still new to this and still learning
still lack of knowledge using gui turbo assembler
can someone help me with this problem? thankss
.MODEL SMALL
.stack 100h
sys_exit equ 1
sys_read equ 3
sys_write equ 4
stdin equ 0
stdout equ 1
.data
.code
start:
msg1 db “enter a number: “, len1 equ $- msg1
msg2 db "enter a number: ", len2 equ $- msg2
msg3 db "the sum is ", len3 equ $- msg3
num1 resb 2
num2 resb 2
res resb 1
.bss
section .text
global_start
mov eax,sys_write
mov ebx,stdout
mov ecx,msg1
mov edx,len1
int 21h
mov eax,sys_read
mov ebx,stdin
mov ecx,num1
mov edx,2
int 21h
mov eax,sys_write
mov ebx stdout
mov ecx,msg2
mov edx,len2
int 21h
mov eax,sys_read
mov ebx,stdin
mov ecx,num2
mov edx,2
int 21h
mov eax,sys_write
moc ebx,stdout
mov ecx,msg3
mov edx,len3
int 21h
mov eax,[num1]
sub eax,'0'
mov ebx, [num2]
sub ebx,'0'
add eax,ebx
add eax,'0'
mov [res],eax
mov eax,sys_write
mov ebx,stdout
mov ecx,res
mov edx,1
int 21h
exit:
mov eax,sys_exit
xor ebx,ebx
int 21h
New contributor
lowkee3i is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.