taylorza / zxn-inlineasm-doc

Documentation repository for the NextBASIC Inline Assembler
6 stars 0 forks source link

Inline assembler and debugging #5

Closed Dotneteer closed 5 months ago

Dotneteer commented 5 months ago

Hi Chris,

Thank you for your excellent work! Have you tried your inline assembler with the ZX Spectrum Next's built-in hardware emulator? I did not manage to stop the execution at the breakpoints set up with the NMI menu. For example, when running your "Hello, World" example with a breakpoint set to bank $00 and offset $0000 (the $c000 physical address when running the code), the hardware debugger does not stop at the specified address.

Istvan

taylorza commented 5 months ago

Hi Istavan,

I just tested and it worked fine on my KS2 with NextOS 2.09. Check 2 things

  1. Ensure the breakpoint has not been disabled (there should be an 'e' on the left of the break point address)
  2. After assembling the code, check the break point again and then execute the code separately with RANDOMIZE USR ($c000)

Note: the assembler does not interact with the debugger, it assembles code into memory that you can then call. It should not be impacting the debugger in any way.

BUT, you can force a break point directly in your code using the NBRK pseudo op code. Just put that in the code where you want it to break and it will trigger the hardware debugger. On the emulator (CSpect) you can use BRK

Regards, Chris

Dotneteer commented 5 months ago

Hi Chris,

Thanks for your help; now I can debug with the inline assembler.

Istvan