James_Parsons:
I agree with Garth that you need to provide more information before you can expect an answer to your post. Like Garth, I have no idea which simulator you are using, what assembler syntax that simulator accepts, or even if the simulator emulates a UART and console, and the address to which you write the contents is the transmit register of that emulated UART.
On an unrelated topic, I followed the link you provided to your web site. If you don't mind, I'm going to comment on one of them.
Code:
START LDAA #0A
LOOP DECA
CMPA #00
BEQ DONE
BNE LOOP
DONE RTS
In your count down example, I believe that you have correctly implemented the subprogram. That is, you load accumulator A with 10 (LDAA #0A), and the loop decrements that accumulator by 1 in each pass through the loop, and exits when the value in the accumulator reaches a value of zero.
However, you are not making effective use of the processor. First, if you'll refer to the
MC6800 Programmer's Reference Manual, the decrement accumulator A instruction (DECA) modifies the processor arithmetic status flags. It modifies the N (negative), the V (oVerflow), and the Z (Zero) flags. It does not modify the C (Carry) flag. What this means for your program is that the Compare Accumulator A with immediate value 0 (CMPA #0) instruction is not required. Second, you really only need one of the two conditional branch instructions, the second one - BNE LOOP.
Thus, you can simplify and improve your subprogram in the following manner:
Code:
START LDAA #0A
LOOP DECA
BNE LOOP
DONE RTS