]> wirehaze git hosting - MS-DOS.git/blob - v4.0/src/BIOS/JUMPMAC.INC

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / BIOS / JUMPMAC.INC
1 ;;Rev 3.30 Modification
2 ;
3 ; given a label <lbl> either 2 byte jump to another label <lbl>_J
4 ; if it is near enough or 3 byte jump to <lbl>
5 ;
6
7 jump macro lbl
8 local a
9 .xcref
10
11 ifndef lbl&_j ;; is this the first invocation
12 a:
13 JMP lbl
14 ELSE
15 IF (lbl&_J GE $) OR ($-lbl&_J GT 126)
16 a:
17 JMP lbl ;; is the jump too far away?
18 ELSE
19 a:
20 JMP lbl&_J ;; do the short one...
21 ENDIF
22 ENDIF
23 lbl&_j = a
24 .cref
25 endm
26 .xcref jump
27 ;REDEFINE THE ABOVE MACRO TO ALWAYS TRY A 3 BYTE NEAR JUMP
28 JUMP MACRO LBL
29 JMP LBL
30 ENDM ;;End of Modification
31 \1a