OSDN Git Service

V309
[fast-forth/master.git] / inc / MSP430FR2355.pat
index 708fb65..4e52a47 100644 (file)
@@ -44,61 +44,89 @@ INFO_LEN=\$0200!
 ! You can check the addresses below by comparing their values in DTCforthMSP430FRxxxx.lst
 ! those addresses are usable with the symbolic assembler
 ! ----------------------------------------------
-! FastForth INFO
+! FastForth INFO addresses
 ! ----------------------------------------------
 FREQ_KHZ=\$1800!        FREQUENCY (in kHz)
 TERMBRW_RST=\$1802!     TERMBRW_RST
 TERMMCTLW_RST=\$1804!   TERMMCTLW_RST
 I2CSLAVEADR=\$1802!     I2C_SLAVE address
-I2CSLAVEADR1=\$1804!    
+I2CSLAVEADR1=\$1804!
 LPM_MODE=\$1806!        LPM_MODE value, LPM0+GIE is the default value
-RSTIV_MEM=\$1808!       SYSRSTIV memory, set to -1 to do Deep RESET
-RST_DP=\$180A!          RST value for DP
-RST_VOC=\$180C!         RST value for VOClink
-VERSION=\$180E!
-THREADS=\$1810!         THREADS
-KERNEL_ADDON=\$1812!
-
-WIPE_INI_=\$1814!       MOV #WIPE_INI,X
-WIPE_COLD=\$1814!       WIPE value for PFA_COLD
-WIPE_INI_FORTH=\$1816!  WIPE value for PFA_INI_FORTH
-WIPE_SLEEP=\$1818!      WIPE value for PFA_SLEEP
-WIPE_WARM=\$181A!       WIPE value for PFA_WARM
-WIPE_TERM_INT=\$181C!   WIPE value for TERMINAL vector
-WIPE_DP=\$182E!         WIPE value for RST_DP   
-WIPE_VOC=\$1820!        WIPE value for RST_VOC
-
-INI_FORTH_INI=\$1822!   MOV #INI_FORTH_INI,X    \ >BODY instruction of default INI_SOFT_APP
-INIT_ACCEPT=\$1822!     WIPE value for PFAACCEPT
-INIT_CR=\$1824!         WIPE value for PFACR
-INIT_EMIT=\$1826!       FORTH value for PFAEMIT
-INIT_KEY=\$1828!        WIPE value for PFAKEY
-INIT_CIB=\$182A!        WIPE value for CIB_ADR
-HALF_FORTH_INI=\$182C!  to preserve the state of DEFERed words, used by user INI_SOFT_APP as:
-!                       ADD #4,0(RSP)           \ skip INI_FORTH >BODY instruction "MOV #INI_FORTH_INI,X"
-!                       MOV #HALF_FORTH_INI,X   \ replace it by "MOV #HALF_FORTH_INI,X"
-!                       MOV @RSP+,PC            \ then RET
-INIT_DOCOL=\$182C!      FORTH value for rDOCOL   (R4) to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL
-INIT_DODOES=\$182E!     FORTH value for rDODOES  (R5)
-INIT_DOCON=\$1830!      FORTH value for rDOCON   (R6)
-INIT_DOVAR=\$1832!      FORTH value for rDOVAR   (R7)
-INIT_CAPS=\$1834!       FORTH value for CAPS
-INIT_BASE=\$1836!       FORTH value for BASE
-!                       free EPROM
-
+USERSTIV=\$1808!        user SYS variable, defines software RESET, DEEP_RST, INIT_HARWARE, etc.
+VERSION=\$180A!
+THREADS=\$180C!         THREADS
+KERNEL_ADDON=\$180E!    BIT15=FLOORED DIVISION
+!                       BIT14=LF_XTAL
+!                       BIT13=UART CTS
+!                       BIT12=UART RTS
+!                       BIT11=UART XON/XOFF
+!                       BIT10=UART half duplex
+!                       BIT9=I2C_TERMINAL
+!                       BIT8=Q15.16 input
+!                       BIT7=DOUBLE input
+!                       BIT6=assembler 20 bits
+!                       BIT5=assembler 16 bits
+!                       BIT4=assembler 16 bits with 20 bits addr
+!                       BIT3=vocabulary set
+!                       BIT2=
+!                       BIT1=
+!                       BIT0=
+!
+DEEP_ORG=\$1810!        MOV #DEEP_ORG,X
+DEEP_TERM_VEC=\$1810!   to DEEP_INIT TERMINAL vector
+DEEP_COLD=\$1812!       to DEEP_INIT COLD_APP
+DEEP_SOFT=\$1814!       to DEEP_INIT SOFT_APP
+DEEP_HARD=\$1816!       to DEEP_INIT HARD_APP
+DEEP_SLEEP=\$1818!      to DEEP_INIT SLEEP_APP
+DEEP_DP=\$181A!         to DEEP_INIT RST_DP
+DEEP_LASTVOC=\$181C!    to DEEP_INIT RST_LASTVOC
+DEEP_CURRENT=\$181E!    to DEEP_INIT RST_CURRENT
+DEEP_CONTEXT=\$1820!    to DEEP_INIT RST_CONTEXT
+!
+PUC_ABORT_ORG=\$1822!   MOV #PUC_ABORT_ORG,X
+INIT_ACCEPT=\$1822!     to INIT PFA_ACCEPT
+INIT_EMIT=\$1824!       to INIT PFA_EMIT
+INIT_KEY=\$1826!        to INIT PFA_KEY
+INIT_CIB=\$1828!        to INIT CIB_ORG
+!
+INIT_DOXXX=\$182C!      MOV #INIT_DOXXX,X       \ te restore DOxxx registers
+FORTH_ORG=\$182A!       MOV #FORTH_ORG,X        \to preserve the state of DEFERed words
+INIT_RSP=\$182A!        to INIT RSP
+!
+INIT_DOCOL=\$182C!      to INIT rDOCOL   (R4) to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL
+INIT_DODOES=\$182E!     to INIT rDODOES  (R5)
+INIT_DOCON=\$1830!      to INIT rDOCON   (R6)
+INIT_DOVAR=\$1832!      to INIT rDOVAR   (R7)
+INIT_CAPS=\$1834!       to INIT CAPS
+INIT_BASE=\$1836!       to INIT BASE
+INIT_LEAVE=\$1838!      to INIT LEAVEPTR
+!
+RST_ORG=\$183A!
+RST_LEN=\$10!
+COLD_APP=\$183A!        COLD_APP
+SOFT_APP=\$183C!        SOFT_APP
+HARD_APP=\$183E!        HARD_APP
+SLEEP_APP=\$1840!       SLEEP_APP
+RST_DP=\$1842!          RST_RET value for (RAM) DDP
+RST_LASTVOC=\$1844!     RST_RET value for (RAM) LASTVOC
+RST_CURRENT=\$1846!     RST_RET value for (RAM) CURRENT
+RST_CONTEXT=\$1848!     RST_RET value for (RAM) CONTEXT (8 CELLS)
+!
+! $185A = free EPROM
+!
 ! ============================================
 ! FRAM TLV
 ! ============================================
