📄 pocsag_decoder.lst
字号:
0230: 3C 0C 01 CMP [12],1
(0262) jnz .temp
0233: B0 02 JNZ 0x0236
(0263) cpl A ;inverse data
0235: 73 CPL A
(0264) .temp:
(0265) call TX8_1_SendData ;send data into UART
0236: 90 A7 CALL TX8_1_SendData
(0266) mov A, [byte_cnt]
0238: 51 08 MOV A,[8]
(0267) cmp A, BYTE_NUM
023A: 39 44 CMP A,68
(0268) jz lp_next_batch ;if byte_cnt != BYTE_NUM
023C: A0 04 JZ 0x0241
(0269) inc A ;inc. byte_cnt
023E: 74 INC A
(0270) jmp lp_save_cnt
023F: 80 05 JMP 0x0245
(0271) lp_next_batch:
(0272) inc [batch_cnt] ;else inc. batch_cnt
0241: 76 0D INC [13]
(0273) mov A, 0 ;reset byte_cnt
0243: 50 00 MOV A,0
(0274) lp_save_cnt:
(0275) mov [byte_cnt], A
0245: 53 08 MOV [8],A
(0276) mov [data], 0 ;reset data
0247: 55 07 00 MOV [7],0
(0277) jmp lp_sample ;start sampling again
024A: 8F 81 JMP 0x01CC
(0278)
(0279) lp_end:
(0280) ;end receiving
(0281) mov REG[PRT2DR], 00h ;turn rate LEDs OFF
024C: 62 08 00 MOV REG[8],0
(0282) mov [inverse], 0 ;reset inverse
024F: 55 0C 00 MOV [12],0
(0283) mov [batch_cnt], 0 ;reset batch_cnt
0252: 55 0D 00 MOV [13],0
(0284) mov [start], 0 ;reset start flag
0255: 55 02 00 MOV [__r0+2],0
(0285) mov A, FFh ;timer period 2ms
0258: 50 FF MOV A,255
(0286) call Timer8_1_WritePeriod ;write timer period
025A: 90 A3 CALL _Timer8_1_WritePeriod
025C: 5D FF MOV A,REG[255]
025E: 70 FE AND F,254
0260: 41 E0 FD AND REG[224],253
0263: 21 80 AND A,128
0265: A0 03 JZ 0x0269
0267: 71 01 OR F,1
0269: 43 E0 20 OR REG[224],32
(0287) M8C_DisableIntMask INT_MSK0, INT_MSK0_AColumn0 ;enable analog0 int
(0288) M8C_EnableIntMask INT_MSK0, INT_MSK0_GPIO ;enable input INT
(0289) jmp l_start ;start over
026C: 8E DE JMP 0x014B
(0290)
(0291) ret
026E: 7F RET
(0292)
(0293) ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
(0294) ; Name : TIMER8_1_ISR
(0295) ; Desc. : Interrupt Service Routine for the timer
(0296) ; Input : None
(0297) ; Output : None
(0298) ; Operation : Serves Digital0 interrupt used by Timer. It will test comparator
(0299) ; output and increment corresponding counter. It will also increment
(0300) ; sampling counter
(0301) ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
(0302) TIMER8_1_ISR:
(0303) tst REG[CMP_CR], 0x10 ;mask comp 0
TIMER8_1_ISR:
026F: 49 64 10 TST REG[100],16
(0304) jz brn_isr_bit0 ;if comp != 0
0272: A0 05 JZ 0x0278
(0305) inc [hi_cnt] ;inc. hi_cnt
0274: 76 05 INC [5]
(0306) jmp brn_isr_end
0276: 80 03 JMP 0x027A
(0307) brn_isr_bit0:
(0308) inc [lo_cnt] ;else inc. lo_cnt
0278: 76 06 INC [6]
(0309) brn_isr_end:
(0310) inc [sample_cnt] ;inc. sample_cnt
027A: 76 09 INC [9]
(0311)
(0312) reti
027C: 7E RETI
(0313)
(0314) ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
(0315) ; Name : GPIO_ISR
(0316) ; Desc. : Interrupt Service Routine for GPIO
(0317) ; Input : None
(0318) ; Output : None
(0319) ; Operation : Serves GPIO interrupt enabled on P1[7] as "change of state" type.
(0320) ; If start flag is 0, it will read timer count, restart timer with
(0321) ; 2msec. period and set ready flag. If start flag is set, it will
(0322) ; restart counter, enable comparator interrupt and disable GPIO.
(0323) ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
(0324) GPIO_ISR:
(0325) push A
GPIO_ISR:
027D: 08 PUSH A
(0326) mov A, REG[PRT1DR] ;read input port
027E: 5D 04 MOV A,REG[4]
(0327) mov A, [start] ;if start == 0
0280: 51 02 MOV A,[__r0+2]
(0328) jnz .brn_isr_start
0282: B0 16 JNZ 0x0299
(0329) mov [ready], 1 ;set ready flag
0284: 55 01 01 MOV [__r0+1],1
(0330) call bTimer8_1_ReadTimer ;read timer count
0287: 90 C3 CALL _bTimer8_1_CaptureCounter
(0331) mov [rate], A ;save timer count as rate
0289: 53 03 MOV [__r0+3],A
(0332) call Timer8_1_Stop ;stop timer
028B: 90 6E CALL _Timer8_1_Stop
(0333) mov A, FFh
028D: 50 FF MOV A,255
(0334) call Timer8_1_WritePeriod ;write timer period
028F: 90 6E CALL _Timer8_1_WritePeriod
(0335) mov A, 00h
0291: 50 00 MOV A,0
(0336) call Timer8_1_WriteCompareValue ;write timer compare value
0293: 90 8A CALL Timer8_1_WriteCompareValue
(0337) call Timer8_1_Start ;start timer
0295: 90 60 CALL _Timer8_1_Start
(0338) jmp .brn_isr_end
0297: 80 15 JMP 0x02AD
(0339) .brn_isr_start:
(0340) ;statr == 1
(0341) call Timer8_1_Stop
0299: 90 60 CALL _Timer8_1_Stop
(0342) call Timer8_1_Start
029B: 90 5A CALL _Timer8_1_Start
029D: 5D FF MOV A,REG[255]
029F: 70 FE AND F,254
02A1: 41 E0 DF AND REG[224],223
02A4: 21 80 AND A,128
02A6: A0 03 JZ 0x02AA
02A8: 71 01 OR F,1
02AA: 43 E0 02 OR REG[224],2
(0343) M8C_DisableIntMask INT_MSK0, INT_MSK0_GPIO ;disable input INT
(0344) M8C_EnableIntMask INT_MSK0, INT_MSK0_AColumn0 ;enable analog0 int
(0345) .brn_isr_end:
(0346) pop A
02AD: 18 POP A
(0347) reti
02AE: 7E RETI
(0348)
(0349) ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
(0350) ; Name : GPIO_ISR
(0351) ; Desc. : Interrupt Service Routine for Comparator
(0352) ; Input : None
(0353) ; Output : None
(0354) ; Operation : Serves Analog0 interrupt used by comparator. On the rising edge it
(0355) ; ; will synchronize sampling count to the begining of new bit
(0356) ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
(0357) COMP_ISR:
(0358) cmp [sample_cnt], 5
COMP_ISR:
02AF: 3C 09 05 CMP [9],5
(0359) jc .brn_isr_left ;if sample_cnt. > SAMPLE_NUM/2
02B2: C0 06 JC 0x02B9
(0360) mov [sample_cnt], SAMPLE_NUM ;set sample_cnt = SAMPLE_NUM
02B4: 55 09 09 MOV [9],9
(0361) jmp .brn_isr_right
02B7: 80 0A JMP 0x02C2
(0362) .brn_isr_left:
(0363) mov [sample_cnt], 0 ;esle sample_cnt = 0
02B9: 55 09 00 MOV [9],0
(0364) mov [hi_cnt], 0 ;reset hi_cnt
02BC: 55 05 00 MOV [5],0
(0365) mov [lo_cnt], 0 ;reset lo_cnt
02BF: 55 06 00 MOV [6],0
(0366) .brn_isr_right:
(0367) reti 02C2: 7E RETI
FILE: C:\PROGRA~1\CYPRES~1\PSOCDE~1\PROJECTS\POCSAG~1\LIB\TX8_1INT.ASM
(0001) ;------------------------------------------------------------------------------
(0002) ; FILENAME: TX8_1int.asm
(0003) ; VERSION: Rev B, 2002 Mar 30
(0004) ;------------------------------------------------------------------------------
(0005) ; DESCRIPTION:
(0006) ; Interrupt handler routine for TX8 user module instance:
(0007) ; TX8_1.
(0008) ;------------------------------------------------------------------------------
(0009) ; Copyright (c) Cypress MicroSystems 2000-2002. All Rights Reserved.
(0010) ;------------------------------------------------------------------------------
(0011)
(0012) include "TX8_1.inc"
(0013)
(0014) area text (ROM, REL)
(0015)
(0016) ;-----------------------------------------------------
(0017) ; Export interrupt handler
(0018) ; NOTE that interrupt handler is NOT exported
(0019) ; for access by C function. Interrupt handlers
(0020) ; are not callable by C functions.
(0021) ;-----------------------------------------------------
(0022) export TX8_1INT
(0023)
(0024) ;-----------------------------------------------------------------------------
(0025) ; FUNCTION NAME: TX8_1Int
(0026) ;
(0027) ; DESCRIPTION:
(0028) ; TX8 interrupt handler for instance TX8_1.
(0029) ;
(0030) ; This is a place holder function. If the user requires use of an interrupt
(0031) ; handler for this function, then place code where specified.
(0032) ;
(0033) ; ARGUMENTS:
(0034) ; none.
(0035) ;
(0036) ; RETURNS:
(0037) ; none.
(0038) ;
(0039) ; SIDE EFFECTS:
(0040) ; none.
(0041) ;
(0042) ; THEORY of OPERATION:
(0043) ; none.
(0044) ;
(0045) ;-----------------------------------------------------------------------------
(0046) TX8_1INT:
(0047) ;--------------------------
(0048) ; Place user code here!!!
(0049) ;--------------------------
(0050) reti
TX8_1INT:
02C3: 7E RETI
FILE: C:\PROGRA~1\CYPRES~1\PSOCDE~1\PROJECTS\POCSAG~1\LIB\TX8_1.ASM
(0001) ;------------------------------------------------------------------------------
TX8_1_EnableInt:
_TX8_1_EnableInt:
02C4: 43 E1 10 OR REG[225],16
(0002) ; FILENAME: TX8_1.asm
(0003) ; VERSION: Rev B, 2002 Mar 30
(0004) ;------------------------------------------------------------------------------
(0005) ; DESCRIPTION:
(0006) ; TX8_1 TX8 User Module API.
(0007) ;------------------------------------------------------------------------------
(0008) ; Copyright (c) Cypress MicroSystems 2000-2002. All Rights Reserved.
(0009) ;------------------------------------------------------------------------------
(0010)
(0011) ;-----------------------------------------------
(0012) ; include instance specific register definitions
(0013) ;-----------------------------------------------
(0014) include "m8c.inc"
(0015) include "TX8_1.inc"
(0016)
(0017) area text (ROM, REL)
(0018)
(0019) ;-------------------------------------------------------------------
(0020) ; Declare the functions global for both assembler and C compiler.
(0021) ;
(0022) ; Note that there are two names for each API. First name is
(0023) ; assembler reference. Name with underscore is name refence for
(0024) ; C compiler. Calling function in C source code does not require
(0025) ; the underscore.
(0026) ;-------------------------------------------------------------------
(0027) export TX8_1_EnableInt
(0028) export _TX8_1_EnableInt
(0029) export TX8_1_DisableInt
(0030) export _TX8_1_DisableInt
(0031) export TX8_1_Start
(0032) export _TX8_1_Start
(0033) export TX8_1_Stop
(0034) export _TX8_1_Stop
(0035) export TX8_1_SendData
(0036) export _TX8_1_SendData
(0037) export bTX8_1_ReadTxStatus
(0038) export _bTX8_1_ReadTxStatus
(0039)
(0040) ;-----------
(0041) ; EQUATES
(0042) ;-----------
(0043) bfCONTROL_REG_START_BIT: equ 1 ; Control register start bit
(0044)
(0045) ;-----------------------------------------------------------------------------
(0046) ; FUNCTION NAME: TX8_1_EnableInt
(0047) ;
(0048) ; DESCRIPTION:
(0049) ; Enables this Transmitter's interrupt by setting the interrupt enable mask
(0050) ; bit associated with this User Module. Remember to call the global interrupt
(0051) ; enable function by using the macro: M8C_EnableGInt.
(0052) ;
(0053) ; ARGUMENTS:
(0054) ; none.
(0055) ;
(0056) ; RETURNS:
(0057) ; none.
(0058) ;
(0059) ; SIDE EFFECTS:
(0060) ; none.
(0061) ;
(0062) ; THEORY of OPERATION:
(0063) ; Sets the specific user module interrupt enable mask bit.
(0064) ;
(0065) ;-----------------------------------------------------------------------------
(0066) TX8_1_EnableInt:
(0067) _TX8_1_EnableInt:
(0068) M8C_EnableIntMask TX8_1_INT_REG, bTX8_1_INT_MASK
(0069) ret
02C7: 7F RET
_TX8_1_DisableInt:
TX8_1_DisableInt:
02C8: 5D FF MOV A,REG[255]
02CA: 70 FE AND F,254
02CC: 41 E1 EF AND REG[225],239
02CF: 21 80 AND A,128
02D1: A0 03 JZ 0x02D5
02D3: 71 01 OR F,1
(0070)
(0071)
(0072) ;-----------------------------------------------------------------------------
(0073) ; FUNCTION NAME: TX8_1_DisableInt
(0074) ;
(0075) ; DESCRIPTION:
(0076) ; Disables this TX8's interrupt by clearing the interrupt enable mask bit
(0077) ; associated with this User Module.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -