アセンブリ言語で書いた電光掲示板

アセンブリ言語で書いた電光掲示板

概要

今回の記事は,高校生の時に作った電光掲示板のコードの紹介です.

PICのアセンブリ言語で書かれています.

作ったもの

あらかじめ書き込んでおいた文字列がスクロールしながら表示される電光掲示板です.

裏側にボタンがついていて,そのボタンに割り当てられた文字列が表示されます.

PIC電光掲示板

PIC電光掲示板

PIC電光掲示板

PIC電光掲示板

PIC電光掲示板

PIC電光掲示板

回路図

高校の時に作ったものなのでかなり雑です.

PICはPIC16F887です.
Dotは適当な8x8のドットマトリックスLED2つです.

回路図

回路図

ソースコード

;**** SCROLL ORIGINAL 8x16x4LINE ***************************************************************
;2012.7.7 作成
;7x16ドットマトリクス使用
;配線は、RA0~6が横カソードで、RB0~7,RC0~7が縦アノード
;スクロールを速度は、一番下のWAITの数字によって可変
;***********************************************************************************************

	LIST	P=PIC16F887
	INCLUDE"P16F887.INC"
	__CONFIG _CONFIG1,_CP_OFF & _LVP_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTOSCIO
	__CONFIG _CONFIG2,_WRT_OFF & _BOR21V

TIM1	EQU	020H
TIM2	EQU	021H
LOOP1	EQU	022H
YOKO	EQU	023H
TATE	EQU	024H
CONT	EQU	025H

	ORG	0
	GOTO	START

START
		BSF	STATUS,RP0
		MOVLW	070H		;8MHz
		MOVWF	OSCCON
		CLRF	TRISA
		CLRF	TRISB
		CLRF	TRISC
		CLRF	TRISE
		MOVLW	B'11111111'
		MOVWF	TRISD
		BCF	STATUS,RP0
		CLRF	PORTB	
		CLRF	PORTC
		CLRF	PORTE

MAIN
		BTFSC	PORTD,0
		GOTO	MAINX
		GOTO	MAIN_A

MAINX		BTFSC	PORTD,1
		GOTO	MAINY
		BSF	PCLATH,3
		BCF	PCLATH,4
		GOTO	MAIN_B

MAINY		BTFSC	PORTD,2
		GOTO	MAINZ
		BCF	PCLATH,3
		BSF	PCLATH,4
		GOTO	MAIN_C

MAINZ		BTFSC	PORTD,3
		GOTO	MAIN
		BSF	PCLATH,3
		BSF	PCLATH,4
		GOTO	MAIN_D


;**************************************************************************************************************

MAIN_A
		MOVLW	0H
		MOVWF	CONT

MA_1A		INCF	CONT
		MOVLW	60H		;ここの数で速さを調節
		MOVWF	LOOP1
LOOPA		MOVF	CONT,W
		MOVWF	YOKO
		MOVLW	0H
		MOVWF	TATE
MA_2A		MOVF	YOKO,W	
		CALL	DAT_1A
		MOVWF	PORTA
		MOVF	TATE,W
		CALL	DAT_2A
		MOVWF	PORTB
		MOVF	TATE,W
		CALL	DAT_3A
		MOVWF	PORTC
		CALL	WAITA
		INCF	YOKO
		INCF	TATE
		CLRF	PORTB
		CLRF	PORTC
		MOVF	TATE,W
		SUBLW	10H
		BTFSS	STATUS,Z
		GOTO	MA_2A
		
		DECFSZ	LOOP1,F
		GOTO	LOOPA

		MOVF	CONT,W
		SUBLW	080H		;ここの数を変える
		BTFSS	STATUS,Z
		GOTO	MA_1A
		GOTO	MAIN_A