-TLV_ORG=\$1A00!     Device Descriptor Info (Tag-Lenght-Value)
+TLV_ORG=\$1A00!         Device Descriptor Info (Tag-Lenght-Value)
 TLV_LEN=\$0032!
 DEVICEID=\$1A04!
-
+!
 ! ============================================
 ! RAM
 ! ============================================
 RAM_ORG=\$2000!
 RAM_LEN=\$1000!
-
+!
 ! ----------------------------------------------
 ! FORTH RAM areas :
 ! ----------------------------------------------
@@ -106,55 +134,51 @@ LSTACK_SIZE=\#16! words
 PSTACK_SIZE=\#48! words
 RSTACK_SIZE=\#48! words
 PAD_LEN=\#84! bytes
-TIB_LEN=\#84! bytes
+CIB_LEN=\#84! bytes
 HOLD_SIZE=\#34! bytes
-
+!
 ! ----------------------------------------------
 ! FastForth RAM memory map (>= 1k):
 ! ----------------------------------------------
-LEAVEPTR=\$2000!    \ Leave-stack pointer, init by QUIT
-LSATCK=\$2000!      \ leave stack,      grow up
-PSTACK=\$2080!      \ parameter stack,  grow down
-RSTACK=\$20E0!      \ Return stack,     grow down
-
-PAD_I2CADR=\$20E0!  \ RX I2C address
-PAD_I2CCNT=\$20E2!  \ count max
-PAD_ORG=\$20E4!     \ user scratch pad buffer, 84 bytes, grow up
-
-TIB_I2CADR=\$2138!  \ TX I2C address
-TIB_I2CCNT=\$213A!  \ count of bytes
-TIB_ORG=\$213C!     \ Terminal input buffer, 84 bytes, grow up
-
-HOLDS_ORG=\$2190!   \ a good address for HOLDS
-HOLD_BASE=\$21B2!   \ BASE HOLD area, grow down
-
-! ----------------------
-! NOT SAVED VARIABLES
-! ----------------------
+LEAVEPTR=\$2000!        Leave-stack pointer, init by QUIT
+LSATCK=\$2000!          leave stack,      grow up
+PSTACK=\$2080!          parameter stack,  grow down
+RSTACK=\$20E0!          Return stack,     grow down
+!
+PAD_I2CADR=\$20E0!      RX I2C address
+PAD_I2CCNT=\$20E2!      count max
+PAD_ORG=\$20E4!         user scratch pad buffer, 84 bytes, grow up
+!
+TIB_I2CADR=\$2138!      TX I2C address
+TIB_I2CCNT=\$213A!      count of bytes
+TIB_ORG=\$213C!         Terminal input buffer, 84 bytes, grow up
+!
+HOLDS_ORG=\$2190!       base address for HOLDS
+HOLD_BASE=\$21B2!       BASE HOLD area, grow down
+!
 HP=\$21B2!              HOLD ptr
