COUNT EQU 20H DL3 EQU 21H DL2 EQU 22H DL1 EQU 23H COUNT1 EQU 24H
org 00h jmp 0010h nop nop nop nop ORG 10H LDI TRISA,1111B LDI COUNT,0000B ;高位 LDI COUNT1,0000B ;低位 ; LDI COUNT,1010B ; LDI COUNT1,0101B ANDIM PA,1011B CALL DELAY414U ;************************ LDA COUNT1 BA0 $+3 ANDIM PA,1011B JMP $+2 ORIM PA,0100B CALL DELAY414U ;************************ LDA COUNT1 BA1 $+3 ANDIM PA,1011B JMP $+2 ORIM PA,0100B CALL DELAY414U ;************************ LDA COUNT1 BA2 $+3 ANDIM PA,1011B JMP $+2 ORIM PA,0100B CALL DELAY414U ;************************ LDA COUNT1 BA3 $+3 ANDIM PA,1011B JMP $+2 ORIM PA,0100B CALL DELAY414U ;*************************************************************************** LDA COUNT BA0 $+3 ANDIM PA,1011B JMP $+2 ORIM PA,0100B CALL DELAY414U ;************************ LDA COUNT BA1 $+3 ANDIM PA,1011B JMP $+2 ORIM PA,0100B CALL DELAY414U ;************************ LDA COUNT BA2 $+3 ANDIM PA,1011B JMP $+2 ORIM PA,0100B CALL DELAY414U ;************************ LDA COUNT BA3 $+3 ANDIM PA,1011B JMP $+2 ORIM PA,0100B CALL DELAY414U ;************************ ORIM PA,0100B CALL DELAY414U CALL DELAY414U JMP 0013H DELAY414U: ;bps: 2400 4800 9600 14400 19200 38400 LDI DL3,1; 2 1 1 2 2 1 DELAY414U02: LDI DL2,5; 8 8 5 3 2 2 DELAY414U03: LDI DL1,8; 11 11 8 3 3 3 SBIM DL1,1 BNZ $-1 SBIM DL2,1 BNZ DELAY414U03 LDI WDCON,1000b SBIM DL3,1 BNZ DELAY414U02 RTNI |