stm8/ ; =========================================================================== ; Segment type: Pure data BYTES segment byte at: 00 'ram0' ds.b 1 byte_1 ds.b 1 byte_2 ds.b 1 ds.b 1 byte_4 ds.b 1 byte_5 ds.b 1 byte_6 ds.b 1 byte_7 ds.b 1 byte_8 ds.b 1 ds.b 1 byte_A ds.b 1 ds.b 1 byte_C ds.b 1 ds.b 1 byte_E ds.b 1 ds.b 1 ds.b 1 ds.b 1 byte_12 ds.b 1 byte_13 ds.b 1 byte_14 ds.b 1 ds.b 1 byte_16 ds.b 1 byte_17 ds.b 1 byte_18 ds.b 1 byte_19 ds.b 1 byte_1A ds.b 1 byte_1B ds.b 1 byte_1C ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 byte_21 ds.b 1 ds.b 1 byte_23 ds.b 1 byte_24 ds.b 1 DMX_loc_addrw ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 byte_2F ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 byte_40 ds.b 1 ds.b 1 byte_42 ds.b 1 ds.b 1 byte_44 ds.b 1 ds.b 1 byte_46 ds.b 1 byte_47 ds.b 1 byte_48 ds.b 1 byte_49 ds.b 1 active_digit_btn ds.b 1 byte_4B ds.b 1 ds.b 1 device_mode ds.b 1 dev_operation_mode ds.b 1 DMX_addrw_bH ds.b 1 DMX_addr_bL ds.b 1 byte_51 ds.b 1 byte_52 ds.b 1 byte_53 ds.b 1 byte_54 ds.b 1 byte_55 ds.b 1 byte_56 ds.b 1 byte_57 ds.b 1 byte_58 ds.b 1 byte_59 ds.b 1 byte_5A ds.b 1 byte_5B ds.b 1 byte_5C ds.b 1 ds.b 1 byte_5E ds.b 1 ds.b 1 word_60 ds.b 2 word_62 ds.b 2 btns_old_clean ds.b 1 btn_and_dmx ds.b 1 btns_clean ds.b 1 btn_dbc_cnt ds.b 1 btn_old_tmp ds.b 1 btn_new_tmp ds.b 1 byte_6A ds.b 1 byte_6B ds.b 1 byte_6C ds.b 1 byte_6D ds.b 1 byte_6E ds.b 1 byte_6F ds.b 1 byte_70 ds.b 1 byte_71 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 byte_93 ds.b 1 ds.b 1 ds.b 1 ds.b 1 byte_97 ds.b 1 byte_98 ds.b 1 byte_99 ds.b 1 byte_9A ds.b 1 byte_9B ds.b 1 byte_9C ds.b 1 byte_9D ds.b 1 byte_9E ds.b 1 ds.b 1 ds.b 1 byte_A1 ds.b 1 byte_A2 ds.b 1 byte_A3 ds.b 1 byte_A4 ds.b 1 ds.b 1 byte_A6 ds.b 1 byte_A7 ds.b 1 byte_A8 ds.b 1 byte_A9 ds.b 1 byte_AA ds.b 1 ds.b 1 byte_AC ds.b 1 ds.b 1 byte_AE ds.b 1 ds.b 1 byte_B0 ds.b 1 ds.b 1 byte_B2 ds.b 1 ds.b 1 byte_B4 ds.b 1 ds.b 1 byte_B6 ds.b 1 ds.b 1 byte_B8 ds.b 1 byte_B9 ds.b 1 byte_BA ds.b 1 byte_BB ds.b 1 byte_BC ds.b 1 byte_BD ds.b 1 byte_BE ds.b 1 byte_BF ds.b 1 segment byte at 5000 'periph2' PA_ODR ds.b 1 ; Port A data output latch register PA_IDR ds.b 1 ; Port A input pin value register PA_DDR ds.b 1 ; Port A data direction register PA_CR1 ds.b 1 ; Port A control register 1 PA_CR2 ds.b 1 ; Port A control register 2 PB_ODR ds.b 1 ; Port B data output latch register PB_IDR ds.b 1 ; Port B input pin value register PB_DDR ds.b 1 ; Port B data direction register PB_CR1 ds.b 1 ; Port B control register 1 PB_CR2 ds.b 1 ; Port B control register 2 PC_ODR ds.b 1 ; Port C data output latch register PC_IDR ds.b 1 ; Port C input pin value register PC_DDR ds.b 1 ; Port C data direction register PC_CR1 ds.b 1 ; Port C control register 1 PC_CR2 ds.b 1 ; Port C control register 2 PD_ODR ds.b 1 ; Port D data output latch register PD_IDR ds.b 1 ; Port D input pin value register PD_DDR ds.b 1 ; Port D data direction register PD_CR1 ds.b 1 ; Port D control register 1 PD_CR2 ds.b 1 ; Port D control register 2 PE_ODR ds.b 1 ; Port E data output latch register PE_IDR ds.b 1 ; Port E input pin value register PE_DDR ds.b 1 ; Port E data direction register PE_CR1 ds.b 1 ; Port E control register 1 PE_CR2 ds.b 1 ; Port E control register 2 PF_ODR ds.b 1 ; Port F data output latch register PF_IDR ds.b 1 ; Port F input pin value register PF_DDR ds.b 1 ; Port F data direction register PF_CR1 ds.b 1 ; Port F control register 1 PF_CR2 ds.b 2 ; Port F control register 2 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 FLASH_CR1 ds.b 1 ; Flash control register 1 FLASH_CR2 ds.b 1 ; Flash control register 2 FLASH_NCR2 ds.b 1 ; Flash complementary control register 2 FLASH_FPR ds.b 1 ; Flash protection register FLASH_NFPR ds.b 1 ; Flash complementary protection register FLASH_IAPSR ds.b 2 ; Flash in-application programming status register ds.b 1 FLASH_PUKR ds.b 2 ; Flash Program memory unprotection register FLASH_DUKR ds.b 2 ; Data EEPROM unprotection register ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 EXTI_CR1 ds.b 1 ; External interrupt control register 1 EXTI_CR2 ds.b 2 ; External interrupt control register 2 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 RST_SR ds.b 2 ; Reset status register ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 CLK_ICKCR ds.b 1 ; Internal clock control register CLK_ECKCR ds.b 2 ; External clock control register CLK_CMSR ds.b 1 ; Clock master status register CLK_SWR ds.b 1 ; System clock switch register CLK_SWCR ds.b 1 ; Clock switch control register CLK_CKDIVR ds.b 1 ; System clock divider register CLK_PCKENR1 ds.b 1 ; Peripheral clock gating register 1 CLK_CSSR ds.b 1 ; Clock security system register CLK_CCOR ds.b 1 ; Configurable clock control register CLK_PCKENR2 ds.b 2 ; Peripheral clock gating register 2 CLK_HSITRIMR ds.b 1 ; HSI clock calibration trimming register CLK_SWIMCCR ds.b 2 ; SWIM clock control register ds.b 1 ds.b 1 WWDG_CR ds.b 1 ; WWDG Control Register WWDG_WR ds.b 2 ; WWDR Window Register ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 IWDG_KR ds.b 1 ; IWDG Key Register IWDG_PR ds.b 1 ; IWDG Prescaler Register IWDG_RLR ds.b 2 ; IWDG Reload Register ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 AWU_CSR1 ds.b 1 ; AWU Control/Status Register 1 AWU_APR ds.b 1 ; AWU Asyncronous prescaler buffer register AWU_TBR ds.b 1 ; AWU Timebase selection register BEEP_CSR ds.b 2 ; BEEP Control/Status Register ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 SPI_CR1 ds.b 1 ; SPI Control Register 1 SPI_CR2 ds.b 1 ; SPI Control Register 2 SPI_ICR ds.b 1 ; SPI Interrupt Control Register SPI_SR ds.b 1 ; SPI Status Register SPI_DR ds.b 1 ; SPI Data Register SPI_CRCPR ds.b 1 ; SPI CRC Polynomial Register SPI_RXCRCR ds.b 1 ; SPI Rx CRC Register SPI_TXCRCR ds.b 2 ; SPI Tx CRC Register ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 I2C_CR1 ds.b 1 ; I2C control register 1 I2C_CR2 ds.b 1 ; I2C control register 2 I2C_FREQR ds.b 1 ; I2C frequency register I2C_OARL ds.b 1 ; I2C Own address register low I2C_OARH ds.b 2 ; I2C Own address register high I2C_DR ds.b 1 ; I2C data register I2C_SR1 ds.b 1 ; I2C status register 1 I2C_SR2 ds.b 1 ; I2C status register 2 I2C_SR3 ds.b 1 ; I2C status register 3 I2C_ITR ds.b 1 ; I2C interrupt control register I2C_CCRL ds.b 1 ; I2C Clock control register low I2C_CCRH ds.b 1 ; I2C Clock control register high I2C_TRISER ds.b 1 ; I2C TRISE register I2C_PECR ds.b 2 ; I2C packet error checking register ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 USART1_SR ds.b 1 ; USART1 Status Register USART1_DR ds.b 1 ; USART1 Data Register USART1_BRR1 ds.b 1 ; USART1 Baud Rate Register 1 USART1_BRR2 ds.b 1 ; USART1 Baud Rate Register 2 USART1_CR1 ds.b 1 ; USART1 Control Register 1 USART1_CR2 ds.b 1 ; USART1 Control Register 2 USART1_CR3 ds.b 1 ; USART1 Control Register 3 USART1_CR4 ds.b 1 ; USART1 Control Register 4 USART1_CR5 ds.b 1 ; USART1 Control Register 5 USART1_GTR ds.b 1 ; USART1 Guard time Register USART1_PSCR ds.b 2 ; USART1 Prescaler Register ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 TIM1_CR1 ds.b 1 ; TIM1 Control register 1 TIM1_CR2 ds.b 1 ; TIM1 Control register 2 TIM1_SMCR ds.b 1 ; TIM1 Slave Mode Control register TIM1_ETR ds.b 1 ; TIM1 External trigger register TIM1_IER ds.b 1 ; TIM1 Interrupt enable register TIM1_SR1 ds.b 1 ; TIM1 Status register 1 TIM1_SR2 ds.b 1 ; TIM1 Status register 2 TIM1_EGR ds.b 1 ; TIM1 Event Generation register TIM1_CCMR1 ds.b 1 ; TIM1 Capture/Compare mode register 1 TIM1_CCMR2 ds.b 1 ; TIM1 Capture/Compare mode register 2 TIM1_CCMR3 ds.b 1 ; TIM1 Capture/Compare mode register 3 TIM1_CCMR4 ds.b 1 ; TIM1 Capture/Compare mode register 4 TIM1_CCER1 ds.b 1 ; TIM1 Capture/Compare enable register 1 TIM1_CCER2 ds.b 1 ; TIM1 Capture/Compare enable register 2 TI11_CNTRH ds.b 1 ; TIM1 Counter High TIM1_CNTRL ds.b 1 ; TIM1 Counter Low TIM1_PSCRH ds.b 1 ; TIM1 Prescaler Register High TIM1_PSCRL ds.b 1 ; TIM1 Prescaler Register Low TIM1_ARRH ds.b 1 ; TIM1 Auto-Reload Register High TIM1_ARRL ds.b 1 ; TIM1 Auto-Reload Register Low TIM1_RCL ds.b 1 ; TIM1 Repetition Counter Register TIM1_CCR1H ds.b 1 ; TIM1 Capture/Compare Register 1 High TIM1_CCR1L ds.b 1 ; TIM1 Capture/Compare Register 1 Low TIM1_CCR2H ds.b 1 ; TIM1 Capture/Compare Register 2 High TIM1_CCR2L ds.b 1 ; TIM1 Capture/Compare Register 2 Low TIM1_CCR3H ds.b 1 ; TIM1 Capture/Compare Register 3 High TIM1_CCR3L ds.b 1 ; TIM1 Capture/Compare Register 3 Low TIM1_CCR4H ds.b 1 ; TIM1 Capture/Compare Register 4 High TIM1_CCR4L ds.b 1 ; TIM1 Capture/Compare Register 4 Low TIM1_BKR ds.b 1 ; TIM1 Break register TIM1_DTR ds.b 1 ; TIM1 dead-time register TIM1_OISR ds.b 2 ; TIM1 Output idle state register ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 TIM2_CR1 ds.b 2 ; TIM2 Control register 1 ds.b 1 TIM2_IER ds.b 1 ; TIM2 Interrupt enable register TIM2_SR1 ds.b 1 ; TIM2 Status register 1 TIM2_SR2 ds.b 1 ; TIM2 Status register 2 TIM2_EGR ds.b 1 ; TIM2 Event Generation register TIM2_CCMR1 ds.b 1 ; TIM2 Capture/Compare mode register 1 TIM2_CCMR2 ds.b 1 ; TIM2 Capture/Compare mode register 2 TIM2_CCMR3 ds.b 1 ; TIM2 Capture/Compare mode register 3 TIM2_CCER1 ds.b 1 ; TIM2 Capture/Compare enable register 1 TIM2_CCER2 ds.b 1 ; TIM2 Capture/Compare enable register 2 TIM2_CNTRH ds.b 1 ; TIM2 Counter High TIM2_CNTRL ds.b 1 ; TIM2 Counter Low TIM2_PSCR ds.b 1 ; TIM2 Prescaler register TIM2_ARRH ds.b 1 ; TIM2 Auto-Reload Register High TIM2_ARRL ds.b 1 ; TIM2 Auto-Reload Register Low TIM2_CCR1H ds.b 1 ; TIM2 Capture/Compare Register 1 High TIM2_CCR1L ds.b 1 ; TIM2 Capture/Compare Register 1 Low TIM2_CCR2H ds.b 1 ; TIM2 Capture/Compare Register 2 High TIM2_CCR2L ds.b 1 ; TIM2 Capture/Compare Register 2 Low TIM2_CCR3H ds.b 1 ; TIM2 Capture/Compare Register 3 High TIM2_CCR3L ds.b 2 ; TIM2 Capture/Compare Register 3 Low ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 TIM4_CR1 ds.b 2 ; TIM4 Control Register 1 ds.b 1 TIM4_IER ds.b 1 ; TIM4 Interrupt Enable Register TIM4_SR ds.b 1 ; TIM4 Status Register TIM4_EGR ds.b 1 ; TIM4 Event Generation Register TIM4_CNTR ds.b 1 ; TIM4 Counter TIM4_PSCR ds.b 1 ; TIM4 Prescaler Register TIM4_ARR ds.b 2 ; TIM4 Auto-Reload Register ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ds.b 1 ADC_CSR ds.b 1 ; ADC Control/Status register ADC_CR1 ds.b 1 ; ADC Configuration register 1 ADC_CR2 ds.b 1 ; ADC Configuration register 2 ADC_CR3 ds.b 1 ; ADC Configuration register 3 ADC_DRH ds.b 1 ; ADC Data Register High ADC_DRL ds.b 1 ; ADC Data Register Low ADC_TDRH ds.b 1 ; ADC Schmitt trigger disable register high ADC_TDRL ds.b 1 ; ADC Schmitt trigger disable register low ADC_HTRH ds.b 1 ; ADC High Threshold Register High ADC_HTRL ds.b 1 ; ADC High Threshold Register Low ADC_LTRH ds.b 1 ; ADC Low Threshold Register High ADC_LTRL ds.b 1 ; ADC Low Threshold Register Low ADC_AWSRH ds.b 1 ; ADC analog watchdog status register high ADC_AWSRL ds.b 1 ; ADC analog watchdog status register low ADC_AWCRH ds.b 1 ; ADC analog watchdog control register high ADC_AWCRL ds.b 2 ; ADC analog watchdog control register low ; File Name : D:\__SORTED__\Utils\uC_Develop\__stm\xc-10_w_remote_prg.hex ; Format : Intel Hex Object Format ; =========================================================================== ; Segment type: Pure code WORDS segment byte 'vectit' ; =============== S U B R O U T I N E ======================================= ; Reset ; Attributes: thunk public __RESET __RESET: dc.l {$82000000+ __RESET_0 } ; Interrupt ; End of function __RESET ; =============== S U B R O U T I N E ======================================= ; TRAP (software) Interrupt Vector ; Attributes: thunk public TRAP_ TRAP_: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function TRAP_ ; =============== S U B R O U T I N E ======================================= ; External Top Level Interrupt ; Attributes: thunk public TLI_ TLI_: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function TLI_ ; =============== S U B R O U T I N E ======================================= ; Auto wake up from halt ; Attributes: thunk public AWU AWU: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function AWU ; =============== S U B R O U T I N E ======================================= ; Clock controller ; Attributes: thunk public CLK CLK: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function CLK ; =============== S U B R O U T I N E ======================================= ; External interrupt 0 ; Attributes: thunk public EXTI0 EXTI0: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function EXTI0 ; =============== S U B R O U T I N E ======================================= ; External interrupt 1 ; Attributes: thunk public EXTI1 EXTI1: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function EXTI1 ; =============== S U B R O U T I N E ======================================= ; External interrupt 2 ; Attributes: thunk public EXTI2 EXTI2: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function EXTI2 ; =============== S U B R O U T I N E ======================================= ; External interrupt 3 ; Attributes: thunk public EXTI3 EXTI3: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function EXTI3 ; =============== S U B R O U T I N E ======================================= ; External interrupt 4 ; Attributes: thunk public EXTI4__jmp EXTI4__jmp: dc.l {$82000000+ EXTI4_0 } ; Interrupt ; End of function EXTI4__jmp ; --------------------------------------------------------------------------- dc.b $82 ; dc.b 0 dc.b $9F ; dc.b $F3 ; dc.b $82 ; dc.b 0 dc.b $9F ; dc.b $F3 ; ; =============== S U B R O U T I N E ======================================= ; End of Transfer ; Attributes: thunk public SPI SPI: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function SPI ; =============== S U B R O U T I N E ======================================= ; TIM1 Update/overflow/underflow/trigger/break ; Attributes: thunk public TIM1 TIM1: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function TIM1 ; =============== S U B R O U T I N E ======================================= ; TIM1 Capture/Compare ; Attributes: thunk public TIM1_ TIM1_: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function TIM1_ ; =============== S U B R O U T I N E ======================================= ; TIM2 Update/overflow ; Attributes: thunk public TIM2__jmp TIM2__jmp: dc.l {$82000000+ TIM2_0 } ; Interrupt ; End of function TIM2__jmp ; =============== S U B R O U T I N E ======================================= ; TIM2 Capture/Compare ; Attributes: thunk public TIM2_ TIM2_: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function TIM2_ ; --------------------------------------------------------------------------- dc.b $82 ; dc.b 0 dc.b $9F ; dc.b $F3 ; dc.b $82 ; dc.b 0 dc.b $9F ; dc.b $F3 ; ; =============== S U B R O U T I N E ======================================= ; USART1 transmission complete ; Attributes: thunk public USART1 USART1: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function USART1 ; =============== S U B R O U T I N E ======================================= ; USART1 Receive register data full ; Attributes: thunk public USART1___jmp USART1___jmp: dc.l {$82000000+ USART1__0 } ; Interrupt ; End of function USART1___jmp ; =============== S U B R O U T I N E ======================================= ; I2C interrupt ; Attributes: thunk public I2C I2C: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function I2C ; --------------------------------------------------------------------------- dc.b $82 ; dc.b 0 dc.b $9F ; dc.b $F3 ; dc.b $82 ; dc.b 0 dc.b $9F ; dc.b $F3 ; ; =============== S U B R O U T I N E ======================================= ; ADC1 end of conversion/analog watchdog interrupt ; Attributes: thunk public ADC1 ADC1: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function ADC1 ; =============== S U B R O U T I N E ======================================= ; Update/overflow ; Attributes: thunk public TIM4 TIM4: dc.l { $82000000+ nullsub_1 } ; Interrupt ; End of function TIM4 ; =============== S U B R O U T I N E ======================================= ; EOP/WR_PG_DIS ; Attributes: thunk public FLASH_ FLASH_: dc.l {$82000000+ nullsub_1 } ; Interrupt ; End of function FLASH_ ; --------------------------------------------------------------------------- dc.b $82 ; dc.b 0 dc.b $9F ; dc.b $F3 ; dc.b $82 ; dc.b 0 dc.b $9F ; dc.b $F3 ; dc.b $82 ; dc.b 0 dc.b $9F ; dc.b $F3 ; dc.b $82 ; dc.b 0 dc.b $9F ; dc.b $F3 ; dc.b $82 ; dc.b 0 dc.b $9F ; dc.b $F3 ; segment byte 'rom' dc.b $C0 ; dc.b $F9 ; dc.b $A4 ; dc.b $B0 ; dc.b $99 ; dc.b $92 ; dc.b $82 ; dc.b $F8 ; dc.b $80 ; dc.b $90 ; dc.b $43 ; C dc.b 0 dc.b 0 dc.b 0 dc.b $41 ; A dc.b $61 ; a dc.b $99 ; dc.b $99 ; dc.b $41 ; A dc.b $E2 ; dc.b $66 ; f dc.b $66 ; f dc.b $41 ; A dc.b $61 ; a dc.b $99 ; dc.b $99 ; dc.b $40 ; @ dc.b $C9 ; dc.b $99 ; dc.b $99 ; dc.w loc_94CD ; jump table for switch statement dc.w loc_94DD dc.w loc_94EE dc.w loc_94FD dc.w loc_950D dc.w loc_951F dc.w loc_9531 dc.w loc_9541 dc.w loc_9553 dc.w loc_9564 dc.w loc_9574 dc.w loc_9582 dc.w loc_9590 dc.w loc_95A0 dc.w loc_95AF dc.w loc_95BE dc.w loc_95CB dc.w loc_95DA dc.w loc_95EA dc.w loc_95F8 dc.w loc_964B ; jump table for switch statement dc.w loc_965D dc.w loc_966E dc.w loc_9681 dc.w loc_9691 dc.w loc_96A3 dc.w loc_96B5 dc.w loc_96CB dc.w loc_96DD dc.w loc_96F3 dc.w loc_9704 dc.w loc_9719 dc.w loc_972C dc.w loc_9745 dc.w loc_9756 dc.w loc_976B dc.w loc_977B dc.w loc_978F dc.w loc_979E dc.w loc_97B1 dc.w loc_97BF dc.w loc_97CF dc.w loc_97DE byte_80F4 dc.b $80 dc.b $FC ; dc.b $62 ; b dc.b 0 dc.b 0 dc.b $81 ; dc.b $46 ; F dc.b 0 dc.b 1 dc.b 0 dc.b 0 dc.b $C0 ; dc.b $F9 ; dc.b $A4 ; dc.b $B0 ; dc.b $99 ; dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b $80 ; dc.b 0 dc.b 0 dc.b 0 dc.b $A dc.b $A dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 1 dc.b 0 dc.b 2 dc.b 0 dc.b 3 dc.b 0 dc.b 4 dc.b 0 dc.b 5 dc.b 0 dc.b 6 dc.b 0 dc.b 7 dc.b $61 ; a dc.b $A8 ; dc.b 0 dc.b 0 dc.b 1 dc.b 0 dc.b 0 dc.b 0 dc.b 0 dc.b 0 ; =============== S U B R O U T I N E ======================================= __RESET_0: ldw x, #$3FF ; Load word ldw sp, x ; Load word ldw y, byte_80F4 ; Load word ldw x, #$80F6 ; Load word loc_8151: ; Load ld a, (x) jreq loc_8174 ; Jump if Z = 1 (equal) bcp a, #$60 ; '`' ; Bit compare jreq loc_816F ; Jump if Z = 1 (equal) ldw byte_BC, x ; Load word ldw x, (3,x) ; Load word ldw byte_BF, x ; Load word ldw x, byte_BC ; Load word ldw x, (1,x) ; Load word loc_8162: ; Load ld a, (y) ld (x), a ; Load incw x ; Increment Word incw y ; Increment Word cpw y, byte_BF ; Arithmetic Compare Word jrne loc_8162 ; Jump if Z = 0 (not equal) ldw x, byte_BC ; Load word loc_816F: ; Addition Word addw x, #5 jra loc_8151 ; Jump relative always ; --------------------------------------------------------------------------- loc_8174: ; Load word ldw x, #$4A ; 'J' jra loc_817B ; Jump relative always ; --------------------------------------------------------------------------- loc_8179: ; Load ld (x), a incw x ; Increment Word loc_817B: ; Arithmetic Compare Word cpw x, #$C2 ; '' jrne loc_8179 ; Jump if Z = 0 (not equal) ldw x, #$100 ; Load word jra loc_8187 ; Jump relative always ; --------------------------------------------------------------------------- loc_8185: ; Load ld (x), a incw x ; Increment Word loc_8187: ; Arithmetic Compare Word cpw x, #$100 jrne loc_8185 ; Jump if Z = 0 (not equal) call device_init ; Call subroutine loc_818F: ; Jump relative always jra loc_818F ; End of function __RESET_0 ; =============== S U B R O U T I N E ======================================= sub_8191: pushw x ; Push word onto the Stack pushw x ; Push word onto the Stack ld a, #4 ; Load ld (1,sp), a ; Load ld a, #5 ; Load ld (2,sp), a ; Load loc_819B: ; Load ld a, (7,sp) ld xl, a ; Load ld a, (8,sp) ; Load add a, (1,sp) ; Addition jrnc loc_81A5 ; Jump if C = 0 incw x ; Increment Word loc_81A5: ; Rotate left through accumulator rlwa x, a pushw x ; Push word onto the Stack ldw x, (5,sp) ; Load word ldw y, #$A ; Load word divw x, y ; Division Word exgw x, y ; Data word exchange ld a, ($8080,x) ; Load popw x ; Pop word from the Stack ld (x), a ; Load ldw x, (3,sp) ; Load word ldw y, #$A ; Load word divw x, y ; Division Word ldw (3,sp), x ; Load word dec (1,sp) ; Decrement dec (2,sp) ; Decrement tnz (2,sp) ; Test for Neg & Zero jrne loc_819B ; Jump if Z = 0 (not equal) addw sp, #4 ; Addition Word ret ; Subroutine Return ; End of function sub_8191 ; =============== S U B R O U T I N E ======================================= sub_81C8: pushw x ; Push word onto the Stack subw sp, #8 ; Subtraction cpw x, ($D,sp) ; Arithmetic Compare Word jrule loc_81D4 ; Jump if (C + Z = 1) subw x, ($D,sp) ; Subtraction word jra loc_81DB ; Jump relative always ; --------------------------------------------------------------------------- loc_81D4: ; Load word ldw x, (9,sp) cpw x, ($D,sp) ; Arithmetic Compare Word jrne loc_81DE ; Jump if Z = 0 (not equal) clrw x ; Clear destination index register loc_81DB: ; Addition Word addw sp, #$A ret ; Subroutine Return ; --------------------------------------------------------------------------- loc_81DE: ; Load word ldw x, (9,sp) call sub_9FEC ; Call subroutine ldw x, sp ; Load word addw x, #5 ; Addition Word call ramB8_BB_to_x_ptr ; Call subroutine ldw x, ($D,sp) ; Load word call sub_9FEC ; Call subroutine ldw x, sp ; Load word addw x, #1 ; Addition Word call ramB8_BB_to_x_ptr ; Call subroutine ldw x, #$FFFF ; Load word ldw byte_BA, x ; Load word ldw x, #0 ; Load word ldw byte_B8, x ; Load word ldw x, sp ; Load word addw x, #1 ; Addition Word call ramB8_BB_sub_xptr_dw ; Call subroutine ldw x, sp ; Load word addw x, #5 ; Addition Word call ramB8_BB_add_xptr_dw ; Call subroutine ldw x, byte_BA ; Load word jra loc_81DB ; Jump relative always ; End of function sub_81C8 ; =============== S U B R O U T I N E ======================================= display_7seg4x_driver: pushw x ; Push word onto the Stack subw sp, #3 ; Subtraction ldw x, byte_4B ; Load word pushw x ; Push word onto the Stack ldw x, byte_A ; Load word callr sub_81C8 ; Call subroutine relative addw sp, #2 ; Addition Word cpw x, #$14 ; Arithmetic Compare Word jrnc loc_8226 ; Jump if C = 0 jp loc_8390 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8226: ; Load word ldw x, byte_A ldw byte_4B, x ; Load word ld a, active_digit_btn ; Load cp a, #5 ; Arithmetic Compare jrc loc_8232 ; Jump if C = 1 clr active_digit_btn ; Clear loc_8232: ; Port D data output latch register bset PD_ODR, #2 bset PD_ODR, #4 ; Port D data output latch register bset PA_ODR, #3 ; Port A data output latch register bset PF_ODR, #4 ; Port F data output latch register clr (3,sp) ; Clear loc_8244: ; Load ld a, (4,sp) ld xl, a ; Load ld a, (5,sp) ; Load add a, active_digit_btn ; Addition jrnc loc_824E ; Jump if C = 0 incw x ; Increment Word loc_824E: ; Rotate left through accumulator rlwa x, a ld a, (1,x) ; Load clrw x ; Clear destination index register ld xl, a ; Load ldw (1,sp), x ; Load word ldw x, #1 ; Load word ld a, (3,sp) ; Load tnz a ; Test for Neg & Zero jreq loc_8261 ; Jump if Z = 1 (equal) loc_825D: ; Shift left Logic word sllw x dec a ; Decrement jrne loc_825D ; Jump if Z = 0 (not equal) loc_8261: ; Rotate right through accumulator rrwa x, a and a, (2,sp) ; Logical And rrwa x, a ; Rotate right through accumulator and a, (1,sp) ; Logical And rrwa x, a ; Rotate right through accumulator cpw x, #0 ; Arithmetic Compare Word jreq loc_82BB ; Jump if Z = 1 (equal) ld a, (3,sp) ; Load tnz a ; Test for Neg & Zero jreq loc_8289 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_828F ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_8295 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_829B ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_82A1 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_82A7 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_82AD ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_82B3 ; Jump if Z = 1 (equal) jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_8289: ; Port B data output latch register bres PB_ODR, #7 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_828F: ; Port B data output latch register bres PB_ODR, #3 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_8295: ; Port D data output latch register bres PD_ODR, #3 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_829B: ; Port B data output latch register bres PB_ODR, #1 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_82A1: ; Port B data output latch register bres PB_ODR, #2 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_82A7: ; Port B data output latch register bres PB_ODR, #6 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_82AD: ; Port D data output latch register bres PD_ODR, #1 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_82B3: ; Port B data output latch register bres PB_ODR, #0 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- dc.b $20 dc.b $20 ; --------------------------------------------------------------------------- loc_82BB: ; Load ld a, (3,sp) tnz a ; Test for Neg & Zero jreq loc_82D7 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_8309 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_830F ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_8315 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_831B ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_8321 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_8327 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_832D ; Jump if Z = 1 (equal) jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_82D7: ; Port B data output latch register bset PB_ODR, #7 loc_82DB: ; Increment inc (3,sp) ld a, (3,sp) ; Load cp a, #8 ; Arithmetic Compare jrnc loc_82E6 ; Jump if C = 0 jp loc_8244 ; Absolute Jump ; --------------------------------------------------------------------------- loc_82E6: ; Load word ldw x, byte_8 pushw x ; Push word onto the Stack ldw x, byte_A ; Load word call sub_81C8 ; Call subroutine addw sp, #2 ; Addition Word cpw x, #$2710 ; Arithmetic Compare Word jrc loc_8339 ; Jump if C = 1 ldw x, byte_A ; Load word ldw byte_8, x ; Load word tnz byte_5B ; Test for Neg & Zero jreq loc_8339 ; Jump if Z = 1 (equal) ld a, byte_5B ; Load cp a, byte_1 ; Arithmetic Compare jrule loc_8335 ; Jump if (C + Z = 1) inc byte_1 ; Increment clr byte_2 ; Clear jra loc_8339 ; Jump relative always ; --------------------------------------------------------------------------- loc_8309: ; Port B data output latch register bset PB_ODR, #3 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_830F: ; Port D data output latch register bset PD_ODR, #3 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_8315: ; Port B data output latch register bset PB_ODR, #1 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_831B: ; Port B data output latch register bset PB_ODR, #2 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_8321: ; Port B data output latch register bset PB_ODR, #6 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_8327: ; Port D data output latch register bset PD_ODR, #1 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- loc_832D: ; Port B data output latch register bset PB_ODR, #0 jra loc_82DB ; Jump relative always ; --------------------------------------------------------------------------- dc.b $20 dc.b $A6 ; ; --------------------------------------------------------------------------- loc_8335: ; Move mov byte_2, #1 loc_8339: ; Test for Neg & Zero tnz byte_2 jreq loc_835D ; Jump if Z = 1 (equal) bres PB_ODR, #7 ; Port B data output latch register bres PB_ODR, #3 ; Port B data output latch register bres PD_ODR, #3 ; Port D data output latch register bres PB_ODR, #1 ; Port B data output latch register bres PB_ODR, #2 ; Port B data output latch register bres PB_ODR, #6 ; Port B data output latch register bres PD_ODR, #1 ; Port D data output latch register bres PB_ODR, #0 ; Port B data output latch register loc_835D: ; Test for Neg & Zero tnz active_digit_btn jrne loc_8367 ; Jump if Z = 0 (not equal) bres PD_ODR, #2 ; Port D data output latch register jra loc_8389 ; Jump relative always ; --------------------------------------------------------------------------- loc_8367: ; Load ld a, active_digit_btn cp a, #1 ; Arithmetic Compare jrne loc_8373 ; Jump if Z = 0 (not equal) bres PD_ODR, #4 ; Port D data output latch register jra loc_8389 ; Jump relative always ; --------------------------------------------------------------------------- loc_8373: ; Load ld a, active_digit_btn cp a, #2 ; Arithmetic Compare jrne loc_837F ; Jump if Z = 0 (not equal) bres PA_ODR, #3 ; Port A data output latch register jra loc_8389 ; Jump relative always ; --------------------------------------------------------------------------- loc_837F: ; Load ld a, active_digit_btn cp a, #3 ; Arithmetic Compare jrne loc_8389 ; Jump if Z = 0 (not equal) bres PF_ODR, #4 ; Port F data output latch register loc_8389: ; Load ld a, active_digit_btn call button_read_to_ram ; Call subroutine inc active_digit_btn ; Increment loc_8390: ; Addition Word addw sp, #5 ret ; Subroutine Return ; End of function display_7seg4x_driver ; =============== S U B R O U T I N E ======================================= sub_8393: push a ; Push onto the Stack subw sp, #3 ; Subtraction clrw x ; Clear destination index register ld xl, a ; Load cpw x, byte_E ; Arithmetic Compare Word jrne loc_83A0 ; Jump if Z = 0 (not equal) tnz byte_2 ; Test for Neg & Zero jreq loc_83C9 ; Jump if Z = 1 (equal) loc_83A0: ; Test for Neg & Zero tnz (4,sp) jreq loc_83A8 ; Jump if Z = 1 (equal) tnz byte_2 ; Test for Neg & Zero jreq loc_83C3 ; Jump if Z = 1 (equal) loc_83A8: ; Clear destination index register clrw x clr a ; Clear ld xh, a ; Load call x_to_ram_A2A1 ; Call subroutine clr (1,sp) ; Clear loc_83B0: ; Push onto the Stack push #0 push #0 ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack inc (1,sp) ; Increment ld a, (1,sp) ; Load cp a, #$32 ; '2' ; Arithmetic Compare jrc loc_83B0 ; Jump if C = 1 loc_83C3: ; Load ld a, (4,sp) clrw x ; Clear destination index register ld xl, a ; Load ldw byte_E, x ; Load word loc_83C9: ; Test for Neg & Zero tnz (4,sp) jreq loc_83D3 ; Jump if Z = 1 (equal) bset PA_ODR, #2 ; Port A data output latch register jra loc_83D7 ; Jump relative always ; --------------------------------------------------------------------------- loc_83D3: ; Port A data output latch register bres PA_ODR, #2 loc_83D7: ; Test for Neg & Zero tnz byte_2 jreq loc_83DE ; Jump if Z = 1 (equal) jp loc_8825 ; Absolute Jump ; --------------------------------------------------------------------------- loc_83DE: ; Load ld a, (4,sp) tnz a ; Test for Neg & Zero jreq loc_841D ; Jump if Z = 1 (equal) dec a ; Decrement jrne loc_83E9 ; Jump if Z = 0 (not equal) jp loc_8498 ; Absolute Jump ; --------------------------------------------------------------------------- loc_83E9: ; Decrement dec a jrne loc_83EF ; Jump if Z = 0 (not equal) jp loc_8510 ; Absolute Jump ; --------------------------------------------------------------------------- loc_83EF: ; Decrement dec a jrne loc_83F5 ; Jump if Z = 0 (not equal) jp loc_8589 ; Absolute Jump ; --------------------------------------------------------------------------- loc_83F5: ; Decrement dec a jrne loc_83FB ; Jump if Z = 0 (not equal) jp loc_8602 ; Absolute Jump ; --------------------------------------------------------------------------- loc_83FB: ; Decrement dec a jrne loc_8401 ; Jump if Z = 0 (not equal) jp loc_8679 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8401: ; Decrement dec a jrne loc_8407 ; Jump if Z = 0 (not equal) jp loc_86F0 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8407: ; Decrement dec a jrne loc_840D ; Jump if Z = 0 (not equal) jp loc_8767 ; Absolute Jump ; --------------------------------------------------------------------------- loc_840D: ; Decrement dec a jrne loc_8413 ; Jump if Z = 0 (not equal) jp loc_87DC ; Absolute Jump ; --------------------------------------------------------------------------- loc_8413: ; Decrement dec a jrne loc_8419 ; Jump if Z = 0 (not equal) jp loc_8801 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8419: ; Absolute Jump far jpf loc_8825 ; --------------------------------------------------------------------------- loc_841D: ; Load word ldw x, sp addw x, #1 ; Addition Word ldw word_62, x ; Load word ldw x, #$4F ; 'O' ; Load word ldw word_60, x ; Load word ldw x, DMX_addrw_bH ; Load word cpw x, #$201 ; Arithmetic Compare Word jrc loc_8434 ; Jump if C = 1 ldw x, #1 ; Load word ldw DMX_addrw_bH, x ; Load word loc_8434: ; Load word ldw x, DMX_addrw_bH jrne loc_843D ; Jump if Z = 0 (not equal) ldw x, #$200 ; Load word ldw DMX_addrw_bH, x ; Load word loc_843D: ; Call subroutine call DMX_to_ch_address bres PA_ODR, #2 ; Port A data output latch register ldw x, #3 ; Load word pushw x ; Push word onto the Stack ldw x, DMX_addrw_bH ; Load word call sub_8191 ; Call subroutine popw x ; Pop word from the Stack mov byte_4, #$88 ; '' ; Move call sub_90B4 ; Call subroutine ldw x, byte_40 ; Load word cpw x, #$1770 ; Arithmetic Compare Word jrc loc_845F ; Jump if C = 1 jp loc_8825 ; Absolute Jump ; --------------------------------------------------------------------------- loc_845F: ; Load word ldw x, byte_C pushw x ; Push word onto the Stack ldw x, byte_A ; Load word call sub_81C8 ; Call subroutine addw sp, #2 ; Addition Word cpw x, #$259 ; Arithmetic Compare Word jrnc loc_8474 ; Jump if C = 0 bres byte_7, #7 ; Bit Reset jra loc_848D ; Jump relative always ; --------------------------------------------------------------------------- loc_8474: ; Load word ldw x, byte_C pushw x ; Push word onto the Stack ldw x, byte_A ; Load word call sub_81C8 ; Call subroutine addw sp, #2 ; Addition Word cpw x, #$FA1 ; Arithmetic Compare Word jrnc loc_8489 ; Jump if C = 0 bset byte_7, #7 ; Bit Set jra loc_848D ; Jump relative always ; --------------------------------------------------------------------------- loc_8489: ; Load word ldw x, byte_A ldw byte_C, x ; Load word loc_848D: ; Load word ldw x, byte_40 addw x, #1 ; Addition Word ldw byte_40, x ; Load word jpf loc_8825 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_8498: ; Load word ldw x, #$51 ; 'Q' ldw word_62, x ; Load word ldw x, sp ; Load word addw x, #2 ; Addition Word ldw word_60, x ; Load word ld a, byte_51 ; Load cp a, #$A ; Arithmetic Compare jrc loc_84AD ; Jump if C = 1 mov byte_51, #1 ; Move loc_84AD: ; Test for Neg & Zero tnz byte_51 jrne loc_84B5 ; Jump if Z = 0 (not equal) mov byte_51, #9 ; Move loc_84B5: ; Load word ldw x, #3 pushw x ; Push word onto the Stack ld a, byte_51 ; Load clrw x ; Clear destination index register ld xl, a ; Load call sub_8191 ; Call subroutine popw x ; Pop word from the Stack mov byte_4, #$88 ; '' ; Move mov byte_5, #$F9 ; '' ; Move mov byte_6, #$FF ; Move clr a ; Clear call sub_9441 ; Call subroutine ldw x, #1 ; Load word ld a, byte_51 ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine ld a, byte_51 ; Load clrw x ; Clear destination index register ld xl, a ; Load decw x ; Decrement Word call sub_9F2D ; Call subroutine ldw x, #$808E ; Load word call sub_9DF6 ; Call subroutine ldw x, #$808A ; Load word call sub_9C73 ; Call subroutine call sub_9ECB ; Call subroutine ldw (2,sp), x ; Load word ldw x, (2,sp) ; Load word cpw x, #$100 ; Arithmetic Compare Word jrc loc_84FF ; Jump if C = 1 ldw x, #$FF ; Load word ldw (2,sp), x ; Load word loc_84FF: ; Load ld a, (3,sp) ld xl, a ; Load ld a, #5 ; Load ld xh, a ; Load call x_to_ram_A2A1 ; Call subroutine mov byte_A6, #5 ; Move jpf loc_8825 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_8510: ; Load word ldw x, #$52 ; 'R' ldw word_62, x ; Load word ldw x, sp ; Load word addw x, #2 ; Addition Word ldw word_60, x ; Load word ld a, byte_52 ; Load cp a, #$A ; Arithmetic Compare jrc loc_8525 ; Jump if C = 1 mov byte_52, #1 ; Move loc_8525: ; Test for Neg & Zero tnz byte_52 jrne loc_852D ; Jump if Z = 0 (not equal) mov byte_52, #9 ; Move loc_852D: ; Load word ldw x, #3 pushw x ; Push word onto the Stack ld a, byte_52 ; Load clrw x ; Clear destination index register ld xl, a ; Load call sub_8191 ; Call subroutine popw x ; Pop word from the Stack mov byte_4, #$88 ; '' ; Move mov byte_5, #$A4 ; '' ; Move mov byte_6, #$FF ; Move ld a, #1 ; Load call sub_9441 ; Call subroutine ldw x, #1 ; Load word ld a, byte_52 ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine ld a, byte_52 ; Load clrw x ; Clear destination index register ld xl, a ; Load decw x ; Decrement Word call sub_9F2D ; Call subroutine ldw x, #$808E ; Load word call sub_9DF6 ; Call subroutine ldw x, #$808A ; Load word call sub_9C73 ; Call subroutine call sub_9ECB ; Call subroutine ldw (2,sp), x ; Load word ldw x, (2,sp) ; Load word cpw x, #$100 ; Arithmetic Compare Word jrc loc_8578 ; Jump if C = 1 ldw x, #$FF ; Load word ldw (2,sp), x ; Load word loc_8578: ; Move mov byte_A6, #5 ld a, (3,sp) ; Load ld xl, a ; Load ld a, #5 ; Load ld xh, a ; Load call x_to_ram_A2A1 ; Call subroutine jpf loc_8825 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_8589: ; Load word ldw x, #$53 ; 'S' ldw word_62, x ; Load word ldw x, sp ; Load word addw x, #2 ; Addition Word ldw word_60, x ; Load word ld a, byte_53 ; Load cp a, #$A ; Arithmetic Compare jrc loc_859E ; Jump if C = 1 mov byte_53, #1 ; Move loc_859E: ; Test for Neg & Zero tnz byte_53 jrne loc_85A6 ; Jump if Z = 0 (not equal) mov byte_53, #9 ; Move loc_85A6: ; Load word ldw x, #3 pushw x ; Push word onto the Stack ld a, byte_53 ; Load clrw x ; Clear destination index register ld xl, a ; Load call sub_8191 ; Call subroutine popw x ; Pop word from the Stack mov byte_4, #$88 ; '' ; Move mov byte_5, #$B0 ; '' ; Move mov byte_6, #$FF ; Move ld a, #2 ; Load call sub_9441 ; Call subroutine ldw x, #1 ; Load word ld a, byte_53 ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine ld a, byte_53 ; Load clrw x ; Clear destination index register ld xl, a ; Load decw x ; Decrement Word call sub_9F2D ; Call subroutine ldw x, #$808E ; Load word call sub_9DF6 ; Call subroutine ldw x, #$808A ; Load word call sub_9C73 ; Call subroutine call sub_9ECB ; Call subroutine ldw (2,sp), x ; Load word ldw x, (2,sp) ; Load word cpw x, #$100 ; Arithmetic Compare Word jrc loc_85F1 ; Jump if C = 1 ldw x, #$FF ; Load word ldw (2,sp), x ; Load word loc_85F1: ; Move mov byte_A6, #5 ld a, (3,sp) ; Load ld xl, a ; Load ld a, #5 ; Load ld xh, a ; Load call x_to_ram_A2A1 ; Call subroutine jpf loc_8825 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_8602: ; Load word ldw x, #$54 ; 'T' ldw word_62, x ; Load word ldw x, sp ; Load word addw x, #2 ; Addition Word ldw word_60, x ; Load word ld a, byte_54 ; Load cp a, #$A ; Arithmetic Compare jrc loc_8617 ; Jump if C = 1 mov byte_54, #1 ; Move loc_8617: ; Test for Neg & Zero tnz byte_54 jrne loc_861F ; Jump if Z = 0 (not equal) mov byte_54, #9 ; Move loc_861F: ; Load word ldw x, #3 pushw x ; Push word onto the Stack ld a, byte_54 ; Load clrw x ; Clear destination index register ld xl, a ; Load call sub_8191 ; Call subroutine popw x ; Pop word from the Stack mov byte_4, #$88 ; '' ; Move mov byte_5, #$99 ; '' ; Move mov byte_6, #$FF ; Move call sub_9604 ; Call subroutine ldw x, #1 ; Load word ld a, byte_54 ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine ld a, byte_54 ; Load clrw x ; Clear destination index register ld xl, a ; Load decw x ; Decrement Word call sub_9F2D ; Call subroutine ldw x, #$808E ; Load word call sub_9DF6 ; Call subroutine ldw x, #$808A ; Load word call sub_9C73 ; Call subroutine call sub_9ECB ; Call subroutine ldw (2,sp), x ; Load word ldw x, (2,sp) ; Load word cpw x, #$100 ; Arithmetic Compare Word jrc loc_8668 ; Jump if C = 1 ldw x, #$FF ; Load word ldw (2,sp), x ; Load word loc_8668: ; Move mov byte_A6, #5 ld a, (3,sp) ; Load ld xl, a ; Load ld a, #5 ; Load ld xh, a ; Load call x_to_ram_A2A1 ; Call subroutine jpf loc_8825 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_8679: ; Load word ldw x, #$55 ; 'U' ldw word_62, x ; Load word ldw x, sp ; Load word addw x, #2 ; Addition Word ldw word_60, x ; Load word ld a, byte_55 ; Load cp a, #$A ; Arithmetic Compare jrc loc_868E ; Jump if C = 1 mov byte_55, #1 ; Move loc_868E: ; Test for Neg & Zero tnz byte_55 jrne loc_8696 ; Jump if Z = 0 (not equal) mov byte_55, #9 ; Move loc_8696: ; Load word ldw x, #3 pushw x ; Push word onto the Stack ld a, byte_55 ; Load clrw x ; Clear destination index register ld xl, a ; Load call sub_8191 ; Call subroutine popw x ; Pop word from the Stack mov byte_4, #$88 ; '' ; Move mov byte_5, #$92 ; '' ; Move mov byte_6, #$FF ; Move call sub_961F ; Call subroutine ldw x, #1 ; Load word ld a, byte_55 ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine ld a, byte_55 ; Load clrw x ; Clear destination index register ld xl, a ; Load decw x ; Decrement Word call sub_9F2D ; Call subroutine ldw x, #$808E ; Load word call sub_9DF6 ; Call subroutine ldw x, #$808A ; Load word call sub_9C73 ; Call subroutine call sub_9ECB ; Call subroutine ldw (2,sp), x ; Load word ldw x, (2,sp) ; Load word cpw x, #$100 ; Arithmetic Compare Word jrc loc_86DF ; Jump if C = 1 ldw x, #$FF ; Load word ldw (2,sp), x ; Load word loc_86DF: ; Move mov byte_A6, #5 ld a, (3,sp) ; Load ld xl, a ; Load ld a, #5 ; Load ld xh, a ; Load call x_to_ram_A2A1 ; Call subroutine jpf loc_8825 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_86F0: ; Load word ldw x, #$56 ; 'V' ldw word_62, x ; Load word ldw x, sp ; Load word addw x, #2 ; Addition Word ldw word_60, x ; Load word ld a, byte_56 ; Load cp a, #$A ; Arithmetic Compare jrc loc_8705 ; Jump if C = 1 mov byte_56, #1 ; Move loc_8705: ; Test for Neg & Zero tnz byte_56 jrne loc_870D ; Jump if Z = 0 (not equal) mov byte_56, #9 ; Move loc_870D: ; Load word ldw x, #3 pushw x ; Push word onto the Stack ld a, byte_56 ; Load clrw x ; Clear destination index register ld xl, a ; Load call sub_8191 ; Call subroutine popw x ; Pop word from the Stack mov byte_4, #$88 ; '' ; Move mov byte_5, #$82 ; '' ; Move mov byte_6, #$FF ; Move call sub_97EE ; Call subroutine ldw x, #1 ; Load word ld a, byte_56 ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine ld a, byte_56 ; Load clrw x ; Clear destination index register ld xl, a ; Load decw x ; Decrement Word call sub_9F2D ; Call subroutine ldw x, #$808E ; Load word call sub_9DF6 ; Call subroutine ldw x, #$808A ; Load word call sub_9C73 ; Call subroutine call sub_9ECB ; Call subroutine ldw (2,sp), x ; Load word ldw x, (2,sp) ; Load word cpw x, #$100 ; Arithmetic Compare Word jrc loc_8756 ; Jump if C = 1 ldw x, #$FF ; Load word ldw (2,sp), x ; Load word loc_8756: ; Move mov byte_A6, #5 ld a, (3,sp) ; Load ld xl, a ; Load ld a, #5 ; Load ld xh, a ; Load call x_to_ram_A2A1 ; Call subroutine jpf loc_8825 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_8767: ; Load word ldw x, #$57 ; 'W' ldw word_62, x ; Load word ldw x, sp ; Load word addw x, #2 ; Addition Word ldw word_60, x ; Load word ld a, byte_57 ; Load cp a, #$A ; Arithmetic Compare jrc loc_877C ; Jump if C = 1 mov byte_57, #1 ; Move loc_877C: ; Test for Neg & Zero tnz byte_57 jrne loc_8784 ; Jump if Z = 0 (not equal) mov byte_57, #9 ; Move loc_8784: ; Load word ldw x, #3 pushw x ; Push word onto the Stack ld a, byte_57 ; Load clrw x ; Clear destination index register ld xl, a ; Load call sub_8191 ; Call subroutine popw x ; Pop word from the Stack mov byte_4, #$88 ; '' ; Move mov byte_5, #$F8 ; '' ; Move mov byte_6, #$FF ; Move call sub_9815 ; Call subroutine ldw x, #1 ; Load word ld a, byte_57 ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine ld a, byte_57 ; Load clrw x ; Clear destination index register ld xl, a ; Load decw x ; Decrement Word call sub_9F2D ; Call subroutine ldw x, #$808E ; Load word call sub_9DF6 ; Call subroutine ldw x, #$808A ; Load word call sub_9C73 ; Call subroutine call sub_9ECB ; Call subroutine ldw (2,sp), x ; Load word ldw x, (2,sp) ; Load word cpw x, #$100 ; Arithmetic Compare Word jrc loc_87CD ; Jump if C = 1 ldw x, #$FF ; Load word ldw (2,sp), x ; Load word loc_87CD: ; Move mov byte_A6, #$FA ; '' ld a, (3,sp) ; Load ld xl, a ; Load ld a, #5 ; Load ld xh, a ; Load call x_to_ram_A2A1 ; Call subroutine jra loc_8825 ; Jump relative always ; --------------------------------------------------------------------------- loc_87DC: ; Load word ldw x, #3 pushw x ; Push word onto the Stack ld a, byte_58 ; Load clrw x ; Clear destination index register ld xl, a ; Load incw x ; Increment Word call sub_8191 ; Call subroutine popw x ; Pop word from the Stack mov byte_4, #$92 ; '' ; Move mov byte_5, #$F9 ; '' ; Move ld a, byte_58 ; Load cp a, #9 ; Arithmetic Compare jrnc loc_87FB ; Jump if C = 0 mov byte_6, #$FF ; Move loc_87FB: ; Clear clr a call sub_9859 ; Call subroutine jra loc_8825 ; Jump relative always ; --------------------------------------------------------------------------- loc_8801: ; Load word ldw x, #3 pushw x ; Push word onto the Stack ld a, byte_59 ; Load clrw x ; Clear destination index register ld xl, a ; Load incw x ; Increment Word call sub_8191 ; Call subroutine popw x ; Pop word from the Stack mov byte_4, #$92 ; '' ; Move mov byte_5, #$A4 ; '' ; Move ld a, byte_59 ; Load cp a, #9 ; Arithmetic Compare jrnc loc_8820 ; Jump if C = 0 mov byte_6, #$FF ; Move loc_8820: ; Load ld a, #1 call sub_9859 ; Call subroutine loc_8825: ; Load word ldw x, #3 call display_7seg4x_driver ; Call subroutine addw sp, #4 ; Addition Word ret ; Subroutine Return ; End of function sub_8393 ; =============== S U B R O U T I N E ======================================= ; save the last push-ed byte to address (X) ; preferably to EEPROM ($4000 - $407f) Sav_sp_to_x_ptr: pushw x ; Push word onto the Stack pushw x ; Push word onto the Stack ldw (1,sp), x ; Load word loc_8832: ; Data EEPROM unprotection register mov FLASH_DUKR, #$AE ; '' mov FLASH_DUKR, #$56 ; 'V' ; Data EEPROM unprotection register ld a, FLASH_IAPSR ; Flash in-application programming status register bcp a, #8 ; Bit compare jreq loc_8832 ; Jump if Z = 1 (equal) ld a, (7,sp) ; Load ldw x, (1,sp) ; Load word ld (x), a ; Load loc_8846: ; Flash in-application programming status register ld a, FLASH_IAPSR bcp a, #4 ; Bit compare jreq loc_8846 ; Jump if Z = 1 (equal) addw sp, #4 ; Addition Word ret ; Subroutine Return ; End of function Sav_sp_to_x_ptr ; =============== S U B R O U T I N E ======================================= read_x_ptr_to_a: subw sp, #3 ; Subtraction ldw (2,sp), x ; Load word ldw x, (2,sp) ; Load word ld a, (x) ; Load ld (1,sp), a ; Load ld a, (1,sp) ; Load addw sp, #3 ; Addition Word ret ; Subroutine Return ; End of function read_x_ptr_to_a ; =============== S U B R O U T I N E ======================================= save_conf_eprom: push device_mode ; Push onto the Stack ldw x, #$4000 ; Load word callr Sav_sp_to_x_ptr ; Call subroutine relative pop a ; Pop from the Stack push dev_operation_mode ; Push onto the Stack ldw x, #$4001 ; Load word callr Sav_sp_to_x_ptr ; Call subroutine relative pop a ; Pop from the Stack ldw x, DMX_addrw_bH ; Load word clr a ; Clear rrwa x, a ; Rotate right through accumulator ld a, xl ; Load push a ; Push onto the Stack ldw x, #$4002 ; Load word callr Sav_sp_to_x_ptr ; Call subroutine relative pop a ; Pop from the Stack ld a, DMX_addr_bL ; Load and a, #$FF ; Logical And push a ; Push onto the Stack ldw x, #$4003 ; Load word callr Sav_sp_to_x_ptr ; Call subroutine relative pop a ; Pop from the Stack push byte_51 ; Push onto the Stack ldw x, #$4004 ; Load word callr Sav_sp_to_x_ptr ; Call subroutine relative pop a ; Pop from the Stack push byte_52 ; Push onto the Stack ldw x, #$4005 ; Load word callr Sav_sp_to_x_ptr ; Call subroutine relative pop a ; Pop from the Stack push byte_53 ; Push onto the Stack ldw x, #$4006 ; Load word callr Sav_sp_to_x_ptr ; Call subroutine relative pop a ; Pop from the Stack push byte_54 ; Push onto the Stack ldw x, #$4007 ; Load word callr Sav_sp_to_x_ptr ; Call subroutine relative pop a ; Pop from the Stack push byte_55 ; Push onto the Stack ldw x, #$4008 ; Load word call Sav_sp_to_x_ptr ; Call subroutine pop a ; Pop from the Stack push byte_56 ; Push onto the Stack ldw x, #$4009 ; Load word call Sav_sp_to_x_ptr ; Call subroutine pop a ; Pop from the Stack push byte_57 ; Push onto the Stack ldw x, #$400A ; Load word call Sav_sp_to_x_ptr ; Call subroutine pop a ; Pop from the Stack push byte_5A ; Push onto the Stack ldw x, #$4010 ; Load word call Sav_sp_to_x_ptr ; Call subroutine pop a ; Pop from the Stack ret ; Subroutine Return ; End of function save_conf_eprom ; =============== S U B R O U T I N E ======================================= read_conf_eprom: push a ; Push onto the Stack ldw x, #$4000 ; Load word call read_x_ptr_to_a ; Call subroutine cp a, #$55 ; 'U' ; Arithmetic Compare jrne reset_conf ; Jump if Z = 0 (not equal) ldw x, #$4000 ; Load word call read_x_ptr_to_a ; Call subroutine ld device_mode, a ; Load ldw x, #$4001 ; Load word call read_x_ptr_to_a ; Call subroutine ld dev_operation_mode, a ; Load ldw x, #$4003 ; Load word call read_x_ptr_to_a ; Call subroutine ld (1,sp), a ; Load ldw x, #$4002 ; Load word call read_x_ptr_to_a ; Call subroutine clrw x ; Clear destination index register ld xl, a ; Load clr a ; Clear rlwa x, a ; Rotate left through accumulator rrwa x, a ; Rotate right through accumulator add a, (1,sp) ; Addition jrnc loc_8907 ; Jump if C = 0 incw x ; Increment Word loc_8907: ; Load ld DMX_addr_bL, a ld a, xl ; Load ld DMX_addrw_bH, a ; Load ldw x, #$4004 ; Load word call read_x_ptr_to_a ; Call subroutine ld byte_51, a ; Load ldw x, #$4005 ; Load word call read_x_ptr_to_a ; Call subroutine ld byte_52, a ; Load ldw x, #$4006 ; Load word call read_x_ptr_to_a ; Call subroutine ld byte_53, a ; Load ldw x, #$4007 ; Load word call read_x_ptr_to_a ; Call subroutine ld byte_54, a ; Load ldw x, #$4008 ; Load word call read_x_ptr_to_a ; Call subroutine ld byte_55, a ; Load ldw x, #$4009 ; Load word call read_x_ptr_to_a ; Call subroutine ld byte_56, a ; Load ldw x, #$400A ; Load word call read_x_ptr_to_a ; Call subroutine ld byte_57, a ; Load ldw x, #$4010 ; Load word call read_x_ptr_to_a ; Call subroutine ld byte_5A, a ; Load jra loc_897A ; Jump relative always ; --------------------------------------------------------------------------- reset_conf: ; Move mov device_mode, #$55 ; 'U' clr dev_operation_mode ; Clear ldw x, #1 ; Load word ldw DMX_addrw_bH, x ; Load word mov byte_51, #1 ; Move mov byte_52, #1 ; Move mov byte_53, #1 ; Move mov byte_54, #1 ; Move mov byte_55, #1 ; Move mov byte_56, #1 ; Move mov byte_57, #1 ; Move clr byte_5A ; Clear call save_conf_eprom ; Call subroutine loc_897A: ; Pop from the Stack pop a ret ; Subroutine Return ; End of function read_conf_eprom ; =============== S U B R O U T I N E ======================================= ; update channel addresses at RAM $30 to $3A ; from RAM $F4 DMX_to_ch_address: subw sp, #3 ; Subtraction clr (3,sp) ; Clear loc_8980: ; Load word ldw x, DMX_addrw_bH decw x ; Decrement Word rrwa x, a ; Rotate right through accumulator add a, (3,sp) ; Addition jrnc loc_8989 ; Jump if C = 0 incw x ; Increment Word loc_8989: ; Rotate left through accumulator rlwa x, a ldw (1,sp), x ; Load word rrwa x, a ; Rotate right through accumulator ld a, (3,sp) ; Load clrw x ; Clear destination index register ld xl, a ; Load sllw x ; Shift left Logic word ldw y, (1,sp) ; Load word ldw ($30,x), y ; Load word ld a, (3,sp) ; Load clrw x ; Clear destination index register ld xl, a ; Load sllw x ; Shift left Logic word ldw y, x ; Load word ldw y, ($30,y) ; Load word cpw y, #$200 ; Arithmetic Compare Word jrc loc_89B5 ; Jump if C = 1 ld a, (3,sp) ; Load clrw x ; Clear destination index register ld xl, a ; Load sllw x ; Shift left Logic word ldw y, x ; Load word ldw x, ($30,x) ; Load word subw x, #$200 ; Subtraction word ldw ($30,y), x ; Load word loc_89B5: ; Increment inc (3,sp) ld a, (3,sp) ; Load cp a, #6 ; Arithmetic Compare jrc loc_8980 ; Jump if C = 1 addw sp, #3 ; Addition Word ret ; Subroutine Return ; End of function DMX_to_ch_address ; =============== S U B R O U T I N E ======================================= ; read A #bit button ; set corresponding bits in RAM_66 (debounced) ; set extended buttons (dmx/io stae as bit4) to RAM_65 button_read_to_ram: push a ; Push onto the Stack tnz a ; Test for Neg & Zero jrne loc_89D5 ; Jump if Z = 0 (not equal) ld a, PD_IDR ; Port D input pin value register bcp a, #$80 ; '' ; Bit compare jreq loc_89D1 ; Jump if Z = 1 (equal) bset btn_new_tmp, #0 ; Bit Set jra loc_89D5 ; Jump relative always ; --------------------------------------------------------------------------- loc_89D1: ; Bit Reset bres btn_new_tmp, #0 loc_89D5: ; Load ld a, (1,sp) cp a, #1 ; Arithmetic Compare jrne loc_89EC ; Jump if Z = 0 (not equal) ld a, PD_IDR ; Port D input pin value register bcp a, #$80 ; '' ; Bit compare jreq loc_89E8 ; Jump if Z = 1 (equal) bset btn_new_tmp, #1 ; Bit Set jra loc_89EC ; Jump relative always ; --------------------------------------------------------------------------- loc_89E8: ; Bit Reset bres btn_new_tmp, #1 loc_89EC: ; Load ld a, (1,sp) cp a, #2 ; Arithmetic Compare jrne loc_8A03 ; Jump if Z = 0 (not equal) ld a, PD_IDR ; Port D input pin value register bcp a, #$80 ; '' ; Bit compare jreq loc_89FF ; Jump if Z = 1 (equal) bset btn_new_tmp, #2 ; Bit Set jra loc_8A03 ; Jump relative always ; --------------------------------------------------------------------------- loc_89FF: ; Bit Reset bres btn_new_tmp, #2 loc_8A03: ; Load ld a, (1,sp) cp a, #3 ; Arithmetic Compare jrne loc_8A1A ; Jump if Z = 0 (not equal) ld a, PD_IDR ; Port D input pin value register bcp a, #$80 ; '' ; Bit compare jreq loc_8A16 ; Jump if Z = 1 (equal) bset btn_new_tmp, #3 ; Bit Set jra loc_8A1A ; Jump relative always ; --------------------------------------------------------------------------- loc_8A16: ; Bit Reset bres btn_new_tmp, #3 loc_8A1A: ; Port A input pin value register ld a, PA_IDR bcp a, #2 ; Bit compare jreq loc_8A27 ; Jump if Z = 1 (equal) bset btn_new_tmp, #4 ; Bit Set jra loc_8A2B ; Jump relative always ; --------------------------------------------------------------------------- loc_8A27: ; Bit Reset bres btn_new_tmp, #4 loc_8A2B: ; Load ld a, btn_old_tmp cp a, btn_new_tmp ; Arithmetic Compare jrne loc_8A3B ; Jump if Z = 0 (not equal) ld a, btn_dbc_cnt ; Load cp a, #$5F ; '_' ; Arithmetic Compare jrnc loc_8A40 ; Jump if C = 0 inc btn_dbc_cnt ; Increment jra loc_8A40 ; Jump relative always ; --------------------------------------------------------------------------- loc_8A3B: ; Move mov btn_old_tmp, btn_new_tmp clr btn_dbc_cnt ; Clear loc_8A40: ; Load ld a, btn_dbc_cnt cp a, #$40 ; '@' ; Arithmetic Compare jrne loc_8A54 ; Jump if Z = 0 (not equal) ld a, btn_new_tmp ; Load cpl a ; One Complement and a, #$F ; Logical And ld btns_clean, a ; Load ld a, btn_new_tmp ; Load cpl a ; One Complement and a, #$1F ; Logical And ld btn_and_dmx, a ; Load loc_8A54: ; Pop from the Stack pop a ret ; Subroutine Return ; End of function button_read_to_ram ; =============== S U B R O U T I N E ======================================= button_to_mode_hndlr: ld a, btns_clean ; Load dec a ; Decrement jreq btn_menu_mode ; Jump if Z = 1 (equal) dec a ; Decrement jreq btn_up ; Jump if Z = 1 (equal) sub a, #2 ; Subtraction jreq btn_down ; Jump if Z = 1 (equal) sub a, #4 ; Subtraction jrne loc_8A69 ; Jump if Z = 0 (not equal) jp btn_enter ; Absolute Jump ; --------------------------------------------------------------------------- loc_8A69: ; Absolute Jump far jpf loc_8AF6 ; --------------------------------------------------------------------------- btn_menu_mode: ; Load ld a, btns_old_clean cp a, btns_clean ; Arithmetic Compare jrne loc_8A76 ; Jump if Z = 0 (not equal) jp loc_8AF6 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8A76: ; Increment inc dev_operation_mode ld a, dev_operation_mode ; Load cp a, #$A ; Arithmetic Compare jrc loc_8A80 ; Jump if C = 1 clr dev_operation_mode ; Clear loc_8A80: ; Clear clr byte_12 clr byte_13 ; Clear clrw x ; Clear destination index register ldw byte_B4, x ; Load word clrw x ; Clear destination index register ldw byte_B2, x ; Load word clrw x ; Clear destination index register ldw byte_B0, x ; Load word tnz dev_operation_mode ; Test for Neg & Zero jrne loc_8AF6 ; Jump if Z = 0 (not equal) clr byte_48 ; Clear clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call sub_9BBF ; Call subroutine jra loc_8AF6 ; Jump relative always ; --------------------------------------------------------------------------- btn_up: ; Load ld a, btns_old_clean cp a, btns_clean ; Arithmetic Compare jreq loc_8AF6 ; Jump if Z = 1 (equal) inc [word_62.w] ; Increment ldw x, word_60 ; Load word ldw y, x ; Load word ldw y, (y) ; Load word cpw y, #$208 ; Arithmetic Compare Word jrnc loc_8ABA ; Jump if C = 0 ldw x, word_60 ; Load word ldw y, x ; Load word ldw x, (x) ; Load word addw x, #1 ; Addition Word ldw (y), x ; Load word loc_8ABA: ; Load word ldw x, #$2710 ldw byte_5E, x ; Load word jra loc_8AF6 ; Jump relative always ; --------------------------------------------------------------------------- btn_down: ; Load ld a, btns_old_clean cp a, btns_clean ; Arithmetic Compare jreq loc_8AF6 ; Jump if Z = 1 (equal) tnz [word_62.w] ; Test for Neg & Zero jreq loc_8ACF ; Jump if Z = 1 (equal) dec [word_62.w] ; Decrement loc_8ACF: ; Load word ldw x, word_60 ld a, (1,x) ; Load or a, (x) ; OR Operation jreq loc_8AE0 ; Jump if Z = 1 (equal) ldw x, word_60 ; Load word ldw y, x ; Load word ldw x, (x) ; Load word subw x, #1 ; Subtraction word ldw (y), x ; Load word loc_8AE0: ; Load word ldw x, #$2710 ldw byte_5E, x ; Load word jra loc_8AF6 ; Jump relative always ; --------------------------------------------------------------------------- btn_enter: ; Load ld a, btns_old_clean cp a, btns_clean ; Arithmetic Compare jreq loc_8AF6 ; Jump if Z = 1 (equal) clr byte_1 ; Clear ldw x, byte_A ; Load word ldw byte_8, x ; Load word call save_conf_eprom ; Call subroutine loc_8AF6: ; Load ld a, btns_old_clean cp a, btns_clean ; Arithmetic Compare jreq loc_8AFF ; Jump if Z = 1 (equal) mov btns_old_clean, btns_clean ; Move loc_8AFF: ; Move mov btns_old_clean, btns_clean tnz btns_old_clean ; Test for Neg & Zero jreq locret_8B62 ; Jump if Z = 1 (equal) ldw x, byte_5E ; Load word jreq locret_8B62 ; Jump if Z = 1 (equal) ldw x, byte_5E ; Load word cpw x, #$1F4 ; Arithmetic Compare Word jrnc locret_8B62 ; Jump if C = 0 ld a, btns_clean ; Load cp a, #2 ; Arithmetic Compare jrne loc_8B37 ; Jump if Z = 0 (not equal) ldw x, byte_5E ; Load word cpw x, #$1F4 ; Arithmetic Compare Word jrnc loc_8B37 ; Jump if C = 0 inc [word_62.w] ; Increment ldw x, word_60 ; Load word ldw y, x ; Load word ldw y, (y) ; Load word cpw y, #$209 ; Arithmetic Compare Word jrnc loc_8B37 ; Jump if C = 0 ldw x, word_60 ; Load word ldw y, x ; Load word ldw x, (x) ; Load word addw x, #1 ; Addition Word ldw (y), x ; Load word loc_8B37: ; Load ld a, btns_clean cp a, #4 ; Arithmetic Compare jrne loc_8B5D ; Jump if Z = 0 (not equal) ldw x, byte_5E ; Load word cpw x, #$1F4 ; Arithmetic Compare Word jrnc loc_8B5D ; Jump if C = 0 tnz [word_62.w] ; Test for Neg & Zero jreq loc_8B4C ; Jump if Z = 1 (equal) dec [word_62.w] ; Decrement loc_8B4C: ; Load word ldw x, word_60 ld a, (1,x) ; Load or a, (x) ; OR Operation jreq loc_8B5D ; Jump if Z = 1 (equal) ldw x, word_60 ; Load word ldw y, x ; Load word ldw x, (x) ; Load word subw x, #1 ; Subtraction word ldw (y), x ; Load word loc_8B5D: ; Load word ldw x, #$7D0 ldw byte_5E, x ; Load word locret_8B62: ; Subroutine Return ret ; End of function button_to_mode_hndlr ; =============== S U B R O U T I N E ======================================= sub_8B63: subw sp, #4 ; Subtraction ld a, #1 ; Load ld (2,sp), a ; Load clr (1,sp) ; Clear loc_8B6B: ; Clear clr (3,sp) loc_8B6D: ; Shift right Logic srl (4,sp) ld a, (2,sp) ; Load clrw x ; Clear destination index register ld xl, a ; Load ld a, ($72,x) ; Load cp a, #$10 ; Arithmetic Compare jrc loc_8B7F ; Jump if C = 1 ld a, (4,sp) ; Load or a, #$80 ; '' ; OR Operation ld (4,sp), a ; Load loc_8B7F: ; Increment inc (2,sp) inc (3,sp) ; Increment ld a, (3,sp) ; Load cp a, #8 ; Arithmetic Compare jrc loc_8B6D ; Jump if C = 1 ld a, (1,sp) ; Load clrw x ; Clear destination index register ld xl, a ; Load ld a, (4,sp) ; Load ld ($6E,x), a ; Load inc (1,sp) ; Increment ld a, (1,sp) ; Load cp a, #4 ; Arithmetic Compare jrc loc_8B6B ; Jump if C = 1 tnz byte_6E ; Test for Neg & Zero jrne loc_8BB7 ; Jump if Z = 0 (not equal) ld a, byte_6F ; Load cp a, #$FF ; Arithmetic Compare jrne loc_8BB7 ; Jump if Z = 0 (not equal) ld a, byte_71 ; Load clrw x ; Clear destination index register ld xl, a ; Load cplw x ; One Complement Word ld a, byte_70 ; Load clrw y ; Clear destination index register ld yl, a ; Load ldw byte_BF, y ; Load word cpw x, byte_BF ; Arithmetic Compare Word jrne loc_8BB7 ; Jump if Z = 0 (not equal) ld a, byte_70 ; Load loc_8BB7: ; Addition Word addw sp, #4 ret ; Subroutine Return ; End of function sub_8B63 ; =============== S U B R O U T I N E ======================================= sub_8BBA: pushw x ; Push word onto the Stack tnz byte_6B ; Test for Neg & Zero jrne loc_8BC2 ; Jump if Z = 0 (not equal) jp loc_8D9D ; Absolute Jump ; --------------------------------------------------------------------------- loc_8BC2: ; Call subroutine relative callr sub_8B63 ld byte_16, a ; Load clr byte_6B ; Clear ld a, byte_16 ; Load cp a, byte_17 ; Arithmetic Compare jrne loc_8BD1 ; Jump if Z = 0 (not equal) jp loc_8D9D ; Absolute Jump ; --------------------------------------------------------------------------- loc_8BD1: ; Load ld a, byte_16 sub a, #7 ; Subtraction jrne loc_8BDA ; Jump if Z = 0 (not equal) jp loc_8C97 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8BDA: ; Decrement dec a jrne loc_8BE0 ; Jump if Z = 0 (not equal) jp loc_8D3A ; Absolute Jump ; --------------------------------------------------------------------------- loc_8BE0: ; Decrement dec a jrne loc_8BE6 ; Jump if Z = 0 (not equal) jp loc_8CF1 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8BE6: ; Subtraction sub a, #3 jrne loc_8BED ; Jump if Z = 0 (not equal) jp loc_8D28 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8BED: ; Decrement dec a jrne loc_8BF3 ; Jump if Z = 0 (not equal) jp loc_8D0D ; Absolute Jump ; --------------------------------------------------------------------------- loc_8BF3: ; Subtraction sub a, #8 jrne loc_8BFA ; Jump if Z = 0 (not equal) jp loc_8CD2 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8BFA: ; Decrement dec a jrne loc_8C00 ; Jump if Z = 0 (not equal) jp loc_8D24 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8C00: ; Subtraction sub a, #2 jrne loc_8C07 ; Jump if Z = 0 (not equal) jp loc_8D2E ; Absolute Jump ; --------------------------------------------------------------------------- loc_8C07: ; Decrement dec a jrne loc_8C0D ; Jump if Z = 0 (not equal) jp loc_8CF6 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8C0D: ; Subtraction sub a, #3 jrne loc_8C14 ; Jump if Z = 0 (not equal) jp loc_8D40 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8C14: ; Subtraction sub a, #$24 ; '$' jrne loc_8C1B ; Jump if Z = 0 (not equal) jp loc_8CB4 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8C1B: ; Subtraction sub a, #2 jrne loc_8C22 ; Jump if Z = 0 (not equal) jp loc_8D4C ; Absolute Jump ; --------------------------------------------------------------------------- loc_8C22: ; Decrement dec a jrne loc_8C28 ; Jump if Z = 0 (not equal) jp loc_8CEC ; Absolute Jump ; --------------------------------------------------------------------------- loc_8C28: ; Decrement dec a jreq loc_8C78 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_8C54 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_8C66 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_8C6D ; Jump if Z = 1 (equal) sub a, #3 ; Subtraction jrne loc_8C3B ; Jump if Z = 0 (not equal) jp loc_8D58 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8C3B: ; Subtraction sub a, #8 jrne loc_8C42 ; Jump if Z = 0 (not equal) jp loc_8D52 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8C42: ; Subtraction sub a, #8 jrne loc_8C49 ; Jump if Z = 0 (not equal) jp loc_8D46 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8C49: ; Subtraction sub a, #4 jrne loc_8C50 ; Jump if Z = 0 (not equal) jp loc_8D34 ; Absolute Jump ; --------------------------------------------------------------------------- loc_8C50: ; Absolute Jump far jpf loc_8D5C ; --------------------------------------------------------------------------- loc_8C54: ; Test for Neg & Zero tnz byte_2 jreq loc_8C5E ; Jump if Z = 1 (equal) clr byte_2 ; Clear jpf loc_8D5C ; Absolute Jump far ; --------------------------------------------------------------------------- loc_8C5E: ; Move mov byte_2, #1 jpf loc_8D5C ; Absolute Jump far ; --------------------------------------------------------------------------- loc_8C66: ; Call subroutine call save_conf_eprom jpf loc_8D5C ; Absolute Jump far ; --------------------------------------------------------------------------- loc_8C6D: ; Clear clr dev_operation_mode ldw x, #1 ; Load word ldw DMX_addrw_bH, x ; Load word jpf loc_8D5C ; Absolute Jump far ; --------------------------------------------------------------------------- loc_8C78: ; Load ld a, dev_operation_mode cp a, #8 ; Arithmetic Compare jrc loc_8C84 ; Jump if C = 1 mov dev_operation_mode, #1 ; Move jra loc_8C86 ; Jump relative always ; --------------------------------------------------------------------------- loc_8C84: ; Increment inc dev_operation_mode loc_8C86: ; Load ld a, dev_operation_mode cp a, #8 ; Arithmetic Compare jrnc loc_8C8F ; Jump if C = 0 jp loc_8D5C ; Absolute Jump ; --------------------------------------------------------------------------- loc_8C8F: ; Move mov dev_operation_mode, #1 jpf loc_8D5C ; Absolute Jump far ; --------------------------------------------------------------------------- loc_8C97: ; Load ld a, dev_operation_mode cp a, #8 ; Arithmetic Compare jrc loc_8CA3 ; Jump if C = 1 mov dev_operation_mode, #1 ; Move jra loc_8CA5 ; Jump relative always ; --------------------------------------------------------------------------- loc_8CA3: ; Decrement dec dev_operation_mode loc_8CA5: ; Test for Neg & Zero tnz dev_operation_mode jreq loc_8CAC ; Jump if Z = 1 (equal) jp loc_8D5C ; Absolute Jump ; --------------------------------------------------------------------------- loc_8CAC: ; Move mov dev_operation_mode, #7 jpf loc_8D5C ; Absolute Jump far ; --------------------------------------------------------------------------- loc_8CB4: ; Load ld a, dev_operation_mode cp a, #8 ; Arithmetic Compare jrnc loc_8CC0 ; Jump if C = 0 mov dev_operation_mode, #8 ; Move jra loc_8CC2 ; Jump relative always ; --------------------------------------------------------------------------- loc_8CC0: ; Increment inc dev_operation_mode loc_8CC2: ; Load ld a, dev_operation_mode cp a, #$A ; Arithmetic Compare jrnc loc_8CCB ; Jump if C = 0 jp loc_8D5C ; Absolute Jump ; --------------------------------------------------------------------------- loc_8CCB: ; Move mov dev_operation_mode, #8 jp loc_8D5C ; Absolute Jump ; --------------------------------------------------------------------------- loc_8CD2: ; Load ld a, dev_operation_mode cp a, #8 ; Arithmetic Compare jrnc loc_8CDE ; Jump if C = 0 mov dev_operation_mode, #8 ; Move jra loc_8CE0 ; Jump relative always ; --------------------------------------------------------------------------- loc_8CDE: ; Decrement dec dev_operation_mode loc_8CE0: ; Load ld a, dev_operation_mode cp a, #8 ; Arithmetic Compare jrnc loc_8D5C ; Jump if C = 0 mov dev_operation_mode, #9 ; Move jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8CEC: ; Increment inc [word_62.w] jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8CF1: ; Decrement dec [word_62.w] jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8CF6: ; Load word ldw x, word_60 ldw y, x ; Load word ldw x, (x) ; Load word addw x, #1 ; Addition Word ldw (y), x ; Load word ldw x, #$2710 ; Load word ldw byte_5E, x ; Load word clr dev_operation_mode ; Clear mov byte_6A, #$19 ; Move jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8D0D: ; Load word ldw x, word_60 ldw y, x ; Load word ldw x, (x) ; Load word subw x, #1 ; Subtraction word ldw (y), x ; Load word ldw x, #$2710 ; Load word ldw byte_5E, x ; Load word clr dev_operation_mode ; Clear mov byte_6A, #$D ; Move jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8D24: ; Clear clr byte_18 jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8D28: ; Move mov byte_18, #1 jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8D2E: ; Move mov byte_18, #2 jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8D34: ; Move mov byte_18, #3 jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8D3A: ; Move mov byte_18, #4 jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8D40: ; Move mov byte_18, #5 jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8D46: ; Move mov byte_18, #6 jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8D4C: ; Move mov byte_18, #7 jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8D52: ; Move mov byte_18, #8 jra loc_8D5C ; Jump relative always ; --------------------------------------------------------------------------- loc_8D58: ; Move mov byte_18, #9 loc_8D5C: ; Load ld a, byte_18 cp a, byte_19 ; Arithmetic Compare jreq loc_8D93 ; Jump if Z = 1 (equal) mov byte_1C, byte_1B ; Move mov byte_1B, byte_1A ; Move mov byte_1A, byte_18 ; Move ld a, byte_1A ; Load ld [word_62.w], a ; Load mov byte_18, #$A ; Move mov byte_19, byte_18 ; Move ld a, byte_1B ; Load ld xl, a ; Load ld a, #$A ; Load mul x, a ; Multiply ldw (1,sp), x ; Load word ld a, byte_1C ; Load ld xl, a ; Load ld a, #$64 ; 'd' ; Load mul x, a ; Multiply addw x, (1,sp) ; Addition Word rrwa x, a ; Rotate right through accumulator add a, byte_1A ; Addition jrnc loc_8D8E ; Jump if C = 0 incw x ; Increment Word loc_8D8E: ; Rotate left through accumulator rlwa x, a ldw [word_60.w], x ; Load word rrwa x, a ; Rotate right through accumulator loc_8D93: ; Move mov byte_6A, byte_16 mov byte_16, #$FF ; Move mov byte_17, byte_16 ; Move loc_8D9D: ; Load ld a, byte_6A cp a, #$19 ; Arithmetic Compare jreq loc_8DA9 ; Jump if Z = 1 (equal) ld a, byte_6A ; Load cp a, #$D ; Arithmetic Compare jrne loc_8DE8 ; Jump if Z = 0 (not equal) loc_8DA9: ; Load word ldw x, byte_93 jreq loc_8DE8 ; Jump if Z = 1 (equal) ldw x, byte_5E ; Load word cpw x, #$1F4 ; Arithmetic Compare Word jrnc loc_8DE8 ; Jump if C = 0 clrw x ; Clear destination index register ldw byte_93, x ; Load word ld a, byte_6A ; Load cp a, #$19 ; Arithmetic Compare jrne loc_8DCC ; Jump if Z = 0 (not equal) ldw x, word_60 ; Load word ldw y, x ; Load word ldw x, (x) ; Load word addw x, #1 ; Addition Word ldw (y), x ; Load word ldw x, #$7D0 ; Load word ldw byte_5E, x ; Load word loc_8DCC: ; Load ld a, byte_6A cp a, #$D ; Arithmetic Compare jrne loc_8DE8 ; Jump if Z = 0 (not equal) ldw x, word_60 ; Load word ld a, (1,x) ; Load or a, (x) ; OR Operation jreq loc_8DE3 ; Jump if Z = 1 (equal) ldw x, word_60 ; Load word ldw y, x ; Load word ldw x, (x) ; Load word subw x, #1 ; Subtraction word ldw (y), x ; Load word loc_8DE3: ; Load word ldw x, #$7D0 ldw byte_5E, x ; Load word loc_8DE8: ; Pop word from the Stack popw x ret ; Subroutine Return ; End of function sub_8BBA ; =============== S U B R O U T I N E ======================================= EXTI4_0: tnz byte_6D ; Test for Neg & Zero jreq loc_8E20 ; Jump if Z = 1 (equal) ldw x, byte_97 ; Load word cpw x, #$5B ; '[' ; Arithmetic Compare Word jrc loc_8DFA ; Jump if C = 1 ldw x, #$3E8 ; Load word ldw byte_93, x ; Load word loc_8DFA: ; Load word ldw x, byte_97 cpw x, #$6F ; 'o' ; Arithmetic Compare Word jrc loc_8E03 ; Jump if C = 1 clr byte_6C ; Clear loc_8E03: ; Load ld a, byte_6C clrw x ; Clear destination index register ld xl, a ; Load ld a, byte_98 ; Load ld ($72,x), a ; Load clrw x ; Clear destination index register ldw byte_97, x ; Load word inc byte_6C ; Increment ld a, byte_6C ; Load cp a, #$21 ; '!' ; Arithmetic Compare jrne locret_8E27 ; Jump if Z = 0 (not equal) clr byte_6C ; Clear mov byte_6B, #1 ; Move clr byte_6D ; Clear jra locret_8E27 ; Jump relative always ; --------------------------------------------------------------------------- loc_8E20: ; Move mov byte_6D, #1 clrw x ; Clear destination index register ldw byte_97, x ; Load word locret_8E27: ; Interrupt routine return iret ; End of function EXTI4_0 ; =============== S U B R O U T I N E ======================================= TIM2_0: ldw x, byte_A ; Load word addw x, #1 ; Addition Word ldw byte_A, x ; Load word ldw x, byte_97 ; Load word addw x, #1 ; Addition Word ldw byte_97, x ; Load word ldw x, byte_B4 ; Load word jreq loc_8E41 ; Jump if Z = 1 (equal) ldw x, byte_B4 ; Load word subw x, #1 ; Subtraction word ldw byte_B4, x ; Load word loc_8E41: ; Load word ldw x, byte_B2 jreq loc_8E4C ; Jump if Z = 1 (equal) ldw x, byte_B2 ; Load word subw x, #1 ; Subtraction word ldw byte_B2, x ; Load word loc_8E4C: ; Load word ldw x, byte_B0 jreq loc_8E57 ; Jump if Z = 1 (equal) ldw x, byte_B0 ; Load word subw x, #1 ; Subtraction word ldw byte_B0, x ; Load word loc_8E57: ; Load word ldw x, byte_AE jreq loc_8E62 ; Jump if Z = 1 (equal) ldw x, byte_AE ; Load word subw x, #1 ; Subtraction word ldw byte_AE, x ; Load word loc_8E62: ; Load word ldw x, byte_B6 jreq loc_8E6D ; Jump if Z = 1 (equal) ldw x, byte_B6 ; Load word subw x, #1 ; Subtraction word ldw byte_B6, x ; Load word loc_8E6D: ; Load word ldw x, byte_5E jreq loc_8E78 ; Jump if Z = 1 (equal) ldw x, byte_5E ; Load word subw x, #1 ; Subtraction word ldw byte_5E, x ; Load word loc_8E78: ; TIM2 Status register 1 bres TIM2_SR1, #0 iret ; Interrupt routine return ; End of function TIM2_0 ; =============== S U B R O U T I N E ======================================= Tmer1_setup: bres TIM1_CR1, #0 ; TIM1 Control register 1 clr TIM1_PSCRH ; TIM1 Prescaler Register High mov TIM1_PSCRL, #2 ; TIM1 Prescaler Register Low clr TIM1_ARRH ; TIM1 Auto-Reload Register High mov TIM1_ARRL, #$FF ; TIM1 Auto-Reload Register Low clr TIM1_CCR1H ; TIM1 Capture/Compare Register 1 High mov TIM1_CCR1L, #$7F ; '' ; TIM1 Capture/Compare Register 1 Low mov TIM1_CCMR1, #$60 ; '`' ; TIM1 Capture/Compare mode register 1 bset TIM1_CCER1, #0 ; TIM1 Capture/Compare enable register 1 clr TIM1_CCR2H ; TIM1 Capture/Compare Register 2 High mov TIM1_CCR2L, #$7F ; '' ; TIM1 Capture/Compare Register 2 Low mov TIM1_CCMR2, #$60 ; '`' ; TIM1 Capture/Compare mode register 2 bset TIM1_CCER1, #4 ; TIM1 Capture/Compare enable register 1 clr TIM1_CCR3H ; TIM1 Capture/Compare Register 3 High mov TIM1_CCR3L, #$7F ; '' ; TIM1 Capture/Compare Register 3 Low mov TIM1_CCMR3, #$60 ; '`' ; TIM1 Capture/Compare mode register 3 bset TIM1_CCER2, #0 ; TIM1 Capture/Compare enable register 2 clr TIM1_CCR4H ; TIM1 Capture/Compare Register 4 High mov TIM1_CCR4L, #$7F ; '' ; TIM1 Capture/Compare Register 4 Low mov TIM1_CCMR4, #$60 ; '`' ; TIM1 Capture/Compare mode register 4 bset TIM1_CCER2, #4 ; TIM1 Capture/Compare enable register 2 bset TIM1_CR1, #0 ; TIM1 Control register 1 bset TIM1_BKR, #7 ; TIM1 Break register clr TIM1_CCR1L ; TIM1 Capture/Compare Register 1 Low clr TIM1_CCR2L ; TIM1 Capture/Compare Register 2 Low clr TIM1_CCR3L ; TIM1 Capture/Compare Register 3 Low clr TIM1_CCR4L ; TIM1 Capture/Compare Register 4 Low ret ; Subroutine Return ; End of function Tmer1_setup ; =============== S U B R O U T I N E ======================================= Ext_int_setup: clr EXTI_CR2 ; External interrupt control register 2 bset EXTI_CR2, #1 ; External interrupt control register 2 ret ; Subroutine Return ; End of function Ext_int_setup ; =============== S U B R O U T I N E ======================================= Timer2_setup: mov TIM2_PSCR, #4 ; TIM2 Prescaler register clr TIM2_ARRH ; TIM2 Auto-Reload Register High mov TIM2_ARRL, #$63 ; 'c' ; TIM2 Auto-Reload Register Low ld a, TIM2_CR1 ; TIM2 Control register 1 or a, #$81 ; '' ; OR Operation ld TIM2_CR1, a ; TIM2 Control register 1 mov TIM2_IER, #1 ; TIM2 Interrupt enable register ret ; Subroutine Return ; End of function Timer2_setup ; =============== S U B R O U T I N E ======================================= Ports_clk_setup: mov PA_DDR, #$FC ; '' ; Port A data direction register mov PA_CR1, #$FF ; Port A control register 1 mov PB_DDR, #$CF ; '' ; Port B data direction register mov PB_CR1, #$FF ; Port B control register 1 mov PC_DDR, #$FF ; Port C data direction register mov PC_CR1, #$FF ; Port C control register 1 mov PD_DDR, #$3F ; '?' ; Port D data direction register mov PD_CR1, #$FF ; Port D control register 1 mov PE_DDR, #$5F ; '_' ; Port E data direction register mov PE_CR1, #$DF ; '' ; Port E control register 1 mov PE_CR2, #$20 ; ' ' ; Port E control register 2 mov PF_DDR, #$FF ; Port F data direction register mov PF_CR1, #$FF ; Port F control register 1 mov CLK_SWR, #$E1 ; '' ; System clock switch register clr CLK_CKDIVR ; System clock divider register ret ; Subroutine Return ; End of function Ports_clk_setup ; =============== S U B R O U T I N E ======================================= device_init: callr Ports_clk_setup ; Call subroutine relative call Tmer1_setup ; Call subroutine callr Timer2_setup ; Call subroutine relative callr Ext_int_setup ; Call subroutine relative call read_conf_eprom ; Call subroutine rim ; Enable Interrupts ldw x, #$400 ; Load word ldw byte_AC, x ; Load word ldw x, #$400 ; Load word ldw byte_AA, x ; Load word clr byte_48 ; Clear mov byte_47, #1 ; Move jra loc_8F6F ; Jump relative always ; --------------------------------------------------------------------------- loc_8F68: ; Clear destination index register clrw x ld a, #9 ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine loc_8F6F: ; Load word ldw x, byte_AC jrne loc_8F68 ; Jump if Z = 0 (not equal) ldw x, #$32 ; '2' ; Load word ldw byte_AC, x ; Load word clrw x ; Clear destination index register ldw byte_AA, x ; Load word clrw x ; Clear destination index register ldw byte_B6, x ; Load word jra loc_8F89 ; Jump relative always ; --------------------------------------------------------------------------- loc_8F80: ; Load word ldw x, #1 ld a, #9 ; Load ld xh, a ; Load call motor_drive ; Call subroutine loc_8F89: ; Load word ldw x, byte_AC jrne loc_8F80 ; Jump if Z = 0 (not equal) clr byte_47 ; Clear call read_conf_eprom ; Call subroutine call Usart_setup ; Call subroutine mov USART1_CR2, #$2C ; ',' ; USART1 Control Register 2 rim ; Enable Interrupts main_loop: ; Load ld a, dev_operation_mode call sub_8393 ; Call subroutine call sub_8BBA ; Call subroutine call button_to_mode_hndlr ; Call subroutine jra main_loop ; Jump relative always ; End of function device_init ; =============== S U B R O U T I N E ======================================= Usart_setup: mov USART1_CR1, #$10 ; USART1 Control Register 1 clr USART1_CR2 ; USART1 Control Register 2 clr USART1_CR3 ; USART1 Control Register 3 clr USART1_BRR2 ; USART1 Baud Rate Register 2 mov USART1_BRR1, #4 ; USART1 Baud Rate Register 1 ret ; Subroutine Return ; End of function Usart_setup ; =============== S U B R O U T I N E ======================================= usart_send_a: ld USART1_DR, a ; USART1 Data Register loc_8FBF: ; USART1 Status Register ld a, USART1_SR and a, #$80 ; '' ; Logical And cp a, #$80 ; '' ; Arithmetic Compare jrne loc_8FBF ; Jump if Z = 0 (not equal) ret ; Subroutine Return ; End of function usart_send_a ; =============== S U B R O U T I N E ======================================= USART1__0: pushw x ; Push word onto the Stack tnz USART1_SR ; USART1 Status Register ld a, USART1_DR ; USART1 Data Register ld (1,sp), a ; Load ldw x, byte_5C ; Load word addw x, #1 ; Addition Word ldw byte_5C, x ; Load word ld a, USART1_CR1 ; USART1 Control Register 1 bcp a, #$80 ; '' ; Bit compare jrne loc_8FEB ; Jump if Z = 0 (not equal) tnz (1,sp) ; Test for Neg & Zero jrne loc_8FEB ; Jump if Z = 0 (not equal) mov byte_23, #1 ; Move jra loc_9040 ; Jump relative always ; --------------------------------------------------------------------------- loc_8FEB: ; Load ld a, byte_23 cp a, #1 ; Arithmetic Compare jrne loc_9002 ; Jump if Z = 0 (not equal) tnz byte_24 ; Test for Neg & Zero jrne loc_9002 ; Jump if Z = 0 (not equal) tnz (1,sp) ; Test for Neg & Zero jrne loc_9002 ; Jump if Z = 0 (not equal) mov byte_24, #1 ; Move clrw x ; Clear destination index register ldw byte_40, x ; Load word jra loc_9040 ; Jump relative always ; --------------------------------------------------------------------------- loc_9002: ; Load ld a, byte_24 cp a, #1 ; Arithmetic Compare jrne loc_9040 ; Jump if Z = 0 (not equal) clr (2,sp) ; Clear loc_900A: ; Load ld a, (2,sp) clrw x ; Clear destination index register ld xl, a ; Load sllw x ; Shift left Logic word ldw y, x ; Load word ldw y, ($30,y) ; Load word cpw y, DMX_loc_addrw ; Arithmetic Compare Word jrne loc_9023 ; Jump if Z = 0 (not equal) ;ld a, (1,sp) ; Load ;ldw x, DMX_loc_addrw ; Load word ;ld ($27,x), a ; Load clrw x ld xl, a ld a, (1,sp) ld ($27,x), a ld a, #6 ; Load ld (2,sp), a ; Load loc_9023: ; Increment inc (2,sp) ld a, (2,sp) ; Load cp a, #6 ; Arithmetic Compare jrc loc_900A ; Jump if C = 1 ldw x, DMX_loc_addrw ; Load word addw x, #1 ; Addition Word ldw DMX_loc_addrw, x ; Load word ldw x, DMX_loc_addrw ; Load word cpw x, #$200 ; Arithmetic Compare Word jrc loc_9040 ; Jump if C = 1 clr byte_23 ; Clear clr byte_24 ; Clear clrw x ; Clear destination index register ldw DMX_loc_addrw, x ; Load word loc_9040: ; Addition Word addw sp, #2 iret ; Interrupt routine return ; End of function USART1__0 ; =============== S U B R O U T I N E ======================================= x_to_ram_A2A1: ld a, xh ; Load ld byte_A2, a ; Load ld a, xl ; Load ld byte_A1, a ; Load ret ; Subroutine Return ; End of function x_to_ram_A2A1 ; =============== S U B R O U T I N E ======================================= LEDs_pwm_timer_set: pushw x ; Push word onto the Stack tnz dev_operation_mode ; Test for Neg & Zero jreq loc_907D ; Jump if Z = 1 (equal) bres USART1_CR1, #6 ; USART1 Control Register 1 clr a ; Clear call usart_send_a ; Call subroutine bset USART1_CR1, #6 ; USART1 Control Register 1 clr a ; Clear call usart_send_a ; Call subroutine ld a, byte_A6 ; Load call usart_send_a ; Call subroutine ld a, (1,sp) ; Load call usart_send_a ; Call subroutine ld a, (2,sp) ; Load call usart_send_a ; Call subroutine ld a, (5,sp) ; Load call usart_send_a ; Call subroutine ld a, byte_A1 ; Load call usart_send_a ; Call subroutine ld a, byte_A2 ; Load call usart_send_a ; Call subroutine loc_907D: ; Load ld a, (1,sp) ld xl, a ; Load ld a, #$50 ; 'P' ; Load mul x, a ; Multiply ld a, #$64 ; 'd' ; Load call sub_9FA3 ; Call subroutine rrwa x, a ; Rotate right through accumulator ld TIM1_CCR2L, a ; TIM1 Capture/Compare Register 2 Low rlwa x, a ; Rotate left through accumulator ld a, (2,sp) ; Load ld xl, a ; Load ld a, #$50 ; 'P' ; Load mul x, a ; Multiply ld a, #$64 ; 'd' ; Load call sub_9FA3 ; Call subroutine rrwa x, a ; Rotate right through accumulator ld TIM1_CCR3L, a ; TIM1 Capture/Compare Register 3 Low rlwa x, a ; Rotate left through accumulator ld a, (5,sp) ; Load ld xl, a ; Load ld a, #$50 ; 'P' ; Load mul x, a ; Multiply ld a, #$64 ; 'd' ; Load call sub_9FA3 ; Call subroutine rrwa x, a ; Rotate right through accumulator ld TIM1_CCR1L, a ; TIM1 Capture/Compare Register 1 Low rlwa x, a ; Rotate left through accumulator ld a, (6,sp) ; Load ld TIM1_CCR4L, a ; TIM1 Capture/Compare Register 4 Low popw x ; Pop word from the Stack ret ; Subroutine Return ; End of function LEDs_pwm_timer_set ; =============== S U B R O U T I N E ======================================= sub_90B4: subw sp, #9 ; Subtraction clr (9,sp) ; Clear loc_90B8: ; Load ld a, (9,sp) clrw x ; Clear destination index register ld xl, a ; Load ld a, ($27,x) ; Load ld ($99,x), a ; Load inc (9,sp) ; Increment ld a, (9,sp) ; Load cp a, #6 ; Arithmetic Compare jrc loc_90B8 ; Jump if C = 1 ldw x, byte_40 ; Load word cpw x, #$1770 ; Arithmetic Compare Word jrc loc_90D2 ; Jump if C = 1 jp loc_9424 ; Absolute Jump ; --------------------------------------------------------------------------- loc_90D2: ; Load ld a, byte_A3 cp a, byte_A4 ; Arithmetic Compare jreq loc_90EC ; Jump if Z = 1 (equal) mov byte_A4, byte_A3 ; Move clrw x ; Clear destination index register ldw byte_B4, x ; Load word clrw x ; Clear destination index register ldw byte_B2, x ; Load word clrw x ; Clear destination index register ldw byte_B0, x ; Load word ldw x, byte_A ; Load word ldw byte_14, x ; Load word clr byte_12 ; Clear clr byte_13 ; Clear loc_90EC: ; Load ld a, byte_9E cp a, #6 ; Arithmetic Compare jrc loc_90F5 ; Jump if C = 1 jp loc_9322 ; Absolute Jump ; --------------------------------------------------------------------------- loc_90F5: ; Clear clr byte_A3 ld a, byte_99 ; Load cp a, #6 ; Arithmetic Compare jrnc loc_9112 ; Jump if C = 0 push #0 ; Push onto the Stack push byte_9C ; Push onto the Stack ld a, byte_9B ; Load ld xl, a ; Load ld a, byte_9A ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack mov byte_2F, #5 ; Move jra loc_915E ; Jump relative always ; --------------------------------------------------------------------------- loc_9112: ; Push onto the Stack push byte_99 push byte_9C ; Push onto the Stack ld a, byte_9B ; Load ld xl, a ; Load ld a, byte_9A ; Load ld xh, a ; Load call sub_9C09 ; Call subroutine popw x ; Pop word from the Stack ld a, byte_2F ; Load cp a, byte_99 ; Arithmetic Compare jreq loc_915E ; Jump if Z = 1 (equal) ld a, byte_2F ; Load cp a, byte_99 ; Arithmetic Compare jrule loc_9143 ; Jump if (C + Z = 1) rvf ; Reset overflow flag ld a, byte_2F ; Load clrw x ; Clear destination index register sub a, byte_99 ; Subtraction jrnc loc_9137 ; Jump if C = 0 decw x ; Decrement Word loc_9137: ; Rotate left through accumulator rlwa x, a cpw x, #$C ; Arithmetic Compare Word jrslt loc_9143 mov byte_2F, byte_99 ; Move clrw x ; Clear destination index register ldw byte_B4, x ; Load word loc_9143: ; Load ld a, byte_2F cp a, byte_99 ; Arithmetic Compare jrnc loc_915E ; Jump if C = 0 rvf ; Reset overflow flag ld a, byte_99 ; Load clrw x ; Clear destination index register sub a, byte_2F ; Subtraction jrnc loc_9152 ; Jump if C = 0 decw x ; Decrement Word loc_9152: ; Rotate left through accumulator rlwa x, a cpw x, #$C ; Arithmetic Compare Word jrslt loc_915E mov byte_2F, byte_99 ; Move clrw x ; Clear destination index register ldw byte_B4, x ; Load word loc_915E: ; Load ld a, byte_9D cp a, #6 ; Arithmetic Compare jrnc loc_916B ; Jump if C = 0 call sub_99D4 ; Call subroutine jpf loc_943E ; Absolute Jump far ; --------------------------------------------------------------------------- loc_916B: ; Load ld a, byte_9D cp a, #$80 ; '' ; Arithmetic Compare jrc loc_9174 ; Jump if C = 1 jp loc_92C7 ; Absolute Jump ; --------------------------------------------------------------------------- loc_9174: ; Load ld a, byte_9D clrw x ; Clear destination index register ld xl, a ; Load subw x, #5 ; Subtraction word call sub_9F2D ; Call subroutine ldw x, #$809A ; Load word call sub_9DF6 ; Call subroutine ldw x, sp ; Load word addw x, #5 ; Addition Word call ramB8_BB_to_x_ptr ; Call subroutine ldw x, byte_AA ; Load word subw x, #$32 ; '2' ; Subtraction word call sub_9FC8 ; Call subroutine ldw x, sp ; Load word addw x, #5 ; Addition Word call sub_9D3C ; Call subroutine jrne loc_919F ; Jump if Z = 0 (not equal) jp loc_92A6 ; Absolute Jump ; --------------------------------------------------------------------------- loc_919F: ; Load word ldw x, byte_AA cpw x, #$332 ; Arithmetic Compare Word jrc loc_91B0 ; Jump if C = 1 ldw x, byte_AA ; Load word cpw x, #$33 ; '3' ; Arithmetic Compare Word jrnc loc_91B0 ; Jump if C = 0 jp loc_92AC ; Absolute Jump ; --------------------------------------------------------------------------- loc_91B0: ; Reset overflow flag rvf ld a, byte_9D ; Load clrw x ; Clear destination index register ld xl, a ; Load subw x, #5 ; Subtraction word call sub_9F2D ; Call subroutine ldw x, #$809A ; Load word call sub_9DF6 ; Call subroutine ldw x, sp ; Load word addw x, #5 ; Addition Word call ramB8_BB_to_x_ptr ; Call subroutine ldw x, byte_AA ; Load word subw x, #$32 ; '2' ; Subtraction word call sub_9FC8 ; Call subroutine ldw x, sp ; Load word addw x, #5 ; Addition Word call sub_9D3C ; Call subroutine jrsge loc_922E rvf ; Reset overflow flag ld a, #2 ; Load call sub_9C57 ; Call subroutine ldw x, sp ; Load word addw x, #5 ; Addition Word call ramB8_BB_to_x_ptr ; Call subroutine ldw x, byte_AA ; Load word subw x, #$32 ; '2' ; Subtraction word call sub_9FC8 ; Call subroutine ldw x, sp ; Load word addw x, #1 ; Addition Word call ramB8_BB_to_x_ptr ; Call subroutine ld a, byte_9D ; Load clrw x ; Clear destination index register ld xl, a ; Load subw x, #5 ; Subtraction word call sub_9F2D ; Call subroutine ldw x, #$809A ; Load word call sub_9DF6 ; Call subroutine ldw x, sp ; Load word addw x, #1 ; Addition Word call sub_9C5F ; Call subroutine ldw x, sp ; Load word addw x, #5 ; Addition Word call sub_9D3C ; Call subroutine jrsle loc_9227 ldw x, #1 ; Load word ld a, #1 ; Load ld xh, a ; Load call motor_drive ; Call subroutine ldw x, #1 ; Load word ldw byte_AC, x ; Load word jpf loc_92AC ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9227: ; Call subroutine call motor_reset jpf loc_92AC ; Absolute Jump far ; --------------------------------------------------------------------------- loc_922E: ; Reset overflow flag rvf ld a, byte_9D ; Load clrw x ; Clear destination index register ld xl, a ; Load subw x, #5 ; Subtraction word call sub_9F2D ; Call subroutine ldw x, #$809A ; Load word call sub_9DF6 ; Call subroutine ldw x, sp ; Load word addw x, #5 ; Addition Word call ramB8_BB_to_x_ptr ; Call subroutine ldw x, byte_AA ; Load word subw x, #$32 ; '2' ; Subtraction word call sub_9FC8 ; Call subroutine ldw x, sp ; Load word addw x, #5 ; Addition Word call sub_9D3C ; Call subroutine jrsle loc_92AC rvf ; Reset overflow flag ld a, #2 ; Load call sub_9C57 ; Call subroutine ldw x, sp ; Load word addw x, #5 ; Addition Word call ramB8_BB_to_x_ptr ; Call subroutine ld a, byte_9D ; Load clrw x ; Clear destination index register ld xl, a ; Load subw x, #5 ; Subtraction word call sub_9F2D ; Call subroutine ldw x, #$809A ; Load word call sub_9DF6 ; Call subroutine ldw x, sp ; Load word addw x, #1 ; Addition Word call ramB8_BB_to_x_ptr ; Call subroutine ldw x, byte_AA ; Load word subw x, #$32 ; '2' ; Subtraction word call sub_9FC8 ; Call subroutine ldw x, sp ; Load word addw x, #1 ; Addition Word call sub_9C5F ; Call subroutine ldw x, sp ; Load word addw x, #5 ; Addition Word call sub_9D3C ; Call subroutine jrsle loc_92A1 clrw x ; Clear destination index register ld a, #1 ; Load ld xh, a ; Load call motor_drive ; Call subroutine ldw x, #1 ; Load word ldw byte_AC, x ; Load word jra loc_92AC ; Jump relative always ; --------------------------------------------------------------------------- loc_92A1: ; Call subroutine call motor_reset jra loc_92AC ; Jump relative always ; --------------------------------------------------------------------------- loc_92A6: ; Call subroutine call motor_reset clrw x ; Clear destination index register ldw byte_AC, x ; Load word loc_92AC: ; Load word ldw x, byte_AA cpw x, #$333 ; Arithmetic Compare Word jrnc loc_92BA ; Jump if C = 0 ldw x, byte_AA ; Load word cpw x, #$32 ; '2' ; Arithmetic Compare Word jrnc loc_92C0 ; Jump if C = 0 loc_92BA: ; Call subroutine call motor_reset clrw x ; Clear destination index register ldw byte_AC, x ; Load word loc_92C0: ; Move mov byte_21, byte_9D jpf loc_943E ; Absolute Jump far ; --------------------------------------------------------------------------- loc_92C7: ; Load ld a, byte_9D cp a, #$80 ; '' ; Arithmetic Compare jrnc loc_92D0 ; Jump if C = 0 jp loc_943E ; Absolute Jump ; --------------------------------------------------------------------------- loc_92D0: ; Load ld a, byte_9D clrw x ; Clear destination index register ld xl, a ; Load subw x, #$80 ; '' ; Subtraction word call sub_9F2D ; Call subroutine ldw x, #$8096 ; Load word call sub_9D72 ; Call subroutine call sub_9ED1 ; Call subroutine ld a, byte_BB ; Load ld (9,sp), a ; Load ld a, (9,sp) ; Load cp a, #$A ; Arithmetic Compare jrc loc_92F1 ; Jump if C = 1 ld a, #9 ; Load ld (9,sp), a ; Load loc_92F1: ; Load ld a, byte_21 cp a, #$80 ; '' ; Arithmetic Compare jrnc loc_9315 ; Jump if C = 0 ldw x, byte_AA ; Load word cpw x, #$34 ; '4' ; Arithmetic Compare Word jrc loc_930E ; Jump if C = 1 clrw x ; Clear destination index register ld a, #9 ; Load ld xh, a ; Load call motor_drive ; Call subroutine ldw x, #1 ; Load word ldw byte_AC, x ; Load word jpf loc_943E ; Absolute Jump far ; --------------------------------------------------------------------------- loc_930E: ; Move mov byte_21, byte_9D jpf loc_943E ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9315: ; Load word ldw x, #1 ld a, (9,sp) ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine jpf loc_943E ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9322: ; Load ld a, byte_9D clrw x ; Clear destination index register ld xl, a ; Load call sub_9F2D ; Call subroutine ldw x, #$8092 ; Load word call sub_9D72 ; Call subroutine call sub_9ED1 ; Call subroutine ld a, byte_BB ; Load ld (9,sp), a ; Load ld a, (9,sp) ; Load cp a, #$A ; Arithmetic Compare jrc loc_9340 ; Jump if C = 1 ld a, #9 ; Load ld (9,sp), a ; Load loc_9340: ; Load ld a, byte_9E cp a, #$27 ; ''' ; Arithmetic Compare jrnc loc_9363 ; Jump if C = 0 push #0 ; Push onto the Stack push #0 ; Push onto the Stack clrw x ; Clear destination index register ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack ldw x, #1 ; Load word ld a, (9,sp) ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine mov byte_A3, #1 ; Move jpf loc_943E ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9363: ; Load ld a, byte_9E cp a, #$42 ; 'B' ; Arithmetic Compare jrnc loc_9387 ; Jump if C = 0 push #0 ; Push onto the Stack push #0 ; Push onto the Stack ldw x, #$FF ; Load word clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack ldw x, #1 ; Load word ld a, (9,sp) ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine mov byte_A3, #2 ; Move jpf loc_943E ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9387: ; Load ld a, byte_9E cp a, #$5F ; '_' ; Arithmetic Compare jrnc loc_93A9 ; Jump if C = 0 push #0 ; Push onto the Stack push #$FF ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack ldw x, #1 ; Load word ld a, (9,sp) ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine mov byte_A3, #3 ; Move jpf loc_943E ; Absolute Jump far ; --------------------------------------------------------------------------- loc_93A9: ; Load ld a, byte_9E cp a, #$7C ; '|' ; Arithmetic Compare jrnc loc_93C1 ; Jump if C = 0 call sub_9604 ; Call subroutine ldw x, #1 ; Load word ld a, (9,sp) ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine mov byte_A3, #4 ; Move jra loc_943E ; Jump relative always ; --------------------------------------------------------------------------- loc_93C1: ; Load ld a, byte_9E cp a, #$98 ; '' ; Arithmetic Compare jrnc loc_93D9 ; Jump if C = 0 call sub_961F ; Call subroutine ldw x, #1 ; Load word ld a, (9,sp) ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine mov byte_A3, #5 ; Move jra loc_943E ; Jump relative always ; --------------------------------------------------------------------------- loc_93D9: ; Load ld a, byte_9E cp a, #$B5 ; '' ; Arithmetic Compare jrnc loc_93F1 ; Jump if C = 0 call sub_97EE ; Call subroutine ldw x, #1 ; Load word ld a, (9,sp) ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine mov byte_A3, #6 ; Move jra loc_943E ; Jump relative always ; --------------------------------------------------------------------------- loc_93F1: ; Load ld a, byte_9E cp a, #$D3 ; '' ; Arithmetic Compare jrnc loc_9409 ; Jump if C = 0 call sub_9815 ; Call subroutine ldw x, #1 ; Load word ld a, (9,sp) ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine mov byte_A3, #7 ; Move jra loc_943E ; Jump relative always ; --------------------------------------------------------------------------- loc_9409: ; Load ld a, byte_9E cp a, #$E7 ; '' ; Arithmetic Compare jrnc loc_9419 ; Jump if C = 0 clr a ; Clear call sub_9859 ; Call subroutine mov byte_A3, #8 ; Move jra loc_943E ; Jump relative always ; --------------------------------------------------------------------------- loc_9419: ; Load ld a, #1 call sub_9859 ; Call subroutine mov byte_A3, #9 ; Move jra loc_943E ; Jump relative always ; --------------------------------------------------------------------------- loc_9424: ; Push onto the Stack push #0 push #0 ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack call sub_99D4 ; Call subroutine ldw x, byte_A ; Load word ldw byte_42, x ; Load word ldw x, byte_5C ; Load word ldw byte_14, x ; Load word clr byte_12 ; Clear clr byte_13 ; Clear loc_943E: ; Addition Word addw sp, #9 ret ; Subroutine Return ; End of function sub_90B4 ; =============== S U B R O U T I N E ======================================= sub_9441: tnz a ; Test for Neg & Zero jreq loc_9458 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9466 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9475 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9482 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9490 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_94A0 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_94AF ; Jump if Z = 1 (equal) jra locret_94BD ; Jump relative always ; --------------------------------------------------------------------------- loc_9458: ; Push onto the Stack push #0 push #0 ; Push onto the Stack clrw x ; Clear destination index register ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_94BD ; Jump relative always ; --------------------------------------------------------------------------- loc_9466: ; Push onto the Stack push #0 push #0 ; Push onto the Stack ldw x, #$FF ; Load word clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_94BD ; Jump relative always ; --------------------------------------------------------------------------- loc_9475: ; Push onto the Stack push #0 push #$FF ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_94BD ; Jump relative always ; --------------------------------------------------------------------------- loc_9482: ; Push onto the Stack push #0 push #$FF ; Push onto the Stack clrw x ; Clear destination index register ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_94BD ; Jump relative always ; --------------------------------------------------------------------------- loc_9490: ; Push onto the Stack push #0 push #0 ; Push onto the Stack ldw x, #$FF ; Load word ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_94BD ; Jump relative always ; --------------------------------------------------------------------------- loc_94A0: ; Push onto the Stack push #0 push #$FF ; Push onto the Stack ldw x, #$FF ; Load word clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_94BD ; Jump relative always ; --------------------------------------------------------------------------- loc_94AF: ; Push onto the Stack push #0 push #$FF ; Push onto the Stack ldw x, #$FF ; Load word ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack locret_94BD: ; Subroutine Return ret ; End of function sub_9441 ; =============== S U B R O U T I N E ======================================= sub_94BE: cp a, #$14 ; switch 20 cases jrnc loc_94C9 ; Jump if C = 0 clrw x ; Clear destination index register ld xl, a ; Load sllw x ; Shift left Logic word ldw x, ($809E,x) ; Load word jp (x) ; switch jump ; --------------------------------------------------------------------------- loc_94C9: ; Absolute Jump far jpf locret_9603 ; --------------------------------------------------------------------------- loc_94CD: ; jumptable 000094C8 case 0 push #0 push #0 ; Push onto the Stack clrw x ; Clear destination index register ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_9603 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_94DD: ; jumptable 000094C8 case 1 push #0 push #0 ; Push onto the Stack ldw x, #$FF ; Load word clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_9603 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_94EE: ; jumptable 000094C8 case 2 push #0 push #$FF ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_9603 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_94FD: ; jumptable 000094C8 case 3 push #0 push #$FF ; Push onto the Stack clrw x ; Clear destination index register ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_9603 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_950D: ; jumptable 000094C8 case 4 push #0 push #0 ; Push onto the Stack ldw x, #$FF ; Load word ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_9603 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_951F: ; jumptable 000094C8 case 5 push #0 push #$FF ; Push onto the Stack ldw x, #$FF ; Load word ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_9603 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9531: ; jumptable 000094C8 case 6 push #0 push #0 ; Push onto the Stack clrw x ; Clear destination index register ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_9603 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9541: ; jumptable 000094C8 case 7 push #0 push #0 ; Push onto the Stack ldw x, #$FF ; Load word ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_9603 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9553: ; jumptable 000094C8 case 8 push #0 push #0 ; Push onto the Stack ldw x, #$FF ; Load word clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_9603 ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9564: ; jumptable 000094C8 case 9 push #0 push #$FF ; Push onto the Stack ldw x, #$FF ; Load word clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jp locret_9603 ; Absolute Jump ; --------------------------------------------------------------------------- loc_9574: ; jumptable 000094C8 case 10 push #0 push #$FF ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jp locret_9603 ; Absolute Jump ; --------------------------------------------------------------------------- loc_9582: ; jumptable 000094C8 case 11 push #0 push #$FF ; Push onto the Stack clrw x ; Clear destination index register ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_9603 ; Jump relative always ; --------------------------------------------------------------------------- loc_9590: ; jumptable 000094C8 case 12 push #0 push #$FF ; Push onto the Stack ldw x, #$FF ; Load word ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_9603 ; Jump relative always ; --------------------------------------------------------------------------- loc_95A0: ; jumptable 000094C8 case 13 push #0 push #$FF ; Push onto the Stack ldw x, #$FF ; Load word clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_9603 ; Jump relative always ; --------------------------------------------------------------------------- loc_95AF: ; jumptable 000094C8 case 14 push #0 push #0 ; Push onto the Stack ldw x, #$FF ; Load word clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_9603 ; Jump relative always ; --------------------------------------------------------------------------- loc_95BE: ; jumptable 000094C8 case 15 push #0 push #$FF ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_9603 ; Jump relative always ; --------------------------------------------------------------------------- loc_95CB: ; jumptable 000094C8 case 16 push #0 push #$FF ; Push onto the Stack ldw x, #$FF ; Load word clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_9603 ; Jump relative always ; --------------------------------------------------------------------------- loc_95DA: ; jumptable 000094C8 case 17 push #0 push #$FF ; Push onto the Stack ldw x, #$FF ; Load word ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_9603 ; Jump relative always ; --------------------------------------------------------------------------- loc_95EA: ; jumptable 000094C8 case 18 push #0 push #$FF ; Push onto the Stack clrw x ; Clear destination index register ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_9603 ; Jump relative always ; --------------------------------------------------------------------------- loc_95F8: ; jumptable 000094C8 case 19 push #0 push #$FF ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack locret_9603: ; Subroutine Return ret ; End of function sub_94BE ; =============== S U B R O U T I N E ======================================= sub_9604: ldw x, byte_B4 ; Load word jrne loc_9619 ; Jump if Z = 0 (not equal) ldw x, #$4E20 ; Load word ldw byte_B4, x ; Load word ld a, byte_12 ; Load cp a, #2 ; Arithmetic Compare jrnc loc_9617 ; Jump if C = 0 inc byte_12 ; Increment jra loc_9619 ; Jump relative always ; --------------------------------------------------------------------------- loc_9617: ; Clear clr byte_12 loc_9619: ; Load ld a, byte_12 call sub_94BE ; Call subroutine ret ; Subroutine Return ; End of function sub_9604 ; =============== S U B R O U T I N E ======================================= sub_961F: ldw x, byte_B4 ; Load word jrne loc_9634 ; Jump if Z = 0 (not equal) ldw x, #$4E20 ; Load word ldw byte_B4, x ; Load word ld a, byte_12 ; Load cp a, #6 ; Arithmetic Compare jrnc loc_9632 ; Jump if C = 0 inc byte_12 ; Increment jra loc_9634 ; Jump relative always ; --------------------------------------------------------------------------- loc_9632: ; Clear clr byte_12 loc_9634: ; Load ld a, byte_12 call sub_9441 ; Call subroutine ret ; Subroutine Return ; End of function sub_961F ; =============== S U B R O U T I N E ======================================= sub_963A: ld a, byte_13 ; Load cp a, #$17 ; switch 23 cases jrnc loc_9647 ; Jump if C = 0 clrw x ; Clear destination index register ld xl, a ; Load sllw x ; Shift left Logic word ldw x, ($80C6,x) ; Load word jp (x) ; switch jump ; --------------------------------------------------------------------------- loc_9647: ; Absolute Jump far jpf locret_97ED ; --------------------------------------------------------------------------- loc_964B: ; jumptable 00009646 case 0 push #0 push #0 ; Push onto the Stack clrw x ; Clear destination index register ld a, #$FF ; Load sub a, byte_12 ; Subtraction ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_97ED ; Absolute Jump far ; --------------------------------------------------------------------------- loc_965D: ; jumptable 00009646 case 1 push #0 push #0 ; Push onto the Stack ld a, byte_12 ; Load ld xl, a ; Load clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_97ED ; Absolute Jump far ; --------------------------------------------------------------------------- loc_966E: ; jumptable 00009646 case 2 push #0 push #0 ; Push onto the Stack ld a, #$FF ; Load sub a, byte_12 ; Subtraction ld xl, a ; Load clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_97ED ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9681: ; jumptable 00009646 case 3 push #0 push byte_12 ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_97ED ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9691: ; jumptable 00009646 case 4 push #0 ld a, #$FF ; Load sub a, byte_12 ; Subtraction push a ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_97ED ; Absolute Jump far ; --------------------------------------------------------------------------- loc_96A3: ; jumptable 00009646 case 5 push #0 push #0 ; Push onto the Stack ld a, byte_12 ; Load ld xl, a ; Load ld a, byte_12 ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_97ED ; Absolute Jump far ; --------------------------------------------------------------------------- loc_96B5: ; jumptable 00009646 case 6 push #0 push #0 ; Push onto the Stack ld a, #$FF ; Load sub a, byte_12 ; Subtraction ld xl, a ; Load ld a, #$FF ; Load sub a, byte_12 ; Subtraction ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_97ED ; Absolute Jump far ; --------------------------------------------------------------------------- loc_96CB: ; jumptable 00009646 case 7 push #0 push byte_12 ; Push onto the Stack ld a, byte_12 ; Load ld xl, a ; Load clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_97ED ; Absolute Jump far ; --------------------------------------------------------------------------- loc_96DD: ; jumptable 00009646 case 8 push #0 ld a, #$FF ; Load sub a, byte_12 ; Subtraction push a ; Push onto the Stack ld a, #$FF ; Load sub a, byte_12 ; Subtraction ld xl, a ; Load clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_97ED ; Absolute Jump far ; --------------------------------------------------------------------------- loc_96F3: ; jumptable 00009646 case 9 push #0 push byte_12 ; Push onto the Stack clrw x ; Clear destination index register ld a, byte_12 ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_97ED ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9704: ; jumptable 00009646 case 10 push #0 ld a, #$FF ; Load sub a, byte_12 ; Subtraction push a ; Push onto the Stack clrw x ; Clear destination index register ld a, #$FF ; Load sub a, byte_12 ; Subtraction ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_97ED ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9719: ; jumptable 00009646 case 11 push #0 push byte_12 ; Push onto the Stack ld a, byte_12 ; Load ld xl, a ; Load ld a, byte_12 ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_97ED ; Absolute Jump far ; --------------------------------------------------------------------------- loc_972C: ; jumptable 00009646 case 12 push #0 ld a, #$FF ; Load sub a, byte_12 ; Subtraction push a ; Push onto the Stack ld a, #$FF ; Load sub a, byte_12 ; Subtraction ld xl, a ; Load ld a, #$FF ; Load sub a, byte_12 ; Subtraction ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jpf locret_97ED ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9745: ; jumptable 00009646 case 13 push #0 push #0 ; Push onto the Stack ld a, byte_12 ; Load ld xl, a ; Load ld a, byte_12 ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jp locret_97ED ; Absolute Jump ; --------------------------------------------------------------------------- loc_9756: ; jumptable 00009646 case 14 push #0 push #0 ; Push onto the Stack ld a, #$FF ; Load sub a, byte_12 ; Subtraction ld xl, a ; Load ld a, #$FF ; Load sub a, byte_12 ; Subtraction ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jp locret_97ED ; Absolute Jump ; --------------------------------------------------------------------------- loc_976B: ; jumptable 00009646 case 15 push #0 push byte_12 ; Push onto the Stack ld a, byte_12 ; Load ld xl, a ; Load clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_97ED ; Jump relative always ; --------------------------------------------------------------------------- loc_977B: ; jumptable 00009646 case 16 push #0 ld a, #$FF ; Load sub a, byte_12 ; Subtraction push a ; Push onto the Stack ld a, #$FF ; Load sub a, byte_12 ; Subtraction ld xl, a ; Load clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_97ED ; Jump relative always ; --------------------------------------------------------------------------- loc_978F: ; jumptable 00009646 case 17 push #0 push byte_12 ; Push onto the Stack clrw x ; Clear destination index register ld a, byte_12 ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_97ED ; Jump relative always ; --------------------------------------------------------------------------- loc_979E: ; jumptable 00009646 case 18 push #0 ld a, #$FF ; Load sub a, byte_12 ; Subtraction push a ; Push onto the Stack clrw x ; Clear destination index register ld a, #$FF ; Load sub a, byte_12 ; Subtraction ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_97ED ; Jump relative always ; --------------------------------------------------------------------------- loc_97B1: ; jumptable 00009646 case 19 push #0 push byte_12 ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_97ED ; Jump relative always ; --------------------------------------------------------------------------- loc_97BF: ; jumptable 00009646 case 20 push #0 ld a, #$FF ; Load sub a, byte_12 ; Subtraction push a ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_97ED ; Jump relative always ; --------------------------------------------------------------------------- loc_97CF: ; jumptable 00009646 case 21 push #0 push #0 ; Push onto the Stack ld a, byte_12 ; Load ld xl, a ; Load clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_97ED ; Jump relative always ; --------------------------------------------------------------------------- loc_97DE: ; jumptable 00009646 case 22 push #0 push #0 ; Push onto the Stack ld a, #$FF ; Load sub a, byte_12 ; Subtraction ld xl, a ; Load clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack locret_97ED: ; Subroutine Return ret ; End of function sub_963A ; =============== S U B R O U T I N E ======================================= sub_97EE: ldw x, byte_B4 ; Load word jrne loc_9811 ; Jump if Z = 0 (not equal) ldw x, #$6E ; 'n' ; Load word ldw byte_B4, x ; Load word ld a, byte_12 ; Load cp a, #$C8 ; '' ; Arithmetic Compare jrnc loc_9801 ; Jump if C = 0 inc byte_12 ; Increment jra loc_9811 ; Jump relative always ; --------------------------------------------------------------------------- loc_9801: ; Clear clr byte_12 ld a, byte_13 ; Load cp a, #$16 ; Arithmetic Compare jrnc loc_980D ; Jump if C = 0 inc byte_13 ; Increment jra loc_9811 ; Jump relative always ; --------------------------------------------------------------------------- loc_980D: ; Clear clr byte_13 clr byte_44 ; Clear loc_9811: ; Call subroutine call sub_963A ret ; Subroutine Return ; End of function sub_97EE ; =============== S U B R O U T I N E ======================================= sub_9815: ldw x, byte_B4 ; Load word jrne loc_9836 ; Jump if Z = 0 (not equal) ldw x, #$64 ; 'd' ; Load word ldw byte_B4, x ; Load word ld a, byte_12 ; Load cp a, #$C8 ; '' ; Arithmetic Compare jrnc loc_9828 ; Jump if C = 0 inc byte_12 ; Increment jra loc_9836 ; Jump relative always ; --------------------------------------------------------------------------- loc_9828: ; Clear clr byte_12 ld a, byte_13 ; Load cp a, #$16 ; Arithmetic Compare jrnc loc_9834 ; Jump if C = 0 inc byte_13 ; Increment jra loc_9836 ; Jump relative always ; --------------------------------------------------------------------------- loc_9834: ; Clear clr byte_13 loc_9836: ; Load word ldw x, byte_B2 jrne loc_9841 ; Jump if Z = 0 (not equal) ldw x, #$1F4 ; Load word ldw byte_B2, x ; Load word jra locret_9858 ; Jump relative always ; --------------------------------------------------------------------------- loc_9841: ; Load word ldw x, byte_B2 cpw x, #$FA ; '' ; Arithmetic Compare Word jrnc loc_9855 ; Jump if C = 0 push #0 ; Push onto the Stack push #0 ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra locret_9858 ; Jump relative always ; --------------------------------------------------------------------------- loc_9855: ; Call subroutine call sub_963A locret_9858: ; Subroutine Return ret ; End of function sub_9815 ; =============== S U B R O U T I N E ======================================= sub_9859: push a ; Push onto the Stack ldw x, byte_14 ; Load word pushw x ; Push word onto the Stack ldw x, byte_A ; Load word call sub_81C8 ; Call subroutine addw sp, #2 ; Addition Word cpw x, #$A ; Arithmetic Compare Word jrc loc_987C ; Jump if C = 1 ldw x, byte_A ; Load word ldw byte_14, x ; Load word ld a, PA_IDR ; Port A input pin value register bcp a, #2 ; Bit compare jreq loc_987A ; Jump if Z = 1 (equal) mov byte_A8, #$FF ; Move jra loc_987C ; Jump relative always ; --------------------------------------------------------------------------- loc_987A: ; Clear clr byte_A8 loc_987C: ; Load ld a, byte_A9 xor a, byte_A8 ; Exclusive OR and a, byte_A9 ; Logical And ld byte_A7, a ; Load tnz byte_A7 ; Test for Neg & Zero jreq loc_98A9 ; Jump if Z = 1 (equal) ldw x, #$9C40 ; Load word ldw byte_B2, x ; Load word tnz (1,sp) ; Test for Neg & Zero jreq loc_9895 ; Jump if Z = 1 (equal) inc byte_59 ; Increment jra loc_9897 ; Jump relative always ; --------------------------------------------------------------------------- loc_9895: ; Increment inc byte_58 loc_9897: ; Load ld a, byte_58 cp a, #$14 ; Arithmetic Compare jrc loc_989F ; Jump if C = 1 clr byte_58 ; Clear loc_989F: ; Load ld a, byte_59 cp a, #$14 ; Arithmetic Compare jrc loc_98C4 ; Jump if C = 1 clr byte_59 ; Clear jra loc_98C4 ; Jump relative always ; --------------------------------------------------------------------------- loc_98A9: ; Load word ldw x, byte_B2 jrne loc_98C4 ; Jump if Z = 0 (not equal) ldw x, byte_AE ; Load word jrne loc_98C4 ; Jump if Z = 0 (not equal) ldw x, #$C350 ; Load word ldw byte_AE, x ; Load word tnz (1,sp) ; Test for Neg & Zero jreq loc_98BC ; Jump if Z = 1 (equal) inc byte_59 ; Increment loc_98BC: ; Load ld a, byte_59 cp a, #$14 ; Arithmetic Compare jrc loc_98C4 ; Jump if C = 1 clr byte_59 ; Clear loc_98C4: ; Move mov byte_A9, byte_A8 mov byte_A6, #5 ; Move tnz (1,sp) ; Test for Neg & Zero jrne loc_9948 ; Jump if Z = 0 (not equal) ldw x, byte_B2 ; Load word cpw x, #$7531 ; Arithmetic Compare Word jrc loc_98EA ; Jump if C = 1 ldw x, #1 ; Load word ld a, #9 ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine ldw x, #$FE ; '' ; Load word ld a, #5 ; Load ld xh, a ; Load call x_to_ram_A2A1 ; Call subroutine jra loc_98FC ; Jump relative always ; --------------------------------------------------------------------------- loc_98EA: ; Load word ldw x, #1 ld a, #5 ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine ldw x, #$8D ; '' ; Load word ld a, #5 ; Load ld xh, a ; Load call x_to_ram_A2A1 ; Call subroutine loc_98FC: ; Load word ldw x, byte_B2 cpw x, #$7531 ; Arithmetic Compare Word jrc loc_9932 ; Jump if C = 1 ldw x, byte_B0 ; Load word jrne loc_990E ; Jump if Z = 0 (not equal) ldw x, #$1F4 ; Load word ldw byte_B0, x ; Load word jra loc_9948 ; Jump relative always ; --------------------------------------------------------------------------- loc_990E: ; Load word ldw x, byte_B0 cpw x, #$FA ; '' ; Arithmetic Compare Word jrnc loc_9922 ; Jump if C = 0 push #0 ; Push onto the Stack push #0 ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra loc_9948 ; Jump relative always ; --------------------------------------------------------------------------- loc_9922: ; Push onto the Stack push #0 push #$FF ; Push onto the Stack ldw x, #$FF ; Load word ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra loc_9948 ; Jump relative always ; --------------------------------------------------------------------------- loc_9932: ; Load word ldw x, byte_B2 jreq loc_993D ; Jump if Z = 1 (equal) ld a, byte_58 ; Load call sub_94BE ; Call subroutine jra loc_9948 ; Jump relative always ; --------------------------------------------------------------------------- loc_993D: ; Push onto the Stack push #0 push #0 ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack loc_9948: ; Load ld a, (1,sp) cp a, #1 ; Arithmetic Compare jrne loc_99C1 ; Jump if Z = 0 (not equal) ld a, byte_59 ; Load cp a, #$D ; Arithmetic Compare jrnc loc_995B ; Jump if C = 0 ld a, byte_59 ; Load call sub_94BE ; Call subroutine jra loc_998F ; Jump relative always ; --------------------------------------------------------------------------- loc_995B: ; Load word ldw x, byte_B2 cpw x, #$7531 ; Arithmetic Compare Word jrc loc_998F ; Jump if C = 1 ldw x, byte_B0 ; Load word jrne loc_996D ; Jump if Z = 0 (not equal) ldw x, #$1F4 ; Load word ldw byte_B0, x ; Load word jra loc_998F ; Jump relative always ; --------------------------------------------------------------------------- loc_996D: ; Load word ldw x, byte_B0 cpw x, #$FA ; '' ; Arithmetic Compare Word jrnc loc_9981 ; Jump if C = 0 push #0 ; Push onto the Stack push #0 ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra loc_998F ; Jump relative always ; --------------------------------------------------------------------------- loc_9981: ; Push onto the Stack push #0 push #$FF ; Push onto the Stack ldw x, #$FF ; Load word ld a, #$FF ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack loc_998F: ; Load word ldw x, byte_B2 cpw x, #$7531 ; Arithmetic Compare Word jrc loc_99AA ; Jump if C = 1 ldw x, #1 ; Load word ld a, #9 ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine ldw x, #$FE ; '' ; Load word ld a, #5 ; Load ld xh, a ; Load call x_to_ram_A2A1 ; Call subroutine jra loc_99C1 ; Jump relative always ; --------------------------------------------------------------------------- loc_99AA: ; Load word ldw x, #1 ld a, #5 ; Load ld xh, a ; Load call sub_9BBF ; Call subroutine ldw x, #$8D ; '' ; Load word ld a, #5 ; Load ld xh, a ; Load call x_to_ram_A2A1 ; Call subroutine ld a, byte_59 ; Load call sub_94BE ; Call subroutine loc_99C1: ; Pop from the Stack pop a ret ; Subroutine Return ; End of function sub_9859 ; =============== S U B R O U T I N E ======================================= motor_reset: bres PC_ODR, #5 ; Port C data output latch register bres PC_ODR, #6 ; Port C data output latch register bres PC_ODR, #7 ; Port C data output latch register bres PD_ODR, #0 ; Port D data output latch register ret ; Subroutine Return ; End of function motor_reset ; =============== S U B R O U T I N E ======================================= sub_99D4: ldw x, byte_AA ; Load word cpw x, #$34 ; '4' ; Arithmetic Compare Word jrnc loc_99E2 ; Jump if C = 0 callr motor_reset ; Call subroutine relative clrw x ; Clear destination index register ldw byte_AC, x ; Load word jra locret_99ED ; Jump relative always ; --------------------------------------------------------------------------- loc_99E2: ; Clear destination index register clrw x ld a, #9 ; Load ld xh, a ; Load callr motor_drive ; Call subroutine relative ldw x, #1 ; Load word ldw byte_AC, x ; Load word locret_99ED: ; Subroutine Return ret ; End of function sub_99D4 ; =============== S U B R O U T I N E ======================================= motor_drive: pushw x ; Push word onto the Stack pushw x ; Push word onto the Stack ldw x, byte_B6 ; Load word jreq loc_99F7 ; Jump if Z = 1 (equal) jp loc_9BBC ; Absolute Jump ; --------------------------------------------------------------------------- loc_99F7: ; Load word ldw x, byte_AC jrne loc_99FE ; Jump if Z = 0 (not equal) jp loc_9BBC ; Absolute Jump ; --------------------------------------------------------------------------- loc_99FE: ; Load ld a, (3,sp) ld xl, a ; Load ld a, #$A ; Load mul x, a ; Multiply ldw (1,sp), x ; Load word ldw x, #$70 ; 'p' ; Load word subw x, (1,sp) ; Subtraction word ldw byte_B6, x ; Load word ldw x, byte_AC ; Load word subw x, #1 ; Subtraction word ldw byte_AC, x ; Load word tnz (4,sp) ; Test for Neg & Zero jrne loc_9A1C ; Jump if Z = 0 (not equal) jp loc_9AF2 ; Absolute Jump ; --------------------------------------------------------------------------- loc_9A1C: ; Load word ldw x, byte_AA cpw x, #$400 ; Arithmetic Compare Word jrnc loc_9A2A ; Jump if C = 0 ldw x, byte_AA ; Load word addw x, #1 ; Addition Word ldw byte_AA, x ; Load word loc_9A2A: ; Load ld a, byte_46 tnz a ; Test for Neg & Zero jreq loc_9A4E ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9A62 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9A76 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9A8A ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9A9E ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9AB2 ; Jump if Z = 1 (equal) dec a ; Decrement jrne loc_9A44 ; Jump if Z = 0 (not equal) jp loc_9AC6 ; Absolute Jump ; --------------------------------------------------------------------------- loc_9A44: ; Decrement dec a jrne loc_9A4A ; Jump if Z = 0 (not equal) jp loc_9ADA ; Absolute Jump ; --------------------------------------------------------------------------- loc_9A4A: ; Absolute Jump far jpf loc_9BAE ; --------------------------------------------------------------------------- loc_9A4E: ; Port C data output latch register bset PC_ODR, #5 bres PC_ODR, #6 ; Port C data output latch register bres PC_ODR, #7 ; Port C data output latch register bres PD_ODR, #0 ; Port D data output latch register jpf loc_9BAE ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9A62: ; Port C data output latch register bset PC_ODR, #5 bset PC_ODR, #6 ; Port C data output latch register bres PC_ODR, #7 ; Port C data output latch register bres PD_ODR, #0 ; Port D data output latch register jpf loc_9BAE ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9A76: ; Port C data output latch register bres PC_ODR, #5 bset PC_ODR, #6 ; Port C data output latch register bres PC_ODR, #7 ; Port C data output latch register bres PD_ODR, #0 ; Port D data output latch register jpf loc_9BAE ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9A8A: ; Port C data output latch register bres PC_ODR, #5 bset PC_ODR, #6 ; Port C data output latch register bset PC_ODR, #7 ; Port C data output latch register bres PD_ODR, #0 ; Port D data output latch register jpf loc_9BAE ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9A9E: ; Port C data output latch register bres PC_ODR, #5 bres PC_ODR, #6 ; Port C data output latch register bset PC_ODR, #7 ; Port C data output latch register bres PD_ODR, #0 ; Port D data output latch register jpf loc_9BAE ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9AB2: ; Port C data output latch register bres PC_ODR, #5 bres PC_ODR, #6 ; Port C data output latch register bset PC_ODR, #7 ; Port C data output latch register bset PD_ODR, #0 ; Port D data output latch register jpf loc_9BAE ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9AC6: ; Port C data output latch register bres PC_ODR, #5 bres PC_ODR, #6 ; Port C data output latch register bres PC_ODR, #7 ; Port C data output latch register bset PD_ODR, #0 ; Port D data output latch register jpf loc_9BAE ; Absolute Jump far ; --------------------------------------------------------------------------- loc_9ADA: ; Port C data output latch register bset PC_ODR, #5 bres PC_ODR, #6 ; Port C data output latch register bres PC_ODR, #7 ; Port C data output latch register bset PD_ODR, #0 ; Port D data output latch register jpf loc_9BAE ; Absolute Jump far ; --------------------------------------------------------------------------- dc.b $AC ; dc.b 0 dc.b $9B ; dc.b $AE ; ; --------------------------------------------------------------------------- loc_9AF2: ; Load word ldw x, byte_AA jreq loc_9AFD ; Jump if Z = 1 (equal) ldw x, byte_AA ; Load word subw x, #1 ; Subtraction word ldw byte_AA, x ; Load word loc_9AFD: ; Load ld a, byte_46 tnz a ; Test for Neg & Zero jrne loc_9B05 ; Jump if Z = 0 (not equal) jp loc_9B9E ; Absolute Jump ; --------------------------------------------------------------------------- loc_9B05: ; Decrement dec a jrne loc_9B0B ; Jump if Z = 0 (not equal) jp loc_9B8C ; Absolute Jump ; --------------------------------------------------------------------------- loc_9B0B: ; Decrement dec a jreq loc_9B7A ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9B68 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9B56 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9B44 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9B32 ; Jump if Z = 1 (equal) dec a ; Decrement jreq loc_9B20 ; Jump if Z = 1 (equal) jp loc_9BAE ; Absolute Jump ; --------------------------------------------------------------------------- loc_9B20: ; Port C data output latch register bset PC_ODR, #5 bres PC_ODR, #6 ; Port C data output latch register bres PC_ODR, #7 ; Port C data output latch register bres PD_ODR, #0 ; Port D data output latch register jra loc_9BAE ; Jump relative always ; --------------------------------------------------------------------------- loc_9B32: ; Port C data output latch register bset PC_ODR, #5 bset PC_ODR, #6 ; Port C data output latch register bres PC_ODR, #7 ; Port C data output latch register bres PD_ODR, #0 ; Port D data output latch register jra loc_9BAE ; Jump relative always ; --------------------------------------------------------------------------- loc_9B44: ; Port C data output latch register bres PC_ODR, #5 bset PC_ODR, #6 ; Port C data output latch register bres PC_ODR, #7 ; Port C data output latch register bres PD_ODR, #0 ; Port D data output latch register jra loc_9BAE ; Jump relative always ; --------------------------------------------------------------------------- loc_9B56: ; Port C data output latch register bres PC_ODR, #5 bset PC_ODR, #6 ; Port C data output latch register bset PC_ODR, #7 ; Port C data output latch register bres PD_ODR, #0 ; Port D data output latch register jra loc_9BAE ; Jump relative always ; --------------------------------------------------------------------------- loc_9B68: ; Port C data output latch register bres PC_ODR, #5 bres PC_ODR, #6 ; Port C data output latch register bset PC_ODR, #7 ; Port C data output latch register bres PD_ODR, #0 ; Port D data output latch register jra loc_9BAE ; Jump relative always ; --------------------------------------------------------------------------- loc_9B7A: ; Port C data output latch register bres PC_ODR, #5 bres PC_ODR, #6 ; Port C data output latch register bset PC_ODR, #7 ; Port C data output latch register bset PD_ODR, #0 ; Port D data output latch register jra loc_9BAE ; Jump relative always ; --------------------------------------------------------------------------- loc_9B8C: ; Port C data output latch register bres PC_ODR, #5 bres PC_ODR, #6 ; Port C data output latch register bres PC_ODR, #7 ; Port C data output latch register bset PD_ODR, #0 ; Port D data output latch register jra loc_9BAE ; Jump relative always ; --------------------------------------------------------------------------- loc_9B9E: ; Port C data output latch register bset PC_ODR, #5 bres PC_ODR, #6 ; Port C data output latch register bres PC_ODR, #7 ; Port C data output latch register bset PD_ODR, #0 ; Port D data output latch register loc_9BAE: ; Load ld a, byte_46 cp a, #8 ; Arithmetic Compare jrnc loc_9BBA ; Jump if C = 0 inc byte_46 ; Increment jra loc_9BBC ; Jump relative always ; --------------------------------------------------------------------------- dc.b $20 dc.b $F4 ; ; --------------------------------------------------------------------------- loc_9BBA: ; Clear clr byte_46 loc_9BBC: ; Addition Word addw sp, #4 ret ; Subroutine Return ; End of function motor_drive ; =============== S U B R O U T I N E ======================================= sub_9BBF: pushw x ; Push word onto the Stack tnz byte_47 ; Test for Neg & Zero jrne loc_9BDE ; Jump if Z = 0 (not equal) ldw x, byte_AC ; Load word jreq loc_9BDE ; Jump if Z = 1 (equal) ldw x, byte_AA ; Load word cpw x, #$33D ; Arithmetic Compare Word jrc loc_9BD2 ; Jump if C = 1 clrw x ; Clear destination index register ldw byte_48, x ; Load word loc_9BD2: ; Load word ldw x, byte_AA cpw x, #$32 ; '2' ; Arithmetic Compare Word jrnc loc_9BDE ; Jump if C = 0 ldw x, #$FF ; Load word ldw byte_48, x ; Load word loc_9BDE: ; Load ld a, byte_49 ld xl, a ; Load ld a, (1,sp) ; Load ld xh, a ; Load call motor_drive ; Call subroutine ldw x, byte_AC ; Load word jrne loc_9C05 ; Jump if Z = 0 (not equal) call motor_reset ; Call subroutine tnz (2,sp) ; Test for Neg & Zero jreq loc_9C05 ; Jump if Z = 1 (equal) ldw x, #$300 ; Load word ldw byte_AC, x ; Load word ldw x, byte_48 ; Load word jreq loc_9C00 ; Jump if Z = 1 (equal) clrw x ; Clear destination index register ldw byte_48, x ; Load word jra loc_9C05 ; Jump relative always ; --------------------------------------------------------------------------- loc_9C00: ; Load word ldw x, #$FF ldw byte_48, x ; Load word loc_9C05: ; Load ld a, byte_49 popw x ; Pop word from the Stack ret ; Subroutine Return ; End of function sub_9BBF ; =============== S U B R O U T I N E ======================================= sub_9C09: pushw x ; Push word onto the Stack pushw x ; Push word onto the Stack ldw x, byte_B4 ; Load word jrne loc_9C21 ; Jump if Z = 0 (not equal) ld a, (8,sp) ; Load ld xl, a ; Load ld a, #$14 ; Load mul x, a ; Multiply ldw (1,sp), x ; Load word ldw x, #$157C ; Load word subw x, (1,sp) ; Subtraction word ldw byte_B4, x ; Load word jra loc_9C54 ; Jump relative always ; --------------------------------------------------------------------------- loc_9C21: ; Load ld a, (8,sp) ld xl, a ; Load ld a, #$14 ; Load mul x, a ; Multiply ldw (1,sp), x ; Load word ldw x, #$157C ; Load word subw x, (1,sp) ; Subtraction word ld a, #2 ; Load call sub_9FA3 ; Call subroutine cpw x, byte_B4 ; Arithmetic Compare Word jrule loc_9C45 ; Jump if (C + Z = 1) push #0 ; Push onto the Stack push #0 ; Push onto the Stack clrw x ; Clear destination index register clr a ; Clear ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack jra loc_9C54 ; Jump relative always ; --------------------------------------------------------------------------- loc_9C45: ; Push onto the Stack push #0 ld a, (8,sp) ; Load push a ; Push onto the Stack ld a, (6,sp) ; Load ld xl, a ; Load ld a, (5,sp) ; Load ld xh, a ; Load call LEDs_pwm_timer_set ; Call subroutine popw x ; Pop word from the Stack loc_9C54: ; Addition Word addw sp, #4 ret ; Subroutine Return ; End of function sub_9C09 ; =============== S U B R O U T I N E ======================================= sub_9C57: pushw x ; Push word onto the Stack clrw x ; Clear destination index register ld xl, a ; Load call sub_9F2D ; Call subroutine popw x ; Pop word from the Stack ret ; Subroutine Return ; End of function sub_9C57 ; =============== S U B R O U T I N E ======================================= sub_9C5F: ld a, (3,x) ; Load push a ; Push onto the Stack ld a, (2,x) ; Load push a ; Push onto the Stack ld a, (1,x) ; Load push a ; Push onto the Stack ld a, (x) ; Load jrne loc_9C6F ; Jump if Z = 0 (not equal) tnz (1,sp) ; Test for Neg & Zero jreq loc_9C7D ; Jump if Z = 1 (equal) loc_9C6F: ; Exclusive OR xor a, #$80 ; '' jra loc_9C7D ; Jump relative always ; End of function sub_9C5F ; =============== S U B R O U T I N E ======================================= sub_9C73: ld a, (3,x) ; Load push a ; Push onto the Stack ld a, (2,x) ; Load push a ; Push onto the Stack ld a, (1,x) ; Load push a ; Push onto the Stack ld a, (x) ; Load loc_9C7D: ; Push onto the Stack push a or a, (2,sp) ; OR Operation jreq loc_9C8D ; Jump if Z = 1 (equal) ldw x, byte_B8 ; Load word jrne loc_9C90 ; Jump if Z = 0 (not equal) loc_9C86: ; Pop word from the Stack popw x ldw byte_B8, x ; Load word popw x ; Pop word from the Stack ldw byte_BA, x ; Load word ret ; Subroutine Return ; --------------------------------------------------------------------------- loc_9C8D: ; Addition Word addw sp, #4 ret ; Subroutine Return ; --------------------------------------------------------------------------- loc_9C90: ; Push word onto the Stack pushw y clr byte_BD ; Clear sllw x ; Shift left Logic word rlc byte_BD ; Rotate left true ld a, xh ; Load ld byte_BC, a ; Load ldw x, (3,sp) ; Load word sllw x ; Shift left Logic word rlc byte_BD ; Rotate left true ld a, xh ; Load clrw x ; Clear destination index register sub a, byte_BC ; Subtraction jreq loc_9CC4 ; Jump if Z = 1 (equal) ld xl, a ; Load jrugt loc_9CD0 ; Jump if (C + Z = 0) cp a, #$E9 ; '' ; Arithmetic Compare jrc loc_9CCA ; Jump if C = 1 neg a ; Negate ld xl, a ; Load ldw y, (5,sp) ; Load word ld a, (4,sp) ; Load or a, #$80 ; '' ; OR Operation loc_9CB4: ; Shift right Logic srl a rrcw y ; Rotate right true word decw x ; Decrement Word jrne loc_9CB4 ; Jump if Z = 0 (not equal) ld (4,sp), a ; Load ldw (5,sp), y ; Load word bset byte_B9, #7 ; Bit Set jra loc_9CF0 ; Jump relative always ; --------------------------------------------------------------------------- loc_9CC4: ; Bit Set bset byte_B9, #7 jra loc_9CEA ; Jump relative always ; --------------------------------------------------------------------------- loc_9CCA: ; Jump relative always jra loc_9D37 ; --------------------------------------------------------------------------- loc_9CCC: ; Pop word from the Stack popw y jra loc_9C86 ; Jump relative always ; --------------------------------------------------------------------------- loc_9CD0: ; Arithmetic Compare cp a, #$18 jrnc loc_9CCC ; Jump if C = 0 add a, byte_BC ; Addition ld byte_BC, a ; Load ldw y, byte_BA ; Load word ld a, byte_B9 ; Load or a, #$80 ; '' ; OR Operation loc_9CDF: ; Shift right Logic srl a rrcw y ; Rotate right true word decw x ; Decrement Word jrne loc_9CDF ; Jump if Z = 0 (not equal) ld byte_B9, a ; Load ldw byte_BA, y ; Load word loc_9CEA: ; Load ld a, (4,sp) or a, #$80 ; '' ; OR Operation ld (4,sp), a ; Load loc_9CF0: ; Load word ldw x, byte_BA ld a, byte_B9 ; Load srl byte_BD ; Shift right Logic jrugt loc_9CFC ; Jump if (C + Z = 0) jrnc loc_9D18 ; Jump if C = 0 jrne loc_9D18 ; Jump if Z = 0 (not equal) loc_9CFC: ; Subtraction word subw x, (5,sp) sbc a, (4,sp) ; Subtract with Carry jrnc loc_9D0A ; Jump if C = 0 cpl byte_BD ; One Complement cpl a ; One Complement negw x ; Negate word jrne loc_9D0A ; Jump if Z = 0 (not equal) inc a ; Increment loc_9D0A: ; Test for Neg & Zero tnz a jrmi loc_9D2B ; Jump if N = 1 (minus) jrne loc_9D25 ; Jump if Z = 0 (not equal) tnzw x ; Test for Neg & Zero word jrne loc_9D25 ; Jump if Z = 0 (not equal) ldw byte_BA, x ; Load word ldw byte_B8, x ; Load word jra loc_9D37 ; Jump relative always ; --------------------------------------------------------------------------- loc_9D18: ; Addition Word addw x, (5,sp) adc a, (4,sp) ; Add with Carry jrnc loc_9D2B ; Jump if C = 0 rrc a ; Rotate right true rrcw x ; Rotate right true word inc byte_BC ; Increment jra loc_9D2B ; Jump relative always ; --------------------------------------------------------------------------- loc_9D25: ; Decrement dec byte_BC sllw x ; Shift left Logic word rlc a ; Rotate left true jrpl loc_9D25 ; Jump if N = 0 (plus) loc_9D2B: ; Load word ldw byte_BA, x sll a ; Shift left Logic ld xl, a ; Load ld a, byte_BC ; Load ld xh, a ; Load srl byte_BD ; Shift right Logic rrcw x ; Rotate right true word ldw byte_B8, x ; Load word loc_9D37: ; Pop word from the Stack popw y addw sp, #4 ; Addition Word ret ; Subroutine Return ; End of function sub_9C73 ; =============== S U B R O U T I N E ======================================= sub_9D3C: ld a, byte_B8 ; Load and a, (x) ; Logical And ld byte_BD, a ; Load ld a, byte_B8 ; Load xor a, (x) ; Exclusive OR jrpl loc_9D4B ; Jump if N = 0 (plus) xor a, (x) ; Exclusive OR jrmi loc_9D64 ; Jump if N = 1 (minus) jra loc_9D68 ; Jump relative always ; --------------------------------------------------------------------------- loc_9D4B: ; Load ld a, byte_B8 sub a, (x) ; Subtraction jrne loc_9D6A ; Jump if Z = 0 (not equal) ld a, byte_B9 ; Load cp a, (1,x) ; Arithmetic Compare jrne loc_9D62 ; Jump if Z = 0 (not equal) ld a, byte_BA ; Load cp a, (2,x) ; Arithmetic Compare jrne loc_9D62 ; Jump if Z = 0 (not equal) ld a, byte_BB ; Load cp a, (3,x) ; Arithmetic Compare jreq loc_9D70 ; Jump if Z = 1 (equal) loc_9D62: ; Jump if C = 0 jrnc loc_9D68 loc_9D64: ; Load ld a, #$FF jra loc_9D6A ; Jump relative always ; --------------------------------------------------------------------------- loc_9D68: ; Load ld a, #1 loc_9D6A: ; Jump if bit is false btjf byte_BD, #7, loc_9D70 neg a ; Negate loc_9D70: ; Reset overflow flag rvf ret ; Subroutine Return ; End of function sub_9D3C ; =============== S U B R O U T I N E ======================================= sub_9D72: ld a, byte_B8 ; Load or a, byte_B9 ; OR Operation jreq locret_9D89 ; Jump if Z = 1 (equal) ld a, (3,x) ; Load push a ; Push onto the Stack ld a, (2,x) ; Load push a ; Push onto the Stack ld a, (1,x) ; Load push a ; Push onto the Stack ld a, (x) ; Load push a ; Push onto the Stack or a, (2,sp) ; OR Operation jrne loc_9D8A ; Jump if Z = 0 (not equal) addw sp, #4 ; Addition Word locret_9D89: ; Subroutine Return ret ; --------------------------------------------------------------------------- loc_9D8A: ; Push word onto the Stack pushw y ld a, (3,sp) ; Load btjf byte_B8, #7, loc_9D97 ; Jump if bit is false xor a, #$80 ; '' ; Exclusive OR ld (3,sp), a ; Load loc_9D97: ; OR Operation or a, #$80 ; '' sll (4,sp) ; Shift left Logic rlc a ; Rotate left true ld byte_BC, a ; Load rrc (4,sp) ; Rotate right true ld a, byte_B9 ; Load bset byte_B9, #7 ; Bit Set sll a ; Shift left Logic ld a, byte_B8 ; Load rlc a ; Rotate left true sub a, byte_BC ; Subtraction add a, #$7F ; '' ; Addition ld byte_B8, a ; Load mov byte_BD, #$18 ; Move sra (3,sp) ; Shift right Arithmetic sll (3,sp) ; Shift left Logic ld a, byte_B9 ; Load ldw x, byte_BA ; Load word loc_9DBC: ; Shift left Logic word sllw y rlc byte_BC ; Rotate left true sra (3,sp) ; Shift right Arithmetic jrc loc_9DCE ; Jump if C = 1 cp a, (4,sp) ; Arithmetic Compare jrc loc_9DD5 ; Jump if C = 1 jrugt loc_9DCE ; Jump if (C + Z = 0) cpw x, (5,sp) ; Arithmetic Compare Word jrc loc_9DD5 ; Jump if C = 1 loc_9DCE: ; Subtraction word subw x, (5,sp) sbc a, (4,sp) ; Subtract with Carry incw y ; Increment Word loc_9DD5: ; Shift left Logic word sllw x rlc a ; Rotate left true rlc (3,sp) ; Rotate left true dec byte_BD ; Decrement jrne loc_9DBC ; Jump if Z = 0 (not equal) ld a, byte_BC ; Load jrmi loc_9DE6 ; Jump if N = 1 (minus) sllw y ; Shift left Logic word rlc a ; Rotate left true dec byte_B8 ; Decrement loc_9DE6: ; Shift left Logic sll a sll (3,sp) ; Shift left Logic rrc byte_B8 ; Rotate right true rrc a ; Rotate right true ld byte_B9, a ; Load ldw byte_BA, y ; Load word popw y ; Pop word from the Stack addw sp, #4 ; Addition Word ret ; Subroutine Return ; End of function sub_9D72 ; =============== S U B R O U T I N E ======================================= sub_9DF6: ld a, byte_B8 ; Load or a, byte_B9 ; OR Operation jreq locret_9E0E ; Jump if Z = 1 (equal) ld a, (3,x) ; Load push a ; Push onto the Stack ld a, (2,x) ; Load push a ; Push onto the Stack ldw x, (x) ; Load word pushw x ; Push word onto the Stack ldw x, (1,sp) ; Load word jrne loc_9E0F ; Jump if Z = 0 (not equal) ldw byte_B8, x ; Load word ldw byte_BA, x ; Load word addw sp, #4 ; Addition Word locret_9E0E: ; Subroutine Return ret ; --------------------------------------------------------------------------- loc_9E0F: ; Load ld a, (1,sp) btjf byte_B8, #7, loc_9E1A ; Jump if bit is false xor a, #$80 ; '' ; Exclusive OR ld (1,sp), a ; Load loc_9E1A: ; OR Operation or a, #$80 ; '' sll (2,sp) ; Shift left Logic rlc a ; Rotate left true rrc (2,sp) ; Rotate right true sub a, #$7E ; '~' ; Subtraction ld byte_BC, a ; Load ld a, byte_B9 ; Load bset byte_B9, #7 ; Bit Set sll a ; Shift left Logic ld a, byte_B8 ; Load rlc a ; Rotate left true add a, byte_BC ; Addition ld byte_B8, a ; Load ld a, (2,sp) ; Load ldw x, byte_B8 ; Load word mul x, a ; Multiply ldw byte_BC, x ; Load word ld a, (3,sp) ; Load ldw x, byte_B8 ; Load word mul x, a ; Multiply clr byte_BE ; Clear callr sub_9EA1 ; Call subroutine relative ld a, (4,sp) ; Load ldw x, byte_B8 ; Load word mul x, a ; Multiply ld a, xl ; Load callr sub_9EAF ; Call subroutine relative ld a, (2,sp) ; Load ldw x, byte_B9 ; Load word mul x, a ; Multiply callr sub_9EA1 ; Call subroutine relative ld a, (3,sp) ; Load ldw x, byte_B9 ; Load word mul x, a ; Multiply callr sub_9EAC ; Call subroutine relative ld a, (4,sp) ; Load ldw x, byte_B9 ; Load word mul x, a ; Multiply clr byte_BA ; Clear callr sub_9EBE ; Call subroutine relative ld a, (2,sp) ; Load ldw x, byte_BA ; Load word mul x, a ; Multiply callr sub_9EAC ; Call subroutine relative ld a, (3,sp) ; Load ldw x, byte_BA ; Load word mul x, a ; Multiply callr sub_9EBE ; Call subroutine relative ld a, (4,sp) ; Load ldw x, byte_BA ; Load word mul x, a ; Multiply ld a, xh ; Load add a, byte_BA ; Addition jrnc loc_9E80 ; Jump if C = 0 inc byte_B9 ; Increment jrne loc_9E80 ; Jump if Z = 0 (not equal) callr sub_9EC6 ; Call subroutine relative loc_9E80: ; Load word ldw x, byte_BD ld a, byte_BC ; Load jrmi loc_9E8C ; Jump if N = 1 (minus) sll byte_B9 ; Shift left Logic rlcw x ; Rotate left true word rlc a ; Rotate left true dec byte_B8 ; Decrement loc_9E8C: ; Shift left Logic sll a sll (1,sp) ; Shift left Logic rrc byte_B8 ; Rotate right true rrc a ; Rotate right true sll byte_B9 ; Shift left Logic ld byte_B9, a ; Load ldw byte_BA, x ; Load word jrnc loc_9E9E ; Jump if C = 0 bset byte_BB, #0 ; Bit Set loc_9E9E: ; Addition Word addw sp, #4 ret ; Subroutine Return ; End of function sub_9DF6 ; =============== S U B R O U T I N E ======================================= sub_9EA1: addw x, byte_BD ; Addition Word ldw byte_BD, x ; Load word jrnc locret_9EAB ; Jump if C = 0 inc byte_BC ; Increment locret_9EAB: ; Subroutine Return ret ; End of function sub_9EA1 ; =============== S U B R O U T I N E ======================================= sub_9EAC: ld a, xl ; Load add a, byte_B9 ; Addition ; End of function sub_9EAC ; =============== S U B R O U T I N E ======================================= sub_9EAF: ld byte_B9, a ; Load ld a, xh ; Load adc a, byte_BE ; Add with Carry ld byte_BE, a ; Load jrnc locret_9EAB ; Jump if C = 0 loc_9EB8: ; Load word ldw x, byte_BC incw x ; Increment Word ldw byte_BC, x ; Load word ret ; Subroutine Return ; End of function sub_9EAF ; =============== S U B R O U T I N E ======================================= sub_9EBE: addw x, byte_B9 ; Addition Word ldw byte_B9, x ; Load word jrnc locret_9EAB ; Jump if C = 0 ; End of function sub_9EBE ; =============== S U B R O U T I N E ======================================= sub_9EC6: inc byte_BE ; Increment jreq loc_9EB8 ; Jump if Z = 1 (equal) ret ; Subroutine Return ; End of function sub_9EC6 ; =============== S U B R O U T I N E ======================================= sub_9ECB: call sub_9ED1 ; Call subroutine ldw x, byte_BA ; Load word ret ; Subroutine Return ; End of function sub_9ECB ; =============== S U B R O U T I N E ======================================= sub_9ED1: pushw x ; Push word onto the Stack ldw x, byte_B8 ; Load word jreq loc_9F2B ; Jump if Z = 1 (equal) clr a ; Clear sllw x ; Shift left Logic word rlwa x, a ; Rotate left through accumulator sub a, #$7F ; '' ; Subtraction jrpl loc_9EE4 ; Jump if N = 0 (plus) loc_9EDD: ; Clear destination index register clrw x ldw byte_B8, x ; Load word ldw byte_BA, x ; Load word jra loc_9F2B ; Jump relative always ; --------------------------------------------------------------------------- loc_9EE4: ; Push word onto the Stack pushw y cp a, #$37 ; '7' ; Arithmetic Compare jrpl loc_9EDD ; Jump if N = 0 (plus) rrcw x ; Rotate right true word swapw x ; SWAP bytes ldw y, byte_BA ; Load word sub a, #$17 ; Subtraction jreq loc_9F1A ; Jump if Z = 1 (equal) jrpl loc_9F09 ; Jump if N = 0 (plus) neg a ; Negate cp a, #$10 ; Arithmetic Compare jrmi loc_9F01 ; Jump if N = 1 (minus) ldw y, x ; Load word clrw x ; Clear destination index register sub a, #$10 ; Subtraction jreq loc_9F1A ; Jump if Z = 1 (equal) loc_9F01: ; Shift right Logic word srlw x rrcw y ; Rotate right true word dec a ; Decrement jrne loc_9F01 ; Jump if Z = 0 (not equal) jra loc_9F1A ; Jump relative always ; --------------------------------------------------------------------------- loc_9F09: ; Arithmetic Compare cp a, #$10 jrmi loc_9F14 ; Jump if N = 1 (minus) ldw x, y ; Load word clrw y ; Clear destination index register sub a, #$10 ; Subtraction jreq loc_9F1A ; Jump if Z = 1 (equal) loc_9F14: ; Shift left Logic word sllw y rlcw x ; Rotate left true word dec a ; Decrement jrne loc_9F14 ; Jump if Z = 0 (not equal) loc_9F1A: ; Test for Neg & Zero tnz byte_B8 jrpl loc_9F24 ; Jump if N = 0 (plus) cplw x ; One Complement Word negw y ; Negate word jrne loc_9F24 ; Jump if Z = 0 (not equal) incw x ; Increment Word loc_9F24: ; Load word ldw byte_BA, y ldw byte_B8, x ; Load word popw y ; Pop word from the Stack loc_9F2B: ; Pop word from the Stack popw x ret ; Subroutine Return ; End of function sub_9ED1 ; =============== S U B R O U T I N E ======================================= sub_9F2D: clr byte_BB ; Clear ldw byte_B9, x ; Load word jrne loc_9F36 ; Jump if Z = 0 (not equal) clr byte_B8 ; Clear ret ; Subroutine Return ; --------------------------------------------------------------------------- loc_9F36: ; Move mov byte_B8, byte_B9 jrpl loc_9F3E ; Jump if N = 0 (plus) negw x ; Negate word ldw byte_B9, x ; Load word loc_9F3E: ; Load ld a, #$8E ; '' tnzw x ; Test for Neg & Zero word jrmi loc_9F51 ; Jump if N = 1 (minus) tnz byte_B9 ; Test for Neg & Zero jrne loc_9F4D ; Jump if Z = 0 (not equal) ld a, #$86 ; '' ; Load ldw x, byte_BA ; Load word jrmi loc_9F51 ; Jump if N = 1 (minus) loc_9F4D: ; Decrement dec a sllw x ; Shift left Logic word jrpl loc_9F4D ; Jump if N = 0 (plus) loc_9F51: ; Shift left Logic word sllw x sll byte_B8 ; Shift left Logic rrc a ; Rotate right true rrcw x ; Rotate right true word ldw byte_B9, x ; Load word ld byte_B8, a ; Load ret ; Subroutine Return ; End of function sub_9F2D ; =============== S U B R O U T I N E ======================================= ramB8_BB_add_xptr_dw: ld a, byte_BB ; Load add a, (3,x) ; Addition ld byte_BB, a ; Load ld a, byte_BA ; Load adc a, (2,x) ; Add with Carry ld byte_BA, a ; Load ld a, byte_B9 ; Load adc a, (1,x) ; Add with Carry ld byte_B9, a ; Load ld a, byte_B8 ; Load adc a, (x) ; Add with Carry ld byte_B8, a ; Load ret ; Subroutine Return ; End of function ramB8_BB_add_xptr_dw ; =============== S U B R O U T I N E ======================================= ramB8_BB_sub_xptr_dw: ld a, byte_BB ; Load sub a, (3,x) ; Subtraction ld byte_BB, a ; Load ld a, byte_BA ; Load sbc a, (2,x) ; Subtract with Carry ld byte_BA, a ; Load ld a, byte_B9 ; Load sbc a, (1,x) ; Subtract with Carry ld byte_B9, a ; Load ld a, byte_B8 ; Load sbc a, (x) ; Subtract with Carry ld byte_B8, a ; Load ret ; Subroutine Return ; End of function ramB8_BB_sub_xptr_dw ; =============== S U B R O U T I N E ======================================= ramB8_BB_to_x_ptr: push a ; Push onto the Stack ld a, byte_B8 ; Load ld (x), a ; Load ld a, byte_B9 ; Load ld (1,x), a ; Load ld a, byte_BA ; Load ld (2,x), a ; Load ld a, byte_BB ; Load ld (3,x), a ; Load pop a ; Pop from the Stack ret ; Subroutine Return ; End of function ramB8_BB_to_x_ptr ; --------------------------------------------------------------------------- dc.b $35 ; 5 dc.b $80 ; dc.b 0 dc.b $BC ; dc.b $20 dc.b 2 ; =============== S U B R O U T I N E ======================================= sub_9FA3: clr byte_BC ; Clear tnzw x ; Test for Neg & Zero word jrpl loc_9FB1 ; Jump if N = 0 (plus) negw x ; Negate word bset byte_BC, #0 ; Bit Set bset byte_BC, #1 ; Bit Set loc_9FB1: ; Test for Neg & Zero tnz a jrpl loc_9FB9 ; Jump if N = 0 (plus) neg a ; Negate bcpl byte_BC, #1 ; Bit complement loc_9FB9: ; Division div x, a sra byte_BC ; Shift right Arithmetic jrpl loc_9FC4 ; Jump if N = 0 (plus) clrw x ; Clear destination index register ld xl, a ; Load jrnc locret_9FC7 ; Jump if C = 0 negw x ; Negate word ret ; Subroutine Return ; --------------------------------------------------------------------------- loc_9FC4: ; Jump if Z = 1 (equal) jreq locret_9FC7 negw x ; Negate word locret_9FC7: ; Subroutine Return ret ; End of function sub_9FA3 ; =============== S U B R O U T I N E ======================================= sub_9FC8: clr byte_BB ; Clear ldw byte_B9, x ; Load word jrne loc_9FD1 ; Jump if Z = 0 (not equal) clr byte_B8 ; Clear ret ; Subroutine Return ; --------------------------------------------------------------------------- loc_9FD1: ; Load ld a, #$8E ; '' tnzw x ; Test for Neg & Zero word jrmi loc_9FE4 ; Jump if N = 1 (minus) tnz byte_B9 ; Test for Neg & Zero jrne loc_9FE0 ; Jump if Z = 0 (not equal) ld a, #$86 ; '' ; Load ldw x, byte_BA ; Load word jrmi loc_9FE4 ; Jump if N = 1 (minus) loc_9FE0: ; Decrement dec a sllw x ; Shift left Logic word jrpl loc_9FE0 ; Jump if N = 0 (plus) loc_9FE4: ; Shift left Logic word sllw x srl a ; Shift right Logic rrcw x ; Rotate right true word ldw byte_B9, x ; Load word ld byte_B8, a ; Load ret ; Subroutine Return ; End of function sub_9FC8 ; =============== S U B R O U T I N E ======================================= sub_9FEC: ldw byte_BA, x ; Load word clr byte_B9 ; Clear clr byte_B8 ; Clear ret ; Subroutine Return ; End of function sub_9FEC ; =============== S U B R O U T I N E ======================================= nullsub_1: iret ; Interrupt routine return ; End of function nullsub_1 ; --------------------------------------------------------------------------- end ;