Slob
Experienced Member
There aren’t all that many 8008 programs, so here is a new one. You put in a date >= 01-JAN-1800 <= 31-DEC-9999 and it tells you the day of the week for that date. Not all that interesting, but I was fascinated by the poem “Monday’s Child” when I was a kid. Naturally, I was born on a Saturday… doomed at birth to be dull but hardworking. The program fits in 2K and has bitbanged serial I/O at 2400 baud at the nominal 8008 clock speed, 500 kHz. The bitbanged parts are from Jim Loos’ code, but this can easily be modified for parallel or UART type I/O. Be careful not to use -any other registers- than are shown in those bitbanged procedures.
No effort whatsoever was made in optimization or cleanup. The math parts (16 bit unsigned addition, 16 bit unsigned subtraction, 16 bit unsigned division) were done with the help of the free version of Chat GPT a few months ago, which is or at least was not very good at 8008 coding. But I eventually beat it into submission and got it to work, possibly with as much effort that it would have taken to do it myself. The division routine certainly could have been looped to save a lot of code space, but it might be a good example of “brute force” coding time/space tradeoffs because looping would undoubtedly involve storing and loading more temporary data and division would be less RAM/ROM, but slower. How much? IDK.
I am planning to modify this program into a universal calendar type program, where it will print out the calendar for the years 1800-9999 on demand.
I realize that my use of ChatGPT for assistance may be controversial. I should have done those by myself, but I wanted to try out ChatGPT. Anyway, it does work, and if you want to improve it, please do!
I don’t think ChatGPT (free version) of several months ago is even close to something like Claude Code of today. Where the version that I used fell down was in:
1. Old vs. new mnemonics, and on top of that it would occasionally use 8080 features
2. Inability to handle running out of registers
3. Didn’t seem to learn from mistakes very well (we would go three steps forward, then one back).
No effort whatsoever was made in optimization or cleanup. The math parts (16 bit unsigned addition, 16 bit unsigned subtraction, 16 bit unsigned division) were done with the help of the free version of Chat GPT a few months ago, which is or at least was not very good at 8008 coding. But I eventually beat it into submission and got it to work, possibly with as much effort that it would have taken to do it myself. The division routine certainly could have been looped to save a lot of code space, but it might be a good example of “brute force” coding time/space tradeoffs because looping would undoubtedly involve storing and loading more temporary data and division would be less RAM/ROM, but slower. How much? IDK.
I am planning to modify this program into a universal calendar type program, where it will print out the calendar for the years 1800-9999 on demand.
I realize that my use of ChatGPT for assistance may be controversial. I should have done those by myself, but I wanted to try out ChatGPT. Anyway, it does work, and if you want to improve it, please do!
I don’t think ChatGPT (free version) of several months ago is even close to something like Claude Code of today. Where the version that I used fell down was in:
1. Old vs. new mnemonics, and on top of that it would occasionally use 8080 features
2. Inability to handle running out of registers
3. Didn’t seem to learn from mistakes very well (we would go three steps forward, then one back).