-CAPS=\$21B4!            CAPS ON/OFF flag, must be set to -1 before first reset !
-LAST_NFA=\$21B6!
-LAST_THREAD=\$21B8!
-LAST_CFA=\$21BA!
-LAST_PSP=\$21BC!
-
-STATEADR=\$21BE!        Interpreter state
-
-SOURCE_LEN=\$21C0!      len of input stream
-SOURCE_ORG=\$21C2!      adr of input stream
-TOIN=\$21C4!            >IN
-DP=\$21C6!              dictionary ptr
-
-LASTVOC=\$21C8!         keep VOC-LINK
-CONTEXT=\$21CA!         CONTEXT dictionnary space (8 CELLS)
-CURRENT=\$21DA!         CURRENT dictionnary ptr
-
-BASEADR=\$21DC!         numeric base, must be defined before first reset !
-LINE=\$21DE!            line in interpretation, activated with NOECHO, desactivated with ECHO
+LAST_NFA=\$21B4!
+LAST_THREAD=\$21B6!
+LAST_CFA=\$21B8!
+LAST_PSP=\$21BA!
+!
+STATEADR=\$21BC!        Interpreter state
+BASEADR=\$21BE!
+CAPS=\$21C0 !
+!
+SOURCE_LEN=\$21C2!      len of input stream
+SOURCE_ORG=\$21C4!      adr of input stream
+TOIN=\$21C6!            >IN
+DP=\$21C8!              dictionary ptr
+!
+LASTVOC=\$21CA!         keep VOC-LINK
+CURRENT=\$21CC!         CURRENT dictionnary ptr
+CONTEXT=\$21CE!         CONTEXT dictionnary space (8 CELLS)
+!
 ! ---------------------------------------
 !21E0! 28 RAM bytes free
 ! ---------------------------------------
-
+!
 ! ---------------------------------------
 ! SD buffer
 ! ---------------------------------------
@@ -162,7 +186,7 @@ SD_BUF_I2ADR=\$21FC!
 SD_BUF_I2CNT=\$21FE!
 SD_BUF=\$2200!      \ SD_Card buffer
 SD_BUF_END=\$2400!
-
+!
 ! ---------------------------------------
 ! FAT16 FileSystemInfos
 ! ---------------------------------------
