diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2024-08-25 17:53:06 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2024-08-25 17:53:06 -0400 |
| commit | ef89f5a85c590b35910ce89c37a2a8d920e1554e (patch) | |
| tree | 5afb58c82348abcda0c3b8eb2dfa4fa1293b28ee /assemble.go | |
| parent | 843806d7c80bfec8fcea5fae81961fa35c91a804 (diff) | |
Diffstat (limited to 'assemble.go')
| -rwxr-xr-x | assemble.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/assemble.go b/assemble.go index 923fb33..9554080 100755 --- a/assemble.go +++ b/assemble.go @@ -2,7 +2,6 @@ package main import ( "bufio" - "encoding/binary" "fmt" "os" "regexp" @@ -91,10 +90,10 @@ func Encode(inst []string, pc int32) ([]byte, error) { for _, s := range inst { switch s { case "syscall": - binary.NativeEndian.PutUint32(bytes, 12) + byteOrder.PutUint32(bytes, 12) return bytes, nil case "nop": - binary.NativeEndian.PutUint32(bytes, 0) + byteOrder.PutUint32(bytes, 0) return bytes, nil } } @@ -177,7 +176,7 @@ func Encode(inst []string, pc int32) ([]byte, error) { (RegNums[inst[1]] << 16) | (0xFFFF & uint32(imm)) } fmt.Println(inst) - binary.NativeEndian.PutUint32(bytes, ret) + byteOrder.PutUint32(bytes, ret) return bytes, nil } |
