forget about the subject of this thread. i deleted the or-
 iginal msg because it's the wrong question i was asking.
 the right question now is:

 @start:
        

 if ($-@start) GE 128
     jmp short @start
 else
     jmp far   @start
 endif

 that work fine. but if the @start label is under that IF state-
 ment, error occures... it seems to me that it only work with l-
 abels that is already defined. but what about labels that defi-
 ned ways AHEAD??? is there anyway around this?

 this won't work:

 if ($-@start) GE 128
     jmp short @start
 else
     jmp far   @start
 endif

 @start: 

 I work with DOS alot so,... I just want to make life easy
 by creating a JUMP macro.

 JUMP macro address
       if ($-address) GE 128
          jmp short @start
       else
          jmp far   @start
       endif
 endm
 ;the code inside the macro might not be right, that's not
 ;important... i'm in a hurry and all i need to know is a
 ;way to calculate the difference of a label that is alre-
 ;ady defined after the JUMP




 

This message was edited by disease_2000, on 5/9/2001 4:59:15 PM
Posted on 2001-05-09 16:53:00 by disease_2000
I've done a lot of DOS with ASM too, and the best answer I know of is to use jmp short somelabel where "somelabel" is a forward reference, and then take out the word "short" (or replace it with "near") if I get the error message "jump out of range". Assemblers and linkers are not too smart, don't you agree? Someday I shall write my own:) Larry
Posted on 2001-05-12 02:49:00 by Larry Hammick