home *** CD-ROM | disk | FTP | other *** search
- ORG 32
- BFBASE: DS BFSIZE
- ORG 100H
- MAIN: CLR A
- MOV P1,A
- CLR F0
- SETB RS1
- MOV R0,#BFBASE
- CLR RS1
- MOV R0,#BFBASE
- CLR RS1
- MOV SCON,#50H
- MOV TMOD,#20H
- MOV TH1,#0FDH
- MOV TL1,TH1
- MOV IP,#10H
- MOV IE,#92H
- MOV TCON,#50H
- CALL GETSW
- NEWPTRN: MOV R2,A
- MOV R3,A
- MOV P1,A
- CPL A
- MOV TH0,A
- ROTATE: MOV A,R3
- JB F0,ROTLEFT
- RR A
- JMP SETP1
- ROTLEFT: RL A
- SETP1: MOV R3,A
- MOV P1,A
- CALL GETSW
- XRL A,R2
- JZ ROTATE
- XRL A,R2
- JMP NEWPTRN
- GETSW: MOV A,P2
- RET
- TOINT: PUSH ACC
- CPL F0
- MOV A,R2
- CPL A
- MOV TH0,A
- POP ACC
- RETI
- SERIAL: PUSH ACC
- PUSH PSW
- CLR RI
- MOV PSW,#10H
- MOV A,SBUF
- MOV B,A
- XRL A,#0DH
- JNZ BUFCHAR
- MOV A,#BFSIZE
- CLR C
- SUBB A,R0
- CPL A
- JZ EXIT
- MOV R3,A
- CLR A
- CLEAR: DEC R0
- MOVX @R0,A
- DJNZ R3,CLEAR
- JMP EXIT
- BUFCHAR: MOV A,#BFSIZE+BFBASE
- CLR C
- SUBB A,R0
- JC EXIT
- MOV A,B
- MOVX @R0,A
- SAVEPTR: INC R0
- EXIT: POP PSW
- POP ACC
- RETI
- ORG 0
- JMP MAIN
- ORG SINT
- JMP SERIAL
- ORG TIMER0
- JMP TOINT
- BFSIZE EQU 31
- END