;******************************************************************************************
;  16*32 LEDドッド表示器サンプル(8*6表示) EEP読込みバージョン
;   Program Name : 
;   Programer    :
;   Create date  :  Version 1.0    H18.06.10
;   History      :
;******************************************************************************************
;   Define I/O
;     A0-A3:LED Driver (Grand)
;     A4:Serial Data Input
;     A5:Serial Data Signal
;     E0:EEP (SCL) 
;     E1:EEP (SDA)
;     B0-B7:LED Driver (Data)
;     C0-C7,D0-D7:LED (Data)
;******************************************************************************************
;====================== 以下はPIC18F452用の記述 ======================
	LIST	P=18F452,ST=OFF,R=DEC
	INCLUDE	"P18F452.inc"
;
	__CONFIG    _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H
	__CONFIG    _CONFIG2L, _BOR_OFF_2L & _PWRT_OFF_2L & _BORV_20_2L
	__CONFIG    _CONFIG2H, _WDT_OFF_2H & _WDTPS_128_2H
	__CONFIG    _CONFIG3H, _CCP2MX_OFF_3H
	__CONFIG    _CONFIG4L, _STVR_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
	__CONFIG    _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L 
	__CONFIG    _CONFIG5H, _CPB_ON_5H & _CPD_OFF_5H
	__CONFIG    _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L 
	__CONFIG    _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
	__CONFIG    _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
	__CONFIG    _CONFIG7H, _EBTRB_OFF_7H
;
DA00	EQU	00H
DA01	EQU	01H
DA02	EQU	02H
DA03	EQU	03H
DA04	EQU	04H
DA05	EQU	05H
DA06	EQU	06H
DA07	EQU	07H
DA08	EQU	08H
DA09	EQU	09H
DA0A	EQU	0AH
DA0B	EQU	0BH
DA0C	EQU	0CH
DA0D	EQU	0DH
DA0E	EQU	0EH
DA0F	EQU	0FH
DA10	EQU	10H
DA11	EQU	11H
DA12	EQU	12H
DA13	EQU	13H
DA14	EQU	14H
DA15	EQU	15H
DA16	EQU	16H
DA17	EQU	17H
DA18	EQU	18H
DA19	EQU	19H
DA1A	EQU	1AH
DA1B	EQU	1BH
DA1C	EQU	1CH
DA1D	EQU	1DH
DA1E	EQU	1EH
DA1F	EQU	1FH
;
DB00	EQU	20H
DB01	EQU	21H
DB02	EQU	22H
DB03	EQU	23H
DB04	EQU	24H
DB05	EQU	25H
DB06	EQU	26H
DB07	EQU	27H
DB08	EQU	28H
DB09	EQU	29H
DB0A	EQU	2AH
DB0B	EQU	2BH
DB0C	EQU	2CH
DB0D	EQU	2DH
DB0E	EQU	2EH
DB0F	EQU	2FH
DB10	EQU	30H
DB11	EQU	31H
DB12	EQU	32H
DB13	EQU	33H
DB14	EQU	34H
DB15	EQU	35H
DB16	EQU	36H
DB17	EQU	37H
DB18	EQU	38H
DB19	EQU	39H
DB1A	EQU	3AH
DB1B	EQU	3BH
DB1C	EQU	3CH
DB1D	EQU	3DH
DB1E	EQU	3EH
DB1F	EQU	3FH
;
DSPCOD	EQU	40H
INRDSPLP EQU	41H
WATDSPLP EQU	42H
WATDSPBLP EQU	43H
LP	EQU	44H
LP1	EQU	45H
LP2	EQU	46H
LP3	EQU	47H
LP4	EQU	48H
IODAT	EQU	49H
RECLP	EQU	4AH
RECWAT	EQU	4BH
;
X1	EQU	4CH
X2	EQU	4DH
X3	EQU	4EH
X4	EQU	4FH
X5	EQU	50H
X6	EQU	51H
CHR	EQU	52H
COMWP000001A	EQU	53H
COMI2CSDTMP	EQU	54H
COMI2CSDLP	EQU	55H
COMATEEPDAT	EQU	56H
COMATEEPAD1	EQU	57H
COMATEEPAD0	EQU	58H
COMATEEPSEL	EQU	59H
COMRED24EEPWK	EQU	5AH
COMI2CRSLP	EQU	5BH
COMWRT24TMP	EQU	5CH
COMI2CRSTMP	EQU	5DH
STS	EQU	5EH	
GST	EQU	5FH
;
	ORG	0h
	GOTO	START
	ORG	8h
	GOTO	START
	ORG	18h
	GOTO	START
START
; 1.Port設定
;  (1)PortAの定義
	CLRF	PORTA		; PORTAの初期化
	CLRF	LATA		; データラッチレジスタの初期化
	MOVLW	H'07'		;
	MOVWF	ADCON1		;
	MOVLW	B'00010000'	; PORTAのIO設定(注意：PORTAは0-5までしかない)	
	MOVWF	TRISA		; PORTAのIO設定
;  (2)PortBの定義
	CLRF	PORTB		; PORTBの初期化
	CLRF	LATB		; データラッチレジスタの初期化
	MOVLW	B'00000000'	; PORTBのIO設定(0-7)	
	MOVWF	TRISB		; PORTBのIO設定
;  (3)PortCの定義
	CLRF	PORTC		; PORTCの初期化
	CLRF	LATC		; データラッチレジスタの初期化
	MOVLW	B'00000000'	; PORTCのIO設定(0-7)	
	MOVWF	TRISC		; PORTCのIO設定
;  (4)PortDの定義
	CLRF	PORTD		; PORTDの初期化
	CLRF	LATD		; データラッチレジスタの初期化
	MOVLW	B'00000000'	; PORTDのIO設定(0-7)	
	MOVWF	TRISD		; PORTDのIO設定
;  (5)PortEの定義
	CLRF	PORTE		; PORTEの初期化
	CLRF	LATE		; データラッチレジスタの初期化
	MOVLW	B'00000100'	; PORTEのIO設定(注意：PORTEは0-2までしかない)	
	MOVWF	TRISE		; PORTEのIO設定
;
	MOVLW	B'0000'		; Bank 0を設定
	MOVWF	BSR		; Bank 0を設定
;  (6)初期化
	BSF	PORTA,5		; Serial Port
	CALL	CLRLED		;
;
	CALL	COMSEL24EEP0	; EEP(0)を選択
	CLRF	COMATEEPAD1	; EEPアドレス2桁め
	CLRF	COMATEEPAD0	; EEPアドレス1桁め 
; ====================== 機能変更パラメータの記述(与える機能によりここのみを変更する) ================
	MOVLW	H'11'		; 16*32 Serial Port Data 読込みモード
;	MOVLW	H'12'		; 8*8 Serial Port Data 読込みモード
;	MOVLW	H'13'		; 8*6 Serial Port Data 読込みモード
;	MOVLW	H'14'		; 8*6 EEP読込みモード
; ====================================================================================================
	MOVWF	GST		; START MODE
;
;
	CALL	DEMO00
;	CALL	DEMO02
;
MAIN
; ====================== 16*32表示機の記述 ======================
	MOVF	GST,W
	XORLW	H'11'
	BTFSC	STATUS,Z
	CALL	PRG01
; ======================  8*8表示機の記述  ======================
	MOVF	GST,W
	XORLW	H'12'
	BTFSC	STATUS,Z
	CALL	PRG02
; ======================  8*6表示機の記述(Serial)  ======================
	MOVF	GST,W
	XORLW	H'13'
	BTFSC	STATUS,Z
	CALL	PRG03
; ======================  8*6表示機の記述(EEP)  ======================
	MOVF	GST,W
	XORLW	H'14'
	BTFSC	STATUS,Z
	CALL	PRG04
; ===============================================================
	GOTO	MAIN

;******************************************************************************************
;   Function Name : PRG01
;   Title         : 16*32 表示関数(Read Serial Port)
;   Input         : 
;   Output        : 
;   Disctiption   : 
;******************************************************************************************
PRG01
	CALL	SERIDAT
	XORLW	H'01'
	BTFSC	STATUS,Z
	CALL	SETFNT
	CALL	WATDSP
	RETURN

;******************************************************************************************
;   Function Name : PRG02
;   Title         : 8*8 表示関数(Read Serial Port)
;   Input         : 
;   Output        : 
;   Disctiption   : 
;******************************************************************************************
PRG02
	CALL	SERIDAT
	XORLW	H'01'
	BTFSC	STATUS,Z
	CALL	SETSFNT
	CALL	WATDSP
	RETURN

;******************************************************************************************
;   Function Name : PRG03
;   Title         : 8*6 表示関数(Read Serial Port)
;   Input         : 
;   Output        : 
;   Disctiption   : 
;******************************************************************************************
PRG03
	CALL	SERIDAT
	XORLW	H'01'
	BTFSS	STATUS,Z
	GOTO	PRG03S
;
	MOVF	DSPCOD,W
	XORLW	H'11'		; MODE11	
	BTFSS	STATUS,Z
	GOTO	PRG03E
	MOVLW	H'11'
	MOVWF	GST
	RETURN 
PRG03E
	MOVF	DSPCOD,W
	XORLW	H'12'		; MODE12	
	BTFSS	STATUS,Z
	GOTO	PRG03F
	MOVLW	H'12'
	MOVWF	GST
	RETURN 
PRG03F
	MOVF	DSPCOD,W
	XORLW	H'14'		; MODE14
	BTFSS	STATUS,Z
	GOTO	PRG03G
	MOVLW	H'14'
	MOVWF	GST
	CALL	EEPADCOU
	RETURN 
PRG03G:
	CALL	SETFNT86
	CALL	MOVFNT86
PRG03S
	CALL	WATDSP
	RETURN


;******************************************************************************************
;   Function Name : PRG04
;   Title         : 8*6 表示関数(Read EEP)
;   Input         : 
;   Output        : 
;   Disctiption   : 
;******************************************************************************************
PRG04
;  
	CALL	COMRED24EEP
;
	MOVF	COMATEEPDAT,W
	XORLW	H'00'		; GO START	
	BTFSS	STATUS,Z
	GOTO	PRG04B
	CLRF	COMATEEPAD1	; アドレス2桁め
	CLRF	COMATEEPAD0	; アドレス1桁め
	RETURN 
PRG04B:
	MOVF	COMATEEPDAT,W
	XORLW	H'FF'		; GO START	
	BTFSS	STATUS,Z
	GOTO	PRG04C
	CLRF	COMATEEPAD1	; アドレス2桁め
	CLRF	COMATEEPAD0	; アドレス1桁め
	RETURN 
PRG04C:
	MOVF	COMATEEPDAT,W
	XORLW	H'01'		; WAIT(Noting)	
	BTFSS	STATUS,Z
	GOTO	PRG04D
	CALL	EEPADCOU
	CALL	WATDSP
	RETURN 
PRG04D:
	MOVF	COMATEEPDAT,W
	XORLW	H'11'		; MODE11	
	BTFSS	STATUS,Z
	GOTO	PRG04E
	MOVLW	H'11'
	MOVWF	GST
	RETURN 
PRG04E:
	MOVF	COMATEEPDAT,W
	XORLW	H'12'		; MODE12	
	BTFSS	STATUS,Z
	GOTO	PRG04F
	MOVLW	H'12'
	MOVWF	GST
	RETURN 
PRG04F:
	MOVF	COMATEEPDAT,W
	XORLW	H'13'		; MODE13	
	BTFSS	STATUS,Z
	GOTO	PRG04G
	MOVLW	H'13'
	MOVWF	GST
	RETURN 
PRG04G:
	CALL	EEPADCOU
	MOVF	COMATEEPDAT,W
	MOVWF	DSPCOD
	CALL	SETFNT86
	CALL	MOVFNT86
	CALL	WATDSP
	RETURN

;******************************************************************************************
;   Function Name : DEMO00
;   Title         : 電源投入時のデモ表示
;   Input         : 
;   Output        : 
;   Disctiption   : 
;******************************************************************************************
DEMO00
	MOVLW	H'FF'
	MOVWF	DSPCOD
	CALL	SETFNT
	CALL	WATDSP
	CALL	WATDSP
;
	MOVLW	H'00'
	MOVWF	DSPCOD
	CALL	SETFNT
	CALL	WATDSP
	CALL	WATDSP
;
	MOVLW	H'0A'
	MOVWF	LP
DEMO00C
	MOVLW	H'FD'
	MOVWF	DSPCOD
	CALL	SETFNT
	MOVLW	H'01'
	MOVWF	LP1
DEMO00C1
	CALL	WATDSP
	DECFSZ	LP1	
	GOTO	DEMO00C1
	MOVLW	H'FE'
	MOVWF	DSPCOD
	CALL	SETFNT
	MOVLW	H'01'
	MOVWF	LP1
DEMO00C2
	CALL	WATDSP
	DECFSZ	LP1	
	GOTO	DEMO00C2
	DECFSZ	LP	
	GOTO	DEMO00C
;
	MOVLW	H'00'
	MOVWF	DSPCOD
	CALL	SETFNT
	CALL	WATDSP
;
	RETURN

;******************************************************************************************
;   Function Name : DEMO02
;   Title         : 
;   Input         : 
;   Output        :
;   Description   : 8*6 Demo 
;******************************************************************************************
DEMO02
	MOVLW	H'FF'
	MOVWF	DSPCOD
	CALL	SETFNT
	CALL	WATDSP
;
	MOVLW	H'00'
	MOVWF	DSPCOD
	CALL	SETFNT
	CALL	WATDSP
;
	CALL	CLRFNT86
;
	MOVLW	'0'
	CALL	OUTDSP
; 
	MOVLW	'1'
	CALL	OUTDSP
; 
	MOVLW	'2'
	CALL	OUTDSP
; 
	MOVLW	'3'
	CALL	OUTDSP
; 
	MOVLW	'4'
	CALL	OUTDSP
; 
	MOVLW	'5'
	CALL	OUTDSP
; 
	MOVLW	'6'
	CALL	OUTDSP
; 
	MOVLW	'7'
	CALL	OUTDSP
; 
	MOVLW	'8'
	CALL	OUTDSP
; 
	MOVLW	'9'
	CALL	OUTDSP
; 
	MOVLW	'A'
	CALL	OUTDSP
; 
	MOVLW	'B'
	CALL	OUTDSP
; 
	MOVLW	'C'
	CALL	OUTDSP
; 
	MOVLW	'D'
	CALL	OUTDSP
; 
	MOVLW	'E'
	CALL	OUTDSP
; 
	MOVLW	'F'
	CALL	OUTDSP
; 
	MOVLW	'G'
	CALL	OUTDSP
; 
	MOVLW	'H'
	CALL	OUTDSP
; 
	MOVLW	'I'
	CALL	OUTDSP
; 
	MOVLW	'J'
	CALL	OUTDSP
; 
	MOVLW	'K'
	CALL	OUTDSP
; 
	MOVLW	'L'
	CALL	OUTDSP
; 
	MOVLW	'M'
	CALL	OUTDSP
; 
	MOVLW	'N'
	CALL	OUTDSP
; 
	MOVLW	'O'
	CALL	OUTDSP
; 
	MOVLW	'P'
	CALL	OUTDSP
; 
	MOVLW	'Q'
	CALL	OUTDSP
; 
	MOVLW	'R'
	CALL	OUTDSP
; 
	MOVLW	'S'
	CALL	OUTDSP
; 
	MOVLW	'T'
	CALL	OUTDSP
; 
	MOVLW	'U'
	CALL	OUTDSP
; 
	MOVLW	'V'
	CALL	OUTDSP
; 
	MOVLW	'W'
	CALL	OUTDSP
; 
	MOVLW	'X'
	CALL	OUTDSP
; 
	MOVLW	'Y'
	CALL	OUTDSP
; 
	MOVLW	'Z'
	CALL	OUTDSP
; 
	MOVLW	'u'
	CALL	OUTDSP
; 
	MOVLW	'd'
	CALL	OUTDSP
; 
	MOVLW	'r'
	CALL	OUTDSP
; 
	MOVLW	'l'
	CALL	OUTDSP
; 
	MOVLW	' '
	CALL	OUTDSP
; 
	MOVLW	'a'
	CALL	OUTDSP
; 
	MOVLW	'e'
	CALL	OUTDSP
