Re: Question about jumps
- From: Markus Pitha <ngNOSPAM@xxxxxxxxxx>
- Date: Wed, 30 Aug 2006 14:09:33 +0200
Thanks for the tipps.
As I read in AoA that shifting a byte to the left would multiply the
operand by two, I was in mood to try it out. But unfortunately it didn't
work. I have no clue why, but my following code read a number from stdin,
but doesn't display any output. What's wrong here?
segment .code
msg1 db "Enter a number: ", 0
len1 equ $-msg1
segment .bss
nmbr resb 8
segment .text
global _start
_start:
mov eax, 4 ;write
mov ebx, 1
mov ecx, msg1
mov edx, len1
int 0x80
mov eax, 3 ;read
mov ebx, 0
mov ecx, nmbr
mov edx, 8
int 0x80
mov eax, nmbr
shl eax, 1 ; nmbr * 2
mov ecx, eax ; mov it to ecx
mov eax, 4
mov ebx, 1
mov edx, 8
int 0x80
mov eax, 1 ; sys_exit
mov ebx, 0
int 0x80
.
- Follow-Ups:
- Re: Question about jumps
- From: randyhyde@xxxxxxxxxxxxx
- Re: Question about jumps
- From: Frank Kotler
- Re: Question about jumps
- From: Dragontamer
- Re: Question about jumps
- References:
- Question about jumps
- From: Markus Pitha
- Re: Question about jumps
- From: Evenbit
- Question about jumps
- Prev by Date: HELP: build old DOS game
- Next by Date: Re: HELP: build old DOS game
- Previous by thread: Re: Question about jumps
- Next by thread: Re: Question about jumps
- Index(es):
Relevant Pages
|
|