[英]Negative numbers in x86 assembly
So, in x86 assembly an if statement in positive number works but i am not sure this works.... I am using the Irvine library so here is the snippet因此,在 x86 程序集中,正数的 if 语句有效,但我不确定这是否有效....我使用的是 Irvine 库,所以这里是片段
.IF xPos <= -117
call UpdatePlayer
dec xPos
call DrawPlayer
jmp gameLoop
.ELSE
jmp gameLoop
.ENDIF
Provided your xPos variable is a dword, use next code:如果您的xPos变量是双字,请使用下一个代码:
.IF SDWORD PTR xPos <= -117
call UpdatePlayer
dec xPos
call DrawPlayer
.ENDIF
jmp gameLoop
You didn't need the .ELSE
clause.您不需要
.ELSE
子句。 Just put jmp gameLoop
outside of the structure.只需将
jmp gameLoop
放在结构之外。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.