!MSP430FR4133.pat
! ----------------------------------------------
-! MSP430FR5739 MEMORY MAP
+! MSP430FR4133 MEMORY MAP
! ----------------------------------------------
! 0000-0FFF = peripherals (4 KB)
-! 1000-17FF = ROM bootstrap loader BSL0..3 (4x512 B)
-! 1800-187F = info B (FRAM 128 B)
-! 1880-18FF = info A (FRAM 128 B)
-! 1900-19FF = N/A (mirrored into info A/B)
-! 1A00-1A7F = TLV device descriptor info (FRAM 128 B)
-! 1A80-1BFF = unused (385 B)
-! 1C00-1FFF = RAM (1 KB)
-! 2000-C1FF = unused (41472 B)
+! 1000-13FF = ROM bootstrap loader BSL0.1 (2x512 B)
+! 1800-19FF = INFO 512 B
+! 1A00-1A23 = TLV device descriptor info (FRAM 35 B)
+! 2000-27FF = RAM (2 KB)
! C400-FF7F = code memory (FRAM 15232 B)
! FF80-FFFF = interrupt vectors (FRAM 127 B)
! ----------------------------------------------
-! ----------------------------------------------
-! FRAM ! INFO B, TLV
-! ----------------------------------------------
-INFO_ORG=\$1800!
-INFO_LEN=\$0200!
-TLV_ORG=\$1A00! ! Device Descriptor Info (Tag-Lenght-Value)
-TLV_LEN=\$0080! !
-DEVICEID=\$1A04!
-! ----------------------------------------------
-! RAM
-! ----------------------------------------------
-RAM_ORG=\$2000!
-RAM_LEN=\$0800!
-! ----------------------------------------------
-! FRAM
-! ----------------------------------------------
-MAIN_ORG=\$C400! Code space start
-xdodoes=\$C400! restore rDODOES: MOV #xdodoes,rDODOES
-xdocon=\$C40E! restore rDOCON: MOV #xdocon,rDOCON
-xdovar=\$C420! restore rDOVAR: MOV #xdocon,rDOVAR
-xdocol=\$C42A! restore rDOCOL: MOV #xdocol,rDOCOL only for DTC model = 1
-! to find DTC value, download \MSP430-FORTH\FastForthSpecs.4th
-! if DTC = 1, restore rDOCOL as this : MOV #xdocol,rDOCOL
-! if DTC = 2, restore rDOCOL as this : MOV #EXIT,rDOCOL
-! if DTC = 3, nothing to do, R7 is free for use.
-! ----------------------------------------------
-! Interrupt Vectors and signatures - MSP430FR4133
-! ----------------------------------------------
-FRAM_FULL=\$FF30! 80 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; must be reset by wipe.
-JTAG_SIG2=\$FF82! if JTAG_SIG1=\$AAAA, length of password string @ JTAG_PASSWORD
-BSL_SIG1=\$FF84!
-BSL_SIG2=\$FF86!
-JTAG_PASSWORD=\$FF88! 256 bits
-BSL_PASSWORD=\$FFE0! 256 bits
-VECT_ORG=\$FFE2! FFE2-FFFF
-VECT_LEN=\$1E!
-
-
-LCD_Vec=\$FFE2!
-P2_Vec=\$FFE4!
-P1_Vec=\$FFE6!
-ADC10_B_Vec=\$FFE8!
-eUSCI_B0_Vec=\$FFEA!
-eUSCI_A0_Vec=\$FFEC!
-WDT_Vec=\$FFEE!
-RTC_Vec=\$FFF0!
-TA1_x_Vec=\$FFF2!
-TA1_0_Vec=\$FFF4!
-TA0_x_Vec=\$FFF6!
-TA0_0_Vec=\$FFF8!
-U_NMI_Vec=\$FFFA!
-S_NMI_Vec=\$FFFC!
-RST_Vec=\$FFFE!
-
-
-
-
-!MSP430FR2xxx.pat
-
-LPM4=\$F8! SR(LPM4+GIE)
-LPM3=\$D8! SR(LPM3+GIE)
-LPM2=\$98! SR(LPM2+GIE)
-LPM1=\$58! SR(LPM1+GIE)
-LPM0=\$18! SR(LPM0+GIE)
-
! ============================================
-! SR bits :
+! BSL
! ============================================
-\#C=\#1! = SR(0) Carry flag
-\#Z=\#2! = SR(1) Zero flag
-\#N=\#4! = SR(2) Negative flag
-\#GIE=\#8! = SR(3) Enable Int
-\#CPUOFF=\#\$10!= SR(4) CPUOFF
-\#OSCOFF=\#\$20!= SR(5) OSCOFF
-\#SCG0=\#\$40! = SR(6) SCG0
-\#SCG1=\#\$80! = SR(7) SCG1
-\#V=\#\$100! = SR(8) oVerflow flag
-\#UF9=\#\$200! = SR(9) User Flag 1 used by ?NUMBER --> INTERPRET --> LITERAL to process double numbers, else free for use.
-\#UF10=\#\$400! = SR(10) User Flag 2
-\#UF11=\#\$800! = SR(11) User Flag 3
+BSL1=\$1000!
! ============================================
-! PORTx, Reg bits :
+! FRAM INFO
! ============================================
-BIT0=1!
-BIT1=2!
-BIT2=4!
-BIT3=8!
-BIT4=\$10!
-BIT5=\$20!
-BIT6=\$40!
-BIT7=\$80!
-BIT8=\$100!
-BIT9=\$200!
-BIT10=\$400!
-BIT11=\$800!
-BIT12=\$1000!
-BIT13=\$2000!
-BIT14=\$4000!
-BIT15=\$8000!
-
-! ============================================
-! symbolic codes :
-! ============================================
-RET=MOV \@R1+,R0! \ MOV @RSP+,PC
-NOP=MOV \#0,R3! \ one word one cycle
-NOP2=\$3C00 ,! \ compile JMP 0 one word two cycles
-NOP3=MOV R0,R0! \ MOV PC,PC one word three cycles
-NEXT=MOV \@R13+,R0! \ MOV @IP+,PC
-SEMI=MOV \@R1+,R13\nMOV \@R13+,R0!
-
-
-! ===========================================================
-! MSP430FR2xxx and FR4xxx DEVICES HAVE SPECIFIC RAM ADDRESSES
-! ===========================================================
-
+INFO_ORG =\$1800!
+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(DCBA) memory map (256 bytes):
-! ============================================
-
+! ----------------------------------------------
+! FastForth INFO
+! ----------------------------------------------
INI_THREAD=\$1800! .word THREADS
TERMBRW_RST=\$1802! .word TERMBRW_RST
TERMMCTLW_RST=\$1804! .word TERMMCTLW_RST
RXOFF=\$1816!
ReadSectorWX=\$1818! call with W = SectorLO X = SectorHI
WriteSectorWX=\$181A! call with W = SectorLO X = SectorHI
+TERMINAL_INT=\$181C! value for TERMINAL vector
! ============================================
-! FORTH RAM areas :
+! FRAM TLV
! ============================================
+TLV_ORG=\$1A00! ! Device Descriptor Info (Tag-Lenght-Value)
+TLV_LEN=\$0080! !
+DEVICEID=\$1A04!
+! ============================================
+! RAM
+! ============================================
+RAM_ORG=\$2000!
+RAM_LEN=\$0800!
+
+! ---------------------------------------
+! FORTH RAM areas :
+! ---------------------------------------
LSTACK_SIZE=\#16! words
PSTACK_SIZE=\#48! words
RSTACK_SIZE=\#48! words
TIB_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
HOLDS_ORG=\$2190! \ a good address for HOLDS
HOLD_BASE=\$21B2! \ BASE HOLD area, grow down
-! ----------------------
+! ---------------------------------------
! NOT SAVED VARIABLES
-! ----------------------
-
+! ---------------------------------------
HP=\$21B2! HOLD ptr
CAPS=\$21B4! CAPS ON/OFF flag, must be set to -1 before first reset !
LAST_NFA=\$21B6!
LAST_CFA=\$21BA!
LAST_PSP=\$21BC!
-!STATE=\$21BE! Interpreter state
+STATEADR=\$21BE! Interpreter state
SOURCE_LEN=\$21C0! len of input stream
SOURCE_ORG=\$21C2! adr of input stream
CONTEXT=\$21CA! CONTEXT dictionnary space (8 CELLS)
CURRENT=\$21DA! CURRENT dictionnary ptr
-!BASE=\$21DC! numeric base, must be defined before first reset !
+BASEADR=\$21DC! numeric base, must be defined before first reset !
LINE=\$21DE! line in interpretation, activated with NOECHO, desactivated with ECHO
! ---------------------------------------
-!21E0! 16 RAM bytes free conditionnaly
-! ---------------------------------------
-!SAV_CURRENT=\$21E0! preserve CURRENT when create assembler words
-!ASMBW1=\$21E2 assembler backward reference 1
-!ASMBW2=\$21E4 assembler backward reference 2
-!ASMBW3=\$21E6 assembler backward reference 3
-!ASMFW1=\$21E8 assembler forward reference 1
-!ASMFW2=\$21EA assembler forward reference 2
-!ASMFW3=\$21EC assembler forward reference 3
-!RPT_WORD=\$21EE!
-! ---------------------------------------
-!21EE! 12RAM bytes free
+!21E0! 28 RAM bytes free
! ---------------------------------------
! ---------------------------------------
SD_END=\$2570!
SD_LEN=\$16E!
-
! ============================================
-! Special Fonction Registers (SFR)
+! FRAM MAIN
! ============================================
+MAIN_ORG=\$C400! Code space start
+SLEEP=\$C400!
+BODYSLEEP=\$C404!
+LIT=\$C40E!
+NEXT_ADR=\$C416!
+XSQUOTE=\$C418!
+HEREADR=\$C42C!
+QTBRAN=\$C438!
+BRAN=\$C43E!
+QFBRAN=\$C442!
+SKIPBRAN=\$C448!
+XDO=\$C44C!
+XPLOOP=\$C45C!
+XLOOP=\$C46E!
+MUSMOD=\$C474! unsigned 32/16 division
+SETIB=\$C4BA! Set Input Buffer with org len values, reset >IN
+REFILL=\$C4CA! accept one line from input and leave org len of input buffer
+CIB_ADR=\$C4D8! contents currently TIB_ORG; may be redirected to SDIB_ORG
+XDODOES=\$C4E2! restore rDODOES: MOV #XDODOES,rDODOES
+XDOCON=\$C4F0! restore rDOCON: MOV #XDOCON,rDOCON
+XDOCOL=\$C4FC! restore rDOCOL: MOV #XDOCOL,rDOCOL only for DTC model = 1
+! to find DTC value, download \MSP430-FORTH\FastForthSpecs.4th
+! if DTC = 1, restore rDOCOL as this : MOV #xdocol,rDOCOL
+! if DTC = 2, restore rDOCOL as this : MOV #EXIT,rDOCOL
+! if DTC = 3, nothing to do, R7 is free for use.
+! ----------------------------------------------
+! Interrupt Vectors and signatures - MSP430FR4133
+! ----------------------------------------------
+FRAM_FULL=\$FF30! 80 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; must be reset by wipe.
+JTAG_SIG2=\$FF82! if JTAG_SIG1=\$AAAA, length of password string @ JTAG_PASSWORD
+BSL_SIG1=\$FF84!
+BSL_SIG2=\$FF86!
+JTAG_PASSWORD=\$FF88! 256 bits
+BSL_PASSWORD=\$FFE0! 256 bits
+VECT_ORG=\$FFE2! FFE2-FFFF
+VECT_LEN=\$1E!
+
+LCD_VEC=\$FFE2!
+P2_VEC=\$FFE4!
+P1_VEC=\$FFE6!
+ADC10_B_VEC=\$FFE8!
+EUSCI_B0_VEC=\$FFEA!
+EUSCI_A0_VEC=\$FFEC!
+WDT_VEC=\$FFEE!
+RTC_VEC=\$FFF0!
+TA1_X_VEC=\$FFF2!
+TA1_0_VEC=\$FFF4!
+TA0_X_VEC=\$FFF6!
+TA0_0_VEC=\$FFF8!
+U_NMI_VEC=\$FFFA!
+S_NMI_VEC=\$FFFC!
+RST_VEC=\$FFFE!
+
+! ============================================
+! Special Fonction Registers (SFR)
+! ============================================
SFRIE1=\$100! \ SFR enable register
SFRIFG1=\$102! \ SFR flag register