@@ -175,7 +199,7 @@ OrgFAT2=\$240C!
 OrgRootDir=\$240E!
 OrgClusters=\$2410!         Sector of Cluster 0
 SecPerClus=\$2412!
-
+!
 ! ---------------------------------------
 ! SD command
 ! ---------------------------------------
@@ -188,7 +212,7 @@ SD_CMD_FRM4=\$2418! HH:CMD  word access
 SD_CMD_FRM5=\$2419! CMD     byte access
 SectorL=\$241A!     2 words
 SectorH=\$241C!
-
+!
 ! ---------------------------------------
 ! BUFFER management
 ! ---------------------------------------
@@ -244,12 +268,12 @@ HDLL_CurClust=14!   Current ClusterLo
 HDLH_CurClust=16!   Current ClusterHi (T as 3Th byte)
 HDLL_CurSize=18!    written size / not yet read size (Long)
 HDLH_CurSize=20!    written size / not yet read size (Long)
-HDLW_BUFofst=22!    BUFFER offset ; used by LOAD" and by WRITE"
-HDLW_PrevLEN=24!    previous LEN
-HDLW_PrevORG=26!    previous ORG
+HDLW_BUFofst=22!    SD BUFFER offset ; used by LOAD" and by WRITE"
+HDLW_PrevLEN=24!    CIB LEN of previous handle
+HDLW_PrevORG=26!    CIB ORG of previous handle
 
 
-!OpenedFirstFile     ; "openedFile" structure 
+!OpenedFirstFile     ; "openedFile" structure
 HandleMax=8!
 HandleLenght=28!
 FirstHandle=\$2438!
@@ -267,50 +291,59 @@ SD_LEN=\$16E!
 ! FRAM MAIN
 ! ============================================
 MAIN_ORG=\$8000!            Code space start
-
+! ----------------------------------------------
 SLEEP=\$8000!               CODE_WITHOUT_RETURN, CPU shutdown
 LIT=\$800A!                 CODE compiled by LITERAL
