Building Go + asm code

I need to find a reasonable doc ( btw, I did search google but not much complete info ) or if some one can help me on this –

  1. How could I build a go and an asm file under linux or osx.

  2. Need to know what as it is invoking? Is it the native go assembler? If so, then are the source included in the src trunk? If not then I would assume GAS is being invoked !

  3. Also if there is a fairly complete doc on Go assembly lang. I found rob pike’s old doc, but not much I could use. For example, I see instructions ( while I was on lldb) like LCC 4(PC). It is a jump and what it is checking in eflags register? The short manual says, the instructions are more like 68000 family, but don’t find a reference of it. On intel it is a class of jump instructions, almost 50 or 60 of them.

Thanks,
Prokash

  1. How could I build a go and an asm file under linux or osx.

The go tool does it for you as long as the .s files are in the same package. Check out the math/big and bytes packages for good examples.

  1. Need to know what as it is invoking? Is it the native go assembler? If so, then are the source included in the src trunk? If not then I would assume GAS is being invoked !

This is Go style assembler, it is assembled by go tool asm automatically.

  1. Also if there is a fairly complete doc on Go assembly lang. I found rob pike’s old doc, but not much I could use. For example, I see instructions ( while I was on lldb) like LCC 4(PC). It is a jump and what it is checking in eflags register? The short manual says, the instructions are more like 68000 family, but don’t find a reference of it. On intel it is a class of jump instructions, almost 50 or 60 of them.

Nope sorry, that’s the best there is. The way most of us figured it out is by reading the various .s files dotted around the std library.

Thanks much,

I tried - go tool compile -S some.s, complains about package not found. I think I must be making some mistakes.

OK, I will look thru the places you jotted down here.

Prokash

You want go tool asm some.s.

Ah, thanks much. Also I need to figure out what JCC 4(PC) is comparing before jumping 4 bytes up in the inst. stream from current prog counter.

Prokash

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.