Linux assembly list
 help / color / mirror / Atom feed
* RE: Make a Calculator! Help-me
@ 2003-04-18  2:47 Guilherme Romao
  2003-04-18  9:23 ` hp
  2003-04-18 22:31 ` hp
  0 siblings, 2 replies; 8+ messages in thread
From: Guilherme Romao @ 2003-04-18  2:47 UTC (permalink / raw)
  To: linux-assembly

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

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: Make a Calculator! Help-me
@ 2003-04-17 15:25 Shenan Hawkins
  0 siblings, 0 replies; 8+ messages in thread
From: Shenan Hawkins @ 2003-04-17 15:25 UTC (permalink / raw)
  To: Stephen Satchell, Guilherme Romao, linux-assembly


Amusing! :-)
I wonder if your movie reference got "lost in translation", so to speak.
(given the grammatical state of the initial request)
Guilherme, don't go looking for Luke! Hehe


Shenan


-----Original Message-----
From: Stephen Satchell [mailto:list@fluent2.pyramid.net] 
Sent: Thursday, April 17, 2003 10:48 AM
To: Guilherme Romao; linux-assembly@vger.kernel.org
Subject: Re: Make a Calculator! Help-me


At 02:11 PM 4/17/03 +0800, Guilherme Romao wrote:
>I am new in the language assembly and I would like to understand better

>on
>the recorders, I am trying to make a calculator that reads two numbers
of 
>the keyboard and later addition the two numbers.  Somebody could make
this 
>calculator and pass me the source.  So that I can to study.  Thank you!

Use the Source, Luke.  See bc(1)



--
X -> unknown; Spurt -> drip of water under pressure
Expert -> X-Spurt -> Unknown drip under pressure.

-
To unsubscribe from this list: send the line "unsubscribe
linux-assembly" in the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Make a Calculator! Help-me
@ 2003-04-17  6:11 Guilherme Romao
  2003-04-17 14:47 ` Stephen Satchell
  2003-04-17 16:47 ` hp
  0 siblings, 2 replies; 8+ messages in thread
From: Guilherme Romao @ 2003-04-17  6:11 UTC (permalink / raw)
  To: linux-assembly

I am new in the language assembly and I would like to understand better on the recorders, I am trying to make a calculator that reads two numbers of the keyboard and later addition the two numbers.  Somebody could make this calculator and pass me the source.  So that I can to study.  Thank you!
-- 
______________________________________________
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr

Powered by Outblaze

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-04-18 22:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-18  2:47 Make a Calculator! Help-me Guilherme Romao
2003-04-18  9:23 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox