diff --git a/apps/at28w/main.asm b/apps/at28w/main.asm index a483a1c..050dc1c 100644 --- a/apps/at28w/main.asm +++ b/apps/at28w/main.asm @@ -22,13 +22,15 @@ at28wMain: .db 0b111, 0b101, 0 at28wInner: - ld hl, (AT28W_MAXBYTES) - ld b, h - ld c, l + ; Reminder: words in parseArgs aren't little endian. High byte is first. + ld a, (AT28W_MAXBYTES) + ld b, a + ld a, (AT28W_MAXBYTES+1) + ld c, a ld hl, AT28W_MEMSTART call at28wBCZero jr nz, .loop - ; BC is zero, default to 0x2000 (8x, the size of the AT28) + ; BC is zero, default to 0x2000 (8k, the size of the AT28) ld bc, 0x2000 .loop: call blkGetC diff --git a/recipes/rc2014/eeprom/glue.asm b/recipes/rc2014/eeprom/glue.asm index c38f4ec..5c4412d 100644 --- a/recipes/rc2014/eeprom/glue.asm +++ b/recipes/rc2014/eeprom/glue.asm @@ -64,10 +64,10 @@ init: a28wCmd: .db "a28w", 0b011, 0b001, 0 ld a, (hl) - ld (AT28W_MAXBYTES+1), a + ld (AT28W_MAXBYTES), a inc hl ld a, (hl) - ld (AT28W_MAXBYTES), a + ld (AT28W_MAXBYTES+1), a jp at28wInner