diff options
author | Astatin <[email protected]> | 2025-06-10 18:27:56 +0200 |
---|---|---|
committer | Astatin <[email protected]> | 2025-06-10 18:27:56 +0200 |
commit | 501b255423d9a08ab5d9765c3feb5bf3a6b7b0af (patch) | |
tree | c2f7573b409bf591dad3302ec6816878842d24d2 /macros.go | |
parent | a7d6e62878245810323787eeb5458e418371b89f (diff) |
Add ASSERT macro + fix label substractions banks + add . for current address
Diffstat (limited to 'macros.go')
-rw-r--r-- | macros.go | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -43,6 +43,31 @@ func NewInstructionSetMacros() InstructionSet { }, } + result[".ASSERT"] = []InstructionParams{ + { + Types: []ParamType{Raw8, Raw8}, + Assembler: func(currentAddress uint32, args []uint32) ([]byte, error) { + if args[0] != args[1] { + return nil, fmt.Errorf("ASSERTION FAILED, %v != %v", args[0], args[1]) + } + return []byte{}, nil + }, + MacroForbidden: false, + SkipFirstPass: true, + }, + { + Types: []ParamType{Raw16, Raw16}, + Assembler: func(currentAddress uint32, args []uint32) ([]byte, error) { + if args[0] != args[1] { + return nil, fmt.Errorf("ASSERTION FAILED, %v != %v", args[0], args[1]) + } + return []byte{}, nil + }, + MacroForbidden: false, + SkipFirstPass: true, + }, + } + result[".DB"] = []InstructionParams{ { Types: []ParamType{Raw8}, |