Close

First Programs

A project log for Intel SDK-85 Enhancements

My adventures with an Intel SDK-85

jimshortzjimshortz 09/17/2023 at 18:260 Comments

Next, it was time to get familiar with programming the SDK-85.  As I often do when learning a new language, I decided to do a math problem.  Prime finding is my go-to, but with a 7 segment display I decided to go for something less verbose.  So, Fibonacci sequence it is.

I wrote the code out on lined paper, leaving lots of space for the hex on the left side.  After writing the code I broke out the 8085 reference card and performed the translations.  To the modern reader, this may sound like absolute hell, but these programs are so short (and the instruction set so simple), assembling them takes only a couple of minutes.  That being said, my first attempt to read and write variables from memory used the MOV M,A instruction.  It did NOT work like I expected so I had to spend some quality time with the Intel 8080 Assembly Language Programming Manual to learn how these instructions work.  (Hint: you want LDA/STA, not MOV).

My first version used 8 bit BCD numbers and would produce the numbers up to 99.  I used the FIRST and SECOND variables to contain the N-1 and N-2 values used to generate N.  I used UPDDT to display the number in the data area and RDKEY to wait for user input to move to the next.  Turns out there are only 12 numbers < 99, so this was pretty anticlimactic.

My second version used 16 bit BCD numbers and produced numbers < 9999.  Amazingly, this version was 9 bytes smaller.  It was far easier to use use the BC and DE pairs to hold N-1 and N-2.  XCHG can be used to promote N-2 to N-1, and single byte PUSH and POP instructions preserve the values when ROM calls are made.  The astute reader will notice the use of the semicolon.  That's because I forgot the DAA and didn't want to erase and rewrite half the page.

At this point, I decided to move onto a more "interesting" application and set about creating the Simon game.  Click here for details on that project. 

Discussions