* 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-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
1 sibling, 1 reply; 8+ messages in thread
From: hp @ 2003-04-18 9:23 UTC (permalink / raw)
To: Guilherme Romao, linux-assembly
Guilherme Romao am Freitag, 18. April 2003 03:47:
> Hi, this is my source of my calculator:
> How I can to make the addition? Thank You!
is this a GNU program?
"no docs better than a manual page" or any other kind of description...
best,
hp
--
Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml en/de
pse, reply to << lx -at- lxhp -dot- in-berlin -dot- de >>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Make a Calculator! Help-me
2003-04-18 2:47 Make a Calculator! Help-me Guilherme Romao
2003-04-18 9:23 ` hp
@ 2003-04-18 22:31 ` hp
1 sibling, 0 replies; 8+ messages in thread
From: hp @ 2003-04-18 22:31 UTC (permalink / raw)
To: Guilherme Romao, linux-assembly; +Cc: hp
Guilherme Romao am Freitag, 18. April 2003 03:47:
> Hi, this is my source of my calculator:
> How I can to make the addition? Thank You!
honestly, do you expect your readers to analysing your(?) example to be able
to send the appropriate reply? at least, I myself won't bother with anything
meaningless like your(?) piece of asm text.
so, please, add some comments which fully explain what it is supposed to do -
e.g. I won't look for syscall numbers which the linux sources provide by
their rsp names (the numbers may change!); &c.
plus, probably, while doing so you yourself might even better understand what
the concerned program segment does...
the examples which you were asking for are already mentioned or, can be found
in the links page at http://linuxassembly.org
best
hp
>
> .file "calculator.s"
> .version "01"
> gcc2_compiled.:
[...]
--
Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml en/de
pse, reply to << lx -at- lxhp -dot- in-berlin -dot- de >>
^ 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
* Re: 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
1 sibling, 0 replies; 8+ messages in thread
From: Stephen Satchell @ 2003-04-17 14:47 UTC (permalink / raw)
To: Guilherme Romao, linux-assembly
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 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
1 sibling, 0 replies; 8+ messages in thread
From: hp @ 2003-04-17 16:47 UTC (permalink / raw)
To: Guilherme Romao, linux-assembly
Guilherme Romao am Donnerstag, 17. April 2003 07:11:
> 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!
a 'calculator' is a most simple application of the Forth language.
examples (Forth compiler/interpreter sources in assembly):
http://www.lxhp.in-berlin.de/lhpf8.html ('lib4th' ANS-type Forth w. 'nasm')
http://www.lxhp.in-berlin.de/lhpf4.html ('f4' fig-type Forth w. (G)AS)
best,
hp
--
Linux,Assembly,Forth: http://www.lxhp.in-berlin.de/index-lx.shtml en/de
pse, reply to << lx -at- lxhp -dot- in-berlin -dot- de >>
^ 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