You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A mirror of the assembler from the Go compiler, with import paths re-written for the assembler to be functional as a standalone library.
License as per the Go project.
Status
Works, but expect to dig into the assembler godoc's to work out what to set different parameters of obj.Prog to get it to generate specific instructions.
Example
Demonstrates assembly of a NOP & an ADD instruction on x86-64.
Instructions are defined as constants in the package for the relavant architecture, and have an 'A' prefix and a size suffix.
For example, the MOV instruction for 64 bits of data is AMOVQ (well, at least in amd64).
Search the go source for usage of a given instruction
For example, if I wanted to work out how to emit the MOV instruction for 64bits, I would search the go source on github for AMOVQ or x86.AMOVQ. Normally, you see find a few examples where the compiler backend fills in a obj.Prog structure, and you follow it's lead.
About
The assembler from the Go compiler, in library form.