この操作を浮動小数点で行う小さな nasm プログラムを作成しようとしています
while(input <= 10^5) do
begin
input = input * 10
i = i - 1
end
nasmの同等のプログラムは次のとおりです
section .data
input: resd 1
n10: dd 0x41200000 ; 10
_start:
mov eax, 0x43480000 ; eax = 200
mov dword [input], eax ; input = eax = 200
mov edx, 0x49742400 ; 10^5
; %begin
mov ecx, 0 ; i = 0
jmp alpha
alpha:
cmp [input], edx ; input <= 10^5
jle _while
jmp log2
_while:
fld dword [input] ; input
fmul dword [n10] ; input * 10
fst dword [input] ; input = input
dec ecx ; i = i - 1
jmp alpha
_while
ループは無限に繰り返されます
ecx / i
gards は常に同じvalue = 0
(0 に設定されている) であり、デクリメントしません。