; 
	MOVLW	'+'
	CALL	OUTDSP
; 
	MOVLW	'-'
	CALL	OUTDSP
; 
	MOVLW	'='
	CALL	OUTDSP
; 
	MOVLW	')'
	CALL	OUTDSP
; 
	MOVLW	'('
	CALL	OUTDSP
; 
	MOVLW	']'
	CALL	OUTDSP
; 
	MOVLW	'['
	CALL	OUTDSP
; 
	MOVLW	'>'
	CALL	OUTDSP
; 
	MOVLW	'<'
	CALL	OUTDSP
; 
	MOVLW	'"'
	CALL	OUTDSP
; 
	MOVLW	'!'
	CALL	OUTDSP
; 
	MOVLW	'*'
	CALL	OUTDSP
; 
	MOVLW	'/'
	CALL	OUTDSP
; 
;	MOVLW	'c'
;	CALL	OUTDSP

	MOVLW	'ｱ'
	CALL	OUTDSP
; 
	MOVLW	'ｲ'
	CALL	OUTDSP
; 
	MOVLW	'ｳ'
	CALL	OUTDSP
; 
	MOVLW	'ｴ'
	CALL	OUTDSP
; 
	MOVLW	'ｵ'
	CALL	OUTDSP
; 
	MOVLW	'ｶ'
	CALL	OUTDSP
; 
	MOVLW	'ｷ'
	CALL	OUTDSP
; 
	MOVLW	'ｸ'
	CALL	OUTDSP
; 
	MOVLW	'ｹ'
	CALL	OUTDSP
; 
	MOVLW	'ｺ'
	CALL	OUTDSP
; 
	MOVLW	'ｻ'
	CALL	OUTDSP
; 
	MOVLW	'ｼ'
	CALL	OUTDSP
; 
	MOVLW	'ｽ'
	CALL	OUTDSP
; 
	MOVLW	'ｾ'
	CALL	OUTDSP
; 
	MOVLW	'ｿ'
	CALL	OUTDSP
; 
	MOVLW	'ﾀ'
	CALL	OUTDSP
; 
	MOVLW	'ﾁ'
	CALL	OUTDSP
; 
	MOVLW	'ﾂ'
	CALL	OUTDSP
; 
	MOVLW	'ﾃ'
	CALL	OUTDSP
; 
	MOVLW	'ﾄ'
	CALL	OUTDSP
; 
	MOVLW	'ﾅ'
	CALL	OUTDSP
; 
	MOVLW	'ﾆ'
	CALL	OUTDSP
; 
	MOVLW	'ﾇ'
	CALL	OUTDSP
; 
	MOVLW	'ﾈ'
	CALL	OUTDSP
; 
	MOVLW	'ﾉ'
	CALL	OUTDSP
; 
	MOVLW	'ﾊ'
	CALL	OUTDSP
; 
	MOVLW	'ﾋ'
	CALL	OUTDSP
; 
	MOVLW	'ﾌ'
	CALL	OUTDSP
; 
	MOVLW	'ﾍ'
	CALL	OUTDSP
; 
	MOVLW	'ﾎ'
	CALL	OUTDSP
; 
	MOVLW	'ﾏ'
	CALL	OUTDSP
; 
	MOVLW	'ﾐ'
	CALL	OUTDSP
; 
	MOVLW	'ﾑ'
	CALL	OUTDSP
; 
	MOVLW	'ﾒ'
	CALL	OUTDSP
; 
	MOVLW	'ﾓ'
	CALL	OUTDSP
; 
	MOVLW	'ﾔ'
	CALL	OUTDSP
; 
	MOVLW	'ﾕ'
	CALL	OUTDSP
; 
	MOVLW	'ﾖ'
	CALL	OUTDSP
; 
	MOVLW	'ﾗ'
	CALL	OUTDSP
; 
	MOVLW	'ﾘ'
	CALL	OUTDSP
; 
	MOVLW	'ﾙ'
	CALL	OUTDSP
; 
	MOVLW	'ﾚ'
	CALL	OUTDSP
; 
	MOVLW	'ﾛ'
	CALL	OUTDSP
; 
	MOVLW	'ﾜ'
	CALL	OUTDSP
; 
	MOVLW	'ﾝ'
	CALL	OUTDSP
; 
	MOVLW	'ﾞ'
	CALL	OUTDSP
; 
	MOVLW	'ﾟ'
	CALL	OUTDSP
; 
	RETURN

;******************************************************************************************
;   Function Name : OUTDSP
;   Title         : 
;   Input         : W-REG 
;   Output        :
;   Description   : 
;******************************************************************************************
OUTDSP
	MOVWF	DSPCOD
;
	CALL	SETFNT86
	CALL	MOVFNT86
	CALL	WATDSP
;	CALL	WATDSP
;	CALL	WATDSP
;	CALL	WATDSP
;
	RETURN

;******************************************************************************************
;   Function Name : WATDSPB
;   Title         : 文字コードを指定して、画面を1秒程度表示する
;   Input         : DSPCOD
;   Output        : 
;   Disctiption   : 
;******************************************************************************************
WATDSPB
	MOVLW	H'64'
	MOVWF	WATDSPBLP
WATDSPB1
	CALL	DSPLED
	DECFSZ	WATDSPBLP	
	GOTO	WATDSPB1 
	RETURN
;******************************************************************************************
;   Function Name : WATDSP
;   Title         : 文字コードを指定して、画面を0.1秒程度表示する
;   Input         : DSPCOD
;   Output        : 
;   Disctiption   : 
;******************************************************************************************
WATDSP
	MOVLW	H'0A'
	MOVWF	WATDSPLP
WATDSP1
	CALL	DSPLED
	DECFSZ	WATDSPLP	
	GOTO	WATDSP1 
	RETURN

;******************************************************************************************
;   Function Name : SETSFNT
;   Title         : 文字コードを指定して、フォントをセットする(8*8)
;   Input         : DSPCOD
;   Output        : 
;   Disctiption   : 
;******************************************************************************************
SETSFNT
	CALL	MOVSFNT
;
;=========================================================
;  キャラクタコード(00)
;    記号 ' ' ※何も表示しない
;=========================================================
	MOVF	DSPCOD,W
	XORLW	H'00'
	BTFSS	STATUS,Z
	GOTO	FSEND00
	MOVLW	B'00000000'
	MOVWF	DB18
	MOVLW	B'00000000'
	MOVWF	DB19
	MOVLW	B'00000000'
	MOVWF	DB1A
	MOVLW	B'00000000'
	MOVWF	DB1B
	MOVLW	B'00000000'
	MOVWF	DB1C
	MOVLW	B'00000000'
	MOVWF	DB1D
	MOVLW	B'00000000'
	MOVWF	DB1E
	MOVLW	B'00000000'
	MOVWF	DB1F
	RETURN
FSEND00
;=========================================================
;  キャラクタコード(2B)
;    記号 '+'
;=========================================================
	MOVF	DSPCOD,W
	XORLW	H'2B'
	BTFSS	STATUS,Z
	GOTO	FSEND2B
	MOVLW	B'00001000'
	MOVWF	DB18
	MOVLW	B'00001000'
	MOVWF	DB19
	MOVLW	B'00001000'
	MOVWF	DB1A
	MOVLW	B'11111111'
	MOVWF	DB1B
	MOVLW	B'11111111'
	MOVWF	DB1C
	MOVLW	B'00001000'
	MOVWF	DB1D
	MOVLW	B'00001000'
	MOVWF	DB1E
	MOVLW	B'00001000'
	MOVWF	DB1F
	RETURN
FSEND2B
;=========================================================
;  キャラクタコード(2D)
;    記号 '-'
;=========================================================
	MOVF	DSPCOD,W
	XORLW	H'2D'
	BTFSS	STATUS,Z
	GOTO	FSEND2D
	MOVLW	B'00001000'
	MOVWF	DB18
	MOVLW	B'00001000'
	MOVWF	DB19
	MOVLW	B'00001000'
	MOVWF	DB1A
	MOVLW	B'00001000'
	MOVWF	DB1B
	MOVLW	B'00001000'
	MOVWF	DB1C
	MOVLW	B'00001000'
	MOVWF	DB1D
	MOVLW	B'00001000'
	MOVWF	DB1E
	MOVLW	B'00001000'
	MOVWF	DB1F
	RETURN
FSEND2D
;=========================================================
;  キャラクタコード(FD)
;    記号  ※斑模様パターンA
;=========================================================
	MOVF	DSPCOD,W
	XORLW	H'FD'
	BTFSS	STATUS,Z
	GOTO	FSENDFD	
	MOVLW	B'01010101'
	MOVWF	DB18
	MOVLW	B'10101010'
	MOVWF	DB19
	MOVLW	B'01010101'
	MOVWF	DB1A
	MOVLW	B'10101010'
	MOVWF	DB1B
	MOVLW	B'01010101'
	MOVWF	DB1C
	MOVLW	B'10101010'
	MOVWF	DB1D
	MOVLW	B'01010101'
	MOVWF	DB1E
	MOVLW	B'10101010'
	MOVWF	DB1F
	RETURN
FSENDFD
;=========================================================
;  キャラクタコード(FE)
;    記号  ※斑模様パターンB
;=========================================================
	MOVF	DSPCOD,W
	XORLW	H'FE'
	BTFSS	STATUS,Z
	GOTO	FSENDFE	
	MOVLW	B'10101010'
	MOVWF	DB18
	MOVLW	B'01010101'
	MOVWF	DB19
	MOVLW	B'10101010'
	MOVWF	DB1A
	MOVLW	B'01010101'
	MOVWF	DB1B
	MOVLW	B'10101010'
	MOVWF	DB1C
	MOVLW	B'01010101'
	MOVWF	DB1D
	MOVLW	B'10101010'
	MOVWF	DB1E
	MOVLW	B'01010101'
	MOVWF	DB1F
	RETURN
FSENDFE
;=========================================================
;  キャラクタコード(FF)
;    記号  ※全点燈
;=========================================================
	MOVF	DSPCOD,W
	XORLW	H'FF'
	BTFSS	STATUS,Z
	GOTO	FSENDFE	
	MOVLW	B'11111111'
	MOVWF	DB18
	MOVLW	B'11111111'
	MOVWF	DB19
	MOVLW	B'11111111'
	MOVWF	DB1A
	MOVLW	B'11111111'
	MOVWF	DB1B
	MOVLW	B'11111111'
	MOVWF	DB1C
	MOVLW	B'11111111'
	MOVWF	DB1D
	MOVLW	B'11111111'
	MOVWF	DB1E
	MOVLW	B'11111111'
	MOVWF	DB1F
	RETURN
FSENDFF
;=========================================================
;  キャラクタコード(それ以外)
;    記号  ※エラー表示
;=========================================================
	MOVLW	B'11111111'
	MOVWF	DB18
	MOVLW	B'10011001'
	MOVWF	DB19
	MOVLW	B'10011001'
	MOVWF	DB1A
	MOVLW	B'10011001'
	MOVWF	DB1B
	MOVLW	B'10011001'
	MOVWF	DB1C
	MOVLW	B'10011001'
	MOVWF	DB1D
	MOVLW	B'10011001'
	MOVWF	DB1E
	MOVLW	B'10011001'
	MOVWF	DB1F
	RETURN

;******************************************************************************************
;   Function Name : SETFNT86
;   Title         : 文字コードを指定して、フォントをセットする(8*6)
;   Input         : W-reg
;   Output        :
;   Description   : 
;******************************************************************************************
SETFNT86
;
;	CALL	MOVFNT86
;
	MOVF	DSPCOD,W
	MOVWF	CHR
	CLRF	X6
;
; ****************
;   0-9
; ****************
;
	MOVF	CHR,W
	XORLW	'0'
	BTFSS	STATUS,Z
	GOTO	SETFNT1
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'00111110'
	MOVWF	X2
	MOVLW	B'01000001'
	MOVWF	X3
	MOVLW	B'00111110'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNT1
	MOVF	CHR,W
	XORLW	'1'
	BTFSS	STATUS,Z
	GOTO	SETFNT2
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'01000010'
	MOVWF	X2
	MOVLW	B'01111111'
	MOVWF	X3
	MOVLW	B'01000000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNT2
	MOVF	CHR,W
	XORLW	'2'
	BTFSS	STATUS,Z
	GOTO	SETFNT3
	MOVLW	B'01000010'
	MOVWF	X1
	MOVLW	B'01000001'
	MOVWF	X2
	MOVLW	B'01100001'
	MOVWF	X3
	MOVLW	B'01010001'
	MOVWF	X4
	MOVLW	B'01001110'
	MOVWF	X5
	RETURN
;
SETFNT3
	MOVF	CHR,W
	XORLW	'3'
	BTFSS	STATUS,Z
	GOTO	SETFNT4
	MOVLW	B'00100010'
	MOVWF	X1
	MOVLW	B'01001001'
	MOVWF	X2
	MOVLW	B'01001001'
	MOVWF	X3
	MOVLW	B'01001001'
	MOVWF	X4
	MOVLW	B'00110110'
	MOVWF	X5
	RETURN
;
SETFNT4
	MOVF	CHR,W
	XORLW	'4'
	BTFSS	STATUS,Z
	GOTO	SETFNT5
	MOVLW	B'00111100'
	MOVWF	X1
	MOVLW	B'00100010'
	MOVWF	X2
	MOVLW	B'00100001'
	MOVWF	X3
	MOVLW	B'01111111'
	MOVWF	X4
	MOVLW	B'00100000'
	MOVWF	X5
	RETURN
;
SETFNT5
	MOVF	CHR,W
	XORLW	'5'
	BTFSS	STATUS,Z
	GOTO	SETFNT6
	MOVLW	B'01001111'
	MOVWF	X1
	MOVLW	B'01001001'
	MOVWF	X2
	MOVLW	B'01001001'
	MOVWF	X3
	MOVLW	B'01001001'
	MOVWF	X4
	MOVLW	B'00110000'
	MOVWF	X5
	RETURN
;
SETFNT6
	MOVF	CHR,W
	XORLW	'6'
	BTFSS	STATUS,Z
	GOTO	SETFNT7
	MOVLW	B'00111110'
	MOVWF	X1
	MOVLW	B'01001001'
	MOVWF	X2
	MOVLW	B'01001001'
	MOVWF	X3
	MOVLW	B'01001001'
	MOVWF	X4
	MOVLW	B'00110000'
	MOVWF	X5
	RETURN
;
SETFNT7
	MOVF	CHR,W
	XORLW	'7'
	BTFSS	STATUS,Z
	GOTO	SETFNT8
	MOVLW	B'00000001'
	MOVWF	X1
	MOVLW	B'00000001'
	MOVWF	X2
	MOVLW	B'01110001'
	MOVWF	X3
	MOVLW	B'00001001'
	MOVWF	X4
	MOVLW	B'00000111'
	MOVWF	X5
	RETURN
;
SETFNT8
	MOVF	CHR,W
	XORLW	'8'
	BTFSS	STATUS,Z
	GOTO	SETFNT9
	MOVLW	B'00110110'
	MOVWF	X1
	MOVLW	B'01001001'
	MOVWF	X2
	MOVLW	B'01001001'
	MOVWF	X3
	MOVLW	B'01001001'
	MOVWF	X4
	MOVLW	B'00110110'
	MOVWF	X5
	RETURN
;
SETFNT9
	MOVF	CHR,W
	XORLW	'9'
	BTFSS	STATUS,Z
	GOTO	SETFNTA
	MOVLW	B'00100110'
	MOVWF	X1
	MOVLW	B'01001001'
	MOVWF	X2
	MOVLW	B'01001001'
	MOVWF	X3
	MOVLW	B'01001001'
	MOVWF	X4
	MOVLW	B'00111110'
	MOVWF	X5
	RETURN

; ****************
;   A-Z
; ****************
;
SETFNTA
	MOVF	CHR,W
	XORLW	'A'
	BTFSS	STATUS,Z
	GOTO	SETFNTB
	MOVLW	B'01111100'
	MOVWF	X1
	MOVLW	B'00010010'
	MOVWF	X2
	MOVLW	B'00010001'
	MOVWF	X3
	MOVLW	B'00010010'
	MOVWF	X4
	MOVLW	B'01111100'
	MOVWF	X5
	RETURN
