Skip to content

Commit

Permalink
Debugger works ;)
Browse files Browse the repository at this point in the history
  • Loading branch information
gboncoffee committed Dec 29, 2023
1 parent a3f0f22 commit 4d86c4b
Show file tree
Hide file tree
Showing 5 changed files with 577 additions and 22 deletions.
4 changes: 4 additions & 0 deletions assembler/assembler.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func CreateDebugTokensFixedSize(tokens []Token, size uint64) []DebuggerToken {
var dt []DebuggerToken
addr := uint64(0)
var last_label string
var last_instruction *DebuggerToken

for _, t := range tokens {
switch t.Type {
Expand All @@ -56,6 +57,9 @@ func CreateDebugTokensFixedSize(tokens []Token, size uint64) []DebuggerToken {
})
addr += size
last_label = ""
last_instruction = &dt[len(dt)-1]
case TOKEN_ARG:
last_instruction.Args = last_instruction.Args + " " + t.Value
case TOKEN_LABEL:
last_label = t.Value
case TOKEN_LITERAL:
Expand Down
Loading

0 comments on commit 4d86c4b

Please sign in to comment.