DAT_1A
		ADDWF	PCL		
		RETLW	B'11111111'	;0	
		RETLW	B'11111111'	;1	
		RETLW	B'11111111'	;2	
		RETLW	B'11111111'	;3	
		RETLW	B'11111111'	;4	
		RETLW	B'11111111'	;5	
		RETLW	B'11111111'	;6	
		RETLW	B'11111111'	;7	
		RETLW	B'11111111'	;8	
		RETLW	B'11111111'	;9	
		RETLW	B'11111111'	;A	
		RETLW	B'11111111'	;B	
		RETLW	B'11111111'	;C	
		RETLW	B'11111111'	;D	
		RETLW	B'11111111'	;E	
		RETLW	B'11111111'	;F	
		RETLW	B'11111111'	;10	
		RETLW	B'00000001'	;11	ここからプログラム開始
		RETLW	B'01111111'	;12	
		RETLW	B'01111111'	;13	
		RETLW	B'01111111'	;14	
		RETLW	B'01111111'	;15	
		RETLW	B'11111111'	;16	
		RETLW	B'00000001'	;17	
		RETLW	B'01101101'	;18	
		RETLW	B'01101101'	;19	
		RETLW	B'01101101'	;1A	
		RETLW	B'01101101'	;1B	
		RETLW	B'11111111'	;1C	
		RETLW	B'11111101'	;1D	
		RETLW	B'11111101'	;1E	
		RETLW	B'00000001'	;1F	
		RETLW	B'11111101'	;20	
		RETLW	B'11111101'	;21	
		RETLW	B'11111111'	;22	
		RETLW	B'11111101'	;23	
		RETLW	B'11110001'	;24
		RETLW	B'11111111'	;25
		RETLW	B'10110011'	;26	
		RETLW	B'01101101'	;27	
		RETLW	B'01101101'	;28	
		RETLW	B'01101101'	;29	
		RETLW	B'10011011'	;2A	
		RETLW	B'11111111'	;2B	
		RETLW	B'11111111'	;2C	
		RETLW	B'11111111'	;2D	
		RETLW	B'11111101'	;1D	
		RETLW	B'11111101'	;1E	
		RETLW	B'00000001'	;1F	
		RETLW	B'11111101'	;20	
		RETLW	B'11111101'	;21	
		RETLW	B'11111111'	;33	
		RETLW	B'00000001'	;34	
		RETLW	B'11101101'	;35	
		RETLW	B'11001101'	;36	
		RETLW	B'10101101'	;37	
		RETLW	B'01110011'	;38	
		RETLW	B'11111111'	;39	
		RETLW	B'11111001'	;3A	
		RETLW	B'11110111'	;3B	
		RETLW	B'00001111'	;3C	
		RETLW	B'11110111'	;3D	
		RETLW	B'11111001'	;3E	
		RETLW	B'11111111'	;3F	
		RETLW	B'11111111'	;40	
		RETLW	B'11111111'	;41	
		RETLW	B'00000001'	;42	
		RETLW	B'11101101'	;43	
		RETLW	B'11101101'	;44	
		RETLW	B'11101101'	;45	
		RETLW	B'11110011'	;46	
		RETLW	B'11111111'	;47	
		RETLW	B'00000001'	;34	
		RETLW	B'11101101'	;35	
		RETLW	B'11001101'	;36	
		RETLW	B'10101101'	;37	
		RETLW	B'01110011'	;38	
		RETLW	B'11111111'	;4D	
		RETLW	B'10000011'	;4E	
		RETLW	B'01111101'	;4F	
		RETLW	B'01111101'	;50	
		RETLW	B'01111101'	;51	
		RETLW	B'10000011'	;52	
		RETLW	B'11111111'	;53	
		RETLW	B'10000011'	;54	
		RETLW	B'01111101'	;55	
		RETLW	B'01101101'	;56	
		RETLW	B'01101101'	;57	
		RETLW	B'10001011'	;58	
		RETLW	B'11111111'	;59	
		RETLW	B'00000001'	;34	
		RETLW	B'11101101'	;35	
		RETLW	B'11001101'	;36	
		RETLW	B'10101101'	;37	
		RETLW	B'01110011'	;38	
		RETLW	B'11111111'	;5F	
		RETLW	B'00000011'	;4E	
		RETLW	B'11101101'	;4F	
		RETLW	B'11101101'	;50	
		RETLW	B'11101101'	;51	
		RETLW	B'00000011'	;52	
		RETLW	B'11111111'	;65	
		RETLW	B'00000001'	;66	
		RETLW	B'11111011'	;67	
		RETLW	B'11110111'	;68	
		RETLW	B'11111011'	;69	
		RETLW	B'00000001'	;6A	
		RETLW	B'11111111'	;6B	
		RETLW	B'01111101'	;6C	
		RETLW	B'00000001'	;6D	
		RETLW	B'01111101'	;6E	
		RETLW	B'11111111'	;6F	
		RETLW	B'00000001'	;70	
		RETLW	B'11110111'	;71	
		RETLW	B'11101111'	;72	
		RETLW	B'11011111'	;73	
		RETLW	B'00000001'	;74	
		RETLW	B'11111111'	;75	
		RETLW	B'10000011'	;54	
		RETLW	B'01111101'	;55	
		RETLW	B'01101101'	;56	
		RETLW	B'01101101'	;57	
		RETLW	B'10001011'	;58	
		RETLW	B'11111111'	;7B	
		RETLW	B'01000001'	;7C	
		RETLW	B'11111111'	;7D	
		RETLW	B'01000001'	;7E	
		RETLW	B'11111111'	;7F	
		RETLW	B'01000001'	;80	
		RETLW	B'11111111'	;81	
		RETLW	B'11111111'	;82	
		RETLW	B'11111111'	;83	
		RETLW	B'11111111'	;84	
		RETLW	B'11111111'	;85	
		RETLW	B'11111111'	;86	
		RETLW	B'11111111'	;87	
		RETLW	B'11111111'	;88	
		RETLW	B'11111111'	;89	
		RETLW	B'11111111'	;90	
		RETLW	B'11111111'	;91	
		RETLW	B'11111111'	;92	
		RETLW	B'11111111'	;93	
		RETLW	B'11111111'	;94	
		RETLW	B'11111111'	;95	
		RETLW	B'11111111'	;96	
		RETLW	B'11111111'	;97	
		RETLW	B'11111111'	;98	
		RETLW	B'11111111'	;99	
		RETLW	B'11111111'	;9A	
		RETLW	B'11111111'	;9B	
		RETLW	B'11111111'	;9C	
		RETLW	B'11111111'	;9D	
		RETLW	B'11111111'	;9E	
		RETLW	B'11111111'	;9F	