;
SETFNTB
	MOVF	CHR,W
	XORLW	'B'
	BTFSS	STATUS,Z
	GOTO	SETFNTC
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'01001001'
	MOVWF	X2
	MOVLW	B'01001001'
	MOVWF	X3
	MOVLW	B'01001001'
	MOVWF	X4
	MOVLW	B'00110110'
	MOVWF	X5
	RETURN
;
SETFNTC
	MOVF	CHR,W
	XORLW	'C'
	BTFSS	STATUS,Z
	GOTO	SETFNTD
	MOVLW	B'00111110'
	MOVWF	X1
	MOVLW	B'01000001'
	MOVWF	X2
	MOVLW	B'01000001'
	MOVWF	X3
	MOVLW	B'01000001'
	MOVWF	X4
	MOVLW	B'00100010'
	MOVWF	X5
	RETURN
;
SETFNTD
	MOVF	CHR,W
	XORLW	'D'
	BTFSS	STATUS,Z
	GOTO	SETFNTE
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'01000001'
	MOVWF	X2
	MOVLW	B'01000001'
	MOVWF	X3
	MOVLW	B'01000001'
	MOVWF	X4
	MOVLW	B'00111110'
	MOVWF	X5
	RETURN
;
SETFNTE
	MOVF	CHR,W
	XORLW	'E'
	BTFSS	STATUS,Z
	GOTO	SETFNTF
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'01001001'
	MOVWF	X2
	MOVLW	B'01001001'
	MOVWF	X3
	MOVLW	B'01001001'
	MOVWF	X4
	MOVLW	B'01001001'
	MOVWF	X5
	RETURN
;
SETFNTF
	MOVF	CHR,W
	XORLW	'F'
	BTFSS	STATUS,Z
	GOTO	SETFNTG
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'00001001'
	MOVWF	X2
	MOVLW	B'00001001'
	MOVWF	X3
	MOVLW	B'00001001'
	MOVWF	X4
	MOVLW	B'00001001'
	MOVWF	X5
	RETURN
;
SETFNTG
	MOVF	CHR,W
	XORLW	'G'
	BTFSS	STATUS,Z
	GOTO	SETFNTH
	MOVLW	B'00111110'
	MOVWF	X1
	MOVLW	B'01000001'
	MOVWF	X2
	MOVLW	B'01001001'
	MOVWF	X3
	MOVLW	B'01001001'
	MOVWF	X4
	MOVLW	B'01111010'
	MOVWF	X5
	RETURN
;
SETFNTH
	MOVF	CHR,W
	XORLW	'H'
	BTFSS	STATUS,Z
	GOTO	SETFNTI
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'00001000'
	MOVWF	X2
	MOVLW	B'00001000'
	MOVWF	X3
	MOVLW	B'00001000'
	MOVWF	X4
	MOVLW	B'01111111'
	MOVWF	X5
	RETURN
;
SETFNTI
	MOVF	CHR,W
	XORLW	'I'
	BTFSS	STATUS,Z
	GOTO	SETFNTJ
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'01000001'
	MOVWF	X2
	MOVLW	B'01111111'
	MOVWF	X3
	MOVLW	B'01000001'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTJ
	MOVF	CHR,W
	XORLW	'J'
	BTFSS	STATUS,Z
	GOTO	SETFNTK
	MOVLW	B'00100000'
	MOVWF	X1
	MOVLW	B'01000000'
	MOVWF	X2
	MOVLW	B'01000000'
	MOVWF	X3
	MOVLW	B'01000000'
	MOVWF	X4
	MOVLW	B'00111111'
	MOVWF	X5
	RETURN
;
SETFNTK
	MOVF	CHR,W
	XORLW	'K'
	BTFSS	STATUS,Z
	GOTO	SETFNTL
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'00001000'
	MOVWF	X2
	MOVLW	B'00010100'
	MOVWF	X3
	MOVLW	B'00100010'
	MOVWF	X4
	MOVLW	B'01000001'
	MOVWF	X5
	RETURN
;
SETFNTL
	MOVF	CHR,W
	XORLW	'L'
	BTFSS	STATUS,Z
	GOTO	SETFNTM
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'01000000'
	MOVWF	X2
	MOVLW	B'01000000'
	MOVWF	X3
	MOVLW	B'01000000'
	MOVWF	X4
	MOVLW	B'01000000'
	MOVWF	X5
	RETURN
;
SETFNTM
	MOVF	CHR,W
	XORLW	'M'
	BTFSS	STATUS,Z
	GOTO	SETFNTN
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'00000010'
	MOVWF	X2
	MOVLW	B'00011100'
	MOVWF	X3
	MOVLW	B'00000010'
	MOVWF	X4
	MOVLW	B'01111111'
	MOVWF	X5
	RETURN
;
SETFNTN
	MOVF	CHR,W
	XORLW	'N'
	BTFSS	STATUS,Z
	GOTO	SETFNTO
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'00000010'
	MOVWF	X2
	MOVLW	B'00001000'
	MOVWF	X3
	MOVLW	B'00100000'
	MOVWF	X4
	MOVLW	B'01111111'
	MOVWF	X5
	RETURN
;
SETFNTO
	MOVF	CHR,W
	XORLW	'O'
	BTFSS	STATUS,Z
	GOTO	SETFNTP
	MOVLW	B'00111110'
	MOVWF	X1
	MOVLW	B'01000001'
	MOVWF	X2
	MOVLW	B'01000001'
	MOVWF	X3
	MOVLW	B'01000001'
	MOVWF	X4
	MOVLW	B'00111110'
	MOVWF	X5
	RETURN
;
SETFNTP
	MOVF	CHR,W
	XORLW	'P'
	BTFSS	STATUS,Z
	GOTO	SETFNTQ
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'00001001'
	MOVWF	X2
	MOVLW	B'00001001'
	MOVWF	X3
	MOVLW	B'00001001'
	MOVWF	X4
	MOVLW	B'00000110'
	MOVWF	X5
	RETURN
;
SETFNTQ
	MOVF	CHR,W
	XORLW	'Q'
	BTFSS	STATUS,Z
	GOTO	SETFNTR
	MOVLW	B'00111110'
	MOVWF	X1
	MOVLW	B'01000001'
	MOVWF	X2
	MOVLW	B'01010001'
	MOVWF	X3
	MOVLW	B'00111110'
	MOVWF	X4
	MOVLW	B'01000000'
	MOVWF	X5
	RETURN
;
SETFNTR
	MOVF	CHR,W
	XORLW	'R'
	BTFSS	STATUS,Z
	GOTO	SETFNTS
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'00001001'
	MOVWF	X2
	MOVLW	B'00011001'
	MOVWF	X3
	MOVLW	B'00101001'
	MOVWF	X4
	MOVLW	B'01000110'
	MOVWF	X5
        RETURN
;
SETFNTS
	MOVF	CHR,W
	XORLW	'S'
	BTFSS	STATUS,Z
	GOTO	SETFNTT
	MOVLW	B'00100110'
	MOVWF	X1
	MOVLW	B'01001001'
	MOVWF	X2
	MOVLW	B'01001001'
	MOVWF	X3
	MOVLW	B'01001001'
	MOVWF	X4
	MOVLW	B'00110010'
	MOVWF	X5
	RETURN
;
SETFNTT
	MOVF	CHR,W
	XORLW	'T'
	BTFSS	STATUS,Z
	GOTO	SETFNTU
	MOVLW	B'00000001'
	MOVWF	X1
	MOVLW	B'00000001'
	MOVWF	X2
	MOVLW	B'01111111'
	MOVWF	X3
	MOVLW	B'00000001'
	MOVWF	X4
	MOVLW	B'00000001'
	MOVWF	X5
	RETURN
;
SETFNTU
	MOVF	CHR,W
	XORLW	'U'
	BTFSS	STATUS,Z
	GOTO	SETFNTV
	MOVLW	B'00111111'
	MOVWF	X1
	MOVLW	B'01000000'
	MOVWF	X2
	MOVLW	B'01000000'
	MOVWF	X3
	MOVLW	B'01000000'
	MOVWF	X4
	MOVLW	B'00111111'
	MOVWF	X5
	RETURN
;
SETFNTV
	MOVF	CHR,W
	XORLW	'V'
	BTFSS	STATUS,Z
	GOTO	SETFNTW
	MOVLW	B'00011111'
	MOVWF	X1
	MOVLW	B'00100000'
	MOVWF	X2
	MOVLW	B'01000000'
	MOVWF	X3
	MOVLW	B'00100000'
	MOVWF	X4
	MOVLW	B'00011111'
	MOVWF	X5
	RETURN
;
SETFNTW
	MOVF	CHR,W
	XORLW	'W'
	BTFSS	STATUS,Z
	GOTO	SETFNTX
	MOVLW	B'00111111'
	MOVWF	X1
	MOVLW	B'01000000'
	MOVWF	X2
	MOVLW	B'00111111'
	MOVWF	X3
	MOVLW	B'01000000'
	MOVWF	X4
	MOVLW	B'00111111'
	MOVWF	X5
	RETURN
;
SETFNTX
	MOVF	CHR,W
	XORLW	'X'
	BTFSS	STATUS,Z
	GOTO	SETFNTY
	MOVLW	B'01000001'
	MOVWF	X1
	MOVLW	B'00100010'
	MOVWF	X2
	MOVLW	B'00011100'
	MOVWF	X3
	MOVLW	B'00100010'
	MOVWF	X4
	MOVLW	B'01000001'
	MOVWF	X5
	RETURN
;
SETFNTY
	MOVF	CHR,W
	XORLW	'Y'
	BTFSS	STATUS,Z
	GOTO	SETFNTZ
	MOVLW	B'00000001'
	MOVWF	X1
	MOVLW	B'00000100'
	MOVWF	X2
	MOVLW	B'01110000'
	MOVWF	X3
	MOVLW	B'00000100'
	MOVWF	X4
	MOVLW	B'00000001'
	MOVWF	X5
	RETURN
;
SETFNTZ
	MOVF	CHR,W
	XORLW	'Z'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNA
	MOVLW	B'01100001'
	MOVWF	X1
	MOVLW	B'01010001'
	MOVWF	X2
	MOVLW	B'01001001'
	MOVWF	X3
	MOVLW	B'01000101'
	MOVWF	X4
	MOVLW	B'01000011'
	MOVWF	X5
	RETURN


; ****************
;   ｶﾅ文字
; ****************
;
SETFNTKNNA	;
	MOVF	CHR,W
	XORLW	'ｱ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNI
	MOVLW	B'00000001'
	MOVWF	X1
	MOVLW	B'01000001'
	MOVWF	X2
	MOVLW	B'00111101'
	MOVWF	X3
	MOVLW	B'00001001'
	MOVWF	X4
	MOVLW	B'00000111'
	MOVWF	X5
	RETURN
;
SETFNTKNNI
	MOVF	CHR,W
	XORLW	'ｲ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNU
	MOVLW	B'00100000'
	MOVWF	X1
	MOVLW	B'00010000'
	MOVWF	X2
	MOVLW	B'01111100'
	MOVWF	X3
	MOVLW	B'00000011'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTKNNU	;
	MOVF	CHR,W
	XORLW	'ｳ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNE
	MOVLW	B'00000110'
	MOVWF	X1
	MOVLW	B'00000010'
	MOVWF	X2
	MOVLW	B'01000011'
	MOVWF	X3
	MOVLW	B'00100010'
	MOVWF	X4
	MOVLW	B'00011110'
	MOVWF	X5
	RETURN
;
SETFNTKNNE	;
	MOVF	CHR,W
	XORLW	'ｴ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNO
	MOVLW	B'01000000'
	MOVWF	X1
	MOVLW	B'01000010'
	MOVWF	X2
	MOVLW	B'01111110'
	MOVWF	X3
	MOVLW	B'01000010'
	MOVWF	X4
	MOVLW	B'01000000'
	MOVWF	X5
	RETURN
;
SETFNTKNNO
	MOVF	CHR,W
	XORLW	'ｵ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNKA
	MOVLW	B'00100010'
	MOVWF	X1
	MOVLW	B'00010010'
	MOVWF	X2
	MOVLW	B'00001010'
	MOVWF	X3
	MOVLW	B'01111111'
	MOVWF	X4
	MOVLW	B'00000010'
	MOVWF	X5
	RETURN
;
SETFNTKNNKA
	MOVF	CHR,W
	XORLW	'ｶ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNKI
	MOVLW	B'01000010'
	MOVWF	X1
	MOVLW	B'00111111'
	MOVWF	X2
	MOVLW	B'00000010'
	MOVWF	X3
	MOVLW	B'01000010'
	MOVWF	X4
	MOVLW	B'00111110'
	MOVWF	X5
	RETURN
;
SETFNTKNNKI
	MOVF	CHR,W
	XORLW	'ｷ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNKU
	MOVLW	B'00001010'
	MOVWF	X1
	MOVLW	B'00001010'
	MOVWF	X2
	MOVLW	B'01111111'
	MOVWF	X3
	MOVLW	B'00001010'
	MOVWF	X4
	MOVLW	B'00001010'
	MOVWF	X5
	RETURN
;
SETFNTKNNKU
	MOVF	CHR,W
	XORLW	'ｸ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNKE
	MOVLW	B'00000100'
	MOVWF	X1
	MOVLW	B'00000011'
	MOVWF	X2
	MOVLW	B'01000001'
	MOVWF	X3
	MOVLW	B'00100001'
	MOVWF	X4
	MOVLW	B'00011111'
	MOVWF	X5
	RETURN
;
SETFNTKNNKE
	MOVF	CHR,W
	XORLW	'ｹ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNKO
	MOVLW	B'00001000'
	MOVWF	X1
	MOVLW	B'00000111'
	MOVWF	X2
	MOVLW	B'01000010'
	MOVWF	X3
	MOVLW	B'00111110'
	MOVWF	X4
	MOVLW	B'00000010'
	MOVWF	X5
	RETURN
;
SETFNTKNNKO
	MOVF	CHR,W
	XORLW	'ｺ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNSA
	MOVLW	B'01000010'
	MOVWF	X1
	MOVLW	B'01000010'
	MOVWF	X2
	MOVLW	B'01000010'
	MOVWF	X3
	MOVLW	B'01000010'
	MOVWF	X4
	MOVLW	B'01111110'
	MOVWF	X5
	RETURN
;
SETFNTKNNSA
	MOVF	CHR,W
	XORLW	'ｻ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNSI
	MOVLW	B'00000010'
	MOVWF	X1
	MOVLW	B'00001111'
	MOVWF	X2
	MOVLW	B'01000010'
	MOVWF	X3
	MOVLW	B'00111111'
	MOVWF	X4
	MOVLW	B'00000010'
	MOVWF	X5
	RETURN
;
SETFNTKNNSI
	MOVF	CHR,W
	XORLW	'ｼ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNSU
	MOVLW	B'00001010'
	MOVWF	X1
	MOVLW	B'00010100'
	MOVWF	X2
	MOVLW	B'00000000'
	MOVWF	X3
	MOVLW	B'01000000'
	MOVWF	X4
	MOVLW	B'00111110'
	MOVWF	X5
	RETURN
;
SETFNTKNNSU
	MOVF	CHR,W
	XORLW	'ｽ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNSE
	MOVLW	B'01000010'
	MOVWF	X1
	MOVLW	B'00100010'
	MOVWF	X2
	MOVLW	B'00011010'
	MOVWF	X3
	MOVLW	B'00100110'
	MOVWF	X4
	MOVLW	B'01000010'
	MOVWF	X5
	RETURN
;
SETFNTKNNSE
	MOVF	CHR,W
	XORLW	'ｾ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNSO
	MOVLW	B'00000100'
	MOVWF	X1
	MOVLW	B'01111111'
	MOVWF	X2
	MOVLW	B'01000100'
	MOVWF	X3
	MOVLW	B'01000100'
	MOVWF	X4
	MOVLW	B'01011100'
	MOVWF	X5
	RETURN
;
SETFNTKNNSO
	MOVF	CHR,W
	XORLW	'ｿ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNTA
	MOVLW	B'00000010'
	MOVWF	X1
	MOVLW	B'00000100'
	MOVWF	X2
	MOVLW	B'01000000'
	MOVWF	X3
	MOVLW	B'00100000'
	MOVWF	X4
	MOVLW	B'00011110'
	MOVWF	X5
	RETURN
