为什么YASM不识别关键字“offset”?

时间:2012-01-26 23:05:51

标签: assembly nasm wow64 yasm

我正在尝试编译Heaven's Gate

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

使用以下代码:

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

但是YASM告诉我:

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

offset不是关键字吗?为什么我会收到此错误?

1 个答案:

答案 0 :(得分:1)

偏移在yasm / nasm语法中是多余的。删除它们,因为标签本身代表其偏移。