Skip to content

Commit 98ecc83

Browse files
committed
New references
1 parent 3b856b9 commit 98ecc83

2 files changed

Lines changed: 102 additions & 10 deletions

File tree

0000.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
layout: default
3+
title: 0000 - Zero page
4+
---
5+
# $0000-$00FF
6+
7+
<a name="AC"></a><a name="AD"></a>
8+
9+
## 172-173 $AC-$AD SAL-SAH
10+
### Kernal working address pointer
11+
These locations are used as a pointer to the address of the current
12+
byte to be written to tape or saved to disk, or the address
13+
where the byte read from tape or from a disk boot sector is to
14+
be stored. The Kernal has several routines to service this pointer,
15+
including:
16+
17+
* [$ED51](E000#ED51) load this pointer with the operation starting address in [$C1-$C2](#C1)
18+
* [$EEC1](E000#EEC1) increment the address here
19+
* [$EEB7](E000#EEB7) compare the address here against the operation ending address at [$AE-$AF](#AE)
20+
21+
There is also a routine [$F7CC](E000#F7CC) to retrieve the character at
22+
the pointer address from the bank specified in [$C6](#C6),
23+
and one [$F7BC](E000#F7BC) to store the current accumulator contents at
24+
the pointer address in the bank specified in [$C6](#C6).
25+
26+
<a name="AF"></a>
27+
28+
## 172-175 $AC-$AF
29+
### Work area for disk booting
30+
The Kernal BOOT_CALL routine [$F890](E000#F890) uses locations
31+
$AC-$AD to hold the address at which the contents
32+
of additional boot sectors are to be stored. Location $AE
33+
holds the bank number for the additional data. Location $AF
34+
holds the number of disk sectors to be loaded during the
35+
boot process.
36+
37+
<a name="AE"></a><a name="AF"></a>
38+
39+
## 174-175 $AE-$AF EAL-E AH
40+
### Kernal address pointer
41+
This location is used during the routines which read from or
42+
write to tape, or in saving to disk, to hold the ending address
43+
for the operation. For loading from disk, this location is used
44+
as a working pointer to the address where data is stored. After
45+
all bytes have been loaded, the locations will hold the ending
46+
address.
47+
48+
Actually, in all cases the pointer will hold the address
49+
of the location immediately following the last one involved in the
50+
operation. The Kernal SAVE routine [$F53E](E000#F53E)
51+
initializes these locations with the contents of the X and Y registers
52+
when the routine is called. The Kernal provides a routine
53+
[$F7C9](E000#F7C9) to retrieve the character at the pointer address from
54+
the bank specified in [$C6](#C6), and one [$F7BF](E000#F7BF) to store the
55+
current accumulator contents at the pointer address in the
56+
bank specified in [$C6](#C6).
57+
58+
<a name="FA"></a>
59+
60+
## 250 $FA Unused
61+
This memory location is considered unused in that no Commodore 128 Kernal or BASIC routine deliberately changes it. However, due to a bug in the screen editor CINT [$C07B](C000#C07B) and SWAPPER [$CD2E](C000#CD2E) routines, it is overwritten whenever those routines run.
62+
63+
Since these routines are triggered during the RUN/STOP-RESTORE sequence, any value you store here will be lost whenever you press RUN/STOP-RESTORE or switch screens. For this reason, if you use this location in your programs, it should only serve as temporary working space, not for storing important data that you need to keep in the situations mentioned above.
64+
65+
<a name="FB"></a><a name="FE"></a>
66+
67+
## 251-254 $FB-$FE Unused
68+
These memory locations are not used by any Commodore 128 ROM routines, making them available for your BASIC or machine language programs. They are not affected by the RUN/STOP-RESTORE key combination. However, keep in mind that all zero-page locations, including these, are cleared to zero during a reset—unless the RUN/STOP key is held down while resetting. For more information, refer to the reset routine at [$E000](E000#E000).
69+
70+
<a name="FF"></a>
71+
72+
## 255 $FF
73+
This location is used as part of the assembly area for character
74+
strings representing the digits of numeric values.

E000.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,26 @@ title: $E000-$FFFF - Kernal Rom, Standard Commodore Jump Table
66

77
# Kernal ROM
88

9-
## 65363 $FF53 JBOOT_CALL <a name="FF53"></a>
10-
It's an entry point for the Kernal BOOT_CALL routine at $F890 which attempts to load and execute the boot sector from an auto-boot disk in the given drive and device. The BOOT protocol is as follows:
9+
<a name="F890"></a>
10+
11+
## 63632 $F890 BOOT_CALL
12+
13+
<span class="badge badge-info">Has a jump table entry at [$FF53](#FF53)</span>
14+
15+
<a name="FF53"></a>
16+
17+
## 65363 $FF53 JBOOT_CALL
18+
19+
<span class="badge badge-info">Entry point for the BOOT_CALL routine, currently at [$F890](#F890)</span>
20+
21+
Routine needs parameter to be set:
22+
23+
* .X must hold device number
24+
* .A must hold the character code corresponding to the desidered drive number (for ex. you should use $30 which corresponds to 0)
25+
26+
If the specified drive is not present or turned off, or the disk does not contain valid boot sectors, the routine will return carry bit set.
27+
28+
BOOT_CALL routine at [$F890](#F890) which attempts to load and execute the boot sector from an auto-boot disk in the given drive and device. The BOOT protocol is as follows:
1129

1230
* Close all open files on boot device.
1331
* Read track 1 sector 0 into TBUFFR ($B00).
@@ -55,13 +73,13 @@ $0C -> $00 // no filename
5573
$0D -> // code
5674
$20, $7D, $FF, // JSR $FF7D (JPRIMM)
5775
$0D, $53, $45, $4C, $45, // String start
58-
$43, $54, $20, $4D, $4F,
59-
$44, $45, $3A, $0D, $0D,
60-
$20, $31, $2E, $20, $43,
61-
$36, $34, $20, $20, $42,
62-
$41, $53, $49, $43, $0D,
63-
$20, $32, $2E, $20, $43,
64-
$31, $32, $38, $20, $42,
76+
$43, $54, $20, $4D, $4F,
77+
$44, $45, $3A, $0D, $0D,
78+
$20, $31, $2E, $20, $43,
79+
$36, $34, $20, $20, $42,
80+
$41, $53, $49, $43, $0D,
81+
$20, $32, $2E, $20, $43,
82+
$31, $32, $38, $20, $42,
6583
$41, $53, $49, $43, $0D,
6684
$20, $33, $2E, $20, $43,
6785
$31, $32, $38, $20, $4D,
@@ -74,7 +92,7 @@ $0D -> // code
7492
$EB, $4C, $00, $B0
7593
</pre>
7694

77-
Starting from $0D, the first three bytes stands for
95+
Starting from $0D, the first three bytes stands for
7896

7997
<pre>
8098
JSR $FF7D

0 commit comments

Comments
 (0)