addr := &obj.Addr{} addr.Type = obj.TYPE_REG addr.Reg = x86.REG_AX
mov := &obj.Prog{} mov.As = x86.AMOVW mov.To = &obj.Addr{Type: obj.TYPE_REG, Reg: x86.REG_AX} mov.From = &obj.Addr{Type: obj.TYPE_MEM, Reg: x86.REG_SP, Offset: 32}This creates a machine instruction that moves a word from the memory location at SP+32 to the AX register. The memory address is represented by an Addr with TYPE_MEM and Reg is the reference register (in this case SP) and Offset is added to the register value to form the memory address.