John
John

Reputation: 11

long assembly code problem

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

what's that about? can that help me? thnx!

Upvotes: 0

Views: 278

Answers (1)

ruslik
ruslik

Reputation: 14870

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

Upvotes: 1

Related Questions