Akalabeth Preamble Files

27 thoughts
last posted March 30, 2014, 10:53 p.m.

13 earlier thoughts

0

It might be helpful to rewrite this in pseudocode with variables replacing the 8-bit and 16-bit values stored on the zero-page.

Let's name the "variables" stored at each zero-page locations as follows:

  • $FE = b1
  • $FF = b2
  • $06/$07 = w1
  • $08/$09 = w2
  • $F9 = b3
  • $FA/$FB = w3
  • $FC/$FD = w4

Then the initial run of the code looks something like this:

b1 = 0x20
b2 = 0x20
Y = 0
b3 = 0
w3 = 0
w4 = 0
do:
    w1 = b1 * 0x100 + 0
    w1 += b3
    w1 += w3
    w1 += w4
    w2 = w1 + b2 * 0x100
    mem[w1 + Y] = 0
    w4 += 0x400
until w4 == 0x2000

This sets

$2000
$2400
$2800
$2c00
$3000
$3400
$3800
$3c00

to $#00.

13 later thoughts