why is this not printing

[b][red]This message was edited by Seijuro_Hiko at 2003-10-11 8:22:3[/red][/b][hr]
I want to print out the sum after they are added together, but it's not printing. Can someone show me where the mistake is??

[code]
section .data

big db "Too Big", 0xA
blen equ $ - big

section .bss

chr resb 2
sum resw 1
num resw 1

section .text

global main

main:

mov ax, 0
mov [sum], ax

begin:

mov eax, 3
mov ebx, 0
mov ecx, chr
mov edx, 2
int 0x80

cmp byte [chr], 0x30
jb e1
cmp byte [chr], 0x39
ja e1

mov ax, [sum]
imul ax, 10
mov bx, 0
mov bl, [chr]
sub bl, 0x30
add ax, bx
mov [sum], ax
jmp begin

e1:
cmp word [sum], 50
jb e3
mov ecx, sum
mov edx, 1
jmp e2

e3:
mov ecx, sum
mov edx, 2

e2:
mov eax, 4
mov ebx, 1
int 0x80

mov eax, 1
mov ebx, 0
int 0x80
[/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories