MVI B,01h
MVI C,01h
LDA 2030h
;Suppose the number is located at 2030h
AGAIN: SUB B
JZ LAST
INR B
INR B
INR C
JMP AGAIN
LAST: MOV A,C
STA 2031h
;the square root is stored at 2031h
HLT
MVI C,01h
LDA 2030h
;Suppose the number is located at 2030h
AGAIN: SUB B
JZ LAST
INR B
INR B
INR C
JMP AGAIN
LAST: MOV A,C
STA 2031h
;the square root is stored at 2031h
HLT
No comments:
Post a Comment