All pastes #458707 Raw Edit

6812help

public text v1 · immutable
#458707 ·published 2007-04-26 00:58 UTC
rendered paste body
I am trying to use this loop to print out the word error to a segmented display in the simulation software I am working with.  After the message is print out it is to wait a little then automatically clear the display.  Right now it is erroring out when it trys to load null into a register so that I can compare it to $00 to break out of the loop.  Below is the code in question.  This is for the Freescale 6812.

ErrorMsg 
	   movb #$80,Ln1Cnt Sets counter line 1
	   movb #$C0,Ln2Cnt Sets counter line 2
	   ldy  #ErrMsg
OutMsg   ldaa Ln1Cnt	 ; moves cursor back to 1st line
	   jsr  LCDOutCmd  ; Displays cursor on 1st line
	   ldaa 0,y
	   jsr  LCDOutChar
	   ldaa Ln2Cnt	 ; moves cursor to 2nd line 
	   jsr  LCDOutCmd  ; Displays cursor on 2nd line
	   ldaa 0,y
	   jsr  LCDOutChar
	   inc  Ln2Cnt	 ; Increments line 2 counter
	   inc  Ln1Cnt	 ; Increments line 1 counter
	   ldaa Ln1Cnt	 ; moves cursor back to 1st line
	   jsr  LCDOutCmd  ; Displays cursor on 1st line
	   iny
	   ldaa 0,y
	   cmpa #$00	   
	   bne  OutMsg
	   jsr  LCDWaitLong
	   jsr  Clear
	   rts