Forums

Bit manipulation

Started by brizzlejonz March 9, 2006
I am having problems getting this program to download to the hc11.  
the assembler said there is no error in it but it doesn't even load 
unto the HC11, can someone please help me?

ORG #$DD00
PROMPT	
	fcb 27, '[, '2,'J
	fcc /Please press a key/
	fcb 10
	fcc /R/
	fcb 10
	fcc /L/
	fcb 10
	fcc /A/
	fcb 10
	fcc /C/
	fcb 10
	fcc /S/
	fcb 10
	fcc /T/
	fcb 10
	fcc /Your choice please:  /
	fcb 4
VAR 	RMB 1
	OUTLHLF	EQU	$FFB2
OUTRHLF	EQU	$FFB5
OUTCRLF	EQU	$FFC4

OUTSTRG0 EQU 	$FFCA
OUTA 	EQU 	$FFB8
INCHAR EQU $FFCD
INPUT	EQU $FFAC
UCASE	EQU $FFA0

	ORG $C000
	JSR INCHAR
	STAA VAR 

TOP
	LDAA VAR	
	STAA $1402 
	JSR PRBINARY

	LDX #PROMPT
	JSR OUTSTRG0

GET.KEY
	JSR INCHAR
	JSR UCASE

	CMPA #'R
	BEQ GOT.R
	CMPA #'C
	BEQ GOT.C
	CMPA #'S
	BEQ GOT.S
	CMPA #'T
	BEQ GOT.T
	CMPA #'L
	BEQ GOT.L
	CMPA #'A
	BEQ  GOT.A
	
	BRA GET.KEY	
	SWI

GOT.R
	LDAA VAR
	JSR	RAND
	STAA VAR
	BRA TOP
GOT.L	
	LDAA VAR
	LSLA 
	STAA VAR
	BRA TOP

GOT.A	LDAA	VAR
	ASRA
	STAA	VAR
	BRA	TOP
GOT.C
	LDAA VAR
	ANDA #%00010100
	STAA VAR
	BRA TOP

GOT.S
	LDAA VAR
	ORAA #%10010000
	STAA VAR
	BRA TOP
GOT.T
	LDAA VAR
	EORA #%10010000
	STAA VAR
	BRA TOP

PRBINARY
	PSHA
	PSHB
	PSHX
	
	TAB
	JSR	OUTLHLF
	TBA	
	JSR	OUTRHLF

	LDAA	#':'
	JSR	OUTA
	
	LDAA	#' '
	JSR	OUTA
	JSR	OUTA
	JSR	OUTA

	LDX	#8
PRBLOOP
	CPX	#0
	BEQ	PRBDONE

	LDAA	#'0'
	LSLB
	ADCA	#0
	JSR	OUTA
	DEX
	BRA	PRBLOOP
PRBDONE
	JSR	OUTCRLF
	PULX
	PULB
	PULA
	RTS

RAND	
	LDAA	VAR
	LSLA
	ADCA	#20
	STAA	VAR
	RTS