Re: Question about jumps



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


.



Relevant Pages