-XSQUOTE=\$8014!             CODE compiled by S" and S_
-HEREXEC=\$8028!             CODE HERE and BEGIN execute address
-QFBRAN=\$8034!              CODE compiled by IF UNTIL
-BRAN=\$803A!                CODE compiled by ELSE REPEAT AGAIN
-NEXT_ADR=\$803C!            CODE NEXT instruction (MOV @IP+,PC)
-XDO=\$803E!                 CODE compiled by DO
-XPLOOP=\$804E!              CODE compiled by +LOOP
-XLOOP=\$8060!               CODE compiled by LOOP
-MUSMOD=\$8066!              ASM CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD
-MDIV1DIV2=\$8078!           ASM CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/
-MDIV1=\$8080!               ASM CODE input for 48/16 unsigned division, see DOUBLE M*/
-RET_ADR=\$80AA!             ASM CODE of INI_FORTH_PFA and MARKER+8 definitions,
-SETIB=\$80AC!               CODE Set Input Buffer with org & len values, reset >IN pointer
-REFILL=\$80BC!              CODE accept one line from input and leave org len of input buffer
-CIB_ADR=\$80CA!             [CIB_ADR] = TIB_ORG by default; may be redirected to SDIB_ORG
-XDODOES=\$80D4!             to restore rDODOES: MOV #XDODOES,rDODOES
-XDOCON=\$80E2!              to restore rDOCON: MOV #XDOCON,rDOCON
-XDOVAR=\$80EE!              to restore rDOVAR: MOV #XDOVAR,rDOVAR
+XSQUOTE=\$801E!             CODE compiled by S" and S_
+HEREXEC=\$8032!             CODE HERE and BEGIN execute address
+MUSMOD=\$803E!              asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD
+MDIV1DIV2=\$8050!           asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/
+MDIV1=\$8058!               asm CODE input for 48/16 unsigned division, see DOUBLE M*/
+RET_ADR=\$8082!             asm CODE of INIT_SOFT_PFA and MARKER+8 definitions,
+SETIB=\$8084!               CODE Set Input Buffer with org & len values, reset >IN pointer
+REFILL=\$8094!              CODE accept one line from input and leave org len of input buffer
+CIB_ORG=\$80A0!             [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG
+QFBRAN=\$80AC!              CODE compiled by IF UNTIL
+BRAN=\$80B2!                CODE compiled by ELSE REPEAT AGAIN
+NEXT_ADR=\$80B4!            CODE NEXT instruction (MOV @IP+,PC)
+XDODOES=\$80B6!             to restore rDODOES: MOV #XDODOES,rDODOES
+XDOCON=\$80C4!              to restore rDOCON: MOV #XDOCON,rDOCON
+!                           to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR
 !                           to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL
-INI_FORTH=\$80F8!           asm CODE common part of RST and QABORT, starts FORTH engine
-QABORT=\$812A!              CODE_WITHOUT_RETURN run-time part of ABORT"
-ABORT_TERM=\$8136!          CODE_WITHOUT_RETURN, called by QREVEAL and INTERPRET  
+INIT_FORTH=\$80D0!          asm CODE common part of RST and QABORT, starts FORTH engine
+QABORT=\$8108!              CODE_WITHOUT_RETURN run-time part of ABORT"
+ABORT_TERM=\$8112!          CODE_WITHOUT_RETURN, called by QREVEAL and INTERPRET
+!-------------------------------------------------------------------------------
+! UART FASTFORTH
+!-------------------------------------------------------------------------------
+UART_INIT_TERM=\$8154!      asm CODE, content of WARM+2 by default (WARM starts with: CALL #UART_INIT_TERM)
+UART_COLD_TERM=\$817E!      asm CODE, content of COLD+2 by default (COLD starts with: CALL #UART_COLD_TERM)
+UART_INIT_SOFT=\$8184!      asm CODE, content of INIT_FORTH+2 (by default, INIT_FORTH starts with: CALL #RET_ADR)
+UART_WARM=\$8186!           WARM address
+UART_RXON=KEY\+\$8!         asm CODE, content of SLEEP+2 (by default, SLEEP starts with: CALL #UART_RXON)
+UART_RXOFF=ACCEPT\+\$2A!    asm CODE, called by ACCEPT after 'CR' and before 'LF'.
 !-------------------------------------------------------------------------------
-UART_COLD_TERM=\$8194!      ASM CODE, content of COLD+2 by default
-UART_INIT_TERM=\$819C!      ASM CODE, content of WARM+2 by default
-UART_RXON=\$81C6!           ASM CODE, content of SLEEP+2 by default
-UART_RXOFF=\$81C8!          ASM CODE, called by ACCEPT before RX char LF.
+! I2C FASTFORTH
 !-------------------------------------------------------------------------------
-I2C_COLD_TERM=\$81B8!       ASM CODE, content of COLD_PFA by default
-I2C_INIT_TERM=\$818E!       ASM CODE, content of WARM_PFA by default
-I2C_RXON=\$81BA!            ASM CODE, content of SLEEP_PFA by default
-I2C_CTRL_CH=\$81BC!         ASM CODE, used as is: MOV.B #CTRL_CHAR,Y
+I2C_ACCEPT=\$8144!          asm CODE, content of SLEEP+2 by default
+I2C_CTRL_CH=\$8146!         asm CODE, used as is: MOV.B #CTRL_CHAR,Y
 !                                                 CALL #I2C_CTRL_CH
+I2C_COLD_TERM=\$8156!       asm CODE, content of COLD+2, RET address by default
+I2C_INIT_SOFT=\$8156!       asm CODE, content of INIT_FORTH+2, RET address by default
+I2C_INIT_TERM=\$8158!       asm CODE, content of WARM+2 by default
+I2C_WARM=\$8180!            WARM address
 !-------------------------------------------------------------------------------
+NOPUC=SYS\+\$0A!            NOPUC               with FORTH: ' SYS 10 +
+COLD=SYS\+\$16!             COLD address                    ' SYS 22 +
+ABORT=ALLOT\+\$8!           CODE_WITHOUT_RETURN             ' ALLOT 8 +
+QUIT=ALLOT\+\$0E!           CODE_WITHOUT_RETURN             ' ALLOT 14 +
 
 ! ----------------------------------------------
 ! Interrupt Vectors and signatures - MSP430FR2355
 ! ----------------------------------------------
-FRAM_FULL=\$FF30!       80 bytes are sufficient considering what can be compiled in one line and WORD use.
+FRAM_FULL=\$FF40!       64 bytes are sufficient considering what can be compiled in one line and WORD use.
 SIGNATURES=\$FF80!      JTAG/BSL signatures
-JTAG_SIG1=\$FF80!       if 0 (electronic fuse=0) enable JTAG/SBW ! reset by wipe and by S1+<reset>
+JTAG_SIG1=\$FF80!       if 0 (electronic fuse=0) enable JTAG/SBW ! reset by -1 SYS and by S1+<reset>
 JTAG_SIG2=\$FF82!       if JTAG_SIG <> |0xFFFFFFFF, 0x00000000|, SBW and JTAG are locked
 BSL_SIG1=\$FF84!
 BSL_SIG2=\$FF86!
@@ -325,7 +358,7 @@ JTAG_PASSWORD=\$FF88!   256 bits
 BSL_PASSWORD=\$FFE0!    256 bits
 VECT_ORG=\$FFCE!         FFCE-FFFF :  24 vectors + reset
 VECT_LEN=\$32!
-
+! ----------------------------------------------
 P4_VEC=\$FFCE!
 P3_VEC=\$FFD0!
 P2_VEC=\$FFD2!
@@ -333,7 +366,7 @@ P1_VEC=\$FFD4!
 SAC1SAC3_VEC=\$FFD6!
 SAC0SAC2_VEC=\$FFD8!
 ECOMPX_VEC=\$FFDA!
-ADC10_VEC=\$FFDC!
+ADC12_VEC=\$FFDC!
 EUSCI_B1_VEC=\$FFDE!
 EUSCI_B0_VEC=\$FFE0!
 EUSCI_A1_VEC=\$FFE2!
@@ -424,6 +457,7 @@ CSCTL8=\$190!       \ CS control 8
 
 
 FRCTLCTL0=\$1A0!    \ FRAM control 0
+FRCTLCTL0_H=\$1A1!  \ FRAM control 0_H: FRAM password byte = $A5
 GCCTL0=\$1A4!       \ General control 0
 GCCTL1=\$1A6!       \ General control 1
 
@@ -719,16 +753,16 @@ ICCILSR7=\$6C12! \ Interrupt Compare Controller Interrupt Level Setting Register
 
 
 
-ADC10CTL0=\$700!    \ ADC10_B Control register 0
-ADC10CTL1=\$702!    \ ADC10_B Control register 1
-ADC10CTL2=\$704!    \ ADC10_B Control register 2
-ADC10LO=\$706!      \ ADC10_B Window Comparator Low Threshold
-ADC10HI=\$708!      \ ADC10_B Window Comparator High Threshold
-ADC10MCTL0=\$70A!   \ ADC10_B Memory Control Register 0
-ADC10MEM0=\$712!    \ ADC10_B Conversion Memory Register
-ADC10IE=\$71A!      \ ADC10_B Interrupt Enable
-ADC10IFG=\$71C!     \ ADC10_B Interrupt Flags
-ADC10IV=\$71E!      \ ADC10_B Interrupt Vector Word
+ADC12CTL0=\$700!    \ ADC12_B Control register 0
+ADC12CTL1=\$702!    \ ADC12_B Control register 1
+ADC12CTL2=\$704!    \ ADC12_B Control register 2
+ADC12LO=\$706!      \ ADC12_B Window Comparator Low Threshold
+ADC12HI=\$708!      \ ADC12_B Window Comparator High Threshold
+ADC12MCTL0=\$70A!   \ ADC12_B Memory Control Register 0
+ADC12MEM0=\$712!    \ ADC12_B Conversion Memory Register
+ADC12IE=\$71A!      \ ADC12_B Interrupt Enable
+ADC12IFG=\$71C!     \ ADC12_B Interrupt Flags
+ADC12IV=\$71E!      \ ADC12_B Interrupt Vector Word
 
 ADCON=\$10!
 ADCSTART=\$03!