Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ORG 0h
- AJMP START
- ORG 1Bh
- AJMP TIMER
- ORG 23h
- AJMP SEND
- ORG 30h
- START:
- MOV DPTR, #10h
- MOV A, #00000000b
- MOVX @DPTR, A
- INC DPTR
- MOV A, #00000001b
- MOVX @DPTR, A
- INC DPTR
- MOV A, #00000010b
- MOVX @DPTR, A
- INC DPTR
- MOV A, #00000011b
- MOVX @DPTR, A
- INC DPTR
- MOV A, #00000100b
- MOVX @DPTR, A
- INC DPTR
- MOV A, #00000101b
- MOVX @DPTR, A
- INC DPTR
- MOV A, #00000110b
- MOVX @DPTR, A
- INC DPTR
- MOV A, #00000111b
- MOVX @DPTR, A
- MOV SCON, #10010000b
- MOV PCON, #10000000b
- MOV IE, #10011000b
- RESTART:
- MOV DPTR, #10h
- MOV R0, #07d
- LOOP:
- CLR ES
- MOVX A, @DPTR
- INC DPTR
- ANL A, #0Fh
- ACALL FUNC
- MOV TMOD, #00010000b
- MOV TCON, #01000001b
- MOV R6, #20d
- CLR 18
- JNB 18, $
- MOV TCON, #00000000b
- SETB ES
- SETB TI
- ;CLR TI
- DJNZ R0, LOOP
- JMP RESTART
- SEND:
- MOV SBUF, A
- CLR TI
- RETI
- FUNC:
- MOV 20h, A
- MOV C, 01
- CPL C
- ANL C, /00
- ORL C, 02
- MOV 03, C
- ;here is the block of code which will calculate error bit of function
- XRL A, 20H ; this line of code create a bit of error
- MOV 25h, A ; we want to put bit of error to 07 bit of 20h byte, but fothis purpose we need another byte to hold it while we will transfer it
- MOV C, 43 ; transfering error bit
- MOV 07, C
- ; so, we have to put calclated function back to Accamulator
- MOV A, 20H
- RET
- TIMER:
- DJNZ R6, RESTART_TIMER
- SETB 18
- RETI
- RESTART_TIMER:
- MOV TH1, #00111100b ;15536
- MOV TL1, #10110000b ;15536
- RETI
- END
Add Comment
Please, Sign In to add comment