For every digit, inumber PUSHes and CALLs once. After the carriage return, it RETurns, then POPs and RETurns repeatedly; this shall return to the initial CALLing procedure on the last RET. This way, no counter is needed. If this strategy did not work, then neither would my function. PS: I...
Thank you, but I have already fixed the error.
;i:cx=base
;o:dx=number
;m:ax,bx,dx
inumber:
xor dx,dx
mov bx,1
mov ah,1
inum:
int 021
cmp al,0d
je crfound
push ax
call inum
pop ax
xor ah,ah
sub al,030
push dx
mul bx
pop dx
add dx,ax
push dx
mov ax,bx
mul cx
mov bx,ax
pop dx
crfound:
ret
I have corrected some errors with the function, but it still works not.
;i:cx=base
;o:dx=number
;m:ax,bx,dx
inumber:
xor dx,dx
mov bx,1
mov ax,030
push ax
mov ah,1
call inum
inum:
int 021
cmp al,0d
je crfound
push ax
call inum
pop ax
xor ah,ah
sub al,030
push dx
mul bx
pop dx
add dx,ax
mov...
I have written a function that allows a user to input an integer in base CX that is stored in DX.
;i:cx=base
;o:dx=number
;m:ax,bx,dx
inumber:
xor dx,dx
mov bx,1
mov ax,030
push ax
inum:
mov ah,1
int 021
cmp al,0d
je crfound
push ax
call inum
crfound:
pop ax
xor ah,ah
sub al,030
push dx
mul bx...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.