DAT_2A
		ADDWF	PCL
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	1H
		RETLW	2H
		RETLW	4H
		RETLW	8H
		RETLW	10H
		RETLW	20H
		RETLW	40H
		RETLW	80H

DAT_3A
		ADDWF	PCL
		RETLW	1H
		RETLW	2H
		RETLW	4H
		RETLW	8H
		RETLW	10H
		RETLW	20H
		RETLW	40H
		RETLW	80H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H


WAITA
		MOVLW	5H
		MOVWF	TIM1
	WA1A	MOVLW	5H
		MOVWF	TIM2
	WA2A	NOP
		DECFSZ	TIM2,F
		GOTO	WA2A
		DECFSZ	TIM1,F
		GOTO	WA1A
		RETURN

;*******************************************************************************************************

		ORG	800H

MAIN_B
		MOVLW	0H
		MOVWF	CONT

MA_1B		INCF	CONT
		MOVLW	60H		;ここの数で速さを調節
		MOVWF	LOOP1
LOOPB		MOVF	CONT,W
		MOVWF	YOKO
		MOVLW	0H
		MOVWF	TATE
MA_2B		MOVF	YOKO,W	
		CALL	DAT_1B
		MOVWF	PORTA
		MOVF	TATE,W
		CALL	DAT_2B
		MOVWF	PORTB
		MOVF	TATE,W
		CALL	DAT_3B
		MOVWF	PORTC
		CALL	WAITB
		INCF	YOKO
		INCF	TATE
		CLRF	PORTB
		CLRF	PORTC
		MOVF	TATE,W
		SUBLW	10H
		BTFSS	STATUS,Z
		GOTO	MA_2B
		
		DECFSZ	LOOP1,F
		GOTO	LOOPB

		MOVF	CONT,W
		SUBLW	07FH		;ここの数を変える
		BTFSS	STATUS,Z
		GOTO	MA_1B
		GOTO	MAIN_B