;
SETFNTKNNTA
	MOVF	CHR,W
	XORLW	'ﾀ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNTH
	MOVLW	B'00001000'
	MOVWF	X1
	MOVLW	B'00000110'
	MOVWF	X2
	MOVLW	B'01001001'
	MOVWF	X3
	MOVLW	B'00100001'
	MOVWF	X4
	MOVLW	B'00011111'
	MOVWF	X5
	RETURN
;
SETFNTKNNTH
	MOVF	CHR,W
	XORLW	'ﾁ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNTU
	MOVLW	B'00001000'
	MOVWF	X1
	MOVLW	B'01001010'
	MOVWF	X2
	MOVLW	B'00111111'
	MOVWF	X3
	MOVLW	B'00001001'
	MOVWF	X4
	MOVLW	B'00001000'
	MOVWF	X5
	RETURN
;
SETFNTKNNTU
	MOVF	CHR,W
	XORLW	'ﾂ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNTE
	MOVLW	B'00000100'
	MOVWF	X1
	MOVLW	B'00001000'
	MOVWF	X2
	MOVLW	B'00000100'
	MOVWF	X3
	MOVLW	B'01001000'
	MOVWF	X4
	MOVLW	B'00111110'
	MOVWF	X5
	RETURN
;
SETFNTKNNTE
	MOVF	CHR,W
	XORLW	'ﾃ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNTO
	MOVLW	B'00000100'
	MOVWF	X1
	MOVLW	B'01000101'
	MOVWF	X2
	MOVLW	B'00111101'
	MOVWF	X3
	MOVLW	B'00000101'
	MOVWF	X4
	MOVLW	B'00000100'
	MOVWF	X5
	RETURN
;
SETFNTKNNTO
	MOVF	CHR,W
	XORLW	'ﾄ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNNA
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'01111111'
	MOVWF	X2
	MOVLW	B'00001000'
	MOVWF	X3
	MOVLW	B'00010000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTKNNNA
	MOVF	CHR,W
	XORLW	'ﾅ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNNI
	MOVLW	B'00000100'
	MOVWF	X1
	MOVLW	B'00000100'
	MOVWF	X2
	MOVLW	B'01000100'
	MOVWF	X3
	MOVLW	B'00111111'
	MOVWF	X4
	MOVLW	B'00000100'
	MOVWF	X5
	RETURN
;
SETFNTKNNNI
	MOVF	CHR,W
	XORLW	'ﾆ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNNU
	MOVLW	B'01000000'
	MOVWF	X1
	MOVLW	B'01000010'
	MOVWF	X2
	MOVLW	B'01000010'
	MOVWF	X3
	MOVLW	B'01000010'
	MOVWF	X4
	MOVLW	B'01000000'
	MOVWF	X5
	RETURN
;
SETFNTKNNNU
	MOVF	CHR,W
	XORLW	'ﾇ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNNE
	MOVLW	B'01000010'
	MOVWF	X1
	MOVLW	B'00101010'
	MOVWF	X2
	MOVLW	B'00010010'
	MOVWF	X3
	MOVLW	B'00101010'
	MOVWF	X4
	MOVLW	B'01000110'
	MOVWF	X5
	RETURN
;
SETFNTKNNNE
	MOVF	CHR,W
	XORLW	'ﾈ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNNO
	MOVLW	B'00100010'
	MOVWF	X1
	MOVLW	B'00010010'
	MOVWF	X2
	MOVLW	B'01111011'
	MOVWF	X3
	MOVLW	B'00010110'
	MOVWF	X4
	MOVLW	B'00100010'
	MOVWF	X5
	RETURN
;
SETFNTKNNNO
	MOVF	CHR,W
	XORLW	'ﾉ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNHA
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'00000000'
	MOVWF	X2
	MOVLW	B'01000000'
	MOVWF	X3
	MOVLW	B'00111111'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTKNNHA
	MOVF	CHR,W
	XORLW	'ﾊ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNHI
	MOVLW	B'01100000'
	MOVWF	X1
	MOVLW	B'00011110'
	MOVWF	X2
	MOVLW	B'00000000'
	MOVWF	X3
	MOVLW	B'00011110'
	MOVWF	X4
	MOVLW	B'01100000'
	MOVWF	X5
	RETURN
;
SETFNTKNNHI
	MOVF	CHR,W
	XORLW	'ﾋ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNHU
	MOVLW	B'00111110'
	MOVWF	X1
	MOVLW	B'01001000'
	MOVWF	X2
	MOVLW	B'01001000'
	MOVWF	X3
	MOVLW	B'01001000'
	MOVWF	X4
	MOVLW	B'01001000'
	MOVWF	X5
	RETURN
;
SETFNTKNNHU
	MOVF	CHR,W
	XORLW	'ﾌ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNHE
	MOVLW	B'00000010'
	MOVWF	X1
	MOVLW	B'00000010'
	MOVWF	X2
	MOVLW	B'01000010'
	MOVWF	X3
	MOVLW	B'01000010'
	MOVWF	X4
	MOVLW	B'00111110'
	MOVWF	X5
	RETURN
;
SETFNTKNNHE
	MOVF	CHR,W
	XORLW	'ﾍ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNHO
	MOVLW	B'00001000'
	MOVWF	X1
	MOVLW	B'00000100'
	MOVWF	X2
	MOVLW	B'00000100'
	MOVWF	X3
	MOVLW	B'00001000'
	MOVWF	X4
	MOVLW	B'00010000'
	MOVWF	X5
	RETURN
;
SETFNTKNNHO
	MOVF	CHR,W
	XORLW	'ﾎ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNMA
	MOVLW	B'00110010'
	MOVWF	X1
	MOVLW	B'00000010'
	MOVWF	X2
	MOVLW	B'01111111'
	MOVWF	X3
	MOVLW	B'00000010'
	MOVWF	X4
	MOVLW	B'00110010'
	MOVWF	X5
	RETURN
;
SETFNTKNNMA
	MOVF	CHR,W
	XORLW	'ﾏ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNMI
	MOVLW	B'00000010'
	MOVWF	X1
	MOVLW	B'00001010'
	MOVWF	X2
	MOVLW	B'00010010'
	MOVWF	X3
	MOVLW	B'00101010'
	MOVWF	X4
	MOVLW	B'01000110'
	MOVWF	X5
	RETURN
;
SETFNTKNNMI
	MOVF	CHR,W
	XORLW	'ﾐ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNMU
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'01001001'
	MOVWF	X2
	MOVLW	B'01001001'
	MOVWF	X3
	MOVLW	B'01001001'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTKNNMU
	MOVF	CHR,W
	XORLW	'ﾑ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNME
	MOVLW	B'01110000'
	MOVWF	X1
	MOVLW	B'01001111'
	MOVWF	X2
	MOVLW	B'01000000'
	MOVWF	X3
	MOVLW	B'00110000'
	MOVWF	X4
	MOVLW	B'01000000'
	MOVWF	X5
	RETURN
;
SETFNTKNNME
	MOVF	CHR,W
	XORLW	'ﾒ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNMO
	MOVLW	B'01000000'
	MOVWF	X1
	MOVLW	B'00101000'
	MOVWF	X2
	MOVLW	B'00011111'
	MOVWF	X3
	MOVLW	B'00100000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTKNNMO
	MOVF	CHR,W
	XORLW	'ﾓ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNYA
	MOVLW	B'00001010'
	MOVWF	X1
	MOVLW	B'01111110'
	MOVWF	X2
	MOVLW	B'01001010'
	MOVWF	X3
	MOVLW	B'01001010'
	MOVWF	X4
	MOVLW	B'01001010'
	MOVWF	X5
	RETURN
;
SETFNTKNNYA
	MOVF	CHR,W
	XORLW	'ﾔ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNYU
	MOVLW	B'00000100'
	MOVWF	X1
	MOVLW	B'01111111'
	MOVWF	X2
	MOVLW	B'00000100'
	MOVWF	X3
	MOVLW	B'00010100'
	MOVWF	X4
	MOVLW	B'00001100'
	MOVWF	X5
	RETURN
;
SETFNTKNNYU
	MOVF	CHR,W
	XORLW	'ﾕ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNYO
	MOVLW	B'01000000'
	MOVWF	X1
	MOVLW	B'01000100'
	MOVWF	X2
	MOVLW	B'01000100'
	MOVWF	X3
	MOVLW	B'01111100'
	MOVWF	X4
	MOVLW	B'01000000'
	MOVWF	X5
	RETURN
;
SETFNTKNNYO
	MOVF	CHR,W
	XORLW	'ﾖ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNRA
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'01010100'
	MOVWF	X2
	MOVLW	B'01010100'
	MOVWF	X3
	MOVLW	B'01111100'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTKNNRA
	MOVF	CHR,W
	XORLW	'ﾗ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNRI
	MOVLW	B'00000100'
	MOVWF	X1
	MOVLW	B'00000101'
	MOVWF	X2
	MOVLW	B'01000101'
	MOVWF	X3
	MOVLW	B'01000101'
	MOVWF	X4
	MOVLW	B'00111100'
	MOVWF	X5
	RETURN
;
SETFNTKNNRI
	MOVF	CHR,W
	XORLW	'ﾘ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNRU
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'00001111'
	MOVWF	X2
	MOVLW	B'00000000'
	MOVWF	X3
	MOVLW	B'01000000'
	MOVWF	X4
	MOVLW	B'00111111'
	MOVWF	X5
	RETURN
;
SETFNTKNNRU
	MOVF	CHR,W
	XORLW	'ﾙ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNRE
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'00000000'
	MOVWF	X2
	MOVLW	B'01111111'
	MOVWF	X3
	MOVLW	B'01000000'
	MOVWF	X4
	MOVLW	B'00100000'
	MOVWF	X5
	RETURN
;
SETFNTKNNRE
	MOVF	CHR,W
	XORLW	'ﾚ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNRO
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'01111111'
	MOVWF	X2
	MOVLW	B'01000000'
	MOVWF	X3
	MOVLW	B'01000000'
	MOVWF	X4
	MOVLW	B'00100000'
	MOVWF	X5
	RETURN
;
SETFNTKNNRO
	MOVF	CHR,W
	XORLW	'ﾛ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNWA
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'01111110'
	MOVWF	X2
	MOVLW	B'01000010'
	MOVWF	X3
	MOVLW	B'01000010'
	MOVWF	X4
	MOVLW	B'01111110'
	MOVWF	X5
	RETURN
;
SETFNTKNNWA
	MOVF	CHR,W
	XORLW	'ﾜ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNNN
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'00001110'
	MOVWF	X2
	MOVLW	B'00000010'
	MOVWF	X3
	MOVLW	B'01000010'
	MOVWF	X4
	MOVLW	B'00111110'
	MOVWF	X5
	RETURN
;
SETFNTKNNN
	MOVF	CHR,W
	XORLW	'ﾝ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNTN
	MOVLW	B'00000010'
	MOVWF	X1
	MOVLW	B'00000100'
	MOVWF	X2
	MOVLW	B'01000000'
	MOVWF	X3
	MOVLW	B'00110000'
	MOVWF	X4
	MOVLW	B'00001110'
	MOVWF	X5
	RETURN
;
SETFNTKNTN
	MOVF	CHR,W
	XORLW	'ﾞ'
	BTFSS	STATUS,Z
	GOTO	SETFNTKNKN
	MOVLW	B'00000111'
	MOVWF	X1
	MOVLW	B'00000000'
	MOVWF	X2
	MOVLW	B'00000111'
	MOVWF	X3
	MOVLW	B'00000000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTKNKN
	MOVF	CHR,W
	XORLW	'ﾟ'
	BTFSS	STATUS,Z
	GOTO	SETFNTSPP
	MOVLW	B'00000111'
	MOVWF	X1
	MOVLW	B'00000101'
	MOVWF	X2
	MOVLW	B'00000111'
	MOVWF	X3
	MOVLW	B'00000000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
; ****************
;   ELSE
; ****************
;
SETFNTSPP
	MOVF	CHR,W
	XORLW	' '
	BTFSS	STATUS,Z
	GOTO	SETFNTSU
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'00000000'
	MOVWF	X2
	MOVLW	B'00000000'
	MOVWF	X3
	MOVLW	B'00000000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTSU
	MOVF	CHR,W
	XORLW	'u'
	BTFSS	STATUS,Z
	GOTO	SETFNTSD
	MOVLW	B'00000100'
	MOVWF	X1
	MOVLW	B'00000010'
	MOVWF	X2
	MOVLW	B'01111111'
	MOVWF	X3
	MOVLW	B'00000010'
	MOVWF	X4
	MOVLW	B'00000100'
	MOVWF	X5
	RETURN
;
SETFNTSD
	MOVF	CHR,W
	XORLW	'd'
	BTFSS	STATUS,Z
	GOTO	SETFNTSR
	MOVLW	B'00010000'
	MOVWF	X1
	MOVLW	B'00100000'
	MOVWF	X2
	MOVLW	B'01111111'
	MOVWF	X3
	MOVLW	B'00100000'
	MOVWF	X4
	MOVLW	B'00010000'
	MOVWF	X5
	RETURN
;
SETFNTSR
	MOVF	CHR,W
	XORLW	'r'
	BTFSS	STATUS,Z
	GOTO	SETFNTSL
	MOVLW	B'00001000'
	MOVWF	X1
	MOVLW	B'01001001'
	MOVWF	X2
	MOVLW	B'00101010'
	MOVWF	X3
	MOVLW	B'00011100'
	MOVWF	X4
	MOVLW	B'00001000'
	MOVWF	X5
	RETURN
;
SETFNTSL
	MOVF	CHR,W
	XORLW	'l'
	BTFSS	STATUS,Z
	GOTO	SETFNTSA
	MOVLW	B'00001000'
	MOVWF	X1
	MOVLW	B'00011100'
	MOVWF	X2
	MOVLW	B'00101010'
	MOVWF	X3
	MOVLW	B'01001001'
	MOVWF	X4
	MOVLW	B'00001000'
	MOVWF	X5
	RETURN
;
SETFNTSA
	MOVF	CHR,W
	XORLW	'a'
	BTFSS	STATUS,Z
	GOTO	SETFNTPPP
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'01111111'
	MOVWF	X2
	MOVLW	B'01111111'
	MOVWF	X3
	MOVLW	B'01111111'
	MOVWF	X4
	MOVLW	B'01111111'
	MOVWF	X5
	RETURN
;
SETFNTPPP
	MOVF	CHR,W
	XORLW	'+'
	BTFSS	STATUS,Z
	GOTO	SETFNTPPN
	MOVLW	B'00001000'
	MOVWF	X1
	MOVLW	B'00001000'
	MOVWF	X2
	MOVLW	B'01111111'
	MOVWF	X3
	MOVLW	B'00001000'
	MOVWF	X4
	MOVLW	B'00001000'
	MOVWF	X5
	RETURN
;
SETFNTPPN
	MOVF	CHR,W
	XORLW	'-'
	BTFSS	STATUS,Z
	GOTO	SETFNTPPE
	MOVLW	B'00001000'
	MOVWF	X1
	MOVLW	B'00001000'
	MOVWF	X2
	MOVLW	B'00001000'
	MOVWF	X3
	MOVLW	B'00001000'
	MOVWF	X4
	MOVLW	B'00001000'
	MOVWF	X5
	RETURN
;
SETFNTPPE
	MOVF	CHR,W
	XORLW	'='
	BTFSS	STATUS,Z
	GOTO	SETFNTEK1R
	MOVLW	B'00010100'
	MOVWF	X1
	MOVLW	B'00010100'
	MOVWF	X2
	MOVLW	B'00010100'
	MOVWF	X3
	MOVLW	B'00010100'
	MOVWF	X4
	MOVLW	B'00010100'
	MOVWF	X5
	RETURN
;
SETFNTEK1R
	MOVF	CHR,W
	XORLW	')'
	BTFSS	STATUS,Z
	GOTO	SETFNTPK1L
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'00000000'
	MOVWF	X2
	MOVLW	B'00000000'
	MOVWF	X3
	MOVLW	B'01000001'
	MOVWF	X4
	MOVLW	B'00111110'
	MOVWF	X5
	RETURN
