0

I'm trying to compile Heaven's Gate:

yasm-1.2.0-win64.exe "Heaven's Gate.asm"

with the code below:

global main
section .text
main:
    bits 32
        db      9ah ;call 33:in64
        dd      offset in64
        dw      33h
        ;32-bit code continues here

    bits 64
    in64:
        gs mov rax, qword [30h] ;gs not fs
        mov rax, qword [rax+60h]
        mov rax, qword [rax+18h]
        mov rax, qword [rax+30h]
        mov rax, qword [rax+10h]

    bits 32
        retf

but YASM tells me:

Heaven's Gate.asm:6: error: undefined symbol `offset' (first use)  
Heaven's Gate.asm:6: error:  (Each undefined symbol is reported only once.)

Isn't offset a keyword? Why am I getting this error?

user541686
  • 205,094
  • 128
  • 528
  • 886

1 Answers1

2

offset is superfluous in yasm/nasm syntax. Remove them, as the label itself stands for its offset.

Jens Björnhager
  • 5,632
  • 3
  • 27
  • 47
  • As for why they have offset in an example clearly targeted for yasm, I don't know. There might have been masm syntax support in earlier versions or something. – Jens Björnhager Jan 26 '12 at 23:34
  • 1
    Probably, yeah. There was also an error with `dword ptr` and such, and removing `ptr` fixed that too. – user541686 Jan 27 '12 at 01:20