128 MLM Disassembly - with Comments

Started by XmikeX, January 12, 2011, 08:39 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

XmikeX

Disassembly of C-128 ML Monitor with Comments
Code Comments/"re-sourcing" almost exclusively by Commodore 128 Internals - The Authoritative Insiders' Guide
         by Abacus Software / K. Gerits, J. Schieb, and F. Thrun

Section Comments from Mapping the 128 (of course)
         by Compute! Books / Otis R. Cowper


Compilation of this text and minor edits as follows, by XmikeX - 11 Jan 2011 (REVISION 01)
   - addition(s)
      Actual code listing(s) copied from VICE x128 v2.2xxxx, utilizing final NTSC 128DCR ROMset
      Instructions revealed by ROM but not listed in 'Internals'
         . fb02a  85 08    sta $08
         . fb662  f0 13    beq $b677
      Expanded Mnemonic Encoding Summary
      Some Table comments from a very-sparse disassembly of Supermon

   - correction(s)
      . fb0d4  bd fc b0 lda $b0fc,x   Monitor routine (Low) Address   -- original text: "Monitor routine (hi) addr."

   - grammar/legibility
      Expansion of some contractions, acronyms, and shorthand verbiage.

   - trickery using 24, 2C BIT as 'skip byte', 'skip word' 'instructions' noted in comments:
      . fb233  2c         Skip to $B236
      . fb7c8  24         Skip to $B7CA
      . fb87d  24         Skip to $B87F
      . fb9ae  24         Skip to $B9B0 (RTS)
      . fb9ae  24         Skip to $B9B0 (RTS)

Available here --> http://starbase.globalpc.net/~xmx/C128-MLM_Commented_Disassembly.txt
........or as a Notepad-Friendly .txt file attached to this forum post.

XmX

PS: Thanks to Fungus for confirming that 24 / 2C can be used as SKB/SKW

Hydrophilic

Thanks for sharing!  I enjoyed reading the comments to compare with my own.  I noticed some mistakes in the comments (by the authors), and it was nice of you to actually put in the missing lines (and note they were missing).

I don't have C128 Internals (umm, I guess I could try Bombjack), but I do have C1571 Internals.  Their disassembly is always of dubious quality.  If you thought my comments of the code at $b687 were bad, take a look at theirs!  Anyway, those Abacus books are a good start if you have no clue what's going on.
I'm kupo for kupo nuts!

XmikeX

Quote from: Hydrophilic on January 12, 2011, 11:42 PM
I don't have C128 Internals (umm, I guess I could try Bombjack), but I do have C1571 Internals.  Their disassembly is always of dubious quality.  If you thought my comments of the code at $b687 were bad, take a look at theirs!
Haven't really looked at your disassembly yet, because the stuff is delivered in nanoprint (courtesy browser and forum) and I need to unlazy: copy/paste to offline editor, or whatever.

Quote from: Hydrophilic on January 12, 2011, 11:42 PM
Anyway, those Abacus books are a good start if you have no clue what's going on.
Indeed. Good start for many. =)

XmX

BigDumbDinosaur

BTW, the authors of C-128 Internals were not Abacus employees.  Abacus was merely the North American publisher of the book, which was actually an English translation of the original Data Becker book published in (then) West Germany.  The translation was also done by Data Becker, which may explain some of the errors that crept in.
x86?  We ain't got no x86.  We don't need no stinking x86!

BigDumbDinosaur

#4
Quote from: XmikeX on January 12, 2011, 08:39 PM$B003  JMONBRK
Monitor break entry point; jumps to 45065/$B009, which enters the monitor with the current program counter, bank, and microprocessor A, X, and Y register values preserved. The monitor is normally called via this entry point whenever a BRK opcode is executed because the Kernal RESTOR routine [$E056], part of the RESET sequence, initializes the CBINV vector at 790-791/$0316-$0317 to point here. CBINV determines where control is passed after a BRK.
The highlighted comment is not entirely correct.  The "bank" is actually the MMU configuration mask that was pushed on to the stack at the beginning of the IRQ/BRK handler.  It doesn't necessarily relate to a bank as defined in the kernel ROM.
x86?  We ain't got no x86.  We don't need no stinking x86!

airship

Quote from: XmikeX on January 13, 2011, 11:08 AM
Haven't really looked at your disassembly yet, because the stuff is delivered in nanoprint (courtesy browser and forum) and I need to unlazy: copy/paste to offline editor, or whatever.
If you're running Firefox, Ctrl/= will increase the display text size, and Ctrl/- will reduce it. You have the same options in the View/Zoom menu. I assume Explorer, Opera, Chrome, etc. have similar controls.
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

Hydrophilic

Quote from: BigDumbDinosaur on January 13, 2011, 03:39 PM
BTW, the authors of C-128 Internals were not Abacus employees.  Abacus was merely the North American publisher of the book, which was actually an English translation of the original Data Becker book published in (then) West Germany.  The translation was also done by Data Becker, which may explain some of the errors that crept in.
Among other things, I noticed the book seemed to be written for the PAL / International machines.  Thanks for explaining that.  It may be why I never saw the book here in the US.  I sure would have bought it if I saw it.

I also got the BASIC 7.0 Internals from Bombjack, and have been doing some comparison of their disassembly comments with my own.  The funny thing is the chapter with the disassembly starts with a comment about how long it is and how much work it took -- and I agree, from personal experience.  28 kiByte of ROM doesn't sound like much, especially in this day and age, but if you try reverse engineering it, it takes FOREVER.  I think I've worked off-and-on with the BASIC ROM disassembly for about 3 years now... and it still isn't 100% complete!
I'm kupo for kupo nuts!

BigDumbDinosaur

Quote from: Hydrophilic on January 14, 2011, 11:16 AM
Quote from: BigDumbDinosaur on January 13, 2011, 03:39 PM
BTW, the authors of C-128 Internals were not Abacus employees.  Abacus was merely the North American publisher of the book, which was actually an English translation of the original Data Becker book published in (then) West Germany.  The translation was also done by Data Becker, which may explain some of the errors that crept in.
Among other things, I noticed the book seemed to be written for the PAL / International machines.  Thanks for explaining that.  It may be why I never saw the book here in the US.  I sure would have bought it if I saw it.

I also got the BASIC 7.0 Internals from Bombjack, and have been doing some comparison of their disassembly comments with my own.  The funny thing is the chapter with the disassembly starts with a comment about how long it is and how much work it took -- and I agree, from personal experience.  28 kiByte of ROM doesn't sound like much, especially in this day and age, but if you try reverse engineering it, it takes FOREVER.  I think I've worked off-and-on with the BASIC ROM disassembly for about 3 years now... and it still isn't 100% complete!
BASIC 7.0 Internals was also a Data Becker book.  Keep in mind that those books were done in 1985, which means the diassemblies don't reflect the 1986 ROMs.
x86?  We ain't got no x86.  We don't need no stinking x86!

orinoco

Sorry for being off topic, but here in germany Data Becker was "famous" for publications full of mistakes and bugs. This together with translation errors should be kept in mind. Just for the record...
?FORMULA TOO COMPLEX ERROR IN 10
READY.
â–ˆ

wte

Quote from: orinoco on January 16, 2011, 11:24 PM
Sorry for being off topic, but here in germany Data Becker was "famous" for publications full of mistakes and bugs. ...
I can confirm this. These books are "great" bug collections. Unfortunately I payed for this crap.