致力于对浮点堆栈进行操作:
fld qword [perResult] ;load st0 with perimeter
fsub qword [firstSide] ;take st0 and minus firstSide, st0= perimeter - firstSide
fmul qword [perResult] ;take st0 and multiply by perimeter, st0 = difference of first equation * perimeter
fstp qword [res1] ;take the result off of st0 and place them into variable equation1
;setting up to take perimeter minus second side
fld qword [perResult] ;load up perimeter into st0
fsub qword [secondSide] ;take st0 and minus secondSide, st0 = perimeter - secondSide
fstp qword [eq2]
出于某种原因,如果我注释掉得到的方程eq2
,我将在前面的方程中得到正确的输出得到res1
,
但如果我不加注释等式 2,我将得到 a0
作为输出
下一个方程也是一样的,如果在前一个方程之后有一个函数,出于某种原因,它会将其归零。
以前有人遇到过这个问题吗?
这是打印功能
mov rdi, areaMsg
call print_string
xor r14,r14
movsd xmm0, [eq2] ;move sumResult into xmm0 for printing
mov qword rax, 1
mov r14, [eq2] ;move result into r14 register for printing float
call print_float
call print_nl
jmp Decision