;
SETFNTPK1L
	MOVF	CHR,W
	XORLW	'('
	BTFSS	STATUS,Z
	GOTO	SETFNTEK2R
	MOVLW	B'00111110'
	MOVWF	X1
	MOVLW	B'01000001'
	MOVWF	X2
	MOVLW	B'00000000'
	MOVWF	X3
	MOVLW	B'00000000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTEK2R
	MOVF	CHR,W
	XORLW	']'
	BTFSS	STATUS,Z
	GOTO	SETFNTPK2L
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'00000000'
	MOVWF	X2
	MOVLW	B'00000000'
	MOVWF	X3
	MOVLW	B'01000001'
	MOVWF	X4
	MOVLW	B'01111111'
	MOVWF	X5
	RETURN
;
SETFNTPK2L
	MOVF	CHR,W
	XORLW	'['
	BTFSS	STATUS,Z
	GOTO	SETFNTEK3R
	MOVLW	B'01111111'
	MOVWF	X1
	MOVLW	B'01000001'
	MOVWF	X2
	MOVLW	B'00000000'
	MOVWF	X3
	MOVLW	B'00000000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTEK3R
	MOVF	CHR,W
	XORLW	'>'
	BTFSS	STATUS,Z
	GOTO	SETFNTPK3L
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'01000001'
	MOVWF	X2
	MOVLW	B'00100010'
	MOVWF	X3
	MOVLW	B'00010100'
	MOVWF	X4
	MOVLW	B'00001000'
	MOVWF	X5
	RETURN
;
SETFNTPK3L
	MOVF	CHR,W
	XORLW	'['
	BTFSS	STATUS,Z
	GOTO	SETFNTPPMU
	MOVLW	B'00001000'
	MOVWF	X1
	MOVLW	B'00010100'
	MOVWF	X2
	MOVLW	B'00100010'
	MOVWF	X3
	MOVLW	B'01000001'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTPPMU
	MOVF	CHR,W
	XORLW	'*'
	BTFSS	STATUS,Z
	GOTO	SETFNTPPWA
	MOVLW	B'00100010'
	MOVWF	X1
	MOVLW	B'00010100'
	MOVWF	X2
	MOVLW	B'00001000'
	MOVWF	X3
	MOVLW	B'00010100'
	MOVWF	X4
	MOVLW	B'00100010'
	MOVWF	X5
	RETURN

;
SETFNTPPWA
	MOVF	CHR,W
	XORLW	'/'
	BTFSS	STATUS,Z
	GOTO	SETFNTPWBU
	MOVLW	B'10000000'
	MOVWF	X1
	MOVLW	B'01100000'
	MOVWF	X2
	MOVLW	B'00011000'
	MOVWF	X3
	MOVLW	B'00000110'
	MOVWF	X4
	MOVLW	B'00000001'
	MOVWF	X5
	RETURN
;
SETFNTPWBU
	MOVF	CHR,W
	XORLW	'"'
	BTFSS	STATUS,Z
	GOTO	SETFNTPBIK
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'00000111'
	MOVWF	X2
	MOVLW	B'00000000'
	MOVWF	X3
	MOVLW	B'00000111'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTPBIK
	MOVF	CHR,W
	XORLW	'!'
	BTFSS	STATUS,Z
	GOTO	SETFNTPBCL
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'00000000'
	MOVWF	X2
	MOVLW	B'11011111'
	MOVWF	X3
	MOVLW	B'00000000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTPBCL
	MOVF	CHR,W
	XORLW	'c'
	BTFSS	STATUS,Z
	GOTO	SETFNTPKANM
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'00000000'
	MOVWF	X2
	MOVLW	B'00000000'
	MOVWF	X3
	MOVLW	B'00000000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	MOVLW	B'00000000'
	MOVWF	X6
;
	MOVLW	H'00'
	MOVWF	DSPCOD
	CALL	SETFNT
	RETURN
;
SETFNTPKANM
	MOVF	CHR,W
	XORLW	','
	BTFSS	STATUS,Z
	GOTO	SETFNTPTEN
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'01000000'
	MOVWF	X2
	MOVLW	B'00110000'
	MOVWF	X3
	MOVLW	B'00000000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTPTEN
	MOVF	CHR,W
	XORLW	'.'
	BTFSS	STATUS,Z
	GOTO	SETFNTPKOR
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'00000000'
	MOVWF	X2
	MOVLW	B'01100000'
	MOVWF	X3
	MOVLW	B'00000000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTPKOR
	MOVF	CHR,W
	XORLW	':'
	BTFSS	STATUS,Z
	GOTO	SETFNTPSKOR
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'00000000'
	MOVWF	X2
	MOVLW	B'00110110'
	MOVWF	X3
	MOVLW	B'00000000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTPSKOR
	MOVF	CHR,W
	XORLW	';'
	BTFSS	STATUS,Z
	GOTO	SETFNTPMAD1
	MOVLW	B'00000000'
	MOVWF	X1
	MOVLW	B'01000000'
	MOVWF	X2
	MOVLW	B'00110110'
	MOVWF	X3
	MOVLW	B'00000000'
	MOVWF	X4
	MOVLW	B'00000000'
	MOVWF	X5
	RETURN
;
SETFNTPMAD1
	MOVF	CHR,W
	XORLW	H'FD'
	BTFSS	STATUS,Z
	GOTO	SETFNTPMAD2
;
	MOVLW	B'01010101'
	MOVWF	X1
	MOVLW	B'10101010'
	MOVWF	X2
	MOVLW	B'01010101'
	MOVWF	X3
	MOVLW	B'10101010'
	MOVWF	X4
	MOVLW	B'01010101'
	MOVWF	X5
	MOVLW	B'10101010'
	MOVWF	X6
;
	MOVLW	H'FD'
	MOVWF	DSPCOD
	CALL	SETFNT
	RETURN
;
SETFNTPMAD2
	MOVF	CHR,W
	XORLW	H'FE'
	BTFSS	STATUS,Z
	GOTO	SETFNTEE
;
	MOVLW	B'10101010'
	MOVWF	X1
	MOVLW	B'01010101'
	MOVWF	X2
	MOVLW	B'10101010'
	MOVWF	X3
	MOVLW	B'01010101'
	MOVWF	X4
	MOVLW	B'10101010'
	MOVWF	X5
	MOVLW	B'01010101'
	MOVWF	X6
;
	MOVLW	H'FE'
	MOVWF	DSPCOD
	CALL	SETFNT
	RETURN
;
SETFNTEE
	MOVLW	B'00000110'
	MOVWF	X1
	MOVLW	B'00001001'
	MOVWF	X2
	MOVLW	B'01110001'
	MOVWF	X3
	MOVLW	B'00000001'
	MOVWF	X4
	MOVLW	B'00000010'
	MOVWF	X5
	RETURN

;******************************************************************************************
;   Function Name : CLRFNT86
;   Title         : フォントを設定する(8*6)
;   Input         : W-reg
;   Output        :
;   Description   : 
;******************************************************************************************
CLRFNT86
	CLRF	X1
	CLRF	X2
	CLRF	X3
	CLRF	X4
	CLRF	X5
	CLRF	X6
	RETURN

;
;******************************************************************************************
;   Function Name : MOVSFNT
;   Title         : フォントをスクロールする(8*8)
;   Input         : 
;   Output        : 
;   Disctiption   : 
;******************************************************************************************
MOVSFNT
; 1B -> 1A
	MOVF	DA08,W
	MOVWF	DA00
	MOVF	DA09,W
	MOVWF	DA01
	MOVF	DA0A,W
	MOVWF	DA02
	MOVF	DA0B,W
	MOVWF	DA03
	MOVF	DA0C,W
	MOVWF	DA04
	MOVF	DA0D,W
	MOVWF	DA05
	MOVF	DA0E,W
	MOVWF	DA06
	MOVF	DA0F,W
	MOVWF	DA07
; 1C -> 1B
	MOVF	DA10,W
	MOVWF	DA08
	MOVF	DA11,W
	MOVWF	DA09
	MOVF	DA12,W
	MOVWF	DA0A
	MOVF	DA13,W
	MOVWF	DA0B
	MOVF	DA14,W
	MOVWF	DA0C
	MOVF	DA15,W
	MOVWF	DA0D
	MOVF	DA16,W
	MOVWF	DA0E
	MOVF	DA17,W
	MOVWF	DA0F
; 1D -> 1C
	MOVF	DA18,W
	MOVWF	DA10
	MOVF	DA19,W
	MOVWF	DA11
	MOVF	DA1A,W
	MOVWF	DA12
	MOVF	DA1B,W
	MOVWF	DA13
	MOVF	DA1C,W
	MOVWF	DA14
	MOVF	DA1D,W
	MOVWF	DA15
	MOVF	DA1E,W
	MOVWF	DA16
	MOVF	DA1F,W
	MOVWF	DA17
; 2A -> 1D
	MOVF	DB00,W
	MOVWF	DA18
	MOVF	DB01,W
	MOVWF	DA19
	MOVF	DB02,W
	MOVWF	DA1A
	MOVF	DB03,W
	MOVWF	DA1B
	MOVF	DB04,W
	MOVWF	DA1C
	MOVF	DB05,W
	MOVWF	DA1D
	MOVF	DB06,W
	MOVWF	DA1E
	MOVF	DB07,W
	MOVWF	DA1F
; 2B -> 2A
	MOVF	DB08,W
	MOVWF	DB00
	MOVF	DB09,W
	MOVWF	DB01
	MOVF	DB0A,W
	MOVWF	DB02
	MOVF	DB0B,W
	MOVWF	DB03
	MOVF	DB0C,W
	MOVWF	DB04
	MOVF	DB0D,W
	MOVWF	DB05
	MOVF	DB0E,W
	MOVWF	DB06
	MOVF	DB0F,W
	MOVWF	DB07
; 2C -> 2B
	MOVF	DB10,W
	MOVWF	DB08
	MOVF	DB11,W
	MOVWF	DB09
	MOVF	DB12,W
	MOVWF	DB0A
	MOVF	DB13,W
	MOVWF	DB0B
	MOVF	DB14,W
	MOVWF	DB0C
	MOVF	DB15,W
	MOVWF	DB0D
	MOVF	DB16,W
	MOVWF	DB0E
	MOVF	DB17,W
	MOVWF	DB0F
; 2D -> 2C
	MOVF	DB18,W
	MOVWF	DB10
	MOVF	DB19,W
	MOVWF	DB11
	MOVF	DB1A,W
	MOVWF	DB12
	MOVF	DB1B,W
	MOVWF	DB13
	MOVF	DB1C,W
	MOVWF	DB14
	MOVF	DB1D,W
	MOVWF	DB15
	MOVF	DB1E,W
	MOVWF	DB16
	MOVF	DB1F,W
	MOVWF	DB17
;
	RETURN


;******************************************************************************************
;   Function Name : MOVFNT86
;   Title         : フォントをスクロールする(8*6)
;   Input         : 
;   Output        : 
;   Disctiption   : 
;******************************************************************************************
MOVFNT86
; 1B -> 1A
	MOVF	DA06,W
	MOVWF	DA00
	MOVF	DA07,W
	MOVWF	DA01
	MOVF	DA08,W
	MOVWF	DA02
	MOVF	DA09,W
	MOVWF	DA03
	MOVF	DA0A,W
	MOVWF	DA04
	MOVF	DA0B,W
	MOVWF	DA05
; 1C -> 1B
	MOVF	DA0C,W
	MOVWF	DA06
	MOVF	DA0D,W
	MOVWF	DA07
	MOVF	DA0E,W
	MOVWF	DA08
	MOVF	DA0F,W
	MOVWF	DA09
	MOVF	DA10,W
	MOVWF	DA0A
	MOVF	DA11,W
	MOVWF	DA0B
; 1D -> 1C
	MOVF	DA12,W
	MOVWF	DA0C
	MOVF	DA13,W
	MOVWF	DA0D
	MOVF	DA14,W
	MOVWF	DA0E
	MOVF	DA15,W
	MOVWF	DA0F
	MOVF	DA16,W
	MOVWF	DA10
	MOVF	DA17,W
	MOVWF	DA11
; 1E -> 1D
	MOVF	DA18,W
	MOVWF	DA12
	MOVF	DA19,W
	MOVWF	DA13
	MOVF	DA1A,W
	MOVWF	DA14
	MOVF	DA1B,W
	MOVWF	DA15
	MOVF	DA1C,W
	MOVWF	DA16
	MOVF	DA1D,W
	MOVWF	DA17
; 2A -> 1E
	MOVF	DB00,W
	MOVWF	DA18
	MOVF	DB01,W
	MOVWF	DA19
	MOVF	DB02,W
	MOVWF	DA1A
	MOVF	DB03,W
	MOVWF	DA1B
	MOVF	DB04,W
	MOVWF	DA1C
	MOVF	DB05,W
	MOVWF	DA1D
; CLRF
	CLRF	DA1E
	CLRF	DA1F
;
;
;
; 2B -> 2A
	MOVF	DB06,W
	MOVWF	DB00
	MOVF	DB07,W
	MOVWF	DB01
	MOVF	DB08,W
	MOVWF	DB02
	MOVF	DB09,W
	MOVWF	DB03
	MOVF	DB0A,W
	MOVWF	DB04
	MOVF	DB0B,W
	MOVWF	DB05
; 2C -> 2B
	MOVF	DB0C,W
	MOVWF	DB06
	MOVF	DB0D,W
	MOVWF	DB07
	MOVF	DB0E,W
	MOVWF	DB08
	MOVF	DB0F,W
	MOVWF	DB09
	MOVF	DB10,W
	MOVWF	DB0A
	MOVF	DB11,W
	MOVWF	DB0B
; 2D -> 2C
	MOVF	DB12,W
	MOVWF	DB0C
	MOVF	DB13,W
	MOVWF	DB0D
	MOVF	DB14,W
	MOVWF	DB0E
	MOVF	DB15,W
	MOVWF	DB0F
	MOVF	DB16,W
	MOVWF	DB10
	MOVF	DB17,W
	MOVWF	DB11
; 2E -> 2D
	MOVF	DB18,W
	MOVWF	DB12
	MOVF	DB19,W
	MOVWF	DB13
	MOVF	DB1A,W
	MOVWF	DB14
	MOVF	DB1B,W
	MOVWF	DB15
	MOVF	DB1C,W
	MOVWF	DB16
	MOVF	DB1D,W
	MOVWF	DB17
; IN -> 2E
	MOVF	X1,W
	MOVWF	DB18
	MOVF	X2,W
	MOVWF	DB19
	MOVF	X3,W
	MOVWF	DB1A
	MOVF	X4,W
	MOVWF	DB1B
	MOVF	X5,W
	MOVWF	DB1C
	MOVF	X6,W
	MOVWF	DB1D
; CLRF
	CLRF	DB1E
	CLRF	DB1F
;
	RETURN
