0

数値を加算および減算するアセンブリ電卓を作成していますが、コードが特定のポイントでハングし、ハングしている理由がよくわかりません。

これがプロセスです(完全には完了しておらず、手順を実行しようとしているだけです):

ADDER PROC
CALL NUM1
XOR CX, CX  ;CX resetting
MOV CX, 10  ;set CX to 10
MOV DL, 10  ;multiplier of number(x * 10^n)
moveend:
LODSB       ;here i move the index to the end and sub 1 from it to be on the     last character
CMP AL, '0' 
JNE moveend     
SUB SI, 1d  
MOV AL, [SI]   
MOV BL, AL  ;moving al to bl(this will contain the whole number)
puttogether:
DEC SI      ;si decreasing
CMP SI, 0
JB veg ;jumps to end, and print if si is before the first character
MOV AL, [SI]
IMUL DL     ;multiply with 10^n
ADD BL, AL  ;BL contains the number so far
XOR AX, AX      ;increasing DL to 10^(n+1)
MOV AL, DL  ;
XOR DX, DX  ;
IMUL CX     ;
MOV DL, AL  ;
XOR AX, AX  ;
JMP puttogether 
veg:
MOV AX, BX
int 21h
RET
ADDER ENDP
4

0 に答える 0