Compare commits

...

5 commits

Author SHA1 Message Date
Michael Steil
2dbb9351f9 c64mem: typo 2020-05-16 10:17:03 +02:00
Michael Steil
6abcb00859 c64mem: misc fixes 2020-05-15 21:57:00 +02:00
Michael Steil
8818175fc7 updated README 2020-05-15 18:25:51 +02:00
Michael Steil
4ee7cc89d5 changed link to GitHub 2020-05-15 15:33:47 +02:00
Michael Steil
64336000b1 c64disasm: linking zp/var symbols 2020-05-15 15:01:23 +02:00
7 changed files with 72 additions and 96 deletions

View file

@ -1,71 +1,31 @@
# Ultimate Commodore 64 BASIC & KERNAL ROM Disassembly
# Ultimate Commodore 64 Reference
This project maintains six commented disassemblies of the C64 ROM (BASIC and KERNAL), five in English and one in German.
This project collects C64 reference material in a machine readable format and maintains a set of scripts to present these on the web.
The txt files are the parsable master versions that can be used to create more rich representations.
The most current web version can be found at [pagetable.com/c64disasm](http://pagetable.com/c64disasm).
## c64disasm_ms.txt
* KERNAL & BASIC ROM Disassembly
* [original Microsoft BASIC source](c64disasm/c64disasm_ms.txt)
* [original Commodore KERNAL source](c64disasm/c64disasm_cbm.txt)
* [disassembly by Lee Davison](c64disasm/c64disasm_en.txt)
* [BASIC disassembly by Bob Sander-Cederlof](c64disasm/c64disasm_sc.txt)
* [disassembly from Commodore-64-intern-Buch](c64disasm/c64disasm_de.txt) (German)
* [disassembly by Magnus Nyman](c64disasm/c64disasm_mn.txt)
* [disassembly by Marko Mäkelä](c64disasm/c64disasm_mm.txt)
* Memory Map
* ["Mapping the Commodore 64" by Sheldon Leemon](c64mem/c64mem_mapc64.txt)
* ["Memory Map mit Wandervorschlägen" by Dr. H. Hauck](c64mem/c64mem_64er.txt) (German)
* ["Commodore-64-intern-Buch"](c64mem/c64mem_64intern.txt) (German)
* [reference by Joe Forster/STA](c64mem/c64mem_sta.txt)
* [comments in the original Microsoft & Commodore Source](c64mem/c64mem_src.txt)
* ["C64 Programmer's Reference Guide"](c64mem/c64mem_prg.txt)
* ["64map"](c64mem/c64mem_64map.txt)
* [reference by Jim Butterfield](c64mem/c64mem_jb.txt)
This is CBMBASIC only. The comments have been taken from
## Credits
*Microsoft's original BASIC for M6502 source, [pagetable.com/?p=774](http://www.pagetable.com/?p=774)*
Converted and formatted by Michael Steil <mist64@mac.com>
## c64disasm_cbm.txt
This is KERNAL only. The comments have been taken from
*The original C64 KERNAL source by Commodore (901227-03), [pagetable.com/?p=894](http://www.pagetable.com/?p=894), [github.com/mist64/cbmsrc](https://github.com/mist64/cbmsrc)*
Converted and formatted by Michael Steil <mist64@mac.com>
## c64disasm_en.txt
The comments have been taken from
*The almost completely commented C64 ROM disassembly. V1.01 Lee Davison 2012*
Converted and formatted by Michael Steil <mist64@mac.com>
## c64disasm_sc.txt
This is CBMBASIC only. The comments have been taken from
*Bob Sander-Cederlof: S-C DocuMentor for Applesoft, [txbobsc.com/scsc/scdocumentor](http://www.txbobsc.com/scsc/scdocumentor/)*
Converted and adapted from Applesoft to CBMBASIC, as well as formatted by Michael Steil <mist64@mac.com>
## c64disasm_de.txt
The comments have been taken from
*Baloui, Said. Das neue Commodore-64-intern-Buch. Düsseldorf: Data-Becker, 1990. ISBN 3890113079*
OCRed and formatted by Michael Steil <mist64@mac.com>
## c64disasm_mn.txt
The comments have been taken from
*JIFFYDOS version 6.01/version 6.02 by Magnus Nyman (Harlekin/FairLight)*
Converted and formatted by Michael Steil <mist64@mac.com>
## c64disasm_mm.txt
The comments have been taken from
*Commodore 64 BASIC/KERNAL ROM Disassembly Version 1.0 (June 1994), by Marko Mäkelä*
Converted and formatted by Michael Steil <mist64@mac.com>
## Side-by-side HTML version
combine.py creates a cross-referenced HTML from all commentaries.
The most current version can be found at [pagetable.com/c64disasm](http://pagetable.com/c64disasm)
The files have been collected, converted, formatted and edited by [Michael Steil](mailto:mist64@mac.com).
## Contributing
Corrections (typos as well as content), translations etc. welcome.
Extensions, corrections (typos as well as content), translations etc. welcome.

View file

@ -35,7 +35,7 @@ descriptions = [
"Comments from the <i>Commodore 64 BASIC/KERNAL ROM Disassembly Version 1.0 (June 1994)</i> by Marko M&auml;kel&auml;."
]
def cross_reference(string):
def cross_reference(string, symbols):
hex_numbers = re.findall(r'(?<!#)\$[0-9A-F][0-9A-F]+', string)
for hex_number in hex_numbers:
dec_number = int(hex_number[1:], 16)
@ -43,6 +43,10 @@ def cross_reference(string):
string = string.replace(hex_number, "<a href=\"../c64mem/#" + '{:04X}'.format(dec_number) + "\">" + hex_number + "</a>")
elif (dec_number >= 0xa000 and dec_number <= 0xbfff) or (dec_number >= 0xe000 and dec_number <= 0xffff):
string = string.replace(hex_number, "<a href=\"#" + hex_number[1:] + "\">" + hex_number + "</a>")
for symbol in symbols:
string = re.sub('\\b' + symbol + '\\b', '<a href="../c64mem/#' + symbol + '">' + symbol + '</a>', string)
return string
asm_donor_index = 1
@ -53,6 +57,16 @@ revision = f.read()
f = os.popen("git log -1 --date=short --pretty=format:%cd .")
date = f.read()
symbols = []
symbol_lines = [line.rstrip() for line in open('../c64mem/c64mem_src.txt')]
for line in symbol_lines:
if line.startswith('#') or line.startswith('-'):
continue
symbol = line[13:19].rstrip()
if symbol != '':
symbols.append(symbol)
symbols = set(symbols)
data = []
linenumber = []
address = []
@ -79,7 +93,7 @@ for i in range(0, files):
print('<meta http-equiv="Content-type" content="text/html; charset=utf-8" />')
print('<html>')
print('<head>')
print('<title>Ultimate Commodore 64 BASIC & KERNAL ROM Disassembly</title>')
print('<title>BASIC & KERNAL ROM Disassembly | Ultimate C64 Reference</title>')
print('')
print('<script language="javascript">')
print(' window.onload = init;')
@ -107,7 +121,7 @@ print(' }')
print(' }')
print('</script>')
print('')
print('<link rel="stylesheet" href="../c64disasm/style.css">')
print('<link rel="stylesheet" href="../style.css">')
print('<style type="text/css">')
print('')
print('h3 {')
@ -136,7 +150,7 @@ print('</head>')
print('<body>')
# http://tholman.com/github-corners/
print('<a href="https://github.com/mist64/c64disasm" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:var(--main-color); color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>')
print('<a href="https://github.com/mist64/c64ref" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:var(--main-color); color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>')
print('<div class="topnav">')
print(' <h1>Ultimate Commodore 64 Reference</h1> ')
@ -148,9 +162,9 @@ print(' <a href="../c64mem/">Memory Map</a><!-- c64mem/ -->')
print('</div>')
print('<div class="body">')
print('<h1>Ultimate Commodore 64 BASIC & KERNAL ROM Disassembly</h1>')
print('<h1>C64 BASIC & KERNAL ROM Disassembly</h1>')
print('<p><i>by <a href="http://www.pagetable.com/">Michael Steil</a>, <a href="https://github.com/mist64/c64disasm">github.com/mist64/c64disasm</a>. Revision ' + revision + ', ' + date + '</i></p>')
print('<p><i>by <a href="http://www.pagetable.com/">Michael Steil</a>, <a href="https://github.com/mist64/c64ref">github.com/mist64/c64ref</a>. Revision ' + revision + ', ' + date + '</i></p>')
print('<b>This allows you to view different commentaries side-by-side. You can enable/disable individual columns:</b><br/><br/>')
print('<table class="checkbox_table">')
@ -196,7 +210,7 @@ while(True):
asmaddress = int(hexaddress, 16)
has_address = True
asm = cross_reference(asm)
asm = cross_reference(asm, symbols)
print('<tr>')
print('<th class="left_column">')
@ -220,7 +234,7 @@ while(True):
comment = line[32:]
comment = html.escape(comment)
comment = cross_reference(comment)
comment = cross_reference(comment, symbols)
if comment.startswith('***'):
comment = '<h3>' + comment[3:] + '</h3>'

View file

@ -1616,21 +1616,21 @@ $0090 Statusvariable ST
Jedes Bit der Zelle 144 hat eine eigene Bedeutung wie folgt.
| | | Kassette |
|-------|------------|---------------------------------|
| Bit 2 | (Wert 4) | Kurzer Block |
| Bit 3 | (Wert 8) | Langer Block |
| Bit 4 | (Wert 16) | Lesefehler (nicht korrigierbar) |
| Bit 5 | (Wert 32) | Prüfsummenfehler |
| Bit 6 | (Wert 64) | File-Ende |
| Bit 7 | (Wert 128) | Band-Ende |
| Bit | Wert | Kassette |
|-----|------|---------------------------------|
| 2 | 4 | Kurzer Block |
| 3 | 8 | Langer Block |
| 4 | 16 | Lesefehler (nicht korrigierbar) |
| 5 | 32 | Prüfsummenfehler |
| 6 | 64 | File-Ende |
| 7 | 128 | Band-Ende |
| | | Floppy/Drucker |
|-------|------------|---------------------------------|
| Bit 0 | (Wert 1) | Fehler beim Schreiben |
| Bit 1 | (Wert 2) | Fehler beim Lesen |
| Bit 6 | (Wert 64) | Daten-Ende |
| Bit 7 | (Wert 128) | »Device Not Present«-Fehler |
| Bit | Wert | Floppy/Drucker |
|-----|------|---------------------------------|
| 0 | 1 | Fehler beim Schreiben |
| 1 | 2 | Fehler beim Lesen |
| 6 | 64 | Daten-Ende |
| 7 | 128 | »Device Not Present«-Fehler |
Alle nicht aufgeführten Bits sind nicht benutzt.

View file

@ -3150,7 +3150,7 @@ $0313 Unused
$0314-$0315 CINV Vector to IRQ Interrupt Routine
This vector points to the address of the routine that is executed when
an IRQ interrupt occurs (normally 59953 ($FA31)).
an IRQ interrupt occurs (normally 59953 ($EA31)).
At power on, the CIA #1 Timer B is set to cause an IRQ interrupt to
occur every 1/60 second. This vector is set to point to the routine
@ -3201,7 +3201,7 @@ $0316-$0317 CBINV Vector: BRK Instruction Interrupt
initialization routines such as RESTOR, IOINIT and part of CINT, and
then jumps through the BASIC warm start vector at 40962. This is the
same routine that is used when the STOP and RESTORE keys are pressed
simultaneously, and is currently located at 65126 ($Fe66).
simultaneously, and is currently located at 65126 ($FE66).
A machine language monitor program will usually change this vector to
point to the monitor warm start address, so that break points may be

View file

@ -506,7 +506,7 @@ $00D9-$00F2 LDTB1 Line flags+endspace
$00F3-$00F4 USER Screen editor color IP
$00F5-$00F5 KEYTAB Keyscan table indirect
$00F5-$00F6 KEYTAB Keyscan table indirect
$00F7-$00F8 RIBUF RS-232 input buffer pointer

View file

@ -295,7 +295,9 @@ $0090 STATUS Value of ST variable, device status for serial bus and data
* Bit #4: 1 = VERIFY error occurred (only during VERIFY), the file read from the device did not match that in the memory.
* Bit #6: 1 = End of file has been reached.
* Bit #7: 1 = Device is not present.
Datasette bits:
* Bit #2: 1 = Block is too short (shorter than 192 bytes).
* Bit #3: 1 = Block is too long (longer than 192 bytes).
* Bit #4: 1 = Not all bytes read with error during pass 1 could be corrected during pass 2, or a VERIFY error occurred, the file read from the device did not match that in the memory.
@ -766,7 +768,7 @@ $02A1 ENABL Temporary area for saving original value of CIA#2 interrupt
$02A2 CASTON Temporary area for saving original value of CIA#1 timer #1 control register, at memory address $DC0E, during datasette input/output.
$02A3-$02A4 KIKA26 Unknown.
$02A3-$02A4 Unknown.
$02A5 LINTMP Number of line currently being scrolled during scrolling the screen.

View file

@ -57,7 +57,7 @@ def cross_reference(string):
formatted_hex_number = '${:04X}'.format(dec_number)
string = string.replace(hex_number, '<a href="#' + '{:04X}'.format(dec_number) + '">' + formatted_hex_number + '</a>')
elif (dec_number >= 0xa000 and dec_number <= 0xbfff) or (dec_number >= 0xe000 and dec_number <= 0xffff):
string = string.replace(hex_number, '<a href="https://www.pagetable.com/c64disasm/#' + '{:04X}'.format(dec_number) + '">' + hex_number + '</a>')
string = string.replace(hex_number, '<a href="../c64disasm/#' + '{:04X}'.format(dec_number) + '">' + hex_number + '</a>')
return string
@ -90,7 +90,7 @@ for i in range(0, files):
print('<meta http-equiv="Content-type" content="text/html; charset=utf-8" />')
print('<html>')
print('<head>')
print('<title>Ultimate Commodore 64 Memory Map</title>')
print('<title>Memory Map | Ultimate C64 Reference</title>')
print('')
print('<script language="javascript">')
print(' window.onload = init;')
@ -158,7 +158,7 @@ print(' }')
print('</script>')
print('')
print('<link rel="stylesheet" href="../c64disasm/style.css">')
print('<link rel="stylesheet" href="../style.css">')
address_width=6.4
label_width=4
@ -212,7 +212,7 @@ print('</head>')
print('<body>')
# http://tholman.com/github-corners/
print('<a href="https://github.com/mist64/c64disasm" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:var(--main-color); color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>')
print('<a href="https://github.com/mist64/c64ref" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:var(--main-color); color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>')
print('<div class="topnav">')
print(' <h1>Ultimate Commodore 64 Reference</h1> ')
@ -224,9 +224,9 @@ print(' <a class="active" href="../c64mem/">Memory Map</a><!-- c64mem/ -->')
print('</div>')
print('<div class="body">')
print('<h1>Ultimate Commodore 64 Memory Map</h1>')
print('<h1>C64 Memory Map</h1>')
print('<p><i>by <a href="http://www.pagetable.com/">Michael Steil</a>, <a href="https://github.com/mist64/c64disasm">github.com/mist64/c64disasm</a>. Revision ' + revision + ', ' + date + '</i></p>')
print('<p><i>by <a href="http://www.pagetable.com/">Michael Steil</a>, <a href="https://github.com/mist64/c64ref">github.com/mist64/c64ref</a>. Revision ' + revision + ', ' + date + '</i></p>')
print('<b>This allows you to view different commentaries side-by-side. You can enable/disable individual columns:</b><br/><br/>')
print('<table class="checkbox_table">')
@ -334,7 +334,7 @@ while(True):
if len(symbol) == 0:
print('<th class="label_column" style="visibility:hidden;"> </th>')
else:
print('<th class="label_column"> ' + symbol + ' </th>')
print('<th class="label_column">' + symbol + ' <a name="' + symbol + '"/> </th>')
# print decimal
if address1 == last_address1 and address2 == last_address2: