My solution was that the inline assembler is a kind of sub-interpreter, invoked by the main interpreter whenever it encounters a '.' (dot) symbol as the first non-whitespace character. This means 128 tokens maximum - which is fine for BASIC, but as there are at least 56 mnemonics in the 6502, I wouldn't be able to treat them as normal tokens. The interpreter stores all keywords as tokens to speed up execution and tokens are identified by bit 7 being set in the code. I am quite pleased with how I ended up slotting this in to the interpreter. This now means I have a lot of power when I need it - for example being able to run off interrupts. It's actually a bit of a pain on an 8 bit only CPU! After that I could code the filesystem timestamp handling - both to set and get the time. Then came the low level software - OS routines to get and set the time (plus checking if the clock it ok on boot up). The actual biggest pain is the CPU interface - the DS12887 is not directly compatible with the 6502 bus signals, but again after a lot of research, I managed to find the right configuration. the solution I learnt from research is that some clever folks found that one can cut away the packaging to expose hidden pins that give access to the battery power terminals - and then hack on a button battery such as a CR2032! The problem is that these units have a built-in battery and they eventually die. I decided to use a period part from the day, the Dallas DS12887 which was found on most PCs in the early-mid 80s. After using the filesystem for a while it becomes obvious that one needs the timestamp on files. I wasn't that bothered about adding a realtime clock until I had got to being 'almost complete' with the FAT16 handling. The most recent update is about the real-time clock. I will try to keep this section of the hackaday site going with short updates for any interested folks.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |