2
* Copyright 2021 ByteDance Inc.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
20
`github.com/twitchyliquid64/golang-asm/asm/arch`
21
`github.com/twitchyliquid64/golang-asm/obj`
25
_AC = arch.Set("amd64")
28
func As(op string) obj.As {
29
if ret, ok := _AC.Instructions[op]; ok {
32
panic("invalid instruction: " + op)
36
func Imm(imm int64) obj.Addr {
38
Type : obj.TYPE_CONST,
43
func Reg(reg string) obj.Addr {
44
if ret, ok := _AC.Register[reg]; ok {
45
return obj.Addr{Reg: ret, Type: obj.TYPE_REG}
47
panic("invalid register name: " + reg)
51
func Ptr(reg obj.Addr, offs int64) obj.Addr {
59
func Sib(reg obj.Addr, idx obj.Addr, scale int16, offs int64) obj.Addr {