;
;		8x16 LEDドットマトリクス表示器制御プログラム
;		Copyright (c) 1999/01/13 by Tomekugi
;
;


		include	16f84.h

		.osc	hs
		.pwrt	on
		.wdt	off
		.protect off

		org	0ch

wait_cn		ds	1	;タイマーカウンター１
wait_cn2	ds	1	;タイマーカウンター２

read_pos	ds	1	;データ読み込みポイント
colun		ds	1	;Display Digit Position
loopsu		ds	1	;ループ回数
wk1		ds	1	;ワークエリア1



		org	0
		goto	start
		org	4
		goto	start


getpattern	jmp	pc+w
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	00000000b
		retw	11111110b
		retw	10001010b
		retw	10101010b
		retw	10101010b
		retw	10001010b
		retw	01111110b
		retw	00000000b
		retw	11111111b
		retw	01111111b
		retw	10111111b
		retw	11011111b
		retw	11100111b
		retw	11011000b
		retw	11011111b
		retw	10111111b
		retw	01111111b
		retw	11111111b
		retw	11111100b
		retw	01110011b
		retw	01111111b
		retw	10111111b
		retw	11000111b
		retw	11111000b
		retw	11111111b
		retw	01111110b
		retw	01111110b
		retw	10111110b
		retw	11011110b
		retw	11100110b
		retw	11111000b
		retw	11111111b
		retw	00000000b
		retw	11110111b
		retw	11110111b
		retw	11101111b
		retw	11101111b
		retw	11111111b
		retw	11101111b
		retw	01110000b
		retw	10001110b
		retw	10100000b
		retw	01111111b
		retw	01000000b
		retw	01111110b
		retw	01100000b
		retw	01011111b
		retw	01100111b
		retw	11111111b
		retw	11111110b
		retw	11000110b
		retw	10111010b
		retw	01111100b
		retw	01111110b
		retw	01111110b
		retw	11111111b
		retw	00011111b
		retw	00100011b
		retw	11011100b
		retw	11101111b
		retw	10011111b
		retw	01111111b
		retw	01111111b
		retw	10011111b
		retw	11111111b
		retw	11000000b
		retw	10111111b
		retw	01111111b
		retw	01111111b
		retw	01111111b
		retw	10111111b
		retw	11001111b
		retw	11111111b
		retw	10111111b
		retw	01011111b
		retw	01011111b
		retw	10000011b
		retw	10101111b
		retw	01101111b
		retw	11111111b
		retw	11100111b
		retw	11011011b
		retw	10111101b
		retw	10111101b
		retw	01111110b
		retw	11111111b
		retw	11111111b
		retw	11111110b
		retw	11000001b
		retw	11110011b
		retw	10111101b
		retw	10111101b
		retw	00000000b
		retw	10111101b
		retw	10111101b
		retw	11011011b
		retw	11100111b
		retw	11111111b
		retw	11110111b
		retw	11111010b
		retw	01111010b
		retw	01111010b
		retw	10111010b
		retw	11000111b
		retw	11111111b
		retw	10011110b
		retw	01101101b
		retw	01101101b
		retw	10000000b
		retw	11101111b
		retw	10101111b
		retw	11000011b
		retw	11101111b
		retw	11111111b
		retw	00011111b
		retw	00100011b
		retw	11011100b
		retw	11101111b
		retw	10011111b
		retw	01111111b
		retw	01111111b
		retw	10011111b
		retw	11111111b
		retw	10000000b
		retw	01111111b
		retw	10011101b
		retw	01101101b
		retw	01101101b
		retw	10000000b
		retw	11101101b
		retw	11011101b
		retw	10111101b
		retw	11111111b
		retw	10111110b
		retw	01111110b
		retw	01111110b
		retw	01111110b
		retw	01111010b
		retw	01111101b
		retw	11111111b
		retw	10111110b
		retw	01111110b
		retw	01111110b
		retw	01111110b
		retw	01111010b
		retw	01111101b
		retw	11111111b
		retw	11111110b
		retw	11000110b
		retw	10111010b
		retw	01100100b
		retw	01111110b
		retw	01100110b
		retw	11111111b
		retw	11101101b
		retw	11010101b
		retw	11010101b
		retw	11010101b
		retw	00000000b
		retw	11111101b
		retw	11111111b
		retw	11110111b
		retw	11101111b
		retw	11011111b
		retw	11011111b
		retw	11101111b
		retw	11110111b
		retw	11111011b
		retw	11111011b
		retw	11110111b
		retw	11111111b
		retw	11100001b
		retw	11000000b
		retw	10000001b
		retw	00000011b
		retw	10000001b
		retw	11000000b
		retw	11100001b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b
		retw	11111111b

start		clr	ra
		clr	rb
		mov	!ra,#0
		mov	!rb,#0

main0
		clr	read_pos
		clr	wk1
main
		mov	ra,colun

		call	data_put

		mov	wait_cn,#25	; wait 100usec
		call	wait

		inc	colun
		inc	wk1

		cjb	colun,#16,main	;表示幅16ドット
		clr	colun
		mov	wk1,read_pos	;
		inc	loopsu
		cjb	loopsu,#40,main;50回ﾙｰﾌﾟを回ったら、1ﾄﾞｯﾄ表示ｼﾌﾄ
		inc	read_pos	;ｼﾌﾄ数加算
		clr	loopsu		;ﾙｰﾌﾟｶｳﾝﾀｰ初期化
		cjb	read_pos,#209,main;データの全体長
		clr	read_pos
		goto	main

;
;data read
;
data_put
		
		mov	w,wk1		;
		call	getpattern	;データ読み込み
		mov	rb,w		;出力
		ret


;
;		μｓオーダーのウェイト
;
wait
wait0
		nop
		nop
		nop
		nop
		nop
		nop
		djnz	wait_cn,wait0
		ret

