Updated BASIC and KERNAL disassembly

Basic and Machine Language

Moderator: Moderators

User avatar
srowe
Vic 20 Scientist
Posts: 1325
Joined: Mon Jun 16, 2014 3:19 pm

Updated BASIC and KERNAL disassembly

Post by srowe »

I've been meaning to post my copy of Lee Davidson's commented ROM disassembly, here it is.

The main changes are to replace the LAB_xxxx labels with their common equivalents, e.g. LAB_FFD2 with CHROUT. I've used the 'Programmer's Ref Guide' and also 'Computes Mapping the VIC'. For some labels I've invented something appropriate.

I find this invaluable when writing assembly programs, hopefully others will too. Updates or corrections are welcome.
Attachments
combined_ROMs.zip
(105.71 KiB) Downloaded 165 times
User avatar
pixel
Vic 20 Scientist
Posts: 1329
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: Updated BASIC and KERNAL disassembly

Post by pixel »

This is a revelation compared to the old version. Thanks a lot!
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
srowe
Vic 20 Scientist
Posts: 1325
Joined: Mon Jun 16, 2014 3:19 pm

Re: Updated BASIC and KERNAL disassembly

Post by srowe »

Glad you think it's an improvement. I think Lee did a tremendous job with his commentary, I've learnt a lot from reading it.

I notice that the C-64 equivalent is hosted on GitHub, would people prefer me to put it up like that?
randolph.pickle
Vic 20 Amateur
Posts: 55
Joined: Thu Nov 27, 2014 10:50 am

Re: Updated BASIC and KERNAL disassembly

Post by randolph.pickle »

This is awesome. Thanks for taking the time to make and post it :D.
User avatar
srowe
Vic 20 Scientist
Posts: 1325
Joined: Mon Jun 16, 2014 3:19 pm

Re: Updated BASIC and KERNAL disassembly

Post by srowe »

I forgot to include the makefile I use to compile and verify that it is byte identical to the original ROMs. I can provide that if it's useful to anyone. It also generates a list of equates that I then include in programs I write.
ajordison
Vic 20 Enthusiast
Posts: 179
Joined: Fri Mar 19, 2010 4:31 pm
Website: http://www.ajordison.co.uk/
Location: Hartlepool, UK
Occupation: Software Engineer

Re: Updated BASIC and KERNAL disassembly

Post by ajordison »

srowe wrote:I can provide that if it's useful to anyone.
That would be really useful, it would be a great reference to test my assembler.
Try out CBM prg Studio over at www.ajordison.co.uk
User avatar
pixel
Vic 20 Scientist
Posts: 1329
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: Updated BASIC and KERNAL disassembly

Post by pixel »

srowe wrote:Glad you think it's an improvement. I think Lee did a tremendous job with his commentary, I've learnt a lot from reading it.
No doubt about that! No wonder he didn't go through the trouble of naming the labels. It must have been quite exhausting already.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
srowe
Vic 20 Scientist
Posts: 1325
Joined: Mon Jun 16, 2014 3:19 pm

Re: Updated BASIC and KERNAL disassembly

Post by srowe »

ajordison wrote: That would be really useful, it would be a great reference to test my assembler.
Here's a new zip file with the Makefile and the generated include file.
Attachments
combined_ROMs.zip
(111.85 KiB) Downloaded 139 times
User avatar
pixel
Vic 20 Scientist
Posts: 1329
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: Updated BASIC and KERNAL disassembly

Post by pixel »

A thing that just occurred to me is that if the labels would end with a colon it'd be easier to navigate around with text searches. But the way you've done it, it could be converted easily with sed (the UN*X tool).
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
srowe
Vic 20 Scientist
Posts: 1325
Joined: Mon Jun 16, 2014 3:19 pm

Re: Updated BASIC and KERNAL disassembly

Post by srowe »

ctags can handle 6502 assembly, works fine with the file as it is.
User avatar
majikeyric
Vic 20 Afficionado
Posts: 349
Joined: Fri Oct 24, 2014 2:08 pm
Website: http://majikeyric.free.fr
Location: France

Re: Updated BASIC and KERNAL disassembly

Post by majikeyric »

Thank you very much :)
User avatar
pixel
Vic 20 Scientist
Posts: 1329
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: Updated BASIC and KERNAL disassembly

Post by pixel »

Is it OK to put the definitions file into Bender (which is MIT licensed)?

BTW I noticed that assigned labels like

Code: Select all

USRPPOK = $00
didn't make it into `combined_ROMs.inc'.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
srowe
Vic 20 Scientist
Posts: 1325
Joined: Mon Jun 16, 2014 3:19 pm

Re: Updated BASIC and KERNAL disassembly

Post by srowe »

pixel wrote:Is it OK to put the definitions file into Bender (which is MIT licensed)?
Sure, I can hardly claim copyright on them, they're either the public names from the Prog Ref or scavenged from other books.
BTW I noticed that assigned labels like

Code: Select all

USRPPOK = $00
didn't make it into `combined_ROMs.inc'.
Odd, they are in the zipfile I made

Code: Select all

[srowe@gilraen temp]$ unzip ../combined_ROMs.zip
Archive:  ../combined_ROMs.zip
  inflating: combined_ROMs.asm       
  inflating: Makefile                
  inflating: combined_ROMs.inc       
[srowe@gilraen temp]$ head combined_ROMs.inc
    FAC_EXPT = $0000
     USRPPOK = $0000
      ADDPRC = $0001
   ER_2MANYF = $0001
    FAC_MANT = $0001
    ER_FOPEN = $0002
      ADRAY1 = $0003
 ER_FNOTOPEN = $0003
  ER_FNOTFND = $0004
      ADRAY2 = $0005
[srowe@gilraen temp]$ 
User avatar
pixel
Vic 20 Scientist
Posts: 1329
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: Updated BASIC and KERNAL disassembly

Post by pixel »

srowe wrote:Sure, I can hardly claim copyright on them, they're either the public names from the Prog Ref or scavenged from other books.
BTW I noticed that assigned labels like

Code: Select all

USRPPOK = $00
didn't make it into `combined_ROMs.inc'.
Odd, they are in the zipfile I made
Sweet. Will put it in with reference to your work, of course. Will trim my finger nails and get new contact lenses.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
e5frog
Vic 20 Nerd
Posts: 551
Joined: Sat Feb 17, 2007 5:46 pm
Website: http://channelf.se
Location: Sweden
Occupation: Service Engineer

Re: Updated BASIC and KERNAL disassembly

Post by e5frog »

Can't really find the right spot when I want to know what JSR $FFxx is pointing to for example. All addresses are replaced by "elite-labels".
My other interest: http://channelf.se
Post Reply