|
Post by mirkosoft on Mar 31, 2015 8:19:37 GMT
Hi!
I want to trace program - which line is currently executed. Really in Basic I'm not good, but it can be useful, more useful if it is possible in assembler.
Thank you for every help, reply or comment.
Miro
|
|
|
Post by donno128 on Mar 31, 2015 16:17:08 GMT
TRON
|
|
|
Post by mirkosoft on Mar 31, 2015 21:19:59 GMT
This command I know, but can be output f.e. to variable? Or better to any RAM address?
I know that I can get this address from Basic code of TRON command and its components code, but I have not lot of time.
Miro
|
|
|
Post by hydrophilic on Apr 1, 2015 7:10:11 GMT
TRON is the best method in pure BASIC. If you want to be "hard core" then use assembly trick...
Easy way is with VICE emulator... set break point in VICE/emulator monitor (not the CBM-MONITOR) for address $4aa2... this will create break point before (almost) every BASIC command is executed...
Be aware that address is $4aa2 is the "standard" vector stored at $308/309... if you have custom ROMs, it may be different.
Also important is that some BASIC commands will by "skip" the vector at $308 (and thus miss address $4aa2). This is due to lame hack in ROM relating to THEN and ELSE code... have you ever used a BASIC wedge that will fail with THEN/ELSE (most famous in my mind are SAM and BASIC 8) ? This is due to sloppy ROM code... some good software (like my BASIC 7.80) properly handle the $308 vector...
In other words, with standard ROM, or "good" software (like mine), the $308 vector (default address $4aa2) is a good way to "catch" / "test" BASIC software at a very low-level... but non-standard ROM or lame software may fail...
[Edit] Damn! Forgot to describe "hard" method... call me lazy On real machine, just replace vector $308 to some machine language code to log important info (like line# etc.). Real machine or VICE, just remember that standard ROM will sometimes "cheat" (skip $308) vector... mainly with THEN / ELSE commands of BASIC. Sorry it is true, but I did not write the ROM [/Edit]
|
|