Blame | Last modification | View Log | Download | RSS feed
ifndef reg96inc ; avoid multiple inclusionreg96inc equ 1;****************************************************************************;* *;* AS 1.42 - File REG96.INC *;* *;* Contains Macro, SFR and Address Definitions for MCS-96 Processors *;* *;****************************************************************************savelisting off ; no listing over this fileif (MOMCPUNAME<>"8096")&&(MOMCPUNAME<>"80196")&&(MOMCPUNAME<>"80196N")&&(MOMCPUNAME<>"80296")fatal "wrong target selected: only 8096, 80196, 80196N, or 80299 supported"endifif MOMPASS=1message "MCS-96 SFR Definitions (C) 1994 Alfred Arnold"message "binde \{MOMCPU}-SFRs ein"endif;----------------------------------------------------------------------------; CPU RegistersR0 equ 0 ; Zero RegisterZERO_REG equ R0ONES_REG equ 2 ; All OnesSP equ 18h ; Stack Pointerif MOMCPU>=80196hWSR equ 14h ; RAM Window in Register Bankif MOMCPU>=80296hWSR1 equ 15h ; RAM-Window in lower Half of Register Bankendifendifif MOMCPU>=80296h ; Signal Processor RegistersACC_00 equ 000ch ; AccumulatorACC_02 equ 000ehACC_04 equ 0006hACC_STAT equ 000bhICB0 equ 1fc3h ; Index RegisterICB1 equ 1fc7hICX0 equ 0010hICX1 equ 0016hIDX0 equ 1fc0hIDX1 equ 1fc4hRPT_CNT equ 0004h ; Count Registerendif;----------------------------------------------------------------------------; SFRs:;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; A/D Converterswitch MOMCPUNAMEcase "80296" ; Suppress Warningcase "80196N"AD_RESULT equ 1faah ; Conversion Result (read as word)AD_COMMAND equ 1fach ; A/D Converter Control RegisterAD_TEST equ 1faeh ; AdjustmentAD_TIME equ 1fafh ; Conversion Speedcase "80196"AD_Result equ 1faah ; Conversion Result (read as word)AD_Command equ 1fach ; A/D Converter Control RegisterAD_Test equ 1faeh ; AdjustmentAD_Time equ 1fafh ; Conversion Speedcase "8096"AD_Command equ 2 ; A/D Converter Control RegisterAD_Result_Lo equ 2 ; A/D Converter ResultAD_Result_Hi equ 3 ; ONLY read as bytes!endcase;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; HSI/HSO/EPAswitch MOMCPUNAMEcase "80296"EPA_MASK equ 1f9ch ; Interrupt MaskEPA_PEND equ 1f9eh ; Interrupts Pending__CNT set 0rept 4EPA{"\{__CNT}"}_CON equ 1f60h+(__CNT*4) ; Capture/Compare Units ControlEPA{"\{__CNT}"}_TIME equ 1f62h+(__CNT*4) ; " " Time__CNT set __CNT+1endmcase "80196N"COMP0_CON equ 1f88h ; Comparator 0 ControlCOMP0_TIME equ 1f8ah ; Comparator 0 TimeCOMP1_CON equ 1f8ch ; ditto Comparator 1COMP1_CON equ 1f8ehEPA_MASK equ 1fa0h ; Interrupt MasksEPA_MASK1 equ 1fa4hEPA_PEND equ 1fa2h ; Interrupts PendingEPA_PEND1 equ 1fa6h__CNT set 0rept 10EPA{"\{__CNT}"}_CON equ 1f60h+(__CNT*4) ; Capture/Compare Units ControlEPA{"\{__CNT}"}_TIME equ 1f62h+(__CNT*4) ; " " Time__CNT set __CNT+1endmEPAIPV equ 1fa8h ; Interrupt Prioritycase "80196"EPA_Mask equ 1fa0h ; (w) EPA Interrupt Masks 4..9, 0..1, Overrun 0..9/0/1EPA_Mask1 equ 1fa4hEPA_Pend equ 1fa2h ; (w) EPA Interrupts Pending 4..9, 0..1, Overrun 0..9/0/1EPA_Pend1 equ 1fa6hEPAIpv equ 1fa8h ; EPA Interrupts PriorityEPA_Control0 equ 1f60h ; Capture/Compare Control Channels 0..9 ControlEPA_Time0 equ 1f62h ; (w) Channels 0..9 Saved TimeEPA_Control1 equ 1f64hEPA_Time1 equ 1f66hEPA_Control2 equ 1f68hEPA_Time2 equ 1f6ahEPA_Control3 equ 1f6chEPA_Time3 equ 1f6ehEPA_Control4 equ 1f70hEPA_Time4 equ 1f72hEPA_Control5 equ 1f74hEPA_Time5 equ 1f76hEPA_Control6 equ 1f78hEPA_Time6 equ 1f7ahEPA_Control7 equ 1f7chEPA_Time7 equ 1f7ehEPA_Control8 equ 1f80hEPA_Time8 equ 1f82hEPA_Control9 equ 1f84hEPA_Time9 equ 1f86hComp_Control0 equ 1f88h ; Compare Channels 0..1 ControlComp_Time0 equ 1f8ah ; Compare Channels 0..1 TimeComp_Control1 equ 1f8chComp_Time1 equ 1f8ehcase "8096"HSI_Time equ 4 ; HSI Trigger Time (word-only)HSI_Mode equ 3 ; HSI Mode RegisterHSI_Status equ 6 ; HSI Status RegisterHSO_Time equ 4 ; HSO Time Setting (word-only)HSO_Command equ 6 ; HSO Control Registerendcase;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; Serialswitch MOMCPUNAMEcase "80296"SP_CON equ 1fbbh ; SIO ControlSP_BAUD equ 1fbch ; (w) SIO Baud RateSP_STATUS equ 1fb9h ; SIO StatusSBUF_RX equ 1fb8h ; Receive DataSBUF_TX equ 1fbah ; Transmit Datacase "80196N"SP_CON equ 1fbbh ; SIO ControlSP_BAUD equ 1fbch ; (w) SIO Baud RateSP_STATUS equ 1fb9h ; SIO StatusSBUF_RX equ 1fb8h ; Receive DataSBUF_TX equ 1fbah ; Transmit DataSSIO_BAUD equ 1fb4h ; SSIO Baud RateSSIO0_BUF equ 1fb0h ; SSIO0 Data RegisterSSIO1_BUF equ 1fb2h ; SSIO1 Data RegisterSSIO0_CON equ 1fb1h ; SSIO0 ModeSSIO1_CON equ 1fb3h ; SSIO1 Modecase "80196"SSIO_StB0 equ 1fb0h ; SSIO Channel 0 Data BufferSSIO_StCr0 equ 1fb1h ; SSIO Channel 0 Transmitter/Receiver ControlSSIO_StB1 equ 1fb2h ; SSIO Channel 1 Data BufferSSIO_StCr1 equ 1fb3h ; SSIO Channel 1 Transmitter/Receiver ControlSSIO_Baud equ 1fb4h ; SSIO Baud RateSBuf_RX equ 1fb8h ; Receive DataSP_Stat equ 1fb9h ; SIO StateSBuf_TX equ 1fbah ; Transmit DataSP_Con equ 1fbbh ; SIO ControlSP_Baud equ 1fbch ; (w) SIO Baud Ratecase "8096"SBUF equ 7 ; UART Data RegisterSPStat equ 11h ; UART Status RegisterSPCon equ 11h ; UART Control RegisterBaud_Reg equ 0eh ; UART Data Rateendcase;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; Interrupt Controlswitch MOMCPUNAMEcase "80296"INT_MASK equ 08h ; Interrupt MasksINT_MASK1 equ 13hINT_PEND equ 09h ; Interrupts PendingINT_PEND1 equ 12hEXTINT_CON equ 1fcch ; External Interrupts Edge SelectionIN_PROG0 equ 1fc8h ; Interrupt Handling in ProgressIN_PROG1 equ 1fcahINT_CON0 equ 1fe8h ; Priority SettingINT_CON1 equ 1feahINT_CON2 equ 1fechINT_CON3 equ 1feehNMI_PEND equ 1fc9h ; NMI PendingVECT_ADDR equ 1ff0h ; Vekcor Basecase "80196N"INT_MASK equ 08h ; Interrupt MasksINT_MASK1 equ 13hINT_PEND equ 09h ; Interrupts PendingINT_PEND1 equ 12hPTSSRV equ 06h ; (w) PTS Interrupt ServedPTSSEL equ 04h ; (w) Enable PTS Sourcescase "80196"Int_Mask_Lo equ 08h ; Interrupt MasksInt_Mask_Hi equ 13hInt_Pend_Lo equ 09h ; Interrupts PendingInt_Pend_Hi equ 12hPTS_Srv equ 06h ; (w) PTS Interrupt ServedPTS_Select equ 04h ; (w) Enable PTS Sourcescase "8096"INT_Mask equ 8 ; Interrupt MaskINT_Pending equ 9 ; Interrupts Pendingendcase;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; TimerWatchdog equ 0ah ; Reset Watchdogswitch MOMCPUNAMEcase "80296"CON_REG0 equ 1fb6h ; PWM ControlPWM0_CONTROL equ 1fb0h ; PWMn Duty CyclePWM1_CONTROL equ 1fb2hPWM2_CONTROL equ 1fb4hT1CONTROL equ 1f90h ; Timer 1 ControlTIMER1 equ 1f92h ; (w) Timer 1 DataT2CONTROL equ 1f94h ; Timer 2 ControlTIMER22 equ 1f96h ; (w) Timer 2 Datacase "80196N"T1CONTROL equ 1f98h ; Timer 1 ControlTIMER1 equ 1f9ah ; (w) Timer 1 DataT2CONTROL equ 1f9ch ; Timer 2 ControlTIMER22 equ 1f9eh ; (w) Timer 2 Datacase "80196"Timer1_Control equ 1f98h ; Timer 1 ControlTimer1 equ 1f9ah ; (w) Timer 1 DataTimer2_Control equ 1f9ch ; Timer 2 ControlTimer2 equ 1f9eh ; (w) Timer 2 Datacase "8096"Timer1 equ 0ah ; Timer 1 (word-only)Timer2 equ 0ch ; Timer 2 (word-only)PWM_Control equ 17h ; PWM Duty Cycle Settingendcase;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; Portsswitch MOMCPUNAMEcase "80296"P1_DIR equ 1fd2h ; Port 1 Direction RegisterP1_MODE equ 1fd0h ; Port 1 Special Functions vs. IO Port SelectionP1_PIN equ 1fd6h ; Port 1 Pin StatusP1_REG equ 1fd4h ; Port 1 Output DataP2_DIR equ 1fd3h ; the same for remaining portsP2_MODE equ 1fd1hP2_PIN equ 1fd7hP2_REG equ 1fd5hP3_DIR equ 1fdahP3_MODE equ 1fd8hP3_PIN equ 1fdehP3_REG equ 1fdchP4_DIR equ 1fdbhP4_MODE equ 1fd9hP4_PIN equ 1fdfhP4_REG equ 1fddhEP_DIR equ 1fe3hEP_MODE equ 1fe1hEP_PIN equ 1fe7hEP_REG equ 1fe5hcase "80196N"P0_PIN equ 1fdah ; Port 0 DataP1_DIR equ 1fd2h ; Port 1 Direction RegisterP1_MODE equ 1fd0h ; Port 1 Special Functions vs. IO Port SelectionP1_PIN equ 1fd6h ; Port 1 Pin StatusP1_REG equ 1fd4h ; Port 1 Output DataP2_DIR equ 1fcbh ; the same for remaining portsP2_MODE equ 1fc9hP2_PIN equ 1fcfhP2_REG equ 1fcdhP3_PIN equ 1ffehP3_REG equ 1ffchP4_PIN equ 1fffhP4_REG equ 1ffdhP34_DRV equ 1ff4h ; Configure Ports 3/4 as Open Drain or Push-PullP5_DIR equ 1ff3hP5_MODE equ 1ff1hP5_PIN equ 1ff7hP5_REG equ 1ff5hP6_DIR equ 1fd3hP6_MODE equ 1fd1hP6_PIN equ 1fd7hP6_REG equ 1fd5hEP_DIR equ 1fe3hEP_MODE equ 1fe1hEP_PIN equ 1fe7hEP_REG equ 1fe5hcase "80196"P0PIn equ 1fdah ; Port 0 DataP1SSel equ 1fd0h ; Port 1 Special Functions SelectionP1IO equ 1fd2h ; Port 1 Direction RegisterP1Reg equ 1fd4h ; Port 1 Data OutputP1PIn equ 1fd6h ; Port 1 Input StateP2SSel equ 1fc9h ; the same for remaining portsP2IO equ 1fcbhP2Reg equ 1fcdhP2PIn equ 1fcfhP3Reg equ 1ffchP3PIn equ 1ffehP4Reg equ 1ffdhP4PIn equ 1fffhP5SSel equ 1ff1hP5IO equ 1ff3hP5Reg equ 1ff5hP5PIn equ 1ff7hP6SSel equ 1fd1hP6IO equ 1fd3hP6Reg equ 1fd5hP6PIn equ 1fd7hcase "8096"Port0 equ 0eh ; Port 0Port1 equ 0fh ; Port 1Port2 equ 10h ; Port 2Port3 equ 1ffeh ; Port 3 (if no external memory)Port4 equ 1fffh ; Port 4 (if no external memory)IOS0 equ 15h ; I/O Status Register 0IOS1 equ 16h ; I/O Status Register 1IOC0 equ 15h ; I/O Control Register 0IOC1 equ 16h ; I/O Control Register 1endcase;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; Slave Portswitch MOMCPUNAMEcase "80296" ; Suppress Warningcase "80196N"SLP_CMD equ 1ffah ; Command RegisterSLP_CON equ 1ffbhSLP_STAT equ 1ff8hcase "80196" ; Suppress Warningcase "8096"SlpStat equ 1ff8h ; Slave Port StatusSlpCmd equ 1ffah ; Slave Port Command RegisterSlpFunReg equ 1ffbh ; Slave-Port Controlendcase;----------------------------------------------------------------------------; Interrupt Vectorsif MOMCPU>=80196hEPAIntX_Vec equ 2000h ; EPA Channel 4...9/0/1 VectorEPAInt3_Vec equ 2002h ; EPA Channel 3 VectorEPAInt2_Vec equ 2004h ; EPA Channel 2 VectorEPAInt1_Vec equ 2006h ; EPA Channel 1 VectorEPAInt0_Vec equ 2008h ; EPA Channel 0 VectorAD_Complete_Vec equ 200ah ; A/D Conversion Complete VectorOBE_Slp_Vec equ 200ch ; Output Buffer Empty VectorIBF_Slp_Vec equ 200eh ; Input Buffer Full VectorTrap_Vec equ 2010h ; Software Trap VectorIll_Opcode_Vec equ 2012h ; Undefined Opcode VectorCMD_Full_Vec equ 2030h ; Command Buffer Full VectorSSIO0_Trans_Vec equ 2032h ; SSIO0 Transfer Completed VectorSSIO1_Trans_Vec equ 2034h ; SSIO1 Transfer Completed VectorSIO_TrInt_Vec equ 2036h ; SIO Character Transmitted VectorSIO_RcInt_Vec equ 2038h ; SIO Character Received VectorExtInt_Vec equ 203ch ; External Interrupt VectorNMI_Vec equ 203eh ; Non Maskable InterruptelseifTOverInt_Vec equ 2000h ; Timer Overflow VectorADInt_Vec equ 2002h ; AD Conversion Completed VectorHSIDataInt_Vec equ 2004h ; HSI Data Available VectorHSOInt_Vec equ 2006h ; HSO VectorHSI0Int_Vec equ 2008h ; HSI.0 VectorTimeInt_Vec equ 200ah ; Timer VectorSerialInt_Vec equ 200ch ; Serial Interrupt VectorExtInt_Vec equ 200eh ; External Interrupt VectorSoftInt_Vec equ 2010h ; TRAP Interrupt VectorSelf_Jump equ 201ah ; Infinite Loopendif;----------------------------------------------------------------------------; Meory Layout, Reserved Addressesswitch MOMCPUNAMEcase "80296"IRAM equ 1ah ; Beginn Internal RAMIRAMEND equ 1ffh ; Ende Internal RAMCODERAM equ 0f800h ; Beginn Code-RAMCODERAMEND equ 0ffffh ; Ende Code-RAMEXTMEM1 equ 400h ; Beginn External Memory Area 1EXTMEM1END equ 1bffh ; Ende External Memory Area 1EXTMEM2 equ 02000h ; Beginn External Memory Area 2EXTMEM2END equ 0f7ffh ; Ende External Memory Area 2EXTMEM3 equ 0ff0400h ; Beginn External Memory Area 3EXTMEM3END equ 0fff7ffh ; Ende External Memory Area 3CCB0 equ 0ff2018h ; Chip ConfigurationCCB1 equ 0ff201ah ; Extended Chip ConfigurationReset_Location equ 0ff2080h ; RESET Entrycase "80196N"IRAM equ 1ah ; Internal RAM StartIRAMEND equ 3ffh ; Internal RAM EndIROM equ 0ff2000h ; Internal Program ROM StartIROMEND equ 0ff9fffh ; Internal Program ROM EndEXTMEM1 equ 600h ; External Memory Area 1 StartEXTMEM1END equ 1effh ; External Memory Area 1 EndEXTMEM2 equ 0a000h ; External Memory Area 2 StartEXTMEM2END equ 0ffffh ; External Memory Area 2 EndEXTMEM3 equ 0ff0100h ; External Memory Area 3 StartEXTMEM3END equ 0ff03ffh ; External Memory Area 3 EndEXTMEM4 equ 0ff0600h ; External Memory Area 4 StartEXTMEM4END equ 0ff1fffh ; External Memory Area 4 EndEXTMEM5 equ 0ffa000h ; External Memory Area 5 StartEXTMEM5END equ 0ffffffh ; External Memory Area 5 EndCCB0 equ 0ff2018h ; Chip ConfigurationCCB1 equ 0ff201ah ; Extended Chip ConfigurationCCB2 equ 0ff201chSecurity_Key equ 0ff2020h ; KeyReset_Location equ 0ff2080h ; RESET EntryUSFR equ 1ff6h ; ???IRAM_CON equ 1fe0h ; Konfiguration Code-RAMcase "80196"IRAM equ 1ah ; Internal RAM StartIRAMEND equ 1ffh ; Internal RAM EndPDRAM equ IRAM ; Power Down RAM StartPDRAMEND equ 1ffh ; Power Down RAM EndCODERAM equ 400h ; Code RAM Start (NO Windowing!)CODERAMEND equ 4ffh ; Code RAM EndIROM equ 2000h ; Internal Program ROM StartIROMEND equ 3fffh ; Internal Program ROM EndEXTMEM1 equ 500h ; External Memory Area 1 StartEXTMEM1END equ 1effh ; External Memory Area 1 EndEXTMEM2 equ 4000h ; External Memory Area 2 StartEXTMEM2END equ 0ffffh ; External Memory Area 2 EndCCB equ 2018h ; Chip ConfigurationCCB1 equ 201ah ; Extended Chip ConfigurationSecurity_Key equ 2020h ; KeyReset_Location equ 2080h ; RESET EntryUSFR equ 1ff6h ; ???case "8096"IRAM equ 1ah ; Internal RAM StartIRAMEND equ 0ffh ; Internal RAM EndPDRAM equ 0f0h ; Power-Down-RAM StartPDRAMEND equ 0ffh ; Power-Down-RAM EndIROM equ 2000h ; Internal Program ROM StartIROMEND equ 3fffh ; Internal Program ROM EndEXTMEM1 equ 100h ; External Memory Area 1 StartEXTMEM1END equ 1effh ; External Memory Area 1 EndEXTMEM2 equ 4000h ; External Memory Area 2 StartEXTMEM2END equ 0ffffh ; External Memory Area 2 EndCCB equ 2018h ; Chip ConfigurationSecurity_Key equ 2020h ; KeyReset_Location equ 2080h ; RESET EntryendcaseSecurity_Key_End equ Security_Key+15;--------------------------------------------------------------------------; Long Jumps__DefLongJmp macro new,oldnew macro Adr,{NoExpand}old Skipljmp AdrSkip:endmendm__DefLongJmp bc,jnc__DefLongJmp be,jne__DefLongJmp bge,jlt__DefLongJmp bgt,jle__DefLongJmp bh,jnh__DefLongJmp ble,jgt__DefLongJmp blt,jge__DefLongJmp bnc,jc__DefLongJmp bne,je__DefLongJmp bnh,jh__DefLongJmp bnst,jst__DefLongJmp bnv,jv__DefLongJmp bnvt,jvt__DefLongJmp bst,jnst__DefLongJmp bv,jnv__DefLongJmp bvt,jnvt;--------------------------------------------------------------------------restore ; re-enable listingendif ; reg96inc