Skip to content

Conversation

@lashtear
Copy link
Contributor

  • Changes to --trace formatting to show flag breakdown and instruction stream
  • Change 0xfff7 and 0xfff8 to print their final trace line before exiting
  • Change to 0xfffe to also trigger halt on read for BRK intercept

if (shouldTrace)
fprintf(stderr, "%04x a:%02x x:%02x y:%02x s: %02x st:%02x\n", pc, a, x,
y, sp, status);
if (shouldTrace){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space before brace

char status_buf[9];
status_buf[8] = '\0';

const char statuses[] = "czidb1vn";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Move these both into the loop right before they're used. Moving them out is the compiler's job :P

* Whitespace
* De-hoist the invariants, make that compiler work for it
Copy link
Member

@mysterymath mysterymath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mysterymath mysterymath merged commit a5206c1 into llvm-mos:main Nov 23, 2025
@lashtear lashtear deleted the mos-sim-trace-ergonomics branch November 23, 2025 23:30
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.

2 participants