Home | History | Annotate | Download | only in tests
      1 keybuf equ 0040h:001Eh
      2 
      3 absolute 5000h
      4 label:
      5 
      6 section .text
      7 absval equ 1000h
      8 
      9 org 0x100
     10 ; Using seg should yield the segment part.
     11 mov ax, seg keybuf
     12 mov ax, seg (0040h:001Eh)	; NASM doesn't understand this syntax
     13 mov es, ax
     14 
     15 ; Use without seg should yield just the offset part.
     16 mov bx, keybuf
     17 ;mov bx, 0040h:001Eh		; Illegal
     18 
     19 ; Each of the below pairs should be equivalent (and legal) in Yasm.
     20 ; There are some differences from NASM here!
     21 
     22 ; Defaults to near jump (on both NASM and Yasm)
     23 jmp keybuf
     24 
     25 ; Direct far jump.
     26 jmp 0040h:001Eh
     27 
     28 ; Force near (non-far) jump (just offset, no segment).
     29 jmp near keybuf
     30 jmp near 0040h:001Eh	; Illegal in NASM ("mismatch in operand sizes")
     31 
     32 ; A couple of jumps to "normal" absolute addresses.
     33 jmp 0x1e
     34 jmp 0
     35 jmp absval
     36 jmp label
     37 
     38 ; Non-absolute jump
     39 label2:
     40 jmp label2
     41 
     42 ; Non-relative access
     43 mov ax, [0]
     44 mov ax, [label]
     45 
     46 ; Direct far, explicitly.
     47 jmp far keybuf		; Illegal in NASM ("value referenced by FAR is not relocatable")
     48 jmp far 0040h:001Eh	; Illegal in NASM ("mismatch in operand sizes")
     49 
     50 keybufptr:
     51 dw keybuf	; offset part
     52 dw seg keybuf	; segment part
     53 
     54