Your job is to write assembly code for the hexidecimal program
presented as the first part of lab8. Recall that you typed this
program in and then ran it on the processor. It caused all of the
LEDS in the hexidecimal display to light up one at a time,
repeatedly.
Make a table of
Address Hex value Addressing Mode Assembly Instruction name
------- --------- --------------- -------------------------
and use the instruction table handout to look up the hex opcodes and
find the corresponding instruction. This should help you to
become more familiar with the 6800 instruction set.
You will run into two new things.
1) Another addressing mode, called relative addressing is used, generally
by the branch instructions. In relative addressing, the address
contained in the second byte is added to the Program Counter's (PC's) lowest
8 bits plus 2. The carry or borrow is added to the high 8 bits. This allows
the user to address data within a range of -125 to +129 bytes of the
present instruction.
2) You will see the JSR instruction, used in extended mode. It will
cause a subroutine jump to an address well outside of the program.
These subrountines are responsible to placing the right bit patterns
on the inputs to the LED display (and these bit patterns are also
stored at high address locations in memory). E.g. the very first
3 bytes of the program are BD FC BC. This translates
to JSR FC BC. When the subroutine is finished, it returns to
the next instruction in the program.