DAT_1B
		ADDWF	PCL		
		RETLW	B'11111111'	;0	
		RETLW	B'11111111'	;1	
		RETLW	B'11111111'	;2	
		RETLW	B'11111111'	;3	
		RETLW	B'11111111'	;4	
		RETLW	B'11111111'	;5	
		RETLW	B'11111111'	;6	
		RETLW	B'11111111'	;7	
		RETLW	B'11111111'	;8	
		RETLW	B'11111111'	;9	
		RETLW	B'11111111'	;A	
		RETLW	B'11111111'	;B	
		RETLW	B'11111111'	;C	
		RETLW	B'11111111'	;D	
		RETLW	B'11111111'	;E	
		RETLW	B'11111111'	;F	
		RETLW	B'11111111'	;10	
		RETLW	B'00000001'	;11	ここからプログラム開始
		RETLW	B'11101111'	;12	
		RETLW	B'11101111'	;13	
		RETLW	B'11101111'	;14	
		RETLW	B'00000001'	;15	
		RETLW	B'11111111'	;16	
		RETLW	B'00000011'	;17	
		RETLW	B'11101101'	;18	
		RETLW	B'11101101'	;19	
		RETLW	B'11101101'	;1A	
		RETLW	B'00000011'	;1B	
		RETLW	B'11111111'	;1C	
		RETLW	B'00000001'	;1D	
		RETLW	B'11101101'	;1E	
		RETLW	B'11101101'	;1F	
		RETLW	B'11101101'	;20	
		RETLW	B'11110011'	;21	
		RETLW	B'11111111'	;22	
		RETLW	B'00000001'	;23	
		RETLW	B'11101101'	;24	
		RETLW	B'11101101'	;25	
		RETLW	B'11101101'	;26	
		RETLW	B'11110011'	;27	
		RETLW	B'11111111'	;28	
		RETLW	B'11111001'	;29	
		RETLW	B'11110111'	;2A	
		RETLW	B'00001111'	;2B	
		RETLW	B'11110111'	;2C	
		RETLW	B'11111001'	;2D	
		RETLW	B'11111111'	;2E	
		RETLW	B'11111111'	;2F	
		RETLW	B'11111111'	;30	
		RETLW	B'00000001'	;31	
		RETLW	B'01101101'	;32	
		RETLW	B'01101101'	;33	
		RETLW	B'01101101'	;34	
		RETLW	B'10010011'	;35	
		RETLW	B'11111111'	;36	
		RETLW	B'01111101'	;37	
		RETLW	B'00000001'	;38	
		RETLW	B'01111101'	;39	
		RETLW	B'11111111'	;3A	
		RETLW	B'00000001'	;3B	
		RETLW	B'11101101'	;3C	
		RETLW	B'11001101'	;3D	
		RETLW	B'10101101'	;3E	
		RETLW	B'01110011'	;3F	
		RETLW	B'11111111'	;40	
		RETLW	B'11111101'	;41	
		RETLW	B'11111101'	;42	
		RETLW	B'00000001'	;43	
		RETLW	B'11111101'	;44	
		RETLW	B'11111101'	;45	
		RETLW	B'11111111'	;46	
		RETLW	B'00000001'	;47	
		RETLW	B'11101111'	;48	
		RETLW	B'11101111'	;49	
		RETLW	B'11101111'	;4A	
		RETLW	B'00000001'	;4B	
		RETLW	B'11111111'	;4C	
		RETLW	B'00000001'	;4D	
		RETLW	B'01111101'	;4E	
		RETLW	B'01111101'	;4F	
		RETLW	B'01111101'	;50	
		RETLW	B'10000011'	;51	
		RETLW	B'11111111'	;52	
		RETLW	B'00000011'	;53	
		RETLW	B'11101101'	;54	
		RETLW	B'11101101'	;55	
		RETLW	B'11101101'	;56	
		RETLW	B'00000011'	;57	
		RETLW	B'11111111'	;58	
		RETLW	B'11111001'	;59	
		RETLW	B'11110111'	;5A	
		RETLW	B'00001111'	;5B	
		RETLW	B'11110111'	;5C	
		RETLW	B'11111001'	;5D	
		RETLW	B'11111111'	;5E	
		RETLW	B'11111111'	;5F	
		RETLW	B'11111111'	;60	
		RETLW	B'11111101'	;61	
		RETLW	B'11111101'	;62	
		RETLW	B'00000001'	;63	
		RETLW	B'11111101'	;64	
		RETLW	B'11111101'	;65	
		RETLW	B'11111111'	;66	
		RETLW	B'10000011'	;67	
		RETLW	B'01111101'	;68	
		RETLW	B'01111101'	;69	
		RETLW	B'01111101'	;6A	
		RETLW	B'10000011'	;6B	
		RETLW	B'11111111'	;6C	
		RETLW	B'11111111'	;6D	
		RETLW	B'11111111'	;6E	
		RETLW	B'11111001'	;6F	
		RETLW	B'11110111'	;70	
		RETLW	B'00001111'	;71	
		RETLW	B'11110111'	;72	
		RETLW	B'11111001'	;73	
		RETLW	B'11111111'	;74	
		RETLW	B'10000011'	;75	
		RETLW	B'01111101'	;76	
		RETLW	B'01111101'	;77	
		RETLW	B'01111101'	;78	
		RETLW	B'10000011'	;79	
		RETLW	B'11111111'	;7A	
		RETLW	B'10000001'	;7B	
		RETLW	B'01111111'	;7C	
		RETLW	B'01111111'	;7D	
		RETLW	B'01111111'	;7E	
		RETLW	B'10000001'	;7F	
		RETLW	B'11111111'	;80	
		RETLW	B'11111111'	;81	
		RETLW	B'11111111'	;82	
		RETLW	B'11111111'	;83	
		RETLW	B'11111111'	;84	
		RETLW	B'11111111'	;85	
		RETLW	B'11111111'	;86	
		RETLW	B'11111111'	;87	
		RETLW	B'11111111'	;88	
		RETLW	B'11111111'	;89	
		RETLW	B'11111111'	;90	
		RETLW	B'11111111'	;91	
		RETLW	B'11111111'	;92	
		RETLW	B'11111111'	;93	
		RETLW	B'11111111'	;94	
		RETLW	B'11111111'	;95	
		RETLW	B'11111111'	;96	
		RETLW	B'11111111'	;97	
		RETLW	B'11111111'	;98	
		RETLW	B'11111111'	;99	
		RETLW	B'11111111'	;9A	
		RETLW	B'11111111'	;9B	
		RETLW	B'11111111'	;9C	
		RETLW	B'11111111'	;9D	
		RETLW	B'11111111'	;9E	
		RETLW	B'11111111'	;9F	
		RETLW	B'11111111'	;A0	
		RETLW	B'11111111'	;A1	
		RETLW	B'11111111'	;A2	
		RETLW	B'11111111'	;A3	
		RETLW	B'11111111'	;A4	
		RETLW	B'11111111'	;A5	
		RETLW	B'11111111'	;A6	
		RETLW	B'11111111'	;A7	
		RETLW	B'11111111'	;A8	
		RETLW	B'11111111'	;A9	
		RETLW	B'11111111'	;AA	
		RETLW	B'11111111'	;AB	
		RETLW	B'11111111'	;AC	
		RETLW	B'11111111'	;AD	
		RETLW	B'11111111'	;AE	
		RETLW	B'11111111'	;AF	
		RETLW	B'11111111'	;B0	
		RETLW	B'11111111'	;B1	
		RETLW	B'11111111'	;B2	
		RETLW	B'11111111'	;B3	
		RETLW	B'11111111'	;B4	
		RETLW	B'11111111'	;B5	
		RETLW	B'11111111'	;B6	
		RETLW	B'11111111'	;B7	





