how do I handle ‘cannot reference SB without a symbol’ error with golang Assembly On Windows?

Viewed 103

when I call asm using golang, i countered a problem on Windows.

here is in a cpuid_amd64.go file

func cpuid_low(arg1, arg2 uint32) (eax, ebx, ecx, edx uint32)

and the definition

#include "textflag.h"

// func cpuid_low(arg1, arg2 uint32) (eax, ebx, ecx, edx uint32)
TEXT ·cpuid_low(SB), NOSPLIT, $0-24
    MOVL arg1+0(FP), AX
    MOVL arg2+4(FP), CX
    CPUID
    MOVL AX, eax+8(FP)
    MOVL BX, ebx+12(FP)
    MOVL CX, ecx+16(FP)
    MOVL DX, edx+20(FP)
    RET

on Windows, an error message was reported:

info\cpuidlow_amd64.s:4: cannot reference SB without a symbol
asm: assembly of info\cpuidlow_amd64.s failed

There is an underscore right below the '· 'character, which displays as: identifier expected, got ·

enter image description here

0 Answers
Related