145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgkeybuf equ 0040h:001Eh 245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgabsolute 5000h 445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orglabel: 545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgsection .text 745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgabsval equ 1000h 845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgorg 0x100 1045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org; Using seg should yield the segment part. 1145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgmov ax, seg keybuf 1245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgmov ax, seg (0040h:001Eh) ; NASM doesn't understand this syntax 1345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgmov es, ax 1445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 1545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org; Use without seg should yield just the offset part. 1645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgmov bx, keybuf 1745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org;mov bx, 0040h:001Eh ; Illegal 1845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 1945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org; Each of the below pairs should be equivalent (and legal) in Yasm. 2045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org; There are some differences from NASM here! 2145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 2245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org; Defaults to near jump (on both NASM and Yasm) 2345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgjmp keybuf 2445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 2545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org; Direct far jump. 2645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgjmp 0040h:001Eh 2745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 2845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org; Force near (non-far) jump (just offset, no segment). 2945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgjmp near keybuf 3045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgjmp near 0040h:001Eh ; Illegal in NASM ("mismatch in operand sizes") 3145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 3245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org; A couple of jumps to "normal" absolute addresses. 3345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgjmp 0x1e 3445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgjmp 0 3545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgjmp absval 3645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgjmp label 3745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 3845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org; Non-absolute jump 3945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orglabel2: 4045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgjmp label2 4145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 4245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org; Non-relative access 4345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgmov ax, [0] 4445afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgmov ax, [label] 4545afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 4645afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org; Direct far, explicitly. 4745afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgjmp far keybuf ; Illegal in NASM ("value referenced by FAR is not relocatable") 4845afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgjmp far 0040h:001Eh ; Illegal in NASM ("mismatch in operand sizes") 4945afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 5045afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgkeybufptr: 5145afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgdw keybuf ; offset part 5245afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.orgdw seg keybuf ; segment part 5345afe016bed87b9c6946184709058b39ede3f77ajwong@chromium.org 54