;******************************************************************************************
;   Function Name : SETFNT
;   Title         : 文字コードを指定して、フォントをセットする(16*32)
;   Input         : DSPCOD
;   Output        : 
;   Disctiption   : 
;******************************************************************************************
SETFNT
;=========================================================
;  キャラクタコード(00)
;    記号 ' ' ※何も表示しない
;=========================================================
	MOVF	DSPCOD,W
	XORLW	H'00'
	BTFSS	STATUS,Z
	GOTO	FEND00
	MOVLW	B'00000000'
	MOVWF	DA00
	MOVLW	B'00000000'
	MOVWF	DB00
	MOVLW	B'00000000'
	MOVWF	DA01
	MOVLW	B'00000000'
	MOVWF	DB01
	MOVLW	B'00000000'
	MOVWF	DA02
	MOVLW	B'00000000'
	MOVWF	DB02
	MOVLW	B'00000000'
	MOVWF	DA03
	MOVLW	B'00000000'
	MOVWF	DB03
	MOVLW	B'00000000'
	MOVWF	DA04
	MOVLW	B'00000000'
	MOVWF	DB04
	MOVLW	B'00000000'
	MOVWF	DA05
	MOVLW	B'00000000'
	MOVWF	DB05
	MOVLW	B'00000000'
	MOVWF	DA06
	MOVLW	B'00000000'
	MOVWF	DB06
	MOVLW	B'00000000'
	MOVWF	DA07
	MOVLW	B'00000000'
	MOVWF	DB07
	MOVLW	B'00000000'
	MOVWF	DA08
	MOVLW	B'00000000'
	MOVWF	DB08
	MOVLW	B'00000000'
	MOVWF	DA09
	MOVLW	B'00000000'
	MOVWF	DB09
	MOVLW	B'00000000'
	MOVWF	DA0A
	MOVLW	B'00000000'
	MOVWF	DB0A
	MOVLW	B'00000000'
	MOVWF	DA0B
	MOVLW	B'00000000'
	MOVWF	DB0B
	MOVLW	B'00000000'
	MOVWF	DA0C
	MOVLW	B'00000000'
	MOVWF	DB0C
	MOVLW	B'00000000'
	MOVWF	DA0D
	MOVLW	B'00000000'
	MOVWF	DB0D
	MOVLW	B'00000000'
	MOVWF	DA0E
	MOVLW	B'00000000'
	MOVWF	DB0E
	MOVLW	B'00000000'
	MOVWF	DA0F
	MOVLW	B'00000000'
	MOVWF	DB0F
	MOVLW	B'00000000'
	MOVWF	DA10
	MOVLW	B'00000000'
	MOVWF	DB10
	MOVLW	B'00000000'
	MOVWF	DA11
	MOVLW	B'00000000'
	MOVWF	DB11
	MOVLW	B'00000000'
	MOVWF	DA12
	MOVLW	B'00000000'
	MOVWF	DB12
	MOVLW	B'00000000'
	MOVWF	DA13
	MOVLW	B'00000000'
	MOVWF	DB13
	MOVLW	B'00000000'
	MOVWF	DA14
	MOVLW	B'00000000'
	MOVWF	DB14
	MOVLW	B'00000000'
	MOVWF	DA15
	MOVLW	B'00000000'
	MOVWF	DB15
	MOVLW	B'00000000'
	MOVWF	DA16
	MOVLW	B'00000000'
	MOVWF	DB16
	MOVLW	B'00000000'
	MOVWF	DA17
	MOVLW	B'00000000'
	MOVWF	DB17
	MOVLW	B'00000000'
	MOVWF	DA18
	MOVLW	B'00000000'
	MOVWF	DB18
	MOVLW	B'00000000'
	MOVWF	DA19
	MOVLW	B'00000000'
	MOVWF	DB19
	MOVLW	B'00000000'
	MOVWF	DA1A
	MOVLW	B'00000000'
	MOVWF	DB1A
	MOVLW	B'00000000'
	MOVWF	DA1B
	MOVLW	B'00000000'
	MOVWF	DB1B
	MOVLW	B'00000000'
	MOVWF	DA1C
	MOVLW	B'00000000'
	MOVWF	DB1C
	MOVLW	B'00000000'
	MOVWF	DA1D
	MOVLW	B'00000000'
	MOVWF	DB1D
	MOVLW	B'00000000'
	MOVWF	DA1E
	MOVLW	B'00000000'
	MOVWF	DB1E
	MOVLW	B'00000000'
	MOVWF	DA1F
	MOVLW	B'00000000'
	MOVWF	DB1F
	RETURN
FEND00
;=========================================================
;  キャラクタコード(2B)
;    記号 '+'
;=========================================================
	MOVF	DSPCOD,W
	XORLW	H'2B'
	BTFSS	STATUS,Z
	GOTO	FEND2B
	MOVLW	B'10000000'
	MOVWF	DA00
	MOVLW	B'00000001'
	MOVWF	DB00
	MOVLW	B'10000000'
	MOVWF	DA01
	MOVLW	B'00000001'
	MOVWF	DB01
	MOVLW	B'10000000'
	MOVWF	DA02
	MOVLW	B'00000001'
	MOVWF	DB02
	MOVLW	B'10000000'
	MOVWF	DA03
	MOVLW	B'00000001'
	MOVWF	DB03
	MOVLW	B'10000000'
	MOVWF	DA04
	MOVLW	B'00000001'
	MOVWF	DB04
	MOVLW	B'10000000'
	MOVWF	DA05
	MOVLW	B'00000001'
	MOVWF	DB05
	MOVLW	B'10000000'
	MOVWF	DA06
	MOVLW	B'00000001'
	MOVWF	DB06
	MOVLW	B'10000000'
	MOVWF	DA07
	MOVLW	B'00000001'
	MOVWF	DB07
	MOVLW	B'10000000'
	MOVWF	DA08
	MOVLW	B'00000001'
	MOVWF	DB08
	MOVLW	B'10000000'
	MOVWF	DA09
	MOVLW	B'00000001'
	MOVWF	DB09
	MOVLW	B'10000000'
	MOVWF	DA0A
	MOVLW	B'00000001'
	MOVWF	DB0A
	MOVLW	B'10000000'
	MOVWF	DA0B
	MOVLW	B'00000001'
	MOVWF	DB0B
	MOVLW	B'10000000'
	MOVWF	DA0C
	MOVLW	B'00000001'
	MOVWF	DB0C
	MOVLW	B'10000000'
	MOVWF	DA0D
	MOVLW	B'00000001'
	MOVWF	DB0D
	MOVLW	B'10000000'
	MOVWF	DA0E
	MOVLW	B'00000001'
	MOVWF	DB0E
	MOVLW	B'11111111'
	MOVWF	DA0F
	MOVLW	B'11111111'
	MOVWF	DB0F
	MOVLW	B'11111111'
	MOVWF	DA10
	MOVLW	B'11111111'
	MOVWF	DB10
	MOVLW	B'10000000'
	MOVWF	DA11
	MOVLW	B'00000001'
	MOVWF	DB11
	MOVLW	B'10000000'
	MOVWF	DA12
	MOVLW	B'00000001'
	MOVWF	DB12
	MOVLW	B'10000000'
	MOVWF	DA13
	MOVLW	B'00000001'
	MOVWF	DB13
	MOVLW	B'10000000'
	MOVWF	DA14
	MOVLW	B'00000001'
	MOVWF	DB14
	MOVLW	B'10000000'
	MOVWF	DA15
	MOVLW	B'00000001'
	MOVWF	DB15
	MOVLW	B'10000000'
	MOVWF	DA16
	MOVLW	B'00000001'
	MOVWF	DB16
	MOVLW	B'10000000'
	MOVWF	DA17
	MOVLW	B'00000001'
	MOVWF	DB17
	MOVLW	B'10000000'
	MOVWF	DA18
	MOVLW	B'00000001'
	MOVWF	DB18
	MOVLW	B'10000000'
	MOVWF	DA19
	MOVLW	B'00000001'
	MOVWF	DB19
	MOVLW	B'10000000'
	MOVWF	DA1A
	MOVLW	B'00000001'
	MOVWF	DB1A
	MOVLW	B'10000000'
	MOVWF	DA1B
	MOVLW	B'00000001'
	MOVWF	DB1B
	MOVLW	B'10000000'
	MOVWF	DA1C
	MOVLW	B'00000001'
	MOVWF	DB1C
	MOVLW	B'10000000'
	MOVWF	DA1D
	MOVLW	B'00000001'
	MOVWF	DB1D
	MOVLW	B'10000000'
	MOVWF	DA1E
	MOVLW	B'00000001'
	MOVWF	DB1E
	MOVLW	B'10000000'
	MOVWF	DA1F
	MOVLW	B'00000001'
	MOVWF	DB1F
	RETURN
FEND2B
;=========================================================
;  キャラクタコード(2D)
;    記号 '-'
;=========================================================
	MOVF	DSPCOD,W
	XORLW	H'2D'
	BTFSS	STATUS,Z
	GOTO	FEND2D
	MOVLW	B'10000000'
	MOVWF	DA00
	MOVLW	B'00000001'
	MOVWF	DB00
	MOVLW	B'10000000'
	MOVWF	DA01
	MOVLW	B'00000001'
	MOVWF	DB01
	MOVLW	B'10000000'
	MOVWF	DA02
	MOVLW	B'00000001'
	MOVWF	DB02
	MOVLW	B'10000000'
	MOVWF	DA03
	MOVLW	B'00000001'
	MOVWF	DB03
	MOVLW	B'10000000'
	MOVWF	DA04
	MOVLW	B'00000001'
	MOVWF	DB04
	MOVLW	B'10000000'
	MOVWF	DA05
	MOVLW	B'00000001'
	MOVWF	DB05
	MOVLW	B'10000000'
	MOVWF	DA06
	MOVLW	B'00000001'
	MOVWF	DB06
	MOVLW	B'10000000'
	MOVWF	DA07
	MOVLW	B'00000001'
	MOVWF	DB07
	MOVLW	B'10000000'
	MOVWF	DA08
	MOVLW	B'00000001'
	MOVWF	DB08
	MOVLW	B'10000000'
	MOVWF	DA09
	MOVLW	B'00000001'
	MOVWF	DB09
	MOVLW	B'10000000'
	MOVWF	DA0A
	MOVLW	B'00000001'
	MOVWF	DB0A
	MOVLW	B'10000000'
	MOVWF	DA0B
	MOVLW	B'00000001'
	MOVWF	DB0B
	MOVLW	B'10000000'
	MOVWF	DA0C
	MOVLW	B'00000001'
	MOVWF	DB0C
	MOVLW	B'10000000'
	MOVWF	DA0D
	MOVLW	B'00000001'
	MOVWF	DB0D
	MOVLW	B'10000000'
	MOVWF	DA0E
	MOVLW	B'00000001'
	MOVWF	DB0E
	MOVLW	B'10000000'
	MOVWF	DA0F
	MOVLW	B'00000001'
	MOVWF	DB0F
	MOVLW	B'10000000'
	MOVWF	DA10
	MOVLW	B'00000001'
	MOVWF	DB10
	MOVLW	B'10000000'
	MOVWF	DA11
	MOVLW	B'00000001'
	MOVWF	DB11
	MOVLW	B'10000000'
	MOVWF	DA12
	MOVLW	B'00000001'
	MOVWF	DB12
	MOVLW	B'10000000'
	MOVWF	DA13
	MOVLW	B'00000001'
	MOVWF	DB13
	MOVLW	B'10000000'
	MOVWF	DA14
	MOVLW	B'00000001'
	MOVWF	DB14
	MOVLW	B'10000000'
	MOVWF	DA15
	MOVLW	B'00000001'
	MOVWF	DB15
	MOVLW	B'10000000'
	MOVWF	DA16
	MOVLW	B'00000001'
	MOVWF	DB16
	MOVLW	B'10000000'
	MOVWF	DA17
	MOVLW	B'00000001'
	MOVWF	DB17
	MOVLW	B'10000000'
	MOVWF	DA18
	MOVLW	B'00000001'
	MOVWF	DB18
	MOVLW	B'10000000'
	MOVWF	DA19
	MOVLW	B'00000001'
	MOVWF	DB19
	MOVLW	B'10000000'
	MOVWF	DA1A
	MOVLW	B'00000001'
	MOVWF	DB1A
	MOVLW	B'10000000'
	MOVWF	DA1B
	MOVLW	B'00000001'
	MOVWF	DB1B
	MOVLW	B'10000000'
	MOVWF	DA1C
	MOVLW	B'00000001'
	MOVWF	DB1C
	MOVLW	B'10000000'
	MOVWF	DA1D
	MOVLW	B'00000001'
	MOVWF	DB1D
	MOVLW	B'10000000'
	MOVWF	DA1E
	MOVLW	B'00000001'
	MOVWF	DB1E
	MOVLW	B'10000000'
	MOVWF	DA1F
	MOVLW	B'00000001'
	MOVWF	DB1F
	RETURN
FEND2D
;=========================================================
;  キャラクタコード(FD)
;    記号  ※斑模様パターンA
;=========================================================
	MOVF	DSPCOD,W
	XORLW	H'FD'
	BTFSS	STATUS,Z
	GOTO	FENDFD
	MOVLW	B'01010101'
	MOVWF	DA00
	MOVLW	B'01010101'
	MOVWF	DB00
	MOVLW	B'10101010'
	MOVWF	DA01
	MOVLW	B'10101010'
	MOVWF	DB01
	MOVLW	B'01010101'
	MOVWF	DA02
	MOVLW	B'01010101'
	MOVWF	DB02
	MOVLW	B'10101010'
	MOVWF	DA03
	MOVLW	B'10101010'
	MOVWF	DB03
	MOVLW	B'01010101'
	MOVWF	DA04
	MOVLW	B'01010101'
	MOVWF	DB04
	MOVLW	B'10101010'
	MOVWF	DA05
	MOVLW	B'10101010'
	MOVWF	DB05
	MOVLW	B'01010101'
	MOVWF	DA06
	MOVLW	B'01010101'
	MOVWF	DB06
	MOVLW	B'10101010'
	MOVWF	DA07
	MOVLW	B'10101010'
	MOVWF	DB07
	MOVLW	B'01010101'
	MOVWF	DA08
	MOVLW	B'01010101'
	MOVWF	DB08
	MOVLW	B'10101010'
	MOVWF	DA09
	MOVLW	B'10101010'
	MOVWF	DB09
	MOVLW	B'01010101'
	MOVWF	DA0A
	MOVLW	B'01010101'
	MOVWF	DB0A
	MOVLW	B'10101010'
	MOVWF	DA0B
	MOVLW	B'10101010'
	MOVWF	DB0B
	MOVLW	B'01010101'
	MOVWF	DA0C
	MOVLW	B'01010101'
	MOVWF	DB0C
	MOVLW	B'10101010'
	MOVWF	DA0D
	MOVLW	B'10101010'
	MOVWF	DB0D
	MOVLW	B'01010101'
	MOVWF	DA0E
	MOVLW	B'01010101'
	MOVWF	DB0E
	MOVLW	B'10101010'
	MOVWF	DA0F
	MOVLW	B'10101010'
	MOVWF	DB0F
	MOVLW	B'01010101'
	MOVWF	DA10
	MOVLW	B'01010101'
	MOVWF	DB10
	MOVLW	B'10101010'
	MOVWF	DA11
	MOVLW	B'10101010'
	MOVWF	DB11
	MOVLW	B'01010101'
	MOVWF	DA12
	MOVLW	B'01010101'
	MOVWF	DB12
	MOVLW	B'10101010'
	MOVWF	DA13
	MOVLW	B'10101010'
	MOVWF	DB13
	MOVLW	B'01010101'
	MOVWF	DA14
	MOVLW	B'01010101'
	MOVWF	DB14
	MOVLW	B'10101010'
	MOVWF	DA15
	MOVLW	B'10101010'
	MOVWF	DB15
	MOVLW	B'01010101'
	MOVWF	DA16
	MOVLW	B'01010101'
	MOVWF	DB16
	MOVLW	B'10101010'
	MOVWF	DA17
	MOVLW	B'10101010'
	MOVWF	DB17
	MOVLW	B'01010101'
	MOVWF	DA18
	MOVLW	B'01010101'
	MOVWF	DB18
	MOVLW	B'10101010'
	MOVWF	DA19
	MOVLW	B'10101010'
	MOVWF	DB19
	MOVLW	B'01010101'
	MOVWF	DA1A
	MOVLW	B'01010101'
	MOVWF	DB1A
	MOVLW	B'10101010'
	MOVWF	DA1B
	MOVLW	B'10101010'
	MOVWF	DB1B
	MOVLW	B'01010101'
	MOVWF	DA1C
	MOVLW	B'01010101'
	MOVWF	DB1C
	MOVLW	B'10101010'
	MOVWF	DA1D
	MOVLW	B'10101010'
	MOVWF	DB1D
	MOVLW	B'01010101'
	MOVWF	DA1E
	MOVLW	B'01010101'
	MOVWF	DB1E
	MOVLW	B'10101010'
	MOVWF	DA1F
	MOVLW	B'10101010'
	MOVWF	DB1F
	RETURN
