• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1keybuf equ 0040h:001Eh
2
3absolute 5000h
4label:
5
6section .text
7absval equ 1000h
8
9org 0x100
10; Using seg should yield the segment part.
11mov ax, seg keybuf
12mov ax, seg (0040h:001Eh)	; NASM doesn't understand this syntax
13mov es, ax
14
15; Use without seg should yield just the offset part.
16mov 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)
23jmp keybuf
24
25; Direct far jump.
26jmp 0040h:001Eh
27
28; Force near (non-far) jump (just offset, no segment).
29jmp near keybuf
30jmp near 0040h:001Eh	; Illegal in NASM ("mismatch in operand sizes")
31
32; A couple of jumps to "normal" absolute addresses.
33jmp 0x1e
34jmp 0
35jmp absval
36jmp label
37
38; Non-absolute jump
39label2:
40jmp label2
41
42; Non-relative access
43mov ax, [0]
44mov ax, [label]
45
46; Direct far, explicitly.
47jmp far keybuf		; Illegal in NASM ("value referenced by FAR is not relocatable")
48jmp far 0040h:001Eh	; Illegal in NASM ("mismatch in operand sizes")
49
50keybufptr:
51dw keybuf	; offset part
52dw seg keybuf	; segment part
53
54