org 00h
mov r0,#40h
mov a,@r0
mov r1,a
inc r0
mov a,@r0
mov b,a
inc r0
mov a,@r0 ; second number is in a
cjne r1,#00,n1
add a,b
jnc sk
mov b,#1
sk:mov b,#0h
sjmp las
n1:cjne r1,#01,n2
add a,b
sjmp las
n2:cjne r1,#02,n3
mul ab
sjmp las
n3:cjne r1,#03,n4
div ab
sjmp las
n4:mov a,#00h
mov b,#00h
las:mov 43h,a
mov 44h,b
sjmp $
end
Comments
Post a Comment