41 MCODE - Debugger
|
06-07-2016, 08:47 PM
Post: #1
|
|||
|
|||
41 MCODE - Debugger
If you're into MCODE development, my debugger from 1986 might come in handy. Recently resurrected from HP-IL cassette tape and saved to a Mac courtesy of Clonix NoV-64 and suitably tweaked to work with that module, the DEBUG function in this module allows you to:
In the manual you will find a worked example of how to drive the debugger. I'd recommend you follow that through before you try anything adventurous. Note that the module must be placed in a RAM/Q-ROM page which can be modified such as a within an RSU or Clonix module. I tested it in 1986 with an ERAMCO RSU (which sadly I sold) and this week with the Clonix NoV-64. Note also that the module modifies itself in order to preserve as much of the CPU state as possible, so the ROM checksum is only valid when the module is first loaded and before any MCODE is executed or breakpoints set. If you want to use the breakpoint function the code under test must also reside in a RAM/Q-ROM, otherwise it cannot be modified to break out back to the debugger. If you just want to set up the CPU, run a genuine ROM MCODE routine through to a RTN and then look at the CPU state you can do that. There are a few more limitations which are explained in the manual. In addition bank switching is not specifically supported (there were't many modules in 1986 that did this and the RSU I had didn't support it so I never implemented anything specific for it). I've had to modify the code to support NoV-64 and your mileage may vary with all of the other variants of HP-41, RSU devices, emulators, etc. that are available now. Back up your HP-41 before use if you are worried about keeping user RAM. If you find a problem, let me know but without your hardware or emulator it will be difficult to fix the code. The module is pretty packed full - I struggled to find space to add a NOP after each WROM (WRIT S&X) instruction in order to make the debugger work with NoV-64. This debugger was part of my final year project that I did for my Computer Science degree and being a poor student at the time I had no printer, so the only copy of the source code is an A4 folder of handwritten code. I've just scanned this, so if you'd really like to see how it all works, drop me a note and I'll make it available (minus the tweaks for Clonix support which would involve rewriting quite a few pages). |
|||
06-08-2016, 05:45 AM
(This post was last modified: 06-08-2016 06:03 AM by Ángel Martin.)
Post: #2
|
|||
|
|||
RE: 41 MCODE - Debugger
What a remarkable addition to the 41 legacy! So glad to see a real powerhouse MCODER back into the limelight. Many thanks for sharing your work, I'm sure it's going to be a pleasure to delve into it and put it to work. Ah, and nice opening splash too ;-)
"To live or die by your own sword one must first learn to wield it aptly." |
|||
06-08-2016, 06:18 AM
Post: #3
|
|||
|
|||
RE: 41 MCODE - Debugger
Hi Mark
Thank you for this great "hacker" tools!! I will "play" with it. Best Regards Tobie |
|||
06-08-2016, 03:08 PM
Post: #4
|
|||
|
|||
RE: 41 MCODE - Debugger
Hey 41 Mcoders,
When we were doing the HP-41 PPC ROM an HP employee Mcoder was interested. He didn't want to join PPC and pay for a ROM so i struck an (unofficial) agreement for him to write a few short Mcode routines. When he did and we loaded them they didn't work. I wonder if they could be written today. The routine was a tone generator with an input of frequency and duration. X < > Y, Richard |
|||
06-08-2016, 07:35 PM
Post: #5
|
|||
|
|||
RE: 41 MCODE - Debugger
(06-08-2016 03:08 PM)richardjnelson Wrote: I wonder if they could be written today. The routine was a tone generator with an input of frequency and duration. There are at least three versions that I'm aware of tone generator functions. The first one was included in the SV-ROM but it's a little unstable. The second is TONEZ, in Doug Wilder's BLDROM. The third is TONEXY, written by Nelson F. Crowle if I'm not wrong. All use the same inputs for frequency and duration in X,Y registers - or the other way round, but the same concept nonetheless. Just for fun I used TONEXY on the 41Z module to provide an audible signal on the complex results, using the real part for frequency and the imaginary for duration. "To live or die by your own sword one must first learn to wield it aptly." |
|||
06-08-2016, 09:01 PM
Post: #6
|
|||
|
|||
RE: 41 MCODE - Debugger
Thank you for all the comments. As the source code might be interesting to a few people I've loaded it onto hpcc.org in all its handwritten glory:
Please note that this is the original code, prior to tweaking it to work with Clonix. The Clonix meant adding a NOP after every WROM instruction in order to allow the device to have time to write to ROM/RAM and because I hadn't left spare bytes lying about I've had to use 3 byte port independent GOSUBs out to little blocks of code containing a few instructions. Consequently the code is now a lot messier than it was when I wrote the notes 30 years ago (I can't believe it was that long ago). The subroutine WRC1 (Write Class 1 Instruction to ROM) is now different as I realised I only ever write NC GO xxxx or NC XQ xxxx, never the Carry variants, so I deleted the code for this and put the extra NOP in. I was interested in the comments about TONEXY. I have another ROM which has that contains all sorts of things I was playing with way back in the 1980s and 1990s. It includes a MCODE metronome, which was published in Datafile V9N4P19, and a MCODE routine which plays a tune from a ROM. It sounds terribly out of tune now. Whether it always was or this is some effect of now running it in a CX and Clonix+HEPAX module I'm not quite sure. I'll drag the ROM off tape but in the meantime you can inspect the PLAY source code. I've a few more ancient artefacts lying around which I should now be able to get off tape now that I've mastered the process. Keep calm and carry on debugging. |
|||
06-08-2016, 10:22 PM
Post: #7
|
|||
|
|||
RE: 41 MCODE - Debugger
(06-08-2016 09:01 PM)Mark Power Wrote: Keep calm and carry on debugging. Great sign-off!! I've seen source code distributed in many non-text formats (e.g. Angel's Excel-based code sounds odd, until you examine it closely, then it's beauty and functionality is revealed) but don't think I've seen PDF source files before. I initially thought it may be a simple way to protect the code from casual copying, but then I looked at it, and it's history was instantly revealed. Thanks for saving it for so long and sharing it here. --Bob Prosperi |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)