开发者

long assembly code problem

开发者 https://www.devze.com 2023-01-31 06:28 出处:网络
I have a programm in assembly but when i add some lines of code it gets confused. for example when i add a new procedure while this procedure works, the whole programm stucks at some point like it doe

I have a programm in assembly but when i add some lines of code it gets confused. for example when i add a new procedure while this procedure works, the whole programm stucks at some point like it doesn't complete the procedure but stays in a specific point.the same happens when i add some commands that doesn't affect the programm, like some mov [300h],00h at the beggining of the code.

any idea how i can resolve this? i have read that jmp command can only jump 128 addresses range. is that true? can i bypass this? i have seen that some procedures has a "near" extension. like

  • test proc near
  • mov al,[0300h]
  • ...
  • ret
  • test endp

what's that about? can that 开发者_Python百科help me? thnx!


First, mov [300h],00h is't something that won't affect the program. It could very well modify your code, so don't do this!

Second, only conditional jumps (Jcc) have this restriction for -128..+127 address range, so if you think that the branch is too far, then instead of

JE some_far_label

use

JNE skip1
jmp some_far_label
skip1:

And if you have some other questions, then please post some code.

EDIT: mov byte [300h], 0 could overwrite your code. If you're using an assembler, then alloc explecitely space for variables:

var1 db 0
0

精彩评论

暂无评论...
验证码 换一张
取 消