我在masm32中完全是新手,我想实现在(错误的)代码的以下行中描述的这种想法:
mov ebx,(eax mod any_number)
编译器给我错误A2026:期望的常数
我读到寄存器之间不能使用mod操作,因此哪些方法可以帮助我执行相同的想法?
希望您的帮助。
mov eax, 9 mod 5
或
xor edx, edx mov eax, 9 mov ecx, 5 div ecx
现在edx包含模量
James T. Streib的汇编语言指南:简要介绍],]];result = number % amount
mov eax,number
cdq ;copy or propagate the sign bit into the edx register
idiv amount
mov result,edx ;the remainder in the edx register and the
;quotient in the eax register