FENDFD
;=========================================================
;  キャラクタコード(FE)
;    記号  ※斑模様パターンB
;=========================================================
	MOVF	DSPCOD,W
	XORLW	H'FE'
	BTFSS	STATUS,Z
	GOTO	FENDFE
	MOVLW	B'10101010'
	MOVWF	DA00
	MOVLW	B'10101010'
	MOVWF	DB00
	MOVLW	B'01010101'
	MOVWF	DA01
	MOVLW	B'01010101'
	MOVWF	DB01
	MOVLW	B'10101010'
	MOVWF	DA02
	MOVLW	B'10101010'
	MOVWF	DB02
	MOVLW	B'01010101'
	MOVWF	DA03
	MOVLW	B'01010101'
	MOVWF	DB03
	MOVLW	B'10101010'
	MOVWF	DA04
	MOVLW	B'10101010'
	MOVWF	DB04
	MOVLW	B'01010101'
	MOVWF	DA05
	MOVLW	B'01010101'
	MOVWF	DB05
	MOVLW	B'10101010'
	MOVWF	DA06
	MOVLW	B'10101010'
	MOVWF	DB06
	MOVLW	B'01010101'
	MOVWF	DA07
	MOVLW	B'01010101'
	MOVWF	DB07
	MOVLW	B'10101010'
	MOVWF	DA08
	MOVLW	B'10101010'
	MOVWF	DB08
	MOVLW	B'01010101'
	MOVWF	DA09
	MOVLW	B'01010101'
	MOVWF	DB09
	MOVLW	B'10101010'
	MOVWF	DA0A
	MOVLW	B'10101010'
	MOVWF	DB0A
	MOVLW	B'01010101'
	MOVWF	DA0B
	MOVLW	B'01010101'
	MOVWF	DB0B
	MOVLW	B'10101010'
	MOVWF	DA0C
	MOVLW	B'10101010'
	MOVWF	DB0C
	MOVLW	B'01010101'
	MOVWF	DA0D
	MOVLW	B'01010101'
	MOVWF	DB0D
	MOVLW	B'10101010'
	MOVWF	DA0E
	MOVLW	B'10101010'
	MOVWF	DB0E
	MOVLW	B'01010101'
	MOVWF	DA0F
	MOVLW	B'01010101'
	MOVWF	DB0F
	MOVLW	B'10101010'
	MOVWF	DA10
	MOVLW	B'10101010'
	MOVWF	DB10
	MOVLW	B'01010101'
	MOVWF	DA11
	MOVLW	B'01010101'
	MOVWF	DB11
	MOVLW	B'10101010'
	MOVWF	DA12
	MOVLW	B'10101010'
	MOVWF	DB12
	MOVLW	B'01010101'
	MOVWF	DA13
	MOVLW	B'01010101'
	MOVWF	DB13
	MOVLW	B'10101010'
	MOVWF	DA14
	MOVLW	B'10101010'
	MOVWF	DB14
	MOVLW	B'01010101'
	MOVWF	DA15
	MOVLW	B'01010101'
	MOVWF	DB15
	MOVLW	B'10101010'
	MOVWF	DA16
	MOVLW	B'10101010'
	MOVWF	DB16
	MOVLW	B'01010101'
	MOVWF	DA17
	MOVLW	B'01010101'
	MOVWF	DB17
	MOVLW	B'10101010'
	MOVWF	DA18
	MOVLW	B'10101010'
	MOVWF	DB18
	MOVLW	B'01010101'
	MOVWF	DA19
	MOVLW	B'01010101'
	MOVWF	DB19
	MOVLW	B'10101010'
	MOVWF	DA1A
	MOVLW	B'10101010'
	MOVWF	DB1A
	MOVLW	B'01010101'
	MOVWF	DA1B
	MOVLW	B'01010101'
	MOVWF	DB1B
	MOVLW	B'10101010'
	MOVWF	DA1C
	MOVLW	B'10101010'
	MOVWF	DB1C
	MOVLW	B'01010101'
	MOVWF	DA1D
	MOVLW	B'01010101'
	MOVWF	DB1D
	MOVLW	B'10101010'
	MOVWF	DA1E
	MOVLW	B'10101010'
	MOVWF	DB1E
	MOVLW	B'01010101'
	MOVWF	DA1F
	MOVLW	B'01010101'
	MOVWF	DB1F
	RETURN
FENDFE
;=========================================================
;  キャラクタコード(FF)
;    記号  ※全てのLEDを点燈する
;=========================================================
	MOVF	DSPCOD,W
	XORLW	H'FF'
	BTFSS	STATUS,Z
	GOTO	FENDFF
	MOVLW	B'11111111'
	MOVWF	DA00
	MOVLW	B'11111111'
	MOVWF	DB00
	MOVLW	B'11111111'
	MOVWF	DA01
	MOVLW	B'11111111'
	MOVWF	DB01
	MOVLW	B'11111111'
	MOVWF	DA02
	MOVLW	B'11111111'
	MOVWF	DB02
	MOVLW	B'11111111'
	MOVWF	DA03
	MOVLW	B'11111111'
	MOVWF	DB03
	MOVLW	B'11111111'
	MOVWF	DA04
	MOVLW	B'11111111'
	MOVWF	DB04
	MOVLW	B'11111111'
	MOVWF	DA05
	MOVLW	B'11111111'
	MOVWF	DB05
	MOVLW	B'11111111'
	MOVWF	DA06
	MOVLW	B'11111111'
	MOVWF	DB06
	MOVLW	B'11111111'
	MOVWF	DA07
	MOVLW	B'11111111'
	MOVWF	DB07
	MOVLW	B'11111111'
	MOVWF	DA08
	MOVLW	B'11111111'
	MOVWF	DB08
	MOVLW	B'11111111'
	MOVWF	DA09
	MOVLW	B'11111111'
	MOVWF	DB09
	MOVLW	B'11111111'
	MOVWF	DA0A
	MOVLW	B'11111111'
	MOVWF	DB0A
	MOVLW	B'11111111'
	MOVWF	DA0B
	MOVLW	B'11111111'
	MOVWF	DB0B
	MOVLW	B'11111111'
	MOVWF	DA0C
	MOVLW	B'11111111'
	MOVWF	DB0C
	MOVLW	B'11111111'
	MOVWF	DA0D
	MOVLW	B'11111111'
	MOVWF	DB0D
	MOVLW	B'11111111'
	MOVWF	DA0E
	MOVLW	B'11111111'
	MOVWF	DB0E
	MOVLW	B'11111111'
	MOVWF	DA0F
	MOVLW	B'11111111'
	MOVWF	DB0F
	MOVLW	B'11111111'
	MOVWF	DA10
	MOVLW	B'11111111'
	MOVWF	DB10
	MOVLW	B'11111111'
	MOVWF	DA11
	MOVLW	B'11111111'
	MOVWF	DB11
	MOVLW	B'11111111'
	MOVWF	DA12
	MOVLW	B'11111111'
	MOVWF	DB12
	MOVLW	B'11111111'
	MOVWF	DA13
	MOVLW	B'11111111'
	MOVWF	DB13
	MOVLW	B'11111111'
	MOVWF	DA14
	MOVLW	B'11111111'
	MOVWF	DB14
	MOVLW	B'11111111'
	MOVWF	DA15
	MOVLW	B'11111111'
	MOVWF	DB15
	MOVLW	B'11111111'
	MOVWF	DA16
	MOVLW	B'11111111'
	MOVWF	DB16
	MOVLW	B'11111111'
	MOVWF	DA17
	MOVLW	B'11111111'
	MOVWF	DB17
	MOVLW	B'11111111'
	MOVWF	DA18
	MOVLW	B'11111111'
	MOVWF	DB18
	MOVLW	B'11111111'
	MOVWF	DA19
	MOVLW	B'11111111'
	MOVWF	DB19
	MOVLW	B'11111111'
	MOVWF	DA1A
	MOVLW	B'11111111'
	MOVWF	DB1A
	MOVLW	B'11111111'
	MOVWF	DA1B
	MOVLW	B'11111111'
	MOVWF	DB1B
	MOVLW	B'11111111'
	MOVWF	DA1C
	MOVLW	B'11111111'
	MOVWF	DB1C
	MOVLW	B'11111111'
	MOVWF	DA1D
	MOVLW	B'11111111'
	MOVWF	DB1D
	MOVLW	B'11111111'
	MOVWF	DA1E
	MOVLW	B'11111111'
	MOVWF	DB1E
	MOVLW	B'11111111'
	MOVWF	DA1F
	MOVLW	B'11111111'
	MOVWF	DB1F
	RETURN
FENDFF
;=========================================================
;  キャラクタコード(それ以外)
;    記号  ※エラー表示
;=========================================================
	MOVLW	B'11111111'
	MOVWF	DA00
	MOVLW	B'11111111'
	MOVWF	DB00
	MOVLW	B'11111111'
	MOVWF	DA01
	MOVLW	B'11111111'
	MOVWF	DB01
	MOVLW	B'11111111'
	MOVWF	DA02
	MOVLW	B'11111111'
	MOVWF	DB02
	MOVLW	B'11111111'
	MOVWF	DA03
	MOVLW	B'11111111'
	MOVWF	DB03
	MOVLW	B'11111111'
	MOVWF	DA04
	MOVLW	B'11111111'
	MOVWF	DB04
	MOVLW	B'11111111'
	MOVWF	DA05
	MOVLW	B'11111111'
	MOVWF	DB05
	MOVLW	B'11111111'
	MOVWF	DA06
	MOVLW	B'11111111'
	MOVWF	DB06
	MOVLW	B'11111111'
	MOVWF	DA07
	MOVLW	B'11111111'
	MOVWF	DB07
	MOVLW	B'11111111'
	MOVWF	DA08
	MOVLW	B'11111111'
	MOVWF	DB08
	MOVLW	B'11111111'
	MOVWF	DA09
	MOVLW	B'11111111'
	MOVWF	DB09
	MOVLW	B'11111111'
	MOVWF	DA0A
	MOVLW	B'11111111'
	MOVWF	DB0A
	MOVLW	B'11111111'
	MOVWF	DA0B
	MOVLW	B'11111111'
	MOVWF	DB0B
	MOVLW	B'00001111'
	MOVWF	DA0C
	MOVLW	B'11110000'
	MOVWF	DB0C
	MOVLW	B'00001111'
	MOVWF	DA0D
	MOVLW	B'11110000'
	MOVWF	DB0D
	MOVLW	B'00001111'
	MOVWF	DA0E
	MOVLW	B'11110000'
	MOVWF	DB0E
	MOVLW	B'00001111'
	MOVWF	DA0F
	MOVLW	B'11110000'
	MOVWF	DB0F
	MOVLW	B'00001111'
	MOVWF	DA10
	MOVLW	B'11110000'
	MOVWF	DB10
	MOVLW	B'00001111'
	MOVWF	DA11
	MOVLW	B'11110000'
	MOVWF	DB11
	MOVLW	B'00001111'
	MOVWF	DA12
	MOVLW	B'11110000'
	MOVWF	DB12
	MOVLW	B'00001111'
	MOVWF	DA13
	MOVLW	B'11110000'
	MOVWF	DB13
	MOVLW	B'11111111'
	MOVWF	DA14
	MOVLW	B'11111111'
	MOVWF	DB14
	MOVLW	B'11111111'
	MOVWF	DA15
	MOVLW	B'11111111'
	MOVWF	DB15
	MOVLW	B'11111111'
	MOVWF	DA16
	MOVLW	B'11111111'
	MOVWF	DB16
	MOVLW	B'11111111'
	MOVWF	DA17
	MOVLW	B'11111111'
	MOVWF	DB17
	MOVLW	B'11111111'
	MOVWF	DA18
	MOVLW	B'11111111'
	MOVWF	DB18
	MOVLW	B'11111111'
	MOVWF	DA19
	MOVLW	B'11111111'
	MOVWF	DB19
	MOVLW	B'11111111'
	MOVWF	DA1A
	MOVLW	B'11111111'
	MOVWF	DB1A
	MOVLW	B'11111111'
	MOVWF	DA1B
	MOVLW	B'11111111'
	MOVWF	DB1B
	MOVLW	B'11111111'
	MOVWF	DA1C
	MOVLW	B'11111111'
	MOVWF	DB1C
	MOVLW	B'11111111'
	MOVWF	DA1D
	MOVLW	B'11111111'
	MOVWF	DB1D
	MOVLW	B'11111111'
	MOVWF	DA1E
	MOVLW	B'11111111'
	MOVWF	DB1E
	MOVLW	B'11111111'
	MOVWF	DA1F
	MOVLW	B'11111111'
	MOVWF	DB1F
	RETURN
;******************************************************************************************
;   Function Name : DSPLED
;   Title         : 16*32LEDを表示する
;   Input         : DA00-DA1F,DB00-DB1F
;   Output        : 
;   Disctiption   : 32回のWAIT(10KHz->約300Hz)
;******************************************************************************************
DSPLED
;Initialize
	CALL	CLRLED
;
;
;00(PORTA0)
	BSF	PORTA,0
	MOVF	DA00,W
	MOVWF	PORTC
	MOVF	DB00,W
	MOVWF	PORTD
	BSF	PORTB,0
	CALL	INRDSP
	BCF	PORTB,0	
;01
	MOVF	DA01,W
	MOVWF	PORTC
	MOVF	DB01,W
	MOVWF	PORTD
	BSF	PORTB,1
	CALL	INRDSP
	BCF	PORTB,1
;02
	MOVF	DA02,W
	MOVWF	PORTC
	MOVF	DB02,W
	MOVWF	PORTD
	BSF	PORTB,2
	CALL	INRDSP
	BCF	PORTB,2
;03
	MOVF	DA03,W
	MOVWF	PORTC
	MOVF	DB03,W
	MOVWF	PORTD
	BSF	PORTB,3
	CALL	INRDSP
	BCF	PORTB,3
;04
	MOVF	DA04,W
	MOVWF	PORTC
	MOVF	DB04,W
	MOVWF	PORTD
	BSF	PORTB,4
	CALL	INRDSP
	BCF	PORTB,4
;05
	MOVF	DA05,W
	MOVWF	PORTC
	MOVF	DB05,W
	MOVWF	PORTD
	BSF	PORTB,5
	CALL	INRDSP
	BCF	PORTB,5
;06
	MOVF	DA06,W
	MOVWF	PORTC
	MOVF	DB06,W
	MOVWF	PORTD
	BSF	PORTB,6
	CALL	INRDSP
	BCF	PORTB,6
;07
	MOVF	DA07,W
	MOVWF	PORTC
	MOVF	DB07,W
	MOVWF	PORTD
	BSF	PORTB,7
	CALL	INRDSP
	BCF	PORTB,7
	BCF	PORTA,0
;
;
;08(PORTA1)
	BSF	PORTA,1
	MOVF	DA08,W
	MOVWF	PORTC
	MOVF	DB08,W
	MOVWF	PORTD
	BSF	PORTB,0
	CALL	INRDSP
	BCF	PORTB,0	
;09
	MOVF	DA09,W
	MOVWF	PORTC
	MOVF	DB09,W
	MOVWF	PORTD
	BSF	PORTB,1
	CALL	INRDSP
	BCF	PORTB,1
;0A
	MOVF	DA0A,W
	MOVWF	PORTC
	MOVF	DB0A,W
	MOVWF	PORTD
	BSF	PORTB,2
	CALL	INRDSP
	BCF	PORTB,2
;0B
	MOVF	DA0B,W
	MOVWF	PORTC
	MOVF	DB0B,W
	MOVWF	PORTD
	BSF	PORTB,3
	CALL	INRDSP
	BCF	PORTB,3
;0C
	MOVF	DA0C,W
	MOVWF	PORTC
	MOVF	DB0C,W
	MOVWF	PORTD
	BSF	PORTB,4
	CALL	INRDSP
	BCF	PORTB,4
;0D
	MOVF	DA0D,W
	MOVWF	PORTC
	MOVF	DB0D,W
	MOVWF	PORTD
	BSF	PORTB,5
	CALL	INRDSP
	BCF	PORTB,5
;0E
	MOVF	DA0E,W
	MOVWF	PORTC
	MOVF	DB0E,W
	MOVWF	PORTD
	BSF	PORTB,6
	CALL	INRDSP
	BCF	PORTB,6
;0F
	MOVF	DA0F,W
	MOVWF	PORTC
	MOVF	DB0F,W
	MOVWF	PORTD
	BSF	PORTB,7
	CALL	INRDSP
	BCF	PORTB,7
	BCF	PORTA,1
;
;
;10(PORTA2)
	BSF	PORTA,2
	MOVF	DA10,W
	MOVWF	PORTC
	MOVF	DB10,W
	MOVWF	PORTD
	BSF	PORTB,0
	CALL	INRDSP
	BCF	PORTB,0	
