1 ;; program to test RDOFF production and linkage
3 ;; items to test include:
4 ;; [1] relocation within the same segment in each module
5 ;; [2] relocation to different segments in same module
6 ;; [3] relocation to same segment in different module
7 ;; [4] relocation to different segment in different module
8 ;; [5] relative relocation to same module
9 ;; [6] relative relocation to different module
10 ;; [7] correct generation of BSS addresses
16 mov ax,localdata
; [2] (16 bit) => 66 b8 0000
17 mov eax,localdata2
; [2] (32 bit) => b8 0000000a
21 mov eax,[_fardata
] ; [4] => a1 00000000 (+20)
22 mov cx,next
; [1] => 66 b9 0012
24 call localproc
; [5] => e8 00000019
27 mov eax,_farproc
; [3] => b8 00000000 (+40+0)
28 call _farproc
; [6] => e8 -$ (-0+40+0) (=1f)
30 mov eax,localbss
; [7] => b8 00000000
33 _term: xor ax,ax ; => 66 31 c0
35 jmp _term
; => e9 -0a (=fffffff6)
42 call localproc
; [5] => e8 -$ (-0+0+?) (=-6=fffffffa)
47 localdata: db 'localdata',0
48 localdata2: db 'localdata2',0
49 farref: dd _fardata
; [3] => 0 (+20)
50 localref: dd _main
; [2] => 0 (+0)
53 localbss: resw
4 ; reserve 8 bytes BSS