Close

Smaller bootloader

A project log for One-instruction TTL Computer

A breadboard-able computer which uses only a single instruction - MOVE

justin-davisJustin Davis 05/30/2017 at 16:590 Comments

Ok, writing code like this is a real pain. I think I need to shorten my bootloader to get it up and running faster. Maybe after I get it going I will expand it. I know with old computers where you had to input the bootloader via switches on the front panel, it was highly desirable to write the shortest possible bootloader. So now my plan is:

  1. Echo characters back to uart (DONE!)
  2. When a key is pressed, put it at string index, and increase string index
  3. Backspace key will decrease string index
  4. Jump to string processing after carriage return entered
  5. 1st character is command (W - write, J - jump) (anything else jumps back to top)
  6. if write then
    1. Next four hexnumbers are the memory address (convert from ASCII)
    2. Last 2 hexnumbers are data to write (convert from ASCII)
  7. if a jump,
    1. Next four hexnumbers are the memory address (convert from ASCII)
    2. set PC to entered memory address (begin executing!)

So this code must be entered with the exact number of characters (5 or 7). Backspace will still work. It will not echo back the string afterward. Once I get this going, then I can enhance it later. Even this is somewhat complicated. But I could write a better bootloader later. That's how it used to be - very simple bootloader to better bootloader to better bootloader.

If I automated sending code, then I could get rid of the ASCII characters, enter it in binary, get rid of the backspace and echoing of characters. So I could streamline this even more, but I think it's ok as is.

Discussions