DAT_2B
		ADDWF	PCL
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	1H
		RETLW	2H
		RETLW	4H
		RETLW	8H
		RETLW	10H
		RETLW	20H
		RETLW	40H
		RETLW	80H

DAT_3B
		ADDWF	PCL
		RETLW	1H
		RETLW	2H
		RETLW	4H
		RETLW	8H
		RETLW	10H
		RETLW	20H
		RETLW	40H
		RETLW	80H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H


WAITB
		MOVLW	5H
		MOVWF	TIM1
	WA1B	MOVLW	5H
		MOVWF	TIM2
	WA2B	NOP
		DECFSZ	TIM2,F
		GOTO	WA2B
		DECFSZ	TIM1,F
		GOTO	WA1B
		RETURN

;********************************************************************************************************

		ORG	1000H

MAIN_C
		MOVLW	0H
		MOVWF	CONT

MA_1C		INCF	CONT
		MOVLW	60H		;ここの数で速さを調節
		MOVWF	LOOP1
LOOPC		MOVF	CONT,W
		MOVWF	YOKO
		MOVLW	0H
		MOVWF	TATE
MA_2C		MOVF	YOKO,W	
		CALL	DAT_1C
		MOVWF	PORTA
		MOVF	TATE,W
		CALL	DAT_2C
		MOVWF	PORTB
		MOVF	TATE,W
		CALL	DAT_3C
		MOVWF	PORTC
		CALL	WAITC
		INCF	YOKO
		INCF	TATE
		CLRF	PORTB
		CLRF	PORTC
		MOVF	TATE,W
		SUBLW	10H
		BTFSS	STATUS,Z
		GOTO	MA_2C
		
		DECFSZ	LOOP1,F
		GOTO	LOOPC

		MOVF	CONT,W
		SUBLW	0A8H		;ここの数を変える
		BTFSS	STATUS,Z
		GOTO	MA_1C
		GOTO	MAIN_C

