diff options
author | Astatin <[email protected]> | 2025-03-07 23:54:34 +0900 |
---|---|---|
committer | Astatin <[email protected]> | 2025-03-07 23:54:34 +0900 |
commit | 8c60c8cf7acb3563b31d9d17ba1303efe3f0aa39 (patch) | |
tree | 33b15fcd30c9527de21547f6b6cf3943348a6b60 /main.go | |
parent | c2fb41b27cb4294520cd73aa3d81d51d0f969bf8 (diff) |
add high/low paramters modifiers, parameters to macros & print symbols to stdout
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -19,6 +19,12 @@ type ProgramState struct { IsMacro bool } +func printSymbols(labels map[string]uint) { + for key, value := range labels { + fmt.Printf("00:%04x %s\n", value, key) + } +} + func parseFile(inputFileName string, input []byte, offset uint) ([]byte, error) { state := ProgramState{ Labels: make(map[string]uint), @@ -30,6 +36,7 @@ func parseFile(inputFileName string, input []byte, offset uint) ([]byte, error) if err != nil { return nil, err } + printSymbols(state.Labels) return secondPass(inputFileName, input, offset, state) } @@ -159,6 +166,7 @@ func secondPass( line = parts[len(parts)-1] for _, label := range parts[:len(parts)-1] { + label = strings.TrimSpace(strings.ToUpper(label)) if !strings.HasPrefix(label, ".") { labelParts := strings.Split(label, ".") if len(labelParts) < 1 { |