;11
	MOVF	DA11,W
	MOVWF	PORTC
	MOVF	DB11,W
	MOVWF	PORTD
	BSF	PORTB,1
	CALL	INRDSP
	BCF	PORTB,1
;12
	MOVF	DA12,W
	MOVWF	PORTC
	MOVF	DB12,W
	MOVWF	PORTD
	BSF	PORTB,2
	CALL	INRDSP
	BCF	PORTB,2
;13
	MOVF	DA13,W
	MOVWF	PORTC
	MOVF	DB13,W
	MOVWF	PORTD
	BSF	PORTB,3
	CALL	INRDSP
	BCF	PORTB,3
;14
	MOVF	DA14,W
	MOVWF	PORTC
	MOVF	DB14,W
	MOVWF	PORTD
	BSF	PORTB,4
	CALL	INRDSP
	BCF	PORTB,4
;15
	MOVF	DA15,W
	MOVWF	PORTC
	MOVF	DB15,W
	MOVWF	PORTD
	BSF	PORTB,5
	CALL	INRDSP
	BCF	PORTB,5
;16
	MOVF	DA16,W
	MOVWF	PORTC
	MOVF	DB16,W
	MOVWF	PORTD
	BSF	PORTB,6
	CALL	INRDSP
	BCF	PORTB,6
;17
	MOVF	DA17,W
	MOVWF	PORTC
	MOVF	DB17,W
	MOVWF	PORTD
	BSF	PORTB,7
	CALL	INRDSP
	BCF	PORTB,7
	BCF	PORTA,2
;
;
;18(PORTA3)
	BSF	PORTA,3
	MOVF	DA18,W
	MOVWF	PORTC
	MOVF	DB18,W
	MOVWF	PORTD
	BSF	PORTB,0
	CALL	INRDSP
	BCF	PORTB,0	
;19
	MOVF	DA19,W
	MOVWF	PORTC
	MOVF	DB19,W
	MOVWF	PORTD
	BSF	PORTB,1
	CALL	INRDSP
	BCF	PORTB,1
;1A
	MOVF	DA1A,W
	MOVWF	PORTC
	MOVF	DB1A,W
	MOVWF	PORTD
	BSF	PORTB,2
	CALL	INRDSP
	BCF	PORTB,2
;1B
	MOVF	DA1B,W
	MOVWF	PORTC
	MOVF	DB1B,W
	MOVWF	PORTD
	BSF	PORTB,3
	CALL	INRDSP
	BCF	PORTB,3
;1C
	MOVF	DA1C,W
	MOVWF	PORTC
	MOVF	DB1C,W
	MOVWF	PORTD
	BSF	PORTB,4
	CALL	INRDSP
	BCF	PORTB,4
;1D
	MOVF	DA1D,W
	MOVWF	PORTC
	MOVF	DB1D,W
	MOVWF	PORTD
	BSF	PORTB,5
	CALL	INRDSP
	BCF	PORTB,5
;1E
	MOVF	DA1E,W
	MOVWF	PORTC
	MOVF	DB1E,W
	MOVWF	PORTD
	BSF	PORTB,6
	CALL	INRDSP
	BCF	PORTB,6
;1F
	MOVF	DA1F,W
	MOVWF	PORTC
	MOVF	DB1F,W
	MOVWF	PORTD
	BSF	PORTB,7
	CALL	INRDSP
	BCF	PORTB,7
	BCF	PORTA,3


	RETURN

;******************************************************************************************
;   Function Name : CLRLED
;   Title         : 16*32LEDを無表示にする
;   Input         : DA00-DA1F,DB00-DB1F
;   Output        : 
;   Disctiption   : 
;******************************************************************************************
CLRLED
	BCF	PORTA,0
	BCF	PORTA,1
	BCF	PORTA,2
	BCF	PORTA,3
	CLRF	PORTB
	CLRF	PORTC
	CLRF	PORTD
	RETURN

;******************************************************************************************
;   Function Name : INRDSP
;   Title         : LEDの１ドッド表示時間
;   Input         : 
;   Output        : 
;   Disctiption   : 2000回程度(20MHz->約10kHz)
;******************************************************************************************
INRDSP
	MOVLW	H'FF'
	MOVWF	INRDSPLP
INRDSP1 
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	DECFSZ	INRDSPLP	
	GOTO	INRDSP1
	RETURN 

;******************************************************************************************
;   Function Name : SERIDAT
;   Disctiption   : データ連動
;                   連動データがあればデータ連動を行なう
;   Input         : なし
;******************************************************************************************
SERIDAT
; 1.データフラグをチェックし、連動データがないなら抜ける
	BTFSC 	PORTA,4
	RETLW	H'00'	
; 2.確認OKシグナルを送る(1=>0)
	BCF	PORTA,5
; 3.受信モードにして相手の送信を待つ 
	CALL	REC
; 4.確認OKシグナルを戻す(0=>1)
	BSF	PORTA,5
; 5.データ移動
	MOVF	IODAT,W
	MOVWF	DSPCOD
	RETLW	H'01'

;******************************************************************************************
;   Function Name : REC
;   Title         : ＲＳ２３２Ｃ受信サブルーチン(PORTA 4)
;                   9600BPS OSC;20.000MHz仕様
;   Input         : 
;   Output        :
;******************************************************************************************
REC
; (0)変数初期化
	CLRF	IODAT
; (1)受信データを待つ
	BTFSC	PORTA,4
	GOTO	REC
; (2)1/2ビット分待つ
	MOVLW	H'55'	; 9600BPS,OSC;20MHz
	MOVWF   RECWAT
REC1	DECFSZ	RECWAT,F
	GOTO	REC1
; (3)データ受信(8ビット分)
	MOVLW	8
	MOVWF	RECLP
	NOP
REC2	MOVLW	H'AA'	; 9600BPS,OSC;20MHz
	MOVWF	RECWAT
REC3	DECFSZ	RECWAT,F
	GOTO	REC3
	NOP
	BTFSS	PORTA,4	; ビットデータが0の時, 0を立てる
	BCF	STATUS,C
	BTFSC	PORTA,4	; ビットデータが1の時, 1を立てる
	BSF	STATUS,C
	RRCF	IODAT,F	; 変数内でビットをシフトする
	DECFSZ	RECLP,F
	GOTO	REC2
	NOP
	NOP
;
	RETURN

;*******************************************************************************************
;   関数名    : COMSEL24EEP0　　　　
;   機能      : AT24C256の0番ソケットのEEPを選択する
;   引数      : 
;   変数      :
;   注意      :
;*******************************************************************************************
COMSEL24EEP0
	MOVLW	B'10100000'
	MOVWF	COMATEEPSEL
	RETURN
;*******************************************************************************************
;   関数名    : COMRED24EEP　　　　
;   機能      : AT24C256からデータを読み込む 
;   引数      : Input
;                  COMATEEPAD1    アドレス2桁め
;		   COMATEEPAD0    アドレス1桁め 
;             : Output : 
;                  COMATEEPDAT,W  読込みデータ
;   変数      :
;   注意      : C3,C4 => E0,E1
;*******************************************************************************************
COMRED24EEP
; 1.Dummy Write
; (1)Start Condition
	CALL	COMI2CSTR
; (2)ヘッダー送信(1010,0000)
;	MOVLW	B'10100000'
	MOVF	COMATEEPSEL,W
	CALL	COMI2CSEND
; (3)アドレス送信
;   上位アドレス送信
	BCF	COMATEEPAD1,7	; 不定
;	BSF	COMATEEPAD1,6	; MSBセット   H17.07.07 Comment
	MOVF	COMATEEPAD1,W
	CALL	COMI2CSEND
;   下位アドレス送信
	MOVF	COMATEEPAD0,W
	CALL	COMI2CSEND
; 2.READ
; (1)Start Condition
	CALL	COMI2CSTR
; (2)ヘッダー送信(1010,0001)
;	MOVLW	B'10100001'
	MOVF	COMATEEPSEL,W
	MOVWF	COMRED24EEPWK
	BSF	COMRED24EEPWK,0
	MOVF	COMRED24EEPWK,W
	CALL	COMI2CSEND
; (3)読込み
	CALL	COMI2CRES

; (4)Stop Condition
	CALL	COMI2CSTP
	MOVF	COMATEEPDAT,W
	RETURN
;*******************************************************************************************
;   関数名    : COMWRT24EEP　　　　
;   機能      : AT24C256にデータを書き込む 
;   引数      : Input
;                  COMATEEPAD1  アドレス2桁め
;		   COMATEEPAD0  アドレス1桁め 
;                  W         書き込みデータ
;               Output
;                  なし
;   変数      :
;*******************************************************************************************
COMWRT24EEP
	MOVWF	COMWRT24TMP
; (1)Start Condition
	CALL	COMI2CSTR
; (2)ヘッダー送信(1010,0000)
;	MOVLW	B'10100000'
	MOVF	COMATEEPSEL,W
	CALL	COMI2CSEND
; (3)アドレス送信
;   上位アドレス送信
	BCF	COMATEEPAD1,7	; 不定
;	BSF	COMATEEPAD1,6	; MSBセット  H17.07.07 Comment
	MOVF	COMATEEPAD1,W
	CALL	COMI2CSEND
;   下位アドレス送信
	MOVF	COMATEEPAD0,W
	CALL	COMI2CSEND
; (4)データ送信
	MOVF	COMWRT24TMP,W
	CALL	COMI2CSEND
; (5)Stop Condition
	CALL	COMI2CSTP

	RETURN
;*******************************************************************************************
;   関数名    : COMI2CSTR　　　　
;   機能      : I2Cでスタートコンディションを与える 
;   引数      : Input  : なし
;             : Output : なし
;   変数      :
;*******************************************************************************************
COMI2CSTR
	BSF	PORTE,1		; SDA信号(1)
	BSF	PORTE,0		; SCL信号(1)
	CALL	COMWATP000001	; 0.6μS以上
	BCF	PORTE,1		; SDA信号(0)
	CALL	COMWATP000001	; 0.6μS以上
	BCF	PORTE,0		; SCL信号(0)
	CALL	COMWATP000001	; 0.6μS以上
	RETURN

;*******************************************************************************************
;   関数名    : COMI2CSTP　　　　
;   機能      : I2Cでストップコンディションを与える 
;   引数      : Input  : なし
;             : Output : なし
;   変数      :
;*******************************************************************************************
COMI2CSTP
	BCF	PORTE,0		; SCL信号(0)
	BCF	PORTE,1		; SDA信号(0)
	CALL	COMWATP000001	; 0.6μS以上
	BSF	PORTE,0		; SCL信号(1)
	BCF	PORTE,1		; SDA信号(0)
	CALL	COMWATP000001	; 0.6μS以上
	BSF	PORTE,1		; SDA信号(1)
	CALL	COMWATP000001	; 0.6μS以上
	RETURN

;*******************************************************************************************
;   関数名    : COMI2CRES　　　　
;   機能      : I2Cで8ビットのデータをバスから受ける 
;   引数      : Input  : なし
;             : Output : W
;   変数      :
;*******************************************************************************************
COMI2CRES
	MOVLW	B'00000110'	; PORTEのIO設定(0-7)	
	MOVWF	TRISE		; PORTEのIO設定

;1:8Bit受信
; 0)ループ変数設定
	MOVLW	H'08'
	MOVWF	COMI2CRSLP
COMI2CRES2
; 1)クロック設定(1)
	CALL	COMWATP000001
	BSF	PORTE,0
	CALL	COMWATP000001
; 2)データ設定
	BTFSS	PORTE,1		; 
	BCF	COMI2CRSTMP,0 	; 
	BTFSC	PORTE,1		; 
	BSF	COMI2CRSTMP,0 	;
; 3)クロック設定(0)
	BCF	PORTE,0
	MOVF	COMI2CRSTMP,W	; 1回分の余計なシフトを補正
	MOVWF	COMATEEPDAT	; 1回分の余計なシフトを補正
	RLCF	COMI2CRSTMP,F
	DECFSZ	COMI2CRSLP,F
	GOTO	COMI2CRES2
;2:NoAct
	CALL	COMI2CCLOK
	CALL	COMWATP000001
;3:元に戻す
	MOVLW	B'00000100'	; PORTEのIO設定(0-7)	
	MOVWF	TRISE		; PORTEのIO設定

;4:結果を返す
	MOVF	COMATEEPDAT,W
	RETURN

;*******************************************************************************************
;   関数名    : COMI2CSEND　　　　
;   機能      : I2Cで8ビットのデータを与える 
;   引数      : Input  :  W 書き込みデータ
;             : Output : なし
;   変数      :
;*******************************************************************************************
COMI2CSEND
	MOVWF	COMI2CSDTMP
;1：8Bit送信
; 0)ループ変数設定
	MOVLW	H'08'
	MOVWF	COMI2CSDLP
COMI2CSEND2
; 1)データ設定
	BTFSS	COMI2CSDTMP,7	; 
	BCF	PORTE,1	 	; 
	BTFSC	COMI2CSDTMP,7	; 
	BSF	PORTE,1	 	;
; 2)クロック信号  
	CALL	COMI2CCLOK		;
; 3)ACTのリターンでデバイス衝突が起きないようにゼロにする 
	BCF	PORTE,1	 	;
; 4)シフト 
	RLCF	COMI2CSDTMP,F
	DECFSZ	COMI2CSDLP,F
	GOTO	COMI2CSEND2
;(2)ACT検知
	CALL	COMI2CACT
	RETURN

;*******************************************************************************************
;   関数名    : COMI2CACT　　　
;   機能      : I2CでACT信号を検知する
;   引数      : Input  : なし
;             : Output : なし
;   変数      :
;*******************************************************************************************
COMI2CACT
	MOVLW	B'00000110'	; PORTEのIO設定(0-7)	
	MOVWF	TRISE		; PORTEのIO設定

	CALL	COMWATP000001	; 
	BSF	PORTE,0		; SCL信号(1)
	CALL	COMWATP000001	; 
COMI2CACT2
	BTFSC	PORTE,1		; 
	GOTO	COMI2CACT2	;
	BCF	PORTE,0		; SCL信号(0)
	CALL	COMWATP000001	; 
;
	MOVLW	B'00000100'	; PORTEのIO設定(0-7)	
	MOVWF	TRISE		; PORTEのIO設定

	RETURN
;*******************************************************************************************
;   関数名    : COMI2CCLOK　　　
;   機能      : I2Cでクロックパルスを与える
;   引数      : Input  : なし
;             : Output : なし
;   変数      :
;*******************************************************************************************
COMI2CCLOK
	BCF	PORTE,0		; SCL信号(0)
	CALL	COMWATP000001	; 1.3μS以上
	CALL	COMWATP000001	; 1.3μS以上
	BSF	PORTE,0		; SCL信号(1)
	CALL	COMWATP000001	; 0.6μS以上
	BCF	PORTE,0		; SCL信号(0)
	NOP			; Actのため時間を長くすると危険
	NOP			; Actのため時間を長くすると危険
	RETURN

;*******************************************************************************************
;   関数名    : COMWATP000001　　　　
;   機能      : 0.000001秒(1μ秒[1000n秒])タイマー 
;   引数      : なし 
;   変数      :
;   注意      : 20MHz用
;*******************************************************************************************
COMWATP000001
	MOVLW	H'09' 
	MOVWF	COMWP000001A
COMWATP000001A 
	DECFSZ	COMWP000001A,F	
	GOTO	COMWATP000001A
	RETURN 


;*******************************************************************************************
;   関数名    : EEPADCOU　　　　
;   機能      : EEPアドレスカウンタ 
;   引数      : なし 
;   変数      :
;   注意      : 
;*******************************************************************************************
EEPADCOU
	CLRF	STS
; 0桁目
	MOVLW	H'01'
	ADDWF	COMATEEPAD0,F
	MOVF	COMATEEPAD0,W
	XORLW	H'00'
	BTFSS	STATUS,Z
	RETURN
; 1桁目
	MOVLW	H'01'
	ADDWF	COMATEEPAD1,F
	MOVF	COMATEEPAD1,W
	XORLW	H'00'
	BTFSS	STATUS,Z
	RETURN
;
;    256用
;   1024用
;
	MOVLW	H'01'
	MOVWF	STS	

	END

