I am trying to write a NASM program to multiply 2 8-bit numbers but i am not getting answers beyond 15. I am a beginner and i really dont its real working... Please help...
section .data
msg1:db "Enter the numbers:"
len1:equ $-msg1
msg2:db "Product is: "
len2:equ $-msg2
section .bss
a:resb 2
b:resb 2
p1:resb 1
p2:resb 1
section .text
global _start
_start:mov eax,4
mov ebx,1
mov ecx,msg1
mov edx,len1
int 80h
mov eax,3
mov ebx,0
mov ecx,a
mov edx,2
int 80h
mov eax,3
mov ebx,0
mov ecx,b
mov edx,2
int 80h
mov eax,4
mov ebx,1
mov ecx,msg2
mov edx,len2
int 80h
clc
mov ecx,4
mov al,[b]
sub al,'0'
mov ah,[a]
sub ah,'0'
shl ah,4
back:mov bl,al
and bl,01h
jz ahead
add al,ah
ahead:ror al,1
loop back
and eax,0000000fh
daa
mov ebp,eax
and eax,000000f0h
shr eax,4
add eax,'0'
mov [p1],eax
mov eax,4
mov ebx,1
mov ecx,p1
mov edx,1
int 80h
mov eax,ebp
and eax,0000000fh
add eax,'0'
mov [p2],eax
mov eax,4
mov ebx,1
mov ecx,p2
mov edx,1
int 80h
mov eax,1
mov ebx,0
int 80h
Most of the code is actually copied. And there is not much found on the internet about NASM programs