All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Guilherme Romao" <gui_slack@linuxmail.org>
To: linux-assembly@vger.kernel.org
Subject: RE: Make a Calculator! Help-me
Date: Fri, 18 Apr 2003 10:47:21 +0800	[thread overview]
Message-ID: <20030418024721.11219.qmail@linuxmail.org> (raw)

Hi, this is my source of my calculator:
 How I can to make the addition?  Thank You!

 .file "calculator.s"
.version "01"
gcc2_compiled.:
.section	.data
.msg:
	.string "\t\tCalculator in Assembly\n"
	tam: .long .- .msg
.pede1:
	.string "1 number: "
	tpede1: .long .- .pede1
.pede2:
	.string "2 number: "
	tpede2: .long .- .pede2
.result:
	.string "The result is"
	tresult: .long .- .result
.text
	.align 4
.globl main
	.type main,@function
main:

pushl %ebp		
movl %esp,%ebp		
movl $0x4,%eax		
movl $0x1,%ebx		
movl $.msg,%ecx		
movl tam, %edx		
int $0x80		

movl $0x4,%eax		
movl $0x1,%ebx
movl $.pede1,%ecx
movl tpede1,%edx
int $0x80

movl %esp,%ecx
subl $0xb,%esp

movl $0x3,%eax
movl $0xa,%edx
int $0x80

movl %eax,%edx
pushl %edx
movl %esp,%ebp
movl $0x4,%eax
movl $0x1,%ebx
int $0x80

movl $0x4,%eax
movl $0x1,%ebx
movl $.pede2, %ecx
movl tpede2, %edx
int $0x80


movl %esp,%ecx
subl $0xb,%esp

movl $0x3,%eax
movl $0xa,%edx
int $0x80

movl %eax, %edx
pushl %edx
movl $0x4,%eax
movl $0x1,%ebx
int $0x80

movl $0x4,%eax
movl $0x1,%ebx
movl $.result,%ecx
movl tresult,%edx
int $0x80

subl %ebp,%edx
movl $0x4,%eax
movl $0x1,%ebx

int $0x80

movl $0x1,%eax
movl $0x0,%ebx
int $0x80

.L1:
	leave
	ret
.Lfe1:
	.size main,.Lef1-main
	.ident "my"
	

-- 
______________________________________________
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze

             reply	other threads:[~2003-04-18  2:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-18  2:47 Guilherme Romao [this message]
2003-04-18  9:23 ` Make a Calculator! Help-me hp
2003-04-18  9:36   ` Maciej Hrebien
2003-04-18 22:31 ` hp
  -- strict thread matches above, loose matches on Subject: below --
2003-04-17 15:25 Shenan Hawkins
2003-04-17  6:11 Guilherme Romao
2003-04-17 14:47 ` Stephen Satchell
2003-04-17 16:47 ` hp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030418024721.11219.qmail@linuxmail.org \
    --to=gui_slack@linuxmail.org \
    --cc=linux-assembly@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.