diff --git a/twasm/.bootle/disk b/twasm/.bootle/disk new file mode 100644 index 0000000..189ce17 Binary files /dev/null and b/twasm/.bootle/disk differ diff --git a/twasm/asm/main.asm b/twasm/asm/main.asm index 8cab49e..f6828a9 100644 --- a/twasm/asm/main.asm +++ b/twasm/asm/main.asm @@ -120,7 +120,7 @@ assemble: ; di = next tte call get_opcode ; al = opcode - mov [.pending_operator_opcode], al ; save it fttb + mov [.pending_operator_opcode], al ; save opcode fttb pop rdi pop rax ; from start of label .operator @@ -142,7 +142,11 @@ assemble: ; of 2 args, it could also be the ; last of 1 - ; otherwise, quietly discard the token, reset things, and keep going :/ + ; otherwise, discard the token, reset things, and keep going :/ + push rsi + mov rsi, .warn_unexpected_register + call print.warn + pop rsi call .reset_state jmp .continue_register @@ -192,6 +196,10 @@ assemble: .break: ret + ; constants + + .warn_unexpected_register db "ignoring unexpected register", 0x0A, 0x00 + ; procedures ; al = byte to write @@ -212,11 +220,11 @@ assemble: ret .reset_state: - ; I don't actually know if these `word` and `byte` directives are needed + ; I don't actually know if these `word` directives are needed ; TODO check that. I think they are, becasue Nasm doesn't record the size ; of labels? mov word [.pending_operator_opcode], UNRECOGNISED_TOKEN_ID - mov byte [.pending_operator_num_args], 0x00 + mov [.pending_operator_num_args], 0x00 mov word [.first_argument], UNRECOGNISED_TOKEN_ID ret