home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CBM Funet Archive
/
cbm-funet-archive-2003.iso
/
cbm
/
c128
/
programming
/
weehack128.lnx
/
weehack.txt.seq
< prev
Wrap
Text File
|
1999-08-02
|
3KB
|
78 lines
Instructions for Monitor Hack
Wee Hack 128
Commands available:
b t 0 dl dp dr R
With this hack, you can now set breakpoints in the regular monitor.
A breakpoint is a point in code at which a BRK is set. This is
like STOP in BASIC. It lets you stop, and check out how your code
has fared in its desired operation. You can set one breakpoint.
To do this, just move your cursor along your disassembled code, and
press B on that line where you want your breakpoint set. It makes a
beep. Done.
Now of course, you execute your code, before that point, with the G
command. When it gets to the breakpoint, it is unset.
If before then, you wanted to unset your breakpoint, there is a
command that will do this. Type 0.
Capital R is a reset command. If something goes awry in a program, this
might help (not guaranteed of course). Principally video reset. Also,
whenever you type R it sets the processor to 2 Mhz operation. Just
something I wanted.
This hack also provides a little alteration to the D command.
Additional parameters are featured. In the midst of disassembling, you
can use one called DL [Length in bytes]. For example, DL50 will
disassemble 50 (hex) bytes from the current point.
Another parameter is DP. P here stands for Program Counter. It
disassembles from the Program Counter. Another is DR. This
disassembles a routine. If you find a JSR in code, cursor to it, and
type DR. A slight variation occurs if you type DR on a blank line. In
this case, the "main" routine is disassembled. How does it decide this?
Well, it takes the last object code you loaded, and disassembles from
the beginning.
That's about it for commands. Now, for clarity, I might as well add
some notes. Naturally, if you're going to use BRK commands to Stop
at points in your code, you don't really want the typical operation
of the BRK monitor response. It retrieves the program counter as
PC+2. Not good. So, this hack does make it so we are left at PC.
It only corrects it when we come out of a breakpoint.
Don't know if you've ever noticed, but the built-in C128 monitor
has a bug. This appears in the BRK return code. Suppose that you
are in some bank, like oh say bank 0, while code executes. It Brks
out. Guess what? Now the monitor reports that it left from code
executing in bank 15! It reports the bank wrong. Well, this hack
fixes that error.
Last command is T. This is actually just the same B command. But
with a twist. It sets a breakpoint for you. It takes the current
PC, locates the instruction after that, and puts the breakpoint
there. Also, it then executes G for you.
This allows you a semblance of a Tracing operation. For this, you
would want to add a Key definition really. The boot file for this hack
adds one for F7.
Before you start, identify the starting point for execution like
this. For disassembly, locate the point to start. Cursor up to
it, hit ';' TAB ':'. Now you can proceed.
For things like branch instructions, it can not really follow your
code. It does not proceed. So you must set a breakpoint yourself
in that case, using B, wherever it belongs. Because of facts like
this: Semblance is the key word.
Hope you like the hack.
Run the BASIC loader "wee hack" to install.
--