DAT_1C
		ADDWF	PCL	
		RETLW	B'11111111'	;0
		RETLW	B'11111111'	;1
		RETLW	B'11111111'	;2
		RETLW	B'11111111'	;3
		RETLW	B'11111111'	;4
		RETLW	B'11111111'	;5
		RETLW	B'11111111'	;6
		RETLW	B'11111111'	;7
		RETLW	B'11111111'	;8
		RETLW	B'11111111'	;9
		RETLW	B'11111111'	;A
		RETLW	B'11111111'	;B
		RETLW	B'11111111'	;C
		RETLW	B'11111111'	;D
		RETLW	B'11111111'	;E
		RETLW	B'11111111'	;F
		RETLW	B'11111111'	;10
		RETLW	B'00000001'	;11
		RETLW	B'11101111'	;12
		RETLW	B'11101111'	;13
		RETLW	B'11101111'	;14
		RETLW	B'00000001'	;15
		RETLW	B'11111111'	;16
		RETLW	B'00000001'	;17
		RETLW	B'01101101'	;18
		RETLW	B'01101101'	;19
		RETLW	B'01101101'	;1A
		RETLW	B'01101101'	;1B
		RETLW	B'11111111'	;1C
		RETLW	B'00000001'	;1D
		RETLW	B'01111111'	;1E
		RETLW	B'01111111'	;1F
		RETLW	B'01111111'	;20
		RETLW	B'01111111'	;21
		RETLW	B'11111111'	;22
		RETLW	B'00000001'	;23
		RETLW	B'01111111'	;24
		RETLW	B'01111111'	;25
		RETLW	B'01111111'	;26
		RETLW	B'01111111'	;27
		RETLW	B'11111111'	;28
		RETLW	B'10000011'	;29
		RETLW	B'01111101'	;2A
		RETLW	B'01111101'	;2B
		RETLW	B'01111101'	;2C
		RETLW	B'10000011'	;2D
		RETLW	B'11111111'	;2E
		RETLW	B'11111111'	;2F
		RETLW	B'11111111'	;30
		RETLW	B'00000001'	;31
		RETLW	B'01101101'	;32
		RETLW	B'01101101'	;33
		RETLW	B'01101101'	;34
		RETLW	B'01101101'	;35
		RETLW	B'11111111'	;36
		RETLW	B'11000001'	;37
		RETLW	B'10111111'	;38
		RETLW	B'01111111'	;39
		RETLW	B'10111111'	;3A
		RETLW	B'11000001'	;3B
		RETLW	B'11111111'	;3C
		RETLW	B'00000001'	;3D
		RETLW	B'01101101'	;3E
		RETLW	B'01101101'	;3F
		RETLW	B'01101101'	;40
		RETLW	B'01101101'	;41
		RETLW	B'11111111'	;42
		RETLW	B'00000001'	;43
		RETLW	B'11101101'	;44
		RETLW	B'11001101'	;45
		RETLW	B'10101101'	;46
		RETLW	B'01110011'	;47
		RETLW	B'11111111'	;48
		RETLW	B'11111001'	;49
		RETLW	B'11110111'	;4A
		RETLW	B'00001111'	;4B
		RETLW	B'11110111'	;4C
		RETLW	B'11111001'	;4D
		RETLW	B'11111111'	;4E
		RETLW	B'10000011'	;4F
		RETLW	B'01111101'	;50
		RETLW	B'01111101'	;51
		RETLW	B'01111101'	;52
		RETLW	B'10000011'	;53
		RETLW	B'11111111'	;54
		RETLW	B'00000001'	;55
		RETLW	B'11110111'	;56
		RETLW	B'11101111'	;57
		RETLW	B'11011111'	;58
		RETLW	B'00000001'	;59
		RETLW	B'11111111'	;5A
		RETLW	B'00000001'	;5B
		RETLW	B'01101101'	;5C
		RETLW	B'01101101'	;5D
		RETLW	B'01101101'	;5E
		RETLW	B'01101101'	;5F
		RETLW	B'11111111'	;60
		RETLW	B'01111111'	;61
		RETLW	B'11111111'	;62
		RETLW	B'11111111'	;63
		RETLW	B'00000001'	;64
		RETLW	B'11101111'	;65
		RETLW	B'11101111'	;66
		RETLW	B'11101111'	;67
		RETLW	B'00000001'	;68
		RETLW	B'11111111'	;69
		RETLW	B'10000011'	;6A
		RETLW	B'01111101'	;6B
		RETLW	B'01111101'	;6C
		RETLW	B'01111101'	;6D
		RETLW	B'10000011'	;6E
		RETLW	B'11111111'	;6F
		RETLW	B'10000001'	;70
		RETLW	B'01111111'	;71
		RETLW	B'10011111'	;72
		RETLW	B'01111111'	;73
		RETLW	B'10000001'	;74
		RETLW	B'11111111'	;75
		RETLW	B'11111111'	;76
		RETLW	B'11111111'	;77
		RETLW	B'00000111'	;78
		RETLW	B'11011011'	;79
		RETLW	B'11011101'	;7A
		RETLW	B'11011011'	;7B
		RETLW	B'00000111'	;7C
		RETLW	B'11111111'	;7D
		RETLW	B'00000001'	;7E
		RETLW	B'11101101'	;7F
		RETLW	B'11001101'	;80
		RETLW	B'10101101'	;81
		RETLW	B'01110011'	;82
		RETLW	B'11111111'	;83
		RETLW	B'00000001'	;84
		RETLW	B'01101101'	;85
		RETLW	B'01101101'	;86
		RETLW	B'01101101'	;87
		RETLW	B'01101101'	;88
		RETLW	B'11111111'	;89
		RETLW	B'11111111'	;90
		RETLW	B'11111111'	;91
		RETLW	B'11111001'	;92
		RETLW	B'11110111'	;93
		RETLW	B'00001111'	;94
		RETLW	B'11110111'	;95
		RETLW	B'11111001'	;96
		RETLW	B'11111111'	;97
		RETLW	B'10000011'	;98
		RETLW	B'01111101'	;99
		RETLW	B'01111101'	;9A
		RETLW	B'01111101'	;9B
		RETLW	B'10000011'	;9C
		RETLW	B'11111111'	;9D
		RETLW	B'10000001'	;9E
		RETLW	B'01111111'	;9F
		RETLW	B'01111111'	;A0
		RETLW	B'01111111'	;A1
		RETLW	B'10000001'	;A2
		RETLW	B'11111111'	;A3
		RETLW	B'11110011'	;A4
		RETLW	B'11111101'	;A5
		RETLW	B'01001101'	;A6
		RETLW	B'11101101'	;A7
		RETLW	B'11110011'	;A8
		RETLW	B'11111111'	;A9
		RETLW	B'11111111'	;AA
		RETLW	B'11111111'	;AB
		RETLW	B'11111111'	;AC
		RETLW	B'11111111'	;AD
		RETLW	B'11111111'	;AE
		RETLW	B'11111111'	;AF
		RETLW	B'11111111'	;B0
		RETLW	B'11111111'	;B1
		RETLW	B'11111111'	;B2
		RETLW	B'11111111'	;B3
		RETLW	B'11111111'	;B4
		RETLW	B'11111111'	;B5
		RETLW	B'11111111'	;B6
		RETLW	B'11111111'	;B7
		RETLW	B'11111111'	;B8
		RETLW	B'11111111'	;B9
		RETLW	B'11111111'	;BA
		RETLW	B'11111111'	;BB
		RETLW	B'11111111'	;BC
		RETLW	B'11111111'	;BD
		RETLW	B'11111111'	;BE





