Motorola 68HC11 MCU

Qacer

Platinum Member
Apr 5, 2001
2,721
1
91
Hi all,

I'm using a Motorola 68HC11 microcontroller. My board is made by Axiom --
model #CME11E9-EVBU. I'm having a problem with a code of mine.

It's suppose to output a string of characters to the screen. My problem is
that whenever I push and pull data from the stack it will only display parts
of the string. However, if I take out the PSH and PUL mnemonics it works.
Why is that?

Thanks in advance!

Here's my code:


PUTCHAR EQU $E466 Built-in subroutine for printing char on screen
GETCHAR EQU $E459 Built-in subroutine for getting keystrokes

ORG $0100 Staring memory location

PSHA Storing the contents of ACCA into the stack
PSHY Storing the contents of REG Y into the stack

LDY #STRTXT Load the starting address of STRTXT into REG Y
JSR LOOPX Call subroutine LOOPX
LDY #TESTXT Load the starting address of TESTXT into REG Y
JSR LOOPX Call subroutine LOOPX

LOOPX LDAA 0,Y Load ACCA with data in REG Y's location
CMPA #$04 Compare ACCA with EOF char
BEQ DONE If equal branch to DONE
JSR PUTCHAR Call built-in subroutine PUTCHAR
INY Increment REG Y
BRA LOOPX Branch to LOOPX
DONE RTS End of subroutine

PULY Pull contents of REG Y from the stack
PULA Pull contents of ACCA from the stack

END

STRTXT FCC 'THISMCU ' Assign STRTXT with specified string
FCB $04 Add EOF character
TESTXT FCC 'TEST123 ' Assign STRTXT with specified string
FCB $04 Add EOF character
RMB 2 Reserve Memory Byte?