x86アセンブリでGCDを繰り返し見つけようとしています。どういうわけか、残り = 0 であるため、ループは最初の反復後に終了し続けます。理由はありますか?
;while r > 0 do
; Set b = a
; Set a = r
; Set r = b % a
;Output a
calculation_loop:
cmp remainder, 0 ;check if remainder is 0
je end_of_calc ;if it is, value in intA is GCD
mov ecx, intA ;set b = a
mov intB, ecx
mov ecx, remainder ;set a = r
mov intA, ecx
mov edx, 0 ;clearing remainder
mov ecx, intA ;process remainder and store in variable
div ecx
mov remainder, edx
mov eax, remainder
call WriteInt
call Crlf
jmp calculation_loop
end_of_calc:
call Crlf
mov eax, intA
mov edx, OFFSET outputPrompt
call WriteString
call WriteInt
call Crlf