I have fixed the memory copy routines. They now function as they should. I had an intermediate version which wouldn't copy just one byte, but I thought about it before I posted and fixed it properly.
This was the original routine:
Code:
;Copies a block of memory
;Disturbs A and Y
;Expects the source start address in $00 and $01, the destination start address in $02 and $03, and the offset to the end byte in Y
MEMCPY:
LDA ($00),Y
STA ($02),Y
DEY
BMI MEMCPY
RTS
This would only copy the high half of a page, if I fed it $FF in Y. Quite why I did this, I don't know. I can only assume I got confused or sidetracked, as this clearly is not going to do what I want.
I've changed it to this:
Code:
MEMCPY:
LDA ($00),Y
STA ($02),Y
DEY
CPY #$FF
BNE MEMCPY ;loop until Y=$FF(one less than $00)
RTS
This will now copy a whole page if I give it $FF, and just the one byte if $00. Now that I can grab chunks of data and drop them into an EEPROM, I can start on a filesystem.
I've come up with a basic sort of spec for one, but if there's already one that's not going to need much space overhead, I might use that instead. A modified version of the Minix FS looks like it might work well(I don't plan to boot from these things, so I can probably toss out the boot block). I do think it's a good idea to use existing formats when possible(and sensible), rather than building a custom thing that won't be compatible and might not be as well-designed.