DAT_2C
		ADDWF	PCL
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	1H
		RETLW	2H
		RETLW	4H
		RETLW	8H
		RETLW	10H
		RETLW	20H
		RETLW	40H
		RETLW	80H

DAT_3C
		ADDWF	PCL
		RETLW	1H
		RETLW	2H
		RETLW	4H
		RETLW	8H
		RETLW	10H
		RETLW	20H
		RETLW	40H
		RETLW	80H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H


WAITC
		MOVLW	5H
		MOVWF	TIM1
	WA1C	MOVLW	5H
		MOVWF	TIM2
	WA2C	NOP
		DECFSZ	TIM2,F
		GOTO	WA2C
		DECFSZ	TIM1,F
		GOTO	WA1C
		RETURN

;********************************************************************************************************

		ORG	1800H

MAIN_D
		MOVLW	0H
		MOVWF	CONT

MA_1D		INCF	CONT
		MOVLW	60H		;ここの数で速さを調節
		MOVWF	LOOP1
LOOPD		MOVF	CONT,W
		MOVWF	YOKO
		MOVLW	0H
		MOVWF	TATE
MA_2D		MOVF	YOKO,W	
		CALL	DAT_1D
		MOVWF	PORTA
		MOVF	TATE,W
		CALL	DAT_2D
		MOVWF	PORTB
		MOVF	TATE,W
		CALL	DAT_3D
		MOVWF	PORTC
		CALL	WAITD
		INCF	YOKO
		INCF	TATE
		CLRF	PORTB
		CLRF	PORTC
		MOVF	TATE,W
		SUBLW	10H
		BTFSS	STATUS,Z
		GOTO	MA_2D
		
		DECFSZ	LOOP1,F
		GOTO	LOOPD

		MOVF	CONT,W
		SUBLW	099H		;ここの数を変える
		BTFSS	STATUS,Z
		GOTO	MA_1D
		GOTO	MAIN_D

