Skip to content

Conversation

@ValShaped
Copy link

@ValShaped ValShaped commented Jul 5, 2023

Bug Fixes:

msprobe.py:

  • Default loadaddr was left undefined unless -mc passed

assemble.py:

  • Off-by-one in assembleOneOpInstruction slice index produced incorrect machine code
  • Off-by-one in assembleRegister Indirect Source mode produced invalid register name
  • Numeric jump offsets outside valid range would be accepted
  • Jump offsets without a leading + or - would always be treated as labels since [0-9] is alphanumeric
  • Crash when parsing blank or comment-only lines
  • Invalid register encoding produced by extensionWord type error in AssembleRegister (object is string, not int)

Formatting improvement:

  • Fixed mixed spaces/tabs
  • Fixed trailing whitespace

msprobe.py:
- Default loadaddr was left undefined unless `-mc` passed
assemble.py:
- Off-by-one in OneOp assembly produced incorrect machine code
- Off-by-one in Indirect mode assembly produced invalid register name
- Out-of-range relative jumps produced garbage output
- Replace invalid instruction marker '!!!' with the invalid opcode
- Exit with a cancellation message instead of unwinding stack on SIGINT
- `jnc` = `jlo`
- `jnz` = `jne`
- `jc` = `jhs`
- `jz` = `jeq`
- Remove comments from lines before processing
  - Remove comment-stripping logic from each function
  - Skip empty/comment-only lines
- Use regex to identify relative jump offset number
  - This fixes a bug where jump offset always needed + or  -
- Use regex to split opcode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant