🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.asm.x86
Article #152

Re: gas and gcc

#152
From: Frank Kotler
Date: Sat, 24 Nov 2001 12:55
43 lines
2083 bytes
Martin Cote wrote:

> extern write_char(char);
> ----------------------------------
> ..globl write_char
> 
> write_char:
>  pushl %ebp
>  movl  %esp,%ebp

push ebx

>  movl  $4,%eax
>  xorl  %ebx,%ebx
>  incl  %ebx
>  movl  4(%esp),%ecx
>  movl  %ecx,char
>  leal  char,%ecx
>  xorl  %edx,%edx
>  incl  %edx
>  int   $0x80

pop ebx

>  leave
>  ret
> 
> char: .byte 0,0,0,0
> ----------------------------------
> 
> And the C main :
> 
> ----------------------------------
> extern write_char(char);
> 
> int main() {
>   write_char(97);
>   return 0;
> }
> ----------------------------------

Best,
Frank
Technical Details
Message-ID: <3BFF9471.D31E7D98@ne.mediaone.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!news.crayne.org!clax86!robomod!not-for-mail
References: <3BFDF24B.9E4D2F05@videotron.ca>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114917,c50bd0ec38019abd
X-Google-Attributes: gid114917,public
X-Google-Thread: f65d0,c50bd0ec38019abd
X-Google-Attributes: gidf65d0,public
X-Google-Thread: f7d8d,c50bd0ec38019abd
X-Google-Attributes: gidf7d8d,public
X-Google-ArrivalTime: 2001-11-24 05:57:54 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!news.crayne.org!clax86!robomod!not-for-mail
From: Frank Kotler <fbkotler@ne.mediaone.net>
Newsgroups: comp.lang.asm.x86,alt.lang.asm,gnu.gcc
Subject: Re: gas and gcc
Approved: CLAX86 Moderators <ccrayne@crayne.org>
Date: Sat, 24 Nov 2001 12:55:58 +0000 (UTC)
Organization: N
Message-ID: <3BFF9471.D31E7D98@ne.mediaone.net>
Sender: clax86@odin.asgard
References: <3BFDF24B.9E4D2F05@videotron.ca>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-CLAX86-Policy: http://www.pacificsites.com/~ccrayne/clax86.html
X-CLAX86-Faq: http://www2.dgsys.com/~raymoon/x86faqs.html
X-CLAX86-Info-1: Send submissions to             comp-lang-asm-x86@moderators.isc.org
X-CLAX86-Info-2: Send technical complaints to    ccrayne@crayne.org
X-CLAX86-Info-3: Send complaints about policy to ccrayne@crayne.org
X-Comment: moderators do not necessarily agree or disagree with this article.
X-Accept-Language: en
X-Complaints-To: newsabuse@supernews.com
Lines: 44