DAT_1D
		ADDWF	PCL	
	DT	B'11111111',B'11111111',B'11111111',B'11111111',B'11111111',B'11111111',B'11111111',B'11111111'	
	DT	B'11111111',B'11111111',B'11111111',B'11111111',B'11111111',B'11111111',B'11111111',B'11111111'	
	DT	B'11111100',B'11111100',B'10000000',B'11011111',B'11100011',B'11111011',B'11111111'		;♪
	DT	B'10000111',B'11111000',B'11100111',B'11111000',B'10000111',B'11111111'				;W
	DT	B'10000000',B'10110110',B'10110110',B'10110110',B'10110110',B'11111111'				;E
	DT	B'10000000',B'11111110',B'11111110',B'11111110',B'11111110',B'11111111'				;L
	DT	B'11000001',B'10111110',B'10111110',B'10111110',B'11011101',B'11111111'				;C
	DT	B'11000001',B'10111110',B'10111110',B'10111110',B'11000001',B'11111111'				;O
	DT	B'10000000',B'11011111',B'11101111',B'11011111',B'10000000',B'11111111'				;M
	DT	B'10000000',B'10110110',B'10110110',B'10110110',B'10110110',B'11111111',B'11111111',B'11111111'	;E
	DT	B'10111111',B'10111111',B'10000000',B'10111111',B'10111111',B'11111111'				;T
	DT	B'11000001',B'10111110',B'10111110',B'10111110',B'11000001',B'11111111',B'11111111',B'11111111'	;O
	DT	B'10111111',B'10111111',B'10000000',B'10111111',B'10111111',B'11111111'				;T
	DT	B'10000000',B'11110111',B'11110111',B'11110111',B'10000000',B'11111111'				;H
	DT	B'10000000',B'10110110',B'10110110',B'10110110',B'10110110',B'11111111',B'11111111',B'11111111'	;E
	DT	B'10000000',B'11011111',B'11101111',B'11011111',B'10000000',B'11111111'				;M
	DT	B'10000001',B'11111110',B'11111110',B'11111110',B'10000001',B'11111111'				;U
	DT	B'11001101',B'10110110',B'10110110',B'10110110',B'11011001',B'11111111'				;S
	DT	B'10111110',B'10000000',B'10111110',B'11111111'							;I
	DT	B'11000001',B'10111110',B'10111110',B'10111110',B'11011101',B'11111111',B'11111111',B'11111111'	;C
	DT	B'11000001',B'10111110',B'10111110',B'10111110',B'11011101',B'11111111'				;C
	DT	B'10000000',B'11111110',B'11111110',B'11111110',B'11111110',B'11111111'				;L
	DT	B'10000001',B'11111110',B'11111110',B'11111110',B'10000001',B'11111111'				;U
	DT	B'10000000',B'10110110',B'10110110',B'10110110',B'11001001'					;B
	DT	B'11111111',B'11111111',B'11111111',B'11111111',B'11111111',B'11111111',B'11111111',B'11111111'	
	DT	B'11111111',B'11111111',B'11111111',B'11111111',B'11111111',B'11111111',B'11111111',B'11111111'	





DAT_2D
		ADDWF	PCL
		RETLW	80H
		RETLW	40H
		RETLW	20H
		RETLW	10H
		RETLW	08H
		RETLW	04H
		RETLW	02H
		RETLW	01H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H


DAT_3D
		ADDWF	PCL
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	0H
		RETLW	80H
		RETLW	40H
		RETLW	20H
		RETLW	10H
		RETLW	08H
		RETLW	04H
		RETLW	02H
		RETLW	01H


WAITD
		MOVLW	5H
		MOVWF	TIM1
	WA1D	MOVLW	5H
		MOVWF	TIM2
	WA2D	NOP
		DECFSZ	TIM2,F
		GOTO	WA2D
		DECFSZ	TIM1,F
		GOTO	WA1D
		RETURN

	END