;program for testing cpu on the excalibur boards using the 16x2 altrex LCD display

;Rosemary Francis 2004

start	
	movi r11 1
	lsli r11 12	;r11 = 2^12

	movi r12 1
	lsli r12 15	;r12 = 0x8000 address of display comand reg

	movi r0 56
	st r0 r12	;write to display
	bsr count
	movi r10 0
	
	movi r0 12	
	st r0 r12	;write to display
	bsr count
	movi r10 0

	movi r0 1	
	st r0 r12	;write to display
	bsr count
	movi r10 0
	
	movi r0 6
	st r0 r12	;write to display
	bsr count
	movi r10 0
	
	lsli r0 7	
	st r0 r12	;write to display
	bsr count
	movi r10 0
	
	addi r12 4	;r12 = 0x8004 address of display data reg
	
	lsli r0 6
	addi r0 8	;H
	st r0 r12	;write to display
	bsr count
	movi r10 0
	
	lsli r0 6
	addi r0 5	;E
	st r0 r12	;write to display
	bsr count
	movi r10 0
	
	lsli r0 6
	addi r0 12	;L
	st r0 r12	;write to display
	bsr count
	movi r10 0
	
		
	lsli r0 6
	addi r0 12	;L
	st r0 r12	;write to display
	bsr count
	movi r10 0
	
	lsli r0 6
	addi r0 15	;O
	st r0 r12	;write to display
	bsr count
	movi r10 0

	movi r0 32	;
	st r0 r12	;write to display
	bsr count
	movi r10 0

	lsli r0 6
	addi r0 23	;W
	st r0 r12	;write to display
	bsr count
	movi r10 0

	lsli r0 6
	addi r0 15	;O
	st r0 r12	;write to display
	bsr count
	movi r10 0

	lsli r0 6
	addi r0 18	;R
	st r0 r12	;write to display
	bsr count
	movi r10 0

	lsli r0 6
	addi r0 12	;L
	st r0 r12	;write to display
	bsr count
	movi r10 0

	lsli r0 6
	addi r0 4	;D
	st r0 r12	;write to display
	bsr count
	movi r10 0



	br end
	
count	
	cmp r10 r11	;count to 2^12 to slow stuff down
	ifs cc_ne
	br count
	addi r10 1
	ret
	movi r0 1

end	nop
