Mail Archives: djgpp/2002/04/07/06:00:19
X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f
|
From: | "Jacky Luk" <luckie AT netvigator DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Declaring variables in GAS
|
Date: | Sun, 7 Apr 2002 17:51:19 +0800
|
Organization: | IMS Netvigator
|
Lines: | 67
|
Message-ID: | <a8p52l$qj71648@imsp212.netvigator.com>
|
References: | <a8okc7$n057 AT imsp212 DOT netvigator DOT com>
|
NNTP-Posting-Host: | pcd603107.netvigator.com
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Newsreader: | Microsoft Outlook Express 6.00.2600.0000
|
X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2600.0000
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
This is the first time I get it->
#include <stdio.h>
int main()
{
int foo1 = 100;
printf ("%d\n", foo1);
return 0;
}
and
.file "foo2.c"
gcc2_compiled.:
___gnu_compiled_c:
.text
LC0:
.ascii "%d\12\0"
.p2align 2
.globl _main
_main:
pushl %ebp
movl %esp,%ebp
subl $4,%esp
movl $100,-4(%ebp)
movl -4(%ebp),%eax
pushl %eax
pushl $LC0
call _printf
addl $8,%esp
xorl %eax,%eax
jmp L1
.align 2,0x90
L1:
leave
ret
What if I have this situation?
#include "asmdefs.inc"
.text
.globl start
start:
movb $0x2, %ah
movb $0x1, %al
movb $0x1, %cl
movb $0x0, %dl
movb bootbuffer, %bx <--- how do i load this? if i
don't know the variable
name?
movb .data, %es <--- how do i load this?
int $0x13
movb $0x4c,%ah
int $0x21
.data
.globl bootbuffer .byte 512 dup (0)
- Raw text -