delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/08/06/11:46:46

Date: Tue, 6 Aug 1996 11:18:53 +0200 (METDST)
From: Robert Hoehne <robert DOT hoehne AT mathematik DOT tu-chemnitz DOT de>
To: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Testing binutils 2.7
Message-Id: <Pine.HPP.3.91.960806110229.25622A-100000@newton.mathematik.tu-chemnitz.de>
Mime-Version: 1.0

I have tested the following test program to build with the
binutils 2.7 and it works.

---------------------test.c------------------
#include <stdio.h>
unsigned char Tableau[1024L*1024L*16L];

int main(int argc, char * argv[])
{
printf("hello world\n");
return(0);
}

---------------------------------------------

I have tested it also with lage libraries. (I think the
Turbo Vision library, compiled with -g3, which contains
about 16000 symbols and is about 4 MB large).

But I found an other difference between GAS 2.5.2 and
GAS 2.7. I have compiled the above test program with
-S to get the assembler file. Then I have compiled it
with the two assemblers and got the following results:

----------compiled with GAS 2.5.2---------------
GAS LISTING test.s 			page 1


   1              		.file	"test.c"
   2              	gcc2_compiled.:
   3              	___gnu_compiled_c:
   4              	.text
   5              	LC0:
   6 0000 68656C6C 		.ascii "hello world\12\0"
   6      6F20776F 
   6      726C640A 
   6      00
   7 000d 909090   		.align 2
   8              	.globl _main
   9              	_main:
  10 0010 55       		pushl %ebp
  11 0011 89E5     		movl %esp,%ebp
  12 0013 E8E8FFFF 		call ___main
  12      FF
  13 0018 68000000 		pushl $LC0
  13      00
  14 001d E8DEFFFF 		call _printf
  14      FF
  15 0022 31C0     		xorl %eax,%eax
  16 0024 C9       		leave
  17 0025 C3       		ret
  18 0026 9090     	.comm _Tableau,16777216

------------------------------------------------------
------------compiled with GAS 2.7---------------------
GAS LISTING test.s 			page 1


   1              		.file	"test.c"
   2              	gcc2_compiled.:
   3              	___gnu_compiled_c:
   4              	.text
   5              	LC0:
   6 0000 68656C6C 		.ascii "hello world\12\0"
   6      6F20776F 
   6      726C640A 
   6      00
   7 000d 90       		.align 2
   8              	.globl _main
   9              	_main:
  10 000e 55       		pushl %ebp
  11 000f 89E5     		movl %esp,%ebp
  12 0011 E8EAFFFF 		call ___main
  12      FF
  13 0016 68000000 		pushl $LC0
  13      00
  14 001b E8E0FFFF 		call _printf
  14      FF
  15 0020 31C0     		xorl %eax,%eax
  16 0022 C9       		leave
  17 0023 C3       		ret
  18              	.comm _Tableau,16777216

-----------------------------------------------------

As you can see, there is a difference in aligning the code.
Now my question. Which is the correct? What should '.align 2'
mean? (alignment on a 2 byte boundory or on a boundary with
the last 2 bits zero?)

Robert


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019