From ba4ffdb34da57d57af07bf87f39f2327923df858 Mon Sep 17 00:00:00 2001 From: jean-michel-thoorens Date: Thu, 10 Nov 2022 20:25:09 +0100 Subject: [PATCH] la der de der --- ADDON/CORE_ANS.asm | 50 +- ADDON/DOUBLE.asm | 284 +---- ADDON/UTILITY.asm | 4 +- MSP430-FORTH/BOOT.f | 6 +- MSP430-FORTH/CHNGBAUD.f | 245 ++-- MSP430-FORTH/CORETEST.4TH | 12 +- MSP430-FORTH/CORE_ANS.f | 51 +- .../CopySourceFileToTarget_SD_Card.bat.lnk | Bin 1197 -> 1703 bytes MSP430-FORTH/DOUBLE.f | 540 ++++---- MSP430-FORTH/FF_SPECS.f | 198 +-- MSP430-FORTH/FixPoint.f | 4 +- MSP430-FORTH/LAST.4TH | 166 +-- MSP430-FORTH/PROG10K.f | 4 +- MSP430-FORTH/PreprocessSourceFile.f.bat.lnk | Bin 0 -> 1613 bytes MSP430-FORTH/RC5toLCD.f | 4 +- MSP430-FORTH/RTC.f | 9 +- MSP430-FORTH/SD_430FR5994/BOOT.4TH | 4 +- MSP430-FORTH/SD_430FR5994/CHNGBAUD.4TH | 269 ++-- MSP430-FORTH/SD_430FR5994/CORDIC.4TH | 8 +- MSP430-FORTH/SD_430FR5994/CORETEST.4TH | 56 +- MSP430-FORTH/SD_430FR5994/CORE_ANS.4TH | 120 +- MSP430-FORTH/SD_430FR5994/DOUBLE.4TH | 532 ++++---- MSP430-FORTH/SD_430FR5994/FF_SPECS.4TH | 166 +-- MSP430-FORTH/SD_430FR5994/FIXPOINT.4TH | 4 +- MSP430-FORTH/SD_430FR5994/MISC/TESTASM.4TH | 36 +- MSP430-FORTH/SD_430FR5994/PROG10k.4TH | 256 ++-- MSP430-FORTH/SD_430FR5994/RC5toLCD.4TH | 32 +- MSP430-FORTH/SD_430FR5994/RTC.4TH | 49 +- MSP430-FORTH/SD_430FR5994/SD_TEST.4TH | 106 +- MSP430-FORTH/SD_430FR5994/SD_TOOLS.4TH | 16 +- MSP430-FORTH/SD_430FR5994/TEST.4TH | 84 +- MSP430-FORTH/SD_430FR5994/TESTXASM.4TH | 14 +- MSP430-FORTH/SD_430FR5994/TSTWORDS.4TH | 34 +- MSP430-FORTH/SD_430FR5994/UARTI2CS.4TH | 81 +- MSP430-FORTH/SD_430FR5994/UTILITY.4TH | 33 +- MSP430-FORTH/SD_TEST.f | 74 +- MSP430-FORTH/SD_TOOLS.f | 6 +- MSP430-FORTH/SendSourceFileToTarget.bat.lnk | Bin 1125 -> 1631 bytes MSP430-FORTH/TEST.f | 4 +- MSP430-FORTH/TESTASM.F | 4 +- MSP430-FORTH/TESTXASM.F | 4 +- MSP430-FORTH/TSTWORDS.f | 4 +- MSP430-FORTH/UARTI2CS.f | 179 ++- MSP430-FORTH/UTILITY.f | 7 +- MSP430-FORTH/test/PID.f | 61 +- MSP430-FORTH/test/PID_2022-09-26-15-38-34.f | 989 ++++++++++++++ MSP430-FORTH/test/SD_LOAD.f | 643 +++++----- MSP430-FORTH/test/SD_LOAD_2022-09-26-15-38-34.f | 1344 ++++++++++++++++++++ MSP430-FORTH/test/UDSLHMOD.f | 2 +- MSP430-FORTH/test/UDSLHMOD_2022-09-26-15-38-34.f | 174 +++ README.md | 108 +- SciTEDirectory.properties | 29 +- binaries/BSL_prog.bat - Raccourci.lnk | Bin 0 -> 1131 bytes binaries/BSL_prog.bat.lnk | Bin 947 -> 0 bytes binaries/CHIPSTICK_FR2433_16MHz_115200.txt | 602 ++++----- binaries/CHIPSTICK_FR2433_16MHz_4MBds.txt | 602 ++++----- binaries/CHIPSTICK_FR2433_16MHz_I2C.txt | 596 ++++----- binaries/CHIPSTICK_FR2433_1MHz_115200.txt | 593 +++++---- binaries/CHIPSTICK_FR2433_8MHz_115200.txt | 600 ++++----- binaries/CHIPSTICK_FR2433_8MHz_I2C.txt | 594 ++++----- binaries/FET_prog.bat - Raccourci.lnk | Bin 947 -> 1131 bytes binaries/LP_MSP430FR2476_16MHz_115200.txt | 602 ++++----- binaries/LP_MSP430FR2476_16MHz_4MBds.txt | 602 ++++----- binaries/LP_MSP430FR2476_16MHz_I2C.txt | 596 ++++----- binaries/LP_MSP430FR2476_1MHz_115200.txt | 593 +++++---- binaries/LP_MSP430FR2476_8MHz_115200.txt | 600 ++++----- binaries/LP_MSP430FR2476_8MHz_I2C.txt | 594 ++++----- binaries/MSP430FRerase_total.bat | 2 - binaries/MSP430erase_total.bat - Raccourci.lnk | Bin 0 -> 1208 bytes binaries/MSP430erase_total.bat.lnk | Bin 1004 -> 0 bytes binaries/MSP430read.bat | 13 - binaries/MSP430read.bat - Raccourci.lnk | Bin 0 -> 1149 bytes binaries/MSP430read.bat.lnk | Bin 965 -> 0 bytes binaries/MSP430readINFO.bat - Raccourci.lnk | Bin 0 -> 1185 bytes binaries/MSP430readMAIN.bat - Raccourci.lnk | Bin 0 -> 1185 bytes binaries/MSP430readRAM.bat - Raccourci.lnk | Bin 0 -> 1172 bytes binaries/MSP430reset.bat | 1 - binaries/MSP430reset.bat - Raccourci.lnk | Bin 0 -> 1154 bytes binaries/MSP430reset.bat.lnk | Bin 970 -> 0 bytes binaries/MSP_EXP430FR2355_16MHz_115200.txt | 600 ++++----- binaries/MSP_EXP430FR2355_16MHz_4MBds.txt | 600 ++++----- binaries/MSP_EXP430FR2355_16MHz_I2C.txt | 595 +++++---- binaries/MSP_EXP430FR2355_1MHz_115200.txt | 593 +++++---- binaries/MSP_EXP430FR2355_24MHz_115200.txt | 600 ++++----- binaries/MSP_EXP430FR2355_24MHz_4MBds.txt | 323 +++++ binaries/MSP_EXP430FR2355_24MHz_6MBds.txt | 600 ++++----- binaries/MSP_EXP430FR2355_24MHz_I2C.txt | 595 +++++---- binaries/MSP_EXP430FR2355_8MHz_115200.txt | 598 ++++----- binaries/MSP_EXP430FR2355_8MHz_I2C.txt | 593 +++++---- binaries/MSP_EXP430FR2433_16MHz_115200.txt | 597 +++++---- binaries/MSP_EXP430FR2433_16MHz_4MBds.txt | 597 +++++---- binaries/MSP_EXP430FR2433_16MHz_I2C.txt | 591 +++++---- binaries/MSP_EXP430FR2433_1MHz_115200.txt | 596 ++++----- binaries/MSP_EXP430FR2433_8MHz_115200.txt | 595 +++++---- binaries/MSP_EXP430FR2433_8MHz_I2C.txt | 589 +++++---- binaries/MSP_EXP430FR4133_16MHz_115200.txt | 625 +++++---- binaries/MSP_EXP430FR4133_16MHz_4MBds.txt | 625 +++++---- binaries/MSP_EXP430FR4133_16MHz_I2C.txt | 618 +++++---- binaries/MSP_EXP430FR4133_1MHz_115200.txt | 623 +++++---- binaries/MSP_EXP430FR4133_8MHz_115200.txt | 623 +++++---- binaries/MSP_EXP430FR4133_8MHz_I2C.txt | 616 +++++---- binaries/MSP_EXP430FR5739_16MHz_115200.txt | 607 +++++---- binaries/MSP_EXP430FR5739_16MHz_4MBds.txt | 607 +++++---- binaries/MSP_EXP430FR5739_16MHz_I2C.txt | 595 +++++---- binaries/MSP_EXP430FR5739_1MHz_115200.txt | 600 ++++----- binaries/MSP_EXP430FR5739_24MHz_115200.txt | 607 +++++---- binaries/MSP_EXP430FR5739_24MHz_4MBds.txt | 323 +++++ binaries/MSP_EXP430FR5739_24MHz_6MBds.txt | 607 +++++---- binaries/MSP_EXP430FR5739_24MHz_I2C.txt | 595 +++++---- binaries/MSP_EXP430FR5739_8MHz_115200.txt | 602 ++++----- binaries/MSP_EXP430FR5739_8MHz_I2C.txt | 596 ++++----- binaries/MSP_EXP430FR5969_16MHz_115200.txt | 604 ++++----- binaries/MSP_EXP430FR5969_16MHz_4MBds.txt | 604 ++++----- binaries/MSP_EXP430FR5969_16MHz_I2C.txt | 600 ++++----- binaries/MSP_EXP430FR5969_1MHz_115200.txt | 595 +++++---- binaries/MSP_EXP430FR5969_8MHz_115200.txt | 597 +++++---- binaries/MSP_EXP430FR5969_8MHz_I2C.txt | 591 +++++---- binaries/MSP_EXP430FR5994_16MHz_115200.txt | 1095 ++++++++-------- binaries/MSP_EXP430FR5994_16MHz_4MBds.txt | 1095 ++++++++-------- binaries/MSP_EXP430FR5994_16MHz_I2C.txt | 1095 ++++++++-------- binaries/MSP_EXP430FR5994_1MHz_115200.txt | 1094 ++++++++-------- binaries/MSP_EXP430FR5994_8MHz_115200.txt | 1091 +++++++--------- binaries/MSP_EXP430FR5994_8MHz_I2C.txt | 1089 +++++++--------- binaries/MSP_EXP430FR6989_16MHz_115200.txt | 603 +++++---- binaries/MSP_EXP430FR6989_16MHz_4MBds.txt | 603 +++++---- binaries/MSP_EXP430FR6989_16MHz_I2C.txt | 607 +++++---- binaries/MSP_EXP430FR6989_1MHz_115200.txt | 602 ++++----- binaries/MSP_EXP430FR6989_8MHz_115200.txt | 604 ++++----- binaries/MSP_EXP430FR6989_8MHz_I2C.txt | 600 ++++----- binaries/prog.bat.lnk | Bin 927 -> 0 bytes config/BSL_prog.bat | 7 +- config/CopySourceFileToTarget_SD_Card.bat | 17 +- config/CopyTo_SD_Card.bat | 37 +- config/FET_prog.bat | 34 +- config/Log/log.txt | 39 + config/MSP430erase_total.bat | 3 +- config/MSP430read.bat | 10 +- config/MSP430readINFO.bat | 12 +- config/MSP430readMAIN.bat | 12 +- config/MSP430readRAM.bat | 12 +- config/MSP430reset.bat | 4 +- config/Preprocess.bat | 15 +- config/PreprocessSourceFile.bat | 11 +- config/SciTEUser.properties | 4 +- config/Select.bat | 22 +- config/SendFile.ttl | 22 +- config/SendSource.bat | 21 +- config/SendSourceFileToTarget.bat | 13 +- config/SendToSD.ttl | 19 +- config/build.bat | 15 +- config/upload_include.ttl | 151 +++ forthMSP430FR.asm | 1150 ++++++----------- forthMSP430FR_ASM.asm | 193 +-- forthMSP430FR_EXTD_ASM.asm | 220 ++-- forthMSP430FR_SD_ACCEPT.asm | 72 +- forthMSP430FR_SD_LOAD.asm | 154 ++- forthMSP430FR_SD_LowLvl.asm | 8 +- forthMSP430FR_SD_RW.asm | 56 +- forthMSP430FR_TERM_HALF.asm | 117 +- forthMSP430FR_TERM_I2C.asm | 147 +-- forthMSP430FR_TERM_UART.asm | 117 +- inc/CHIPSTICK_FR2433.pat | 10 +- inc/FastForthREGtoTI.pat | 6 +- inc/LP_MSP430FR2476.pat | 13 +- inc/MSP430FR2355.pat | 51 +- inc/MSP430FR2433.pat | 196 +-- inc/MSP430FR2476.pat | 196 +-- inc/MSP430FR2633.pat | 200 +-- inc/MSP430FR2xxx.pat | 91 +- inc/MSP430FR4133.pat | 197 +-- inc/MSP430FR5738.inc | 18 +- inc/MSP430FR5738.pat | 31 +- inc/MSP430FR5739.inc | 3 +- inc/MSP430FR5739.pat | 33 +- inc/MSP430FR57xx.pat | 61 +- inc/MSP430FR5948.pat | 201 +-- inc/MSP430FR5969.pat | 193 +-- inc/MSP430FR5972.pat | 196 +-- inc/MSP430FR5994.pat | 213 +--- inc/MSP430FR5xxx.pat | 87 +- inc/MSP430FR6989.pat | 192 +-- inc/MSP430FRxxxx.pat | 149 ++- inc/MSP_EXP430FR2355.asm | 2 +- inc/MSP_EXP430FR2355.pat | 14 +- inc/MSP_EXP430FR2433.pat | 15 +- inc/MSP_EXP430FR4133.pat | 14 +- inc/MSP_EXP430FR5739.asm | 12 +- inc/MSP_EXP430FR5739.pat | 22 +- inc/MSP_EXP430FR5969.asm | 12 +- inc/MSP_EXP430FR5969.pat | 16 +- inc/MSP_EXP430FR5972.asm | 12 +- inc/MSP_EXP430FR5972.pat | 9 +- inc/MSP_EXP430FR5994.asm | 12 +- inc/MSP_EXP430FR5994.pat | 15 +- inc/MSP_EXP430FR6989.asm | 12 +- inc/MSP_EXP430FR6989.pat | 16 +- inc/TERMINALBAUDRATE.inc | 43 +- inc/TargetInit.asm | 56 +- inc/ThingsInFirst.inc | 105 +- 199 files changed, 26374 insertions(+), 25863 deletions(-) create mode 100644 MSP430-FORTH/PreprocessSourceFile.f.bat.lnk create mode 100644 MSP430-FORTH/test/PID_2022-09-26-15-38-34.f create mode 100644 MSP430-FORTH/test/SD_LOAD_2022-09-26-15-38-34.f create mode 100644 MSP430-FORTH/test/UDSLHMOD_2022-09-26-15-38-34.f create mode 100644 binaries/BSL_prog.bat - Raccourci.lnk delete mode 100644 binaries/BSL_prog.bat.lnk delete mode 100644 binaries/MSP430FRerase_total.bat create mode 100644 binaries/MSP430erase_total.bat - Raccourci.lnk delete mode 100644 binaries/MSP430erase_total.bat.lnk delete mode 100644 binaries/MSP430read.bat create mode 100644 binaries/MSP430read.bat - Raccourci.lnk delete mode 100644 binaries/MSP430read.bat.lnk create mode 100644 binaries/MSP430readINFO.bat - Raccourci.lnk create mode 100644 binaries/MSP430readMAIN.bat - Raccourci.lnk create mode 100644 binaries/MSP430readRAM.bat - Raccourci.lnk delete mode 100644 binaries/MSP430reset.bat create mode 100644 binaries/MSP430reset.bat - Raccourci.lnk delete mode 100644 binaries/MSP430reset.bat.lnk create mode 100644 binaries/MSP_EXP430FR2355_24MHz_4MBds.txt create mode 100644 binaries/MSP_EXP430FR5739_24MHz_4MBds.txt delete mode 100644 binaries/prog.bat.lnk create mode 100644 config/Log/log.txt create mode 100644 config/upload_include.ttl diff --git a/ADDON/CORE_ANS.asm b/ADDON/CORE_ANS.asm index 6050fac..5718c54 100644 --- a/ADDON/CORE_ANS.asm +++ b/ADDON/CORE_ANS.asm @@ -360,6 +360,31 @@ MSTAR MOV @PSP,&MPYS MOV @IP+,PC .ELSE + + .IFNDEF UMSTAR + FORTHWORD "UM*" +; T.I. UNSIGNED MULTIPLY SUBROUTINE: U1 x U2 -> Ud +; https://forth-standard.org/standard/core/UMTimes +; UM* u1 u2 -- ud unsigned 16x16->32 mult. +UMSTAR MOV @PSP,S ;2 ud1lo +UMSTAR1 MOV #0,T ;1 ud1hi=0 + MOV #0,X ;1 RESlo=0 + MOV #0,Y ;1 REShi=0 + MOV #1,W ;1 BIT TEST REGISTER +UMSTARLOOP BIT W,TOS ;1 TEST ACTUAL BIT MRlo + JZ UMSTARNEXT ;2 IF 0: DO NOTHING + ADD S,X ;1 IF 1: ADD ud1lo TO RESlo + ADDC T,Y ;1 ADDC ud1hi TO REShi +UMSTARNEXT ADD S,S ;1 (RLA LSBs) ud1lo x 2 + ADDC T,T ;1 (RLC MSBs) ud1hi x 2 + ADD W,W ;1 (RLA) NEXT BIT TO TEST + JNC UMSTARLOOP ;2 IF BIT IN CARRY: FINISHED 10~ loop + MOV X,0(PSP) ;3 low result on stack + MOV Y,TOS ;1 high result in TOS + MOV @IP+,PC ;4 17 words + .ENDIF + + ;https://forth-standard.org/standard/core/MTimes ;C M* n1 n2 -- dlo dhi signed 16*16->32 multiply FORTHWORD "M*" @@ -631,7 +656,7 @@ CFETCH MOV.B @TOS,TOS ;2 ;https://forth-standard.org/standard/core/CStore ; C! char c-addr -- store char in memory FORTHWORD "C!" -CSTORE MOV.B @PSP+,0(TOS) ;4 + MOV.B @PSP+,0(TOS) ;4 ADD #1,PSP ;1 MOV @PSP+,TOS ;2 MOV @IP+,PC @@ -641,7 +666,7 @@ CSTORE MOV.B @PSP+,0(TOS) ;4 ;https://forth-standard.org/standard/core/CComma ; C, char -- append char FORTHWORD "C," -CCOMMA MOV &DP,W + MOV &DP,W MOV.B TOS,0(W) ADD #1,&DP MOV @PSP+,TOS @@ -658,14 +683,14 @@ PLUSSTORE ADD @PSP+,0(TOS) ;https://forth-standard.org/standard/core/ALIGNED ;C ALIGNED addr -- a-addr align given addr FORTHWORD "ALIGNED" -ALIGNED BIT #1,TOS + BIT #1,TOS ADDC #0,TOS MOV @IP+,PC ;https://forth-standard.org/standard/core/ALIGN ;C ALIGN -- align HERE FORTHWORD "ALIGN" -ALIGNN BIT #1,&DP ; 3 + BIT #1,&DP ; 3 ADDC #0,&DP ; 4 MOV @IP+,PC @@ -777,7 +802,7 @@ XDO MOV #8000h,X ;2 compute 8000h-limit = "fudge factor" FORTHWORDIMM "DO" ; immediate ; https://forth-standard.org/standard/core/DO ; DO -- DOadr L: -- 0 -DO SUB #2,PSP ; + SUB #2,PSP ; MOV TOS,0(PSP) ; ADD #2,&DP ; make room to compile xdo MOV &DP,TOS ; -- HERE+2 @@ -897,7 +922,7 @@ CHARR mDOCOL ;https://forth-standard.org/standard/core/BracketCHAR ;C [CHAR] -- compile character literal FORTHWORDIMM "[CHAR]" ; immediate -BRACCHAR mDOCOL + mDOCOL .word CHARR .word lit,lit,COMMA .word COMMA,EXIT @@ -947,12 +972,12 @@ FILL_X MOV @PSP+,TOS ; pop new TOS ;https://forth-standard.org/standard/core/HEX FORTHWORD "HEX" -HEX MOV #16,&BASEADR + MOV #16,&BASEADR MOV @IP+,PC ;https://forth-standard.org/standard/core/DECIMAL FORTHWORD "DECIMAL" -DECIMAL MOV #10,&BASEADR + MOV #10,&BASEADR MOV @IP+,PC ; https://forth-standard.org/standard/core/HERE @@ -963,17 +988,16 @@ DECIMAL MOV #10,&BASEADR ;https://forth-standard.org/standard/core/p ;C ( \ -- paren ; skip input until ) FORTHWORDIMM "\40" ; immediate -PARENT mDOCOL + mDOCOL .word lit,')',WORDD,DROP,EXIT ;https://forth-standard.org/standard/core/Dotp ; .( \ -- dotparen ; type comment immediatly. FORTHWORDIMM ".\40" ; immediate -DOTPAREN MOV #0,&CAPS + MOV #0,T mDOCOL - .word lit,')',WORDD + .word lit,')',WORDD+4 .word COUNT,TYPE - .word BL,LIT,CAPS,STORE .word EXIT ;https://forth-standard.org/standard/core/J @@ -1123,6 +1147,7 @@ PAD CALL rDOCON MOV @RSP+,IP MOV @IP+,PC + .IFNDEF TO ; https://forth-standard.org/standard/core/TO ; TO name Run-time: ( x -- ) ; Assign the value x to named VALUE. @@ -1130,6 +1155,7 @@ PAD CALL rDOCON BIS #UF9,SR MOV @IP+,PC + .ENDIF ; https://forth-standard.org/standard/core/VALUE ; ( x "name" -- ) define a Forth VALUE ; Skip leading space delimiters. Parse name delimited by a space. diff --git a/ADDON/DOUBLE.asm b/ADDON/DOUBLE.asm index a0c5f67..4253928 100644 --- a/ADDON/DOUBLE.asm +++ b/ADDON/DOUBLE.asm @@ -44,69 +44,6 @@ TOR PUSH TOS MOV @IP+,PC .ENDIF - .IFNDEF RFROM1 -; https://forth-standard.org/standard/core/Rfrom -; R> -- x R: x -- pop from return stack - FORTHWORD "R>" -RFROM1 SUB #2,PSP ; 1 - MOV TOS,0(PSP) ; 3 - MOV @RSP+,TOS ; 2 - MOV @IP+,PC ; 4 - - .ENDIF - .IFNDEF ZEROLESS - FORTHWORD "0<" -; https://forth-standard.org/standard/core/Zeroless -; 0< n -- flag true if TOS negative -ZEROLESS ADD TOS,TOS ;1 set carry if TOS negative - SUBC TOS,TOS ;1 TOS=-1 if carry was clear -EQUALTRUE XOR #-1,TOS ;1 TOS=-1 if carry was set - MOV @IP+,PC ; - - .ENDIF - .IFNDEF STOD -; https://forth-standard.org/standard/core/StoD -; S>D n -- d single -> double prec. - FORTHWORD "S>D" -STOD SUB #2,PSP - MOV TOS,0(PSP) - MOV #ZEROLESS,PC - - .ENDIF - .IFNDEF DROP1 -; https://forth-standard.org/standard/core/DROP -; DROP x -- drop top of stack - FORTHWORD "DROP" -DROP1 MOV @PSP+,TOS ; 2 - MOV @IP+,PC ; 4 - - .ENDIF - .IFNDEF QDUP -; https://forth-standard.org/standard/core/DUP -; DUP x -- x x duplicate top of stack - FORTHWORD "DUP" -QDUPNEXT SUB #2,PSP ; 2 push old TOS.. - MOV TOS,0(PSP) ; 3 ..onto stack -QDUPEND MOV @IP+,PC ; 4 - -; https://forth-standard.org/standard/core/qDUP -; ?DUP x -- 0 | x x DUP if nonzero - FORTHWORD "?DUP" -QDUP CMP #0,TOS - JNZ QDUPNEXT - JZ QDUPEND - - .ENDIF - .IFNDEF SWAP -; https://forth-standard.org/standard/core/SWAP -; SWAP x1 x2 -- x2 x1 swap top two items - FORTHWORD "SWAP" -SWAP MOV @PSP,W ; 2 - MOV TOS,0(PSP) ; 3 - MOV W,TOS ; 1 - MOV @IP+,PC ; 4 - - .ENDIF .IFNDEF OVER ;https://forth-standard.org/standard/core/OVER ;C OVER x1 x2 -- x1 x2 x1 @@ -117,14 +54,6 @@ OVER MOV TOS,-2(PSP) ; 3 -- x1 (x2) x2 MOV @IP+,PC ; 4 .ENDIF - .IFNDEF NIP1 - FORTHWORD "NIP" -; https://forth-standard.org/standard/core/NIP -; NIP x1 x2 -- x2 Drop the first item below the top of stack -NIP1 ADD #2,PSP ; 1 - MOV @IP+,PC ; 4 - - .ENDIF .IFNDEF ROT ;https://forth-standard.org/standard/core/ROT ;C ROT x1 x2 x3 -- x2 x3 x1 @@ -136,186 +65,6 @@ ROT MOV @PSP,W ; 2 fetch x2 MOV @IP+,PC ; 4 .ENDIF - .IFNDEF UMSLASHMOD -;https://forth-standard.org/standard/core/UMDivMOD -; UM/MOD udlo|udhi u1 -- r q unsigned 32/16->r16 q16 - FORTHWORD "UM/MOD" -UMSLASHMOD PUSH #DROP ;3 as return address for MU/MOD - MOV #MUSMOD,PC - - .ENDIF - .IFNDEF FLOORED_DIVISION - .IFNDEF SMSLASHREM -;https://forth-standard.org/standard/core/SMDivREM -;C SM/REM d1lo d1hi n2 -- n3 n4 symmetric signed div - FORTHWORD "SM/REM" -SMSLASHREM MOV TOS,S ;1 S=divisor - MOV @PSP,T ;2 T=rem_sign - CMP #0,TOS ;1 n2 >= 0 ? - JGE d1u2SMSLASHREM ;2 yes - XOR #-1,TOS ;1 - ADD #1,TOS ;1 -d1u2SMSLASHREM ; -- d1 u2 - CMP #0,0(PSP) ;3 d1hi >= 0 ? - JGE ud1u2SMSLASHREM ;2 yes - XOR #-1,2(PSP) ;4 d1lo - XOR #-1,0(PSP) ;4 d1hi - ADD #1,2(PSP) ;4 d1lo+1 - ADDC #0,0(PSP) ;4 d1hi+C -ud1u2SMSLASHREM ; -- ud1 u2 - PUSHM #2,S ;4 PUSHM S,T - CALL #MUSMOD - MOV @PSP+,TOS - POPM #2,S ;4 POPM T,S - CMP #0,T ;1 -- ur uq T=rem_sign>=0? - JGE SMSLASHREMnruq ;2 yes - XOR #-1,0(PSP) ;3 - ADD #1,0(PSP) ;3 -SMSLASHREMnruq - XOR S,T ;1 S=divisor T=quot_sign - CMP #0,T ;1 -- nr uq T=quot_sign>=0? - JGE SMSLASHREMnrnq ;2 yes -NEGAT XOR #-1,TOS ;1 - ADD #1,TOS ;1 -SMSLASHREMnrnq ; -- nr nq S=divisor - MOV @IP+,PC ;4 34 words - - .ENDIF - .ELSE ; FLOORED_DIVISION - .IFNDEF FMSLASHMOD -;https://forth-standard.org/standard/core/FMDivMOD -;C FM/MOD d1 n1 -- r q floored signed div'n - FORTHWORD "FM/MOD" -FMSLASHMOD MOV TOS,S ;1 S=divisor - MOV @PSP,T ;2 T=rem_sign - CMP #0,TOS ;1 n2 >= 0 ? - JGE d1u2FMSLASHMOD ;2 yes - XOR #-1,TOS ;1 - ADD #1,TOS ;1 -d1u2FMSLASHMOD ; -- d1 u2 - CMP #0,0(PSP) ;3 d1hi >= 0 ? - JGE ud1u2FMSLASHMOD ;2 yes - XOR #-1,2(PSP) ;4 d1lo - XOR #-1,0(PSP) ;4 d1hi - ADD #1,2(PSP) ;4 d1lo+1 - ADDC #0,0(PSP) ;4 d1hi+C -ud1u2FMSLASHMOD ; -- ud1 u2 - PUSHM #2,S ;4 PUSHM S,T - CALL #MUSMOD - MOV @PSP+,TOS - POPM #2,S ;4 POPM T,S - CMP #0,T ;1 -- ur uq T=rem_sign>=0? - JGE FMSLASHMODnruq ;2 yes - XOR #-1,0(PSP) ;3 - ADD #1,0(PSP) ;3 -FMSLASHMODnruq - XOR S,T ;1 S=divisor T=quot_sign - CMP #0,T ;1 -- nr uq T=quot_sign>=0? - JGE FMSLASHMODnrnq ;2 yes -NEGAT XOR #-1,TOS ;1 - ADD #1,TOS ;1 -FMSLASHMODnrnq ; -- nr nq S=divisor - - CMP #0,0(PSP) ; - JZ FMSLASHMODEND - CMP #1,TOS ; quotient < 1 ? - JGE FMSLASHMODEND ; -QUOTLESSONE ADD S,0(PSP) ; add divisor to remainder - SUB #1,TOS ; decrement quotient -FMSLASHMODEND - MOV @RSP+,IP - MOV @IP+,PC ; - - .ENDIF - .ENDIF - .IFNDEF SLASH -;https://forth-standard.org/standard/core/Div -;C / n1 n2 -- n3 signed divide - FORTHWORD "/" -SLASH mDOCOL - .word TOR,STOD,RFROM - .IFNDEF FLOORED_DIVISION - .word SMSLASHREM - .ELSE - .word FMSLASHMOD - .ENDIF - .word NIP,EXIT - - .ENDIF - .IFNDEF CFETCH -;https://forth-standard.org/standard/core/CFetch -; C@ c-addr -- char fetch char from memory - FORTHWORD "C@" -CFETCH MOV.B @TOS,TOS ;2 - MOV @IP+,PC ;4 - - .ENDIF - .IFNDEF LESS -; https://forth-standard.org/standard/core/OneMinus -; 1- n1/u1 -- n2/u2 subtract 1 from TOS - FORTHWORD "1-" -ONEMINUS1 SUB #1,TOS - MOV @IP+,PC - - .ENDIF - .IFNDEF LESS -;https://forth-standard.org/standard/core/less -;C < n1 n2 -- flag test n1 n1 n2 -- flag test n1>n2, signed - FORTHWORD ">" -MORE SUB @PSP+,TOS ;2 TOS=n2-n1 - JL TOSTRUE ;2 --> +5 -TOSFALSE AND #0,TOS ;1 flag Z = 1 - MOV @IP+,PC ;4 - - .ENDIF - -; .IFNDEF IFF -;; https://forth-standard.org/standard/core/IF -;; IF -- IFadr initialize conditional forward branch -; FORTHWORDIMM "IF" ; immediate -;IFF SUB #2,PSP ; -; MOV TOS,0(PSP) ; -; MOV &DP,TOS ; -- HERE -; ADD #4,&DP ; compile one word, reserve one word -; MOV #QFBRAN,0(TOS) ; -- HERE compile QFBRAN -; ADD #2,TOS ; -- HERE+2=IFadr -; MOV @IP+,PC -; -; FORTHWORDIMM "ELSE" ; immediate -;; https://forth-standard.org/standard/core/ELSE -;; ELSE IFadr -- ELSEadr resolve forward IF branch, leave ELSEadr on stack -;ELSS ADD #4,&DP ; make room to compile two words -; MOV &DP,W ; W=HERE+4 -; MOV #BRAN,-4(W) -; MOV W,0(TOS) ; HERE+4 ==> [IFadr] -; SUB #2,W ; HERE+2 -; MOV W,TOS ; -- ELSEadr -; MOV @IP+,PC -; -; FORTHWORDIMM "THEN" ; immediate -;; https://forth-standard.org/standard/core/THEN -;; THEN IFadr -- resolve forward branch -;THEN MOV &DP,0(TOS) ; -- IFadr -; MOV @PSP+,TOS ; -- -; MOV @IP+,PC -; .ENDIF - - .IFNDEF TO -; https://forth-standard.org/standard/core/TO - FORTHWORD "TO" -TO BIS #UF9,SR - MOV @IP+,PC - - .ENDIF .IFNDEF SPACE ;https://forth-standard.org/standard/core/SPACE ;C SPACE -- output a space @@ -443,11 +192,23 @@ TWORFROM SUB #4,PSP ; DOUBLE word set ; =============================================== .IFNDEF DDOT +; ; https://forth-standard.org/standard/double/Dd +; ; D. dlo dhi -- display d (signed) +; FORTHWORD "D." +; MOV TOS,S ; S will be pushed as sign +; MOV #UDOT+10,PC ; U. + 10 = D. + ; https://forth-standard.org/standard/double/Dd ; D. dlo dhi -- display d (signed) FORTHWORD "D." - MOV TOS,S ; S will be pushed as sign - MOV #UDOT+10,PC ; U. + 10 = D. + MOV TOS,S ;1 S will be pushed as sign by UDOTNEXT + CMP #0,S ;1 + JGE DDOTNEXT ;2 + XOR #-1,0(PSP) ;4 + XOR #-1,TOS ;1 + ADD #1,0(PSP) ;4 + ADDC #0,TOS ;1 +DDOTNEXT MOV #UDOTNEXT,PC ;3 .ENDIF .IFNDEF TwoROT @@ -496,7 +257,7 @@ DZEROLESS ADD #2,PSP ; https://forth-standard.org/standard/double/DEqual FORTHWORD "D=" -DEQUAL ADD #6,PSP ; 2 + ADD #6,PSP ; 2 CMP TOS,-4(PSP) ; 3 ud1H - ud2H MOV #0,TOS ; 1 JNZ DSETFLAG ; 2 @@ -550,7 +311,7 @@ MPLUS SUB #2,PSP .IFNDEF DMinus ; https://forth-standard.org/standard/double/DMinus FORTHWORD "D-" -DMINUS SUB @PSP+,2(PSP) + SUB @PSP+,2(PSP) SUBC TOS,0(PSP) MOV @PSP+,TOS MOV @IP+,PC ; 4 @@ -592,7 +353,7 @@ DTWOTIMES FORTHWORD "D2*" .IFNDEF DMAX ; https://forth-standard.org/standard/double/DMAX FORTHWORD "DMAX" ; -- d1 d2 -DMAX mDOCOL + mDOCOL .word TWOOVER,TWOOVER ; -- d1 d2 d1 d2 .word DLESS,QFBRAN,DMAX1 ; -- d1 d2 .word TWOTOR,TWODROP,TWORFROM ; -- d2 @@ -604,7 +365,7 @@ DMAX2 .word EXIT .IFNDEF DMIN ; https://forth-standard.org/standard/double/DMIN FORTHWORD "DMIN" ; -- d1 d2 -DMIN mDOCOL + mDOCOL .word TWOOVER,TWOOVER ; -- d1 d2 d1 d2 .word DLESS,QFBRAN,DMIN1 ; -- d1 d2 .word TWODROP ; -- d1 @@ -740,6 +501,15 @@ TwoCONSTANT mDOCOL .word EXIT .ENDIF + .IFNDEF TO +; https://forth-standard.org/standard/core/TO +; TO name Run-time: ( x -- ) +; Assign the value x to named VALUE. + FORTHWORD "TO" + BIS #UF9,SR + MOV @IP+,PC + + .ENDIF .IFNDEF TwoVALUE ; https://forth-standard.org/standard/double/TwoVALUE FORTHWORD "2VALUE" ; x1 x2 "name" -- diff --git a/ADDON/UTILITY.asm b/ADDON/UTILITY.asm index f2752a8..14f9b5b 100644 --- a/ADDON/UTILITY.asm +++ b/ADDON/UTILITY.asm @@ -328,8 +328,8 @@ WORDS2 .word LIT,0,DUP .word LIT,0 .word xdo ; DO WORDS3 .word DUP,II,PAD,PLUS,FETCH ; old MAX NFA U< NFA ? - .word ULESS,QFBRAN,WORDS4 ; no - .word TWODROP,II ; yes, replace old MAX of NFA by new MAX of NFA + .word ULESS,QFBRAN,WORDS4 ; no + .word DROP,DROP,II ; yes, replace old MAX of NFA by new MAX of NFA .word DUP,PAD,PLUS,FETCH ; WORDS4 .word LIT,2,xploo,WORDS3 ; 2 +LOOP .word QDUP ; MAX of NFA = 0 ? diff --git a/MSP430-FORTH/BOOT.f b/MSP430-FORTH/BOOT.f index 15c98e9..b2b82e8 100644 --- a/MSP430-FORTH/BOOT.f +++ b/MSP430-FORTH/BOOT.f @@ -116,9 +116,7 @@ BW1 SUB #2,PSP \ 2 push old TOS.. \ https://forth-standard.org/standard/core/EXECUTE \ EXECUTE i*x xt -- j*x execute Forth word at 'xt' CODE EXECUTE - PUSH TOS \ 3 push xt - MOV @PSP+,TOS \ 2 - MOV @RSP+,PC \ 4 xt --> PC + MOV #EXECUTE,PC ENDCODE [THEN] @@ -140,5 +138,5 @@ BW1 SUB #2,PSP \ 2 push old TOS.. RST_RET \ remove definitions above LOAD" SD_TEST.4TH" \ load a file to test the SD_Card driver [ELSE] \ else - ' SYS $0E + EXECUTE \ TOS2WARM address, does same as n SYS (n odd) + TOS2WARM EXECUTE \ TOS2WARM address, does same as n SYS (n odd) [THEN] \ then diff --git a/MSP430-FORTH/CHNGBAUD.f b/MSP430-FORTH/CHNGBAUD.f index a62393c..a84ab41 100644 --- a/MSP430-FORTH/CHNGBAUD.f +++ b/MSP430-FORTH/CHNGBAUD.f @@ -27,10 +27,10 @@ 0<> IF MOV #0,TOS THEN \ if TOS <> 0 (UART TERMINAL), set TOS = 0 MOV TOS,0(PSP) MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON $0D EMIT \ return to column 1 without CR - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" <-- Ouch! unexpected I2C_FastForth target!" RST_RET \ remove ABORT_UARTI2CS definition before resuming ; @@ -337,16 +337,16 @@ BW2 ADD #4,&DP \ make room to compile two words : BAD_MHz $20 DUP EMIT - ABORT" only for 1,4,8,16,24 MHz MCLK!" + ABORT" only for 1, 2, 4, 8, 12, 16, 20, 24 MHz MCLK!" ; - : OVR_BAUDS + : OVER_BDS $20 DUP EMIT ESC [7m \ set reverse video - ." with MCLK = " FREQ_KHZ @ 1000 U/ . - ABORT" MHz? don't dream!" + ." with MCLK = " FREQ_KHZ @ 1000 U/ . + ABORT" MHz ? don't dream!" ; - : CHNGBAUD \ only for 1, 4, 8, 16, 24 MHz + : CHNGBAUD \ only for 1, 4, 8, 12, 16, 20, 24 MHz RST_RET \ removes this created word (garbage collector) ECHO ESC [8;42;80t \ set 42L * 80C terminal display @@ -356,168 +356,217 @@ BW2 ADD #4,&DP \ make room to compile two words FREQ_KHZ @ DUP >R \ r-- target MCLCK frequency in MHz ." target MCLK = " 1000 U/ . ." MHz" CR ." choose your baudrate:" CR - ." 0 --> 6 MBds" CR \ >= 24 MHz - ." 1 --> 5 MBds" CR \ >= 20 MHz - ." 2 --> 4 MBds" CR \ >= 16 MHz - ." 3 --> 3 MBds" CR \ >= 12 MHz - ." 4 --> 1843200 Bds" CR \ >= 8 MHz - ." 5 --> 921600 Bds" CR \ >= 4 MHz - ." 6 --> 460800 Bds" CR \ >= 2 MHz - ." 7 --> 230400 Bds" CR \ >= 1 MHz - ." 8 --> 115200 Bds" CR \ >= 500 kHz - ." 9 --> 38400 Bds" CR - ." A --> 19200 Bds" CR - ." B --> 9600 Bds" CR - ." other --> abort" CR + ." 0 --> 6 MBds" CR \ >= 20 MHz + ." 1 --> 5 MBds" CR \ >= 16 MHz + ." 2 --> 4 MBds" CR \ >= 16 MHz + ." 3 --> 3 MBds" CR \ >= 12 MHz + ." 4 --> 1843200 Bds" CR \ >= 8 MHz + ." 5 --> 921600 Bds" CR \ >= 4 MHz + ." 6 --> 460800 Bds" CR \ >= 2 MHz + ." 7 --> 230400 Bds" CR \ >= 1 MHz + ." 8 --> 115200 Bds" CR \ >= 500 kHz + ." 9 --> 57600 Bds" CR + ." A --> 38400 Bds" CR + ." B --> 19200 Bds" CR + ." C --> 9600 Bds" CR + ." D --> DMX interface (250000 Bds)" CR + ." M --> MIDI interface (31250 Bds)" CR + ." other --> quit" CR ." your choice: " KEY CASE - #48 OF ." 6 MBds" \ add this to the current line + #'0' OF ." 6 MBds" \ add this to the current line R> CASE - #24000 OF $4 $0 \ -- TERM_BRW TERM_MCTLW - ENDOF - 24000 < - IF OVR_BAUDS \ < 24 MHz --> abort + #24000 OF $4 $0 ENDOF \ -- TERM_BRW TERM_MCTLW + #20000 OF $3 $4900 ENDOF + 20000 < + IF OVER_BDS \ < 20 MHz --> abort THEN BAD_MHz \ other MHz --> abort ENDCASE ENDOF - #49 OF ." 5 MBds" + #'1' OF ." 5 MBds" R> CASE - #24000 OF $4 $EE00 ENDOF - #20000 OF $4 $0 ENDOF + #24000 OF $4 $EE00 ENDOF + #20000 OF $4 $0 ENDOF 20000 < - IF OVR_BAUDS \ < 20 MHz --> abort + IF OVER_BDS \ < 16 MHz --> abort THEN BAD_MHz \ other MHz --> abort ENDCASE ENDOF - #50 OF ." 4 MBds" + #'2' OF ." 4 MBds" R> CASE - #24000 OF $6 $0 ENDOF - #20000 OF $5 $0 ENDOF - #16000 OF $4 $0 ENDOF + #24000 OF $6 $0 ENDOF + #20000 OF $5 $0 ENDOF + #16000 OF $4 $0 ENDOF 16000 < - IF OVR_BAUDS \ < 16 MHz --> abort + IF OVER_BDS \ < 16 MHz --> abort THEN BAD_MHz \ other MHz --> abort ENDCASE ENDOF - #51 OF ." 3 MBds" + #'3' OF ." 3 MBds" R> CASE - #24000 OF $8 $0 ENDOF - #20000 OF $6 $D600 ENDOF - #16000 OF $5 $4900 ENDOF - #12000 OF $4 $0 ENDOF + #24000 OF $8 $0 ENDOF + #20000 OF $6 $D600 ENDOF + #16000 OF $5 $4900 ENDOF + #12000 OF $4 $0 ENDOF 12000 < - IF OVR_BAUDS \ < 12 MHz --> abort + IF OVER_BDS \ < 12 MHz --> abort THEN BAD_MHz \ other MHz --> abort ENDCASE ENDOF - #52 OF ." 1843200 Bds" + #'4' OF ." 1843200 Bds" R> CASE - #24000 OF $0D $0200 ENDOF - #20000 OF $0A $DF00 ENDOF - #16000 OF $8 $D600 ENDOF - #12000 OF $6 $AA00 ENDOF - #8000 OF $5 $9200 ENDOF + #24000 OF $0D $0200 ENDOF + #20000 OF $0A $DF00 ENDOF + #16000 OF $8 $D600 ENDOF + #12000 OF $6 $AA00 ENDOF + #8000 OF $5 $9200 ENDOF 8000 < - IF OVR_BAUDS \ < 8 MHz --> abort + IF OVER_BDS \ < 8 MHz --> abort THEN BAD_MHz \ other MHz --> abort ENDCASE ENDOF - #53 OF ." 921600 Bds" + #'5' OF ." 921600 Bds" R> CASE - #24000 OF $1 $00A1 ENDOF - #20000 OF $1 $B751 ENDOF - #16000 OF $11 $4A00 ENDOF - #12000 OF $0D $0200 ENDOF - #8000 OF $8 $D600 ENDOF - #4000 OF $4 $4900 ENDOF + #24000 OF $1 $00A1 ENDOF + #20000 OF $1 $B751 ENDOF + #16000 OF $11 $4A00 ENDOF + #12000 OF $0D $0200 ENDOF + #8000 OF $8 $D600 ENDOF + #4000 OF $4 $4900 ENDOF 4000 < - IF OVR_BAUDS \ < 4 MHz --> abort + IF OVER_BDS \ < 4 MHz --> abort THEN BAD_MHz \ other MHz --> abort ENDCASE ENDOF - #54 OF ." 460800 Bds" + #'6' OF ." 460800 Bds" R> CASE - #24000 OF $3 $0241 ENDOF - #20000 OF $2 $92B1 ENDOF - #16000 OF $2 $BB21 ENDOF - #12000 OF $1 $00A1 ENDOF - #8000 OF $11 $4A00 ENDOF - #4000 OF $8 $D600 ENDOF - #2000 OF $4 $4900 ENDOF + #24000 OF $3 $0241 ENDOF + #20000 OF $2 $92B1 ENDOF + #16000 OF $2 $BB21 ENDOF + #12000 OF $1 $00A1 ENDOF + #8000 OF $11 $4A00 ENDOF + #4000 OF $8 $D600 ENDOF + #2000 OF $4 $4900 ENDOF 2000 < - IF OVR_BAUDS \ < 2 MHz --> abort + IF OVER_BDS \ < 2 MHz --> abort THEN BAD_MHz \ other MHz --> abort ENDCASE ENDOF - #55 OF ." 230400 Bds" + #'7' OF ." 230400 Bds" R> CASE - #24000 OF $6 $2081 ENDOF - #20000 OF $5 $EE61 ENDOF - #16000 OF $4 $5551 ENDOF - #12000 OF $3 $0241 ENDOF - #8000 OF $2 $BB21 ENDOF - #4000 OF $11 $4A00 ENDOF - #2000 OF $8 $D600 ENDOF - #1000 OF $4 $4900 ENDOF - 1000 < - IF OVR_BAUDS \ < 1 MHz --> abort - THEN BAD_MHz \ other MHz --> abort + #24000 OF $6 $2081 ENDOF + #20000 OF $5 $EE61 ENDOF + #16000 OF $4 $5551 ENDOF + #12000 OF $3 $0241 ENDOF + #8000 OF $2 $BB21 ENDOF + #4000 OF $11 $4A00 ENDOF + #2000 OF $8 $D600 ENDOF + #1000 OF $4 $4900 ENDOF + BAD_MHz \ other MHz --> abort ENDCASE ENDOF - #56 OF ." 115200 Bds" + #'8' OF ." 115200 Bds" R> CASE - #24000 OF $0D $4901 ENDOF - #20000 OF $0A $AD01 ENDOF - #16000 OF $8 $F7A1 ENDOF - #12000 OF $6 $2081 ENDOF - #8000 OF $4 $5551 ENDOF - #4000 OF $2 $BB21 ENDOF - #2000 OF $11 $4A00 ENDOF - #1000 OF $8 $D600 ENDOF - #500 OF $4 $4900 ENDOF - 500 < - IF OVR_BAUDS \ < 500 Khz --> abort - THEN BAD_MHz \ other MHz --> abort + #24000 OF $0D $4901 ENDOF + #20000 OF $0A $AD01 ENDOF + #16000 OF $8 $F7A1 ENDOF + #12000 OF $6 $2081 ENDOF + #8000 OF $4 $5551 ENDOF + #4000 OF $2 $BB21 ENDOF + #2000 OF $11 $4A00 ENDOF + #1000 OF $8 $D600 ENDOF + BAD_MHz \ other MHz --> abort + ENDCASE + ENDOF + #'9' OF ." 57600 Bds" + R> CASE + #24000 OF $1A $D601 ENDOF + #20000 OF $15 $00A1 ENDOF + #16000 OF $11 $DD51 ENDOF + #12000 OF $0D $4901 ENDOF + #8000 OF $8 $F7A1 ENDOF + #4000 OF $4 $5551 ENDOF + #2000 OF $2 $BB21 ENDOF + #1000 OF $11 $4A00 ENDOF + BAD_MHz \ other MHz --> abort ENDCASE ENDOF - #57 OF ." 38400 Bds" + #'A' OF ." 38400 Bds" R> CASE #24000 OF $27 $0011 ENDOF + #20000 OF $20 $BF01 ENDOF #16000 OF $1A $D601 ENDOF + #12000 OF $13 $5581 ENDOF #8000 OF $0D $4901 ENDOF - #4000 OF $6 $2081 ENDOF - #1000 OF $1 $00A1 ENDOF + #4000 OF $6 $2081 ENDOF + #2000 OF $3 $0241 ENDOF + #1000 OF $1 $00A1 ENDOF BAD_MHz \ other MHz --> abort ENDCASE ENDOF - #65 OF ." 19200 Bds" + #'B' OF ." 19200 Bds" R> CASE #24000 OF $4E $0021 ENDOF + #20000 OF $41 $D611 ENDOF #16000 OF $34 $4911 ENDOF + #12000 OF $27 $0011 ENDOF #8000 OF $1A $D601 ENDOF #4000 OF $0D $4901 ENDOF - #1000 OF $3 $0241 ENDOF + #2000 OF $6 $2081 ENDOF + #1000 OF $3 $0241 ENDOF BAD_MHz \ other MHz --> abort ENDCASE ENDOF - #66 OF ." 9600 Bds" + #'C' OF ." 9600 Bds" R> CASE #24000 OF $9C $0041 ENDOF + #20000 OF $82 $2531 ENDOF #16000 OF $68 $D621 ENDOF + #12000 OF $4E $0021 ENDOF #8000 OF $34 $4911 ENDOF #4000 OF $1A $D601 ENDOF - #1000 OF $6 $2081 ENDOF + #2000 OF $13 $4901 ENDOF + #1000 OF $6 $2081 ENDOF BAD_MHz \ other MHz --> abort ENDCASE ENDOF - ." abort" ABORT" " \ ABORT" " displays nothing + #'D' OF ." DMX interface (250000 Bds)" + R> CASE + #24000 OF $6 $1 ENDOF + #20000 OF $5 $1 ENDOF + #16000 OF $4 $1 ENDOF + #12000 OF $3 $1 ENDOF + #8000 OF $2 $1 ENDOF + #4000 OF $10 $0 ENDOF + #2000 OF $8 $0 ENDOF + #1000 OF $4 $0 ENDOF + BAD_MHz \ other MHz --> abort + ENDCASE + ENDOF + #'M' OF ." MIDI interface (31250 Bds)" + R> CASE + #24000 OF $30 $1 ENDOF + #20000 OF $28 $1 ENDOF + #16000 OF $20 $1 ENDOF + #12000 OF $18 $1 ENDOF + #8000 OF $10 $1 ENDOF + #4000 OF $8 $1 ENDOF + #2000 OF $4 $1 ENDOF + #1000 OF $2 $1 ENDOF + BAD_MHz \ other MHz --> abort + ENDCASE + ENDOF + ABORT" " \ ABORT" " displays nothing ENDCASE TERMMCTLW_RST ! \ set UCAxMCTLW value in FRAM TERMBRW_RST ! \ set UCAxBRW value in FRAM CR ESC [7m \ escape sequence to set reverse video - ." Change baudrate in Teraterm, save its setup, then reset target." + ." Change baudrate in Teraterm, save its setup, then hit a key." ESC [0m + CR + KEY + 0 SYS ; CHNGBAUD diff --git a/MSP430-FORTH/CORETEST.4TH b/MSP430-FORTH/CORETEST.4TH index 9c940ce..5511f55 100644 --- a/MSP430-FORTH/CORETEST.4TH +++ b/MSP430-FORTH/CORETEST.4TH @@ -1,14 +1,14 @@ -\ ; ------------------------------------- -\ ; CORETEST.4TH for any FastForth target -\ ; ------------------------------------- +; ------------------------------------- +; CORETEST.4TH for any FastForth target +; ------------------------------------- MARKER {CORETEST} : ABORT_TEST \ flag -- $0D EMIT \ return to column 1, no 'LF' - POSTPONE {CORETEST} \ remove all test words ABORT" {CORE_ANS} word set not found !" + POSTPONE {CORETEST} \ remove all test words ; [UNDEFINED] {CORE_ANS} ABORT_TEST @@ -16,7 +16,7 @@ : CORETESTSUCCESS $0D DUP EMIT \ return to column 1, set true flag for ABORT" $0A BASE ! \ set decimal - {CORETEST} \ remove all test words + {CORETEST} \ remove all coretest definitionss ABORT" CORETEST + COREPLUSTEST success!" \ true_flag -- ; @@ -1531,5 +1531,5 @@ T{ MA? MA0 MA? MA1 MA? MA2 -> TRUE TRUE FALSE }T T{ MA0 -> }T T{ MA? MA0 MA? MA1 MA? MA2 -> FALSE FALSE FALSE }T -ECHO +ECHO CORETESTSUCCESS diff --git a/MSP430-FORTH/CORE_ANS.f b/MSP430-FORTH/CORE_ANS.f index 87652d1..00e4878 100644 --- a/MSP430-FORTH/CORE_ANS.f +++ b/MSP430-FORTH/CORE_ANS.f @@ -35,10 +35,10 @@ SUB #2,PSP MOV TOS,0(PSP) MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON 'CR' EMIT \ return to column 1, no 'LF' - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ; ABORT_CORE_ANS @@ -78,7 +78,6 @@ [IF] {CORE_ANS} [THEN] \ if already defined removes it before. [UNDEFINED] {CORE_ANS} [IF] - MARKER {CORE_ANS} [UNDEFINED] ABORT [IF] @@ -749,9 +748,7 @@ BW1 MOV TOS,&OP2 \ Load 2nd operand MOV &RES1,TOS \ high result in TOS MOV @IP+,PC ENDCODE - [THEN] - [UNDEFINED] M* [IF] \ https://forth-standard.org/standard/core/MTimes \ M* n1 n2 -- dlo dhi signed 16*16->32 multiply CODE M* @@ -762,6 +759,32 @@ BW1 MOV TOS,&OP2 \ Load 2nd operand [ELSE] ; MSP430FR413x without hardware_MPY + [UNDEFINED] UM* [IF] +\ T.I. UNSIGNED MULTIPLY SUBROUTINE: U1 x U2 -> Ud +\ https://forth-standard.org/standard/core/UMTimes +\ UM* u1 u2 -- ud unsigned 16x16->32 mult. + CODE UM* + MOV @PSP,S \2 ud1lo + MOV #0,T \1 ud1hi=0 + MOV #0,X \1 RESlo=0 + MOV #0,Y \1 REShi=0 + MOV #1,W \1 BIT TEST REGISTER + BEGIN + BIT W,TOS \1 TEST ACTUAL BIT ud2lo + 0<> IF + ADD S,X \1 ADD ud1lo TO RESlo + ADDC T,Y \1 ADDC ud1hi TO REShi + THEN + ADD S,S \1 (RLA LSBs) ud1lo x 2 + ADDC T,T \1 (RLC MSBs) ud1hi x 2 + ADD W,W \1 (RLA) NEXT BIT TO TEST + U>= UNTIL \2 IF BIT IN CARRY: FINISHED 10~ loop + MOV X,0(PSP) \3 low result on stack + MOV Y,TOS \1 high result in TOS + MOV @IP+,PC \4 17 words + ENDCODE + [THEN] + [UNDEFINED] M* [IF] \ https://forth-standard.org/standard/core/UMTimes \ UM* u1 u2 -- udlo udhi unsigned 16x16->32 mult. @@ -1130,6 +1153,7 @@ BW1 MOV TOS,&OP2 \ Load 2nd operand \ --------------------------- \ BLOCK AND STRING COMPLEMENT \ --------------------------- + [UNDEFINED] CHAR [IF] \ https://forth-standard.org/standard/core/CHAR \ CHAR -- char parse ASCII character @@ -1241,13 +1265,12 @@ BW1 MOV TOS,&OP2 \ Load 2nd operand \ https://forth-standard.org/standard/core/Dotp \ .( -- type comment immediatly. CODE .( ; " - PUSH IP - MOV #0,&CAPS \ CAPS OFF - LO2HI - ')' WORD + MOV #0,T \ CAPS OFF + COLON + ')' + [ ' WORD 16 + , ] \ for volatile CAPS OFF COUNT TYPE HI2LO - MOV #$20,&CAPS \ CAPS ON MOV @RSP+,IP MOV @IP+,PC ENDCODE IMMEDIATE @@ -1266,9 +1289,7 @@ BW1 MOV TOS,&OP2 \ Load 2nd operand \ https://forth-standard.org/standard/core/EXECUTE \ EXECUTE i*x xt -- j*x execute Forth word at 'xt' CODE EXECUTE - PUSH TOS \ 3 push xt - MOV @PSP+,TOS \ 2 - MOV @RSP+,PC \ 4 xt --> PC + MOV #EXECUTE,PC ENDCODE [THEN] @@ -1291,9 +1312,9 @@ BW1 MOV TOS,&OP2 \ Load 2nd operand MOV @X+,W \ 2 W = TOIN PUSHM #4,IP \ 6 PUSHM IP,S,T,W MOV PC,IP \ 1 - ADD #8,IP \ 1 IP = address compiled after ENDCODE + ADD #8,IP \ 1 IP = ENDCODE PC address MOV #INTERPRET,PC \ 3 addr defined in MSP430FRxxxx.pat - NOP \ 1 stuffing instruction + NOP \ 0 stuffing instruction (never executed) ENDCODE \ , \ end_of_EVALUATE_addr -- compile the end_of_EVALUATE_addr diff --git a/MSP430-FORTH/CopySourceFileToTarget_SD_Card.bat.lnk b/MSP430-FORTH/CopySourceFileToTarget_SD_Card.bat.lnk index 9e9e5326aa40034aae161e924f5dcd00d343e0ab..aee5a6dbc57914e4a6e8e42282e82d227064a698 100644 GIT binary patch literal 1703 zcmb_cUr1A76hB+$pRk%ZB_(qd10!8Ctxz*uyZ%Yb4R=>rH|BM_n_HWAZPW6>@Wmjo z9;_gUqCfr#Q>ds+!mwU~2$TZTo`UG55V0OCLg<`(x7@_&LBDa%_kHJ{?|07kJ7?b^ z08prvr~$?#4HefR5j42&c=O18``MJDHOrgO{e4PNbopsK&4UWrF+9l|)LNw)vdy1N z6PmBZZq=QsMA)I%-^hTSOfmP@X>s9%d}&i`&GDvy(JQt%EFnJR7MlU8AqnDO_61Y@ zw%ujjU8F-#**ks_Kw1snZvrEDL4+1?fCWOpqquR8Ft8bpgwK^&kJqTc9}qo4CWEoJL4XF^BK+V3+Rg#QWn>#O#J$ zK;?2-)pZ&$n#}bU)46=z0Rs!r8k4QMj*v%|MSiVGMvg_ywhb93rUMvBfC`M`#hFDL zi@XOgDsf~(F9x+yvN=EpjZ#&p9smORppp#+XI8}q8m4Yh|4#`s5y&dFusWM(;|=x?)#Edjew;r0rw$npV~5VBbq zn~@JVbd7unaxrrqa51cMtHOj9Z(NMX|LR;0xsL8R4x+myHlqe406DvLEX;)8p63zx zW}iE}PiD$TP0#n#c3vxde`%m(K6U)p-t#ABQo2s{C`Wql_5JUA2NIox`0a?7Z!ueD z^rIh*aG|pQ=R|5x(7BaIyMtn7qvW7OH=zbCE4k`+0>-g`Lc#TO+Tq#COjYlkvZ3qd zx50X}uOkNvz71t{`c&@3jRagqim&m|OGxdROnX{Hp235-jw2(bK#fg*3p+HS7O;pK zBu79^toZQ9sJtNN?TbUmeKyRy*UL=IIb1(RRq*>0_A PC?WUr!tjTaWRHwLd%af3 delta 638 zcmZ3^yOwi;jFG`>Hr2u%R~TV*!-J>sZEG(xZf9fw11JUI07+5CiGJesQC2Z<5dCe05Og*Otxi>3Hf!2qxdgS4kSDkh(T5_%SzU;oq9=d>otZ0 m{x>BqR0752Kng%sn*cGUO)<#MnQXx9J~@t!gAJsIfdK#>&X=eF diff --git a/MSP430-FORTH/DOUBLE.f b/MSP430-FORTH/DOUBLE.f index 063f079..485cf67 100644 --- a/MSP430-FORTH/DOUBLE.f +++ b/MSP430-FORTH/DOUBLE.f @@ -37,10 +37,10 @@ 0<> IF MOV #0,TOS THEN \ if TOS <> 0 (DOUBLE input), set TOS = 0 MOV TOS,0(PSP) MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON $0D EMIT \ return to column 1 without CR - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" build FastForth with DOUBLE_INPUT addon!" RST_RET \ if no abort remove this word ; @@ -81,173 +81,6 @@ ENDCODE [THEN] - [UNDEFINED] 0< [IF] -\ https://forth-standard.org/standard/core/Zeroless -\ 0< n -- flag true if TOS negative - CODE 0< - ADD TOS,TOS \ 1 set carry if TOS negative - SUBC TOS,TOS \ 1 TOS=-1 if carry was clear - XOR #-1,TOS \ 1 TOS=-1 if carry was set - MOV @IP+,PC \ - ENDCODE - [THEN] - - [UNDEFINED] DROP [IF] -\ https://forth-standard.org/standard/core/DROP -\ DROP x -- drop top of stack - CODE DROP - MOV @PSP+,TOS \ 2 - MOV @IP+,PC \ 4 - ENDCODE - [THEN] - - [UNDEFINED] DUP [IF] -\ https://forth-standard.org/standard/core/DUP -\ DUP x -- x x duplicate top of stack - CODE DUP -BW1 SUB #2,PSP \ 2 push old TOS.. - MOV TOS,0(PSP) \ 3 ..onto stack - MOV @IP+,PC \ 4 - ENDCODE - - CODE ?DUP -\ https://forth-standard.org/standard/core/qDUP -\ ?DUP x -- 0 | x x DUP if nonzero - CMP #0,TOS \ 2 test for TOS nonzero - 0<> ?GOTO BW1 \ 2 - MOV @IP+,PC \ 4 - ENDCODE - [THEN] - - [UNDEFINED] NIP [IF] -\ https://forth-standard.org/standard/core/NIP -\ NIP x1 x2 -- x2 Drop the first item below the top of stack - CODE NIP - ADD #2,PSP - MOV @IP+,PC - ENDCODE - [THEN] - - [UNDEFINED] UM/MOD [IF] -\ https://forth-standard.org/standard/core/UMDivMOD -\ UM/MOD udlo|udhi u1 -- r q unsigned 32/16->r16 q16 - CODE UM/MOD - PUSH #DROP \ - MOV #MUSMOD,PC \ execute MUSMOD then return to DROP - ENDCODE - [THEN] - - KERNEL_ADDON @ 0< ; test the switch: FLOORED/SYMETRIC DIVISION - [IF] - [UNDEFINED] FM/MOD [IF] -\ https://forth-standard.org/standard/core/FMDivMOD -\ FM/MOD d1 n1 -- r q floored signed div'n - CODE FM/MOD - MOV TOS,S \ S=DIV - MOV @PSP,T \ T=DVDhi - CMP #0,TOS \ n2 >= 0 ? - S< IF \ - XOR #-1,TOS - ADD #1,TOS \ -- d1 u2 - THEN - CMP #0,0(PSP) \ d1hi >= 0 ? - S< IF \ - XOR #-1,2(PSP) \ d1lo - XOR #-1,0(PSP) \ d1hi - ADD #1,2(PSP) \ d1lo+1 - ADDC #0,0(PSP) \ d1hi+C - THEN \ -- uDVDlo uDVDhi uDIVlo - PUSHM #3,IP \ save IP,S,T - LO2HI - UM/MOD \ -- uREMlo uQUOTlo - HI2LO - POPM #3,IP \ restore T,S,IP - CMP #0,T \ T=DVDhi --> REM_sign - S< IF - XOR #-1,0(PSP) - ADD #1,0(PSP) - THEN - XOR S,T \ S=DIV XOR T=DVDhi = Quot_sign - CMP #0,T \ -- n3 u4 T=quot_sign - S< IF - XOR #-1,TOS - ADD #1,TOS - THEN \ -- n3 n4 S=divisor - - CMP #0,0(PSP) \ remainder <> 0 ? - 0<> IF - CMP #1,TOS \ quotient < 1 ? - S< IF - ADD S,0(PSP) \ add divisor to remainder - SUB #1,TOS \ decrement quotient - THEN - THEN - MOV @IP+,PC - ENDCODE - [THEN] - - [ELSE] - [UNDEFINED] SM/REM [IF] -\ https://forth-standard.org/standard/core/SMDivREM -\ SM/REM DVDlo DVDhi DIV -- r3 q4 symmetric signed div - CODE SM/REM - MOV TOS,S \ S=DIV - MOV @PSP,T \ T=DVDhi - CMP #0,TOS \ n2 >= 0 ? - S< IF \ - XOR #-1,TOS - ADD #1,TOS \ -- d1 u2 - THEN - CMP #0,0(PSP) \ d1hi >= 0 ? - S< IF \ - XOR #-1,2(PSP) \ d1lo - XOR #-1,0(PSP) \ d1hi - ADD #1,2(PSP) \ d1lo+1 - ADDC #0,0(PSP) \ d1hi+C - THEN \ -- uDVDlo uDVDhi uDIVlo - PUSHM #3,IP \ save IP,S,T - LO2HI - UM/MOD \ -- uREMlo uQUOTlo - HI2LO - POPM #3,IP \ restore T,S,IP - CMP #0,T \ T=DVDhi --> REM_sign - S< IF - XOR #-1,0(PSP) - ADD #1,0(PSP) - THEN - XOR S,T \ S=DIV XOR T=DVDhi = Quot_sign - CMP #0,T \ -- n3 u4 T=quot_sign - S< IF - XOR #-1,TOS - ADD #1,TOS - THEN \ -- n3 n4 S=divisor - MOV @IP+,PC - ENDCODE - [THEN] - [THEN] - - [UNDEFINED] / [IF] -\ https://forth-standard.org/standard/core/Div -\ / n1 n2 -- n3 signed quotient - : / - >R DUP 0< R> - [ KERNEL_ADDON @ 0< ] - [IF] FM/MOD - [ELSE] SM/REM - [THEN] - NIP - ; - [THEN] - - [UNDEFINED] C@ [IF] -\ https://forth-standard.org/standard/core/CFetch -\ C@ c-addr -- char fetch char from memory - CODE C@ - MOV.B @TOS,TOS - MOV @IP+,PC - ENDCODE - [THEN] - [UNDEFINED] SWAP [IF] \ https://forth-standard.org/standard/core/SWAP \ SWAP x1 x2 -- x2 x1 swap top two items @@ -293,28 +126,6 @@ BW1 SUB #2,PSP \ 2 push old TOS.. ENDCODE [THEN] - [UNDEFINED] < [IF] \ define < and > -\ https://forth-standard.org/standard/core/less -\ < n1 n2 -- flag test n1 IF \ 2 -BW1 MOV #-1,TOS \ 1 flag Z = 0 - THEN - MOV @IP+,PC - ENDCODE - -\ https://forth-standard.org/standard/core/more -\ > n1 n2 -- flag test n1>n2, signed - CODE > - SUB @PSP+,TOS \ 2 TOS=n2-n1 - S< ?GOTO BW1 \ 2 --> +5 -FW1 AND #0,TOS \ 1 flag Z = 1 - MOV @IP+,PC - ENDCODE - [THEN] - [UNDEFINED] IF [IF] \ define IF THEN \ https://forth-standard.org/standard/core/IF \ IF -- IFadr initialize conditional forward branch @@ -359,15 +170,14 @@ FW1 AND #0,TOS \ 1 flag Z = 1 ENDCODE [THEN] - [UNDEFINED] DOES> [IF] -\ https://forth-standard.org/standard/core/DOES -\ DOES> -- set action for the latest CREATEd definition - CODE DOES> - MOV &LAST_CFA,W \ W = CFA of CREATEd word - MOV #DODOES,0(W) \ replace CFA (CALL rDOCON) by new CFA (CALL rDODOES) - MOV IP,2(W) \ replace PFA by the address after DOES> as execution address - MOV @RSP+,IP - MOV @IP+,PC + [UNDEFINED] SPACE [IF] +\ https://forth-standard.org/standard/core/SPACE +\ SPACE -- output a space + CODE SPACE + SUB #2,PSP \ 1 + MOV TOS,0(PSP) \ 3 + MOV #$20,TOS \ 2 + MOV #EMIT,PC \ 17~ 23~ ENDCODE [THEN] @@ -380,15 +190,15 @@ FW1 AND #0,TOS \ 1 flag Z = 1 PUSH IP BEGIN LO2HI - $20 EMIT + SPACE \ 25~ HI2LO - SUB #2,IP - SUB #1,TOS + SUB #2,IP \ 1 + SUB #1,TOS \ 1 0= UNTIL - MOV @RSP+,IP + MOV @RSP+,IP \ THEN - MOV @PSP+,TOS \ -- drop n - MOV @IP+,PC + MOV @PSP+,TOS \ -- drop n + MOV @IP+,PC \ ENDCODE [THEN] @@ -696,85 +506,85 @@ BW1 XOR #-1,0(PSP) [UNDEFINED] M*/ [IF] \ https://forth-standard.org/standard/double/MTimesDiv - RST_SET + RST_SET - CODE TSTBIT \ addr bit_mask -- true/flase flag - MOV @PSP+,X - AND @X,TOS - MOV @IP+,PC - ENDCODE + CODE TSTBIT \ addr bit_mask -- true/flase flag + MOV @PSP+,X + AND @X,TOS + MOV @IP+,PC + ENDCODE - KERNEL_ADDON HMPY TSTBIT \ hardware MPY ? - - RST_RET \ remove TSTBIT definition - - [IF] ; MSP430FRxxxx with hardware_MPY - - CODE M*/ \ d1 * n1 / +n2 -- d2 - MOV 4(PSP),&MPYS32L \ 5 Load 1st operand d1lo - MOV 2(PSP),&MPYS32H \ 5 d1hi - MOV @PSP+,&OP2 \ 4 -- d1 n2 load 2nd operand n1 - MOV TOS,T \ T = DIV - NOP3 - MOV &RES0,S \ 3 S = RESlo - MOV &RES1,TOS \ 3 TOS = RESmi - MOV &RES2,W \ 3 W = REShi - MOV #0,rDOCON \ clear sign flag - CMP #0,W \ negative product ? - S< IF \ compute ABS value if yes - XOR #-1,S - XOR #-1,TOS - XOR #-1,W - ADD #1,S - ADDC #0,TOS - ADDC #0,W - MOV #-1,rDOCON \ set sign flag - THEN + KERNEL_ADDON HMPY TSTBIT \ hardware MPY ? - [ELSE] ; no hardware multiplier + RST_RET \ remove TSTBIT definition - CODE M*/ \ d1lo d1hi n1 +n2 -- d2lo d2hi - MOV #0,rDOCON \ rDOCON = sign - CMP #0,2(PSP) \ d1 < 0 ? - S< IF - XOR #-1,4(PSP) - XOR #-1,2(PSP) - ADD #1,4(PSP) - ADDC #0,2(PSP) - MOV #-1,rDOCON - THEN \ ud1 - CMP #0,0(PSP) \ n1 < 0 ? - S< IF - XOR #-1,0(PSP) - ADD #1,0(PSP) \ u1 - XOR #-1,rDOCON - THEN \ let's process UM* -- ud1lo ud1hi u1 +n2 - MOV 4(PSP),Y \ 3 uMDlo - MOV 2(PSP),T \ 3 uMDhi - MOV @PSP+,S \ 2 uMRlo -- ud1lo ud1hi +n2 - MOV #0,rDODOES \ 1 uMDlo=0 - MOV #0,2(PSP) \ 3 uRESlo=0 - MOV #0,0(PSP) \ 3 uRESmi=0 -- uRESlo uRESmi +n2 - MOV #0,W \ 1 uREShi=0 - MOV #1,X \ 1 BIT TEST REGlo - BEGIN BIT X,S \ 1 test actual bit in uMRlo - 0<> IF ADD Y,2(PSP) \ 3 IF 1: ADD uMDlo TO uRESlo - ADDC T,0(PSP) \ 3 ADDC uMDmi TO uRESmi - ADDC rDODOES,W \ 1 ADDC uMRlo TO uREShi - THEN ADD Y,Y \ 1 (RLA LSBs) uMDlo *2 - ADDC T,T \ 1 (RLC MSBs) uMDhi *2 - ADDC rDODOES,rDODOES \ 1 (RLA LSBs) uMDlo *2 - ADD X,X \ 1 (RLA) NEXT BIT TO TEST - U>= UNTIL \ 1 IF BIT IN CARRY: FINISHED W=uREShi -\ TOS +n2 -\ W REShi -\ 0(PSP) RESmi -\ 2(PSP) RESlo - MOV TOS,T - MOV @PSP,TOS - MOV 2(PSP),S - - [THEN] ; endcase of software/hardware_MPY + [IF] ; MSP430FRxxxx with hardware_MPY + + CODE M*/ \ d1 * n1 / +n2 -- d2 + MOV 4(PSP),&MPYS32L \ 5 Load 1st operand d1lo + MOV 2(PSP),&MPYS32H \ 5 d1hi + MOV @PSP+,&OP2 \ 4 -- d1 n2 load 2nd operand n1 + MOV TOS,T \ T = DIV + NOP3 + MOV &RES0,S \ 3 S = RESlo + MOV &RES1,TOS \ 3 TOS = RESmi + MOV &RES2,W \ 3 W = REShi + MOV #0,rDOCON \ clear sign flag + CMP #0,W \ negative product ? + S< IF \ compute ABS value if yes + XOR #-1,S + XOR #-1,TOS + XOR #-1,W + ADD #1,S + ADDC #0,TOS + ADDC #0,W + MOV #-1,rDOCON \ set sign flag + THEN + + [ELSE] ; no hardware multiplier + + CODE M*/ \ d1lo d1hi n1 +n2 -- d2lo d2hi + MOV #0,rDOCON \ rDOCON = sign + CMP #0,2(PSP) \ d1 < 0 ? + S< IF + XOR #-1,4(PSP) + XOR #-1,2(PSP) + ADD #1,4(PSP) + ADDC #0,2(PSP) + MOV #-1,rDOCON + THEN \ ud1 + CMP #0,0(PSP) \ n1 < 0 ? + S< IF + XOR #-1,0(PSP) + ADD #1,0(PSP) \ u1 + XOR #-1,rDOCON + THEN \ let's process MU* -- ud1lo ud1hi u1 +n2 + MOV 4(PSP),Y \ 3 ud1lo + MOV 2(PSP),T \ 3 ud1mi + MOV #0,rDODOES \ 1 ud1hi=0 + MOV @PSP+,S \ 2 u1 -- ud1lo ud1hi +n2 + MOV #0,2(PSP) \ 3 uRESlo=0 + MOV #0,0(PSP) \ 3 uRESmi=0 -- uRESlo uRESmi +n2 + MOV #0,W \ 1 uREShi=0 + MOV #1,X \ 1 BIT TEST REGlo + BEGIN BIT X,S \ 1 test actual bit in u1 + 0<> IF ADD Y,2(PSP) \ 3 IF 1: ADD ud1lo TO uRESlo + ADDC T,0(PSP) \ 3 ADDC ud1mi TO uRESmi + ADDC rDODOES,W \ 1 ADDC ud1hi TO uREShi + THEN ADD Y,Y \ 1 (RLA LSBs) ud1lo *2 + ADDC T,T \ 1 (RLC MSBs) ud1mi *2 + ADDC rDODOES,rDODOES \ 1 (RLA LSBs) ud1hi *2 + ADD X,X \ 1 (RLA) NEXT BIT TO TEST + U>= UNTIL \ 1 IF BIT IN CARRY: FINISHED W=uREShi +\ TOS +n2 +\ W REShi +\ 0(PSP) RESmi +\ 2(PSP) RESlo + MOV TOS,T + MOV @PSP,TOS + MOV 2(PSP),S + + [THEN] ; endcase of software/hardware_MPY \ process division \ reg input output @@ -818,7 +628,7 @@ BW1 XOR #-1,0(PSP) MOV #XDOCON,rDOCON MOV @IP+,PC \ 52 words ENDCODE - [THEN] + [THEN] \ end of [UNDEFINED] M*/ [UNDEFINED] 2VARIABLE [IF] \ https://forth-standard.org/standard/double/TwoVARIABLE @@ -884,6 +694,44 @@ BW1 XOR #-1,0(PSP) ; Complement to pass DOUBLE TESTS ; ------------------------------- + [UNDEFINED] R> [IF] +\ https://forth-standard.org/standard/core/Rfrom +\ R> -- x R: x -- pop from return stack ; CALL #RFROM performs DOVAR + CODE R> + SUB #2,PSP \ 1 + MOV TOS,0(PSP) \ 3 + MOV @RSP+,TOS \ 2 + MOV @IP+,PC \ 4 + ENDCODE + [THEN] + + [UNDEFINED] C@ [IF] +\ https://forth-standard.org/standard/core/Fetch +\ C@ c-addr -- char fetch char from memory + CODE C@ + MOV.B @TOS,TOS + MOV @IP+,PC + ENDCODE + [THEN] + + [UNDEFINED] DUP [IF] \ define DUP and ?DUP +\ https://forth-standard.org/standard/core/DUP +\ DUP x -- x x duplicate top of stack + CODE DUP +BW1 SUB #2,PSP \ 2 push old TOS.. + MOV TOS,0(PSP) \ 3 ..onto stack + MOV @IP+,PC \ 4 + ENDCODE + +\ https://forth-standard.org/standard/core/qDUP +\ ?DUP x -- 0 | x x DUP if nonzero + CODE ?DUP + CMP #0,TOS \ 2 test for TOS nonzero + 0<> ?GOTO BW1 \ 2 + MOV @IP+,PC \ 4 + ENDCODE + [THEN] + [UNDEFINED] SWAP [IF] \ https://forth-standard.org/standard/core/SWAP \ SWAP x1 x2 -- x2 x1 swap top two items @@ -895,6 +743,15 @@ BW1 XOR #-1,0(PSP) ENDCODE [THEN] + [UNDEFINED] DROP [IF] +\ https://forth-standard.org/standard/core/DROP +\ DROP x -- drop top of stack + CODE DROP + MOV @PSP+,TOS \ 2 + MOV @IP+,PC \ 4 + ENDCODE + [THEN] + [UNDEFINED] VARIABLE [IF] \ https://forth-standard.org/standard/core/VARIABLE \ VARIABLE -- define a Forth VARIABLE @@ -1096,6 +953,17 @@ BW2 ADD #4,&DP \ make room to compile two words ENDCODE [THEN] + [UNDEFINED] 0< [IF] +\ https://forth-standard.org/standard/core/Zeroless +\ 0< n -- flag true if TOS negative + CODE 0< + ADD TOS,TOS \ 1 set carry if TOS negative + SUBC TOS,TOS \ 1 TOS=-1 if carry was clear + XOR #-1,TOS \ 1 TOS=-1 if carry was set + MOV @IP+,PC \ + ENDCODE + [THEN] + [UNDEFINED] SOURCE [IF] \ https://forth-standard.org/standard/core/SOURCE \ SOURCE -- adr u of current input buffer @@ -1298,6 +1166,114 @@ BW2 ADD #4,&DP \ make room to compile two words ; IS CR [THEN] + KERNEL_ADDON @ 0< ; test the switch: FLOORED/SYMETRIC DIVISION + [IF] + [UNDEFINED] FM/MOD [IF] +\ https://forth-standard.org/standard/core/FMDivMOD +\ FM/MOD d1 n1 -- r q floored signed div'n + CODE FM/MOD + MOV TOS,S \ S=DIV + MOV @PSP,T \ T=DVDhi + CMP #0,TOS \ n2 >= 0 ? + S< IF \ + XOR #-1,TOS + ADD #1,TOS \ -- d1 u2 + THEN + CMP #0,0(PSP) \ d1hi >= 0 ? + S< IF \ + XOR #-1,2(PSP) \ d1lo + XOR #-1,0(PSP) \ d1hi + ADD #1,2(PSP) \ d1lo+1 + ADDC #0,0(PSP) \ d1hi+C + THEN \ -- uDVDlo uDVDhi uDIVlo + PUSHM #2,S \ 4 PUSHM S,T + CALL #MUSMOD + MOV @PSP+,TOS + POPM #2,S \ 4 POPM T,S + CMP #0,T \ T=DVDhi --> REM_sign + S< IF + XOR #-1,0(PSP) + ADD #1,0(PSP) + THEN + XOR S,T \ S=DIV XOR T=DVDhi = Quot_sign + CMP #0,T \ -- n3 u4 T=quot_sign + S< IF + XOR #-1,TOS + ADD #1,TOS + THEN \ -- n3 n4 S=divisor + + CMP #0,0(PSP) \ remainder <> 0 ? + 0<> IF + CMP #1,TOS \ quotient < 1 ? + S< IF + ADD S,0(PSP) \ add divisor to remainder + SUB #1,TOS \ decrement quotient + THEN + THEN + MOV @IP+,PC + ENDCODE + [THEN] + [ELSE] + [UNDEFINED] SM/REM [IF] +\ https://forth-standard.org/standard/core/SMDivREM +\ SM/REM DVDlo DVDhi DIV -- r3 q4 symmetric signed div + CODE SM/REM + MOV TOS,S \ S=DIV + MOV @PSP,T \ T=DVDhi + CMP #0,TOS \ n2 >= 0 ? + S< IF \ + XOR #-1,TOS + ADD #1,TOS \ -- d1 u2 + THEN + CMP #0,0(PSP) \ d1hi >= 0 ? + S< IF \ + XOR #-1,2(PSP) \ d1lo + XOR #-1,0(PSP) \ d1hi + ADD #1,2(PSP) \ d1lo+1 + ADDC #0,0(PSP) \ d1hi+C + THEN \ -- uDVDlo uDVDhi uDIVlo + PUSHM #2,S \ 4 PUSHM S,T + CALL #MUSMOD + MOV @PSP+,TOS + POPM #2,S \ 4 POPM T,S + CMP #0,T \ T=DVDhi --> REM_sign + S< IF + XOR #-1,0(PSP) + ADD #1,0(PSP) + THEN + XOR S,T \ S=DIV XOR T=DVDhi = Quot_sign + CMP #0,T \ -- n3 u4 T=quot_sign + S< IF + XOR #-1,TOS + ADD #1,TOS + THEN \ -- n3 n4 S=divisor + MOV @IP+,PC + ENDCODE + [THEN] + [THEN] + + [UNDEFINED] NIP [IF] +\ https://forth-standard.org/standard/core/NIP +\ NIP x1 x2 -- x2 Drop the first item below the top of stack + CODE NIP + ADD #2,PSP + MOV @IP+,PC + ENDCODE + [THEN] + + [UNDEFINED] / [IF] +\ https://forth-standard.org/standard/core/Div +\ / n1 n2 -- n3 signed quotient + : / + >R DUP 0< R> + [ KERNEL_ADDON @ 0< ] \ test the switch: FLOORED / SYMETRIC DIVISION + [IF] FM/MOD + [ELSE] SM/REM + [THEN] + NIP + ; + [THEN] + \ ============================================================================== \ TESTER \ ============================================================================== diff --git a/MSP430-FORTH/FF_SPECS.f b/MSP430-FORTH/FF_SPECS.f index 71f9f6a..1ee8ffa 100644 --- a/MSP430-FORTH/FF_SPECS.f +++ b/MSP430-FORTH/FF_SPECS.f @@ -12,7 +12,7 @@ \ MSP_EXP430FR4133 CHIPSTICK_FR2433 MSP_EXP430FR2433 MSP_EXP430FR2355 \ LP_MSP430FR2476 \ MY_MSP430FR5738_2 -\ JMJ_BOX_2018_10_29 +\ JMJ_BOX_2018_10_29 JMJ_BOX_2022_07_28 \ \ from scite editor : copy your TARGET selection in (shift+F8) parameter 1: \ copy COMPLEMENT if used in (shift+F8) parameter 2: @@ -31,10 +31,10 @@ SUB #2,PSP MOV TOS,0(PSP) MOV &VERSION,TOS \ ARG - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON 'CR' EMIT \ return to column 1, no 'LF' - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" RST_RET \ remove ABORT_FF_SPECS definition before resuming ; @@ -513,14 +513,21 @@ BW2 ADD #4,&DP \ make room to compile two words ; end of definitions we need ; -------------------------- + CODE 2*DUP + SUB #2,PSP + ADD TOS,TOS + MOV TOS,0(PSP) + MOV @IP+,PC + ENDCODE + [UNDEFINED] S? [IF] \ - CODE S? \ to compile: sep S? sep - MOV #S"+10,PC \ (S" + 10) --> PC + CODE S? \ sep --- to compile: sep S? sep + MOV #S"+$0A,PC \ (S" + 10) --> PC ENDCODE IMMEDIATE [THEN] [UNDEFINED] ESC [IF] - CODE ESC + CODE ESC \ we can't use  which is trapped by TERMINAL ! CMP #0,&STATEADR 0= IF MOV @IP+,PC \ interpret time usage disallowed THEN @@ -528,35 +535,39 @@ BW2 ADD #4,&DP \ make room to compile two words 'ESC' \ -- char escape POSTPONE LITERAL \ compile-time code : lit 'ESC' POSTPONE EMIT \ compile-time code : EMIT - 'SP' \ char SPACE as separator for next string + 'SP' \ char SPACE as separator for end of string POSTPONE S? \ compile-time code : S? POSTPONE TYPE \ compile-time code : TYPE ; IMMEDIATE [THEN] [DEFINED] FORTH [IF] \ word-set addon ? - CODE BODY>SQNFA \ BODY -- ADR cnt BODY > SQuoteNFA - SUB #2,PSP - SUB #4,TOS - MOV TOS,Y \ Y = CFA - MOV Y,X \ X = CFA +\ NFA address is always even +\ [NFA] = count_of_string + Immediate_flag +\ NFA + count_of_string_odd = CFA +\ NFA + count_of_string_even + 1 = CFA + CODE BODY>SQNFA \ BODY -- NFA(addr cnt) BODY > SQuoteNFA + SUB #2,PSP \ -- x BODY + SUB #4,TOS \ -- x CFA + MOV TOS,Y \ Y = CFA + MOV Y,X \ X = CFA BEGIN - SUB #2,X - MOV X,0(PSP) \ -- string_test_address CFA - MOV.B @X+,TOS \ -- string_test_address cnt_test - RRA TOS \ -- string_test_address cnt_test/2 - MOV TOS,W - BIT #1,W \ cnt_test even ? + SUB #2,X \ -- X = CFA-2i = NFA ? + MOV X,0(PSP) \ -- CFA-2i x + MOV.B @X+,TOS \ -- CFA-2i cnt_test+Imm + RRA TOS \ -- CFA-2I cnt_test + MOV TOS,W \ + ADD #1,TOS + BIT #1,W \ cnt_test even ? 0= IF - ADD #1,W \ if yes add #1,TOS + ADD #1,W \ if yes add #1 to cnt_test THEN - ADD X,W \ string_test_address + cnt_test - CMP W,Y \ string_test_address + cnt_test = CFA ? - 0<> WHILE \ out of loop if yes - MOV @PSP,X \ loop back to test with X - one_word + ADD X,W \ CFA-2i + aligned_cnt_test + CMP W,Y \ CFA-2i + aligned_cnt_test = CFA ? + 0<> WHILE \ out of loop if yes + MOV @PSP,X \ loop back to test with CFA-2(i+1) REPEAT - MOV X,0(PSP) \ -- string_addr string_cnt of NFA - MOV @IP+,PC + MOV @IP+,PC \ -- addr cnt ENDCODE [THEN] @@ -567,6 +578,7 @@ BW2 ADD #4,&DP \ make room to compile two words ESC [8;42;80t \ set 42L * 80C terminal display \ \ title in reverse video + CR ESC [7m \ Turn reverse video on CR ." FastForth V" VERSION @ @@ -613,21 +625,18 @@ BW2 ADD #4,&DP \ make room to compile two words THEN ." MHz, " \ MCLK - U. ." bytes" \ HERE - MAIN_ORG = number of bytes code, ESC [0m \ Turn off character attributes -\ -\ general CR + +\ +\ FORTH specs ." /COUNTED-STRING = 255" CR ." /HOLD = 34" CR ." /PAD = 84" CR ." ADDRESS-UNIT-BITS = 16" CR - [DEFINED] {CORE_ANS} - [IF] ." FLOORED DIVISION = " - KERNEL_ADDON @ \ negative value if FLOORED DIVISION - 0< IF ." true" - ELSE ." false" - THEN CR - [THEN] + [DEFINED] SM/REM [IF] ." false" [THEN] + [DEFINED] FM/MOD [IF] ." true" [THEN] + CR ." MAX-CHAR = 255" CR ." MAX-N = 32767" CR ." MAX-U = 65535" CR @@ -635,65 +644,84 @@ BW2 ADD #4,&DP \ make room to compile two words ." MAX-UD = 4294967295" CR ." STACK-CELLS = 48" CR ." RETURN-STACK-CELLS= 48" CR - ." Definitions are always UPPERCASE." CR -\ + ." Definitions are forced UPPERCASE" CR +\ ." BACKGROUND, COLD, WARM, ABORT customizable" CR +\ ." automatic garbage collector" CR + \ kernel specs - CR ESC [7m ." Kernel add-ons" ESC [0m CR \ subtitle in reverse video + CR ESC [7m ." KERNEL add-ons" ESC [0m CR \ subtitle in reverse video KERNEL_ADDON @ - 2* DUP 0< IF ." 32.768kHz LF XTAL" CR THEN \ BIT14 - 2* DUP 0< IF ." /RTS /CTS " 2* \ BIT13 - ELSE 2* DUP \ /BIT13 - 0< IF ." /RTS " THEN \ /BIT13 & BIT12 - THEN - 2* DUP 0< IF ." XON/XOFF " THEN \ BIT11 - 2* DUP 0< IF ." Half-Duplex " THEN \ BIT10 - 2* DUP 0< IF ." I2C_Master TERMINAL" \ BIT9 - ELSE ." UART TERMINAL" THEN CR \ /BIT9 - 2* DUP 0< IF 2* DUP 0< IF ." DOUBLE and " \ BIT8 + BIT7 - THEN ." Q15.16 numbers handling" CR - ELSE 2* DUP 0< IF ." DOUBLE numbers handling" CR \ /BIT8 + BIT7 - THEN + 2*DUP 0< IF ." 32.768kHz LF XTAL" CR THEN \ BIT14 + 2*DUP 0< IF ." /CTS " THEN \ BIT13 + 2*DUP 0< IF ." /RTS " THEN \ BIT12 + 2*DUP 0< IF ." XON/XOFF " THEN \ BIT11 + 2*DUP 0< IF ." Half-Duplex " THEN \ BIT10 + 2*DUP 0< IF ." I2C_Master TERMINAL" \ BIT9 + ELSE ." UART TERMINAL" \ /BIT9 + THEN CR + 2*DUP 0< IF 2*DUP + 0< IF ." DOUBLE and " \ BIT8 + BIT7 + THEN ." Q15.16 numbers handling" CR + ELSE 2*DUP + 0< IF ." DOUBLE numbers handling" CR \ /BIT8 + BIT7 + THEN THEN - 2* DUP 0< IF ." MSP430_X assembler with TI's syntax" - CR 2* 2* \ BIT6 BIT5 BIT4 - ELSE \ /BIT6 - 2* DUP - 0< IF ." MSP430 Assembler" \ BIT5 - 2* DUP - 0< IF ." , 20bits extended addresses," \ BIT4 - THEN - ELSE 2* \ BIT4 + 2*DUP 0< IF ." MSP430 16/20bits" \ BIT6 BIT5 + ELSE 2*DUP ." MSP430 16bits" \ /BIT6 + 0< IF ." (20bits addr)" \ BIT5 THEN - ." with TI's syntax" CR - THEN DROP \ BIT2 to BIT0 are free + THEN ." assembler, with TI's syntax" CR + DROP [DEFINED] FORTH [IF] ." word-set management" CR [THEN] - [DEFINED] LOAD" [IF] ." SD_CARD Load" CR + [DEFINED] LOAD" [IF] ." SD_CARD Load + Bootloader" CR [THEN] - [DEFINED] BOOT [IF] ." SD_CARD Bootloader" CR + [DEFINED] READ" [IF] ." SD_CARD Read/Write/Del/CopyTERM2SD" CR [THEN] - [DEFINED] READ" [IF] ." SD_CARD Read/Write" CR + +\ extensions + CR ESC [7m ." EXTENSIONS" ESC [0m \ subtitle in reverse video + [DEFINED] {CORE_ANS} [IF] CR ." CORE ANS94 'CORETEST passed'" [THEN] -\ + [DEFINED] {DOUBLE} [IF] CR ." DOUBLE numbers set" + [THEN] + [DEFINED] {UTILITY} [IF] CR ." UTILITY" + [THEN] + [DEFINED] {FIXPOINT} [IF] CR ." Q15.16 ADD SUB MUL DIV" + [THEN] + [DEFINED] {CORDIC} [IF] CR ." CORDIC engine" + [THEN] + [DEFINED] {SD_TOOLS} [IF] CR ." SD_TOOLS" + [THEN] + [DEFINED] {RTC} [IF] CR ." RTC utility" + [THEN] + [DEFINED] {UARTI2CS} [IF] CR ." UART to I2C_FastForth bridge" + [THEN] + CR + \ display word-sets +\ ------------------------------------\ LASTVOC \ -- VOCLINK addr. BEGIN @ ?DUP \ -- VOCLINK word-set here ? WHILE \ -- VLK \ --------------------------------\ - CR ESC [7m \ word-set TITLE in reverse video + ESC [7m \ word-set TITLE in reverse video DUP THREADS @ 2* - \ -- VLK WORDSET_BODY [DEFINED] FORTH \ word-set addon ? - [IF] DUP BODY>SQNFA \ -- VLK WRDST_BODY addr cnt + [IF] DUP BODY>SQNFA \ -- VLK WRDST_BODY addr cnt [ELSE] OVER @ \ -- VLK WRDST_BODY NEXT_VLINK IF S" hidden" \ if next_vlink <>0 ELSE S" FORTH" \ if next_vlink = 0 THEN \ -- VLK WRDST_BODY addr cnt - [THEN] - TYPE ." word-set" \ -- VLK WRDST_BODY + [THEN] TYPE \ type word-set name + ." word-set" \ -- VLK WRDST_BODY ESC [0m CR -\ --------------------------------\ block of DEFINITIONS -\ : WORDS \ VOC_BODY -- customized WORD definition +\ --------------------------------\ +\ : WORDS \ -- +\ --------------------------------\ +\ CR \ +\ CONTEXT @ \ -- VOC_BODY PAD_ORG \ -- VOC_BODY PAD MOVE all threads from VOC_BODY to PAD_ORG THREADS @ 2* \ -- VOC_BODY PAD THREADS*2 MOVE \ -- vocabulary entries are copied in PAD_ORG @@ -703,8 +731,8 @@ BW2 ADD #4,&DP \ make room to compile two words DO \ -- ptr MAX I = PAD_ptr = thread*2 DUP I PAD_ORG + @ \ -- ptr MAX MAX NFAx U< IF \ -- ptr MAX if MAX U< NFAx - DROP DROP \ -- drop ptr and MAX - I DUP PAD_ORG + @ \ -- new_ptr new_MAX + DROP DROP I \ -- drop ptr and MAX + DUP PAD_ORG + @ \ -- new_ptr new_MAX THEN \ 2 +LOOP \ -- ptr MAX ?DUP \ -- ptr MAX MAX | -- ptr 0 (all threads in PAD = 0) @@ -723,28 +751,8 @@ BW2 ADD #4,&DP \ make room to compile two words \ --------------------------------\ CR \ -- VLINK definitions display REPEAT - DROP -\ -\ extensions - CR ESC [7m ." EXTENSIONS" ESC [0m \ subtitle in reverse video - [DEFINED] {CORE_ANS} [IF] CR ." CORE ANS94" - [THEN] - [DEFINED] {DOUBLE} [IF] CR ." DOUBLE numbers set" - [THEN] - [DEFINED] {UTILITY} [IF] CR ." UTILITY" - [THEN] - [DEFINED] {FIXPOINT} [IF] CR ." Q15.16 ADD SUB MUL DIV" - [THEN] - [DEFINED] {CORDIC} [IF] CR ." CORDIC engine" - [THEN] - [DEFINED] {SD_TOOLS} [IF] CR ." SD_TOOLS" - [THEN] - [DEFINED] {RTC} [IF] CR ." RTC utility" - [THEN] - [DEFINED] {UARTI2CS} [IF] CR ." UART to I2C_FastForth bridge" - [THEN] - CR - SYS \ WARM +\ ------------------------------------\ -- + SYS \ [0] SYS = WARM ; SPECS \ performs RST_RET and displays FastForth specs diff --git a/MSP430-FORTH/FixPoint.f b/MSP430-FORTH/FixPoint.f index d823d58..2f12387 100644 --- a/MSP430-FORTH/FixPoint.f +++ b/MSP430-FORTH/FixPoint.f @@ -49,10 +49,10 @@ 0<> IF MOV #0,TOS THEN \ if TOS <> 0 (FIXPOINT input), set TOS = 0 MOV TOS,0(PSP) MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON $0D EMIT \ return to column 1 without CR - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" build FastForth with Q15.16_INPUT addon !" RST_RET \ if no abort remove this word $1B EMIT $63 EMIT \ send 'ESC c' (clear screen) diff --git a/MSP430-FORTH/LAST.4TH b/MSP430-FORTH/LAST.4TH index 41fdd8e..1dbf445 100644 --- a/MSP430-FORTH/LAST.4TH +++ b/MSP430-FORTH/LAST.4TH @@ -7,10 +7,10 @@ SUB #2,R15 MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" RST_RET ; @@ -129,15 +129,15 @@ FW1 AND #0,R14 CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -145,9 +145,9 @@ FW1 AND #0,R14 [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -162,9 +162,9 @@ FW1 AND #0,R14 ENDCODE IMMEDIATE CODE UNTIL - MOV #$4096,R9 -BW1 ADD #4,&$1DC0 - MOV &$1DC0,R10 + MOV #[THEN]+$52,R9 +BW1 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) MOV @R15+,R14 @@ -172,7 +172,7 @@ BW1 ADD #4,&$1DC0 ENDCODE IMMEDIATE CODE AGAIN - MOV #$409C,R9 + MOV #[THEN]+$58,R9 GOTO BW1 ENDCODE IMMEDIATE @@ -200,8 +200,8 @@ BW1 ADD #4,&$1DC0 CODE DO SUB #2,R15 MOV R14,0(R15) - ADD #2,&$1DC0 - MOV &$1DC0,R14 + ADD #2,&$1DBE + MOV &$1DBE,R14 MOV #XDO,-2(R14) ADD #2,&$1C00 MOV &$1C00,R10 @@ -223,8 +223,8 @@ BW1 BIT #$100,R2 CODE LOOP MOV #XLOOP,R9 -BW2 ADD #4,&$1DC0 - MOV &$1DC0,R10 +BW2 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) BEGIN @@ -332,7 +332,7 @@ BW2 ADD #4,&$1DC0 [UNDEFINED] UM/MOD [IF] CODE UM/MOD PUSH #DROP - MOV #$4028,R0 + MOV #<#+8,R0 ENDCODE [THEN] @@ -371,7 +371,7 @@ BW2 ADD #4,&$1DC0 [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -414,9 +414,16 @@ BW2 ADD #4,&$1DC0 ; end of definitions we need ; -------------------------- + CODE 2*DUP + SUB #2,R15 + ADD R14,R14 + MOV R14,0(R15) + MOV @R13+,R0 + ENDCODE + [UNDEFINED] S? [IF] CODE S? - MOV #S"+10,R0 + MOV #S"+$0A,R0 ENDCODE IMMEDIATE [THEN] @@ -447,6 +454,7 @@ BW2 ADD #4,&$1DC0 MOV.B @R9+,R14 RRA R14 MOV R14,R10 + ADD #1,R14 BIT #1,R10 0= IF ADD #1,R10 @@ -456,7 +464,6 @@ BW2 ADD #4,&$1DC0 0<> WHILE MOV @R15,R9 REPEAT - MOV R9,0(R15) MOV @R13+,R0 ENDCODE [THEN] @@ -465,6 +472,7 @@ BW2 ADD #4,&$1DC0 RST_RET ECHO ESC [8;42;80t + CR ESC [7m CR ." FastForth V" $180A @ @@ -510,18 +518,15 @@ BW2 ADD #4,&$1DC0 - U. ." bytes" ESC [0m CR + ." /COUNTED-STRING = 255" CR ." /HOLD = 34" CR ." /PAD = 84" CR ." ADDRESS-UNIT-BITS = 16" CR - [DEFINED] {CORE_ANS} - [IF] ." FLOORED DIVISION = " - $180E @ - 0< IF ." true" - ELSE ." false" - THEN CR - [THEN] + [DEFINED] SM/REM [IF] ." false" [THEN] + [DEFINED] FM/MOD [IF] ." true" [THEN] + CR ." MAX-CHAR = 255" CR ." MAX-N = 32767" CR ." MAX-U = 65535" CR @@ -529,57 +534,71 @@ BW2 ADD #4,&$1DC0 ." MAX-UD = 4294967295" CR ." STACK-CELLS = 48" CR ." RETURN-STACK-CELLS= 48" CR - ." Definitions are always UPPERCASE." CR - CR ESC [7m ." Kernel add-ons" ESC [0m CR + ." Definitions are forced UPPERCASE" CR + + CR ESC [7m ." KERNEL add-ons" ESC [0m CR $180E @ - 2* DUP 0< IF ." 32.768kHz LF XTAL" CR THEN - 2* DUP 0< IF ." /RTS /CTS " 2* - ELSE 2* DUP - 0< IF ." /RTS " THEN - THEN - 2* DUP 0< IF ." XON/XOFF " THEN - 2* DUP 0< IF ." Half-Duplex " THEN - 2* DUP 0< IF ." I2C_Master TERMINAL" - ELSE ." UART TERMINAL" THEN CR - 2* DUP 0< IF 2* DUP 0< IF ." DOUBLE and " - THEN ." Q15.16 numbers handling" CR - ELSE 2* DUP 0< IF ." DOUBLE numbers handling" CR - THEN + 2*DUP 0< IF ." 32.768kHz LF XTAL" CR THEN + 2*DUP 0< IF ." /CTS " THEN + 2*DUP 0< IF ." /RTS " THEN + 2*DUP 0< IF ." XON/XOFF " THEN + 2*DUP 0< IF ." Half-Duplex " THEN + 2*DUP 0< IF ." I2C_Master TERMINAL" + ELSE ." UART TERMINAL" + THEN CR + 2*DUP 0< IF 2*DUP + 0< IF ." DOUBLE and " + THEN ." Q15.16 numbers handling" CR + ELSE 2*DUP + 0< IF ." DOUBLE numbers handling" CR + THEN THEN - 2* DUP 0< IF ." MSP430_X assembler with TI's syntax" - CR 2* 2* - ELSE - 2* DUP - 0< IF ." MSP430 Assembler" - 2* DUP - 0< IF ." , 20bits extended addresses," - THEN - ELSE 2* + 2*DUP 0< IF ." MSP430 16/20bits" + ELSE 2*DUP ." MSP430 16bits" + 0< IF ." (20bits addr)" THEN - ." with TI's syntax" CR - THEN DROP + THEN ." assembler, with TI's syntax" CR + DROP [DEFINED] FORTH [IF] ." word-set management" CR [THEN] - [DEFINED] LOAD" [IF] ." SD_CARD Load" CR + [DEFINED] LOAD" [IF] ." SD_CARD Load + Bootloader" CR + [THEN] + [DEFINED] READ" [IF] ." SD_CARD Read/Write/Del/CopyTERM2SD" CR + [THEN] + + CR ESC [7m ." EXTENSIONS" ESC [0m + [DEFINED] {CORE_ANS} [IF] CR ." CORE ANS94 'CORETEST passed'" + [THEN] + [DEFINED] {DOUBLE} [IF] CR ." DOUBLE numbers set" + [THEN] + [DEFINED] {UTILITY} [IF] CR ." UTILITY" + [THEN] + [DEFINED] {FIXPOINT} [IF] CR ." Q15.16 ADD SUB MUL DIV" + [THEN] + [DEFINED] {CORDIC} [IF] CR ." CORDIC engine" [THEN] - [DEFINED] BOOT [IF] ." SD_CARD Bootloader" CR + [DEFINED] {SD_TOOLS} [IF] CR ." SD_TOOLS" [THEN] - [DEFINED] READ" [IF] ." SD_CARD Read/Write" CR + [DEFINED] {RTC} [IF] CR ." RTC utility" [THEN] - $1DC2 + [DEFINED] {UARTI2CS} [IF] CR ." UART to I2C_FastForth bridge" + [THEN] + CR + + $1DC0 BEGIN @ ?DUP WHILE - CR ESC [7m + ESC [7m DUP $180C @ 2* - [DEFINED] FORTH - [IF] DUP BODY>SQNFA + [IF] DUP BODY>SQNFA [ELSE] OVER @ IF S" hidden" ELSE S" FORTH" THEN - [THEN] - TYPE ." word-set" + [THEN] TYPE + ." word-set" ESC [0m CR $1CE4 $180C @ 2* @@ -590,8 +609,8 @@ BW2 ADD #4,&$1DC0 DO DUP I $1CE4 + @ U< IF - DROP DROP - I DUP $1CE4 + @ + DROP DROP I + DUP $1CE4 + @ THEN 2 +LOOP ?DUP @@ -608,25 +627,6 @@ BW2 ADD #4,&$1DC0 DROP CR REPEAT - DROP - CR ESC [7m ." EXTENSIONS" ESC [0m - [DEFINED] {CORE_ANS} [IF] CR ." CORE ANS94" - [THEN] - [DEFINED] {DOUBLE} [IF] CR ." DOUBLE numbers set" - [THEN] - [DEFINED] {UTILITY} [IF] CR ." UTILITY" - [THEN] - [DEFINED] {FIXPOINT} [IF] CR ." Q15.16 ADD SUB MUL DIV" - [THEN] - [DEFINED] {CORDIC} [IF] CR ." CORDIC engine" - [THEN] - [DEFINED] {SD_TOOLS} [IF] CR ." SD_TOOLS" - [THEN] - [DEFINED] {RTC} [IF] CR ." RTC utility" - [THEN] - [DEFINED] {UARTI2CS} [IF] CR ." UART to I2C_FastForth bridge" - [THEN] - CR SYS ; diff --git a/MSP430-FORTH/PROG10K.f b/MSP430-FORTH/PROG10K.f index b4e90b2..86dd3d6 100644 --- a/MSP430-FORTH/PROG10K.f +++ b/MSP430-FORTH/PROG10K.f @@ -91,10 +91,10 @@ SUB #2,PSP MOV TOS,0(PSP) MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON 'CR' EMIT \ return to column 1 without 'LF' - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" RST_RET \ remove ABORT_UARTI2CS definition before resuming ; diff --git a/MSP430-FORTH/PreprocessSourceFile.f.bat.lnk b/MSP430-FORTH/PreprocessSourceFile.f.bat.lnk new file mode 100644 index 0000000000000000000000000000000000000000..46e2bc555ab23a87f46528a861550493b93418a5 GIT binary patch literal 1613 zcmbtUZ%9*76hB+$pRn3UC8cr*f|9Q3tZ-(z_WWON>`zI($me{UTbpm~ZPXXVF9yL1 zl!71%EB{0(R1_9rNMC{ov;xyU1<{8J5$l6R1f8?@mYWzM-p9H3-1E-;oqNvtaSs82 zB14HYz(jP0nyZis8q~XAKJeUlJfnDB8!74gHlyg(SPN-YDI`aEkv2H1l^Kw0`Cy*X zd@*=bH)m2|r%rb*8+I`U_OH{D;)0Us#^5OMslntE!fmz?7xD-l01c1^NihG6X?WG? zcI+dFvxJMY+21n#`6^>(#DhLDxFCP-2O2*H2 zWcI}H_eJs6FT?Ntm7@qi5b?agBeID9v%oH+wmN2uRNxl_WqKXJ{uNLsHxi&!;3eqA zOUVj9Vg;ZK^ngd>Fx?K3QGrwFaCzLzF+&Vh;$bEsEyol!Sgh3+tGTOGd(dbHXid1S-b%{w9vi=WBPE_ zA})1+Y7fvauj}NMddQ%hMxjt-zxVw6NfoY)(QX8!N<0&YH^nHFYX*uml)$nUQ*lGJ zvFUJqf`6>Rtke=#sv>I%^4NJNFN!uH9CY$E9v`o5^-}}VqEtn!!rN3FuHQ+4v@?3}CBk$9h>T&baJxx7V%HCeQQ?Zyb`E&2N z<8$iBsR8Aa!P`Us``?VEOhf!m#4E8`Y;(Ht_a-=BJN#p6%Yf+0m;!jrI-XK*6(7R?j+#SDOi>iYBhnOK%vF zEuHqH#2&DE)RV|a;fSt8VkflY%pFq4xbdsauhvC7vN0vK_JjgDAACy zXOi}#D3s`s*I7_``HlL~G)$Ohw@&q IF MOV #0,TOS THEN \ if TOS <> 0 (FIXPOINT input), set TOS = 0 MOV TOS,0(PSP) MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON $0D EMIT \ return to column 1 without CR - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" target without LF_XTAL !" RST_RET \ if no abort remove this word ; @@ -711,7 +711,7 @@ BW1 MOV TOS,&OP2 \ Load 2nd operand : SET_TIME ESC [8;42;80t \ set terminal display 42L * 80C - 39 0 DO CR LOOP \ to avoid erasing any line of source, create 42 empty lines + 42 0 DO CR LOOP \ to avoid erasing any line of source, create 42 empty lines ESC [H \ then set cursor home CR ." DATE (DMY): " PAD_ORG DUP PAD_LEN @@ -729,5 +729,4 @@ BW1 MOV TOS,&OP2 \ Load 2nd operand RST_SET - ECHO - SET_TIME + ECHO SET_TIME diff --git a/MSP430-FORTH/SD_430FR5994/BOOT.4TH b/MSP430-FORTH/SD_430FR5994/BOOT.4TH index 956597f..2617ad8 100644 --- a/MSP430-FORTH/SD_430FR5994/BOOT.4TH +++ b/MSP430-FORTH/SD_430FR5994/BOOT.4TH @@ -46,9 +46,7 @@ BW1 SUB #2,R15 [UNDEFINED] EXECUTE [IF] CODE EXECUTE - PUSH R14 - MOV @R15+,R14 - MOV @R1+,R0 + MOV #\+$28,R0 ENDCODE [THEN] diff --git a/MSP430-FORTH/SD_430FR5994/CHNGBAUD.4TH b/MSP430-FORTH/SD_430FR5994/CHNGBAUD.4TH index 916f6ee..cda3422 100644 --- a/MSP430-FORTH/SD_430FR5994/CHNGBAUD.4TH +++ b/MSP430-FORTH/SD_430FR5994/CHNGBAUD.4TH @@ -11,10 +11,10 @@ 0<> IF MOV #0,R14 THEN MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" <-- Ouch! unexpected I2C_FastForth target!" RST_RET ; @@ -58,7 +58,7 @@ BW1 SUB #2,R15 [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -77,7 +77,7 @@ BW1 SUB #2,R15 CODE U/ SUB #2,R15 MOV #0,0(R15) - CALL #$4028 + CALL #<#+8 MOV @R15,R14 ADD #4,R15 MOV @R13+,R0 @@ -135,15 +135,15 @@ FW1 AND #0,R14 CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -151,9 +151,9 @@ FW1 AND #0,R14 [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -175,8 +175,8 @@ FW1 AND #0,R14 CODE DO SUB #2,R15 MOV R14,0(R15) - ADD #2,&$1DC0 - MOV &$1DC0,R14 + ADD #2,&$1DBE + MOV &$1DBE,R14 MOV #XDO,-2(R14) ADD #2,&$1C00 MOV &$1C00,R10 @@ -198,8 +198,8 @@ BW1 BIT #$100,R2 CODE LOOP MOV #XLOOP,R9 -BW2 ADD #4,&$1DC0 - MOV &$1DC0,R10 +BW2 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) BEGIN @@ -281,13 +281,13 @@ BW2 ADD #4,&$1DC0 : BAD_MHz $20 DUP EMIT - ABORT" only for 1,4,8,16,24 MHz MCLK!" + ABORT" only for 1, 2, 4, 8, 12, 16, 20, 24 MHz MCLK!" ; - : OVR_BAUDS + : OVER_BDS $20 DUP EMIT ESC [7m - ." with MCLK = " $1800 @ 1000 U/ . - ABORT" MHz? don't dream!" + ." with MCLK = " $1800 @ 1000 U/ . + ABORT" MHz ? don't dream!" ; : CHNGBAUD @@ -300,168 +300,217 @@ BW2 ADD #4,&$1DC0 $1800 @ DUP >R ." target MCLK = " 1000 U/ . ." MHz" CR ." choose your baudrate:" CR - ." 0 --> 6 MBds" CR - ." 1 --> 5 MBds" CR - ." 2 --> 4 MBds" CR - ." 3 --> 3 MBds" CR - ." 4 --> 1843200 Bds" CR - ." 5 --> 921600 Bds" CR - ." 6 --> 460800 Bds" CR - ." 7 --> 230400 Bds" CR - ." 8 --> 115200 Bds" CR - ." 9 --> 38400 Bds" CR - ." A --> 19200 Bds" CR - ." B --> 9600 Bds" CR - ." other --> abort" CR + ." 0 --> 6 MBds" CR + ." 1 --> 5 MBds" CR + ." 2 --> 4 MBds" CR + ." 3 --> 3 MBds" CR + ." 4 --> 1843200 Bds" CR + ." 5 --> 921600 Bds" CR + ." 6 --> 460800 Bds" CR + ." 7 --> 230400 Bds" CR + ." 8 --> 115200 Bds" CR + ." 9 --> 57600 Bds" CR + ." A --> 38400 Bds" CR + ." B --> 19200 Bds" CR + ." C --> 9600 Bds" CR + ." D --> DMX interface (250000 Bds)" CR + ." M --> MIDI interface (31250 Bds)" CR + ." other --> quit" CR ." your choice: " KEY CASE - #48 OF ." 6 MBds" + #'0' OF ." 6 MBds" R> CASE - #24000 OF $4 $0 - ENDOF - 24000 < - IF OVR_BAUDS + #24000 OF $4 $0 ENDOF + #20000 OF $3 $4900 ENDOF + 20000 < + IF OVER_BDS THEN BAD_MHz ENDCASE ENDOF - #49 OF ." 5 MBds" + #'1' OF ." 5 MBds" R> CASE - #24000 OF $4 $EE00 ENDOF - #20000 OF $4 $0 ENDOF + #24000 OF $4 $EE00 ENDOF + #20000 OF $4 $0 ENDOF 20000 < - IF OVR_BAUDS + IF OVER_BDS THEN BAD_MHz ENDCASE ENDOF - #50 OF ." 4 MBds" + #'2' OF ." 4 MBds" R> CASE - #24000 OF $6 $0 ENDOF - #20000 OF $5 $0 ENDOF - #16000 OF $4 $0 ENDOF + #24000 OF $6 $0 ENDOF + #20000 OF $5 $0 ENDOF + #16000 OF $4 $0 ENDOF 16000 < - IF OVR_BAUDS + IF OVER_BDS THEN BAD_MHz ENDCASE ENDOF - #51 OF ." 3 MBds" + #'3' OF ." 3 MBds" R> CASE - #24000 OF $8 $0 ENDOF - #20000 OF $6 $D600 ENDOF - #16000 OF $5 $4900 ENDOF - #12000 OF $4 $0 ENDOF + #24000 OF $8 $0 ENDOF + #20000 OF $6 $D600 ENDOF + #16000 OF $5 $4900 ENDOF + #12000 OF $4 $0 ENDOF 12000 < - IF OVR_BAUDS + IF OVER_BDS THEN BAD_MHz ENDCASE ENDOF - #52 OF ." 1843200 Bds" + #'4' OF ." 1843200 Bds" R> CASE - #24000 OF $0D $0200 ENDOF - #20000 OF $0A $DF00 ENDOF - #16000 OF $8 $D600 ENDOF - #12000 OF $6 $AA00 ENDOF - #8000 OF $5 $9200 ENDOF + #24000 OF $0D $0200 ENDOF + #20000 OF $0A $DF00 ENDOF + #16000 OF $8 $D600 ENDOF + #12000 OF $6 $AA00 ENDOF + #8000 OF $5 $9200 ENDOF 8000 < - IF OVR_BAUDS + IF OVER_BDS THEN BAD_MHz ENDCASE ENDOF - #53 OF ." 921600 Bds" + #'5' OF ." 921600 Bds" R> CASE - #24000 OF $1 $00A1 ENDOF - #20000 OF $1 $B751 ENDOF - #16000 OF $11 $4A00 ENDOF - #12000 OF $0D $0200 ENDOF - #8000 OF $8 $D600 ENDOF - #4000 OF $4 $4900 ENDOF + #24000 OF $1 $00A1 ENDOF + #20000 OF $1 $B751 ENDOF + #16000 OF $11 $4A00 ENDOF + #12000 OF $0D $0200 ENDOF + #8000 OF $8 $D600 ENDOF + #4000 OF $4 $4900 ENDOF 4000 < - IF OVR_BAUDS + IF OVER_BDS THEN BAD_MHz ENDCASE ENDOF - #54 OF ." 460800 Bds" + #'6' OF ." 460800 Bds" R> CASE - #24000 OF $3 $0241 ENDOF - #20000 OF $2 $92B1 ENDOF - #16000 OF $2 $BB21 ENDOF - #12000 OF $1 $00A1 ENDOF - #8000 OF $11 $4A00 ENDOF - #4000 OF $8 $D600 ENDOF - #2000 OF $4 $4900 ENDOF + #24000 OF $3 $0241 ENDOF + #20000 OF $2 $92B1 ENDOF + #16000 OF $2 $BB21 ENDOF + #12000 OF $1 $00A1 ENDOF + #8000 OF $11 $4A00 ENDOF + #4000 OF $8 $D600 ENDOF + #2000 OF $4 $4900 ENDOF 2000 < - IF OVR_BAUDS + IF OVER_BDS THEN BAD_MHz ENDCASE ENDOF - #55 OF ." 230400 Bds" + #'7' OF ." 230400 Bds" R> CASE - #24000 OF $6 $2081 ENDOF - #20000 OF $5 $EE61 ENDOF - #16000 OF $4 $5551 ENDOF - #12000 OF $3 $0241 ENDOF - #8000 OF $2 $BB21 ENDOF - #4000 OF $11 $4A00 ENDOF - #2000 OF $8 $D600 ENDOF - #1000 OF $4 $4900 ENDOF - 1000 < - IF OVR_BAUDS - THEN BAD_MHz + #24000 OF $6 $2081 ENDOF + #20000 OF $5 $EE61 ENDOF + #16000 OF $4 $5551 ENDOF + #12000 OF $3 $0241 ENDOF + #8000 OF $2 $BB21 ENDOF + #4000 OF $11 $4A00 ENDOF + #2000 OF $8 $D600 ENDOF + #1000 OF $4 $4900 ENDOF + BAD_MHz ENDCASE ENDOF - #56 OF ." 115200 Bds" + #'8' OF ." 115200 Bds" R> CASE - #24000 OF $0D $4901 ENDOF - #20000 OF $0A $AD01 ENDOF - #16000 OF $8 $F7A1 ENDOF - #12000 OF $6 $2081 ENDOF - #8000 OF $4 $5551 ENDOF - #4000 OF $2 $BB21 ENDOF - #2000 OF $11 $4A00 ENDOF - #1000 OF $8 $D600 ENDOF - #500 OF $4 $4900 ENDOF - 500 < - IF OVR_BAUDS - THEN BAD_MHz + #24000 OF $0D $4901 ENDOF + #20000 OF $0A $AD01 ENDOF + #16000 OF $8 $F7A1 ENDOF + #12000 OF $6 $2081 ENDOF + #8000 OF $4 $5551 ENDOF + #4000 OF $2 $BB21 ENDOF + #2000 OF $11 $4A00 ENDOF + #1000 OF $8 $D600 ENDOF + BAD_MHz + ENDCASE + ENDOF + #'9' OF ." 57600 Bds" + R> CASE + #24000 OF $1A $D601 ENDOF + #20000 OF $15 $00A1 ENDOF + #16000 OF $11 $DD51 ENDOF + #12000 OF $0D $4901 ENDOF + #8000 OF $8 $F7A1 ENDOF + #4000 OF $4 $5551 ENDOF + #2000 OF $2 $BB21 ENDOF + #1000 OF $11 $4A00 ENDOF + BAD_MHz ENDCASE ENDOF - #57 OF ." 38400 Bds" + #'A' OF ." 38400 Bds" R> CASE #24000 OF $27 $0011 ENDOF + #20000 OF $20 $BF01 ENDOF #16000 OF $1A $D601 ENDOF + #12000 OF $13 $5581 ENDOF #8000 OF $0D $4901 ENDOF - #4000 OF $6 $2081 ENDOF - #1000 OF $1 $00A1 ENDOF + #4000 OF $6 $2081 ENDOF + #2000 OF $3 $0241 ENDOF + #1000 OF $1 $00A1 ENDOF BAD_MHz ENDCASE ENDOF - #65 OF ." 19200 Bds" + #'B' OF ." 19200 Bds" R> CASE #24000 OF $4E $0021 ENDOF + #20000 OF $41 $D611 ENDOF #16000 OF $34 $4911 ENDOF + #12000 OF $27 $0011 ENDOF #8000 OF $1A $D601 ENDOF #4000 OF $0D $4901 ENDOF - #1000 OF $3 $0241 ENDOF + #2000 OF $6 $2081 ENDOF + #1000 OF $3 $0241 ENDOF BAD_MHz ENDCASE ENDOF - #66 OF ." 9600 Bds" + #'C' OF ." 9600 Bds" R> CASE #24000 OF $9C $0041 ENDOF + #20000 OF $82 $2531 ENDOF #16000 OF $68 $D621 ENDOF + #12000 OF $4E $0021 ENDOF #8000 OF $34 $4911 ENDOF #4000 OF $1A $D601 ENDOF - #1000 OF $6 $2081 ENDOF + #2000 OF $13 $4901 ENDOF + #1000 OF $6 $2081 ENDOF BAD_MHz ENDCASE ENDOF - ." abort" ABORT" " + #'D' OF ." DMX interface (250000 Bds)" + R> CASE + #24000 OF $6 $1 ENDOF + #20000 OF $5 $1 ENDOF + #16000 OF $4 $1 ENDOF + #12000 OF $3 $1 ENDOF + #8000 OF $2 $1 ENDOF + #4000 OF $10 $0 ENDOF + #2000 OF $8 $0 ENDOF + #1000 OF $4 $0 ENDOF + BAD_MHz + ENDCASE + ENDOF + #'M' OF ." MIDI interface (31250 Bds)" + R> CASE + #24000 OF $30 $1 ENDOF + #20000 OF $28 $1 ENDOF + #16000 OF $20 $1 ENDOF + #12000 OF $18 $1 ENDOF + #8000 OF $10 $1 ENDOF + #4000 OF $8 $1 ENDOF + #2000 OF $4 $1 ENDOF + #1000 OF $2 $1 ENDOF + BAD_MHz + ENDCASE + ENDOF + ABORT" " ENDCASE $1804 ! $1802 ! CR ESC [7m - ." Change baudrate in Teraterm, save its setup, then reset target." + ." Change baudrate in Teraterm, save its setup, then hit a key." ESC [0m + CR + KEY + 0 SYS ; CHNGBAUD diff --git a/MSP430-FORTH/SD_430FR5994/CORDIC.4TH b/MSP430-FORTH/SD_430FR5994/CORDIC.4TH index 6a4122b..2509530 100644 --- a/MSP430-FORTH/SD_430FR5994/CORDIC.4TH +++ b/MSP430-FORTH/SD_430FR5994/CORDIC.4TH @@ -87,7 +87,7 @@ MARKER {CORDIC} MOV @R13+,R0 ENDCODE - $180E 8 TSTBIT + $180E $10 TSTBIT RST_RET @@ -218,7 +218,7 @@ BW3 ADD R14,R9 ADD R10,R10 U>= UNTIL MOV R11,R9 - MOV #$40AE,R6 + MOV #[THEN]+$6A,R6 MOV @R1+,R0 ENDCODE @@ -366,7 +366,7 @@ FW1 RRA R12 MOV #0,2(R15) MOV R14,0(R15) MOV #286,R14 - CALL #$4028 + CALL #<#+8 MOV @R15+,0(R15) CMP #0,R6 S< IF @@ -375,7 +375,7 @@ FW1 RRA R12 ADD #1,0(R15) ADDC #0,R14 THEN - MOV #$40AE,R6 + MOV #[THEN]+$6A,R6 MOV @R13+,R0 ENDCODE diff --git a/MSP430-FORTH/SD_430FR5994/CORETEST.4TH b/MSP430-FORTH/SD_430FR5994/CORETEST.4TH index 976805e..4968fb8 100644 --- a/MSP430-FORTH/SD_430FR5994/CORETEST.4TH +++ b/MSP430-FORTH/SD_430FR5994/CORETEST.4TH @@ -1,27 +1,26 @@ -\ ; ------------------------------------- -\ ; CORETEST.4TH for any FastForth target -\ ; ------------------------------------- +; ------------------------------------- +; CORETEST.4TH for any FastForth target +; ------------------------------------- MARKER {CORETEST} : ABORT_TEST \ flag -- - $0D EMIT \ return to column 1 - POSTPONE {CORETEST} \ remove all test words + $0D EMIT \ return to column 1, no 'LF' ABORT" {CORE_ANS} word set not found !" + POSTPONE {CORETEST} \ remove all test words ; [UNDEFINED] {CORE_ANS} ABORT_TEST : CORETESTSUCCESS - $0D EMIT \ -- $0D return to column 1 - $0A BASE ! \ set decimal - {CORETEST} \ remove all test words - ." CORETEST + COREPLUSTEST success!" \ true -- + $0D DUP EMIT \ return to column 1, set true flag for ABORT" + $0A BASE ! \ set decimal + {CORETEST} \ remove all coretest definitionss + ABORT" CORETEST + COREPLUSTEST success!" \ true_flag -- ; - [UNDEFINED] SM/REM - [IF] + [UNDEFINED] SM/REM [IF] \ https://forth-standard.org/standard/core/SMDivREM \ SM/REM d1 n1 -- r q symmetric signed div'n CODE SM/REM @@ -59,8 +58,7 @@ ENDCODE [THEN] - [UNDEFINED] FM/MOD - [IF] + [UNDEFINED] FM/MOD [IF] \ https://forth-standard.org/standard/core/FMDivMOD \ FM/MOD d1 n1 -- r q floored signed div'n : FM/MOD @@ -173,7 +171,7 @@ T{ -> }T \ START WITH CLEAN SLATE ( TEST IF ANY BITS ARE SET; ANSWER IN BASE 1 ) T{ : BITSSET? IF 0 0 ELSE 0 THEN ; -> }T T{ 0 BITSSET? -> 0 }T ( ZERO IS ALL BITS CLEAR ) -T{ 1 BITSSET? -> 0 0 }T ( OTHER NUMBER HAVE AT LEAST ONE BIT ) +T{ 1 BITSSET? -> 0 0 }T ( OTHER NUMBER HAVE AT LEAST ONE BIT ) T{ -1 BITSSET? -> 0 0 }T \ ------------------------------------------------------------------------ @@ -224,7 +222,7 @@ T{ MSB 2* -> 0S }T T{ 0S 2/ -> 0S }T T{ 1 2/ -> 0 }T T{ 4000 2/ -> 2000 }T -T{ 1S 2/ -> 1S }T \ MSB PROPOGATED +T{ 1S 2/ -> 1S }T \ MSB PROPOGATED T{ 1S 1 XOR 2/ -> 1S }T T{ MSB 2/ MSB AND -> MSB }T @@ -1138,28 +1136,12 @@ TESTING INPUT: ACCEPT CREATE ABUF 80 CHARS ALLOT -\ ' ACCEPT DUP >BODY SWAP 2 + @ = \ JMT: -\ [IF] \ JMT: ACCEPT is not redirected - : ACCEPT-TEST - CR ." PLEASE TYPE UP TO 80 CHARACTERS: " - ABUF 80 ACCEPT - CR ." RECEIVED: " [CHAR] " EMIT - ABUF SWAP TYPE [CHAR] " EMIT CR - ; -\ [ELSE] \ JMT: ACCEPT is redirected -\ : ACCEPT-TEST -\ ['] NOECHO >BODY DUP @ @ \ JMT: -- NOECHO_BODY YEMIT_exec -\ SWAP 2 - @ \ JMT: -- YEMIT_exec NOECHO_exec -\ = DUP \ JMT: -- NOECHO_flag NOECHO_flag -\ IF ECHO THEN \ JMT: -- NOECHO_flag -\ CR ." PLEASE TYPE UP TO 80 CHARACTERS: " -\ ['] ACCEPT >BODY \ JMT: find default exec part of ACCEPT -\ EXECUTE \ JMT: execute it -\ CR ." RECEIVED: " [CHAR] " EMIT -\ ABUF SWAP TYPE [CHAR] " EMIT CR -\ IF NOECHO THEN \ JMT: -- -\ ; -\ [THEN] +: ACCEPT-TEST + CR ." PLEASE TYPE UP TO 80 CHARACTERS: " + ABUF 80 ACCEPT + CR ." RECEIVED: " [CHAR] " EMIT + ABUF SWAP TYPE [CHAR] " EMIT CR +; T{ ACCEPT-TEST -> }T \ ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba diff --git a/MSP430-FORTH/SD_430FR5994/CORE_ANS.4TH b/MSP430-FORTH/SD_430FR5994/CORE_ANS.4TH index 0755634..2fc661c 100644 --- a/MSP430-FORTH/SD_430FR5994/CORE_ANS.4TH +++ b/MSP430-FORTH/SD_430FR5994/CORE_ANS.4TH @@ -3,10 +3,10 @@ SUB #2,R15 MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ; ABORT_CORE_ANS @@ -39,12 +39,11 @@ [IF] {CORE_ANS} [THEN] [UNDEFINED] {CORE_ANS} [IF] - MARKER {CORE_ANS} [UNDEFINED] ABORT [IF] CODE ABORT - MOV #ALLOT+$08,R0 + MOV #ALLOT+8,R0 ENDCODE [THEN] @@ -176,9 +175,9 @@ BW1 SUB #2,R15 [UNDEFINED] C, [IF] CODE C, - MOV &$1DC0,R10 + MOV &$1DBE,R10 MOV.B R14,0(R10) - ADD #1,&$1DC0 + ADD #1,&$1DBE MOV @R15+,R14 MOV @R13+,R0 ENDCODE @@ -266,15 +265,15 @@ FW1 MOV #-1,R14 CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -282,9 +281,9 @@ FW1 MOV #-1,R14 [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -299,9 +298,9 @@ FW1 MOV #-1,R14 ENDCODE IMMEDIATE CODE UNTIL - MOV #$4096,R9 -BW1 ADD #4,&$1DC0 - MOV &$1DC0,R10 + MOV #[THEN]+$52,R9 +BW1 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) MOV @R15+,R14 @@ -309,7 +308,7 @@ BW1 ADD #4,&$1DC0 ENDCODE IMMEDIATE CODE AGAIN - MOV #$409C,R9 + MOV #[THEN]+$58,R9 GOTO BW1 ENDCODE IMMEDIATE @@ -337,8 +336,8 @@ BW1 ADD #4,&$1DC0 CODE DO SUB #2,R15 MOV R14,0(R15) - ADD #2,&$1DC0 - MOV &$1DC0,R14 + ADD #2,&$1DBE + MOV &$1DBE,R14 MOV #XDO,-2(R14) ADD #2,&$1C00 MOV &$1C00,R10 @@ -360,8 +359,8 @@ BW1 BIT #$100,R2 CODE LOOP MOV #XLOOP,R9 -BW2 ADD #4,&$1DC0 - MOV &$1DC0,R10 +BW2 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) BEGIN @@ -417,10 +416,10 @@ BW2 ADD #4,&$1DC0 [UNDEFINED] LEAVE [IF] CODE LEAVE - MOV &$1DC0,R10 + MOV &$1DBE,R10 MOV #UNLOOP,0(R10) - MOV #$409C,2(R10) - ADD #6,&$1DC0 + MOV #[THEN]+$58,2(R10) + ADD #6,&$1DBE ADD #2,&$1C00 ADD #4,R10 MOV &$1C00,R9 @@ -560,7 +559,7 @@ FW1 MOV @R15+,R14 MOV @R13+,R0 ENDCODE - $180E 8 TSTBIT + $180E $10 TSTBIT RST_RET @@ -574,9 +573,7 @@ BW1 MOV R14,&$4C8 MOV &$4E6,R14 MOV @R13+,R0 ENDCODE - [THEN] - [UNDEFINED] M* [IF] CODE M* MOV @R15,&$4C2 GOTO BW1 @@ -585,6 +582,29 @@ BW1 MOV R14,&$4C8 [ELSE] ; MSP430FR413x without hardware_MPY + [UNDEFINED] UM* [IF] + CODE UM* + MOV @R15,R12 + MOV #0,R11 + MOV #0,R9 + MOV #0,R8 + MOV #1,R10 + BEGIN + BIT R10,R14 + 0<> IF + ADD R12,R9 + ADDC R11,R8 + THEN + ADD R12,R12 + ADDC R11,R11 + ADD R10,R10 + U>= UNTIL + MOV R9,0(R15) + MOV R8,R14 + MOV @R13+,R0 + ENDCODE + [THEN] + [UNDEFINED] M* [IF] CODE M* MOV @R15,R12 @@ -620,7 +640,7 @@ BW1 MOV R14,&$4C8 [IF] CODE UM/MOD PUSH #DROP - MOV #$4028,R0 + MOV #<#+8,R0 ENDCODE [THEN] @@ -643,7 +663,7 @@ BW1 MOV R14,&$4C8 ADDC #0,0(R15) THEN PUSHM #2,R12 - CALL #$4028 + CALL #<#+8 MOV @R15+,R14 POPM #2,R12 CMP #0,R11 @@ -687,7 +707,7 @@ BW1 MOV R14,&$4C8 ADDC #0,0(R15) THEN PUSHM #2,R12 - CALL #$4028 + CALL #<#+8 MOV @R15+,R14 POPM #2,R12 CMP #0,R11 @@ -855,8 +875,8 @@ BW1 MOV R14,&$4C8 [UNDEFINED] ALIGN [IF] CODE ALIGN - BIT #1,&$1DC0 - ADDC #0,&$1DC0 + BIT #1,&$1DBE + ADDC #0,&$1DBE MOV @R13+,R0 ENDCODE [THEN] @@ -888,6 +908,7 @@ BW1 MOV R14,&$4C8 ENDCODE [THEN] + [UNDEFINED] CHAR [IF] : CHAR $20 WORD 1+ C@ @@ -980,13 +1001,12 @@ BW1 MOV R14,&$4C8 [UNDEFINED] .( [IF] ; " CODE .( ; " - PUSH R13 - MOV #0,&$1DB8 - LO2HI - ')' WORD + MOV #0,R11 + COLON + ')' + [ ' WORD 16 + , ] COUNT TYPE HI2LO - MOV #$20,&$1DB8 MOV @R1+,R13 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -1001,30 +1021,28 @@ BW1 MOV R14,&$4C8 [UNDEFINED] EXECUTE [IF] CODE EXECUTE - PUSH R14 - MOV @R15+,R14 - MOV @R1+,R0 + MOV #\+$28,R0 ENDCODE [THEN] [UNDEFINED] EVALUATE [IF] CODENNM - MOV @R1+,&$1DBE MOV @R1+,&$1DBC MOV @R1+,&$1DBA + MOV @R1+,&$1DB8 MOV @R1+,R13 MOV @R13+,R0 ENDCODE CODE EVALUATE - MOV #$1DBA,R9 + MOV #$1DB8,R9 MOV @R9+,R12 MOV @R9+,R11 MOV @R9+,R10 PUSHM #4,R13 MOV R0,R13 ADD #8,R13 - MOV #\+$08,R0 + MOV #\+8,R0 MOV #0,R3 ENDCODE , @@ -1033,9 +1051,9 @@ BW1 MOV R14,&$4C8 [UNDEFINED] RECURSE [IF] CODE RECURSE - MOV &$1DC0,R9 - MOV &$1DDC,0(R9) - ADD #2,&$1DC0 + MOV &$1DBE,R9 + MOV &$1DDA,0(R9) + ADD #2,&$1DBE MOV @R13+,R0 ENDCODE IMMEDIATE [THEN] @@ -1044,8 +1062,8 @@ BW1 MOV R14,&$4C8 CODE SOURCE SUB #4,R15 MOV R14,2(R15) - MOV &$1DBA,R14 - MOV &$1DBC,0(R15) + MOV &$1DB8,R14 + MOV &$1DBA,0(R15) MOV @R13+,R0 ENDCODE [THEN] @@ -1080,7 +1098,7 @@ BW1 MOV R14,&$4C8 [THEN] [UNDEFINED] >IN [IF] - $1DBE CONSTANT >IN + $1DBC CONSTANT >IN [THEN] [UNDEFINED] PAD [IF] @@ -1112,7 +1130,7 @@ BW1 MOV R14,&$4C8 CREATE HI2LO MOV #$4030,-4(R10) - MOV #$409E,-2(R10) + MOV #[THEN],-2(R10) MOV @R1+,R13 MOV @R13+,R0 ENDCODE @@ -1120,7 +1138,7 @@ BW1 MOV R14,&$4C8 [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME diff --git a/MSP430-FORTH/SD_430FR5994/DOUBLE.4TH b/MSP430-FORTH/SD_430FR5994/DOUBLE.4TH index 1721b9a..7842ca1 100644 --- a/MSP430-FORTH/SD_430FR5994/DOUBLE.4TH +++ b/MSP430-FORTH/SD_430FR5994/DOUBLE.4TH @@ -7,10 +7,10 @@ 0<> IF MOV #0,R14 THEN MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" build FastForth with DOUBLE_INPUT addon!" RST_RET ; @@ -47,153 +47,6 @@ ENDCODE [THEN] - [UNDEFINED] 0< [IF] - CODE 0< - ADD R14,R14 - SUBC R14,R14 - XOR #-1,R14 - MOV @R13+,R0 - ENDCODE - [THEN] - - [UNDEFINED] DROP [IF] - CODE DROP - MOV @R15+,R14 - MOV @R13+,R0 - ENDCODE - [THEN] - - [UNDEFINED] DUP [IF] - CODE DUP -BW1 SUB #2,R15 - MOV R14,0(R15) - MOV @R13+,R0 - ENDCODE - - CODE ?DUP - CMP #0,R14 - 0<> ?GOTO BW1 - MOV @R13+,R0 - ENDCODE - [THEN] - - [UNDEFINED] NIP [IF] - CODE NIP - ADD #2,R15 - MOV @R13+,R0 - ENDCODE - [THEN] - - [UNDEFINED] UM/MOD [IF] - CODE UM/MOD - PUSH #DROP - MOV #$4028,R0 - ENDCODE - [THEN] - - $180E @ 0< ; test the switch: FLOORED/SYMETRIC DIVISION - [IF] - [UNDEFINED] FM/MOD [IF] - CODE FM/MOD - MOV R14,R12 - MOV @R15,R11 - CMP #0,R14 - S< IF - XOR #-1,R14 - ADD #1,R14 - THEN - CMP #0,0(R15) - S< IF - XOR #-1,2(R15) - XOR #-1,0(R15) - ADD #1,2(R15) - ADDC #0,0(R15) - THEN - PUSHM #3,R13 - LO2HI - UM/MOD - HI2LO - POPM #3,R13 - CMP #0,R11 - S< IF - XOR #-1,0(R15) - ADD #1,0(R15) - THEN - XOR R12,R11 - CMP #0,R11 - S< IF - XOR #-1,R14 - ADD #1,R14 - THEN - - CMP #0,0(R15) - 0<> IF - CMP #1,R14 - S< IF - ADD R12,0(R15) - SUB #1,R14 - THEN - THEN - MOV @R13+,R0 - ENDCODE - [THEN] - - [ELSE] - [UNDEFINED] SM/REM [IF] - CODE SM/REM - MOV R14,R12 - MOV @R15,R11 - CMP #0,R14 - S< IF - XOR #-1,R14 - ADD #1,R14 - THEN - CMP #0,0(R15) - S< IF - XOR #-1,2(R15) - XOR #-1,0(R15) - ADD #1,2(R15) - ADDC #0,0(R15) - THEN - PUSHM #3,R13 - LO2HI - UM/MOD - HI2LO - POPM #3,R13 - CMP #0,R11 - S< IF - XOR #-1,0(R15) - ADD #1,0(R15) - THEN - XOR R12,R11 - CMP #0,R11 - S< IF - XOR #-1,R14 - ADD #1,R14 - THEN - MOV @R13+,R0 - ENDCODE - [THEN] - [THEN] - - [UNDEFINED] / [IF] - : / - >R DUP 0< R> - [ $180E @ 0< ] - [IF] FM/MOD - [ELSE] SM/REM - [THEN] - NIP - ; - [THEN] - - [UNDEFINED] C@ [IF] - CODE C@ - MOV.B @R14,R14 - MOV @R13+,R0 - ENDCODE - [THEN] - [UNDEFINED] SWAP [IF] CODE SWAP MOV @R15,R10 @@ -231,37 +84,19 @@ BW1 SUB #2,R15 ENDCODE [THEN] - [UNDEFINED] < [IF] - CODE < - SUB @R15+,R14 - S< ?GOTO FW1 - 0<> IF -BW1 MOV #-1,R14 - THEN - MOV @R13+,R0 - ENDCODE - - CODE > - SUB @R15+,R14 - S< ?GOTO BW1 -FW1 AND #0,R14 - MOV @R13+,R0 - ENDCODE - [THEN] - [UNDEFINED] IF [IF] CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -269,9 +104,9 @@ FW1 AND #0,R14 [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -286,13 +121,12 @@ FW1 AND #0,R14 ENDCODE [THEN] - [UNDEFINED] DOES> [IF] - CODE DOES> - MOV &$1DDC,R10 - MOV #$1285,0(R10) - MOV R13,2(R10) - MOV @R1+,R13 - MOV @R13+,R0 + [UNDEFINED] SPACE [IF] + CODE SPACE + SUB #2,R15 + MOV R14,0(R15) + MOV #$20,R14 + MOV #EMIT,R0 ENDCODE [THEN] @@ -303,7 +137,7 @@ FW1 AND #0,R14 PUSH R13 BEGIN LO2HI - $20 EMIT + SPACE HI2LO SUB #2,R13 SUB #1,R14 @@ -577,89 +411,89 @@ BW1 XOR #-1,0(R15) [UNDEFINED] M*/ [IF] - RST_SET + RST_SET - CODE TSTBIT - MOV @R15+,R9 - AND @R9,R14 - MOV @R13+,R0 - ENDCODE + CODE TSTBIT + MOV @R15+,R9 + AND @R9,R14 + MOV @R13+,R0 + ENDCODE - $180E 8 TSTBIT + $180E $10 TSTBIT - RST_RET + RST_RET - [IF] ; MSP430FRxxxx with hardware_MPY + [IF] ; MSP430FRxxxx with hardware_MPY + + CODE M*/ + MOV 4(R15),&$4D4 + MOV 2(R15),&$4D6 + MOV @R15+,&$4C8 + MOV R14,R11 + MOV R0,R0 + MOV &$4E4,R12 + MOV &$4E6,R14 + MOV &$4E8,R10 + MOV #0,R6 + CMP #0,R10 + S< IF + XOR #-1,R12 + XOR #-1,R14 + XOR #-1,R10 + ADD #1,R12 + ADDC #0,R14 + ADDC #0,R10 + MOV #-1,R6 + THEN - CODE M*/ - MOV 4(R15),&$4D4 - MOV 2(R15),&$4D6 - MOV @R15+,&$4C8 - MOV R14,R11 - MOV R0,R0 - MOV &$4E4,R12 - MOV &$4E6,R14 - MOV &$4E8,R10 - MOV #0,R6 - CMP #0,R10 - S< IF - XOR #-1,R12 - XOR #-1,R14 - XOR #-1,R10 - ADD #1,R12 - ADDC #0,R14 - ADDC #0,R10 - MOV #-1,R6 - THEN + [ELSE] ; no hardware multiplier - [ELSE] ; no hardware multiplier + CODE M*/ + MOV #0,R6 + CMP #0,2(R15) + S< IF + XOR #-1,4(R15) + XOR #-1,2(R15) + ADD #1,4(R15) + ADDC #0,2(R15) + MOV #-1,R6 + THEN + CMP #0,0(R15) + S< IF + XOR #-1,0(R15) + ADD #1,0(R15) + XOR #-1,R6 + THEN + MOV 4(R15),R8 + MOV 2(R15),R11 + MOV #0,R5 + MOV @R15+,R12 + MOV #0,2(R15) + MOV #0,0(R15) + MOV #0,R10 + MOV #1,R9 + BEGIN BIT R9,R12 + 0<> IF ADD R8,2(R15) + ADDC R11,0(R15) + ADDC R5,R10 + THEN ADD R8,R8 + ADDC R11,R11 + ADDC R5,R5 + ADD R9,R9 + U>= UNTIL + MOV R14,R11 + MOV @R15,R14 + MOV 2(R15),R12 - CODE M*/ - MOV #0,R6 - CMP #0,2(R15) - S< IF - XOR #-1,4(R15) - XOR #-1,2(R15) - ADD #1,4(R15) - ADDC #0,2(R15) - MOV #-1,R6 - THEN - CMP #0,0(R15) - S< IF - XOR #-1,0(R15) - ADD #1,0(R15) - XOR #-1,R6 - THEN - MOV 4(R15),R8 - MOV 2(R15),R11 - MOV @R15+,R12 - MOV #0,R5 - MOV #0,2(R15) - MOV #0,0(R15) - MOV #0,R10 - MOV #1,R9 - BEGIN BIT R9,R12 - 0<> IF ADD R8,2(R15) - ADDC R11,0(R15) - ADDC R5,R10 - THEN ADD R8,R8 - ADDC R11,R11 - ADDC R5,R5 - ADD R9,R9 - U>= UNTIL - MOV R14,R11 - MOV @R15,R14 - MOV 2(R15),R12 - - [THEN] ; endcase of software/hardware_MPY + [THEN] ; endcase of software/hardware_MPY MOV #32,R5 CMP #0,R10 0= IF MOV R14,R10 - CALL #$403A + CALL #<#+$1A ELSE - CALL #$4042 + CALL #<#+$22 THEN MOV @R15+,0(R15) CMP #0,R6 @@ -677,8 +511,8 @@ BW1 XOR #-1,0(R15) THEN THEN THEN - MOV #$40A0,R5 - MOV #$40AE,R6 + MOV #[THEN]+$5C,R5 + MOV #[THEN]+$6A,R6 MOV @R13+,R0 ENDCODE [THEN] @@ -687,7 +521,7 @@ BW1 XOR #-1,0(R15) : 2VARIABLE CREATE HI2LO - ADD #4,&$1DC0 + ADD #4,&$1DBE MOV @R1+,R13 MOV @R13+,R0 ENDCODE @@ -741,6 +575,36 @@ BW1 XOR #-1,0(R15) ; Complement to pass DOUBLE TESTS ; ------------------------------- + [UNDEFINED] R> [IF] + CODE R> + SUB #2,R15 + MOV R14,0(R15) + MOV @R1+,R14 + MOV @R13+,R0 + ENDCODE + [THEN] + + [UNDEFINED] C@ [IF] + CODE C@ + MOV.B @R14,R14 + MOV @R13+,R0 + ENDCODE + [THEN] + + [UNDEFINED] DUP [IF] + CODE DUP +BW1 SUB #2,R15 + MOV R14,0(R15) + MOV @R13+,R0 + ENDCODE + + CODE ?DUP + CMP #0,R14 + 0<> ?GOTO BW1 + MOV @R13+,R0 + ENDCODE + [THEN] + [UNDEFINED] SWAP [IF] CODE SWAP MOV @R15,R10 @@ -750,6 +614,13 @@ BW1 XOR #-1,0(R15) ENDCODE [THEN] + [UNDEFINED] DROP [IF] + CODE DROP + MOV @R15+,R14 + MOV @R13+,R0 + ENDCODE + [THEN] + [UNDEFINED] VARIABLE [IF] : VARIABLE CREATE @@ -793,15 +664,15 @@ BW1 XOR #-1,0(R15) CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -809,9 +680,9 @@ BW1 XOR #-1,0(R15) [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -834,8 +705,8 @@ BW1 XOR #-1,0(R15) CODE DO SUB #2,R15 MOV R14,0(R15) - ADD #2,&$1DC0 - MOV &$1DC0,R14 + ADD #2,&$1DBE + MOV &$1DBE,R14 MOV #XDO,-2(R14) ADD #2,&$1C00 MOV &$1C00,R10 @@ -857,8 +728,8 @@ BW1 BIT #$100,R2 CODE LOOP MOV #XLOOP,R9 -BW2 ADD #4,&$1DC0 - MOV &$1DC0,R10 +BW2 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) BEGIN @@ -922,18 +793,27 @@ BW2 ADD #4,&$1DC0 ENDCODE [THEN] + [UNDEFINED] 0< [IF] + CODE 0< + ADD R14,R14 + SUBC R14,R14 + XOR #-1,R14 + MOV @R13+,R0 + ENDCODE + [THEN] + [UNDEFINED] SOURCE [IF] CODE SOURCE SUB #4,R15 MOV R14,2(R15) - MOV &$1DBA,R14 - MOV &$1DBC,0(R15) + MOV &$1DB8,R14 + MOV &$1DBA,0(R15) MOV @R13+,R0 ENDCODE [THEN] [UNDEFINED] >IN [IF] - $1DBE CONSTANT >IN + $1DBC CONSTANT >IN [THEN] [UNDEFINED] 1+ [IF] @@ -1069,17 +949,17 @@ BW2 ADD #4,&$1DC0 [UNDEFINED] .( [IF] ; " CODE .( ; " - MOV #0,&$1DB8 + MOV #0,&CAPS COLON ')' WORD COUNT TYPE - $20 $1DB8 ! + $20 CAPS ! ; IMMEDIATE [THEN] [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -1087,6 +967,106 @@ BW2 ADD #4,&$1DC0 ; IS CR [THEN] + $180E @ 0< ; test the switch: FLOORED/SYMETRIC DIVISION + [IF] + [UNDEFINED] FM/MOD [IF] + CODE FM/MOD + MOV R14,R12 + MOV @R15,R11 + CMP #0,R14 + S< IF + XOR #-1,R14 + ADD #1,R14 + THEN + CMP #0,0(R15) + S< IF + XOR #-1,2(R15) + XOR #-1,0(R15) + ADD #1,2(R15) + ADDC #0,0(R15) + THEN + PUSHM #2,R12 + CALL #<#+8 + MOV @R15+,R14 + POPM #2,R12 + CMP #0,R11 + S< IF + XOR #-1,0(R15) + ADD #1,0(R15) + THEN + XOR R12,R11 + CMP #0,R11 + S< IF + XOR #-1,R14 + ADD #1,R14 + THEN + + CMP #0,0(R15) + 0<> IF + CMP #1,R14 + S< IF + ADD R12,0(R15) + SUB #1,R14 + THEN + THEN + MOV @R13+,R0 + ENDCODE + [THEN] + [ELSE] + [UNDEFINED] SM/REM [IF] + CODE SM/REM + MOV R14,R12 + MOV @R15,R11 + CMP #0,R14 + S< IF + XOR #-1,R14 + ADD #1,R14 + THEN + CMP #0,0(R15) + S< IF + XOR #-1,2(R15) + XOR #-1,0(R15) + ADD #1,2(R15) + ADDC #0,0(R15) + THEN + PUSHM #2,R12 + CALL #<#+8 + MOV @R15+,R14 + POPM #2,R12 + CMP #0,R11 + S< IF + XOR #-1,0(R15) + ADD #1,0(R15) + THEN + XOR R12,R11 + CMP #0,R11 + S< IF + XOR #-1,R14 + ADD #1,R14 + THEN + MOV @R13+,R0 + ENDCODE + [THEN] + [THEN] + + [UNDEFINED] NIP [IF] + CODE NIP + ADD #2,R15 + MOV @R13+,R0 + ENDCODE + [THEN] + + [UNDEFINED] / [IF] + : / + >R DUP 0< R> + [ $180E @ 0< ] + [IF] FM/MOD + [ELSE] SM/REM + [THEN] + NIP + ; + [THEN] + 0 CONSTANT FALSE -1 CONSTANT TRUE @@ -1442,14 +1422,14 @@ T{ LO-2INT -1 M+ -> LO-2INT -1. D+ }T ; To correct the result if the division is floored, only used when ; necessary i.e. negative quotient and remainder <> 0 -: ?$8000 [ -3 2 / -2 = ] LITERAL IF 1. D- THEN ; +: ?FLOORED [ -3 2 / -2 = ] LITERAL IF 1. D- THEN ; T{ 5. 7 11 M*/ -> 3. }T -T{ 5. -7 11 M*/ -> -3. ?$8000 }T -T{ -5. 7 11 M*/ -> -3. ?$8000 }T +T{ 5. -7 11 M*/ -> -3. ?FLOORED }T +T{ -5. 7 11 M*/ -> -3. ?FLOORED }T T{ -5. -7 11 M*/ -> 3. }T T{ MAX-2INT 8 16 M*/ -> HI-2INT }T -T{ MAX-2INT -8 16 M*/ -> HI-2INT DNEGATE ?$8000 }T +T{ MAX-2INT -8 16 M*/ -> HI-2INT DNEGATE ?FLOORED }T T{ MIN-2INT 8 16 M*/ -> LO-2INT }T T{ MIN-2INT -8 16 M*/ -> LO-2INT DNEGATE }T T{ MAX-2INT MAX-INTD MAX-INTD M*/ -> MAX-2INT }T diff --git a/MSP430-FORTH/SD_430FR5994/FF_SPECS.4TH b/MSP430-FORTH/SD_430FR5994/FF_SPECS.4TH index 41fdd8e..1dbf445 100644 --- a/MSP430-FORTH/SD_430FR5994/FF_SPECS.4TH +++ b/MSP430-FORTH/SD_430FR5994/FF_SPECS.4TH @@ -7,10 +7,10 @@ SUB #2,R15 MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" RST_RET ; @@ -129,15 +129,15 @@ FW1 AND #0,R14 CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -145,9 +145,9 @@ FW1 AND #0,R14 [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -162,9 +162,9 @@ FW1 AND #0,R14 ENDCODE IMMEDIATE CODE UNTIL - MOV #$4096,R9 -BW1 ADD #4,&$1DC0 - MOV &$1DC0,R10 + MOV #[THEN]+$52,R9 +BW1 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) MOV @R15+,R14 @@ -172,7 +172,7 @@ BW1 ADD #4,&$1DC0 ENDCODE IMMEDIATE CODE AGAIN - MOV #$409C,R9 + MOV #[THEN]+$58,R9 GOTO BW1 ENDCODE IMMEDIATE @@ -200,8 +200,8 @@ BW1 ADD #4,&$1DC0 CODE DO SUB #2,R15 MOV R14,0(R15) - ADD #2,&$1DC0 - MOV &$1DC0,R14 + ADD #2,&$1DBE + MOV &$1DBE,R14 MOV #XDO,-2(R14) ADD #2,&$1C00 MOV &$1C00,R10 @@ -223,8 +223,8 @@ BW1 BIT #$100,R2 CODE LOOP MOV #XLOOP,R9 -BW2 ADD #4,&$1DC0 - MOV &$1DC0,R10 +BW2 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) BEGIN @@ -332,7 +332,7 @@ BW2 ADD #4,&$1DC0 [UNDEFINED] UM/MOD [IF] CODE UM/MOD PUSH #DROP - MOV #$4028,R0 + MOV #<#+8,R0 ENDCODE [THEN] @@ -371,7 +371,7 @@ BW2 ADD #4,&$1DC0 [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -414,9 +414,16 @@ BW2 ADD #4,&$1DC0 ; end of definitions we need ; -------------------------- + CODE 2*DUP + SUB #2,R15 + ADD R14,R14 + MOV R14,0(R15) + MOV @R13+,R0 + ENDCODE + [UNDEFINED] S? [IF] CODE S? - MOV #S"+10,R0 + MOV #S"+$0A,R0 ENDCODE IMMEDIATE [THEN] @@ -447,6 +454,7 @@ BW2 ADD #4,&$1DC0 MOV.B @R9+,R14 RRA R14 MOV R14,R10 + ADD #1,R14 BIT #1,R10 0= IF ADD #1,R10 @@ -456,7 +464,6 @@ BW2 ADD #4,&$1DC0 0<> WHILE MOV @R15,R9 REPEAT - MOV R9,0(R15) MOV @R13+,R0 ENDCODE [THEN] @@ -465,6 +472,7 @@ BW2 ADD #4,&$1DC0 RST_RET ECHO ESC [8;42;80t + CR ESC [7m CR ." FastForth V" $180A @ @@ -510,18 +518,15 @@ BW2 ADD #4,&$1DC0 - U. ." bytes" ESC [0m CR + ." /COUNTED-STRING = 255" CR ." /HOLD = 34" CR ." /PAD = 84" CR ." ADDRESS-UNIT-BITS = 16" CR - [DEFINED] {CORE_ANS} - [IF] ." FLOORED DIVISION = " - $180E @ - 0< IF ." true" - ELSE ." false" - THEN CR - [THEN] + [DEFINED] SM/REM [IF] ." false" [THEN] + [DEFINED] FM/MOD [IF] ." true" [THEN] + CR ." MAX-CHAR = 255" CR ." MAX-N = 32767" CR ." MAX-U = 65535" CR @@ -529,57 +534,71 @@ BW2 ADD #4,&$1DC0 ." MAX-UD = 4294967295" CR ." STACK-CELLS = 48" CR ." RETURN-STACK-CELLS= 48" CR - ." Definitions are always UPPERCASE." CR - CR ESC [7m ." Kernel add-ons" ESC [0m CR + ." Definitions are forced UPPERCASE" CR + + CR ESC [7m ." KERNEL add-ons" ESC [0m CR $180E @ - 2* DUP 0< IF ." 32.768kHz LF XTAL" CR THEN - 2* DUP 0< IF ." /RTS /CTS " 2* - ELSE 2* DUP - 0< IF ." /RTS " THEN - THEN - 2* DUP 0< IF ." XON/XOFF " THEN - 2* DUP 0< IF ." Half-Duplex " THEN - 2* DUP 0< IF ." I2C_Master TERMINAL" - ELSE ." UART TERMINAL" THEN CR - 2* DUP 0< IF 2* DUP 0< IF ." DOUBLE and " - THEN ." Q15.16 numbers handling" CR - ELSE 2* DUP 0< IF ." DOUBLE numbers handling" CR - THEN + 2*DUP 0< IF ." 32.768kHz LF XTAL" CR THEN + 2*DUP 0< IF ." /CTS " THEN + 2*DUP 0< IF ." /RTS " THEN + 2*DUP 0< IF ." XON/XOFF " THEN + 2*DUP 0< IF ." Half-Duplex " THEN + 2*DUP 0< IF ." I2C_Master TERMINAL" + ELSE ." UART TERMINAL" + THEN CR + 2*DUP 0< IF 2*DUP + 0< IF ." DOUBLE and " + THEN ." Q15.16 numbers handling" CR + ELSE 2*DUP + 0< IF ." DOUBLE numbers handling" CR + THEN THEN - 2* DUP 0< IF ." MSP430_X assembler with TI's syntax" - CR 2* 2* - ELSE - 2* DUP - 0< IF ." MSP430 Assembler" - 2* DUP - 0< IF ." , 20bits extended addresses," - THEN - ELSE 2* + 2*DUP 0< IF ." MSP430 16/20bits" + ELSE 2*DUP ." MSP430 16bits" + 0< IF ." (20bits addr)" THEN - ." with TI's syntax" CR - THEN DROP + THEN ." assembler, with TI's syntax" CR + DROP [DEFINED] FORTH [IF] ." word-set management" CR [THEN] - [DEFINED] LOAD" [IF] ." SD_CARD Load" CR + [DEFINED] LOAD" [IF] ." SD_CARD Load + Bootloader" CR + [THEN] + [DEFINED] READ" [IF] ." SD_CARD Read/Write/Del/CopyTERM2SD" CR + [THEN] + + CR ESC [7m ." EXTENSIONS" ESC [0m + [DEFINED] {CORE_ANS} [IF] CR ." CORE ANS94 'CORETEST passed'" + [THEN] + [DEFINED] {DOUBLE} [IF] CR ." DOUBLE numbers set" + [THEN] + [DEFINED] {UTILITY} [IF] CR ." UTILITY" + [THEN] + [DEFINED] {FIXPOINT} [IF] CR ." Q15.16 ADD SUB MUL DIV" + [THEN] + [DEFINED] {CORDIC} [IF] CR ." CORDIC engine" [THEN] - [DEFINED] BOOT [IF] ." SD_CARD Bootloader" CR + [DEFINED] {SD_TOOLS} [IF] CR ." SD_TOOLS" [THEN] - [DEFINED] READ" [IF] ." SD_CARD Read/Write" CR + [DEFINED] {RTC} [IF] CR ." RTC utility" [THEN] - $1DC2 + [DEFINED] {UARTI2CS} [IF] CR ." UART to I2C_FastForth bridge" + [THEN] + CR + + $1DC0 BEGIN @ ?DUP WHILE - CR ESC [7m + ESC [7m DUP $180C @ 2* - [DEFINED] FORTH - [IF] DUP BODY>SQNFA + [IF] DUP BODY>SQNFA [ELSE] OVER @ IF S" hidden" ELSE S" FORTH" THEN - [THEN] - TYPE ." word-set" + [THEN] TYPE + ." word-set" ESC [0m CR $1CE4 $180C @ 2* @@ -590,8 +609,8 @@ BW2 ADD #4,&$1DC0 DO DUP I $1CE4 + @ U< IF - DROP DROP - I DUP $1CE4 + @ + DROP DROP I + DUP $1CE4 + @ THEN 2 +LOOP ?DUP @@ -608,25 +627,6 @@ BW2 ADD #4,&$1DC0 DROP CR REPEAT - DROP - CR ESC [7m ." EXTENSIONS" ESC [0m - [DEFINED] {CORE_ANS} [IF] CR ." CORE ANS94" - [THEN] - [DEFINED] {DOUBLE} [IF] CR ." DOUBLE numbers set" - [THEN] - [DEFINED] {UTILITY} [IF] CR ." UTILITY" - [THEN] - [DEFINED] {FIXPOINT} [IF] CR ." Q15.16 ADD SUB MUL DIV" - [THEN] - [DEFINED] {CORDIC} [IF] CR ." CORDIC engine" - [THEN] - [DEFINED] {SD_TOOLS} [IF] CR ." SD_TOOLS" - [THEN] - [DEFINED] {RTC} [IF] CR ." RTC utility" - [THEN] - [DEFINED] {UARTI2CS} [IF] CR ." UART to I2C_FastForth bridge" - [THEN] - CR SYS ; diff --git a/MSP430-FORTH/SD_430FR5994/FIXPOINT.4TH b/MSP430-FORTH/SD_430FR5994/FIXPOINT.4TH index aacdf93..e98fb72 100644 --- a/MSP430-FORTH/SD_430FR5994/FIXPOINT.4TH +++ b/MSP430-FORTH/SD_430FR5994/FIXPOINT.4TH @@ -11,10 +11,10 @@ 0<> IF MOV #0,R14 THEN MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" build FastForth with Q15.16_INPUT addon !" RST_RET $1B EMIT $63 EMIT diff --git a/MSP430-FORTH/SD_430FR5994/MISC/TESTASM.4TH b/MSP430-FORTH/SD_430FR5994/MISC/TESTASM.4TH index a58e6c9..0cd7c1f 100644 --- a/MSP430-FORTH/SD_430FR5994/MISC/TESTASM.4TH +++ b/MSP430-FORTH/SD_430FR5994/MISC/TESTASM.4TH @@ -7,10 +7,10 @@ SUB #2,R15 MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ; ABORT_TEST_ASM @@ -188,15 +188,15 @@ BW1 SUB #2,R15 CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -220,9 +220,9 @@ BW1 SUB #2,R15 ENDCODE IMMEDIATE CODE UNTIL - MOV #$4096,R9 -BW1 ADD #4,&$1DC0 - MOV &$1DC0,R10 + MOV #[THEN]+$52,R9 +BW1 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) MOV @R15+,R14 @@ -230,7 +230,7 @@ BW1 ADD #4,&$1DC0 ENDCODE IMMEDIATE CODE AGAIN - MOV #$409C,R9 + MOV #[THEN]+$58,R9 GOTO BW1 ENDCODE IMMEDIATE @@ -259,8 +259,8 @@ BW1 ADD #4,&$1DC0 CODE DO SUB #2,R15 MOV R14,0(R15) - ADD #2,&$1DC0 - MOV &$1DC0,R14 + ADD #2,&$1DBE + MOV &$1DBE,R14 MOV #XDO,-2(R14) ADD #2,&$1C00 MOV &$1C00,R10 @@ -282,8 +282,8 @@ BW1 BIT #$100,R2 CODE LOOP MOV #XLOOP,R9 -BW2 ADD #4,&$1DC0 - MOV &$1DC0,R10 +BW2 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) BEGIN @@ -329,7 +329,7 @@ BW2 ADD #4,&$1DC0 [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -340,9 +340,9 @@ BW2 ADD #4,&$1DC0 [UNDEFINED] C, [IF] CODE C, - MOV &$1DC0,R10 + MOV &$1DBE,R10 MOV.B R14,0(R10) - ADD #1,&$1DC0 + ADD #1,&$1DBE MOV @R15+,R14 MOV @R13+,R0 ENDCODE @@ -610,7 +610,7 @@ TABLE20 PFA_TABLE ! TABLE 10 DUMP ; ----------------------------------------------------------------------- CODE TRUC - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE CODENNM diff --git a/MSP430-FORTH/SD_430FR5994/PROG10k.4TH b/MSP430-FORTH/SD_430FR5994/PROG10k.4TH index ba55cc3..6d18630 100644 --- a/MSP430-FORTH/SD_430FR5994/PROG10k.4TH +++ b/MSP430-FORTH/SD_430FR5994/PROG10k.4TH @@ -11,10 +11,10 @@ SUB #2,R15 MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" RST_RET ; @@ -48,15 +48,15 @@ CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -65,9 +65,9 @@ [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -79,7 +79,7 @@ [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -238,8 +238,8 @@ FW2 BIC #%1111_1000,0(R1) MOV #0,&$340 MOV #0,&$342 MOV #{RC5TOLCD},R10 - MOV #$406C,-2(R10) - MOV @R10+,&$183E + MOV #<#+$4C,-2(R10) + MOV @R10+,&$1842 MOV @R10+,&$FFEA MOV @R10+,&$FFDE THEN @@ -313,8 +313,8 @@ BW1 CALL #STOP_R2L MOV @R13+,R0 THEN MOV #STOP_R2L,&{RC5TOLCD}-2 - MOV &$183E,&{RC5TOLCD} - MOV #INIT_R2L,&$183E + MOV &$1842,&{RC5TOLCD} + MOV #INIT_R2L,&$1842 MOV &$FFEA,&{RC5TOLCD}+2 MOV #WDT_INT,&$FFEA MOV &$FFDE,&{RC5TOLCD}+4 @@ -324,7 +324,7 @@ BW1 CALL #STOP_R2L MOV &$1800,2(R15) MOV #0,0(R15) MOV #200,R14 - CALL #$4028 + CALL #<#+8 MOV @R15,&{RC5TOLCD}+6 ADD #4,R15 MOV @R15+,R14 @@ -333,7 +333,7 @@ BW1 CALL #STOP_R2L ." RC5toLCD is running," ." Type STOP to quit." HI2LO - MOV #ALLOT+$08,R0 + MOV #ALLOT+8,R0 ENDCODE RST_SET @@ -366,15 +366,15 @@ RST_SET CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -383,9 +383,9 @@ RST_SET [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -397,7 +397,7 @@ RST_SET [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -556,8 +556,8 @@ FW2 BIC #%1111_1000,0(R1) MOV #0,&$340 MOV #0,&$342 MOV #{RC5TOLCD},R10 - MOV #$406C,-2(R10) - MOV @R10+,&$183E + MOV #<#+$4C,-2(R10) + MOV @R10+,&$1842 MOV @R10+,&$FFEA MOV @R10+,&$FFDE THEN @@ -631,8 +631,8 @@ BW1 CALL #STOP_R2L MOV @R13+,R0 THEN MOV #STOP_R2L,&{RC5TOLCD}-2 - MOV &$183E,&{RC5TOLCD} - MOV #INIT_R2L,&$183E + MOV &$1842,&{RC5TOLCD} + MOV #INIT_R2L,&$1842 MOV &$FFEA,&{RC5TOLCD}+2 MOV #WDT_INT,&$FFEA MOV &$FFDE,&{RC5TOLCD}+4 @@ -642,7 +642,7 @@ BW1 CALL #STOP_R2L MOV &$1800,2(R15) MOV #0,0(R15) MOV #200,R14 - CALL #$4028 + CALL #<#+8 MOV @R15,&{RC5TOLCD}+6 ADD #4,R15 MOV @R15+,R14 @@ -651,7 +651,7 @@ BW1 CALL #STOP_R2L ." RC5toLCD is running," ." Type STOP to quit." HI2LO - MOV #ALLOT+$08,R0 + MOV #ALLOT+8,R0 ENDCODE RST_SET @@ -684,15 +684,15 @@ RST_SET CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -701,9 +701,9 @@ RST_SET [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -715,7 +715,7 @@ RST_SET [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -874,8 +874,8 @@ FW2 BIC #%1111_1000,0(R1) MOV #0,&$340 MOV #0,&$342 MOV #{RC5TOLCD},R10 - MOV #$406C,-2(R10) - MOV @R10+,&$183E + MOV #<#+$4C,-2(R10) + MOV @R10+,&$1842 MOV @R10+,&$FFEA MOV @R10+,&$FFDE THEN @@ -949,8 +949,8 @@ BW1 CALL #STOP_R2L MOV @R13+,R0 THEN MOV #STOP_R2L,&{RC5TOLCD}-2 - MOV &$183E,&{RC5TOLCD} - MOV #INIT_R2L,&$183E + MOV &$1842,&{RC5TOLCD} + MOV #INIT_R2L,&$1842 MOV &$FFEA,&{RC5TOLCD}+2 MOV #WDT_INT,&$FFEA MOV &$FFDE,&{RC5TOLCD}+4 @@ -960,7 +960,7 @@ BW1 CALL #STOP_R2L MOV &$1800,2(R15) MOV #0,0(R15) MOV #200,R14 - CALL #$4028 + CALL #<#+8 MOV @R15,&{RC5TOLCD}+6 ADD #4,R15 MOV @R15+,R14 @@ -969,7 +969,7 @@ BW1 CALL #STOP_R2L ." RC5toLCD is running," ." Type STOP to quit." HI2LO - MOV #ALLOT+$08,R0 + MOV #ALLOT+8,R0 ENDCODE RST_SET @@ -1002,15 +1002,15 @@ RST_SET CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -1019,9 +1019,9 @@ RST_SET [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -1033,7 +1033,7 @@ RST_SET [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -1192,8 +1192,8 @@ FW2 BIC #%1111_1000,0(R1) MOV #0,&$340 MOV #0,&$342 MOV #{RC5TOLCD},R10 - MOV #$406C,-2(R10) - MOV @R10+,&$183E + MOV #<#+$4C,-2(R10) + MOV @R10+,&$1842 MOV @R10+,&$FFEA MOV @R10+,&$FFDE THEN @@ -1267,8 +1267,8 @@ BW1 CALL #STOP_R2L MOV @R13+,R0 THEN MOV #STOP_R2L,&{RC5TOLCD}-2 - MOV &$183E,&{RC5TOLCD} - MOV #INIT_R2L,&$183E + MOV &$1842,&{RC5TOLCD} + MOV #INIT_R2L,&$1842 MOV &$FFEA,&{RC5TOLCD}+2 MOV #WDT_INT,&$FFEA MOV &$FFDE,&{RC5TOLCD}+4 @@ -1278,7 +1278,7 @@ BW1 CALL #STOP_R2L MOV &$1800,2(R15) MOV #0,0(R15) MOV #200,R14 - CALL #$4028 + CALL #<#+8 MOV @R15,&{RC5TOLCD}+6 ADD #4,R15 MOV @R15+,R14 @@ -1287,7 +1287,7 @@ BW1 CALL #STOP_R2L ." RC5toLCD is running," ." Type STOP to quit." HI2LO - MOV #ALLOT+$08,R0 + MOV #ALLOT+8,R0 ENDCODE RST_SET @@ -1320,15 +1320,15 @@ RST_SET CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -1337,9 +1337,9 @@ RST_SET [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -1351,7 +1351,7 @@ RST_SET [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -1510,8 +1510,8 @@ FW2 BIC #%1111_1000,0(R1) MOV #0,&$340 MOV #0,&$342 MOV #{RC5TOLCD},R10 - MOV #$406C,-2(R10) - MOV @R10+,&$183E + MOV #<#+$4C,-2(R10) + MOV @R10+,&$1842 MOV @R10+,&$FFEA MOV @R10+,&$FFDE THEN @@ -1585,8 +1585,8 @@ BW1 CALL #STOP_R2L MOV @R13+,R0 THEN MOV #STOP_R2L,&{RC5TOLCD}-2 - MOV &$183E,&{RC5TOLCD} - MOV #INIT_R2L,&$183E + MOV &$1842,&{RC5TOLCD} + MOV #INIT_R2L,&$1842 MOV &$FFEA,&{RC5TOLCD}+2 MOV #WDT_INT,&$FFEA MOV &$FFDE,&{RC5TOLCD}+4 @@ -1596,7 +1596,7 @@ BW1 CALL #STOP_R2L MOV &$1800,2(R15) MOV #0,0(R15) MOV #200,R14 - CALL #$4028 + CALL #<#+8 MOV @R15,&{RC5TOLCD}+6 ADD #4,R15 MOV @R15+,R14 @@ -1605,7 +1605,7 @@ BW1 CALL #STOP_R2L ." RC5toLCD is running," ." Type STOP to quit." HI2LO - MOV #ALLOT+$08,R0 + MOV #ALLOT+8,R0 ENDCODE RST_SET @@ -1638,15 +1638,15 @@ RST_SET CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -1655,9 +1655,9 @@ RST_SET [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -1669,7 +1669,7 @@ RST_SET [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -1828,8 +1828,8 @@ FW2 BIC #%1111_1000,0(R1) MOV #0,&$340 MOV #0,&$342 MOV #{RC5TOLCD},R10 - MOV #$406C,-2(R10) - MOV @R10+,&$183E + MOV #<#+$4C,-2(R10) + MOV @R10+,&$1842 MOV @R10+,&$FFEA MOV @R10+,&$FFDE THEN @@ -1903,8 +1903,8 @@ BW1 CALL #STOP_R2L MOV @R13+,R0 THEN MOV #STOP_R2L,&{RC5TOLCD}-2 - MOV &$183E,&{RC5TOLCD} - MOV #INIT_R2L,&$183E + MOV &$1842,&{RC5TOLCD} + MOV #INIT_R2L,&$1842 MOV &$FFEA,&{RC5TOLCD}+2 MOV #WDT_INT,&$FFEA MOV &$FFDE,&{RC5TOLCD}+4 @@ -1914,7 +1914,7 @@ BW1 CALL #STOP_R2L MOV &$1800,2(R15) MOV #0,0(R15) MOV #200,R14 - CALL #$4028 + CALL #<#+8 MOV @R15,&{RC5TOLCD}+6 ADD #4,R15 MOV @R15+,R14 @@ -1923,7 +1923,7 @@ BW1 CALL #STOP_R2L ." RC5toLCD is running," ." Type STOP to quit." HI2LO - MOV #ALLOT+$08,R0 + MOV #ALLOT+8,R0 ENDCODE RST_SET @@ -1956,15 +1956,15 @@ RST_SET CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -1973,9 +1973,9 @@ RST_SET [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -1987,7 +1987,7 @@ RST_SET [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -2146,8 +2146,8 @@ FW2 BIC #%1111_1000,0(R1) MOV #0,&$340 MOV #0,&$342 MOV #{RC5TOLCD},R10 - MOV #$406C,-2(R10) - MOV @R10+,&$183E + MOV #<#+$4C,-2(R10) + MOV @R10+,&$1842 MOV @R10+,&$FFEA MOV @R10+,&$FFDE THEN @@ -2221,8 +2221,8 @@ BW1 CALL #STOP_R2L MOV @R13+,R0 THEN MOV #STOP_R2L,&{RC5TOLCD}-2 - MOV &$183E,&{RC5TOLCD} - MOV #INIT_R2L,&$183E + MOV &$1842,&{RC5TOLCD} + MOV #INIT_R2L,&$1842 MOV &$FFEA,&{RC5TOLCD}+2 MOV #WDT_INT,&$FFEA MOV &$FFDE,&{RC5TOLCD}+4 @@ -2232,7 +2232,7 @@ BW1 CALL #STOP_R2L MOV &$1800,2(R15) MOV #0,0(R15) MOV #200,R14 - CALL #$4028 + CALL #<#+8 MOV @R15,&{RC5TOLCD}+6 ADD #4,R15 MOV @R15+,R14 @@ -2241,7 +2241,7 @@ BW1 CALL #STOP_R2L ." RC5toLCD is running," ." Type STOP to quit." HI2LO - MOV #ALLOT+$08,R0 + MOV #ALLOT+8,R0 ENDCODE RST_SET @@ -2274,15 +2274,15 @@ RST_SET CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -2291,9 +2291,9 @@ RST_SET [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -2305,7 +2305,7 @@ RST_SET [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -2464,8 +2464,8 @@ FW2 BIC #%1111_1000,0(R1) MOV #0,&$340 MOV #0,&$342 MOV #{RC5TOLCD},R10 - MOV #$406C,-2(R10) - MOV @R10+,&$183E + MOV #<#+$4C,-2(R10) + MOV @R10+,&$1842 MOV @R10+,&$FFEA MOV @R10+,&$FFDE THEN @@ -2539,8 +2539,8 @@ BW1 CALL #STOP_R2L MOV @R13+,R0 THEN MOV #STOP_R2L,&{RC5TOLCD}-2 - MOV &$183E,&{RC5TOLCD} - MOV #INIT_R2L,&$183E + MOV &$1842,&{RC5TOLCD} + MOV #INIT_R2L,&$1842 MOV &$FFEA,&{RC5TOLCD}+2 MOV #WDT_INT,&$FFEA MOV &$FFDE,&{RC5TOLCD}+4 @@ -2550,7 +2550,7 @@ BW1 CALL #STOP_R2L MOV &$1800,2(R15) MOV #0,0(R15) MOV #200,R14 - CALL #$4028 + CALL #<#+8 MOV @R15,&{RC5TOLCD}+6 ADD #4,R15 MOV @R15+,R14 @@ -2559,7 +2559,7 @@ BW1 CALL #STOP_R2L ." RC5toLCD is running," ." Type STOP to quit." HI2LO - MOV #ALLOT+$08,R0 + MOV #ALLOT+8,R0 ENDCODE RST_SET @@ -2592,15 +2592,15 @@ RST_SET CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -2609,9 +2609,9 @@ RST_SET [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -2623,7 +2623,7 @@ RST_SET [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -2782,8 +2782,8 @@ FW2 BIC #%1111_1000,0(R1) MOV #0,&$340 MOV #0,&$342 MOV #{RC5TOLCD},R10 - MOV #$406C,-2(R10) - MOV @R10+,&$183E + MOV #<#+$4C,-2(R10) + MOV @R10+,&$1842 MOV @R10+,&$FFEA MOV @R10+,&$FFDE THEN @@ -2857,8 +2857,8 @@ BW1 CALL #STOP_R2L MOV @R13+,R0 THEN MOV #STOP_R2L,&{RC5TOLCD}-2 - MOV &$183E,&{RC5TOLCD} - MOV #INIT_R2L,&$183E + MOV &$1842,&{RC5TOLCD} + MOV #INIT_R2L,&$1842 MOV &$FFEA,&{RC5TOLCD}+2 MOV #WDT_INT,&$FFEA MOV &$FFDE,&{RC5TOLCD}+4 @@ -2868,7 +2868,7 @@ BW1 CALL #STOP_R2L MOV &$1800,2(R15) MOV #0,0(R15) MOV #200,R14 - CALL #$4028 + CALL #<#+8 MOV @R15,&{RC5TOLCD}+6 ADD #4,R15 MOV @R15+,R14 @@ -2877,7 +2877,7 @@ BW1 CALL #STOP_R2L ." RC5toLCD is running," ." Type STOP to quit." HI2LO - MOV #ALLOT+$08,R0 + MOV #ALLOT+8,R0 ENDCODE RST_RET diff --git a/MSP430-FORTH/SD_430FR5994/RC5toLCD.4TH b/MSP430-FORTH/SD_430FR5994/RC5toLCD.4TH index 64ae8f3..3e76dfd 100644 --- a/MSP430-FORTH/SD_430FR5994/RC5toLCD.4TH +++ b/MSP430-FORTH/SD_430FR5994/RC5toLCD.4TH @@ -8,10 +8,10 @@ SUB #2,R15 MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" RST_RET ; @@ -45,15 +45,15 @@ CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -62,9 +62,9 @@ [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -76,7 +76,7 @@ [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -235,8 +235,8 @@ FW2 BIC #%1111_1000,0(R1) MOV #0,&$340 MOV #0,&$342 MOV #{RC5TOLCD},R10 - MOV #$406C,-2(R10) - MOV @R10+,&$183E + MOV #<#+$4C,-2(R10) + MOV @R10+,&$1842 MOV @R10+,&$FFEA MOV @R10+,&$FFDE THEN @@ -310,8 +310,8 @@ BW1 CALL #STOP_R2L MOV @R13+,R0 THEN MOV #STOP_R2L,&{RC5TOLCD}-2 - MOV &$183E,&{RC5TOLCD} - MOV #INIT_R2L,&$183E + MOV &$1842,&{RC5TOLCD} + MOV #INIT_R2L,&$1842 MOV &$FFEA,&{RC5TOLCD}+2 MOV #WDT_INT,&$FFEA MOV &$FFDE,&{RC5TOLCD}+4 @@ -321,7 +321,7 @@ BW1 CALL #STOP_R2L MOV &$1800,2(R15) MOV #0,0(R15) MOV #200,R14 - CALL #$4028 + CALL #<#+8 MOV @R15,&{RC5TOLCD}+6 ADD #4,R15 MOV @R15+,R14 @@ -330,7 +330,7 @@ BW1 CALL #STOP_R2L ." RC5toLCD is running," ." Type STOP to quit." HI2LO - MOV #ALLOT+$08,R0 + MOV #ALLOT+8,R0 ENDCODE RST_SET diff --git a/MSP430-FORTH/SD_430FR5994/RTC.4TH b/MSP430-FORTH/SD_430FR5994/RTC.4TH index 29f72f4..b176bc5 100644 --- a/MSP430-FORTH/SD_430FR5994/RTC.4TH +++ b/MSP430-FORTH/SD_430FR5994/RTC.4TH @@ -11,10 +11,10 @@ 0<> IF MOV #0,R14 THEN MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" target without LF_XTAL !" RST_RET ; @@ -162,15 +162,15 @@ BW1 SUB #2,R15 CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -178,9 +178,9 @@ BW1 SUB #2,R15 [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -204,8 +204,8 @@ BW1 SUB #2,R15 CODE DO SUB #2,R15 MOV R14,0(R15) - ADD #2,&$1DC0 - MOV &$1DC0,R14 + ADD #2,&$1DBE + MOV &$1DBE,R14 MOV #XDO,-2(R14) ADD #2,&$1C00 MOV &$1C00,R10 @@ -227,8 +227,8 @@ BW1 BIT #$100,R2 CODE LOOP MOV #XLOOP,R9 -BW2 ADD #4,&$1DC0 - MOV &$1DC0,R10 +BW2 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) BEGIN @@ -263,9 +263,9 @@ BW2 ADD #4,&$1DC0 ENDCODE IMMEDIATE CODE UNTIL - MOV #$4096,R9 -BW1 ADD #4,&$1DC0 - MOV &$1DC0,R10 + MOV #[THEN]+$52,R9 +BW1 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) MOV @R15+,R14 @@ -273,7 +273,7 @@ BW1 ADD #4,&$1DC0 ENDCODE IMMEDIATE CODE AGAIN - MOV #$409C,R9 + MOV #[THEN]+$58,R9 GOTO BW1 ENDCODE IMMEDIATE @@ -373,7 +373,7 @@ BW1 MOV R14,&$4C8 [UNDEFINED] UM/MOD [IF] CODE UM/MOD PUSH #DROP - MOV #$4028,R0 + MOV #<#+8,R0 ENDCODE [THEN] @@ -526,22 +526,22 @@ BW1 MOV R14,&$4C8 [UNDEFINED] EVALUATE [IF] CODENNM - MOV @R1+,&$1DBE MOV @R1+,&$1DBC MOV @R1+,&$1DBA + MOV @R1+,&$1DB8 MOV @R1+,R13 MOV @R13+,R0 ENDCODE CODE EVALUATE - MOV #$1DBA,R9 + MOV #$1DB8,R9 MOV @R9+,R12 MOV @R9+,R11 MOV @R9+,R10 PUSHM #4,R13 MOV R0,R13 ADD #8,R13 - MOV #\+$08,R0 + MOV #\+8,R0 MOV #0,R3 ENDCODE , @@ -551,7 +551,7 @@ BW1 MOV R14,&$4C8 [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -561,7 +561,7 @@ BW1 MOV R14,&$4C8 : SET_TIME ESC [8;42;80t - 39 0 DO CR LOOP + 42 0 DO CR LOOP ESC [H CR ." DATE (DMY): " $1CE4 DUP #84 @@ -579,5 +579,4 @@ BW1 MOV R14,&$4C8 RST_SET - ECHO - SET_TIME + ECHO SET_TIME diff --git a/MSP430-FORTH/SD_430FR5994/SD_TEST.4TH b/MSP430-FORTH/SD_430FR5994/SD_TEST.4TH index 7ebb9cc..06886c5 100644 --- a/MSP430-FORTH/SD_430FR5994/SD_TEST.4TH +++ b/MSP430-FORTH/SD_430FR5994/SD_TEST.4TH @@ -13,10 +13,10 @@ MOV #0,0(R15) [THEN] MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" build FastForth with SD_CARD_READ_WRITE addon!" RST_RET ; @@ -67,15 +67,15 @@ CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -84,9 +84,9 @@ [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -101,9 +101,9 @@ ENDCODE IMMEDIATE CODE UNTIL - MOV #$4096,R9 -BW1 ADD #4,&$1DC0 - MOV &$1DC0,R10 + MOV #[THEN]+$52,R9 +BW1 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) MOV @R15+,R14 @@ -111,7 +111,7 @@ BW1 ADD #4,&$1DC0 ENDCODE IMMEDIATE CODE AGAIN - MOV #$409C,R9 + MOV #[THEN]+$58,R9 GOTO BW1 ENDCODE IMMEDIATE @@ -139,8 +139,8 @@ BW1 ADD #4,&$1DC0 CODE DO SUB #2,R15 MOV R14,0(R15) - ADD #2,&$1DC0 - MOV &$1DC0,R14 + ADD #2,&$1DBE + MOV &$1DBE,R14 MOV #XDO,-2(R14) ADD #2,&$1C00 MOV &$1C00,R10 @@ -162,8 +162,8 @@ BW1 BIT #$100,R2 CODE LOOP MOV #XLOOP,R9 -BW2 ADD #4,&$1DC0 - MOV &$1DC0,R10 +BW2 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) BEGIN @@ -335,7 +335,7 @@ BW1 SUB #2,R15 [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -461,7 +461,7 @@ BW1 SUB #2,R15 MOV R8,&$201E CMP #$200,R8 U>= IF - CALL #WRITE+4 + CALL #WRITE+$4 THEN MOV @R13+,R0 ENDCODE @@ -473,6 +473,25 @@ BW1 SUB #2,R15 CLOSE ; + CODE START_TIMER + MOV #%01_0010_0100,&$3C0 + MOV @R13+,R0 + ENDCODE + + CODE DISPLAY_TIME + SUB #6,R15 + MOV R14,4(R15) + MOV &$3D0,2(R15) + MOV #0,&$3C0 + MOV #0,0(R15) + MOV #33,R14 + CALL #<#+8 + MOV @R15+,R14 + ADD #2,R15 + COLON + ECHO ." , done in " U. ." ms" + ; + : SD_TEST ECHO $0D EMIT @@ -480,14 +499,14 @@ BW1 SUB #2,R15 ." ----------" CR ." SD_TESTS " CR ." ----------" CR - ." ? Fast Forth Specifs" CR - ." 0 Set date and time" CR + ." ? Fast Forth Specs" CR + ." 0 Set date and time (MSP430FR5xxx)" CR ." 1 Load {UTILITY} words" CR ." 2 Load {SD_TOOLS} words" CR ." 3 Load {CORE_ANS} words" CR - ." 4 Load ANS core tests" CR - ." 5 Load a source file to make 10k program" CR - ." 6 Read it only (47k)" CR + ." 4 Execute ANS core tests" CR + ." 5 Load a source file to compile 10k program" CR + ." 6 Read it only (51k)" CR ." 7 write FORTH dump in YOURFILE.TXT" CR ." 8 append FORTH dump to YOURFILE.TXT" CR ." 9 delete YOURFILE.TXT" CR @@ -495,24 +514,31 @@ BW1 SUB #2,R15 KEY DUP $0D = IF KEY DROP ." 'CR'" ELSE DUP EMIT - THEN CR - NOECHO + THEN RST_RET + NOECHO CASE - '?' OF LOAD" FF_SPECS.4TH" ENDOF - '0' OF LOAD" RTC.4TH" ENDOF - '1' OF LOAD" UTILITY.4TH" ENDOF - '2' OF LOAD" SD_TOOLS.4TH" ENDOF - '3' OF LOAD" CORE_ANS.4TH" ENDOF - '4' OF LOAD" CORETEST.4TH" ENDOF - '5' OF LOAD" PROG10K.4TH" ENDOF - '6' OF READ" PROG10K.4TH" - BEGIN READ UNTIL ENDOF - '7' OF WRITE" YOURFILE.TXT" - WRITEDUMP ENDOF - '8' OF APPEND" YOURFILE.TXT" - WRITEDUMP ENDOF - '9' OF DEL" YOURFILE.TXT" ENDOF + '?' OF CR LOAD" FF_SPECS.4TH" ENDOF + '0' OF CR LOAD" RTC.4TH" ENDOF + '1' OF CR LOAD" UTILITY.4TH" ENDOF + '2' OF CR LOAD" SD_TOOLS.4TH" ENDOF + '3' OF CR LOAD" CORE_ANS.4TH" ENDOF + '4' OF CR LOAD" CORETEST.4TH" ENDOF + '5' OF CR LOAD" PROG10K.4TH" ENDOF + + '6' OF START_TIMER + READ" PROG10K.4TH" + BEGIN READ UNTIL + DISPLAY_TIME ENDOF + '7' OF START_TIMER + WRITE" YOURFILE.TXT" + WRITEDUMP DISPLAY_TIME ENDOF + '8' OF START_TIMER + APPEND" YOURFILE.TXT" + WRITEDUMP DISPLAY_TIME ENDOF + '9' OF START_TIMER + DEL" YOURFILE.TXT" + DISPLAY_TIME ENDOF ENDCASE ; diff --git a/MSP430-FORTH/SD_430FR5994/SD_TOOLS.4TH b/MSP430-FORTH/SD_430FR5994/SD_TOOLS.4TH index 71fcc54..7b9ceac 100644 --- a/MSP430-FORTH/SD_430FR5994/SD_TOOLS.4TH +++ b/MSP430-FORTH/SD_430FR5994/SD_TOOLS.4TH @@ -15,10 +15,10 @@ MOV #0,0(R15) [THEN] MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" Build FastForth with SD_CARD_LOADER addon!" RST_RET ; @@ -164,8 +164,8 @@ FW1 MOV @R15+,R14 CODE DO SUB #2,R15 MOV R14,0(R15) - ADD #2,&$1DC0 - MOV &$1DC0,R14 + ADD #2,&$1DBE + MOV &$1DBE,R14 MOV #XDO,-2(R14) ADD #2,&$1C00 MOV &$1C00,R10 @@ -187,8 +187,8 @@ BW1 BIT #$100,R2 CODE LOOP MOV #XLOOP,R9 -BW2 ADD #4,&$1DC0 - MOV &$1DC0,R10 +BW2 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) BEGIN @@ -229,7 +229,7 @@ BW2 ADD #4,&$1DC0 [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -288,7 +288,7 @@ BW1 MOV R14,R9 CODE CLUSTER. BW2 BIT.B #4,&$260 0<> IF - MOV #COLD,R0 + MOV #SYS+$14,R0 THEN MOV.B &$2012,R10 MOV @R15,R9 diff --git a/MSP430-FORTH/SD_430FR5994/TEST.4TH b/MSP430-FORTH/SD_430FR5994/TEST.4TH index 280f98c..0654b31 100644 --- a/MSP430-FORTH/SD_430FR5994/TEST.4TH +++ b/MSP430-FORTH/SD_430FR5994/TEST.4TH @@ -3,10 +3,10 @@ SUB #2,R15 MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ; ABORT_CORE_ANS @@ -48,7 +48,7 @@ [UNDEFINED] ABORT [IF] CODE ABORT - MOV #ALLOT+$08,R0 + MOV #ALLOT+8,R0 ENDCODE [THEN] @@ -196,9 +196,9 @@ BW1 SUB #2,R15 [UNDEFINED] C, [IF] CODE C, - MOV &$1DC0,R10 + MOV &$1DBE,R10 MOV.B R14,0(R10) - ADD #1,&$1DC0 + ADD #1,&$1DBE MOV @R15+,R14 MOV @R13+,R0 ENDCODE @@ -294,15 +294,15 @@ FW1 MOV #-1,R14 CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -311,9 +311,9 @@ FW1 MOV #-1,R14 [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -329,9 +329,9 @@ FW1 MOV #-1,R14 ENDCODE IMMEDIATE CODE UNTIL - MOV #$4096,R9 -BW1 ADD #4,&$1DC0 - MOV &$1DC0,R10 + MOV #[THEN]+$52,R9 +BW1 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) MOV @R15+,R14 @@ -339,7 +339,7 @@ BW1 ADD #4,&$1DC0 ENDCODE IMMEDIATE CODE AGAIN - MOV #$409C,R9 + MOV #[THEN]+$58,R9 GOTO BW1 ENDCODE IMMEDIATE @@ -368,8 +368,8 @@ BW1 ADD #4,&$1DC0 CODE DO SUB #2,R15 MOV R14,0(R15) - ADD #2,&$1DC0 - MOV &$1DC0,R14 + ADD #2,&$1DBE + MOV &$1DBE,R14 MOV #XDO,-2(R14) ADD #2,&$1C00 MOV &$1C00,R10 @@ -391,8 +391,8 @@ BW1 BIT #$100,R2 CODE LOOP MOV #XLOOP,R9 -BW2 ADD #4,&$1DC0 - MOV &$1DC0,R10 +BW2 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) BEGIN @@ -452,10 +452,10 @@ BW2 ADD #4,&$1DC0 [UNDEFINED] LEAVE [IF] CODE LEAVE - MOV &$1DC0,R10 + MOV &$1DBE,R10 MOV #UNLOOP,0(R10) - MOV #$409C,2(R10) - ADD #6,&$1DC0 + MOV #[THEN]+$58,2(R10) + ADD #6,&$1DBE ADD #2,&$1C00 ADD #4,R10 MOV &$1C00,R9 @@ -607,7 +607,7 @@ FW1 MOV @R15+,R14 MOV @R13+,R0 ENDCODE - $180E 8 TSTBIT + $180E $10 TSTBIT RST_RET @@ -670,7 +670,7 @@ BW1 MOV R14,&$4C8 [IF] CODE UM/MOD PUSH #DROP - MOV #$4028,R0 + MOV #<#+8,R0 ENDCODE [THEN] @@ -694,7 +694,7 @@ BW1 MOV R14,&$4C8 ADDC #0,0(R15) THEN PUSHM #2,R12 - CALL #$4028 + CALL #<#+8 MOV @R15+,R14 POPM #2,R12 CMP #0,R11 @@ -739,7 +739,7 @@ BW1 MOV R14,&$4C8 ADDC #0,0(R15) THEN PUSHM #2,R12 - CALL #$4028 + CALL #<#+8 MOV @R15+,R14 POPM #2,R12 CMP #0,R11 @@ -924,8 +924,8 @@ BW1 MOV R14,&$4C8 [UNDEFINED] ALIGN [IF] CODE ALIGN - BIT #1,&$1DC0 - ADDC #0,&$1DC0 + BIT #1,&$1DBE + ADDC #0,&$1DBE MOV @R13+,R0 ENDCODE [THEN] @@ -1063,12 +1063,12 @@ BW1 MOV R14,&$4C8 [IF] CODE .( ; " PUSH R13 - MOV #0,&$1DB8 + MOV #0,&CAPS LO2HI ')' WORD COUNT TYPE HI2LO - MOV #$20,&$1DB8 + MOV #$20,&CAPS MOV @R1+,R13 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -1095,22 +1095,22 @@ BW1 MOV R14,&$4C8 [IF] CODENNM - MOV @R1+,&$1DBE MOV @R1+,&$1DBC MOV @R1+,&$1DBA + MOV @R1+,&$1DB8 MOV @R1+,R13 MOV @R13+,R0 ENDCODE CODE EVALUATE - MOV #$1DBA,R9 + MOV #$1DB8,R9 MOV @R9+,R12 MOV @R9+,R11 MOV @R9+,R10 PUSHM #4,R13 MOV R0,R13 ADD #8,R13 - MOV #\+$08,R0 + MOV #\+8,R0 MOV #0,R3 ENDCODE , @@ -1120,9 +1120,9 @@ BW1 MOV R14,&$4C8 [UNDEFINED] RECURSE [IF] CODE RECURSE - MOV &$1DC0,R9 - MOV &$1DDC,0(R9) - ADD #2,&$1DC0 + MOV &$1DBE,R9 + MOV &$1DDA,0(R9) + ADD #2,&$1DBE MOV @R13+,R0 ENDCODE IMMEDIATE [THEN] @@ -1132,8 +1132,8 @@ BW1 MOV R14,&$4C8 CODE SOURCE SUB #4,R15 MOV R14,2(R15) - MOV &$1DBA,R14 - MOV &$1DBC,0(R15) + MOV &$1DB8,R14 + MOV &$1DBA,0(R15) MOV @R13+,R0 ENDCODE [THEN] @@ -1173,7 +1173,7 @@ BW1 MOV R14,&$4C8 [UNDEFINED] >IN [IF] - $1DBE CONSTANT >IN + $1DBC CONSTANT >IN [THEN] [UNDEFINED] PAD @@ -1210,7 +1210,7 @@ BW1 MOV R14,&$4C8 CREATE HI2LO MOV #$4030,-4(R10) - MOV #$409E,-2(R10) + MOV #[THEN],-2(R10) MOV @R1+,R13 MOV @R13+,R0 ENDCODE @@ -1219,7 +1219,7 @@ BW1 MOV R14,&$4C8 [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME diff --git a/MSP430-FORTH/SD_430FR5994/TESTXASM.4TH b/MSP430-FORTH/SD_430FR5994/TESTXASM.4TH index 5dbeb90..4b4479f 100644 --- a/MSP430-FORTH/SD_430FR5994/TESTXASM.4TH +++ b/MSP430-FORTH/SD_430FR5994/TESTXASM.4TH @@ -7,10 +7,10 @@ SUB #2,R15 MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" RST_RET ; @@ -162,8 +162,8 @@ FW1 MOV @R15+,R14 CODE DO SUB #2,R15 MOV R14,0(R15) - ADD #2,&$1DC0 - MOV &$1DC0,R14 + ADD #2,&$1DBE + MOV &$1DBE,R14 MOV #XDO,-2(R14) ADD #2,&$1C00 MOV &$1C00,R10 @@ -185,8 +185,8 @@ BW1 BIT #$100,R2 CODE LOOP MOV #XLOOP,R9 -BW2 ADD #4,&$1DC0 - MOV &$1DC0,R10 +BW2 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) BEGIN @@ -227,7 +227,7 @@ BW2 ADD #4,&$1DC0 [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME diff --git a/MSP430-FORTH/SD_430FR5994/TSTWORDS.4TH b/MSP430-FORTH/SD_430FR5994/TSTWORDS.4TH index a049acd..33b19bc 100644 --- a/MSP430-FORTH/SD_430FR5994/TSTWORDS.4TH +++ b/MSP430-FORTH/SD_430FR5994/TSTWORDS.4TH @@ -3,10 +3,10 @@ SUB #2,R15 MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" RST_RET ; @@ -46,15 +46,15 @@ BW1 SUB #2,R15 CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -63,9 +63,9 @@ BW1 SUB #2,R15 [UNDEFINED] ELSE [IF] CODE ELSE - ADD #4,&$1DC0 - MOV &$1DC0,R10 - MOV #$409C,-4(R10) + ADD #4,&$1DBE + MOV &$1DBE,R10 + MOV #[THEN]+$58,-4(R10) MOV R10,0(R14) SUB #2,R10 MOV R10,R14 @@ -91,9 +91,9 @@ BW1 SUB #2,R15 ENDCODE IMMEDIATE CODE UNTIL - MOV #$4096,R9 -BW1 ADD #4,&$1DC0 - MOV &$1DC0,R10 + MOV #[THEN]+$52,R9 +BW1 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) MOV @R15+,R14 @@ -101,7 +101,7 @@ BW1 ADD #4,&$1DC0 ENDCODE IMMEDIATE CODE AGAIN - MOV #$409C,R9 + MOV #[THEN]+$58,R9 GOTO BW1 ENDCODE IMMEDIATE @@ -130,8 +130,8 @@ BW1 ADD #4,&$1DC0 CODE DO SUB #2,R15 MOV R14,0(R15) - ADD #2,&$1DC0 - MOV &$1DC0,R14 + ADD #2,&$1DBE + MOV &$1DBE,R14 MOV #XDO,-2(R14) ADD #2,&$1C00 MOV &$1C00,R10 @@ -153,8 +153,8 @@ BW1 BIT #$100,R2 CODE LOOP MOV #XLOOP,R9 -BW2 ADD #4,&$1DC0 - MOV &$1DC0,R10 +BW2 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) BEGIN diff --git a/MSP430-FORTH/SD_430FR5994/UARTI2CS.4TH b/MSP430-FORTH/SD_430FR5994/UARTI2CS.4TH index 76ac36b..70051ee 100644 --- a/MSP430-FORTH/SD_430FR5994/UARTI2CS.4TH +++ b/MSP430-FORTH/SD_430FR5994/UARTI2CS.4TH @@ -9,23 +9,19 @@ 0<> IF MOV #0,R14 THEN MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" <-- Ouch! unexpected I2C_FastForth target!" RST_RET ; ABORT_UARTI2CS - MARKER {UARTI2CS} 16 ALLOT - - CODE LEDS MOV @R13+,R0 ENDCODE - [UNDEFINED] = [IF] CODE = SUB @R15+,R14 @@ -35,13 +31,6 @@ ENDCODE [THEN] - [UNDEFINED] + [IF] - CODE + - ADD @R15+,R14 - MOV @R13+,R0 - ENDCODE - [THEN] - [UNDEFINED] TSTBIT [IF] CODE TSTBIT MOV @R15+,R9 @@ -76,13 +65,13 @@ BW1 BIC.B #$20,&$20C BIC.B #$20,&$204 BIC.B #$10,&$21A - CMP #$406C,&{UARTI2CS}-2 + CMP #<#+$4C,&{UARTI2CS}-2 0<> IF MOV #{UARTI2CS},R10 - MOV #$406C,-2(R10) - MOV @R10+,&$183A - MOV @R10+,&$183E - MOV @R10+,&$1840 + MOV #<#+$4C,-2(R10) + MOV @R10+,&$183C + MOV @R10+,&$1842 + MOV @R10+,&$1844 MOV @R10+,&$FFF0 MOV @R10+,&$FFDE THEN @@ -96,10 +85,11 @@ BW1 HDNCODE BACKGRND_U2I BIT #8,&$5CA - 0<> IF - MOV #WARM_IP_ADR,0(R1) - PUSH #$40BA -BW2 MOV #1,R14 + 0<> ?GOTO FW1 + BIT.B #$40,&$240 + 0= IF +FW1 MOV #1,R14 + MOV #SYS+$0E,0(R1) GOTO BW1 THEN BIC.B #$10,&$21C @@ -125,14 +115,12 @@ BW3 MOV &{UARTI2CS}+12,&$3C0 BIS.B #2,&$204 [THEN] CALL &{UARTI2CS}+2 - CMP #6,R14 - 0= ?GOTO BW2 CMP #$0E,R14 0<> IF CMP #$0A,R14 U>= ?GOTO BW1 THEN - MOV #ALLOT+$08,0(R1) + MOV #ALLOT+8,0(R1) MOV @R1+,R0 ENDCODE @@ -157,17 +145,17 @@ BW3 MOV &{UARTI2CS}+12,&$3C0 0<> UNTIL MOV.B #'c',&$5CE BEGIN - BIT.B #4,&$261 + BIT.B #2,&$261 0<> UNTIL BEGIN - BIC.B #6,&I2CSM_IFG - MOV R0,R0 - MOV.B &{UARTI2CS}+14,R10 - BEGIN - MOV #0,R3 - SUB #1,R10 - 0= UNTIL - BIT.B #6,&I2CSM_IFG + BIC.B #6,&I2CSM_IFG + MOV R0,R0 + MOV.B &{UARTI2CS}+14,R10 + BEGIN + MOV #0,R3 + SUB #1,R10 + 0= UNTIL + BIT.B #6,&I2CSM_IFG 0= UNTIL ADD #2,R1 MOV @R1,R0 @@ -285,7 +273,7 @@ FW2 THEN CMP.B #-1,R8 0= IF - MOV.B #0,R8 + MOV.B #1,&{UARTI2CS}+15 MOV.B #$0D,&$5CE BEGIN BIT #2,&$5DC @@ -327,6 +315,7 @@ FW2 CMP.B #4,R9 U>= IF MOV.B R9,R8 + MOV.B R8,&{UARTI2CS}+15 BIS.B #4,&$265 THEN THEN @@ -339,7 +328,7 @@ FW2 0<> UNTIL CMP.B #2,R9 U>= WHILE - MOV.B #0,R8 + BIC.B #2,&$265 CALL #KEY+8 BEGIN BIC #1,&$5DC @@ -351,6 +340,7 @@ FW2 0= UNTIL BIT #1,&$5DC 0= UNTIL + MOV.B #0,R8 REPEAT CALL #I2CM_STOP [DEFINED] LEDS [IF] @@ -358,7 +348,6 @@ FW2 [THEN] CMP.B #0,R9 0= IF - MOV.B R8,&{UARTI2CS}+15 MOV #ACCEPT+$1C,R0 THEN CALL #KEY+8 @@ -378,24 +367,24 @@ FW2 ." Connect to I2C_SLAVE at @" . $08 EMIT ." , TERATERM(Alt-B) " - ." or I2C_MASTER(S2) to quit..." + ." or I2C_MASTER(SW1) to quit..." HI2LO MOV @R1+,R13 BEGIN BIT #1,&$5CA 0= UNTIL - CMP #$406C,&{UARTI2CS}-2 + CMP #<#+$4C,&{UARTI2CS}-2 0= IF MOV #REMOVE_U2I,&{UARTI2CS}-2 - MOV &$183A,&{UARTI2CS} - MOV &$183E,&{UARTI2CS}+2 - MOV &$1840,&{UARTI2CS}+4 + MOV &$183C,&{UARTI2CS} + MOV #STOP_U2I,&$183C + MOV &$1842,&{UARTI2CS}+2 + MOV #HARD_U2I,&$1842 + MOV &$1844,&{UARTI2CS}+4 + MOV #BACKGRND_U2I,&$1844 MOV &$FFF0,&{UARTI2CS}+6 - MOV &$FFDE,&{UARTI2CS}+8 - MOV #STOP_U2I,&$183A - MOV #HARD_U2I,&$183E - MOV #BACKGRND_U2I,&$1840 MOV #U2I_TERM_INT,&$FFF0 + MOV &$FFDE,&{UARTI2CS}+8 MOV #500MS_INT,&$FFDE MOV R14,&{UARTI2CS}+10 $180E $4000 TSTBIT diff --git a/MSP430-FORTH/SD_430FR5994/UTILITY.4TH b/MSP430-FORTH/SD_430FR5994/UTILITY.4TH index d732370..5ce820d 100644 --- a/MSP430-FORTH/SD_430FR5994/UTILITY.4TH +++ b/MSP430-FORTH/SD_430FR5994/UTILITY.4TH @@ -7,10 +7,10 @@ SUB #2,R15 MOV R14,0(R15) MOV &$180A,R14 - SUB #400,R14 + SUB #401,R14 COLON $0D EMIT - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" RST_RET ; @@ -61,15 +61,15 @@ CODE IF SUB #2,R15 MOV R14,0(R15) - MOV &$1DC0,R14 - ADD #4,&$1DC0 - MOV #$4096,0(R14) + MOV &$1DBE,R14 + ADD #4,&$1DBE + MOV #[THEN]+$52,0(R14) ADD #2,R14 MOV @R13+,R0 ENDCODE IMMEDIATE CODE THEN - MOV &$1DC0,0(R14) + MOV &$1DBE,0(R14) MOV @R15+,R14 MOV @R13+,R0 ENDCODE IMMEDIATE @@ -81,9 +81,9 @@ ENDCODE IMMEDIATE CODE UNTIL - MOV #$4096,R9 -BW1 ADD #4,&$1DC0 - MOV &$1DC0,R10 + MOV #[THEN]+$52,R9 +BW1 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) MOV @R15+,R14 @@ -91,7 +91,7 @@ BW1 ADD #4,&$1DC0 ENDCODE IMMEDIATE CODE AGAIN - MOV #$409C,R9 + MOV #[THEN]+$58,R9 GOTO BW1 ENDCODE IMMEDIATE @@ -119,8 +119,8 @@ BW1 ADD #4,&$1DC0 CODE DO SUB #2,R15 MOV R14,0(R15) - ADD #2,&$1DC0 - MOV &$1DC0,R14 + ADD #2,&$1DBE + MOV &$1DBE,R14 MOV #XDO,-2(R14) ADD #2,&$1C00 MOV &$1C00,R10 @@ -142,8 +142,8 @@ BW1 BIT #$100,R2 CODE LOOP MOV #XLOOP,R9 -BW2 ADD #4,&$1DC0 - MOV &$1DC0,R10 +BW2 ADD #4,&$1DBE + MOV &$1DBE,R10 MOV R9,-4(R10) MOV R14,-2(R10) BEGIN @@ -350,7 +350,7 @@ FW1 MOV @R13+,R0 [UNDEFINED] CR [IF] CODE CR - MOV #$409E,R0 + MOV #[THEN],R0 ENDCODE :NONAME @@ -447,7 +447,8 @@ BW1 MOV R14,-4(R15) [UNDEFINED] WORDS [IF] : WORDS CR - $1DC6 @ $1CE4 + $1DC4 @ + $1CE4 $180C @ 2* MOVE BEGIN diff --git a/MSP430-FORTH/SD_TEST.f b/MSP430-FORTH/SD_TEST.f index 1140aad..bc67ce2 100644 --- a/MSP430-FORTH/SD_TEST.f +++ b/MSP430-FORTH/SD_TEST.f @@ -89,10 +89,10 @@ MOV #0,0(PSP) [THEN] MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON 'CR' EMIT \ return to column 1 without 'LF' - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" build FastForth with SD_CARD_READ_WRITE addon!" RST_RET \ remove ABORT_SD_TEST definition before resuming ; @@ -624,6 +624,25 @@ BW1 SUB #2,PSP \ 2 push old TOS.. CLOSE \ close YOURFILE.TXT ; + CODE START_TIMER + MOV #%01_0010_0100,&TB0CTL \ start TB0, ACLK (32768 Hz), continuous mode + MOV @IP+,PC + ENDCODE + + CODE DISPLAY_TIME + SUB #6,PSP + MOV TOS,4(PSP) \ save TOS + MOV &TB0R,2(PSP) \ DVDlo=TB0R + MOV #0,&TB0CTL \ stop timer + MOV #0,0(PSP) \ DVDhi=0 + MOV #33,TOS \ DVR=33 --> 0.7% error, 1985ms max + CALL #MUSMOD \ DVDlo DVDhi DVR -- REM QUOTlo QUOThi + MOV @PSP+,TOS \ -- REM QUOTlo + ADD #2,PSP \ -- QUOlo + COLON + ECHO ." , done in " U. ." ms" + ; + : SD_TEST ECHO 'CR' EMIT @@ -631,39 +650,46 @@ BW1 SUB #2,PSP \ 2 push old TOS.. ." ----------" CR ." SD_TESTS " CR ." ----------" CR - ." ? Fast Forth Specifs" CR - ." 0 Set date and time" CR + ." ? Fast Forth Specs" CR + ." 0 Set date and time (MSP430FR5xxx)" CR ." 1 Load {UTILITY} words" CR ." 2 Load {SD_TOOLS} words" CR ." 3 Load {CORE_ANS} words" CR - ." 4 Load ANS core tests" CR - ." 5 Load a source file to make 10k program" CR - ." 6 Read it only (47k)" CR + ." 4 Execute ANS core tests" CR + ." 5 Load a source file to compile 10k program" CR + ." 6 Read it only (51k)" CR ." 7 write FORTH dump in YOURFILE.TXT" CR ." 8 append FORTH dump to YOURFILE.TXT" CR ." 9 delete YOURFILE.TXT" CR ." your choice: " KEY DUP 'CR' = - IF KEY DROP ." 'CR'" + IF KEY DROP ." 'CR'" \ skip LF... ELSE DUP EMIT - THEN CR - NOECHO + THEN RST_RET \ remove all definitions + NOECHO CASE - '?' OF LOAD" FF_SPECS.4TH" ENDOF \ - '0' OF LOAD" RTC.4TH" ENDOF - '1' OF LOAD" UTILITY.4TH" ENDOF - '2' OF LOAD" SD_TOOLS.4TH" ENDOF - '3' OF LOAD" CORE_ANS.4TH" ENDOF - '4' OF LOAD" CORETEST.4TH" ENDOF - '5' OF LOAD" PROG10K.4TH" ENDOF - '6' OF READ" PROG10K.4TH" \ open file as read - BEGIN READ UNTIL ENDOF \ sequentially read 512 bytes, then file is closed - '7' OF WRITE" YOURFILE.TXT" \ overwrite existing file or create new file - WRITEDUMP ENDOF - '8' OF APPEND" YOURFILE.TXT" \ append to existing file or create new file - WRITEDUMP ENDOF - '9' OF DEL" YOURFILE.TXT" ENDOF + '?' OF CR LOAD" FF_SPECS.4TH" ENDOF \ LOAD" command is always executed after the SD_TEST exit, + '0' OF CR LOAD" RTC.4TH" ENDOF \ so, no risk of crashing this program, regardless of RST_RET use... + '1' OF CR LOAD" UTILITY.4TH" ENDOF + '2' OF CR LOAD" SD_TOOLS.4TH" ENDOF + '3' OF CR LOAD" CORE_ANS.4TH" ENDOF + '4' OF CR LOAD" CORETEST.4TH" ENDOF + '5' OF CR LOAD" PROG10K.4TH" ENDOF + \ ...instead of READ" WRITE" APPEND" DEL" which are executed immediately + '6' OF START_TIMER + READ" PROG10K.4TH" \ open file as read + BEGIN READ UNTIL \ sequentially read 512 bytes, then the file is closed + DISPLAY_TIME ENDOF + '7' OF START_TIMER + WRITE" YOURFILE.TXT" \ create new file or overwrite existing file + WRITEDUMP DISPLAY_TIME ENDOF + '8' OF START_TIMER + APPEND" YOURFILE.TXT" \ append to existing file or create new file + WRITEDUMP DISPLAY_TIME ENDOF + '9' OF START_TIMER + DEL" YOURFILE.TXT" \ no message + DISPLAY_TIME ENDOF ENDCASE ; diff --git a/MSP430-FORTH/SD_TOOLS.f b/MSP430-FORTH/SD_TOOLS.f index fe2f5e2..6bd610c 100644 --- a/MSP430-FORTH/SD_TOOLS.f +++ b/MSP430-FORTH/SD_TOOLS.f @@ -53,10 +53,10 @@ MOV #0,0(PSP) [THEN] MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON 'CR' EMIT \ return to column 1 without 'LF' - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" Build FastForth with SD_CARD_LOADER addon!" RST_RET \ remove ABORT_UARTI2CS definition before resuming ; @@ -365,7 +365,7 @@ BW1 MOV TOS,X \ X = SectorH \ --------------------------------\ BW2 BIT.B #CD_SD,&SD_CDIN \ test Card Detect: memory card present ? 0<> IF \ no: force COLD - MOV #COLD,PC \ no + MOV #TOS2COLD,PC \ no THEN MOV.B &SecPerClus,W \ SecPerClus(54321) = multiplicator MOV @PSP,X \ X = ClusterL diff --git a/MSP430-FORTH/SendSourceFileToTarget.bat.lnk b/MSP430-FORTH/SendSourceFileToTarget.bat.lnk index 1fc31c35605a30e34185c1c8b85bb76207af42ec..2f8dd0b0602cf41dabad7ce14490d8261cfb4fa7 100644 GIT binary patch literal 1631 zcmbtUZAepL6h3!ZX;{tjBkjWx35L4nM};%Xx$Ad1^WIg|jl6Dmb8FjO+ob*&5*P&5 z4@n53DDxvqA)~MeMf%Z?h?D};eg)B=Ld5!E5kcqNZMlgN={uhDzVF$2pYxuN`yK=U zCQ*eFU{sM%ejQ>#gX`9p4;{CkOfrYFUc_~Lon%JD1IpaT1Pwz|aDy^Ql?dr|A57z# z&w7WtYcdwHbh;ardUK{L0gNuW*~$gPfJ62GR6`uZz|06+{i?-o z-d(6g%b@kDc>-nCf4>Qg-~t(%!3rD%Ktwojk2J6aj)cw?nUB|~!RwQqQos)-A^ucz zQd^jRpTf6t0e|byG{y@)LZeaz%0ECCg60*Wnd-Av94Zim zI%7_CnW6SjRg`_W$U?9zLNJp8CwZ)#-0ZVRmK>)fdfblCKAtTbHa*)@+jgzs z?Uj2)a~sBf?7etmI-&h^x9Vxn-QIuw-+&2?L;e=z%jN30Y2EO9BV4NJ`#!$0+i%-0 zqTWir(h-@6$mY_ZW;vnmBw`%X2y(8Q%@~@gNK^OBsv6pFe(A45{TebL=bI5rsRo^= z4qH!)5)xvKlU_7Z#?zh_;pdE8#*mU+Qo~YvTc8Q0ghkU}G9;9g1vmag<#Qm-QM8~> zLx!`;^FXBQ5Q@w2qe=Tg1O?mcv}6`{zDamI0i&j=P2-)Y-$n-H*??G1W}};EX>Ck* zp;3sS3lAo{*@4U6%D&1HZFljx_N}OIB7;gq{=}y_z9YjlusZwWuc3D*Ngp1+0f|sY A^Z)<= delta 616 zcmcc5^OR$PjFH9zA=SbiR~TV*Lu61)+uF;Fg^Ubf0Hq)tAj!%&(NDZS$|?pff?$L& z7=k%=e(d%F49WR}_3IDaUM0CQ z^P$Jw15MBGbd;TMxV!E^zRF9%uI?pFJD09lMo9iL(Bqs83=2Ym?l24v2!3m@_m(q5 zr~C3B7lfA-rzu$i#Zy3zlm}vAAkJkdW+-4VVK8PeU{GKX*I;mDuwsZo2~)PCXgiu;({#F0b)#Z RV~{PMe4o{x4Wyod0RX~~jP?Kk diff --git a/MSP430-FORTH/TEST.f b/MSP430-FORTH/TEST.f index 429c398..7251a63 100644 --- a/MSP430-FORTH/TEST.f +++ b/MSP430-FORTH/TEST.f @@ -35,10 +35,10 @@ SUB #2,PSP MOV TOS,0(PSP) MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON 'CR' EMIT \ return to column 1, no 'LF' - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ; ABORT_CORE_ANS diff --git a/MSP430-FORTH/TESTASM.F b/MSP430-FORTH/TESTASM.F index 6817f0c..e6375f0 100644 --- a/MSP430-FORTH/TESTASM.F +++ b/MSP430-FORTH/TESTASM.F @@ -38,10 +38,10 @@ SUB #2,PSP MOV TOS,0(PSP) MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON 'CR' EMIT \ return to column 1 without 'LF' - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" \ RST_RET \ remove ABORT_TEST_ASM definition before resuming ; diff --git a/MSP430-FORTH/TESTXASM.F b/MSP430-FORTH/TESTXASM.F index aae07fe..27cf6d3 100644 --- a/MSP430-FORTH/TESTXASM.F +++ b/MSP430-FORTH/TESTXASM.F @@ -34,10 +34,10 @@ SUB #2,PSP MOV TOS,0(PSP) MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON 'CR' EMIT \ return to column 1 without 'LF' - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" RST_RET \ remove ABORT_TEST_ASM definition before resuming ; diff --git a/MSP430-FORTH/TSTWORDS.f b/MSP430-FORTH/TSTWORDS.f index f0991c8..427a0f3 100644 --- a/MSP430-FORTH/TSTWORDS.f +++ b/MSP430-FORTH/TSTWORDS.f @@ -7,10 +7,10 @@ SUB #2,PSP MOV TOS,0(PSP) MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON 'CR' EMIT \ return to column 1 without 'LF' - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" RST_RET \ remove ABORT_TEST_ASM definition before resuming ; diff --git a/MSP430-FORTH/UARTI2CS.f b/MSP430-FORTH/UARTI2CS.f index 9980fe6..86ab319 100644 --- a/MSP430-FORTH/UARTI2CS.f +++ b/MSP430-FORTH/UARTI2CS.f @@ -124,8 +124,8 @@ \ \ driver test : MCLK=24MHz, PL2303CG with shortened cable (20cm), WIFI off, all windows apps closed else Scite and TERATERM. \ ----------- . -\ . ┌────────────────────────────────┐ -\ notebook USB to I2C bridge +-- I2C -->| up to 112 I2C_FASTFORTH targets| +\ RST . ┌────────────────────────────────┐ +\ notebook USB to I2C bridge ┌─┐ +-- I2C -->| up to 112 I2C_FASTFORTH targets| \ ┌───────────────┐ ╔════════════════════════════════════════════════════════════╗ / ┌───────────────────────────────┐ | \ | WINDOWS 10 | ║ PL2303GC/HXD/TA launchpad running UARTI2CS ║ +-- I2C -->| MSP430FR4133 @ 1 MHz | | \ | | ║───────────────┐ ┌────────────────────────────────║ / ┌───────────────────────────────┐ |──┘ @@ -135,15 +135,14 @@ \ | | ║───────────────┘ └────────────────────────────────║ └───────────────────────────────┘ \ | | ║ |<- l=20cm->| ║<-l=20cm->| \ └───────────────┘ ╚════════════════════════════════════════════════════════════╝ -\ |_| -\ test results : RST +\ └─┘ +\ test results : SW1 \ ------------ \ -\ Full duplex downloading (+ interpret + compile + execute) CORETEST.4TH to I2C Master target = 625ms/732kBds. -\ Full duplex downloading (+ interpret + compile + execute) CORETEST.4TH to I2C Slave target = 1047ms/431kBds. +\ Full duplex downloading (+ interpret + compile + execute) CORETEST.4TH to I2C Master target = 547ms/836kBds. +\ Full duplex downloading (+ interpret + compile + execute) CORETEST.4TH to I2C Slave target = 1031ms/443kBds. \ the difference (422 ms) is the effective time of the I2C Half duplex exchange. -\ [(9 bits / char) + ( 2*START + 2*addr + 1 CTRL_Char + 1 STOP / line )] = [(45763 chars * 9 bits) + (1538 lines * 30 bits)] / 0,422 = 1,085 MHz -\ ==> I2C effective rate = 109 % of I2C Fast-mode Plus (Fm+). +\ [(9 bits / char) + ( 2*START + 2*addr + 1 CTRL_Char + 1 STOP / line )] = [(45773 chars * 9 bits) + (1536 lines * 30 bits)] / 0.485 = 507 kHz \ \ also connected to and tested with another I2C_FastForth target with MCLK = 1MHz (I2C CLK > MCLK !). \ @@ -187,39 +186,35 @@ 0<> IF MOV #0,TOS THEN \ if TOS <> 0 (UART TERMINAL), set TOS = 0 MOV TOS,0(PSP) MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON \ ASSEMBLER switch to FORTH with IP backup $0D EMIT \ return to column 1 without CR - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" ABORT" <-- Ouch! unexpected I2C_FastForth target!" RST_RET \ remove the ABORT_UARTI2CS definition before continuing the download. ; ABORT_UARTI2CS \ run tests - +\ \ here is a MARKER definition, used to free the program memory including it, and restoring previous hardware context if any. - MARKER {UARTI2CS} \ the command : ' , leaves USER_PARAM address on the stack. -\ &{UARTI2CS}-2 = USER_DOES <-- #REMOVE_U2I addr, the subroutine used to restore the low level environment below: + MARKER {UARTI2CS} \ assembly addr = your content +\ &{UARTI2CS}-2 = USER_PARAM-2 <-- #REMOVE_U2I addr, the subroutine used to restore the low level environment below: 16 ALLOT \ &{UARTI2CS} = USER_PARAM <-- previous &STOP_APP addr - \ &{UARTI2CS}+2 = USER_PARAM+2 <-- previous &HARD_APP addr +\ \ &{UARTI2CS}+2 = USER_PARAM+2 <-- previous &HARD_APP addr \ &{UARTI2CS}+4 = USER_PARAM+4 <-- previous &BACKGRND_APP addr \ &{UARTI2CS}+6 = USER_PARAM+6 <-- previous &TERM_VEC addr \ &{UARTI2CS}+8 = USER_PARAM+8 <-- previous &Px_VEC addr \ local variables : UARTI2CS_ADR=\{UARTI2CS\}\+10; <-- I2C_Slave_Addr<<1 -\ TIMER_CONF=\{UARTI2CS\}\+12 <-- TIM_CTL configuration -\ COLLISION_DLY=\{UARTI2CS\}\+14; <-- 20 us resolution delay after I2C collision +\ (defined as is in TIMER_CONF=\{UARTI2CS\}\+12 <-- TIM_CTL configuration +\ ..\inc\target.pat) COLLISION_DLY=\{UARTI2CS\}\+14; <-- 20 us resolution delay after I2C collision \ DUPLEX_MODE=\{UARTI2CS\}\+15; <-- flag = 4 --> NOECHO, <> 4 --> ECHO, -1 = I2C link lost -\ USER_PARAMS[-2...+16[ are initialised by START_U2I and USER_PARAMS[-2...+10[ are restored by REMOVE_U2I. - -\ ========================================================================= - CODE LEDS MOV @IP+,PC ENDCODE \ comment this line to remove LEDS option -\ ========================================================================= - +\ USER_PARAMS[-2...+16[ are initialised by START_U2I and only USER_PARAMS[-2...+10[ are restored by REMOVE_U2I. +\ \ ----------------------------------------------------------------------- \ first we download the set of definitions we need (copied from CORE_ANS) \ ----------------------------------------------------------------------- -\ + [UNDEFINED] = [IF] \ https://forth-standard.org/standard/core/Equal \ = x1 x2 -- flag test x1=x2 @@ -231,19 +226,6 @@ ENDCODE [THEN] - [UNDEFINED] + [IF] \ for [ABORT, (GEMA pattern) -\ https://forth-standard.org/standard/core/Plus -\ + n1/u1 n2/u2 -- n3/u3 add n1+n2 - CODE + - ADD @PSP+,TOS - MOV @IP+,PC - ENDCODE - [THEN] - -\ ----------------------------- -\ end of definitions we need... -\ ----------------------------- -\ [UNDEFINED] TSTBIT [IF] CODE TSTBIT \ addr bit_mask -- true/flase flag MOV @PSP+,X @@ -252,6 +234,14 @@ ENDCODE [THEN] +\ ----------------------------- +\ end of definitions we need... +\ ----------------------------- +\ +\ ========================================================================= +\ CODE LEDS MOV @IP+,PC ENDCODE \ comment/uncomment this line to remove/add LEDS option +\ ========================================================================= +\ \ see symbolic values in ..\inc\launchpad.pat or/and in ..\inc\device.pat \ note: HDNCODE definitions are HiDdeN and cannot be called from TERMINAL \ ------------------------------------\ @@ -271,7 +261,7 @@ \ ------------------------------------\ HDNCODE REMOVE_U2I \ REMOVE_APP subroutine \ ------------------------------------\ -BW1 \ <-- WARM <-- INIT_FORTH <-- SYS_failures|RESET +BW1 \ <-- WARM <-- INIT_FORTH <-- SYS_failures|software_BOR \ ------------------------------------\ [DEFINED] LEDS [IF] BIC.B #LED1,&LED1_OUT \ set TX red led OFF @@ -303,39 +293,39 @@ BW1 \ <-- WARM <-- INIT_FORTH <-- SYS_failur ENDCODE \ \ ------------------------------------\ -\ ------------------------------------\ +\ ====================================\ HDNCODE STOP_U2I \ new STOP_APP subroutine, defined for the example, not used. -\ ------------------------------------\ +\ ====================================\ CALL #I2CM_STOP \ send I2C STOP - MOV &{UARTI2CS},PC \ run previous STOP_APP then RET + MOV &OLD_STOP_APP,PC \ run previous STOP_APP then RET ENDCODE \ \ ------------------------------------\ -\ ------------------------------------\ +\ ====================================\ HDNCODE BACKGRND_U2I \ new BACKGRND_APP subroutine, RET to LPM0 shut down. -\ ------------------------------------\ +\ ====================================\ \ user request test \ \ ------------------------------------\ BIT #8,&TERM_STATW \ 3 break sent by TERATERM (Alt+B) ? - 0<> IF - MOV #WARM_IP_ADR,0(RSP) \ replace BACKGRND_U2I return by INIT_FORTH followed by WARM - PUSH #INIT_FORTH \ -\ ------------------------------------\ -BW2 MOV #1,TOS \ to identify manual request to REMOVE_U2I + 0<> ?GOTO FW1 + BIT.B #SW1,&SW1_IN \ SW1 pressed ? + 0= IF \ +FW1 MOV #1,TOS \ to identify human request to REMOVE_U2I + MOV #TOS2WARM,0(RSP) \ replace BACKGRND_U2I ret directly by TOS2WARM (no need STOP_APP(I2CM_STOP) ) GOTO BW1 \ 2 - THEN + THEN \ \ ------------------------------------\ BIC.B #INT_IN,&INT_IN_IFG \ 4 clear INT_IN IFG MOV #'CR',S \ 2 S = 'CR' = penultimate char of line to be RXed by UART MOV #0,T \ 2 T = init buffer pointer for UART_TERMINAL input MOV.B &DUPLEX_MODE,Y \ 3 Y = 4 ==> NOECHO else ECHO, for U2I_TERM_INT and 500MS_INT use - MOV &{UARTI2CS}+4,PC \ 3 previous BACKGRND_APP executes RXON, enabling TERMINAL TX, then RET to LPM0 shut down. + MOV &OLD_BACKGRND_APP,PC \ 3 previous BACKGRND_APP executes RXON, enabling TERMINAL TX, then RET to BACKGRND. ENDCODE \ \ ------------------------------------\ -\ ------------------------------------\ +\ ====================================\ HDNCODE HARD_U2I \ new HARD_APP subroutine, RETurn redirected to ABORT --> ACCEPT --> BACKGRND -\ ------------------------------------\ +\ ====================================\ \ init 500MS_INT \ used to scan I2C_Slave hard RESET and to slow down (re)START RX loop \ ------------------------------------\ BW3 MOV &TIMER_CONF,&TIM_CTL \ start RX_timer, up mode @@ -361,12 +351,10 @@ BW3 MOV &TIMER_CONF,&TIM_CTL \ start RX_timer, up mode \ ------------------------------------\ \ run previous HARD_APP \ \ ------------------------------------\ - CALL &{UARTI2CS}+2 \ execute previous HARD_APP to init TERM_UC, activates I/O. + CALL &OLD_HARD_APP \ execute previous HARD_APP to init TERM_UC, activates I/O. \ ------------------------------------\ TOS = USERSYS=$00|SYSRSTIV=$02|$04|$0E|$xx as UARTI2CS|POWER_ON|RST|SVSH_threshold|SYS_failures \ define new SYSRSTIV select \ \ ------------------------------------\ - CMP #6,TOS \ SYSRSTIV = RESET ? - 0= ?GOTO BW2 \ if yes goto REMOVE_U2I with TOS = 1, return to WARM CMP #$0E,TOS \ SVSHIFG SVSH event = #14 ? (POWER_ON) 0<> IF \ if not CMP #$0A,TOS \ SYSRSTIV >= violation memory protected areas ? @@ -374,7 +362,7 @@ BW3 MOV &TIMER_CONF,&TIM_CTL \ start RX_timer, up mode THEN \ \ ------------------------------------\ MOV #ABORT,0(RSP) \ replace WARM return by ABORT return - MOV @RSP+,PC \ --> ABORT --> ACCCEPT --> BACKGRND --> LPM4 + MOV @RSP+,PC \ --> ABORT --> ACCEPT --> BACKGRND --> LPM0 ENDCODE \ \ ------------------------------------\ @@ -382,7 +370,7 @@ BW3 MOV &TIMER_CONF,&TIM_CTL \ start RX_timer, up mode HDNCODE I2CM_START \ I2C_Master START and TX Address, version with collision detection and resolution \ ----------------------------------------\ _ BIS.B #SM_SDA,&I2CSM_DIR \ 3 v_ force SDA as output (low) - BIS &UARTI2CS_ADR,X \ 3 _ X = (Slave_Address<<1 | R/w bit) + BIS &UARTI2CS_ADR,X \ 3 _ X = (Slave_Address<<1 + R/w bit) BIS.B #SM_SCL,&I2CSM_DIR \ 3 v_ force SCL as output (low) \ ----------------------------------------\ \ I2C_Master Send I2C Addr \ @@ -400,7 +388,7 @@ BW3 MOV &TIMER_CONF,&TIM_CTL \ start RX_timer, up mode BIT.B #SM_SDA,&I2CSM_IN \ 3 h get SDA input 0= IF \ 2 h \ ----------------------------\ -\ collision detected \ if SDA input low, collision detected +\ collision detected \ if SDA input is low, collision detected \ ----------------------------\ BEGIN \ BIT #TX,&TERM_IFG \ 3 @@ -409,19 +397,19 @@ BW3 MOV &TIMER_CONF,&TIM_CTL \ start RX_timer, up mode \ ----------------------------\ \ collision resolution \ \ ----------------------------\ - BEGIN \ wait until SDA high - BIT.B #SM_SDA,&I2CSM_IN \ 3 h + BEGIN \ + BIT.B #SM_SCL,&I2CSM_IN \ 3 h wait while SCL is low (case of I2C_Slave stretching) 0<> UNTIL \ 2 \ ----------------------------\ BEGIN \ wait for 20us bus idle time - BIC.B #SM_BUS,&I2CSM_IFG \ 4 clear SM_BUS IFG - NOP3 \ 3 - MOV.B &COLLISION_DLY,W \ 3 load delay value - BEGIN \ - NOP \ 1 - SUB #1,W \ 1 - 0= UNTIL \ 2 4~ x (delay value) - BIT.B #SM_BUS,&I2CSM_IFG \ 4 + BIC.B #SM_BUS,&I2CSM_IFG \ 4 clear SM_BUS IFG + NOP3 \ 3 + MOV.B &COLLISION_DLY,W \ 3 load delay value + BEGIN \ + NOP \ 1 + SUB #1,W \ 1 + 0= UNTIL \ 2 4~ x (delay value) + BIT.B #SM_BUS,&I2CSM_IFG \ 4 0= UNTIL \ 2 + 16~ dead time for the remainder of idle time \ ----------------------------\ ADD #2,RSP \ 1 remove the RET for Nack/Ack processing and select.. @@ -600,7 +588,7 @@ FW2 \ single use forward label \ <──────── if Nack THEN \ (275 cycles for 500MS_INT) CMP.B #-1,Y \ 1 l return of I2C_Slave on bus ? 0= IF \ 2 l if yes - MOV.B #0,Y \ clear 'no_I2C_Slave' flag, ECHO is ON + MOV.B #1,&DUPLEX_MODE \ clear 'no_I2C_Slave' flag, ECHO is ON MOV.B #'CR',&TERM_TXBUF \ send CR+LF to terminal BEGIN \ BIT #TX,&TERM_IFG \ @@ -626,7 +614,7 @@ FW2 \ single use forward label \ <──────── if Nack SUB #1,W \ 1 l count down of bits 0= UNTIL \ 2 l \ ----------------------------\ -\ case of RX data $FF \ case of -1 SYS for example +\ case of RX data $FF \ case of I2C_Slave BOR, ABORT request, I2C_BUS lost \ ----------------------------\ CMP.B #-1,X \ 1 l received char $FF ? let's consider that the slave is lost... 0<> WHILE \ 2 l @@ -652,13 +640,14 @@ FW2 \ single use forward label \ <──────── if Nack 0<> UNTIL \ 2 l loop if no MOV.B X,&TERM_TXBUF \ 3 l send RXed char to UART TERMINAL THEN \ - REPEAT \ 2 l loop back to RX data + REPEAT \ 2 l loop back to RX data for chars {$08...$FF} \ --------------------------------\ -\ case of RX CTRL_Char {$00...$07}\ here Master holds SCL low, Slave can test it: CMP #8,&TERM_STATW +\ case of RX CTRL_Char {$00...$07}\ here Master holds SCL low \ --------------------------------\ see forthMSP430FR_TERM_I2C.asm CMP.B #4,X \ 1 U>= IF \ 2 MOV.B X,Y \ NOECHO = $04, ECHO = {$05...$07} + MOV.B Y,&DUPLEX_MODE \ save NOECHO flag BIS.B #SM_SDA,&I2CSM_DIR \ 3 l prepare SDA low = Ack for Ctrl_Chars {$04...$07} THEN \ \ --------------------------------\ @@ -673,7 +662,7 @@ FW2 \ single use forward label \ <──────── if Nack BIT.B #SM_SDA,&I2CSM_IN \ 3 h _ get SDA as TX Ack/Nack state BIS.B #SM_SCL,&I2CSM_DIR \ 3 h v_ SCL as output : force SCL low \ --------------------------------\ - 0<> UNTIL \ 2 l if Ack, loop back to Master_RX data after CTRL_Chars {$04...$07,$08...$FE} + 0<> UNTIL \ 2 l if Ack, loop back to Master_RX data after CTRL_Chars {$04...$07} \ ------------------------------------\ \ Nack is sent by Master \ case of CTRL-Chars {$FF...$03}, SDA is high, SCL is low \ ------------------------------------\ @@ -681,20 +670,21 @@ FW2 \ single use forward label \ <──────── if Nack U>= WHILE \ l out of loop for CTRL_chars {$00,$01} \ ------------------------------------\ \ CTRL_Char {$02,$03,$FF} \ only CTRL_Char $FF is used -\ ------------------------------------\ +\ ------------------------------------\ _ + BIC.B #SM_SCL,&I2CSM_DIR \ 3 l _^ release SCL (high) to avoid Stretch time out on I2C_Slave side + CALL #UART_RXON \ resume UART downloading source file + BEGIN \ + BIC #RX,&TERM_IFG \ clear UCRXIFG + MOV &FREQ_KHZ,X \ 1000, 2000, 4000, 8000, 16000, 240000 + BEGIN MOV #65,W \ 2~ <-------+ wait time for TERMINAL to refill its USB buffer + BEGIN SUB #1,W \ 1~ <---+ | ==> ((65*3)+5)*FREQ_KHZ/1000 = 200ms delay + 0= UNTIL \ 2~ 3~ loop ---+ | + SUB #1,X \ 1~ | + 0= UNTIL \ 2~ 200~ loop -----+ + BIT #RX,&TERM_IFG \ 4 new char in TERMRXBUF during this delay ? + 0= UNTIL \ 2 yes, the input stream is still active: loop back MOV.B #0,Y \ set echo ON - CALL #UART_RXON \ resume UART downloading source file - BEGIN \ - BIC #RX,&TERM_IFG \ clear UCRXIFG - MOV &FREQ_KHZ,X \ 1000, 2000, 4000, 8000, 16000, 240000 - BEGIN MOV #65,W \ 2~ <-------+ wait time for TERMINAL to refill its USB buffer - BEGIN SUB #1,W \ 1~ <---+ | ==> ((65*3)+5)*FREQ_KHZ/1000 = 200ms delay - 0= UNTIL \ 2~ 3~ loop ---+ | - SUB #1,X \ 1~ | - 0= UNTIL \ 2~ 200~ loop -----+ - BIT #RX,&TERM_IFG \ 4 new char in TERMRXBUF during this delay ? - 0= UNTIL \ 2 yes, the input stream is still active: loop back - REPEAT \ l loop back to reSTART RX on WARM|ABORT messages. + REPEAT \ l loop back to reSTART RX on WARM|ABORT" messages or I2C_Bus lost. \ ----------------------------------------\ \ I2C_Master_RX Send STOP \ remainder: CTRL_Chars {$00,$01} \ ----------------------------------------\ @@ -711,7 +701,6 @@ FW2 \ single use forward label \ <──────── if Nack \ I2C_Slave ACCEPT ctrl_char $00 \ case of request by I2C_Slave ACCEPT \ ----------------------------------------\ 0= IF \ - MOV.B Y,&DUPLEX_MODE \ save updated NOECHO flag before RET MOV #BACKGRND,PC \ which calls BACKGRND_U2I, RXON enabling TERMINAL TX, then LPM0 shut down. THEN \ \ ----------------------------------------\ @@ -735,9 +724,9 @@ FW2 \ single use forward label \ <──────── if Nack \ I2C_address<<1 mini = $10, maxi = $EE (I2C-bus specification and user manual V6) \ type on TERMINAL "$12 START_U2I" to link teraterm TERMINAL with FastForth I2C_Slave target at address $12 -\ ------------------------------------\ +\ ====================================\ CODE START_U2I \ I2C_Addr<<1 -- -\ ------------------------------------\ +\ ====================================\ SUB #2,PSP \ DUP MOV TOS,0(PSP) \ COLON \ ASSEMBLER switch to FORTH with IP backup @@ -745,7 +734,7 @@ FW2 \ single use forward label \ <──────── if Nack ." Connect to I2C_SLAVE at @" \ . 'BS' EMIT \ display number without space after ." , TERATERM(Alt-B) " \ - ." or I2C_MASTER(RST) to quit..." \ + ." or I2C_MASTER(SW1) to quit..." \ HI2LO \ FORTH switch to ASSEMBLER MOV @RSP+,IP \ restore IP BEGIN \ @@ -754,15 +743,15 @@ FW2 \ single use forward label \ <──────── if Nack CMP #RET_ADR,&{UARTI2CS}-2 \ USER_DOES default value ? 0= IF \ if yes MOV #REMOVE_U2I,&{UARTI2CS}-2 \ USER_DOES of {UARTI2CS} will CALL &{UARTI2CS}-2 = CALL #REMOVE_U2I - MOV &STOP_APP,&{UARTI2CS} \ save STOP_APP value to {UARTI2CS} - MOV &HARD_APP,&{UARTI2CS}+2 \ save HARD_APP value to {UARTI2CS}+2 - MOV &BACKGRND_APP,&{UARTI2CS}+4 \ save BACKGRND_APP value to {UARTI2CS}+4 - MOV &TERM_VEC,&{UARTI2CS}+6 \ save TERM_VEC value to {UARTI2CS}+6 - MOV &INT_IN_VEC,&{UARTI2CS}+8 \ save INT_IN_VEC value to {UARTI2CS}+8 + MOV &STOP_APP,&OLD_STOP_APP \ save previous STOP_APP value to {UARTI2CS} MOV #STOP_U2I,&STOP_APP \ set STOP_APP with STOP_U2I addr + MOV &HARD_APP,&OLD_HARD_APP \ save previous HARD_APP value to {UARTI2CS}+2 MOV #HARD_U2I,&HARD_APP \ set HARD_APP with HARD_U2I addr + MOV &BACKGRND_APP,&OLD_BACKGRND_APP \ save previous BACKGRND_APP value to {UARTI2CS}+4 MOV #BACKGRND_U2I,&BACKGRND_APP \ set BACKGRND_APP with BACKGRND_U2I addr + MOV &TERM_VEC,&OLD_TERM_VEC \ save previous TERM_VEC value to {UARTI2CS}+6 MOV #U2I_TERM_INT,&TERM_VEC \ set TERM_VEC with U2I_TERM_INT addr + MOV &INT_IN_VEC,&OLD_INT_IN_VEC \ save previous INT_IN_VEC value to {UARTI2CS}+8 MOV #500MS_INT,&INT_IN_VEC \ set INT_IN_VEC with 500MS_INT addr \ --------------------------------\ MOV TOS,&UARTI2CS_ADR \ save I2C_address<<1 at {UARTI2CS}+10 @@ -776,7 +765,7 @@ FW2 \ single use forward label \ <──────── if Nack [IF] MOV #76,&COLLISION_DLY \ > set 20us delay = (delay*MHz/4 -4, and set ECHO (<>4) [ELSE] MOV #36,&COLLISION_DLY \ ) [THEN] \ ) - [THEN] \ + [THEN] \ here we may add a priority... by slice of 20us THEN \ MOV #0,TOS \ -- 0 to enter in HARD_U2I with 0 SYS GOTO BW3 \ goto HARD_U2I as new HARD_APP, direct return to ABORT diff --git a/MSP430-FORTH/UTILITY.f b/MSP430-FORTH/UTILITY.f index d803f34..3cac286 100644 --- a/MSP430-FORTH/UTILITY.f +++ b/MSP430-FORTH/UTILITY.f @@ -46,10 +46,10 @@ SUB #2,PSP MOV TOS,0(PSP) MOV &VERSION,TOS - SUB #400,TOS \ FastForth V4.0 + SUB #401,TOS \ FastForth V4.1 COLON 'CR' EMIT \ return to column 1 without 'LF' - ABORT" FastForth V4.0 please!" + ABORT" FastForth V4.1 please!" RST_RET \ remove ABORT_UTILITY definition before resuming ; @@ -566,7 +566,8 @@ BW1 MOV TOS,-4(PSP) \ -- S0 ( TOS S0 PSP ) | -- TOS ( TOS R0 RSP ) \ list all words of vocabulary first in CONTEXT. : WORDS \ -- CR - CONTEXT @ PAD_ORG \ -- VOC_BODY PAD_ORG MOVE all threads of VOC_BODY in PAD_ORG + CONTEXT @ \ -- VOC_BODY + PAD_ORG \ -- VOC_BODY PAD_ORG MOVE all threads of VOC_BODY in PAD_ORG THREADS @ 2* \ -- VOC_BODY PAD_ORG THREAD*2 MOVE \ -- vocabumary entries are copied in PAD_ORG BEGIN \ -- diff --git a/MSP430-FORTH/test/PID.f b/MSP430-FORTH/test/PID.f index bba32f1..a6d89c5 100644 --- a/MSP430-FORTH/test/PID.f +++ b/MSP430-FORTH/test/PID.f @@ -786,13 +786,13 @@ MOV @PSP+,S \ S=d1L GOTO BW1 ENDCODE -CODE S2F \ ( s -- f ) Signed number to fixed point +CODE S>F \ ( s -- f ) Signed number to fixed point SUB #2,PSP MOV #0,0(PSP) MOV @IP+,PC ENDCODE -: F2S \ ( f -- s ) Fixed point to signed number (rounded) +: F>S \ ( f -- s ) Fixed point to signed number (rounded) SWAP $8000 AND IF 1 + THEN ; : DMIN \ ( d1 d2 -- d_min ) Minimum of double number (also for fixed-point) @@ -815,21 +815,22 @@ ENDCODE : F.000 3 F.N ; \ Output fixed point value -\ Setup variables for pid control +\ Set Q15.16 variables for pid control 2VARIABLE KP \ Proportionnal coeff, scaled to input range. 2VARIABLE KI \ integral coeff, in second 2VARIABLE KD \ derivative coeff, in second -VARIABLE SETPOINT \ setpoint, same scale as input +2VARIABLE I_SUM \ cummulative i error + +\ Set input/output variable +VARIABLE SETPOINT \ setpoint, same scale as measurement VARIABLE SAMPLE_TIME \ sampling interval in ms -VARIABLE OUT_MAX \ output max limit (--> 20 mA) -VARIABLE OUT_MIN \ output min limit (--> 4 mA) +VARIABLE OUT_MAX \ output max limit (--> 21 mA) +VARIABLE OUT_MIN \ output min limit (--> 3 mA) VARIABLE OUT-OVERRIDE \ output override (auto mode if -1) \ Working variables while pid is running -VARIABLE SET-VAL \ current setpoint -VARIABLE INPUT_PREV \ last seen input -2VARIABLE I_SUM \ cummulative i error +VARIABLE INPUT_PREV \ previous measurement VARIABLE DEBUG \ PID compute state 0 DEBUG ! @@ -840,43 +841,43 @@ VARIABLE DEBUG \ PID compute state \ ============================================================================= \ Main PID - internal definitions (do not call manually) \ inputs and outputs are 16 bits numbers -\ PID parameters and PID compute are Q15.16 numbers. +\ PID parameters and PID computed values are Q15.16 numbers. : CALC-P \ ( f_error -- f_correction ) Calculate proportionnal output KP 2@ F* \ fetch k-value and scale error -?DEBUG IF ." Pval:" 2DUP F2S . +?DEBUG IF ." Pval:" 2DUP F>S . THEN ; - : CALC-I \ ( f_error -- f_correction ) Calculate integral output KI 2@ F* \ apply ki factor I_SUM 2@ F+ \ sum up with running integral error -OUT_MIN @ S2F -OUT_MAX @ S2F +OUT_MIN @ S>F +OUT_MAX @ S>F DRANGE \ cap inside output range 2DUP I_SUM 2! \ update running integral error -?DEBUG IF ." Ival:" 2DUP F2S . +?DEBUG IF ." Ival:" 2DUP F>S . THEN ; : CALC-D \ ( s_is -- f_correction ) Calculate differential output \ actually use "derivative on input", not on error - INPUT_PREV @ - \ substract last input from current input - S2F KD 2@ F* \ make fixed point, fetch kd factor and multiply -?DEBUG IF ." Dval:" 2DUP F2S . + INPUT_PREV @ - \ substract previous from current measures + S>F KD 2@ F* \ make fixed point, fetch kd factor and multiply +?DEBUG IF ." Dval:" 2DUP F>S . THEN ; -: PID_COMPUTE \ ( s_is -- s_corr ) Do a PID calculation, return duty-cycle -\ CR ." SET:" SET-VAL @ . ." IS:" DUP . \ DEBUG +: PID_COMPUTE \ ( s_is -- s_corr ) Do a PID calculation, return output duty-cycle +\ CR ." SET:" SETPOINT @ . ." IS:" DUP . \ DEBUG \ feed error in p and i, current setpoint in d, sum up results -DUP DUP SET-VAL @ SWAP - S2F \ ( s_is s_is f_error ) -2DUP CALC-P \ ( s_is s_is f_error f_p ) -2SWAP CALC-I F+ \ ( s_is s_is f_p+i ) -ROT CALC-D F- \ ( s_is f_p+i+d ) \ substract! derivate on input - not error +DUP + DUP SETPOINT @ SWAP - S>F \ ( s_is s_is f_error ) + 2DUP CALC-P \ ( s_is s_is f_error f_p ) + 2SWAP CALC-I F+ \ ( s_is f_p+i ) +ROT CALC-D F- \ ( s_is f_p+i+d ) \ substract! derivate on input - not error -F2S \ ( s_is s_corr ) +F>S \ ( s_is s_corr ) ?DEBUG IF ." OUT:" DUP . THEN SWAP INPUT_PREV ! \ Update INPUT_PREV for next run @@ -889,12 +890,12 @@ THEN \ Main PID - external interface : SET \ ( s -- ) Change setpoint on a running pid - SET-VAL ! ; + SETPOINT ! ; : TUNING \ ( f_kp f_ki f_kd -- ) Change tuning-parameters on a running pid \ depends on sampletime, so fetch it, move to fixed-point and change unit to seconds \ store on return stack for now - SAMPLE_TIME @ S2F 1000,0 F/ 2>R \ + SAMPLE_TIME @ S>F 1000,0 F/ 2>R \ 2R@ F/ KD 2! \ translate from 1/s to the sampletime 2R> F* KI 2! \ translate from 1/s to the sampletime @@ -919,7 +920,7 @@ THEN OUT-OVERRIDE @ -1 = IF \ we're in auto-mode - do PID calculation PID_COMPUTE ELSE \ manual-mode! store input, return override value - CR ." SET:" SET-VAL @ . ." IS:" DUP . + CR ." SET:" SETPOINT @ . ." IS:" DUP . INPUT_PREV ! OUT-OVERRIDE @ ." PWM:" DUP . @@ -934,12 +935,12 @@ THEN \ store current output value as i to let it run smoothly OUT-OVERRIDE @ OUT_MIN @ OUT_MAX @ RANGE \ Make sure we return something inside PWM range - S2F I_SUM 2! \ init I_SUM + S>F I_SUM 2! \ init I_SUM -1 OUT-OVERRIDE ! THEN ; : AUTOHOLD \ ( -- ) Bring PID back to auto-mode after a manual override - INPUT_PREV @ SET-VAL ! \ Use last input as setpoint (no bumps!) + INPUT_PREV @ SETPOINT ! \ Use last input as setpoint (no bumps!) AUTO ; diff --git a/MSP430-FORTH/test/PID_2022-09-26-15-38-34.f b/MSP430-FORTH/test/PID_2022-09-26-15-38-34.f new file mode 100644 index 0000000..bba32f1 --- /dev/null +++ b/MSP430-FORTH/test/PID_2022-09-26-15-38-34.f @@ -0,0 +1,989 @@ +\ PID controller written in Forth +\ Based on the code presented here: +\ http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/ + +\ MSP_EXP430FR5739 MSP_EXP430FR5969 MSP_EXP430FR5994 MSP_EXP430FR6989 +\ MSP_EXP430FR4133 MSP_EXP430FR2433 MSP_EXP430FR2355 CHIPSTICK_FR2433 + +MARKER {PID} + +[UNDEFINED] VARIABLE [IF] +\ https://forth-standard.org/standard/core/VARIABLE +\ VARIABLE -- define a Forth VARIABLE +: VARIABLE +CREATE +HI2LO +MOV @RSP+,IP +MOV #DOVAR,-4(W) \ CFA = DOVAR +MOV @IP+,PC +ENDCODE +[THEN] + +[UNDEFINED] CONSTANT [IF] +\ https://forth-standard.org/standard/core/CONSTANT +\ CONSTANT n -- define a Forth CONSTANT +: CONSTANT +CREATE +HI2LO +MOV TOS,-2(W) \ PFA = n +MOV @PSP+,TOS +MOV @RSP+,IP +MOV @IP+,PC +ENDCODE +[THEN] + +[UNDEFINED] STATE [IF] +\ https://forth-standard.org/standard/core/STATE +\ STATE -- a-addr holds compiler state +STATEADR CONSTANT STATE +[THEN] + +[UNDEFINED] ROT [IF] +\ https://forth-standard.org/standard/core/ROT +\ ROT x1 x2 x3 -- x2 x3 x1 +CODE ROT +MOV @PSP,W \ 2 fetch x2 +MOV TOS,0(PSP) \ 3 store x3 +MOV 2(PSP),TOS \ 3 fetch x1 +MOV W,2(PSP) \ 3 store x2 +MOV @IP+,PC +ENDCODE +[THEN] + +[UNDEFINED] SWAP [IF] +\ https://forth-standard.org/standard/core/SWAP +\ SWAP x1 x2 -- x2 x1 swap top two items +CODE SWAP +MOV @PSP,W \ 2 +MOV TOS,0(PSP) \ 3 +MOV W,TOS \ 1 +MOV @IP+,PC \ 4 +ENDCODE +[THEN] + +[UNDEFINED] DUP [IF] +\ https://forth-standard.org/standard/core/DUP +\ DUP x -- x x duplicate top of stack +CODE DUP +BW1 SUB #2,PSP \ 2 push old TOS.. + MOV TOS,0(PSP) \ 3 ..onto stack + MOV @IP+,PC \ 4 +ENDCODE + +\ https://forth-standard.org/standard/core/qDUP +\ ?DUP x -- 0 | x x DUP if nonzero +CODE ?DUP +CMP #0,TOS \ 2 test for TOS nonzero +0<> ?GOTO BW1 \ 2 +MOV @IP+,PC \ 4 +ENDCODE +[THEN] + +[UNDEFINED] AND [IF] +\ https://forth-standard.org/standard/core/AND +\ C AND x1 x2 -- x3 logical AND +CODE AND +AND @PSP+,TOS +MOV @IP+,PC +ENDCODE +[THEN] + +[UNDEFINED] SPACE [IF] +\ https://forth-standard.org/standard/core/SPACE +\ SPACE -- output a space +: SPACE +$20 EMIT ; +[THEN] + +[UNDEFINED] R> [IF] +\ https://forth-standard.org/standard/core/Rfrom +\ R> -- x R: x -- pop from return stack ; CALL #RFROM performs DOVAR +CODE R> +MOV rDOVAR,PC +ENDCODE +[THEN] + +[UNDEFINED] @ [IF] +\ https://forth-standard.org/standard/core/Fetch +\ @ c-addr -- char fetch char from memory +CODE @ +MOV @TOS,TOS +MOV @IP+,PC +ENDCODE +[THEN] + +[UNDEFINED] ! [IF] +\ https://forth-standard.org/standard/core/Store +\ ! x a-addr -- store cell in memory +CODE ! +MOV @PSP+,0(TOS) \ 4 +MOV @PSP+,TOS \ 2 +MOV @IP+,PC \ 4 +ENDCODE +[THEN] + +[UNDEFINED] C@ [IF] +\ https://forth-standard.org/standard/core/CFetch +\ C@ c-addr -- char fetch char from memory +CODE C@ +MOV.B @TOS,TOS +MOV @IP+,PC +ENDCODE +[THEN] + +[UNDEFINED] 1+ [IF] +\ https://forth-standard.org/standard/core/OnePlus +\ 1+ n1/u1 -- n2/u2 add 1 to TOS +CODE 1+ +ADD #1,TOS +MOV @IP+,PC +ENDCODE +[THEN] + +[UNDEFINED] + [IF] +\ https://forth-standard.org/standard/core/Plus +\ + n1/u1 n2/u2 -- n3/u3 add n1+n2 +CODE + +ADD @PSP+,TOS +MOV @IP+,PC +ENDCODE +[THEN] + +[UNDEFINED] - [IF] +\ https://forth-standard.org/standard/core/Minus +\ - n1/u1 n2/u2 -- n3/u3 n3 = n1-n2 +CODE - +SUB @PSP+,TOS \ 2 -- n2-n1 ( = -n3) +XOR #-1,TOS \ 1 +ADD #1,TOS \ 1 -- n3 = -(n2-n1) = n1-n2 +MOV @IP+,PC +ENDCODE +[THEN] + +[UNDEFINED] MAX [IF] +\ https://forth-standard.org/standard/core/MAX +\ MAX n1 n2 -- n3 signed maximum +CODE MAX + CMP @PSP,TOS \ n2-n1 + S< ?GOTO FW1 \ n2R +PUSH @PSP+ +PUSH TOS +MOV @PSP+,TOS +NEXT +ENDCODE + +\ https://forth-standard.org/standard/core/TwoRFetch +\ ( -- x1 x2 ) ( R: x1 x2 -- x1 x2 ) Copy cell pair x1 x2 from the return stack. +CODE 2R@ +SUB #4,PSP +MOV TOS,2(PSP) +MOV @RSP,TOS +MOV 2(RSP),0(PSP) +NEXT +ENDCODE + +\ https://forth-standard.org/standard/core/TwoRfrom +\ ( -- x1 x2 ) ( R: x1 x2 -- ) Transfer cell pair x1 x2 from the return stack +CODE 2R> +SUB #4,PSP +MOV TOS,2(PSP) +MOV @RSP+,TOS +MOV @RSP+,0(PSP) +NEXT +ENDCODE + +[UNDEFINED] 2VARIABLE [IF] +\ https://forth-standard.org/standard/double/TwoVARIABLE +: 2VARIABLE \ -- +CREATE 4 ALLOT +; +[THEN] + +[UNDEFINED] 2CONSTANT [IF] \ defined if MEM_EXT + \ https://forth-standard.org/standard/double/TwoCONSTANT + : 2CONSTANT \ udlo/dlo/Qlo udhi/dhi/Qhi -- to create double or Q15.16 CONSTANT + CREATE , , \ compile Qhi then Qlo + DOES> 2@ \ execution part addr -- Qhi Qlo + ; +[THEN] + +[UNDEFINED] <> [IF] +\ https://forth-standard.org/standard/core/ne +\ = ( x1 x2 -- flag ) flag is true if and only if x1 is not bit-for-bit the same as x2 +CODE <> +SUB @PSP+,TOS \ 2 +0<> IF + MOV #-1,TOS +THEN +NEXT \ 4 +ENDCODE +[THEN] + +[UNDEFINED] = [IF] +\ https://forth-standard.org/standard/core/Equal +\ = x1 x2 -- flag test x1=x2 +CODE = +SUB @PSP+,TOS \ 2 +0<> IF \ 2 + AND #0,TOS \ 1 + MOV @IP+,PC \ 4 +THEN +XOR #-1,TOS \ 1 flag Z = 1 +MOV @IP+,PC \ 4 +ENDCODE +[THEN] + +\ https://forth-standard.org/standard/core/Uless +\ U< u1 u2 -- flag test u1 IF + MOV #-1,TOS \ 1 + U< IF \ 2 flag + AND #0,TOS \ 1 flag Z = 1 + THEN +THEN +MOV @IP+,PC \ 4 +ENDCODE +[THEN] + +\ ------------------------------------------------------------------------------ +\ CONTROL STRUCTURES +\ ------------------------------------------------------------------------------ +\ THEN and BEGIN compile nothing +\ DO compile one word +\ IF, ELSE, AGAIN, UNTIL, WHILE, REPEAT, LOOP & +LOOP compile two words +\ LEAVE compile three words +\ +[UNDEFINED] IF [IF] +\ https://forth-standard.org/standard/core/IF +\ IF -- IFadr initialize conditional forward branch +CODE IF \ immediate +SUB #2,PSP \ +MOV TOS,0(PSP) \ +MOV &DP,TOS \ -- HERE +ADD #4,&DP \ compile one word, reserve one word +MOV #QFBRAN,0(TOS) \ -- HERE compile QFBRAN +ADD #2,TOS \ -- HERE+2=IFadr +MOV @IP+,PC +ENDCODE IMMEDIATE +[THEN] + +[UNDEFINED] THEN [IF] +\ https://forth-standard.org/standard/core/THEN +\ THEN IFadr -- resolve forward branch +CODE THEN \ immediate +MOV &DP,0(TOS) \ -- IFadr +MOV @PSP+,TOS \ -- +MOV @IP+,PC +ENDCODE IMMEDIATE +[THEN] + +[UNDEFINED] ELSE [IF] +\ https://forth-standard.org/standard/core/ELSE +\ ELSE IFadr -- ELSEadr resolve forward IF branch, leave ELSEadr on stack +CODE ELSE \ immediate +ADD #4,&DP \ make room to compile two words +MOV &DP,W \ W=HERE+4 +MOV #BRAN,-4(W) +MOV W,0(TOS) \ HERE+4 ==> [IFadr] +SUB #2,W \ HERE+2 +MOV W,TOS \ -- ELSEadr +MOV @IP+,PC +ENDCODE IMMEDIATE +[THEN] + +[UNDEFINED] DEFER! [IF] +\ https://forth-standard.org/standard/core/DEFERStore +\ Set the word xt1 to execute xt2. An ambiguous condition exists if xt1 is not for a word defined by DEFER. +CODE DEFER! \ xt2 xt1 -- +MOV @PSP+,2(TOS) \ -- xt1=CFA_DEFER xt2 --> [CFA_DEFER+2] +MOV @PSP+,TOS \ -- +MOV @IP+,PC +ENDCODE +[THEN] + +[UNDEFINED] IS [IF] +\ https://forth-standard.org/standard/core/IS +\ IS xt -- +\ used as is : +\ DEFER DISPLAY create a "do nothing" definition (2 CELLS) +\ inline command : ' U. IS DISPLAY U. becomes the runtime of the word DISPLAY +\ or in a definition : ... ['] U. IS DISPLAY ... +\ KEY, EMIT, CR, ACCEPT and WARM are examples of DEFERred words +\ +\ as IS replaces the PFA value of any word, it's a TO alias for VARIABLE and CONSTANT words... +: IS +STATE @ +IF POSTPONE ['] POSTPONE DEFER! +ELSE ' DEFER! +THEN +; IMMEDIATE +[THEN] + +[UNDEFINED] >BODY [IF] +\ https://forth-standard.org/standard/core/toBODY +\ >BODY -- addr leave BODY of a CREATEd word\ also leave default ACTION-OF primary DEFERred word +CODE >BODY +ADD #4,TOS +MOV @IP+,PC +ENDCODE +[THEN] + +\ ============================================================================= +\ fixpoint words +CODE F+ +BW1 ADD @PSP+,2(PSP) + ADDC @PSP+,TOS + NEXT \ 4 +ENDCODE + +CODE F- +BW1 SUB @PSP+,2(PSP) + SUBC TOS,0(PSP) + MOV @PSP+,TOS + NEXT \ 4 +ENDCODE + +\ https://forth-standard.org/standard/core/HOLDS +\ Adds the string represented by addr u to the pictured numeric output string +\ compilation use: <# S" string" HOLDS #> +\ free chars area in the 32+2 bytes HOLD buffer = {26,23,2} chars with a 32 bits sized {hexa,decimal,binary} number. +\ (2 supplementary bytes are room for sign - and decimal point) +\ C HOLDS addr u -- +CODE HOLDS +BW3 MOV @PSP+,X \ 2 + ADD TOS,X \ 1 src + MOV &HP,Y \ 3 dst +BEGIN SUB #1,X \ 1 src-1 + SUB #1,TOS \ 1 cnt-1 +U>= WHILE SUB #1,Y \ 1 dst-1 + MOV.B @X,0(Y) \ 4 +REPEAT MOV Y,&HP \ 3 + MOV @PSP+,TOS \ 2 + MOV @IP+,PC \ 4 15 words +ENDCODE + +TLV_ORG 4 + @ $81F3 U< +$81EF TLV_ORG 4 + @ U< += [IF] ; MSP430FR2xxx|MSP430FR4xxx subfamilies without hardware_MPY + + +CODE F/ \ Q15.16 / Q15.16 --> Q15.16 result + PUSHM #4,R7 + MOV @PSP+,R6 \ DVRlo + MOV @PSP+,X \ DVDhi --> REMlo + MOV #0,W \ REMhi = 0 + MOV @PSP,Y \ DVDlo --> DVDhi + MOV #0,T \ DVDlo = 0 + MOV X,S \ + XOR TOS,S \ DVDhi XOR DVRhi --> S keep sign of result + AND #-1,X \ DVD < 0 ? +S< IF XOR #-1,Y \ INV(DVDlo) + XOR #-1,X \ INV(DVDhi) + ADD #1,Y \ INV(DVDlo)+1 + ADDC #0,X \ INV(DVDhi)+C +THEN AND #-1,TOS \ DVR < 0 ? +S< IF XOR #-1,R6 \ INV(DVRlo) + XOR #-1,TOS \ INV(DVRhi) + ADD #1,R6 \ INV(DVRlo)+1 + ADDC #0,TOS \ INV(DVRhi)+C +THEN +\ don't uncomment lines below ! +\ ------------------------------------------------------------------------ +\ UD/MOD DVDlo DVDhi DVRlo DVRhi -- REMlo REMhi QUOTlo QUOThi +\ ------------------------------------------------------------------------ +\ MOV 4(PSP),T \ DVDlo +\ MOV 2(PSP),Y \ DVDhi +\ MOV #0,X \ REMlo = 0 +\ MOV #0,W \ REMhi = 0 + MOV #32,R5 \ init loop count +BW1 CMP TOS,W \ 1 REMhi = DVRhi ? + 0= IF CMP R6,X \ 1 REMlo U< DVRlo ? + THEN + U>= IF SUB R6,X \ 1 no: REMlo - DVRlo (carry is set) + SUBC TOS,W \ 1 REMhi - DVRhi + THEN +BW2 ADDC R7,R7 \ 1 RLC quotLO + ADDC R4,R4 \ 1 RLC quotHI + SUB #1,R5 \ 1 Decrement loop counter + 0< ?GOTO FW1 \ 2 out of loop if count<0 + ADD T,T \ 1 RLA DVDlo + ADDC Y,Y \ 1 RLC DVDhi + ADDC X,X \ 1 RLC REMlo + ADDC W,W \ 1 RLC REMhi + U< ?GOTO BW1 \ 2 15~ loop + SUB R6,X \ 1 REMlo - DVRlo + SUBC TOS,W \ 1 REMhi - DVRhi + BIS #1,SR \ 1 + GOTO BW2 \ 2 16~ loop +FW1 +\ MOV X,4(PSP) \ REMlo +\ MOV W,2(PSP) \ REMhi +\ ADD #4,PSP \ skip REMlo REMhi + MOV R7,0(PSP) \ QUOTlo + MOV R4,TOS \ QUOThi + POPM #4,R7 \ restore R4 to R7 +\ MOV @IP+,PC \ end of UD/MOD +\ ------------------------------------------------------------------------ +BW1 AND #-1,S \ clear V, set N; QUOT < 0 ? +S< IF XOR #-1,0(PSP) \ INV(QUOTlo) + XOR #-1,TOS \ INV(QUOThi) + ADD #1,0(PSP) \ INV(QUOTlo)+1 + ADDC #0,TOS \ INV(QUOThi)+C +THEN MOV @IP+,PC +ENDCODE + +\ F#S Qlo Qhi u -- Qhi 0 convert fractional part Qlo of Q15.16 fixed point number +\ with u digits +CODE F#S + MOV 2(PSP),X \ -- Qlo Qhi u X = Qlo + MOV @PSP,2(PSP) \ -- Qhi Qhi u + MOV X,0(PSP) \ -- Qhi Qlo u + PUSHM #2,TOS \ save TOS,IP + MOV #0,S \ -- Qhi Qlo x +BEGIN PUSH S \ R-- limit IP count + MOV &BASEADR,TOS \ -- Qhi Qlo base + LO2HI + UM* \ u1 u2 -- RESlo REShi + HI2LO \ -- Qhi RESlo digit + SUB #2,IP + CMP #10,TOS \ digit to char + U>= IF ADD #7,TOS + THEN ADD #$30,TOS + MOV @RSP+,S \ R-- limit IP + MOV.B TOS,HOLDS_ORG(S) \ -- Qhi RESlo char char to string + ADD #1,S \ count+1 + CMP 2(RSP),S \ count=limit ? +U>= UNTIL + POPM #2,TOS \ restore IP,TOS + MOV #0,0(PSP) \ -- Qhi 0 len + SUB #2,PSP \ -- Qhi 0 x len + MOV #HOLDS_ORG,0(PSP) \ -- Qhi 0 addr len + GOTO BW3 \ jump HOLDS +ENDCODE + +\ unsigned multiply 32*32 = 64 +\ don't use S reg (keep sign) +CODE UDM* + PUSH IP \ 3 + PUSHM #4,R7 \ 6 save R7 ~ R4 regs + MOV 4(PSP),IP \ 3 MDlo + MOV 2(PSP),T \ 3 MDhi + MOV @PSP,W \ 2 MRlo + MOV #0,R4 \ 1 MDLO=0 + MOV #0,R5 \ 1 MDHI=0 + MOV #0,4(PSP) \ 3 RESlo=0 + MOV #0,2(PSP) \ 3 REShi=0 + MOV #0,R6 \ 1 RESLO=0 + MOV #0,R7 \ 1 RESHI=0 + MOV #1,X \ 1 BIT TEST REGlo + MOV #0,Y \ 1 BIT TEST2 REGhi +BEGIN CMP #0,X + 0<> IF BIT X,W \ 2+1 TEST ACTUAL BIT MRlo + ELSE BIT Y,TOS \ 2+1 TEST ACTUAL BIT MRhi + THEN + 0<> IF ADD IP,4(PSP) \ 2+3 IF 1: ADD MDlo TO RESlo + ADDC T,2(PSP) \ 3 ADDC MDhi TO REShi + ADDC R4,R6 \ 1 ADDC MDLO TO RESLO + ADDC R5,R7 \ 1 ADDC MDHI TO RESHI + THEN ADD IP,IP \ 1 (RLA LSBs) MDlo *2 + ADDC T,T \ 1 (RLC MSBs) MDhi *2 + ADDC R4,R4 \ 1 (RLA LSBs) MDLO *2 + ADDC R5,R5 \ 1 (RLC MSBs) MDHI *2 + ADD X,X \ 1 (RLA) NEXT BIT TO TEST + ADDC Y,Y \ 1 (RLA) NEXT BIT TO TEST +U>= UNTIL MOV R6,0(PSP) \ 2+2 IF BIT IN CARRY: FINISHED 32 * 16~ (average loop) + MOV R7,TOS \ 1 high result in TOS + POPM #4,R7 \ 6 restore R4 to R7 + MOV @RSP+,IP \ 2 + MOV @IP+,PC +ENDCODE + +CODE F* \ s15.16 * s15.16 --> s15.16 result + MOV 2(PSP),S \ + XOR TOS,S \ 1s15 XOR 2s15 --> S keep sign of result + BIT #$8000,2(PSP) \ MD < 0 ? +0<> IF XOR #-1,2(PSP) + XOR #-1,4(PSP) + ADD #1,4(PSP) + ADDC #0,2(PSP) +THEN + COLON + DABS UDM* \ -- RES0 RES1 RES2 RES3 + HI2LO + MOV @RSP+,IP + MOV @PSP+,TOS \ -- RES0 RES1 RES2 + MOV @PSP+,0(PSP) \ -- RES1 RES2 + GOTO BW1 \ goto end of F/ to process sign of result +ENDCODE + +[ELSE] \ hardware multiplier + +CODE F/ \ Q15.16 / Q15.16 --> Q15.16 result +\ TOS = DVRhi +\ 0(PSP) = DVRlo +\ 2(PSP) = DVDhi +\ 4(PSP) = DVDlo + PUSHM #4,R7 \ 6 PUSHM R7 to R4 + MOV @PSP+,R6 \ 2 DVRlo + MOV @PSP+,X \ 2 DVDhi --> REMlo + MOV #0,W \ 1 REMhi = 0 + MOV @PSP,Y \ 2 DVDlo --> DVDhi + MOV #0,T \ 1 DVDlo = 0 + MOV X,S \ 1 + XOR TOS,S \ 1 DVDhi XOR DVRhi --> S keep sign of result + AND #-1,X \ 1 DVD < 0 ? +S< IF XOR #-1,Y \ 1 INV(DVDlo) + XOR #-1,X \ 1 INV(DVDhi) + ADD #1,Y \ 1 INV(DVDlo)+1 + ADDC #0,X \ 1 INV(DVDhi)+C +THEN AND #-1,TOS \ 1 DVR < 0 ? +S< IF XOR #-1,R6 \ 1 INV(DVRlo) + XOR #-1,TOS \ 1 INV(DVRhi) + ADD #1,R6 \ 1 INV(DVRlo)+1 + ADDC #0,TOS \ 1 INV(DVRhi)+C +THEN MOV #32,R5 \ 2 init loop count +BW1 CMP TOS,W \ 1 REMhi = DVRhi ? + 0= IF \ 2 + CMP R6,X \ 1 REMlo U< DVRlo ? + THEN + U>= IF \ 2 + SUB R6,X \ 1 no: REMlo - DVRlo (carry is set) + SUBC TOS,W \ 1 REMhi - DVRhi + THEN +BW2 ADDC R7,R7 \ 1 RLC quotLO + ADDC R4,R4 \ 1 RLC quotHI + SUB #1,R5 \ 1 Decrement loop counter + 0< ?GOTO FW1 \ 2 out of loop if count<0 + ADD T,T \ 1 RLA DVDlo + ADDC Y,Y \ 1 RLC DVDhi + ADDC X,X \ 1 RLC REMlo + ADDC W,W \ 1 RLC REMhi + U< ?GOTO BW1 \ 2 19~ loop + SUB R6,X \ 1 REMlo - DVRlo + SUBC TOS,W \ 1 REMhi - DVRhi + BIS #1,SR \ 1 + GOTO BW2 \ 2 16~ loop +FW1 AND #-1,S \ 1 clear V, set N; QUOT < 0 ? +S< IF XOR #-1,R7 \ 1 INV(QUOTlo) + XOR #-1,R4 \ 1 INV(QUOThi) + ADD #1,R7 \ 1 INV(QUOTlo)+1 + ADDC #0,R4 \ 1 INV(QUOThi)+C +THEN MOV R7,0(PSP) \ 3 QUOTlo + MOV R4,TOS \ 1 QUOThi + POPM #4,R7 \ 6 restore R4 to R7 + MOV @IP+,PC \ 4 +ENDCODE + +\ F#S Qlo Qhi u -- Qhi 0 convert fractionnal part of Q15.16 fixed point number +\ with u digits +CODE F#S + MOV 2(PSP),X \ -- Qlo Qhi u X = Qlo + MOV @PSP,2(PSP) \ -- Qhi Qhi u + MOV X,0(PSP) \ -- Qhi Qlo u + MOV TOS,T \ T = limit + MOV #0,S \ S = count +BEGIN MOV @PSP,&MPY \ Load 1st operand + MOV &BASEADR,&OP2 \ Load 2nd operand + MOV &RES0,0(PSP) \ -- Qhi RESlo x low result on stack + MOV &RES1,TOS \ -- Qhi RESlo REShi high result in TOS + CMP #10,TOS \ digit to char + U>= IF ADD #7,TOS + THEN ADD #$30,TOS + MOV.B TOS,HOLDS_ORG(S) \ -- Qhi RESlo char char to string + ADD #1,S \ count+1 + CMP T,S \ count=limit ? +0= UNTIL MOV #0,0(PSP) \ -- Qhi 0 REShi + MOV T,TOS \ -- Qhi 0 limit + SUB #2,PSP \ -- Qhi 0 x len + MOV #HOLDS_ORG,0(PSP) \ -- Qhi 0 addr len + GOTO BW3 \ jump HOLDS +ENDCODE + +CODE F* \ signed s15.16 multiplication --> s15.16 result + MOV 4(PSP),&MPYS32L \ 5 Load 1st operand + MOV 2(PSP),&MPYS32H \ 5 + MOV @PSP,&OP2L \ 4 load 2nd operand + MOV TOS,&OP2H \ 3 + ADD #4,PSP \ 1 remove 2 cells +\ NOP2 \ 2 +\ NOP2 \ 2 wait 8 cycles after write OP2L before reading RES1 + MOV &RES1,0(PSP) \ 5 + MOV &RES2,TOS \ 5 + MOV @IP+,PC +ENDCODE + +[THEN] \ hardware multiplier + +CODE F.N \ ( f n -- ) display a Q15.16 number with n digits after comma +MOV TOS,T \ T = #digits +MOV @PSP+,TOS +MOV TOS,S \ S = sign +PUSHM #3,IP \ R-- IP sign #digit +LO2HI + <# DABS \ -- uQlo uQhi R-- IP sign #digit + R> F#S \ -- uQhi 0 R-- IP sign + $2C HOLD \ $2C = char ',' + #S \ -- 0 0 + R> SIGN #> \ -- addr len R-- IP + TYPE SPACE \ -- +; + + +\ https://forth-standard.org/standard/double/Dless +\ flag is true if and only if d1 is less than d2 +CODE D< + MOV @PSP+,S \ S=d2L + MOV @PSP+,T \ T=d1H + MOV @PSP+,W \ W=d1L +BW1 CMP TOS,T \ 1 d1H - d2H + MOV #0,TOS \ 1 -- false_flag by default +S< IF MOV #-1,TOS \ 2 -- true_flag if d1H < d2H +THEN +0= IF CMP S,W \ 1 -- false_flag d1L - d2L + S< IF MOV #-1,TOS \ 1 -- true_flag if (d1H = d2H) & (d1L < d2L) + THEN +THEN +NEXT \ 4 +ENDCODE + +\ : D> 2SWAP D< ; +CODE D> +MOV TOS,T \ T=d2H +MOV @PSP+,W \ W=d2L +MOV @PSP+,TOS \ TOS=d1H +MOV @PSP+,S \ S=d1L +GOTO BW1 +ENDCODE + +CODE S2F \ ( s -- f ) Signed number to fixed point + SUB #2,PSP + MOV #0,0(PSP) + MOV @IP+,PC +ENDCODE + +: F2S \ ( f -- s ) Fixed point to signed number (rounded) + SWAP $8000 AND IF 1 + THEN ; + +: DMIN \ ( d1 d2 -- d_min ) Minimum of double number (also for fixed-point) + 2OVER 2OVER + D< IF 2DROP ELSE 2NIP THEN +; + +: DMAX \ ( d1 d2 -- d_max ) Maximum of double number (also for fixed-point) + 2OVER 2OVER + D> IF 2DROP ELSE 2NIP THEN +; + +: DRANGE \ ( d_val d_min d_max -- d_val ) Make sure a double number is in range + 2ROT DMIN DMAX +; + +: RANGE \ ( s_val s_min s_max -- s_val ) Make sure a number is in range + ROT MIN MAX +; + +: F.000 3 F.N ; \ Output fixed point value + +\ Setup variables for pid control +2VARIABLE KP \ Proportionnal coeff, scaled to input range. +2VARIABLE KI \ integral coeff, in second +2VARIABLE KD \ derivative coeff, in second +VARIABLE SETPOINT \ setpoint, same scale as input + +VARIABLE SAMPLE_TIME \ sampling interval in ms +VARIABLE OUT_MAX \ output max limit (--> 20 mA) +VARIABLE OUT_MIN \ output min limit (--> 4 mA) +VARIABLE OUT-OVERRIDE \ output override (auto mode if -1) + +\ Working variables while pid is running +VARIABLE SET-VAL \ current setpoint +VARIABLE INPUT_PREV \ last seen input +2VARIABLE I_SUM \ cummulative i error + +VARIABLE DEBUG \ PID compute state +0 DEBUG ! + +: ?DEBUG DEBUG @ ; + + +\ ============================================================================= +\ Main PID - internal definitions (do not call manually) +\ inputs and outputs are 16 bits numbers +\ PID parameters and PID compute are Q15.16 numbers. + +: CALC-P \ ( f_error -- f_correction ) Calculate proportionnal output +KP 2@ F* \ fetch k-value and scale error +?DEBUG IF ." Pval:" 2DUP F2S . +THEN +; + + +: CALC-I \ ( f_error -- f_correction ) Calculate integral output +KI 2@ F* \ apply ki factor +I_SUM 2@ F+ \ sum up with running integral error +OUT_MIN @ S2F +OUT_MAX @ S2F +DRANGE \ cap inside output range +2DUP I_SUM 2! \ update running integral error +?DEBUG IF ." Ival:" 2DUP F2S . +THEN +; + +: CALC-D \ ( s_is -- f_correction ) Calculate differential output + \ actually use "derivative on input", not on error + INPUT_PREV @ - \ substract last input from current input + S2F KD 2@ F* \ make fixed point, fetch kd factor and multiply +?DEBUG IF ." Dval:" 2DUP F2S . +THEN +; + +: PID_COMPUTE \ ( s_is -- s_corr ) Do a PID calculation, return duty-cycle +\ CR ." SET:" SET-VAL @ . ." IS:" DUP . \ DEBUG +\ feed error in p and i, current setpoint in d, sum up results +DUP DUP SET-VAL @ SWAP - S2F \ ( s_is s_is f_error ) +2DUP CALC-P \ ( s_is s_is f_error f_p ) +2SWAP CALC-I F+ \ ( s_is s_is f_p+i ) +ROT CALC-D F- \ ( s_is f_p+i+d ) \ substract! derivate on input - not error + +F2S \ ( s_is s_corr ) +?DEBUG IF ." OUT:" DUP . +THEN +SWAP INPUT_PREV ! \ Update INPUT_PREV for next run +OUT_MIN @ OUT_MAX @ RANGE \ Make sure we return something inside PWM range +?DEBUG IF ." PWM:" DUP . +THEN +; + +\ ============================================================================= +\ Main PID - external interface + +: SET \ ( s -- ) Change setpoint on a running pid + SET-VAL ! ; + +: TUNING \ ( f_kp f_ki f_kd -- ) Change tuning-parameters on a running pid + \ depends on sampletime, so fetch it, move to fixed-point and change unit to seconds + \ store on return stack for now + SAMPLE_TIME @ S2F 1000,0 F/ 2>R \ + + 2R@ F/ KD 2! \ translate from 1/s to the sampletime + 2R> F* KI 2! \ translate from 1/s to the sampletime + KP 2! ; + +\ Init PID +\ To use in a *reverse acting system* (bigger output value **reduced** +\ input value make sure `kp`, `ki` and `kd` are **all** negative. +\ Starts pid in manual mode (no setpoint set!). Set setpoint and call auto +\ to start the control loop. +: PID-INIT \ ( f_kp f_ki f_kd s_sampletime s_outmin s_outmax -- ) + OUT_MAX ! + OUT_MIN ! + SAMPLE_TIME ! + TUNING + 0 OUT-OVERRIDE ! \ Make sure we're in manual mode + CR ." PID initialized - kp:" KP 2@ F.000 ." ki:" KI 2@ F.000 ." kd:" KD 2@ F.000 +; + +\ Returns calculated PID value or override value if in manual mode +: PID \ ( s_is -- s_corr ) + OUT-OVERRIDE @ -1 = IF \ we're in auto-mode - do PID calculation + PID_COMPUTE + ELSE \ manual-mode! store input, return override value + CR ." SET:" SET-VAL @ . ." IS:" DUP . + INPUT_PREV ! + OUT-OVERRIDE @ + ." PWM:" DUP . + THEN ; + +: MANUAL \ ( s -- ) Override output - switches PID into *manual mode* + OUT-OVERRIDE ! ; + + +: AUTO \ ( -- ) Switch back to auto-mode after manual mode + OUT-OVERRIDE @ -1 <> IF \ only do something if we'r in override mode + \ store current output value as i to let it run smoothly + OUT-OVERRIDE @ + OUT_MIN @ OUT_MAX @ RANGE \ Make sure we return something inside PWM range + S2F I_SUM 2! \ init I_SUM + -1 OUT-OVERRIDE ! + THEN ; + +: AUTOHOLD \ ( -- ) Bring PID back to auto-mode after a manual override + INPUT_PREV @ SET-VAL ! \ Use last input as setpoint (no bumps!) + AUTO ; + + + +\ \ ******************************\ +\ ASM BACKGROUND \ +\ \ ******************************\ +\ BEGIN +\ \ ... \ insert here your background task +\ \ ... \ +\ \ ... \ +\ CALL &RXON \ comment this line to disable TERMINAL_INPUT +\ BIS &LPM_MODE,SR \ +\ \ ******************************\ +\ \ here start all interrupts \ +\ \ ******************************\ +\ \ here return all interrupts \ +\ \ ******************************\ +\ AGAIN \ +\ ENDASM \ +\ \ ******************************\ + +\ ------------------------------\ +CODE STOP \ stops multitasking, must to be used before downloading app +\ ------------------------------\ + MOV @IP+,PC +ENDCODE + +\ ------------------------------\ +CODE APP_INIT \ this routine completes the init of system, i.e. FORTH + this app. +\ ------------------------------\ + MOV @IP+,PC +ENDCODE \ + +\ ------------------------------\ +CODE START \ this routine replaces WARM and SLEEP default values by these of this application. +\ ------------------------------\ +\ MOV #SLEEP,X \ replace default background process SLEEP +\ MOV #BACKGROUND,2(X) \ by RC5toLCD BACKGROUND +\ MOV #WARM,X \ replace default WARM +\ MOV #APP_INIT,2(X) \ by RC5toLCD APP_INIT +\ MOV X,PC \ then execute it + MOV @IP+,PC +ENDCODE + + +ECHO diff --git a/MSP430-FORTH/test/SD_LOAD.f b/MSP430-FORTH/test/SD_LOAD.f index 269cc0d..e5fd11c 100644 --- a/MSP430-FORTH/test/SD_LOAD.f +++ b/MSP430-FORTH/test/SD_LOAD.f @@ -129,12 +129,19 @@ SD_LOAD.f \ BODY+2 = VOClink value before MARKER definition \ BODY+4 = RET_ADR: by default MARKER_DOES does a call to RET_ADR (does nothing) 10 ALLOT \ make room for: -\ {SD_APP}+10 = content of previous .... -\ {SD_APP}+12 = content of previous .... -\ {SD_APP}+14 = content of previous .... -\ {SD_APP}+16 = content of previous .... -\ {SD_APP}+18 = content of previous .... - +\ {SD_APP} = content of previous SOFT_APP +\ {SD_APP}+2 = content of previous HARD_APP +\ {SD_APP}+4 = content of previous .... +\ {SD_APP}+6 = content of previous .... +\ {SD_APP}+8 = content of previous .... + + [UNDEFINED] TSTBIT [IF] + CODE TSTBIT \ addr bit_mask -- true/flase flag + MOV @PSP+,X + AND @X,TOS + MOV @IP+,PC + ENDCODE + [THEN] \ ====================================\ @@ -142,11 +149,11 @@ SD_LOAD.f \ ====================================\ MOV #1,X \ \ ====================================\ -\ SPI_X_GET \ PUT(FFh) X times, output : W = last received byte, X = 0 +\ SPI_X_GET = SPI_GET+2 \ PUT(FFh) X times, output : W = last received byte, X = 0 \ ====================================\ MOV #-1,W \ \ ====================================\ -\ SPI_PUT \ PUT(W) X times, output : W = last received byte, X = 0 +\ SPI_PUT = SPI_GET+4 \ PUT(W) X times, output : W = last received byte, X = 0 \ ====================================\ BEGIN SWPB W \ 1 @@ -168,43 +175,37 @@ SD_LOAD.f \ in SPI mode CRC is not required, but CMD frame must be ended with a stop bit \ ====================================\ - HDNCODE REWR_CMD \ WX <=== CMD17 or CMD24 (read or write Sector CMD) + HDNCODE SEND17_24 \ WX <=== CMD17 or CMD24 (read or write Sector CMD) \ ====================================\ BIC.B #CS_SD,&SD_CSOUT \ set Chip Select low - BIT.B #CD_SD,&SD_CDIN \ test Card Detect: memory card present ? - 0<> IF \ - MOV #COLD,PC \ no: force COLD - THEN \ yes -\ ------------------------------------\ input = logical sector... +\ ------------------------------------\ +\ ComputePhysicalSector \ input = logical sector... +\ ------------------------------------\ ADD &BS_FirstSectorL,W \ 3 ADDC &BS_FirstSectorH,X \ 3 \ ------------------------------------\ ...output = physical sector \ Compute CMD \ \ ------------------------------------\ MOV #1,&SD_CMD_FRM \ 3 $(01 00 xx xx xx CMD) set stop bit in CMD frame - CMP #1,&FATtype \ 3 FAT16 ? - 0= IF \ 2 yes : CMD17/24 byte address = Sector * BPB_BytsPerSec - ADD W,W \ 1 shift left one Sector - ADDC.B X,X \ 1 - MOV W,&SD_CMD_FRM+2 \ 3 $(01 00 ll LL xx CMD) - MOV.B X,&SD_CMD_FRM+4 \ 3 $(01 00 ll LL hh CMD) - ELSE \ FAT32 : CMD17/24 sector address - MOV.B W,&SD_CMD_FRM+1 \ 3 $(01 ll xx xx xx CMD) - SWPB W \ 1 - MOV.B W,&SD_CMD_FRM+2 \ 3 $(01 ll LL xx xx CMD) - MOV.B X,&SD_CMD_FRM+3 \ 3 $(01 ll LL hh xx CMD) - SWPB X \ 1 - MOV.B X,&SD_CMD_FRM+4 \ 3 $(01 ll LL hh HH CMD) - THEN + MOV.B W,&SD_CMD_FRM+1 \ 3 $(01 ll xx xx xx CMD) + SWPB W \ 1 + MOV.B W,&SD_CMD_FRM+2 \ 3 $(01 ll LL xx xx CMD) + MOV.B X,&SD_CMD_FRM+3 \ 3 $(01 ll LL hh xx CMD) + SWPB X \ 1 + MOV.B X,&SD_CMD_FRM+4 \ 3 $(01 ll LL hh HH CMD) + GOTO FW1 + ENDCODE + + HDNCODE WIBS_CMD \ WaitIdleBeforeSendCMD \ ====================================\ -BW1 \ WaitIdleBeforeSendCMD \ <=== CMD41, CMD1, CMD16 (forthMSP430FR_SD_INIT.asm) +FW1 \ WaitIdleBeforeSendCMD \ <=== CMD41, CMD1, CMD16 (forthMSP430FR_SD_INIT.asm) \ ====================================\ BEGIN \ CALL #SPI_GET \ - ADD.B #1,W \ expected value = FFh <==> MISO = 1 = SPI idle state + ADD.B #1,W \ expected value = FFh <==> MISO = 1 = SPI idle state 0= UNTIL \ loop back if <> FFh \ ====================================\ W = 0 = expected R1 response = ready, for CMD41,CMD16, CMD17, CMD24 -BW2 \ sendCommand \ sendCommand = WaitIdleBeforeSendCMD+8 +BW1 \ sendCommand = WIBS_CMD+8 \ ====================================\ \ input : SD_CMD_FRM : {CRC,byte_l,byte_L,byte_h,byte_H,CMD} \ W = expected return value @@ -215,25 +216,22 @@ BW2 \ sendCommand \ sendCommand = WaitIdleBeforeSendCMD+8 \ Send_CMD_PUT \ performs little endian --> big endian conversion \ ------------------------------------\ BEGIN - MOV.B SD_CMD_FRM(X),&SD_TXBUF \ 5 - CMP #0,&SD_BRW \ 3 full speed ? + MOV.B SD_CMD_FRM(X),&SD_TXBUF \ 5 + CMP #0,&SD_BRW \ 3 full speed ? 0<> IF \ no BEGIN \ case of low speed during memCardInit BIT #RX_SD,&SD_IFG \ 3 - JZ Send_CMD_Loop \ 2 0<> UNTIL CMP.B #0,&SD_RXBUF \ 3 to clear UCRXIFG THEN \ NOP \ 0 NOPx adjusted to avoid SD error SUB.B #1,X \ 1 - U< UNTIL \ 2 don't skip SD_CMD_FRM(0) ! + S< UNTIL \ 2 don't skip SD_CMD_FRM(0) ! \ host must provide height clock cycles to complete operation \ here X=255, so wait for CMD return expected value with PUT FFh 256 times -\ MOV #4,X \ to pass made in PRC SD_Card init -\ MOV #16,X \ to pass Transcend SD_Card init -\ MOV #32,X \ to pass Panasonic SD_Card init -\ MOV #64,X \ to pass SanDisk SD_Card init -\ ------------------------------------\ expect W = return value during X = 255 times +\ ------------------------------------\ +\ Wait_Command_Response \ expect W = return value during X = 255 times +\ ------------------------------------\ BEGIN SUB #1,X \ 1 0>= WHILE \ 2 if out of loop, error on time out with flag Z = 0 @@ -249,13 +247,14 @@ BW2 \ sendCommand \ sendCommand = WaitIdleBeforeSendCMD+8 0= UNTIL \ 2 16~ full speed loop THEN \ WHILE resolution MOV @RSP+,PC \ W = expected value, unchanged + ENDCODE \ ------------------------------------\ flag Z = 1 <==> Returned value = expected value \ ------------------------------------\ HDNCODE CMD_IDLE \ <=== CMD0, CMD8, CMD55: W = 1 = R1 expected response = idle (forthMSP430FR_SD_INIT.asm) \ ------------------------------------\ MOV #1,W \ expected R1 response (first byte of SPI R7) = 01h : idle state - GOTO BW2 \ + GOTO BW1 \ \ ------------------------------------\ @@ -286,32 +285,27 @@ BW2 \ sendCommand \ sendCommand = WaitIdleBeforeSendCMD+8 \'101' - Data rejected due to a CRC error. \'110' - Data Rejected due to a Write Error -\ ----------------------------------\ -CODE ABORT_SD \ <=== OPEN file errors from forthMSP430FR_SD_LOAD.asm -\ ----------------------------------\ - SUB #2,PSP \ - MOV TOS,0(PSP) \ - MOV #10h,&BASE \ select hex - MOV S,TOS \ -\ MOV #TIB_ORG,&CIB_ADR \ restore TIB as Current Input Buffer -\ MOV #BODYACCEPT,&PFAACCEPT \ restore default ACCEPT - LO2HI \ - U. - HI2LO - MOV #ABORT_TERM,PC \ no return... -ENDCODE -\ ----------------------------------\ - -\ ----------------------------------\ -CODE SD_ERROR \ <=== SD_INIT errors 4,8,$10 -\ ----------------------------------\ - SWPB S \ High Level error in High byte - ADD &SD_RXBUF,S \ add SPI(GET) return value as low byte error -BW3 \ SD_CARD_ID_ERROR \ <=== SD_INIT error $20 from forthMSP430FR_SD_LowLvl.asm - BIS.B #CS_SD,&SD_CSOUT \ Chip Select high - COLON \ - S" < SD Error!" \ don't use S register - ABORT_SD +\ ------------------------------\ +CODE SD_ERROR \ <=== SD_INIT errors 4,8,$10 +\ ------------------------------\ +\ SD_CARD_INIT_ERROR \ <=== from forthMSP430FR_SD_INIT.asm +\ SD_CARD_FILE_ERROR \ <=== from forthMSP430FR_SD_LOAD.asm, forthMSP430FR_SD_RW.asm +\ NO_SD_CARD \ from forthMSP430FR_SD_LOAD(Open_File) +BW1 MOV S,TOS \ + CALL #ABORT_TERM \ + CALL #INIT_FORTH \ + LO2HI + [DEFINED] BOOTSTRAP [IF] + NOBOOT \ + [THEN] + ECHO \ + ESC [7m + ."SD_ERROR $" \ + $10 LIT BASEADR ! \ + U. \ + #10 LIT BASEADR ! \ + ESC [0m + ABORT \ ; \ ==================================\ @@ -319,263 +313,244 @@ BW3 \ SD_CARD_ID_ERROR \ <=== SD_INIT error $20 from forthMSP43 \ ==================================\ BIS #1,S \ preset sd_read error MOV.B #51h,&SD_CMD_FRM+5 \ CMD17 = READ_SINGLE_BLOCK - CALL #REWR_CMD \ which performs logical sector to physical sector then little endian to big endian conversion - 0<> ?GOTO BW3 \ SD_ERROR \ time out error if R1 <> 0 -\ ------------------------------------\ - BEGIN \ wait SD_Card response FEh -\ ------------------------------------\ - CALL #SPI_GET \ - ADD.B #2,W \ 1 FEh expected value + CALL #SEND17_24 \ which performs logical sector to physical sector then little endian to big endian conversion + 0<> ?GOTO FW2 \ SD_ERROR \ time out error if R1 <> 0 +\ --------------------------------\ + BEGIN \ wait SD_Card response FEh +\ --------------------------------\ + CALL #SPI_GET \ + ADD.B #2,W \ 1 FEh expected value 0= UNTIL -\ ------------------------------------\ - BEGIN \ get 512+1 bytes, write 512 bytes in SD_BUF -\ ------------------------------------\ - MOV.B #-1,&SD_TXBUF \ 3 put FF - NOP \ 1 NOPx adjusted to avoid read SD_error - ADD #1,X \ 1 - CMP #BytsPerSec+1,X \ 2 +\ --------------------------------\ + BEGIN \ get 512+1 bytes, write 512 bytes in SD_BUF +\ --------------------------------\ + MOV.B #-1,&SD_TXBUF \ 3 put FF + NOP \ 1 NOPx adjusted to avoid read SD_error + ADD #1,X \ 1 + CMP #BytsPerSec+1,X \ 2 0<> WHILE - MOV.B &SD_RXBUF,SD_BUF-1(X) \ 5 + MOV.B &SD_RXBUF,SD_BUF-1(X) \ 5 REPEAT -\ ------------------------------------\ - MOV.B #-1,&SD_TXBUF \ 3 put only one FF because first CRC byte is already received... -\ ------------------------------------\ -\ ReadWriteHappyEnd \ <==== WriteSector -\ ------------------------------------\ -BW2 BIC #3,S \ reset read and write errors - BIS.B #CS_SD,&SD_CSOUT \ Chip Select high - MOV @RSP+,PC \ +\ --------------------------------\ + MOV.B #-1,&SD_TXBUF \ 3 put only one FF because first CRC byte is already received... +\ --------------------------------\ +\ ReadWriteHappyEnd \ <==== WriteSector +\ --------------------------------\ +BW2 BIC #3,S \ reset read and write errors + BIS.B #CS_SD,&SD_CSOUT \ Chip Select high + MOV @RSP+,PC \ ENDCODE -\ ------------------------------------\ +\ --------------------------------\ \ .IFDEF SD_CARD_READ_WRITE -\ ====================================\ - CODE WRITE_SWX \ Write Sector -\ ====================================\ - BIS #2,S \ preset sd_write error - MOV.B #058h,SD_CMD_FRM+5 \ CMD24 = WRITE_SINGLE_BLOCK - CALL #CMD_RW \ which performs logical sector to physical sector then little endian to big endian conversions - 0<> ?GOTO BW3 \ ReturnError = 2 - MOV #2,X \ to put 16 bits value - CALL #SPI_PUT \ which performs little endian to big endian conversion - BEGIN \ 11 cycles loop write, starts with X = 0 - MOV.B SD_BUF(X),&SD_TXBUF \ 5 - NOP \ 1 NOPx adjusted to avoid write SD_error - ADD #1,X \ 1 - CMP #BytsPerSec,X \ 2 - 0= UNTIL -\ ------------------------------------\ CRC16 not used in SPI mode - MOV #3,X \ PUT 2 bytes to skip CRC16 - CALL #SPI_X_GET \ + 1 byte to get data token in W -\ ------------------------------------\ CheckWriteState - BIC.B #0E1h,W \ apply mask for Data response - CMP.B #4,W \ data accepted - 0= ?GOTO BW2 \ goto ReadWriteHappyEnd - GOTO BW3 \ goto SD_ERROR - ENDCODE +\ ================================\ + CODE WRITE_SWX \ Write Sector +\ ================================\ + BIS #2,S \ preset sd_write error + MOV.B #058h,SD_CMD_FRM+5 \ CMD24 = WRITE_SINGLE_BLOCK + CALL #SEND17_24 \ which performs logical sector to physical sector then little endian to big endian conversions + 0= IF \ + MOV #2,X \ to put 16 bits value + CALL #SPI_PUT \ which performs little endian to big endian conversion + BEGIN \ 11 cycles loop write, starts with X = 0 + MOV.B SD_BUF(X),&SD_TXBUF \ 5 + NOP \ 1 NOPx adjusted to avoid write SD_error + ADD #1,X \ 1 + CMP #BytsPerSec,X \ 2 + 0= UNTIL +\ ----------------------------\ CRC16 not used in SPI mode + MOV #3,X \ PUT 2 bytes to skip CRC16 + CALL #SPI_X_GET \ + 1 byte to get data token in W +\ ----------------------------\ CheckWriteState + BIC.B #0E1h,W \ apply mask for Data response + CMP.B #4,W \ data accepted + 0= ?GOTO BW2 \ goto ReadWriteHappyEnd + THEN +FW2 SWPB S \ High Level error in High byte + BIS &SD_RXBUF,S \ add SPI(GET) return value as low byte error + GOTO BW1 \ goto SD_ERROR + ENDCODE \ +\ ----------------------------------\ + +\ this subroutine is called by Write_File (bufferPtr=512) and CloseHandle (0 =< BufferPtr =< 512) +\ ==================================\ + HDNCODE WR_SDBUF \SWX input: T = CurrentHDL +\ ==================================\ + ADD &BufferPtr,HDLL_CurSize(T) \ update handle CurrentSizeL + ADDC #0,HDLH_CurSize(T) \ +\ ==================================\ +\ WriteSectorHL \ = WR_SDBUF+10 +\ ==================================\ + MOV &SectorL,W \ Low + MOV &SectorH,X \ High + MOV #WRITE_SWX,PC \ write SectorWX, W = 0 + ENDCODE \ \ ----------------------------------\ + \ .ENDIF \ SD_CARD_READ_WRITE -\ =========================================================== +\ ================================== \ Init SD_Card -\ =========================================================== -\ ----------------------------------\ - CODE INIT_SD +\ ================================== + +\-----------------------------------\ + CODE INIT_SOFT_SD \ called by INI_FORTH common part of ?ABORT|RST +\-----------------------------------\ + MOV #0,&CurrentHdl \ + MOV &{SD_APP},PC \ link to previous INI_SOFT_APP then RET +\-----------------------------------\ + \ ----------------------------------\ - CALL #INIT_TERM \ which activates all previous I/O settings and set TOS = RSTIV_MEM. + CODE INIT_HARD_SD \ ----------------------------------\ - CMP #0,TOS \ RSTIV_MEM = WARM ? - 0<> IF \ init if RSTIV_MEM <> WARM + CALL &{SD_APP}+2 \ which activates all previous I/O settings and set TOS = RSTIV_MEM. \ ----------------------------------\ - BIT.B #CD_SD,&SD_CDIN \ SD_memory in SD_Card module ? -\ JNZ INI_SD_END \ no - 0= IF \ yes + BIT.B #CD_SD,&SD_CDIN \ SD_memory in SD_Card module ? + 0= IF \ yes \ ----------------------------------\ - MOV #$0A981,&SD_CTLW0 \ UCxxCTL1 = CKPH, MSB, MST, SPI_3, SMCLK + UCSWRST - MOV #FREQUENCY*3,&SD_BRW \ UCxxBRW init SPI CLK = 333 kHz ( < 400 kHz) for SD_Card initialisation - BIS.B #CS_SD,&SD_CSDIR \ SD Chip Select as output high - BIS #BUS_SD,&SD_SEL \ Configure pins as SIMO, SOMI & SCK (PxDIR.y are controlled by eUSCI module) - BIC #1,&SD_CTLW0 \ release eUSCI from reset + MOV #$0A981,&SD_CTLW0 \ UCxxCTL1 = CKPH, MSB, MST, SPI_3, SMCLK + UCSWRST + MOV #FREQUENCY,X + MOV X,&SD_BRW + RLA X + ADD X ,SD_BRW \ UCxxBRW init SPI CLK = 333 kHz ( < 400 kHz) for SD_Card initialisation + BIS.B #CS_SD,&SD_CSDIR \ SD Chip Select as output high + BIS #BUS_SD,&SD_SEL \ Configure pins as SIMO, SOMI & SCK (PxDIR.y are controlled by eUSCI module) + BIC #1,&SD_CTLW0 \ release eUSCI from reset \ ----------------------------------\ - MOV #SD_LEN,X \ - BEGIN \ case of MSP430FR57xx : SD datas are in FRAM not initialized by RESET. - SUB #2,X \ 1 - MOV #0,SD_ORG(X) \ 3 - 0= UNTIL \ 2 + MOV #SD_LEN,X \ + BEGIN \ case of MSP430FR57xx : SD datas are in FRAM not initialized by RESET. + SUB #2,X \ 1 + MOV #0,SD_ORG(X) \ 3 + 0= UNTIL \ 2 \ ----------------------------------\ \ SD_POWER_ON \ ----------------------------------\ - MOV #8,X \ send 64 clk on SD_clk - CALL #SPI_X_GET \ - BIC.B #CS_SD,&SD_CSOUT \ preset Chip Select output low to switch in SPI mode + BIC.B #CS_SD,&SD_CSOUT \ preset Chip Select output low to switch in SPI mode \ ----------------------------------\ \ INIT_CMD0 \ all SD area is 0 filled \ ----------------------------------\ - MOV #4,S \ preset error 4R1 for CMD0 - MOV #$95,&SD_CMD_FRM \ $(95 00 00 00 00 00) - MOV #$4000,&SD_CMD_FRM+4 \ $(95 00 00 00 00 40)\ send CMD0 + MOV #4,S \ preset error 4R1 for CMD0 + MOV #$95,&SD_CMD_FRM \ $(95 00 00 00 00 00) + MOV #0,&SD_CMD_FRM+2 \ + MOV #$4000,&SD_CMD_FRM+4 \ $(95 00 00 00 00 40)\ send CMD0 + MOV #8,Y \ CMD0 necessary loop, not documented in "SDA simplified specifications" \ ----------------------------------\ \ SEND_CMD0 \ CMD0 : GO_IDLE_STATE expected SPI_R1 response = 1 = idle state \ ----------------------------------\ - CALL #sendCommandIdleRet \ X - 0<> IF \ INIT_CMD8 \ if no idle state - MOV #SD_ERROR,PC \ ReturnError = $04R1, case of defectuous card (or insufficient SD_POWER_ON clk) + BEGIN + CALL #CMD_IDLE \ X + 0<> WHILE \ if no idle state + SUB #1,Y \ + 0= IF + MOV #SD_ERROR,PC \ ReturnError = $04R1, case of defectuous card (or insufficient SD_POWER_ON clk) THEN + REPEAT \ ----------------------------------\ see forthMSP430FR_SD_lowLvl.asm -\ INIT_CMD8 \ mandatory if SD_Card >= V2.x [11:8]supply voltage(VHS) +\ INIT_CMD8 \ mandatory if SD_Card >= V2.x [11:8]supply voltage(VHS) \ ----------------------------------\ - BEGIN - CALL #SPI_GET \ (needed to pass SanDisk ultra 8GB "HC I") - CMP.B #-1,W \ FFh expected value <==> MISO = high level -\ JNE INIT_CMD8 \ loop back while yet busy - 0= UNTIL - MOV #$0AA87,&SD_CMD_FRM \ $(87 AA ...) (CRC:CHECK PATTERN) - MOV #1,&SD_CMD_FRM+2 \ $(87 AA 01 00 ...) (CRC:CHECK PATTERN:VHS set as 2.7to3.6V:0) - MOV #$4800,&SD_CMD_FRM+4 \ $(87 AA 01 00 00 48) + MOV #$0AA87,&SD_CMD_FRM \ $(87 AA ...) (CRC:CHECK PATTERN) + MOV #1,&SD_CMD_FRM+2 \ $(87 AA 01 00 ...) (CRC:CHECK PATTERN:VHS set as 2.7to3.6V:0) + MOV #$4800,&SD_CMD_FRM+4 \ $(87 AA 01 00 00 48) \ ----------------------------------\ -\ SEND_CMD8 \ CMD8 = SEND_IF_COND\ expected R1 response (first byte of SPI R7) = 01h : idle state +\ SEND_CMD8 \ CMD8 = SEND_IF_COND\ expected R1 response (first byte of SPI R7) = 01h : idle state \ ----------------------------------\ - CALL #sendCommandIdleRet \X time out occurs with SD_Card V1.x (and all MMC_card) + CALL #CMD_IDLE \ X time out occurs with SD_Card V1.x (and all MMC_card) \ ----------------------------------\ - MOV #4,X \ skip end of SD_Card V2.x type R7 response (4 bytes), because useless - CALL #SPI_X_GET \WX + MOV #4,X \ skip end of SD_Card V2.x type R7 response (4 bytes), because useless + CALL #SPI_GET+2 \ CALL SPI_X_GET \ ----------------------------------\ -INIT_ACMD41 \ no more CRC needed from here +\ INIT_ACMD41 \ no more CRC needed from here \ ----------------------------------\ - MOV #1,&SD_CMD_FRM \ $(01 00 ... set stop bit - MOV #0,&SD_CMD_FRM+2 \ $(01 00 00 00 ... -\ MOV.B #16,Y \ init 16 * ACMD41 repeats (power on fails with SanDisk ultra 8GB "HC I" and Transcend 2GB) -\ MOV.B #32,Y \ init 32 * ACMD41 repeats ==> ~400ms time out - MOV.B #-1,Y \ init 255 * ACMD41 repeats ==> ~3 s time out - MOV #8,S \ preset error 8R1 for ACMD41 + MOV #1,&SD_CMD_FRM \ $(01 00 ... set stop bit + MOV #0,&SD_CMD_FRM+2 \ $(01 00 00 00 ... + MOV.B #-1,Y \ init 255 * ACMD41 repeats ==> ~3 s time out + MOV #8,S \ preset error 8R1 for ACMD41 \ ----------------------------------\ -\ SEND_ACMD41 \ send CMD55+CMD41 +\ SEND_ACMD41 \ send CMD55+CMD41 \ ----------------------------------\ - BEGIN -\ INIT_CMD55 \ - MOV #$7700,&SD_CMD_FRM+4 \ $(01 00 00 00 00 77) -\ SEND_CMD55 \ CMD55 = APP_CMD\ expected SPI_R1 response = 1 : idle - CALL #sendCommandIdleRet \X -\ SEND_CMD41 \ CMD41 = APP OPERATING CONDITION - MOV #$6940,&SD_CMD_FRM+4 \ $(01 00 00 00 40 69) (30th bit = HCS = High Capacity Support request) - CALL #WaitIdleBeforeSendCMD \ wait until idle (needed to pass SanDisk ultra 8GB "HC I") then send Command CMD41 -\ JZ SetBLockLength \ if SD_Card ready (R1=0) - 0<> WHILE \ if SD_Card not ready (R1<>0) - SUB.B #1,Y \ else decr time out delay -\ JNZ INIT_CMD55 \ then loop back while count of repeat not reached - 0= IF - MOV #SD_ERROR,PC \ ReturnError on time out : unusable card (or insufficient Vdd SD) - THEN - REPEAT \ + BEGIN + MOV #$7700,&SD_CMD_FRM+4 \ $(01 00 00 00 00 77) +\ SEND_CMD55 \ CMD55 = APP_CMD\ expected SPI_R1 response = 1 : idle + CALL #CMD_IDLE \X +\ SEND_CMD41 \ CMD41 = APP OPERATING CONDITION + MOV #$6940,&SD_CMD_FRM+4 \ $(01 00 00 00 40 69) (30th bit = HCS = High Capacity Support request) + CALL #WIBS_CMD \ wait until idle (needed to pass SanDisk ultra 8GB "HC I") then send Command CMD41 + 0<> WHILE \ if SD_Card not ready (R1<>0) + SUB.B #1,Y \ else decr time out delay + 0= IF + MOV #SD_ERROR,PC \ #8 Error on time out : unusable card (or insufficient Vdd SD) + THEN + REPEAT \ +\ ----------------------------------\ W = R1 = 0 +\ SwitchSPIhighSpeed \ end of SD init ==> SD_CLK = SMCLK \ ----------------------------------\ -\ setBLockLength \ set block = 512 bytes (buffer size), usefull only for FAT16 SD Cards + BIS #1,&SD_CTLW0 \ Software reset + MOV #0,&SD_BRW \ UCxxBRW = 0 ==> SPI_CLK = MCLK + BIC #1,&SD_CTLW0 \ release from reset \ ----------------------------------\ - ADD S,S \ preset error $10 for CMD16 -\ SEND_CMD16 \ CMD16 = SET_BLOCKLEN - MOV #$02,&SD_CMD_FRM+2 \ $(01 00 02 00 ...) - MOV #$5000,&SD_CMD_FRM+4 \ $(01 00 02 00 00 50) - CALL #WaitIdleBeforeSendCMD \ wait until idle then send CMD16 - 0<> IF - MOV #SD_ERROR,PC \ if W = R1 <> 0, ReturnError = $20R1 \ send command ko - THEN \ -\ ----------------------------------\ W = R1 = 0 -\ SwitchSPIhighSpeed \ end of SD init ==> SD_CLK = SMCLK +\ Read_EBP_FirstSector \ BS_FirstSectorHL=0 +\ ----------------------------------\ + MOV #0,W \ + MOV #0,X + CALL #READ_SWX \ read physical first sector + MOV #SD_BUF,Y \ \ ----------------------------------\ - BIS #1,&SD_CTLW0 \ Software reset - MOV #0,&SD_BRW \ UCxxBRW = 0 ==> SPI_CLK = MCLK - BIC #1,&SD_CTLW0 \ release from reset + CMP #$AA55,1FEh(Y) \ valid boot sector ? + 0<> IF + MOV #$1000,S \ error Boot Sector + MOV #SD_ERROR,PC \ + THEN \ ----------------------------------\ -\ Read_EBP_FirstSector \ W=0, BS_FirstSectorHL=0 +\ SetMBR \ \ ----------------------------------\ - MOV #0,X - CALL #readSectorWX \ read physical first sector - MOV #SD_BUF,Y \ - MOV 454(Y),&BS_FirstSectorL \ so, sectors become logical - MOV 456(Y),&BS_FirstSectorH \ - MOV.B 450(Y),W \ W = partition ID + MOV $1C6(Y),&BS_FirstSectorL \ logical sector = physical sector + BS_FirstSector + MOV $1C8(Y),&BS_FirstSectorH \ \ ----------------------------------\ \ TestPartitionID \ \ ----------------------------------\ - MOV #1,&FATtype \ preset FAT16 -\ FAT16_CHS_LBA_Test \ - SUB.B #6,W \ ID=06h Partition FAT16 > 32MB using CHS & LBA ? - 0<> IF \ no -\ FAT16_LBA_Test \ - SUB.B #8,W \ ID=0Eh Partition FAT16 using LBA ? - 0<> IF \ no -\ ----------------------------------\ - MOV #2,&FATtype \ set FAT32 -\ FAT32_LBA_Test \ - ADD.B #2,W \ ID=0Ch Partition FAT32 using LBA ? - 0<> IF \ no -\ FAT32_CHS_LBA_Test \ - ADD.B #1,W \ ID=0Bh Partition FAT32 using CHS & LBA ? - 0<> IF \ no - ADD.B #4,W \ ID=07h assigned to FAT 32 by MiniTools Partition Wizard.... - 0<> IF \ no - ADD #0$200B,W \ - MOV W,S \ - MOV #SD_CARD_ID_ERROR,PC \ S = ReturnError = $20xx with xx = partition ID - THEN - THEN - THEN + MOV.B $1C2(Y),S \ S = partition ID + SUB.B #$0C,S \ ID=0Ch Partition FAT32 using LBA ? + 0<> IF + ADD.B #1,S \ ID=0Bh Partition FAT32 using CHS & LBA ? + 0<> IF + ADD.B #4,S \ ID=07h assigned to FAT32 by MiniTools Partition Wizard.... + 0<> IF + ADD #$1007,S \ set ReturnError = $10 & restore ID value + MOV #SD_ERROR,PC \ see: https://en.wikipedia.org/wiki/Partition_type THEN THEN + THEN \ ----------------------------------\ see: https://en.wikipedia.org/wiki/Partition_type \ Read_MBR_FirstSector \ read first logical sector \ ----------------------------------\ W = 0 - MOV #0,X - CALL #READ_SWX \ ...with the good CMD17 bytes/sectors frame ! (good switch FAT16/FAT32) -\ ----------------------------------\ -\ FATxx_SetFileSystem \ -\ ----------------------------------\ - MOV.B 13(Y),&SecPerClus \ - MOV 14(Y),X \ 3 X = BPB_RsvdSecCnt - MOV X,&OrgFAT1 \ 3 set OrgFAT1 - MOV 22(Y),W \ W = BPB_FATsize - CMP #0,W \ BPB_FATsize = 0 ? - 0= IF - MOV 36(Y),W \ W = BPB_FATSz32 - THEN -\ Set_FATsize \ - MOV W,&FATSize \ limited to 16384 sectors.... - ADD W,X \ - MOV X,&OrgFAT2 \ X = OrgFAT1 + FATsize = OrgFAT2 - ADD W,X \ X = OrgFAT2 + FATsize = FAT16 OrgRootDir | FAT32 OrgDatas - CMP #2,&FATtype \ FAT32? - 0<> IF -\ FAT16_SetRootCluster \ - MOV X,&OrgRootDIR \ only FAT16 use, is a sector used by CLS_SCT - ADD #32,X \ OrgRootDir + RootDirSize = OrgDatas - THEN - SUB &SecPerClus,X \ OrgDatas - SecPerClus*2 = OrgClusters - SUB &SecPerClus,X \ no borrow expected - MOV X,&OrgClusters \ X = virtual cluster 0 address (clusters 0 and 1 don't exist) - MOV &FATtype,&DIRClusterL \ init DIRcluster as RootDIR - THEN \ - THEN \ - MOV @RSP+,PC \ RET - ENDCODE -\ ----------------------------------\ - -\ ----------------------------------\ - HDNCODE RST_ABORT_SD \ common part of ?ABORT|RST -\ ----------------------------------\ - CALL #RET_ADR \ which does nothing -\ ----------------------------------\ - MOV &CurrentHdl,T \ - GOTO FW1 - BEGIN - MOV.B #0,HDLB_Token(T) \ - MOV @T,T \ -FW1 CMP #0,T \ - 0= UNTIL - MOV #TIB_ORG,&CIB_ADR \ restore TIB as Current Input Buffer for next line (next QUIT) - MOV #ACCEPT+4,&ACCEPT+2 \ restore default ACCEPT for next line (next QUIT) + MOV #0,X + CALL #READ_SWX \ ...with the good CMD17 bytes/sectors frame ! (good switch FAT16/FAT32) +\ ----------------------------------\ +\ FAT32_SetFileSystem \ +\ ----------------------------------\ + MOV $0E(Y),X \3 X = BPB_RsvdSecCnt (05FEh=1534) + MOV X,&OrgFAT1 \3 set OrgFAT1 +\ ----------------------------------\ + MOV $24(Y),W \ no set W = BPB_FATSz32 (1D01h=7425) + MOV W,&FATSize \ limited to 32767 sectors.... +\ ----------------------------------\ + ADD W,X \ + MOV X,&OrgFAT2 \ X = OrgFAT1 + FATsize = OrgFAT32 (8959) +\ ----------------------------------\ + ADD W,X \ X = OrgFAT2 + FATsize = FAT32 OrgDatas (16384) +FATxx_SetFileSystemNext \ + MOV.B $0D(Y),Y \ Logical sectors per cluster (8) + MOV Y,&SecPerClus \ + SUB Y,X \ OrgDatas - SecPerClus*2 = OrgClusters + SUB Y,X \ no borrow expected + MOV X,&OrgClusters \ X = virtual cluster 0 address (clusters 0 and 1 don't exist) + MOV #2,&DIRClusterL \ init DIRcluster as FAT32 RootDIR + MOV #0,&DIRClusterH \ + THEN \ MOV @RSP+,PC \ RET - ENDCODE + ENDCODE \ \ ----------------------------------\ \----------------------------------------------------------------------- @@ -592,35 +567,38 @@ FW1 CMP #0,T \ \ Y = BufferPtr, (DIR) EntryOfst, FAToffset - HDNCODE CLS_FAT -\ ----------------------------------\ -\ HDLCurClusToFAT1sectWofstY \WXY Input: T=currentHandle, Output: W=FATsector, Y=FAToffset, Cluster=HDL_CurCluster +\ ==================================\ + HDNCODE RD_FATW \ (< 65536) +\ ==================================\ + ADD &OrgFAT1,W \ + MOV #0,X \ FAT1_SectorHI = 0 + MOV #READ_SWX,PC \ read FAT1SectorW, W = 0 + ENDCODE \ \ ----------------------------------\ + + HDNCODE CLS_FAT +\ ==================================\ +\ HDLCurClusToFAT1sectWofstY \ WXY Input: T=currentHandle, Output: W=FATsector, Y=FAToffset, Cluster=HDL_CurCluster +\ ==================================\ MOV HDLL_CurClust(T),&ClusterL \ MOV HDLH_CurClust(T),&ClusterH \ -\ ----------------------------------\ +\ ==================================\ \ ClusterToFAT1sectWofstY \WXY Input : Cluster \ Output: W = FATsector, Y = FAToffset -\ ----------------------------------\ +\ ==================================\ MOV.B &ClusterL+1,W \ 3 W = ClusterLoHI MOV.B &ClusterL,Y \ 3 Y = ClusterLoLo - CMP #2,&FATtype \ 3 FAT32? - 0= IF \ yes -\ JZ CTF1S_end \ 2 yes - \ input : Cluster n, max = 7FFFFF (SDcard up to 256 GB) \ ClusterLoLo*4 = displacement in 512 bytes sector ==> FAToffset \ ClusterHiLo&ClusterLoHi +C << 1 = relative FATsector + orgFAT1 ==> FATsector \ ----------------------------------\ - MOV.B &ClusterH,X \ X = 0:ClusterHiLo - SWPB X \ X = ClusterHiLo:0 - ADD X,W \ W = ClusterHiLo:ClusterLoHi + MOV.B &ClusterH,X \ X = 0:ClusterHiLo + SWPB X \ X = ClusterHiLo:0 + ADD X,W \ W = ClusterHiLo:ClusterLoHi \ ----------------------------------\ - SWPB Y \ Y = ClusterLoLo:0 - ADD Y,Y \ 1 Y = ClusterLoLo:0 << 1 + carry for FATsector - ADDC W,W \ W = ClusterHiLo:ClusterLoHi << 1 = ClusterHiLo:ClusterL / 128 - SWPB Y -\ CTF1S_end - THEN + SWPB Y \ Y = ClusterLoLo:0 + ADD Y,Y \ 1 Y = ClusterLoLo:0 << 1 + carry for FATsector + ADDC W,W \ W = ClusterHiLo:ClusterLoHi << 1 = ClusterHiLo:ClusterL / 128 + SWPB Y ADD Y,Y \ Y = 0:ClusterLoLo << 1 MOV @RSP+,PC \ 4 ENDCODE @@ -629,61 +607,48 @@ FW1 CMP #0,T \ \ use no registers HDNCODE CLS_SCT -\ ----------------------------------\ Input : Cluster, output: Sector = Cluster_first_sector -\ ComputeClusFrstSect \ If Cluster = 1 ==> RootDirectory ==> SectorL = OrgRootDir -\ ----------------------------------\ Output: SectorL of Cluster - MOV #0,&SectorH \ - MOV &OrgRootDir,&SectorL \ - CMP.B #0,&ClusterH \ clusterH <> 0 ? - 0= IF - CMP #1,&ClusterL \ clusterHL = 1 ? (FAT16 specificity) - 0= IF \ yes, sectorL for FAT16 OrgRootDIR is done - MOV @RSP+,PC - THEN - THEN - - TLV_ORG 4 + @ $81F3 U< - $81EF TLV_ORG 4 + @ U< = \ MSP430FR413x subfamily without hardware_MPY - [IF] \ Cluster24< ClusFrstSect\ SecPerClus = {1,2,4,8,16,32,64} - PUSHM #3,W \ 5 PUSHM W,X,Y - MOV.B &SecPerClus,W \ 3 SecPerClus(5-1) = multiplicator - MOV &ClusterL,X \ 3 Cluster(16-1) --> MULTIPLICANDlo - MOV.B &ClusterH,Y \ 3 Cluster(24-17) --> MULTIPLICANDhi - GOTO FW1 \ - BEGIN \ - ADD X,X \ 1 (RLA) shift one left MULTIPLICANDlo16 - ADDC Y,Y \ 1 (RLC) shift one left MULTIPLICANDhi8 -FW1 RRA W \ 1 shift one right multiplicator - U>= UNTIL \ 2 C = 0 loop back - ADD &OrgClusters,X \ 3 OrgClusters = sector of virtual_cluster_0, word size - ADDC #0,Y \ 1 - MOV X,&SectorL \ 3 low result - MOV Y,&SectorH \ 3 high result - POPM #3,W \ 5 POPM Y,X,W -\ ----------------------------------\ - [ELSE] ; hardware MPY, the general case -\ ----------------------------------\ - MOV &ClusterL,&MPY32L \ 3 - MOV &ClusterH,&MPY32H \ 3 - MOV &SecPerClus,&OP2 \ 5+3 - MOV &RES0,&SectorL \ 5 - MOV &RES1,&SectorH \ 5 - ADD &OrgClusters,&SectorL \ 5 OrgClusters = sector of virtual cluster 0, word size - ADDC #0,&SectorH \ 3 32~ -\ ----------------------------------\ +\ ==================================\ +\ ClusterHLtoFrstSectorHL \ Input : Cluster, output: Sector = Cluster_first_sector +\ ==================================\ Output: SectorL of Cluster + KERNEL_ADDON HMPY TSTBIT [IF] \ KERNEL_ADDON(BIT0) = hardware MPY flag + MOV &ClusterL,&MPY32L \ 3 + MOV &ClusterH,&MPY32H \ 3 + MOV &SecPerClus,&OP2 \ 5+3 + MOV &RES0,&SectorL \ 5 + MOV &RES1,&SectorH \ 5 + ADD &OrgClusters,&SectorL \ 5 OrgClusters = sector of virtual cluster 0, word size + ADDC #0,&SectorH \ 3 32~ + MOV #0,&SectorH \ + [ELSE] \ no hardware MPY + PUSHM #3,W \ 5 PUSHM W,X,Y + MOV.B &SecPerClus,W \ 3 SecPerClus(5-1) = multiplicator + MOV &ClusterL,X \ 3 Cluster(16-1) --> MULTIPLICANDlo + MOV.B &ClusterH,Y \ 3 Cluster(24-17) --> MULTIPLICANDhi + GOTO FW1 \ + BEGIN \ + ADD X,X \ 1 (RLA) shift one left MULTIPLICANDlo16 + ADDC Y,Y \ 1 (RLC) shift one left MULTIPLICANDhi8 +FW1 RRA W \ 1 shift one right multiplicator + U>= UNTIL \ 2 C = 0 loop back + ADD &OrgClusters,X \ 3 OrgClusters = sector of virtual_cluster_0, word size + ADDC #0,Y \ 1 + MOV X,&SectorL \ 3 low result + MOV Y,&SectorH \ 3 high result + POPM #3,W \ 5 POPM Y,X,W [THEN] -\ ----------------------------------\32~ + 5~ by 2* shift MOV @RSP+,PC \ -\ ----------------------------------\ ENDCODE HDNCODE CUR_SCT -\ ----------------------------------\ -\ ComputeHDLcurrentSector \ input: currentHandle, output: Cluster, Sector -\ ----------------------------------\ +\ ==================================\ +\ HDLCurClusPlsOfst2sectorHL \ input: HDL (CurClust, ClustOfst) output: SectorHL +\ ==================================\ MOV HDLL_CurClust(T),&ClusterL \ MOV HDLH_CurClust(T),&ClusterH \ +\ ==================================\ +\ ClusterHL2sectorHL \ W input: ClusterHL, ClustOfst output: SectorHL +\ ==================================\ CALL #CLS_SCT \ Cluster --> its first sector MOV.B HDLB_ClustOfst(T),W \ ADD W,&SectorL \ diff --git a/MSP430-FORTH/test/SD_LOAD_2022-09-26-15-38-34.f b/MSP430-FORTH/test/SD_LOAD_2022-09-26-15-38-34.f new file mode 100644 index 0000000..269cc0d --- /dev/null +++ b/MSP430-FORTH/test/SD_LOAD_2022-09-26-15-38-34.f @@ -0,0 +1,1344 @@ +\ -*- coding: utf-8 -*- + +SD_LOAD.f +\ =========================================================== +\ ABOUT INIT SD_CARD AND HOW TO SELECT FAT16/FAT32 FORMAT +\ =========================================================== +\ FAT16/FAT32 selection is made via the ID of partition in EBP +\ because SD must be always FAT16 and SDHC must be always FAT32 +\ this is automatically done when we format the SD_Card ! + + +\ ===================================================================== +\ goal : accept 64 MB up to 64 GB SD_CARD +\ ===================================================================== +\ thus FAT and RootClus logical sectors are word addressable. + +\ FAT is a little endian structure. +\ CMD frame is sent as big endian. + +\ we assume that SDSC Card (up to 2GB) is FAT16 with a byte addressing +\ and that SDHC Card (4GB up to 64GB) is FAT32 with a sector addressing (sector = 512 bytes) +\ for SDHC Card = 64 GB, cluster = 64 sectors ==> max clusters = 20 0000h ==> FAT size = 16384 sectors +\ ==> FAT1 and FAT2 can be addressed with a single word. + +\ ref. https://en.wikipedia.org/wiki/Extended_boot_record +\ ref. https://en.wikipedia.org/wiki/Partition_type + +\ Formatage FA16 d'une SDSC Card 2GB +\ First sector of physical drive (sector 0) content : +\ --------------------------------------------------- +\ dec@| HEX@ +\ 446 |0x1BE : partition table first record ==> logical drive 0 +\ 462 |0x1CE : partition table 2th record ==> logical drive 1 +\ 478 |0x1DE : partition table 3th record ==> logical drive 2 +\ 494 |0x1EE : partition table 4th record ==> logical drive 3 + +\ partition of first record content : +\ --------------------------------------------------- +\ 450 |0x1C2 = 0x0E : type FAT16 using LBA addressing +\ 454 |0x1C6 = 89 00 00 00 : FirstSector (of logical drive 0) BS_FirstSector = 137 + + +\ Partition type Description +\ 0 empty / unused +\ 1 FAT12 +\ 4 FAT16 for partitions <= 32 MiB +\ 5 extended partition +\ 6 FAT16 for partitions > 32 MiB +\ 11 FAT32 for partitions <= 2 GiB +\ 12 Same as type 11 (FAT32), but using LBA addressing, which removes size constraints +\ 14 Same as type 6 (FAT16), but using LBA addressing +\ 15 Same as type 5, but using LBA addressing +\ ref. https://www.compuphase.com/mbr_fat.htm#BOOTSECTOR + +\ FirstSector of logical drive (sector 0) content : +\ ------------------------------------------------- +\ dec@| HEX@ = HEX decimal +\ 11 | 0x0B = 00 02 : 512 bytes/sector BPB_BytsPerSec = 512 +\ 13 | 0x0D = 40 : 64 sectors/cluster BPB_SecPerClus = 64 +\ 14 | 0x0E = 01 00 : 2 reserved sectors BPB_RsvdSecCnt = 1 +\ 16 | 0x10 = 02 : 2 FATs BPB_NumFATs = 2 (always 2) +\ 17 | 0x11 = 00 02 : 512 entries/directory BPB_RootEntCnt = 512 +\ 19 | 0x13 = 00 00 : BPB_TotSec16 (if < 65535) BPB_TotSec16 = 0 +\ 22 | 0x16 = EB 00 : 235 sectors/FAT (FAT16) BPB_FATSize = 235 +\ 32 | 0x20 = 77 9F 3A 00 : ‭3841911‬ total sectors BPB_TotSec32 = ‭3841911‬ +\ 54 | 0x36 = "FAT16" BS_FilSysType (not used) + +\ all values below are evaluated in logical sectors +\ FAT1 = BPB_RsvdSecCnt = 1 +\ FAT2 = BPB_RsvdSecCnt + BPB_FATSz32 = 1 + 235 = 236 +\ OrgRootDirL = BPB_RsvdSecCnt + (BPB_FATSize * BPB_NumFATs) = 471 +\ RootDirSize = BPB_RootEntCnt * 32 / BPB_BytsPerSec = 32 sectors +\ OrgDatas = OrgRootDir + RootDirSize = 503 +\ OrgCluster = OrgRootDir - 2*BPB_SecPerClus = 375 (virtual value) +\ FirstSectorOfCluster(n) = OrgCluster + n*BPB_SecPerClus ==> cluster(3) = 705 + +\ ==================================================================================== + +\ Formatage FA32 d'une SDSC Card 8GB +\ First sector of physical drive (sector 0) content : +\ --------------------------------------------------- +\ dec@| HEX@ +\ 446 |0x1BE : partition table first record ==> logical drive 0 +\ 462 |0x1CE : partition table 2th record ==> logical drive 1 +\ 478 |0x1DE : partition table 3th record ==> logical drive 2 +\ 494 |0x1EE : partition table 4th record ==> logical drive 3 + +\ partition record content : +\ --------------------------------------------------- +\ 450 |0x1C2 = 0x0C : type FAT32 using LBA addressing +\ 454 |0x1C6 = 00 20 00 00 : FirstSector (of logical drive 0) = BS_FirstSector = 8192 + +\ +\ FirstSector of logical block (sector 0) content : +\ ------------------------------------------------- +\ dec@| HEX@ = HEX decimal +\ 11 | 0x0B = 00 02 : 512 bytes/sector BPB_BytsPerSec = 512 +\ 13 | 0x0D = 08 : 8 sectors/cluster BPB_SecPerClus = 8 +\ 14 | 0x0E = 20 00 : 32 reserved sectors BPB_RsvdSecCnt = 32 +\ 16 | 0x10 = 02 : 2 FATs BPB_NumFATs = 2 (always 2) +\ 17 | 0x11 = 00 00 : 0 BPB_RootEntCnt = 0 (always 0 for FAT32) + +\ 32 | 0x20 = 00 C0 EC 00 : BPB_TotSec32 BPB_TotSec32 = 15515648 +\ 36 | 0x24 = 30 3B 00 00 : BPB_FATSz32 BPB_FATSz32 = 15152 +\ 40 | 0x28 = 00 00 : BPB_ExtFlags BPB_ExtFlags +\ 44 | 0x2C = 02 00 00 00 : BPB_RootClus BPB_RootClus = 2 +\ 48 | 0x30 = 01 00 : BPB_FSInfo BPB_FSInfo = 1 +\ 50 | 0x33 = 06 00 : BPB_BkBootSec BPB_BkBootSec = 6 +\ 82 | 0x52 = "FAT32" : BS_FilSysType BS_FilSysType (not used) + +\ +\ all values below are evaluated in logical sectors +\ FAT1 = BPB_RsvdSecCnt = 32 +\ FAT2 = BPB_RsvdSecCnt + BPB_FATSz32 = 32 + 15152 = 15184 +\ OrgRootDirL = BPB_RsvdSecCnt + BPB_FATSz32 * BPB_NumFATs = 32 + 15152*2 = 30336 +\ OrgCluster = OrgRootDir - 2*BPB_SecPerClus = 30320 +\ RootDirSize = BPB_RootEntCnt * 32 / BPB_BytsPerSec = 0 +\ OrgDatas = OrgRootDir + RootDirSize = 30336 +\ FirstSectorOfCluster(n) = OrgCluster + n*BPB_SecPerClus ==> cluster(6) = 30368 + +\ SPI_GET and SPI_PUT are adjusted for SD_CLK = MCLK +\ PUT value must be a word or byte:byte because little endian to big endian conversion + + + MARKER {SD_APP} +\ CFA = DODOES +\ PFA = MARKER_DOES +\ BODY = DP value before MARKER definition +\ BODY+2 = VOClink value before MARKER definition +\ BODY+4 = RET_ADR: by default MARKER_DOES does a call to RET_ADR (does nothing) + 10 ALLOT \ make room for: +\ {SD_APP}+10 = content of previous .... +\ {SD_APP}+12 = content of previous .... +\ {SD_APP}+14 = content of previous .... +\ {SD_APP}+16 = content of previous .... +\ {SD_APP}+18 = content of previous .... + + + +\ ====================================\ + HDNCODE SPI_GET \ PUT(FFh) one time, output : W = received byte, X = 0 +\ ====================================\ + MOV #1,X \ +\ ====================================\ +\ SPI_X_GET \ PUT(FFh) X times, output : W = last received byte, X = 0 +\ ====================================\ + MOV #-1,W \ +\ ====================================\ +\ SPI_PUT \ PUT(W) X times, output : W = last received byte, X = 0 +\ ====================================\ + BEGIN + SWPB W \ 1 + MOV.B W,&SD_TXBUF \ 3 put W high byte then W low byte and so forth, that performs little to big endian conversion + CMP #0,&SD_BRW \ 3 full speed ? + 0<> IF \ no + BEGIN + BIT #RX_SD,&SD_IFG \ 3 + 0<> UNTIL + CMP.B #0,&SD_RXBUF \ 3 clear RX_BUF flag + THEN +\ NOP \ NOPx adjusted to avoid SD error + SUB #1,X \ 1 + 0= UNTIL \ 2 12~ loop + MOV.B &SD_RXBUF,W \ 3 + MOV @RSP+,PC \ 4 X=0 + ENDCODE +\ ------------------------------------\ + +\ in SPI mode CRC is not required, but CMD frame must be ended with a stop bit +\ ====================================\ + HDNCODE REWR_CMD \ WX <=== CMD17 or CMD24 (read or write Sector CMD) +\ ====================================\ + BIC.B #CS_SD,&SD_CSOUT \ set Chip Select low + BIT.B #CD_SD,&SD_CDIN \ test Card Detect: memory card present ? + 0<> IF \ + MOV #COLD,PC \ no: force COLD + THEN \ yes +\ ------------------------------------\ input = logical sector... + ADD &BS_FirstSectorL,W \ 3 + ADDC &BS_FirstSectorH,X \ 3 +\ ------------------------------------\ ...output = physical sector +\ Compute CMD \ +\ ------------------------------------\ + MOV #1,&SD_CMD_FRM \ 3 $(01 00 xx xx xx CMD) set stop bit in CMD frame + CMP #1,&FATtype \ 3 FAT16 ? + 0= IF \ 2 yes : CMD17/24 byte address = Sector * BPB_BytsPerSec + ADD W,W \ 1 shift left one Sector + ADDC.B X,X \ 1 + MOV W,&SD_CMD_FRM+2 \ 3 $(01 00 ll LL xx CMD) + MOV.B X,&SD_CMD_FRM+4 \ 3 $(01 00 ll LL hh CMD) + ELSE \ FAT32 : CMD17/24 sector address + MOV.B W,&SD_CMD_FRM+1 \ 3 $(01 ll xx xx xx CMD) + SWPB W \ 1 + MOV.B W,&SD_CMD_FRM+2 \ 3 $(01 ll LL xx xx CMD) + MOV.B X,&SD_CMD_FRM+3 \ 3 $(01 ll LL hh xx CMD) + SWPB X \ 1 + MOV.B X,&SD_CMD_FRM+4 \ 3 $(01 ll LL hh HH CMD) + THEN +\ ====================================\ +BW1 \ WaitIdleBeforeSendCMD \ <=== CMD41, CMD1, CMD16 (forthMSP430FR_SD_INIT.asm) +\ ====================================\ + BEGIN \ + CALL #SPI_GET \ + ADD.B #1,W \ expected value = FFh <==> MISO = 1 = SPI idle state + 0= UNTIL \ loop back if <> FFh +\ ====================================\ W = 0 = expected R1 response = ready, for CMD41,CMD16, CMD17, CMD24 +BW2 \ sendCommand \ sendCommand = WaitIdleBeforeSendCMD+8 +\ ====================================\ + \ input : SD_CMD_FRM : {CRC,byte_l,byte_L,byte_h,byte_H,CMD} + \ W = expected return value + \ output W is unchanged, flag Z is positionned + \ reverts CMD bytes before send : $(CMD hh LL ll 00 CRC) + MOV #5,X \ X = SD_CMD_FRM ptr AND countdown +\ ------------------------------------\ +\ Send_CMD_PUT \ performs little endian --> big endian conversion +\ ------------------------------------\ + BEGIN + MOV.B SD_CMD_FRM(X),&SD_TXBUF \ 5 + CMP #0,&SD_BRW \ 3 full speed ? + 0<> IF \ no + BEGIN \ case of low speed during memCardInit + BIT #RX_SD,&SD_IFG \ 3 + JZ Send_CMD_Loop \ 2 + 0<> UNTIL + CMP.B #0,&SD_RXBUF \ 3 to clear UCRXIFG + THEN +\ NOP \ 0 NOPx adjusted to avoid SD error + SUB.B #1,X \ 1 + U< UNTIL \ 2 don't skip SD_CMD_FRM(0) ! + \ host must provide height clock cycles to complete operation + \ here X=255, so wait for CMD return expected value with PUT FFh 256 times +\ MOV #4,X \ to pass made in PRC SD_Card init +\ MOV #16,X \ to pass Transcend SD_Card init +\ MOV #32,X \ to pass Panasonic SD_Card init +\ MOV #64,X \ to pass SanDisk SD_Card init +\ ------------------------------------\ expect W = return value during X = 255 times + BEGIN + SUB #1,X \ 1 + 0>= WHILE \ 2 if out of loop, error on time out with flag Z = 0 + MOV.B #-1,&SD_TXBUF \ 3 PUT FFh + CMP #0,&SD_BRW \ 3 full speed ? + 0<> IF \ + BEGIN \ case of low speed during memCardInit (CMD0,CMD8,ACMD41,CMD16) + BIT #RX_SD,&SD_IFG \ 3 + 0<> UNTIL \ 2 + THEN +\ NOP \ NOPx adjusted to avoid SD_error + CMP.B &SD_RXBUF,W \ 3 return value = ExpectedValue ? + 0= UNTIL \ 2 16~ full speed loop + THEN \ WHILE resolution + MOV @RSP+,PC \ W = expected value, unchanged +\ ------------------------------------\ flag Z = 1 <==> Returned value = expected value + +\ ------------------------------------\ + HDNCODE CMD_IDLE \ <=== CMD0, CMD8, CMD55: W = 1 = R1 expected response = idle (forthMSP430FR_SD_INIT.asm) +\ ------------------------------------\ + MOV #1,W \ expected R1 response (first byte of SPI R7) = 01h : idle state + GOTO BW2 \ +\ ------------------------------------\ + + +\ SD Error n° +\ High byte +\ 1 = CMD17 read error +\ 2 = CMD24 write error +\ 4 = CMD0 time out (GO_IDLE_STATE) +\ 8 = ACMD41 time out (APP_SEND_OP_COND) +\ $10 = CMD16 time out (SET_BLOCKLEN) +\ $20 = not FAT16/FAT32 media, low byte = partition ID + +\ low byte, if CMD R1 response : %0xxx_xxxx +\ 1th bit = In Idle state +\ 2th bit = Erase reset +\ 3th bit = Illegal command +\ 4th bit = Command CRC error +\ 5th bit = erase sequence error +\ 6th bit = address error +\ 7th bit = parameter error + +\ Data Response Token +\ Every data block written to the card will be acknowledged by a data response token. +\ It is one byte long and has the following format: +\ %xxxx_sss0 with bits(3-1) = Status +\The meaning of the status bits is defined as follows: +\'010' - Data accepted. +\'101' - Data rejected due to a CRC error. +\'110' - Data Rejected due to a Write Error + +\ ----------------------------------\ +CODE ABORT_SD \ <=== OPEN file errors from forthMSP430FR_SD_LOAD.asm +\ ----------------------------------\ + SUB #2,PSP \ + MOV TOS,0(PSP) \ + MOV #10h,&BASE \ select hex + MOV S,TOS \ +\ MOV #TIB_ORG,&CIB_ADR \ restore TIB as Current Input Buffer +\ MOV #BODYACCEPT,&PFAACCEPT \ restore default ACCEPT + LO2HI \ + U. + HI2LO + MOV #ABORT_TERM,PC \ no return... +ENDCODE +\ ----------------------------------\ + +\ ----------------------------------\ +CODE SD_ERROR \ <=== SD_INIT errors 4,8,$10 +\ ----------------------------------\ + SWPB S \ High Level error in High byte + ADD &SD_RXBUF,S \ add SPI(GET) return value as low byte error +BW3 \ SD_CARD_ID_ERROR \ <=== SD_INIT error $20 from forthMSP430FR_SD_LowLvl.asm + BIS.B #CS_SD,&SD_CSOUT \ Chip Select high + COLON \ + S" < SD Error!" \ don't use S register + ABORT_SD + ; + +\ ==================================\ + CODE READ_SWX \ Read Sector +\ ==================================\ + BIS #1,S \ preset sd_read error + MOV.B #51h,&SD_CMD_FRM+5 \ CMD17 = READ_SINGLE_BLOCK + CALL #REWR_CMD \ which performs logical sector to physical sector then little endian to big endian conversion + 0<> ?GOTO BW3 \ SD_ERROR \ time out error if R1 <> 0 +\ ------------------------------------\ + BEGIN \ wait SD_Card response FEh +\ ------------------------------------\ + CALL #SPI_GET \ + ADD.B #2,W \ 1 FEh expected value + 0= UNTIL +\ ------------------------------------\ + BEGIN \ get 512+1 bytes, write 512 bytes in SD_BUF +\ ------------------------------------\ + MOV.B #-1,&SD_TXBUF \ 3 put FF + NOP \ 1 NOPx adjusted to avoid read SD_error + ADD #1,X \ 1 + CMP #BytsPerSec+1,X \ 2 + 0<> WHILE + MOV.B &SD_RXBUF,SD_BUF-1(X) \ 5 + REPEAT +\ ------------------------------------\ + MOV.B #-1,&SD_TXBUF \ 3 put only one FF because first CRC byte is already received... +\ ------------------------------------\ +\ ReadWriteHappyEnd \ <==== WriteSector +\ ------------------------------------\ +BW2 BIC #3,S \ reset read and write errors + BIS.B #CS_SD,&SD_CSOUT \ Chip Select high + MOV @RSP+,PC \ + ENDCODE +\ ------------------------------------\ + +\ .IFDEF SD_CARD_READ_WRITE + +\ ====================================\ + CODE WRITE_SWX \ Write Sector +\ ====================================\ + BIS #2,S \ preset sd_write error + MOV.B #058h,SD_CMD_FRM+5 \ CMD24 = WRITE_SINGLE_BLOCK + CALL #CMD_RW \ which performs logical sector to physical sector then little endian to big endian conversions + 0<> ?GOTO BW3 \ ReturnError = 2 + MOV #2,X \ to put 16 bits value + CALL #SPI_PUT \ which performs little endian to big endian conversion + BEGIN \ 11 cycles loop write, starts with X = 0 + MOV.B SD_BUF(X),&SD_TXBUF \ 5 + NOP \ 1 NOPx adjusted to avoid write SD_error + ADD #1,X \ 1 + CMP #BytsPerSec,X \ 2 + 0= UNTIL +\ ------------------------------------\ CRC16 not used in SPI mode + MOV #3,X \ PUT 2 bytes to skip CRC16 + CALL #SPI_X_GET \ + 1 byte to get data token in W +\ ------------------------------------\ CheckWriteState + BIC.B #0E1h,W \ apply mask for Data response + CMP.B #4,W \ data accepted + 0= ?GOTO BW2 \ goto ReadWriteHappyEnd + GOTO BW3 \ goto SD_ERROR + ENDCODE +\ ----------------------------------\ + +\ .ENDIF \ SD_CARD_READ_WRITE + +\ =========================================================== +\ Init SD_Card +\ =========================================================== +\ ----------------------------------\ + CODE INIT_SD +\ ----------------------------------\ + CALL #INIT_TERM \ which activates all previous I/O settings and set TOS = RSTIV_MEM. +\ ----------------------------------\ + CMP #0,TOS \ RSTIV_MEM = WARM ? + 0<> IF \ init if RSTIV_MEM <> WARM +\ ----------------------------------\ + BIT.B #CD_SD,&SD_CDIN \ SD_memory in SD_Card module ? +\ JNZ INI_SD_END \ no + 0= IF \ yes +\ ----------------------------------\ + MOV #$0A981,&SD_CTLW0 \ UCxxCTL1 = CKPH, MSB, MST, SPI_3, SMCLK + UCSWRST + MOV #FREQUENCY*3,&SD_BRW \ UCxxBRW init SPI CLK = 333 kHz ( < 400 kHz) for SD_Card initialisation + BIS.B #CS_SD,&SD_CSDIR \ SD Chip Select as output high + BIS #BUS_SD,&SD_SEL \ Configure pins as SIMO, SOMI & SCK (PxDIR.y are controlled by eUSCI module) + BIC #1,&SD_CTLW0 \ release eUSCI from reset +\ ----------------------------------\ + MOV #SD_LEN,X \ + BEGIN \ case of MSP430FR57xx : SD datas are in FRAM not initialized by RESET. + SUB #2,X \ 1 + MOV #0,SD_ORG(X) \ 3 + 0= UNTIL \ 2 +\ ----------------------------------\ +\ SD_POWER_ON +\ ----------------------------------\ + MOV #8,X \ send 64 clk on SD_clk + CALL #SPI_X_GET \ + BIC.B #CS_SD,&SD_CSOUT \ preset Chip Select output low to switch in SPI mode +\ ----------------------------------\ +\ INIT_CMD0 \ all SD area is 0 filled +\ ----------------------------------\ + MOV #4,S \ preset error 4R1 for CMD0 + MOV #$95,&SD_CMD_FRM \ $(95 00 00 00 00 00) + MOV #$4000,&SD_CMD_FRM+4 \ $(95 00 00 00 00 40)\ send CMD0 +\ ----------------------------------\ +\ SEND_CMD0 \ CMD0 : GO_IDLE_STATE expected SPI_R1 response = 1 = idle state +\ ----------------------------------\ + CALL #sendCommandIdleRet \ X + 0<> IF \ INIT_CMD8 \ if no idle state + MOV #SD_ERROR,PC \ ReturnError = $04R1, case of defectuous card (or insufficient SD_POWER_ON clk) + THEN +\ ----------------------------------\ see forthMSP430FR_SD_lowLvl.asm +\ INIT_CMD8 \ mandatory if SD_Card >= V2.x [11:8]supply voltage(VHS) +\ ----------------------------------\ + BEGIN + CALL #SPI_GET \ (needed to pass SanDisk ultra 8GB "HC I") + CMP.B #-1,W \ FFh expected value <==> MISO = high level +\ JNE INIT_CMD8 \ loop back while yet busy + 0= UNTIL + MOV #$0AA87,&SD_CMD_FRM \ $(87 AA ...) (CRC:CHECK PATTERN) + MOV #1,&SD_CMD_FRM+2 \ $(87 AA 01 00 ...) (CRC:CHECK PATTERN:VHS set as 2.7to3.6V:0) + MOV #$4800,&SD_CMD_FRM+4 \ $(87 AA 01 00 00 48) +\ ----------------------------------\ +\ SEND_CMD8 \ CMD8 = SEND_IF_COND\ expected R1 response (first byte of SPI R7) = 01h : idle state +\ ----------------------------------\ + CALL #sendCommandIdleRet \X time out occurs with SD_Card V1.x (and all MMC_card) +\ ----------------------------------\ + MOV #4,X \ skip end of SD_Card V2.x type R7 response (4 bytes), because useless + CALL #SPI_X_GET \WX +\ ----------------------------------\ +INIT_ACMD41 \ no more CRC needed from here +\ ----------------------------------\ + MOV #1,&SD_CMD_FRM \ $(01 00 ... set stop bit + MOV #0,&SD_CMD_FRM+2 \ $(01 00 00 00 ... +\ MOV.B #16,Y \ init 16 * ACMD41 repeats (power on fails with SanDisk ultra 8GB "HC I" and Transcend 2GB) +\ MOV.B #32,Y \ init 32 * ACMD41 repeats ==> ~400ms time out + MOV.B #-1,Y \ init 255 * ACMD41 repeats ==> ~3 s time out + MOV #8,S \ preset error 8R1 for ACMD41 +\ ----------------------------------\ +\ SEND_ACMD41 \ send CMD55+CMD41 +\ ----------------------------------\ + BEGIN +\ INIT_CMD55 \ + MOV #$7700,&SD_CMD_FRM+4 \ $(01 00 00 00 00 77) +\ SEND_CMD55 \ CMD55 = APP_CMD\ expected SPI_R1 response = 1 : idle + CALL #sendCommandIdleRet \X +\ SEND_CMD41 \ CMD41 = APP OPERATING CONDITION + MOV #$6940,&SD_CMD_FRM+4 \ $(01 00 00 00 40 69) (30th bit = HCS = High Capacity Support request) + CALL #WaitIdleBeforeSendCMD \ wait until idle (needed to pass SanDisk ultra 8GB "HC I") then send Command CMD41 +\ JZ SetBLockLength \ if SD_Card ready (R1=0) + 0<> WHILE \ if SD_Card not ready (R1<>0) + SUB.B #1,Y \ else decr time out delay +\ JNZ INIT_CMD55 \ then loop back while count of repeat not reached + 0= IF + MOV #SD_ERROR,PC \ ReturnError on time out : unusable card (or insufficient Vdd SD) + THEN + REPEAT \ +\ ----------------------------------\ +\ setBLockLength \ set block = 512 bytes (buffer size), usefull only for FAT16 SD Cards +\ ----------------------------------\ + ADD S,S \ preset error $10 for CMD16 +\ SEND_CMD16 \ CMD16 = SET_BLOCKLEN + MOV #$02,&SD_CMD_FRM+2 \ $(01 00 02 00 ...) + MOV #$5000,&SD_CMD_FRM+4 \ $(01 00 02 00 00 50) + CALL #WaitIdleBeforeSendCMD \ wait until idle then send CMD16 + 0<> IF + MOV #SD_ERROR,PC \ if W = R1 <> 0, ReturnError = $20R1 \ send command ko + THEN \ +\ ----------------------------------\ W = R1 = 0 +\ SwitchSPIhighSpeed \ end of SD init ==> SD_CLK = SMCLK +\ ----------------------------------\ + BIS #1,&SD_CTLW0 \ Software reset + MOV #0,&SD_BRW \ UCxxBRW = 0 ==> SPI_CLK = MCLK + BIC #1,&SD_CTLW0 \ release from reset +\ ----------------------------------\ +\ Read_EBP_FirstSector \ W=0, BS_FirstSectorHL=0 +\ ----------------------------------\ + MOV #0,X + CALL #readSectorWX \ read physical first sector + MOV #SD_BUF,Y \ + MOV 454(Y),&BS_FirstSectorL \ so, sectors become logical + MOV 456(Y),&BS_FirstSectorH \ + MOV.B 450(Y),W \ W = partition ID +\ ----------------------------------\ +\ TestPartitionID \ +\ ----------------------------------\ + MOV #1,&FATtype \ preset FAT16 +\ FAT16_CHS_LBA_Test \ + SUB.B #6,W \ ID=06h Partition FAT16 > 32MB using CHS & LBA ? + 0<> IF \ no +\ FAT16_LBA_Test \ + SUB.B #8,W \ ID=0Eh Partition FAT16 using LBA ? + 0<> IF \ no +\ ----------------------------------\ + MOV #2,&FATtype \ set FAT32 +\ FAT32_LBA_Test \ + ADD.B #2,W \ ID=0Ch Partition FAT32 using LBA ? + 0<> IF \ no +\ FAT32_CHS_LBA_Test \ + ADD.B #1,W \ ID=0Bh Partition FAT32 using CHS & LBA ? + 0<> IF \ no + ADD.B #4,W \ ID=07h assigned to FAT 32 by MiniTools Partition Wizard.... + 0<> IF \ no + ADD #0$200B,W \ + MOV W,S \ + MOV #SD_CARD_ID_ERROR,PC \ S = ReturnError = $20xx with xx = partition ID + THEN + THEN + THEN + THEN + THEN +\ ----------------------------------\ see: https://en.wikipedia.org/wiki/Partition_type +\ Read_MBR_FirstSector \ read first logical sector +\ ----------------------------------\ W = 0 + MOV #0,X + CALL #READ_SWX \ ...with the good CMD17 bytes/sectors frame ! (good switch FAT16/FAT32) +\ ----------------------------------\ +\ FATxx_SetFileSystem \ +\ ----------------------------------\ + MOV.B 13(Y),&SecPerClus \ + MOV 14(Y),X \ 3 X = BPB_RsvdSecCnt + MOV X,&OrgFAT1 \ 3 set OrgFAT1 + MOV 22(Y),W \ W = BPB_FATsize + CMP #0,W \ BPB_FATsize = 0 ? + 0= IF + MOV 36(Y),W \ W = BPB_FATSz32 + THEN +\ Set_FATsize \ + MOV W,&FATSize \ limited to 16384 sectors.... + ADD W,X \ + MOV X,&OrgFAT2 \ X = OrgFAT1 + FATsize = OrgFAT2 + ADD W,X \ X = OrgFAT2 + FATsize = FAT16 OrgRootDir | FAT32 OrgDatas + CMP #2,&FATtype \ FAT32? + 0<> IF +\ FAT16_SetRootCluster \ + MOV X,&OrgRootDIR \ only FAT16 use, is a sector used by CLS_SCT + ADD #32,X \ OrgRootDir + RootDirSize = OrgDatas + THEN + SUB &SecPerClus,X \ OrgDatas - SecPerClus*2 = OrgClusters + SUB &SecPerClus,X \ no borrow expected + MOV X,&OrgClusters \ X = virtual cluster 0 address (clusters 0 and 1 don't exist) + MOV &FATtype,&DIRClusterL \ init DIRcluster as RootDIR + THEN \ + THEN \ + MOV @RSP+,PC \ RET + ENDCODE +\ ----------------------------------\ + +\ ----------------------------------\ + HDNCODE RST_ABORT_SD \ common part of ?ABORT|RST +\ ----------------------------------\ + CALL #RET_ADR \ which does nothing +\ ----------------------------------\ + MOV &CurrentHdl,T \ + GOTO FW1 + BEGIN + MOV.B #0,HDLB_Token(T) \ + MOV @T,T \ +FW1 CMP #0,T \ + 0= UNTIL + MOV #TIB_ORG,&CIB_ADR \ restore TIB as Current Input Buffer for next line (next QUIT) + MOV #ACCEPT+4,&ACCEPT+2 \ restore default ACCEPT for next line (next QUIT) + MOV @RSP+,PC \ RET + ENDCODE +\ ----------------------------------\ + +\----------------------------------------------------------------------- +\ SD card OPEN, LOAD subroutines +\----------------------------------------------------------------------- + +\ used variables : BufferPtr, BufferLen + +\ rules for registers use +\ S = error +\ T = CurrentHdl, pathname +\ W = SectorL, (RTC) TIME +\ X = SectorH, (RTC) DATE +\ Y = BufferPtr, (DIR) EntryOfst, FAToffset + + + HDNCODE CLS_FAT +\ ----------------------------------\ +\ HDLCurClusToFAT1sectWofstY \WXY Input: T=currentHandle, Output: W=FATsector, Y=FAToffset, Cluster=HDL_CurCluster +\ ----------------------------------\ + MOV HDLL_CurClust(T),&ClusterL \ + MOV HDLH_CurClust(T),&ClusterH \ +\ ----------------------------------\ +\ ClusterToFAT1sectWofstY \WXY Input : Cluster \ Output: W = FATsector, Y = FAToffset +\ ----------------------------------\ + MOV.B &ClusterL+1,W \ 3 W = ClusterLoHI + MOV.B &ClusterL,Y \ 3 Y = ClusterLoLo + CMP #2,&FATtype \ 3 FAT32? + 0= IF \ yes +\ JZ CTF1S_end \ 2 yes + +\ input : Cluster n, max = 7FFFFF (SDcard up to 256 GB) +\ ClusterLoLo*4 = displacement in 512 bytes sector ==> FAToffset +\ ClusterHiLo&ClusterLoHi +C << 1 = relative FATsector + orgFAT1 ==> FATsector +\ ----------------------------------\ + MOV.B &ClusterH,X \ X = 0:ClusterHiLo + SWPB X \ X = ClusterHiLo:0 + ADD X,W \ W = ClusterHiLo:ClusterLoHi +\ ----------------------------------\ + SWPB Y \ Y = ClusterLoLo:0 + ADD Y,Y \ 1 Y = ClusterLoLo:0 << 1 + carry for FATsector + ADDC W,W \ W = ClusterHiLo:ClusterLoHi << 1 = ClusterHiLo:ClusterL / 128 + SWPB Y +\ CTF1S_end + THEN + ADD Y,Y \ Y = 0:ClusterLoLo << 1 + MOV @RSP+,PC \ 4 + ENDCODE +\ ----------------------------------\ + + +\ use no registers + HDNCODE CLS_SCT +\ ----------------------------------\ Input : Cluster, output: Sector = Cluster_first_sector +\ ComputeClusFrstSect \ If Cluster = 1 ==> RootDirectory ==> SectorL = OrgRootDir +\ ----------------------------------\ Output: SectorL of Cluster + MOV #0,&SectorH \ + MOV &OrgRootDir,&SectorL \ + CMP.B #0,&ClusterH \ clusterH <> 0 ? + 0= IF + CMP #1,&ClusterL \ clusterHL = 1 ? (FAT16 specificity) + 0= IF \ yes, sectorL for FAT16 OrgRootDIR is done + MOV @RSP+,PC + THEN + THEN + + TLV_ORG 4 + @ $81F3 U< + $81EF TLV_ORG 4 + @ U< = \ MSP430FR413x subfamily without hardware_MPY + [IF] \ Cluster24< ClusFrstSect\ SecPerClus = {1,2,4,8,16,32,64} + PUSHM #3,W \ 5 PUSHM W,X,Y + MOV.B &SecPerClus,W \ 3 SecPerClus(5-1) = multiplicator + MOV &ClusterL,X \ 3 Cluster(16-1) --> MULTIPLICANDlo + MOV.B &ClusterH,Y \ 3 Cluster(24-17) --> MULTIPLICANDhi + GOTO FW1 \ + BEGIN \ + ADD X,X \ 1 (RLA) shift one left MULTIPLICANDlo16 + ADDC Y,Y \ 1 (RLC) shift one left MULTIPLICANDhi8 +FW1 RRA W \ 1 shift one right multiplicator + U>= UNTIL \ 2 C = 0 loop back + ADD &OrgClusters,X \ 3 OrgClusters = sector of virtual_cluster_0, word size + ADDC #0,Y \ 1 + MOV X,&SectorL \ 3 low result + MOV Y,&SectorH \ 3 high result + POPM #3,W \ 5 POPM Y,X,W +\ ----------------------------------\ + [ELSE] ; hardware MPY, the general case +\ ----------------------------------\ + MOV &ClusterL,&MPY32L \ 3 + MOV &ClusterH,&MPY32H \ 3 + MOV &SecPerClus,&OP2 \ 5+3 + MOV &RES0,&SectorL \ 5 + MOV &RES1,&SectorH \ 5 + ADD &OrgClusters,&SectorL \ 5 OrgClusters = sector of virtual cluster 0, word size + ADDC #0,&SectorH \ 3 32~ +\ ----------------------------------\ + [THEN] +\ ----------------------------------\32~ + 5~ by 2* shift + MOV @RSP+,PC \ +\ ----------------------------------\ + ENDCODE + + + HDNCODE CUR_SCT +\ ----------------------------------\ +\ ComputeHDLcurrentSector \ input: currentHandle, output: Cluster, Sector +\ ----------------------------------\ + MOV HDLL_CurClust(T),&ClusterL \ + MOV HDLH_CurClust(T),&ClusterH \ + CALL #CLS_SCT \ Cluster --> its first sector + MOV.B HDLB_ClustOfst(T),W \ + ADD W,&SectorL \ + ADDC #0,&SectorH \ + MOV @RSP+,PC \ +\ ----------------------------------\ + ENDCODE + + HDNCODE LOAD_SCT +\ ==================================\ +\ SetBufLenAndLoadCurSector \WXY <== previous handle reLOAD with BufferPtr<>0 +\ ==================================\ + MOV #bytsPerSec,&BufferLen \ preset BufferLen + CMP #0,HDLH_CurSize(T) \ CurSize > 65535 ? + JNZ LoadHDLcurrentSector \ yes +\ CMP HDLL_CurSize(T),&BufferPtr \ BufferPtr >= CurSize ? (BufferPtr = 0 or see RestorePreviousLoadedBuffer) +\ JC CLOSE_HDL \ yes + CMP #bytsPerSec,HDLL_CurSize(T) \ CurSize >= 512 ? + JC LoadHDLcurrentSector \ yes + MOV HDLL_CurSize(T),&BufferLen \ no: adjust BufferLen +\ ==================================\ +\ LoadHDLcurrentSector \ <=== OPEN_WRITE_APPEND +\ ==================================\ + CALL #CUR_SCT \ use no registers + MOV #READ_SECT,PC \ SWX then RET +\ ----------------------------------\ + ENDCODE + + HDNCODE CLOSE_HDL +\ ==================================\ +\ CloseHandleT \ <== CLOSE, Read_File, TERM2SD", OPEN_DEL +\ ==================================\ +MOV &CurrentHdl,T \ +CMP #0,T \ no handle? +0<> IF \ + CMP.B #2,HDLB_Token(T) \ opened as write (updated) file ? + 0= IF + CALL #WriteBuffer \SWXY + CALL #OPWW_UpdateDirectory \SWXY + ELSE + CMP.B #-1,HDLB_Token(T) \ token type = LOAD? + 0= IF +\ ----------------------------------\ +\ RestoreSD_ACCEPTContext \ +\ ----------------------------------\ + MOV HDLW_PrevLEN(T),TOS \ + MOV HDLW_PrevORG(T),0(PSP) \ -- org len +\ ----------------------------------\ +\ RestoreReturnOfSD_ACCEPT \ +\ ----------------------------------\ + ADD #6,RSP \ R-- QUIT3 empties return stack + MOV @RSP+,IP \ skip return to SD_ACCEPT + CMP #0,HDLW_PrevHDL(T) \ + 0= IF \ no more token + PUSH #ECHO + MOV #TIB_ORG,&CIB_ADR \ restore TIB as Current Input Buffer for next line (next QUIT) + MOV #ACCEPT+4,&ACCEPT+2 \ restore default ACCEPT for next line (next QUIT) + ELSE + PUSH #NOECHO + THEN + THEN + THEN + MOV.B #0,HDLB_Token(T) \ release the handle + MOV @T,T \ T = previous handle + MOV T,&CurrentHdl \ becomes current handle + CMP #0,T \ + 0<> IF \ if more handles +\ ----------------------------------\ +\ RestorePreviousLoadedBuffer \ +\ ----------------------------------\ + MOV HDLW_BUFofst(T),&BufferPtr \ restore previous BufferPtr + CALL #LOAD_SCT \ then reload previous buffer + BIC #Z,SR \ + THEN +THEN + MOV @RSP+,PC \ Z = 1 if no more handle +\ ----------------------------------\ + ENDCODE + +\ sequentially load in SD_BUF bytsPerSec bytes of a file opened as read or as load +\ if new bufferLen have a size <= BufferPtr, closes the file then RET. +\ if previous bufferLen had a size < bytsPerSec, closes the file and reloads previous LOADed file if exist. +\ HDLL_CurSize leaves the not yet read size +\ All used registers must be initialized. + + HDNCODE READ_FILE +\ ==================================\ +\ Read_File \ <== SD_ACCEPT, READ +\ ==================================\ + MOV &CurrentHdl,T \ + MOV #0,&BufferPtr \ reset BufferPtr (the buffer is already read) +\ ----------------------------------\ + CMP #bytsPerSec,&BufferLen \ + JNZ CLOSE_HDL \ because this last and incomplete sector is already read + SUB #bytsPerSec,HDLL_CurSize(T) \ HDLL_CurSize is decremented of one sector lenght + SUBC #0,HDLH_CurSize(T) \ + ADD.B #1,HDLB_ClustOfst(T) \ current cluster offset is incremented + CMP.B &SecPerClus,HDLB_ClustOfst(T) \ Cluster Bound reached ? + JNC LOAD_SCT \ no +\ ----------------------------------\ +\SearchNextCluster \ yes +\ ----------------------------------\ + MOV.B #0,HDLB_ClustOfst(T) \ reset Current_Cluster sectors offset + CALL #CLS_FAT\WXY Output: W=FATsector, Y=FAToffset, Cluster=HDL_CurCluster + ADD &OrgFAT1,W \ + MOV #0,X + CALL #ReadSectorWX \SWX (< 65536) + MOV #0,HDLH_CurClust(T) \ + MOV SD_BUF(Y),HDLL_CurClust(T) \ + CMP #1,&FATtype \ FAT16? + JZ LOAD_SCT \ + MOV SD_BUF+2(Y),HDLH_CurClust(T) \ + MOV LOAD_SCT,PC + ENDCODE + + + +\ if first open_load token, save DefaultInputStream +\ if other open_load token, decrement token, save previous context + +\ OPEN subroutine +\ Input : EntryOfst, Cluster = EntryOfst(HDLL_FirstClus()) +\ init handle(HDLL_DIRsect,HDLW_DIRofst,HDLL_FirstClus,HDLL_CurClust,HDLL_CurSize) +\ Output: Cluster = first Cluster of file, X = CurrentHdl + + HDNCODE NEW_HDL +\ ----------------------------------\ input : Cluster, EntryOfst +\ GetFreeHandle \STWXY init handle(HDLL_DIRsect,HDLW_DIRofst,HDLL_FirstClus = HDLL_CurClust,HDLL_CurSize) +\ ----------------------------------\ output : T = new CurrentHdl +MOV #8,S \ prepare file already open error +MOV #FirstHandle,T \ +MOV #0,X \ X = init previous handle as 0 +\ ----------------------------------\ +\ SearchHandleLoop \ +\ ----------------------------------\ +BEGIN + CMP.B #0,HDLB_Token(T) \ free handle ? +0<> WHILE \ no +\ AlreadyOpenTest \ + CMP &ClusterH,HDLH_FirstClus(T) \ + 0= IF + CMP &ClusterL,HDLL_FirstClus(T) \ + 0= IF + MOV @RSP+,PC \ error 8: file already Open abort ===> + THEN + THEN +\ SearchNextHandle \ + MOV T,X \ handle is occupied, keep it in X as previous handle + ADD #HandleLenght,T \ + CMP #HandleEnd,T \ + 0= IF + ADD S,S \ 16 = no more handle error + MOV @RSP+,PC \ abort ===> + THEN +REPEAT +\ ----------------------------------\ +\FreeHandleFound \ T = new handle, X = previous handle +\ ----------------------------------\ +MOV #0,S \ prepare Happy End (no error) +MOV T,&CurrentHdl \ +MOV X,HDLW_PrevHDL(T) \ link to previous handle +\ ----------------------------------\ +\ CheckCaseOfPreviousToken \ +\ ----------------------------------\ +CMP #0,X \ existing previous handle? +0<> IF \ yes + ADD &TOIN,HDLW_BUFofst(X) \ in previous handle, add interpret offset to Buffer offset +\ ----------------------------------\ +\ CheckCaseOfLoadFileToken \ +\ ----------------------------------\ + CMP.B #0,W \ open_type is LOAD (-1) ? + S< IF \ yes + CMP.B #0,HDLB_Token(X) \ previous token is negative? (open_load type) + S< IF \ yes + ADD.B HDLB_Token(X),W \ LOAD token = previous LOAD token -1 + THEN + THEN +THEN +\ ----------------------------------\ +\ InitHandle \ +\ ----------------------------------\ +MOV.B W,HDLB_Token(T) \ marks handle as open type: <0=LOAD, 1=READ, 2=WRITE, 4=DEL +MOV.B #0,HDLB_ClustOfst(T) \ clear ClustOfst +MOV &SectorL,HDLL_DIRsect(T) \ init handle DIRsectorL +MOV &SectorH,HDLH_DIRsect(T) \ +MOV &EntryOfst,Y \ +MOV Y,HDLW_DIRofst(T) \ init handle SD_BUF offset of DIR entry +MOV SD_BUF+26(Y),HDLL_FirstClus(T) \ init handle firstcluster of file (to identify file) +MOV SD_BUF+20(Y),HDLH_FirstClus(T) +MOV SD_BUF+26(Y),HDLL_CurClust(T) \ init handle CurrentCluster +MOV SD_BUF+20(Y),HDLH_CurClust(T) +MOV SD_BUF+28(Y),HDLL_CurSize(T) \ init handle LOW currentSizeL +MOV SD_BUF+30(Y),HDLH_CurSize(T) \ +MOV #0,&BufferPtr \ reset BufferPtr all type of files +CMP.B #2,W \ is a WRITE file handle? +0= IF + MOV CUR_SCT,PC \ = 2, is a WRITE file +THEN +S>= IF \ > 2, is a file to be deleted + MOV @RSP+,PC \ RET +THEN +MOV #0,HDLW_BUFofst(T) \ < 2, is a READ or a LOAD file +CMP.B #-1,W \ +0= IF \ case of first loaded file: ReplaceInputBuffer + MOV #SDIB_ORG,&CIB_ADR \ set SD Input Buffer as Current Input Buffer before return to QUIT + MOV #SD_ACCEPT,&ACCEPT+2 \ redirect ACCEPT to SD_ACCEPT before return to QUIT +THEN +S>= IF +MOV LOAD_SCT,PC \ case of READ file +THEN +\ ----------------------------------\ +\ SaveBufferContext \ (see CLOSE_HDL) +\ ----------------------------------\ +MOV &SOURCE_LEN,HDLW_PrevLEN(T) \ = CPL +SUB &TOIN,HDLW_PrevLEN(T) \ PREVLEN = CPL - >IN +MOV &SOURCE_ORG,HDLW_PrevORG(T) \ = CIB +ADD &TOIN,HDLW_PrevORG(T) \ PrevORG = CIB + >IN +\ ----------------------------------\ +MOV LOAD_SCT,PC \ then RET + ENDCODE + + HDNCODE NAME_BL +\ ----------------------------------\ input : X = countdown_of_spaces, Y = name pointer in buffer +\ ParseEntryNameSpaces \XY +\ ----------------------------------\ output: Z flag, Y is set after the last space char +CMP #0,X \ +0<> IF + BEGIN + CMP.B #32,SD_BUF(Y) \ SPACE ? + 0<> WHILE + ADD #1,Y \ inc pointer + SUB #1,X \ dec countdown_of_spaces + 0= UNTIL + THEN +THEN +MOV @RSP+,PC \ +\ ----------------------------------\ + ENDCODE + + +CODE OPEN_ERROR +BW1 +\ S = Error 1 : PathNameNotFound \ +\ S = Error 2 : NoSuchFile \ +\ S = Error 4 : DIRisFull \ +\ S = Error 8 : alreadyOpen \ +\ S = Error 16 : NomoreHandle \ +\ ----------------------------------\ +COLON \ set ECHO, type Pathname, type #error, type "< OpenError"\ no return +S" < OpenError" \ +ABORT_SD \ to insert S error as flag, no return +; + + +\ ====================================================================== +\ OPEN FILE primitive +\ ====================================================================== +\ Open_File -- +\ primitive for LOAD" READ" CREATE" WRITE" DEL" +\ store OpenType on TOS, +\ compile state : compile OpenType, compile SQUOTE and the string of provided pathname +\ exec state : open a file from SD card via its pathname +\ convert counted string found at HERE in a String then parse it +\ media identifiers "A:", "B:" ... are ignored (only one SD_Card), +\ char "\" as first one initializes rootDir as SearchDir. +\ if file found, if not already open and if free handle... +\ ...open the file as read and return the handle in CurrentHdl. +\ if the pathname is a directory, change current directory, no handle is set. +\ if an error is encountered, no handle is set, an error message is displayed. + + HDNCODE OPEN_FILE +\ ----------------------------------\ +\ Open_File \ -- open_type HERE HERE as pathname ptr +\ ----------------------------------\ +MOV @PSP+,rDOCON \ rDOCON = addr = pathname PTR +ADD rDOCON,TOS \ TOS = EOS (End Of String) = pathname end +MOV TOS,&EndOfPath \ for WRITE CREATE part +\ ----------------------------------\ +\ OPN_PathName \ +\ ----------------------------------\ +MOV #1,S \ error 1 +MOV &DIRClusterL,&ClusterL \ +MOV &DIRclusterH,&ClusterH \ +CMP rDOCON,TOS \ PTR = end of pathname ? +\ JZ OPN_NoPathName ; +0= ?GOTO BW1 \ yes: error 1 ===> + CMP.B #':',1(rDOCON) \ A: B: C: ... in pathname ? + 0= IF + ADD #2,rDOCON \ yes : skip drive because not used, only one SD_card + THEN + CMP.B #'\',0(rDOCON) \ "\" as first char ? + 0<> ?GOTO FW1 +\ JNZ OPN_SearchDirSector \ no + ADD #1,rDOCON \ yes : skip '\' char + MOV &FATtype,&ClusterL \ FATtype = 1 as FAT16 RootDIR, FATtype = 2 = FAT32RootDIR + MOV #0,&ClusterH \ +\ OPN_EndOfStringTest \ <=== dir found in path +BW2 CMP rDOCON,TOS \ PTR = EOS ? (end of pathname ?) + 0= ?GOTO FW3 +\ JZ OPN_SetCurrentDIR \ yes +\ OPN_SearchDirSector \ +FW1 MOV rDOCON,&Pathname \ save Pathname ptr + CALL #CLS_SCT \ output: SectorHL + MOV #32,rDODOES \ preset countdown for FAT16 RootDIR sectors + CMP #2,&FATtype \ FAT32? + JZ OPN_SetDirSectors \ yes + 0<> IF + CMP &ClusterL,&FATtype \ FAT16 AND RootDIR ? +\ JZ OPN_LoadDIRsector \ yes + 0= ?GOTO FW1 +\ OPN_SetDirSectors \ + THEN + MOV &SecPerClus,rDODOES \ +\ OPN_LoadDIRsector \ <=== Dir Sector loopback +BW2 +FW1 CALL #READ_SECT \SWX + MOV #2,S \ prepare no such file error + MOV #0,W \ init entries count +\ OPN_SearchDIRentry \ <=== DIR Entry loopback +BW3 MOV W,Y \ 1 + RLAM #4,Y \ --> * 16 + ADD Y,Y \ 1 --> * 2 + MOV Y,&EntryOfst \ EntryOfst points to first free entry + CMP.B #0,SD_BUF(Y) \ free entry ? (end of entries in DIR) +\ JZ OPN_NoSuchFile + 0= ?GOTO BW1 \ error 2 NoSuchFile, used by create ===> + MOV #8,X \ count of chars in entry name +\ OPN_CompareName8chars + BEGIN \ + CMP.B @rDOCON+,SD_BUF(Y) \ compare Pathname(char) with DirEntry(char) + 0= WHILE +\ JNZ OPN_FirstCharMismatch \ + ADD #1,Y \ + SUB #1,X \ +\ JNZ OPN_CompareName8chars \ loopback if chars 1 to 7 of string and DirEntry are equal + 0= UNTIL + ADD #1,rDOCON \ 9th char of Pathname is always a dot + THEN +\ OPN_FirstCharMismatch \ + CMP.B #'.',-1(rDOCON) \ FirstNotEqualChar of Pathname = dot ? + 0<> IF \ OPN_DotNotFound + ADD #3,X \ for next cases not equal chars of entry until 11 must be spaces + CALL #NAME_BL \ for X + 3 chars + JNZ OPN_DIRentryMismatch \ if a char entry <> space + CMP.B #'\',-1(rDOCON) \ FirstNotEqualChar of Pathname = "\" ? +\ JZ OPN_EntryFound \ + 0= ?GOTO FW1 + CMP rDOCON,TOS \ EOS exceeded ? +\ JNC OPN_EntryFound \ yes + U< ?GOTO FW2 +\ OPN_DIRentryMismatch \ + MOV &pathname,rDOCON \ reload Pathname + ADD #1,W \ inc entry + CMP #16,W \ 16 entry in a sector + JNZ OPN_SearchDIRentry \ ===> loopback for search next DIR entry + 0<> ?GOTO BW3 + ADD #1,&SectorL \ + ADDC #0,&SectorH \ + SUB #1,rDODOES \ dec count of Dir sectors + JNZ OPN_LoadDIRsector \ ===> loopback for search next DIR sector + MOV #4,S \ + GOTO BW1 \ error 4 ===> + THEN +\ OPN_DotFound \ not equal chars of entry name until 8 must be spaces + CMP.B #'.',-2(rDOCON) \ LastCharEqual = dot ? + JZ OPN_DIRentryMismatch \ case of first DIR entry = "." and Pathname = "..\" + CALL #NAME_BL \ parse X spaces, X{0,...,7} + JNZ OPN_DIRentryMismatch \ if a char entry <> space + MOV #3,X \ +\ OPN_CompareExt3chars \ + CMP.B @rDOCON+,SD_BUF(Y) \ compare string(char) with DirEntry(char) + JNZ OPN_ExtNotEqualChar \ + ADD #1,Y \ + SUB #1,X \ + JNZ OPN_CompareExt3chars \ nothing to do if chars equal + JMP OPN_EntryFound \ +\ OPN_ExtNotEqualChar \ + CMP rDOCON,TOS \ EOS exceeded ? + JC OPN_DIRentryMismatch \ no, loop back + CMP.B #'\',-1(rDOCON) \ FirstNotEqualChar = "\" ? + JNZ OPN_DIRentryMismatch \ + CALL #NAME_BL \ parse X spaces, X{0,...,3} + JNZ OPN_DIRentryMismatch \ if a char entry <> space, loop back +\ OPN_EntryFound \ Y points on the file attribute (11th byte of entry) +FW1 +FW2 MOV &EntryOfst,Y \ reload DIRentry + MOV SD_BUF+26(Y),&ClusterL \ first clusterL of file + MOV SD_BUF+20(Y),&ClusterH \ first clusterT of file, always 0 if FAT16 +\ OPN_EntryFoundNext + BIT.B #10h,SD_BUF+11(Y) \ test if Directory or File + JZ OPN_FileFound \ +\ OPN_DIRfound \ entry is a DIRECTORY + CMP #0,&ClusterH \ case of ".." entry, when parent directory is root + JNZ OPN_DIRfoundNext \ + CMP #0,&ClusterL \ case of ".." entry, when parent directory is root + JNZ OPN_DIRfoundNext \ + MOV &FATtype,&ClusterL \ set cluster as RootDIR cluster +\ OPN_DIRfoundNext \ + CMP rDOCON,TOS \ EOS exceeded ? + JC OPN_EndOfStringTest \ no: (we presume that FirstNotEqualChar = "\") ==> loop back +\ OPN_SetCurrentDIR \ -- open_type ptr +FW3 MOV &ClusterL,&DIRClusterL \ + MOV &ClusterH,&DIRclusterH \ + MOV #0,0(PSP) \ -- open_type ptr open_type = 0 + JMP OPN_Dir +\ OPN_FileFound \ -- open_type ptr + MOV @PSP,W \ + CALL #NEW_HDL \STWXY init handle(HDLL_DIRsect,HDLW_DIRofst,HDLL_FirstClus = HDLL_CurClust,HDLL_CurSize) +\ --------------------------------\ output : T = CurrentHdl*, S = ReturnError, Y = DIRentry offset + \ OPN_NomoreHandle \ S = error 16 + \ OPN_alreadyOpen \ S = error 8 + \ OPN_EndOfDIR \ S = error 4 + \ OPN_NoSuchFile \ S = error 2 + \ OPN_NoPathName, S = error 1 +OPN_Dir + MOV #xdodoes,rDODOES \ restore rDODOES + MOV #xdocon,rDOCON \ restore rDODOES + MOV @PSP+,W \ -- ptr W = open_type + MOV @PSP+,TOS \ -- +\ ----------------------------------\ then go to selected OpenType subroutine (OpenType = W register) +\OPEN_QDIR \ +\ ----------------------------------\ + CMP #0,W \ + JZ OPEN_LOAD_END \ nothing to do +\ ----------------------------------\ +\OPEN_QLOAD \ +\ ----------------------------------\ + .IFDEF SD_CARD_READ_WRITE \ + CMP.B #-1,W \ open_type = LOAD" + JNZ OPEN_QREAD \ next step + .ENDIF \ +\ ----------------------------------\ here W is free +\OPEN_LOAD \ +\ ----------------------------------\ +MOV @IP+,PC \ + ENDCODE + +\----------------------------------------------------------------------- +\ SD_CARD_LOADER FORTH word +\----------------------------------------------------------------------- + +\Z LOAD" pathame" -- immediate +\ compile state : compile LOAD" pathname" +\ exec state : open a file from SD card via its pathname +\ see Open_File primitive for pathname conventions +\ the opened file becomes the new input stream for INTERPRET +\ this command is recursive, limited only by the count of free handles (up to 8) +\ LOAD" acts also as dos command "CD" : +\ - LOAD" \misc\" set a:\misc as current directory +\ - LOAD" \" reset current directory to root +\ - LOAD" ..\" change to parent directory + +\ ====================================================================== +\ LOAD" primitive as part of Open_File +\ input from open: S = OpenError, W = open_type, SectorHL = DIRsectorHL, +\ Buffer = [DIRsector], ClusterHL = FirstClusterHL +\ from open(GetFreeHandle): Y = DIRentry, T = CurrentHdl +\ output: nothing else abort on error +\ ====================================================================== + + [UNDEFINED] S_ + [IF] + CODE S_ \ Squote alias with blank instead quote separator + MOV #0,&CAPS \ turn CAPS OFF + COLON + XSQUOTE , \ compile run-time code + $20 WORD \ -- c-addr (= HERE) + HI2LO + MOV.B @TOS,TOS \ -- len compile string + ADD #1,TOS \ -- len+1 + BIT #1,TOS \ C = ~Z + ADDC TOS,&DP \ store aligned DP + MOV @PSP+,TOS \ -- + MOV @RSP+,IP \ pop paired with push COLON + MOV #$20,&CAPS \ turn CAPS ON (default state) + MOV @IP+,PC \ NEXT + ENDCODE IMMEDIATE + [THEN] + +\ ----------------------------------\ + CODE LOAD \ immediate +\ ----------------------------------\ + MOV.B #-1,W \ W = OpenType +\ ----------------------------------\ +BW1 SUB #4,PSP \ + MOV TOS,2(PSP) \ + MOV W,0(PSP) \ -- Open_type (0=LOAD", 1=READ", 2=WRITE", 4=DEL") + MOV &STATE,TOS \ + COLON \ if exec state + IF + 20 WORD COUNT \ -- open_type addr u + ELSE \ compile OPEN_FILE + LITERAL + S_ [ 20 WORD DROP ] + THEN + OPEN_FILE + ; IMMEDIATE + +\ .IFDEF SD_CARD_READ_WRITE + +\----------------------------------------------------------------------- +\ SD_READ_WRITE FORTH words +\----------------------------------------------------------------------- + +\Z READ -- +\ parse string until " is encountered, convert counted string in String +\ then parse string until char '0'. +\ media identifiers "A:", "B:" ... are ignored (only one SD_Card), +\ char "\" as first one initializes rootDir as SearchDir. +\ if file found, if not already open and if free handle... +\ ...open the file as read and return the handle in CurrentHdl. +\ then load first sector in buffer, bufferLen and bufferPtr are ready for read +\ currentHdl keep handle that is flagged as "read". + +\ to read sequentially next sectors use READ word. A flag is returned : true if file is closed. +\ the last sector so is in buffer. + +\ if pathname is a directory, change current directory. +\ if an error is encountered, no handle is set, error message is displayed. + +\ READ" acts also as CD dos command : +\ - READ" a:\misc\" set a:\misc as current directory +\ - READ" a:\" reset current directory to root +\ - READ" ..\" change to parent directory + +\ to close all files type : WARM (or COLD, RESET) + +\ ----------------------------------\ + CODE READ \ " + MOV.B #1,W \ W = OpenType + GOTO BW1 \ + ENDCODE IMMEDIATE + +\Z WRITE" pathame" -- immediate +\ open or create the file designed by pathname. +\ an error occurs if the file is already opened. +\ the last sector of the file is loaded in buffer, and bufferPtr leave the address of the first free byte. +\ compile state : compile WRITE" pathname" +\ exec state : open or create entry selected by pathname +\ ----------------------------------\ + CODE WRITE \ " + MOV.B #2,W \ W = OpenType + GOTO BW1 \ + ENDCODE IMMEDIATE + + +\Z DEL" pathame" -- immediate +\ compile state : compile DEL" pathname" +\ exec state : DELETE entry selected by pathname + +\ ----------------------------------\ + CODE DEL \ " +\ ----------------------------------\ + MOV.B #4,W \ W = OpenType + GOTO BW1 \ + ENDCODE IMMEDIATE + + +\Z CLOSE -- +\ close current handle +\ ----------------------------------\ + CODE CLOSE \ +\ ----------------------------------\ + CALL #CLOSE_HDL \ + MOV @IP+,PC \ + ENDCODE + +\ .ENDIF \ SD_CARD_READ_WRITE + + + + +\ .IFDEF BOOTLOADER +\ https://forth-standard.org/standard/core/Equal +\ = x1 x2 -- flag test x1=x2 + [UNDEFINED] = + [IF] + CODE = + SUB @PSP+,TOS \ 2 + 0<> IF \ 2 + AND #0,TOS \ 1 + MOV @IP+,PC \ 4 + THEN + XOR #-1,TOS \ 1 flag Z = 1 + MOV @IP+,PC \ 4 + ENDCODE + [THEN] + +\ https://forth-standard.org/standard/core/DUP +\ DUP x -- x x duplicate top of stack + [UNDEFINED] DUP + [IF] + CODE DUP + BW1 SUB #2,PSP \ 2 push old TOS.. + MOV TOS,0(PSP) \ 3 ..onto stack + MOV @IP+,PC \ 4 + ENDCODE + +\ https://forth-standard.org/standard/core/qDUP +\ ?DUP x -- 0 | x x DUP if nonzero + CODE ?DUP + CMP #0,TOS \ 2 test for TOS nonzero + 0<> ?GOTO BW1 \ 2 + MOV @IP+,PC \ 4 + ENDCODE +[THEN] + +\ https://forth-standard.org/standard/core/EVALUATE +\ EVALUATE \ i*x c-addr u -- j*x interpret string + [UNDEFINED] EVALUATE + [IF] + CODE EVALUATE + MOV #SOURCE_LEN,X \ 2 + MOV @X+,S \ 2 S = SOURCE_LEN + MOV @X+,T \ 2 T = SOURCE_ORG + MOV @X+,W \ 2 W = TOIN + PUSHM #4,IP \ 6 PUSHM IP,S,T,W + LO2HI + INTERPRET + HI2LO + MOV @RSP+,&TOIN \ 4 + MOV @RSP+,&SOURCE_ORG \ 4 + MOV @RSP+,&SOURCE_LEN \ 4 + MOV @RSP+,IP + MOV @IP+,PC + ENDCODE + [THEN] + +\ BOOT RSTIV_MEM -- \ bootstrap on SD_CARD\BOOT.4th file +\ \ called by WARM +\ to enable bootstrap type: ' BOOT IS WARM +\ to disable bootstrap type: ' BOOT [PFA] IS WARM + CODE BOOT + MOV #INIT_SD,X \ X = INIT_SD + BIC #LOCKLPM5,&PM5CTL0 \ activate all previous I/O settings, mandatory for QSD_MEM. + CMP #2,TOS \ RSTIV_MEM <> WARM ? + U< IF \ yes + MOV @RSP+,PC \ if RSTIV_MEM U< 2, return to BODYWARM + THEN + BIT.B #CD_SD,&SD_CDIN \ SD_memory in SD_Card socket ? + 0<> IF \ + MOV 2(X),PC \ if no, goto previous INIT: INIT TERMINAL only then ret to PFAWARM + THEN +\--------------------------------------------------------------------------------- +\ RESET 6: if RSTIV_MEM <> WARM, init TERM, init SD +\--------------------------------------------------------------------------------- + CALL X \ init TERM UC first then init SD card, TOS = RSTIV_MEM +\--------------------------------------------------------------------------------- +\ END OF RESET +\--------------------------------------------------------------------------------- + MOV #PSTACK-2,PSP \ to avoid error "Stack empty!" + MOV #0,&STATE \ ) + MOV #LSTACK,&LEAVEPTR \ > same as QUIT + MOV #RSTACK,RSP \ ) + LO2HI \ + S_ LOAD" BOOT.4TH" \ LOAD BOOT.4TH issues error 2 if no such file... + EVALUATE \ to interpret this string + ; diff --git a/MSP430-FORTH/test/UDSLHMOD.f b/MSP430-FORTH/test/UDSLHMOD.f index dc1be32..096eaf9 100644 --- a/MSP430-FORTH/test/UDSLHMOD.f +++ b/MSP430-FORTH/test/UDSLHMOD.f @@ -41,7 +41,7 @@ \ ASSEMBLER conditionnal usage with ?JMP ?GOTO S< S>= U< U>= 0= 0<> 0< -PWR_STATE +RST_RET CODE DSM/REM \ D1 / D2 --> DREM DQUOT MOV TOS,Y \ 1 Y=DVRhi diff --git a/MSP430-FORTH/test/UDSLHMOD_2022-09-26-15-38-34.f b/MSP430-FORTH/test/UDSLHMOD_2022-09-26-15-38-34.f new file mode 100644 index 0000000..dc1be32 --- /dev/null +++ b/MSP430-FORTH/test/UDSLHMOD_2022-09-26-15-38-34.f @@ -0,0 +1,174 @@ +\ -*- coding: utf-8 -*- +\ http://patorjk.com/software/taag/#p=display&f=Banner&t=Fast Forth + +\ TARGET SELECTION +\ MSP_EXP430FR5739 MSP_EXP430FR5969 MSP_EXP430FR5994 MSP_EXP430FR6989 +\ MSP_EXP430FR4133 MSP_EXP430FR2433 MSP_EXP430FR2355 CHIPSTICK_FR2433 +\ MY_MSP430FR5738_1 MY_MSP430FR5738 MY_MSP430FR5948 MY_MSP430FR5948_1 +\ JMJ_BOX + +\ Fast Forth For Texas Instrument MSP430FRxxxx FRAM devices +\ Copyright (C) <2015> +\ +\ This program is free software: you can redistribute it and/or modify +\ it under the terms of the GNU General Public License as published by +\ the Free Software Foundation, either version 3 of the License, or +\ (at your option) any later version. +\ +\ This program is distributed in the hope that it will be useful, +\ but WITHOUT ANY WARRANTY; without even the implied warranty of +\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +\ GNU General Public License for more details. +\ +\ You should have received a copy of the GNU General Public License +\ along with this program. If not, see . + +\ REGISTERS USAGE +\ rDODOES to rEXIT must be saved before use and restored after +\ scratch registers Y to S are free for use +\ under interrupt, IP is free for use + +\ PUSHM order : PSP,TOS, IP, S, T, W, X, Y, rEXIT, rDOVAR, rDOCON, rDODOES +\ example : PUSHM IP,Y +\ +\ POPM order : rDODOES, rDOCON, rDOVAR, rEXIT, Y, X, W, T, S, IP,TOS,PSP +\ example : POPM Y,IP + +\ FORTH conditionnals: unary{ 0= 0< 0> }, binary{ = < > U< } + +\ ASSEMBLER conditionnal usage with IF UNTIL WHILE S< S>= U< U>= 0= 0<> 0>= + +\ ASSEMBLER conditionnal usage with ?JMP ?GOTO S< S>= U< U>= 0= 0<> 0< + + +PWR_STATE + +CODE DSM/REM \ D1 / D2 --> DREM DQUOT + MOV TOS,Y \ 1 Y=DVRhi + MOV @PSP+,W \ 2 W=DVRlo + MOV @PSP+,X \ 2 X=DVDhi + MOV @PSP,T \ 2 T=DVDlo + PUSHM #5,X \ 7 PUSHM DVDhi,DVRhi, M, P, Q + AND #-1,Y \ 1 Y=DVRhi < 0 ? +S< IF XOR #-1,W \ 1 W=INV(DVRlo) + XOR #-1,Y \ 1 Y=INV(DVRhi) + ADD #1,W \ 1 W=INV(DVRlo)+1 + ADDC #0,Y \ 1 Y=INV(DVRhi)+C +THEN + AND #-1,X \ 1 X=DVDhi < 0 ? +S< IF XOR #-1,T \ 1 T=INV(DVDlo) + XOR #-1,X \ 1 X=INV(DVDhi) + ADD #1,T \ 1 T=INV(DVDlo)+1 + ADDC #0,X \ 1 X=INV(DVDhi)+C +THEN +\ ------------------------------------------------------------------------ +\ don't uncomment lines below, don't rub out, please ! +\ ------------------------------------------------------------------------ +\ UD/MOD DVDlo DVDhi DVRlo DVRhi -- REMlo REMhi QUOTlo QUOThi +\ ------------------------------------------------------------------------ +\ MOV TOS,Y \ 1 Y=DVRhi +\ MOV @PSP+,W \ 2 W=DVRlo +\ MOV @PSP+,X \ 2 X=DVDhi +\ MOV @PSP,T \ 2 T=DVDlo +\ PUSHM #5,X \ 7 PUSHM DVDhi,DVRhi, M, P, Q + MOV #0,M \ 1 M=REMlo = 0 + MOV #0,P \ 1 P=REMhi = 0 + MOV #32,Q \ 2 Q=count +BW1 CMP Y,P \ 1 REMhi = DVRhi ? + 0= IF CMP W,M \ 1 REMlo U< DVRlo ? + THEN + U>= IF SUB W,M \ 1 no: REMlo - DVRlo (carry is set) + SUBC Y,P \ 1 REMhi - DVRhi + THEN + BEGIN ADDC S,S \ 1 RLC quotLO + ADDC TOS,TOS \ 1 RLC quotHI + SUB #1,Q \ 1 Decrement loop counter + U>= WHILE \ 2 out of loop if count<0 + ADD T,T \ 1 RLA DVDlo + ADDC X,X \ 1 RLC DVDhi + ADDC M,M \ 1 RLC REMlo + ADDC P,P \ 1 RLC REMhi + U< ?GOTO BW1 \ 2 19~ loop + SUB W,M \ 1 REMlo - DVRlo + SUBC Y,P \ 1 REMhi - DVRhi + BIS #1,SR \ 1 + REPEAT \ 2 16~ loop + MOV M,T \ 1 T=REMlo + MOV P,W \ 1 W=REMhi + POPM #5,X \ 7 X=DVDhi, Y=DVRhi, restore M, P, Q, as system regs + CMP #0,X \ 1 sign of Rem ? + S< IF XOR #-1,T \ 1 INV(REMlo) + XOR #-1,W \ 1 INV(REMhi) + ADD #1,T \ 1 INV(REMlo)+1 + ADDC #0,W \ 1 INV(REMhi)+C + THEN + SUB #4,PSP \ + MOV T,4(PSP) \ REMlo + MOV W,2(PSP) \ REMhi + XOR X,Y + CMP #0,Y \ sign of Quot ? +S< IF XOR #-1,S \ 1 INV(QUOTlo) + XOR #-1,TOS \ 1 INV(QUOThi) + ADD #1,S \ 1 INV(QUOTlo)+1 + ADDC #0,TOS \ 1 INV(QUOThi)+C +THEN + MOV S,0(PSP) \ 3 QUOTlo + MOV @IP+,PC \ 4 +ENDCODE + +PWR_HERE + +[UNDEFINED] DROP [IF] +\ https://forth-standard.org/standard/core/DROP +\ DROP x -- drop top of stack +CODE DROP +MOV @PSP+,TOS \ 2 +MOV @IP+,PC \ 4 +ENDCODE +[THEN] + +: UD. \ u -- display ud (unsigned) +<# #S #> TYPE $20 EMIT +; + +\ https://forth-standard.org/standard/double/Dd +\ D. dlo dhi -- display d (signed) +CODE D. +MOV #U.,W \ U. + 10 = D. +ADD #10,W +MOV W,PC +ENDCODE + + + +; dvd div ; Quot Rem + .0 .0 UD/MOD D. D. ; inf 0 --> + .0 .1 UD/MOD D. D. ; 0 0 --> + .1 .0 UD/MOD D. D. ; inf dvd --> + .1 .1 UD/MOD D. D. ; 1 0 --> + .1 .2 UD/MOD D. D. ; 0 1 --> + .0 .2 UD/MOD D. D. ; 0 0 --> + .2 .0 UD/MOD D. D. ; inf dvd --> + .2 .1 UD/MOD D. D. ; 2 0 --> + .2 .2 UD/MOD D. D. ; 1 0 --> + .2 .3 UD/MOD D. D. ; 0 2 --> + .0 .3 UD/MOD D. D. ; 0 0 --> + .3 .0 UD/MOD D. D. ; inf dvd --> + .3 .1 UD/MOD D. D. ; 3 0 --> + .3 .2 UD/MOD D. D. ; 1 1 --> + .3 .3 UD/MOD D. D. ; 1 0 --> + .3 .4 UD/MOD D. D. ; 0 3 --> + .4 .1 UD/MOD D. D. ; 4 0 --> + +; dvd div ; Quot Rem + .0 -.1 UD/MOD D. D. ; 0 0 --> + -.1 .0 UD/MOD D. D. ; inf dvd --> + -.1 .1 UD/MOD D. D. ; dvd 0 --> + -.1 -.1 UD/MOD D. D. ; 1 0 --> + -.1 -.2 UD/MOD D. D. ; 1 1 --> + -.1 -.3 UD/MOD D. D. ; 1 2 --> + -.2 .0 UD/MOD D. D. ; inf dvd --> + -.2 -.1 UD/MOD D. D. ; 0 dvd --> + -.2 -.2 UD/MOD D. D. ; 1 0 --> + -.2 -.3 UD/MOD D. D. ; 1 1 --> + -.2 -.4 UD/MOD D. D. ; 1 2 --> diff --git a/README.md b/README.md index 97d22b2..28c4556 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ If you want to quickly get an idea of what Fast Forth can do, see the /MSP430-FO You will see that the FORTH language is used here as packaging of the program written in assembler. See /MSP430-FORTH/FF_SPECS.f for another point of view. -For only 3 kbytes in addition, we have the primitives to access the SD_CARD FAT32: read, write, del, download source files and also to copy them from PC to the SD_Card. +For only 3 kb in addition, we have the primitives to access the SD_CARD FAT32: read, write, del, download source files and also to copy them from PC to the SD_Card. It works with all SD\_CARD memories from 4GB to 64GB with FAT32 format. With all the kernel addons, including the 20 bits MSP430\_X assembler and the SD\_Card driver, FastForth size is **10 kB**. @@ -100,6 +100,19 @@ Note: please, for each update download all subdirectories to correctly update th TX ---> RX ) Pin Px.y RTS ---> CTS (optionnal) RTS pin Px.y is described in your \inc\launchpad.asm) + TERATERM config terminal: NewLine receive : LF, + NewLine transmit : CR+LF + Size : 80 chars x 42 lines (adjust lines according to your display) + type terminal : VT520 + + TERATERM config serial port: COM = these of your USBtoUART device + speed = TERMINALBAUDRATE value, + 8 bits, no parity, 1 Stop bit, + XON/XOFF flow control, + delay = 0ms/line, 0ms/char + + **don't forget to save always new TERATERM configuration !** + ## Out of the box Once FastForth is loaded in the target FRAM memory, you add assembly code or FORTH code, or both, @@ -129,7 +142,24 @@ Finally, using the SCITE editor as IDE, all is ready to do everything from its " What is new ? ------------- -### V4.0, the last. +### V4.1, the last. + +* = V4.0 - 10 bytes. + +* the pack of \inc\files.pat, used by GEMA.EXE to convert a generic FORTH file.f to a customised FORTH file.4TH, is simplified: + * MSP430FRxxxx.pat for FRAM(INFO TLV MAIN) declarations, + * MSP430FR5xxx.pat, MSP430FR57xx.pat and MSP430FR2xxx.pat for RAM declarations, + * \.pat and \.pat for target and device configurations. + +* rewritten bat files. + +* WARM now displays a number which includes the error codes SYSUNIV (7) and SYSSNIV (15), in addition to SYSRSTIV ones (31) + +* fixed `>NUMBER` + +* SD_TEST.4TH used as SD_CARD bootstrap on reset (or not) works fine, just for my 68th birthday! + +### V4.0, the penultimate last. * = V3.9 - 26 bytes. @@ -235,11 +265,11 @@ What is new ? * More complicated: - In the FastForth init process, COLD WARM BACKGRND are modified and INIT_FORTH is added. - They start each with a call to a paired assembly subroutine: + In the FastForth init process, COLD WARM ABORT" BACKGRND are modified and INIT_FORTH is added. + They include each a call to a paired assembly subroutine: - RST_SYS failures ------------>+ +<- ABORT_TERM <--- ABORT" <--- (error) <---+<-- COMPILE/EXECUTE<-INTERPRET <--+ - | | | ^ + RST_SYS failures ------------>+ +<--------------- ABORT" <---+<-- COMPILE/EXECUTE<-INTERPRET <--+ + | | ===== | ^ RST ----------->+ | v v | v | +-> INIT_FORTH ----------->+-> ABORT->QUIT->+->ACCEPT->+ +->ACCEPT->+ SW1+RST ------->+ | ========== ^ | ^ @@ -253,18 +283,18 @@ What is new ? ^ ==== [0] SYS ------->+ - CALL... &STOP_APP &SOFT_APP &HARD_APP &BACKGRND_APP - ========= ========= ========= ============= + CALL... &STOP_APP &SOFT_APP &HARD_APP &ABORT_APP &BACKGRND_APP + ========= ========= ========= ========== ============= - Default subroutine INIT_STOP INIT_SOFT INIT_TERM INIT_BACKGRND - Default action UART: wait idle do nothing init TERM UC.. UART: send RXON - I2C: do nothing ..unlock I/O I2C: send Ctrl_Char $00 + Default subroutine INIT_STOP INIT_SOFT INIT_TERM ABORT_TERM INIT_BACKGRND + Default action UART: wait idle do nothing init TERM UC.. discard.. UART: send RXON + I2C: do nothing ..unlock I/O ..downloading I2C: send Ctrl_Char $00 - note: -n SYS|SW1+RST reset the default subroutine of these four calls. + note: -n SYS|SW1+RST reset the default subroutine of these five calls. don't use TOS in these subroutines. On the other hand, MARKER is modified in such a way that MARKER\_DOES executes a CALL to - the content of USER_BODY-2, by default RET_ADR: + the content of USER_PARAM-2, by default RET_ADR: MARKER [CFA] = DODOES [PFA] = MARKER_DOES @@ -276,9 +306,9 @@ What is new ? By replacing [USER_PARAM-2] with the address of a new defined subroutine (named for example: REMOVE_XXX), MARKER_DOES will execute it to restore n critical pointers (room made by 2n ALLOT) at USER_PARAM, USER_PARAM+2, ... -Thus, with MARKER and the definition of subroutines STOP_XXX, SOFT_XXX, HARD_XXX, BACKGRND_XXX, -the programmer has full control of his "XXX" real time application using interrupts, -with everything he needs to start, stop and remove it properly, thanks to this 'soft' MARKER definition, +Thus, with MARKER and the definition of some subroutines according to the need: STOP_XXX, SOFT_XXX, HARD_XXX, ABORT_XXX, BACKGRND_XXX, +the programmer has full control of his "XXX" real time application using interrupts, +with everything he needs to start, stop and remove it properly, thanks to this 'soft' MARKER definition, avoiding the hardware (SW1+RST) of the last chance. See example in /MSP430-FORTH/UARTI2CS.f. @@ -513,26 +543,25 @@ In explorer you should obtain this back your driver letter: \UTILITY.asm adds WORDS, DUMP, ? .S .RS \binaries\files.txt ready for drag'n drop to prog.bat - \prog(.bat) to do what ?... + \prog(.bat) to do... \config\ - \asm.properties configuration for *.inc,*.asm files - \forth.properties configuration for *.f,*.4th files - \fortran.properties configuration for *.pat files - \SciTEDirectory.properties copy it to your project root folder \SciTEUser.properties copy it in your home directory + \SciTEDirectory.properties copy it to your project root folder + \asm.properties configuration for *.inc,*.asm, .pat files + \forth.properties configuration for *.f,*.4th files \SendFile.ttl TERATERM macro file to send source file to FASTFORTH \SendToSD.ttl TERATERM macro file to send source file to embedded SD_CARD \build(.bat) called by scite to build target.txt program \BSL_prog(.bat) to flash target with target.txt file with BSL_Scripter \FET_prog(.bat) to flash target with target.txt file with MSP430Flasher - \CopyTo_SD_Card(.bat) to copy in your MSP430-FORTH + \Select.bat called to select target, device and deviceID + \CopyTo_SD_Card(.bat) to copy a file in the target SD_Card \SendSource(.bat) to send file to FASTFORTH \Preprocess(.bat) to convert generic .f file to specific .4th file - \CopySourceFileToTarget_SD_Card.bat copy it in any user folder for drag'n drop use - \SendSourceFileToTarget.bat copy it in any user folder for drag'n drop use - \PreprocessSourceFile.bat copy it in any user folder for drag'n drop use - \SelectTarget.bat called to select target, device and deviceID + \CopySourceFileToTarget_SD_Card.bat create a link in any user folder for drag'n drop use + \SendSourceFileToTarget.bat create a link in any user folder for drag'n drop use + \PreprocessSourceFile.bat create a link in any user folder for drag'n drop use \inc\ MACRO ASsembler files.inc, files.asm, GEMA preprocessor files.pat \TargetInit.asm select target configuration file for AS assembler @@ -540,10 +569,14 @@ In explorer you should obtain this back your driver letter: \ThingsInFirst.inc general configuration for AS assembler \MSP430FRxxxx.inc device declarations \ThingsInLast.inc general post configuration for AS assembler + \FastForthREGtoTI.pat converts FORTH symbolic registers names to TI Rx registers \tiREGtoFastForth.pat converts TI Rx registers to FORTH symbolic registers names - \MSP430FRxxxx.pat device configuration for gema preprocessor - \MSP_EXP430FRxxxx.pat target configuration for gema preprocessor + \MSP430FRxxxx.pat FastForth generic declarations for INFO TLV FRAM areas + \MSP430FR2xxx.pat FastForth RAM declarations for FR2xxx and FR4xxx families + \MSP430FR57xx.pat FastForth RAM declarations for FR57xx family + \MSP430FR5xxx.pat FastForth RAM declarations for FR5xxx and FR6xxx families + \MSP_EXP430FRxxxx.pat target (launchpad) configuration \prog\ SciTEGlobal.properties, TERATERM.INI + programs.url @@ -705,12 +738,11 @@ correctly ended with CR+LF. If you have MSP-EXP430FR5994, nothing to do. For the choice of a SD card socket be carefull, pin CD (Card Detect) must be present! -web search: "micro SD card 9 pin" Look for the good wiring in /Launchpad.asm file #### Compile with SD_Card addon -in forthMSP430FR.asm, uncomment lines SD_CARD_LOADER, SD_CARD_READ_WRITE, SD_TOOLS +in forthMSP430FR.asm, uncomment lines SD_CARD_LOADER, SD_CARD_READ_WRITE then compile for your target ### the commands @@ -836,7 +868,7 @@ Here is the FastForth memory management, one of its major assets, with both hard * all programs donwloaded from the TERMINAL or from the SD_CARD are lost, - * COLD_APP, SOFT_APP, HARD_APP and BACKGND_APP default values are restored, + * COLD_APP, ABORT_APP, SOFT_APP, HARD_APP and BACKGND_APP default values are restored, * all interrupts vectors are initialised with their default value, @@ -928,7 +960,7 @@ The register IP is the Interpretative Pointer. High level FORTH definitions starts with a boot code "DOCOL" which saves the IP pointer and loads it with the first address of a list of execution addresses, then performs a postincrement branch to the first one. -The list ends with the address of another piece of code: EXIT (6 cycles) which restores IP before the instruction MOV @IP+,PC. +The list ends with the address of another piece of code: EXIT (6 cycles) which restores IP from stack before the instruction MOV @IP+,PC. here, the compilation of low level ADD definition : @@ -1265,7 +1297,7 @@ Example: MARKER {MYAPP} 'ESC' , 'XON' C, 'XOFF' C, - HDNCODE EXAMPLE \ hidden definition because linked in the hidden word-set + HDNCODE EXAMPLE \ hidden definition to be linked in the hidden word-set CMP #RET_ADR,&{MYAPP}-2 \ compare content of {MYAPP}-2 address with RET_ADR MOV &BASE,X \ X = 16 MOV #BASE,X \ X = address of base @@ -1360,7 +1392,7 @@ or use them directly then restore FastForth default values: If you want to restore only rDODOES, rDOCON and rDOVAR: -`MOV #INIT_DOXXX+4,X` +`MOV #INIT_DOXXX+2,X` `MOV @X+,rDODOES` `MOV @X+,rDOCON` `MOV @X,rDOVAR` @@ -1678,17 +1710,17 @@ Once bootloader is enabled, any PUC event loads (and executes) the file \BOOT.4T WRITE write sequentially the content of SD_buf to a file READ read sequentially a file in SD_buf, leave a flag, false when the file is automatically closed. CLOSE close last opened file. - DEL" TRUC" remove the file TRUC from SD_CARD. + DEL" TRUC" remove quietly the file TRUC from SD_CARD. WRITE" TRUC" create or overwrite a file TRUC ready to write to its beginning. APPEND" TRUC" open or create a file TRUC ready to write to the end of this file READ" TRUC" open TRUC and load its first sector in SD_buf WR_SECT Write SD_BUF in Sector loaded in W=lo:X=hi - RD_SECT load Sector W=lo:X=hi into SD_BUF, set BufferPtr=0 + RD_SECT Read Sector W=lo:X=hi into SD_BUF, set BufferPtr=0 ## OPTIONNAL ADD-ON -* Their respective MARKER word identified with braces {} removes all ADD-ONs words. +* Their respective MARKER word identified with braces {} removes all subsequent words. Sources are in the folder \MSP430-FORTH\, as source.f file. ### ANS_COMP @@ -1840,7 +1872,7 @@ F+, CLUSTER. .123 CLUSTER. displays first sector of cluster 123 SECTOR. .123456789 SECTOR. displays sector 123456789 -### DOUBLE word set +### DOUBLE word set (ANS94 compliant) [D.R ](https://forth-standard.org/standard/double/DDotR), [2LITERAL ](https://forth-standard.org/standard/double/TwoLITERAL), diff --git a/SciTEDirectory.properties b/SciTEDirectory.properties index 8182684..8249f63 100644 --- a/SciTEDirectory.properties +++ b/SciTEDirectory.properties @@ -258,7 +258,7 @@ $(BufferLength) chars in $(NbOfLines) lines. Sel: $(SelHeight) lines, $(SelLengt statusbar.text.3=\ Now is: Date=$(CurrentDate) Time=$(CurrentTime) statusbar.text.4=\ -$(FileNameExt) : $(FileDate) — $(FileTime) | $(FileAttr) +$(FilePath) : $(FileDate) — $(FileTime) if PLAT_WIN command.scite.help=C:\Users\JeanMi\AppData\Local\Yandex\YandexBrowser\Application\browser.exe --allow-file-access --allow-file-access-from-files "https://www.scintilla.org/SciTEDoc.html" @@ -616,26 +616,7 @@ Ctrl+PageDown|IDM_NEXTFILE| #Next File|IDM_NEXTFILE|\ #Prev File|IDM_PREVFILE| -#if PLAT_WIN -import .\config\asm -import .\config\forth -import .\config\fortran -import .\config\hex -import .\config\others - -#if PLAT_GTK -import /home/thoorens/CloudStation/projets/msp430/config/asm -import /home/thoorens/CloudStation/projets/msp430/config/forth -import /home/thoorens/CloudStation/projets/msp430/config/fortran -import /home/thoorens/CloudStation/projets/msp430/config/hex -import /home/thoorens/CloudStation/projets/msp430/config/others - -import /home/jean_mi/CloudStation/projets/msp430/config/asm -import /home/jean_mi/CloudStation/projets/msp430/config/forth -import /home/jean_mi/CloudStation/projets/msp430/config/fortran -import /home/jean_mi/CloudStation/projets/msp430/config/hex -import /home/jean_mi/CloudStation/projets/msp430/config/others - - - - +import ./config/asm +import ./config/forth +import ./config/hex +import ./config/others diff --git a/binaries/BSL_prog.bat - Raccourci.lnk b/binaries/BSL_prog.bat - Raccourci.lnk new file mode 100644 index 0000000000000000000000000000000000000000..0350c73a3ba86f5826af77199ffc3197218d3949 GIT binary patch literal 1131 zcmah|T}YE*6n-|PG_*FGBm3Kkghjb#i&aa*>8H~*-C!FDEp)E!bBnp*gu3XaAR*8$ z`T-#f3I7O{x(JC-q^oX(RbZ=bf+)feSw-eW&^h1c&w|nWan5_*^F8l#-gD0T+5yN^ za?-$@q|tC61<;b+8lQCyUQ5bMC3kca-;=V|`JZJxr?#Ylvh=jBjWQK9&X10ScF`PC zJWLkgu)#1`hNFVnyAIkgY^anLRi3+Nl@LQcIEg~!V|iAv4fKm1Yloix3u*=xO2`d$ z^=m0agwR8-61X!=qUTFU0e`eB7!rXq8McJ`!*%|{Y$hdhw6Ntw*OKyxW!F$om< zSFsRFW72JORgA8UR#0elQCE>tViyrz^_=gUPK(hQ&w0;#&Uv46-tW8%0x;Rl)Ideo z=(~qzIBEa(E=^h2-kKhKSK60;*4O3TMxx1Bw)9un;ZQ#fSDmZgjBReY8D~76QX9@H zUTrI>Zd^o{zR9XryKPA1bE!-kI1dY&u>Sn|P=8S(Zsy$HD~SO;yROPp4kVCA4k={7 zqiCgd4$@v${SkIT2?a+B_ZAd^qEz`2EBwVi#d2P7;6_nx^_)gS|aN7Y4L+W)h0Gc42KtkF6}@ zhPLBcTEkW>jClXbj2U$2s@h^ZoAcoO{l_rvS)Q za?-$*q+z*(Vra=;U-7CfesxA>8H~@3{hE=zxMJGVPxE{l4p|z%s*N%gG|tbCl=eqm zNO5nb82b%|_%<9A>O8BUHN%c-X;JSUJgI~j>cdf#pb!hs1pCl{=(hUx^j}ajs6;}p zsmtHXAtHo6a&3ky!z8-Dg%k)xx;sK5a6H47a?SShA7-mjGDjh+tdTToWC29bjSk|Z ztx%J72z*e{J$ph6i`ms4?TLtbzmG!NbC};t%taFOx-3>UYt3I_ftfOFM-)92LxdiF z_@vBt5`s^_b3tb2n$(kcNyugn{;-w zskNnK-U%Yb%#Tlb*W&U zbUdwTy*70C-OaIMOUtQ0N3NfpSH>?3JWm6Q5D2GV##!eoZU%83Q*cE!k|+#9?5^MQ{18yLW3 zWhD7Km+s9b1~;-Qcq?v5##xX6o+CrBsfKJjux)NGCK#(+N9;VMn z*D&olO$fFlxQJfb$D|ucq>w9*k=H>IK2WkNP}Okzt@80SrW_x)ra1C$25{sZB>5Ye zzx}+QM=c2ld87^t;{#FKsI5_-Xt)&HMgC3(*hq}ib4#vUm5%YE17H45d^pGcmGKWm CedcTc literal 947 zcmah|Ur19?82{a6;38|%GFOooNiu44_Ta;y$c=3(r57C7!womrw(h`fsH{gRFbaE! zpoa)c`il|tR6P}=_izbDrVj~GWQ6$=K|S>Q?%i?~qjULv=R4o|o$t^2&OHV|aoQ+> zf+-QYj#{YHA9X|z{`fYpl;^KEn}2>-npc(;i&&bh1?49=(WJfWE2=9#!*T0PEe?3S zQ!cdmefn?Gx)MRVxfs_Lt~n6TW|Bq8_A|TL$NWSr{p=UU7iq#=Q@}8+bp7DINm=&2th3BLxqJ5Ch#{H!)C}t&6jciakK=BQ_9DVlM&MpzB(|-4pEWJ>IRSj4}9qrGoW8 za%^B24|G(PrB_YG4nKT}>!S!}q@zx7`^{Ht(nXl*DQx zAP2yxfcC+Q;q>iZG3}8F=w-PuiqA_be zSuvVj6{Y-MyQ$X@W^U505Z_H4rzsQcvdY90l#=lqt^eoO`l;_0h7Qzf! s{wrjCl8}P#rQ@xKug=v!evLxkLSwO$_B}$7f_4!9Hm-V`n+a diff --git a/binaries/LP_MSP430FR2476_16MHz_115200.txt b/binaries/LP_MSP430FR2476_16MHz_115200.txt index e7a7488..b18bf42 100644 --- a/binaries/LP_MSP430FR2476_16MHz_115200.txt +++ b/binaries/LP_MSP430FR2476_16MHz_115200.txt @@ -1,323 +1,323 @@ @1800 -80 3E 08 00 A1 F7 18 00 FD FF 90 01 10 00 A8 19 -CC 82 6A 81 70 81 44 81 2A 83 0E 93 D8 8B 96 8B -96 8B 98 82 5E 83 26 83 3C 21 E0 20 4C 85 A0 80 -AE 80 8C 84 20 00 0A 00 00 20 6A 81 70 81 44 81 -2A 83 0E 93 D8 8B 96 8B 96 8B 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 00 00 +80 3E 08 00 A1 F7 18 00 FD FF 91 01 10 00 90 19 +32 82 C0 80 48 80 C6 80 9A 80 90 82 04 93 16 8B +D4 8A D4 8A 00 00 FE 81 C4 82 8C 82 3C 21 E0 20 +58 85 76 83 84 83 66 84 0A 00 00 20 C0 80 48 80 +C6 80 9A 80 90 82 04 93 16 8B D4 8A D4 8A 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @8000 -2F 83 8F 4E 00 00 3E 4D 30 4D 8F 4E FE FF AF 4F -FC FF 2F 82 2F 82 8F 4E 02 00 7E 4D 8F 4D 00 00 -0D 5E 1D B3 0D 63 30 4D 0B 4E 1C 4F 02 00 2E 4F -0A 43 35 40 20 00 0E 93 04 20 05 11 0E 4C 0C 43 -09 43 0A 9B 01 28 0A 8B 09 69 08 68 15 83 07 30 -0C 5C 0E 6E 0A 6A F5 2B 0A 8B 12 D3 F5 3F 35 40 -A0 80 8F 4A 02 00 8F 49 00 00 0E 48 30 41 82 43 -BE 21 B2 4F BC 21 82 4E BA 21 3E 4F 30 4D 2F 82 -8F 4E 02 00 3E 40 54 00 BF 40 3C 21 00 00 AF 4F -FE FF 2F 83 FF 3C 0E 93 3E 4F 99 21 2D 4D 30 4D -2F 83 8F 4E 00 00 3E 41 0D 12 3D 4E 30 4D 2F 83 -8F 4E 00 00 3E 41 2E 4E 30 4D 3D 41 39 40 22 18 -B2 49 96 82 B2 49 5C 83 B2 49 24 83 B2 49 8A 80 -31 49 34 49 35 49 36 49 37 49 B2 49 B8 21 B2 49 -B6 21 B2 49 00 20 82 43 B4 21 92 12 3C 18 30 40 -96 8C 8F 93 02 00 02 20 2F 52 BF 3F 30 12 20 81 -B0 12 2A 83 92 C3 1C 05 18 42 00 18 39 40 41 00 -19 83 FE 23 18 83 FA 23 92 B3 1C 05 F3 23 30 41 -B0 12 BA 80 96 84 96 80 42 81 6C 83 14 80 04 1B -5B 37 6D 00 8E 83 8E 83 14 80 04 1B 5B 30 6D 00 -8E 83 C0 88 B2 40 81 00 00 05 92 42 02 18 06 05 -92 42 04 18 08 05 F2 D0 30 00 0A 02 92 C3 00 05 -92 D3 1A 05 92 C3 30 01 30 41 92 B3 0A 05 FD 23 -30 41 92 12 3E 18 84 12 6C 83 14 80 07 0D 0A 1B -5B 37 6D 23 8E 83 C4 85 14 80 19 46 61 73 74 46 -6F 72 74 68 20 A9 4A 2E 4D 2E 54 68 6F 6F 72 65 -6E 73 2C 20 8E 83 00 80 40 FF 46 91 9E 84 90 85 -14 80 0A 62 79 74 65 73 20 66 72 65 65 00 9C 80 -36 81 00 00 06 53 59 53 92 12 3A 18 0E 93 06 38 -02 24 1E B3 03 24 B0 12 BA 80 72 81 82 4E 08 18 -D2 B3 21 02 02 20 B2 43 08 18 B2 40 04 A5 20 01 -92 D3 04 01 B2 D0 10 00 00 01 B2 40 80 5A CC 01 -3F 40 80 20 31 40 E0 20 B2 D3 06 02 B2 40 FE FF -02 02 B2 D3 26 02 B2 40 FF 7F 22 02 B2 D3 46 02 -B2 40 FC FF 42 02 E2 D3 45 02 F2 40 A5 00 A1 01 -F2 40 10 00 A0 01 D2 43 A1 01 B2 40 00 A5 60 01 -B2 D0 10 00 86 01 F2 C3 82 01 F2 D0 0A 00 82 01 -B2 40 E8 01 84 01 39 40 5C 00 18 42 00 18 18 83 -FE 23 19 83 FA 23 39 40 00 20 29 83 89 43 00 20 -FC 23 19 42 5E 01 1E 42 08 18 82 43 08 18 3E B3 -01 20 0E 49 B0 12 BA 80 72 81 00 00 0C 41 43 43 -45 50 54 00 30 40 98 82 08 4E 2E 4F 08 5E 39 40 -0D 00 3A 40 20 00 3B 40 FE 82 3C 40 0A 83 5D 15 -92 12 40 18 12 D2 06 18 FB 3F A2 B3 1C 05 FD 27 -B2 40 13 00 0E 05 E2 D3 43 02 30 41 21 52 3A 17 -58 42 0C 05 48 9C 08 2C 48 9B EF 27 78 92 11 20 -2E 9F 0F 24 1E 83 05 3C 0E 9A 03 2C CE 48 00 00 -1E 53 A2 B3 1C 05 FD 27 C2 48 0E 05 30 4D 00 83 -2D 83 92 B3 1C 05 E4 23 FC 3F 92 B3 1C 05 FD 27 -58 42 0C 05 3E 8F 3D 41 48 4C EB 3F 00 00 06 4B -45 59 30 40 26 83 30 12 3C 83 A2 B3 1C 05 FD 27 -B2 40 11 00 0E 05 E2 C3 43 02 30 41 2F 83 8F 4E -00 00 92 B3 1C 05 FD 27 B0 12 BA 82 1E 42 0C 05 -30 4D 00 00 08 45 4D 49 54 00 30 40 5E 83 08 4E -3E 4F C7 3F 54 83 08 45 43 48 4F 00 B2 40 A2 B3 -F2 82 30 4D 00 00 0C 4E 4F 45 43 48 4F 00 B2 40 -30 4D F2 82 30 4D 00 00 08 54 59 50 45 00 0D 12 -3D 40 A4 83 39 4F 2D 83 2F 83 8F 4E 00 00 7E 49 -DC 3F A4 83 5E 83 F7 23 18 24 1E 83 0D 5B 54 48 -45 4E 5D 00 30 4D 0C 4E 38 4F 3C 9F 39 4F 3E 4F -6D 22 F9 98 00 00 6A 22 19 53 1C 83 FA 23 2D 53 -30 4D 2F 53 3E 4F 1E 83 61 22 3E 4F 3D 41 30 4D -AC 83 0D 5B 45 4C 53 45 5D 00 0D 12 84 12 00 80 -01 00 9C 80 04 84 14 80 05 0D 6B 6F 20 0A 8E 83 -84 80 6E 80 D6 85 90 88 9A 80 F6 83 0A 80 06 5B -54 48 45 4E 5D 00 B6 83 1E 84 D2 83 04 84 0A 80 -06 5B 45 4C 53 45 5D 00 B6 83 30 84 D2 83 3C 84 -14 80 04 5B 49 46 5D 00 B6 83 04 84 A2 84 9C 80 -04 84 E2 83 09 5B 49 46 5D 00 0E 93 3E 4F CD 27 -30 4D 44 84 17 5B 55 4E 44 45 46 49 4E 45 44 5D -0D 12 84 12 D6 85 42 86 6A 84 1E 83 0E 7E 3D 41 -2F 53 30 4D 54 84 13 5B 44 45 46 49 4E 45 44 5D -0D 12 84 12 D6 85 42 86 6E 84 3F 12 2F 83 8F 4E -00 00 3E 41 30 4D 2F 83 8F 4E 00 00 30 4D 3E 8F -3E E3 1E 53 30 4D 00 00 02 40 2E 4E 30 4D 8C 82 -02 21 BE 4F 00 00 3E 4F 30 4D C4 81 05 53 22 00 -2F 83 8F 4E 00 00 3E 40 22 00 0B 43 0D 12 84 12 -00 80 14 80 54 89 E4 85 DA 84 1A 53 1A B3 82 6A -C0 21 7B 3F 76 83 05 2E 22 00 0D 12 84 12 C0 84 -00 80 8E 83 54 89 4C 85 00 00 04 3C 23 00 B2 40 -B2 21 B2 21 30 4D BC 84 02 23 1B 42 B6 21 2C 4F -2F 83 B0 12 30 80 BF 4F 00 00 7A 90 0A 00 02 28 -7A 50 07 00 7A 50 30 00 92 83 B2 21 18 42 B2 21 -C8 4A 00 00 30 4D 08 85 04 23 53 00 0D 12 84 12 -0A 85 44 85 2D 83 09 DE 09 93 E1 23 3D 41 30 4D -38 85 04 23 3E 00 9F 42 B2 21 00 00 3E 40 B2 21 -2E 8F 30 4D 00 00 08 48 4F 4C 44 00 4A 4E 3E 4F -DB 3F 52 85 08 53 49 47 4E 00 0E 93 3E 4F 7A 40 -2D 00 D2 33 30 4D 86 12 20 00 66 83 04 55 2E 00 -0C 43 2F 83 8F 4E 00 00 0E 4C 1D 15 3E F3 06 34 -BF E3 00 00 3E E3 9F 53 00 00 0E 63 84 12 FE 84 -86 85 6C 85 3C 85 8C 84 7A 85 56 85 8E 83 4C 85 -E6 84 02 2E 0E 93 E4 37 3C 43 E3 3F 00 00 08 57 +00 00 02 40 2E 4E 30 4D 00 00 02 21 BE 4F 00 00 +3E 4F 30 4D 3D 41 39 40 26 18 B2 49 FC 81 B2 49 +C2 82 B2 49 8A 82 B2 49 60 83 31 49 34 49 35 49 +36 49 37 49 B2 49 B6 21 B2 49 00 20 82 43 B4 21 +92 12 40 18 30 40 94 8C B0 12 90 82 92 C3 1C 05 +18 42 00 18 39 40 41 00 19 83 FE 23 18 83 FA 23 +92 B3 1C 05 F3 23 30 41 8F 93 02 00 02 20 2F 52 +A2 3D 92 12 3E 18 B0 12 14 80 70 84 6C 83 98 80 +D2 82 30 83 04 1B 5B 37 6D 00 F4 82 F4 82 30 83 +04 1B 5B 30 6D 00 F4 82 C0 88 B2 40 81 00 00 05 +92 42 02 18 06 05 92 42 04 18 08 05 F2 D0 30 00 +0A 02 92 C3 00 05 92 D3 1A 05 92 C3 30 01 30 41 +92 B3 0A 05 FD 23 30 41 92 12 42 18 84 12 D2 82 +30 83 07 0D 0A 1B 5B 37 6D 23 F4 82 C0 85 30 83 +19 46 61 73 74 46 6F 72 74 68 20 A9 4A 2E 4D 2E +54 68 6F 6F 72 65 6E 73 2C 20 F4 82 1C 83 40 FF +3C 91 78 84 9C 85 30 83 0A 62 79 74 65 73 20 66 +72 65 65 00 72 83 8C 80 00 00 06 53 59 53 92 12 +3C 18 0E 93 06 38 02 24 1E B3 03 24 B0 12 14 80 +C8 80 82 4E 08 18 D2 B3 21 02 02 20 B2 43 08 18 +B2 40 04 A5 20 01 92 D3 04 01 B2 D0 10 00 00 01 +B2 40 80 5A CC 01 3F 40 80 20 31 40 E0 20 B2 D3 +06 02 B2 40 FE FF 02 02 B2 D3 26 02 B2 40 FF 7F +22 02 B2 D3 46 02 B2 40 FC FF 42 02 E2 D3 45 02 +F2 40 A5 00 A1 01 F2 40 10 00 A0 01 D2 43 A1 01 +B2 40 00 A5 60 01 B2 D0 10 00 86 01 F2 C3 82 01 +F2 D0 0A 00 82 01 B2 40 E8 01 84 01 39 40 5C 00 +18 42 00 18 18 83 FE 23 19 83 FA 23 39 40 00 20 +29 83 89 43 00 20 FC 23 19 42 5A 01 59 0E 09 59 +19 D2 5C 01 59 0E 59 06 59 D2 5E 01 1E 42 08 18 +82 43 08 18 3E B3 01 20 0E 49 B0 12 14 80 C8 80 +0A 80 0C 41 43 43 45 50 54 00 30 40 FE 81 08 4E +2E 4F 08 5E 39 40 0D 00 3A 40 20 00 3B 40 64 82 +3C 40 70 82 5D 15 92 12 44 18 12 D2 06 18 FB 3F +A2 B3 1C 05 FD 27 B2 40 13 00 0E 05 E2 D3 43 02 +30 41 21 52 3A 17 58 42 0C 05 48 9C 08 2C 48 9B +EF 27 78 92 11 20 2E 9F 0F 24 1E 83 05 3C 0E 9A +03 2C CE 48 00 00 1E 53 A2 B3 1C 05 FD 27 C2 48 +0E 05 30 4D 66 82 2D 83 92 B3 1C 05 E4 23 FC 3F +92 B3 1C 05 FD 27 58 42 0C 05 3E 8F 3D 41 48 4C +EB 3F 00 00 06 4B 45 59 30 40 8C 82 30 12 A2 82 +A2 B3 1C 05 FD 27 B2 40 11 00 0E 05 E2 C3 43 02 +30 41 2F 83 8F 4E 00 00 92 B3 1C 05 FD 27 B0 12 +20 82 1E 42 0C 05 30 4D 00 00 08 45 4D 49 54 00 +30 40 C4 82 08 4E 3E 4F C7 3F BA 82 08 45 43 48 +4F 00 B2 40 A2 B3 58 82 30 4D 00 00 0C 4E 4F 45 +43 48 4F 00 B2 40 30 4D 58 82 30 4D 00 00 08 54 +59 50 45 00 0D 12 3D 40 0A 83 39 4F 2D 83 2F 83 +8F 4E 00 00 7E 49 DC 3F 0A 83 5E 83 F7 23 52 24 +84 82 0D 5B 54 48 45 4E 5D 00 30 4D 2F 83 8F 4E +00 00 3E 4D 30 4D 8F 4E FE FF AF 4F FC FF 2F 82 +2F 82 8F 4E 02 00 7E 4D 8F 4D 00 00 0D 5E 1D B3 +0D 63 30 4D 82 43 BC 21 B2 4F BA 21 82 4E B8 21 +3E 4F 30 4D 2F 82 8F 4E 02 00 3E 40 54 00 BF 40 +3C 21 00 00 AF 4F FE FF 2F 83 47 3F 0E 93 3E 4F +1B 20 2D 4D 30 4D 2F 83 8F 4E 00 00 3E 41 0D 12 +3D 4E 30 4D 2F 83 8F 4E 00 00 3E 41 2E 4E 30 4D +0C 4E 38 4F 3C 9F 39 4F 3E 4F EB 23 F9 98 00 00 +E8 23 19 53 1C 83 FA 23 2D 53 30 4D 2F 53 3E 4F +1E 83 DF 23 3D 41 3E 4F 30 4D 12 83 0D 5B 45 4C +53 45 5D 00 0D 12 84 12 1C 83 01 00 72 83 DE 83 +30 83 05 0D 6B 6F 20 0A F4 82 5A 83 44 83 D6 85 +A2 88 70 83 D0 83 26 83 06 5B 54 48 45 4E 5D 00 +90 83 F8 83 AC 83 DE 83 26 83 06 5B 45 4C 53 45 +5D 00 90 83 0A 84 AC 83 16 84 30 83 04 5B 49 46 +5D 00 90 83 DE 83 7C 84 72 83 DE 83 BC 83 09 5B +49 46 5D 00 0E 93 3E 4F CD 27 30 4D 1E 84 17 5B +55 4E 44 45 46 49 4E 45 44 5D 0D 12 84 12 D6 85 +42 86 44 84 1E 83 0E 7E 3D 41 2F 53 30 4D 2E 84 +13 5B 44 45 46 49 4E 45 44 5D 0D 12 84 12 D6 85 +42 86 48 84 3F 12 2F 83 8F 4E 00 00 3E 41 30 4D +2F 83 8F 4E 00 00 30 4D 3E 8F 3E E3 1E 53 30 4D +1A 81 05 53 22 00 2F 83 8F 4E 00 00 3E 40 22 00 +0B 43 0D 12 84 12 1C 83 30 83 54 89 E4 85 A0 84 +1A 53 1A B3 82 6A BE 21 85 3F DC 82 05 2E 22 00 +0D 12 84 12 86 84 1C 83 F4 82 54 89 58 85 00 00 +04 3C 23 00 B2 40 B2 21 B2 21 30 4D 0B 4E 1C 4F +02 00 2E 4F 0A 43 35 40 20 00 0E 93 04 20 05 11 +0E 4C 0C 43 09 43 0A 9B 01 28 0A 8B 09 69 08 68 +15 83 07 30 0C 5C 0E 6E 0A 6A F5 2B 0A 8B 12 D3 +F5 3F 35 40 76 83 8F 4A 02 00 8F 49 00 00 0E 48 +30 41 82 84 02 23 1B 42 B6 21 2C 4F 2F 83 B0 12 +D4 84 BF 4F 00 00 7A 90 0A 00 02 28 7A 50 07 00 +7A 50 30 00 92 83 B2 21 18 42 B2 21 C8 4A 00 00 +30 4D 14 85 04 23 53 00 0D 12 84 12 16 85 50 85 +2D 83 09 DE 09 93 E1 23 3D 41 30 4D 44 85 04 23 +3E 00 9F 42 B2 21 00 00 3E 40 B2 21 2E 8F 30 4D +00 00 08 48 4F 4C 44 00 4A 4E 3E 4F DB 3F 5E 85 +08 53 49 47 4E 00 0E 93 3E 4F 7A 40 2D 00 D2 33 +30 4D 86 12 20 00 CC 82 04 55 2E 00 0C 43 2F 83 +8F 4E 00 00 0E 43 1D 15 84 12 C4 84 92 85 78 85 +48 85 66 84 86 85 62 85 F4 82 58 85 AC 84 02 2E +0E 93 EC 37 3E E3 1E 53 3C 43 E9 3F 00 00 08 57 4F 52 44 00 05 3C 2F 83 8F 4E 00 00 3E 40 20 00 -1B 42 B8 21 3C 40 BA 21 39 4C 38 4C 09 58 38 5C -2A 4C 08 99 1C 2C 7E 98 FC 27 18 83 F8 90 27 00 +3B 40 20 00 3C 40 B8 21 39 4C 38 4C 09 58 38 5C +2A 4C 08 99 18 2C 7E 98 FC 27 18 83 F8 90 27 00 02 00 01 20 0B 43 CA 4C 00 00 08 99 0C 24 7C 48 4E 9C 09 24 1A 53 7C 90 61 00 F5 2B 7C 90 7B 00 -F2 2F 4C 8B F0 3F 18 82 BC 21 82 48 BE 21 1E 42 -C0 21 0A 8E CE 4A 00 00 30 4D 00 00 08 46 49 4E -44 00 2F 83 0C 4E 3B 40 C6 21 3E 4B 0E 93 1E 24 +F2 2F 4C 8B F0 3F 18 82 BA 21 82 48 BC 21 1E 42 +BE 21 0A 8E CE 4A 00 00 30 4D 00 00 08 46 49 4E +44 00 2F 83 0C 4E 3B 40 C4 21 3E 4B 0E 93 1E 24 58 4C 01 00 78 F0 0F 00 08 58 0E 58 2E 53 1E 4E FE FF 0E 93 F2 27 09 4E 78 49 48 11 68 9C F7 23 0A 4C FA 99 01 00 F3 23 1A 53 58 83 FA 23 19 B3 09 63 0C 49 6E 4E 1E F3 01 20 1E 83 8F 4C 00 00 -30 4D C2 85 0E 3E 4E 55 4D 42 45 52 1B 42 B6 21 +30 4D BE 85 0E 3E 4E 55 4D 42 45 52 1B 42 B6 21 3C 4F 38 4F 29 4F 2F 82 82 4B C0 04 6A 4C 7A 80 3A 00 03 28 7A 80 07 00 12 28 7A 50 0A 00 0A 9B 22 C3 0D 2C 82 49 E0 04 82 48 E2 04 19 42 E4 04 18 42 E6 04 09 5A 08 63 1C 53 1E 83 E7 23 8F 4C -00 00 8F 48 02 00 8F 49 04 00 30 4D 32 C0 00 02 -3F 82 8F 4E 06 00 08 43 09 43 1B 42 B6 21 0C 4E -0E 43 1E 15 3D 40 4C 87 7E 4C 6A 4C 7A 80 2D 00 -16 24 CA 2F 2B 43 7A 52 14 24 3B 52 6A 53 11 24 -3B 40 10 00 5A 93 0D 24 6A 92 41 20 3E 90 03 00 -3E 20 FC 9C 01 00 6C 4C 8F 4C 04 00 38 3C B1 43 -02 00 1E 83 FC 9C 00 00 E0 23 AE 27 4E 87 2F 24 -2D 83 6A 4C 7A 90 5F 00 BF 27 32 B0 00 02 27 20 -32 D0 00 02 7A 80 2E 00 B7 27 6A 53 20 20 0A 4E -09 43 8F 49 02 00 5A 83 09 4A 09 5C 69 49 79 80 -3A 00 03 28 79 80 07 00 0C 28 79 50 0A 00 09 9B -08 2C 8F 49 00 00 0E 4B 2C 15 B0 12 28 80 2A 17 -E8 3F 9F 4F 04 00 02 00 AF 4F 04 00 4A 93 1D 17 -04 24 3F 50 06 00 0E F3 30 4D 2F 53 9F 4F 02 00 -04 00 BF 4F 00 00 3E E3 09 20 3E E3 BF E3 02 00 -BF E3 00 00 9F 53 02 00 8F 63 00 00 32 B0 00 02 -47 26 30 4D FA 84 03 5C 92 42 BA 21 BE 21 30 4D -0D 12 84 12 6E 80 D6 85 9A 80 38 88 42 86 00 88 -0A 4E 3E 4F 3D 40 1A 88 71 27 3D 40 F6 87 1A E2 +00 00 8F 48 02 00 8F 49 04 00 30 4D 3D 40 1A 88 +32 C0 00 02 3F 82 8F 4E 06 00 08 43 09 43 1B 42 +B6 21 0C 4E 0E 43 1E 15 3D 40 50 87 7E 4C 6A 4C +7A 80 2D 00 16 24 C8 2F 2B 43 7A 52 14 24 3B 52 +6A 53 11 24 3B 40 10 00 5A 93 0D 24 6A 92 41 20 +3E 90 03 00 3E 20 FC 9C 01 00 6C 4C 8F 4C 04 00 +38 3C B1 43 02 00 1E 83 FC 9C 00 00 E0 23 AC 27 +52 87 2F 24 2D 83 6A 4C 7A 90 5F 00 BD 27 32 B0 +00 02 27 20 32 D0 00 02 7A 80 2E 00 B5 27 6A 53 +20 20 0A 4E 09 43 8F 49 02 00 5A 83 09 4A 09 5C +69 49 79 80 3A 00 03 28 79 80 07 00 0C 28 79 50 +0A 00 09 9B 08 2C 8F 49 00 00 0E 4B 2C 15 B0 12 +CC 84 2A 17 E8 3F 9F 4F 04 00 02 00 AF 4F 04 00 +4A 93 1D 17 04 24 3F 50 06 00 0E F3 30 4D 2F 53 +9F 4F 02 00 04 00 BF 4F 00 00 3E E3 09 20 3E E3 +BF E3 02 00 BF E3 00 00 9F 53 02 00 8F 63 00 00 +32 B0 00 02 32 26 30 4D C0 84 03 5C 92 42 B8 21 +BC 21 30 4D 0D 12 84 12 44 83 D6 85 70 83 38 88 +42 86 04 88 0A 4E 3E 4F 71 27 3D 40 FA 87 1A E2 B4 21 A0 24 0E 12 3E 4F 30 41 1C 88 3E 4F 3D 40 -F6 87 10 20 3D 40 0E 8A DE 53 00 00 68 4E 08 5E -F8 40 3F 00 00 00 2C 3C DA 83 E6 87 0F 4C 49 54 -45 52 41 4C 82 93 B4 21 0D 24 09 4E 1A 42 C0 21 -A2 52 C0 21 BA 40 00 80 00 00 8A 49 02 00 3E 4F +FA 87 10 20 3D 40 0C 8A DE 53 00 00 68 4E 08 5E +F8 40 3F 00 00 00 35 3C B4 83 EA 87 0F 4C 49 54 +45 52 41 4C 82 93 B4 21 0D 24 09 4E 1A 42 BE 21 +A2 52 BE 21 BA 40 1C 83 00 00 8A 49 02 00 3E 4F 32 B0 00 02 32 C0 00 02 03 24 8A 4E 02 00 EE 3F 30 4D 8F 4E FE FF 3E 40 80 20 0E 8F 0E 11 2F 83 -0E 5E 0E 7E 3E E3 30 4D 74 85 0A 43 4F 55 4E 54 -2F 83 7A 4E 8F 4E 00 00 0E 4A 3E F3 30 4D 2F 83 -8F 4E 00 00 0E 43 B2 90 40 FF C0 21 EB 2F 30 4D -B0 84 0A 41 4C 4C 4F 54 82 5E C0 21 3E 4F 30 4D -3F 40 80 20 0E 43 84 12 14 80 02 0D 0A 00 8E 83 -7E 80 F0 87 72 88 14 80 0B 73 74 61 63 6B 20 65 -6D 70 74 79 F2 80 9E 88 14 80 09 4D 41 49 4E 20 -66 75 6C 6C F2 80 9C 80 C8 88 B2 88 0D 41 42 4F -52 54 22 00 0D 12 84 12 C0 84 00 80 F2 80 54 89 -4C 85 CE 85 02 27 0D 12 84 12 D6 85 42 86 96 80 -24 89 4C 85 24 88 76 84 07 5B 27 5D 0D 12 84 12 -16 89 00 80 00 80 54 89 54 89 4C 85 28 89 03 5B +0E 5E 0E 7E 3E E3 30 4D 2F 83 8F 4E 00 00 0E 43 +B2 90 40 FF BE 21 F6 2F 30 4D 80 85 0A 43 4F 55 +4E 54 2F 83 7A 4E 8F 4E 00 00 0E 4A 3E F3 30 4D +F2 81 0A 41 4C 4C 4F 54 82 5E BE 21 3E 4F 30 4D +3F 40 80 20 0E 43 84 12 30 83 02 0D 0A 00 F4 82 +54 83 F4 87 72 88 30 83 0B 73 74 61 63 6B 20 65 +6D 70 74 79 68 80 88 88 30 83 09 4D 41 49 4E 20 +66 75 6C 6C 68 80 72 83 C8 88 B2 88 0D 41 42 4F +52 54 22 00 0D 12 84 12 86 84 1C 83 68 80 54 89 +58 85 CE 85 02 27 0D 12 84 12 D6 85 42 86 6C 83 +24 89 58 85 24 88 50 84 07 5B 27 5D 0D 12 84 12 +16 89 1C 83 1C 83 54 89 54 89 58 85 28 89 03 5B 82 43 B4 21 30 4D 00 00 02 5D B2 43 B4 21 30 4D -3C 88 02 2C A2 53 C0 21 1A 42 C0 21 8A 4E FE FF -3E 4F 30 4D A8 84 11 50 4F 53 54 50 4F 4E 45 00 -0D 12 84 12 D6 85 42 86 9A 80 24 89 80 88 96 80 -8E 89 00 80 00 80 54 89 54 89 00 80 54 89 54 89 -4C 85 00 00 02 3A 30 12 E0 89 92 B3 C0 21 A2 63 -C0 21 0D 12 84 12 D6 85 AA 89 3D 41 5A D3 5A 53 -0A 5E 19 42 C4 21 08 4E FE 5E FF FF 6E 4E 3E F0 -0F 00 0E 5E 09 5E 3E 4F 82 48 D8 21 82 49 DA 21 -82 4A DC 21 82 4F DE 21 2A 52 82 4A C0 21 30 41 +3C 88 02 2C A2 53 BE 21 1A 42 BE 21 8A 4E FE FF +3E 4F 30 4D 02 80 11 50 4F 53 54 50 4F 4E 45 00 +0D 12 84 12 D6 85 42 86 70 83 24 89 80 88 6C 83 +8E 89 1C 83 1C 83 54 89 54 89 1C 83 54 89 54 89 +58 85 00 00 02 3A 30 12 E0 89 92 B3 BE 21 A2 63 +BE 21 0D 12 84 12 D6 85 AA 89 3D 41 5A D3 5A 53 +0A 5E 19 42 C2 21 08 4E FE 5E FF FF 6E 4E 3E F0 +0F 00 0E 5E 09 5E 3E 4F 82 48 D6 21 82 49 D8 21 +82 4A DA 21 82 4F DC 21 2A 52 82 4A BE 21 30 41 BA 40 0D 12 FC FF BA 40 84 12 FE FF B2 43 B4 21 -30 4D 82 9F DE 21 01 20 0B 24 84 12 14 80 0F 73 -74 61 63 6B 20 6D 69 73 6D 61 74 63 68 21 FC 80 -18 42 D8 21 19 42 DA 21 A8 49 FE FF 89 48 00 00 -30 4D 3E 89 03 3B 82 93 B4 21 DE 26 0D 12 84 12 -00 80 4C 85 54 89 F2 89 40 89 4C 85 00 00 12 49 -4D 4D 45 44 49 41 54 45 18 42 D8 21 D8 D3 00 00 -30 4D 8A 88 0C 43 52 45 41 54 45 00 B0 12 9A 89 -BA 40 86 12 FC FF 8A 4A FE FF D6 3F 88 83 0A 44 -4F 45 53 3E 1A 42 DC 21 BA 40 85 12 00 00 8A 4D -02 00 3D 41 30 4D 94 89 0E 3A 4E 4F 4E 41 4D 45 -30 12 E0 89 2F 83 8F 4E 00 00 1A 42 C0 21 1A B3 -0A 63 0E 4A 39 40 12 02 08 49 8E 3F 3E 8A 05 49 -53 00 0D 12 82 93 B4 21 08 20 84 12 16 89 C0 8A -3D 41 BE 4F 02 00 3E 4F 30 4D 84 12 2C 89 00 80 -C2 8A 54 89 4C 85 54 8A 08 43 4F 44 45 00 B0 12 -9A 89 A2 82 C0 21 92 42 C6 21 C8 21 B2 40 B8 8B -C6 21 30 4D 66 85 0E 48 44 4E 43 4F 44 45 12 12 -C4 21 B2 40 B8 8B C4 21 0D 12 84 12 DE 8A 10 8B -3D 41 B2 41 C4 21 30 4D D8 8A 0E 43 4F 44 45 4E -4E 4D 30 12 E2 8A B6 3F 00 00 0E 45 4E 44 43 4F -44 45 0B 4D 84 12 F2 89 3A 8B 0D 4B B2 40 96 8B -C6 21 82 43 C8 21 30 4D 00 00 0A 43 4F 4C 4F 4E -1A 42 C0 21 BA 40 0D 12 00 00 BA 40 84 12 02 00 -A2 52 C0 21 B2 43 B4 21 E9 3F 00 00 0A 4C 4F 32 -48 49 A2 83 C0 21 1A 42 C0 21 EF 3F F6 8A 0B 48 -49 32 4C 4F A2 53 C0 21 1A 42 C0 21 8A 4A FE FF -82 43 B4 21 A8 3F 66 89 FC 88 02 8C 1A 8B 6E 8A -8C 85 3C 86 14 89 7E 8B AE 8A 88 8A 24 8A 52 89 -4E 8C 94 86 00 00 00 00 02 93 82 91 E6 92 A2 90 -FE 90 54 91 34 92 40 92 C4 8F E8 90 00 00 00 00 -6C 8B B4 8E 00 00 5C 92 B6 8B 2B 42 BA 49 00 00 -2A 53 1B 83 FB 23 30 41 00 00 0E 52 53 54 5F 53 -45 54 39 40 C0 21 3A 40 42 18 B0 12 DA 8B 30 4D -EA 8B 0E 52 53 54 5F 52 45 54 39 40 42 18 3A 40 -C0 21 2C 49 B0 12 DA 8B 1A 42 C2 21 3B 40 10 00 -09 4A 08 49 29 83 18 48 FE FF 0C 98 FC 2B 89 48 -00 00 1B 83 F6 23 2A 4A 0A 93 F0 23 30 4D 40 8C -B2 4E 42 18 BE 12 3E 4F 3D 41 DF 3F 48 89 0C 4D -41 52 4B 45 52 00 12 12 BE 21 0D 12 84 12 D6 85 -42 86 96 80 6A 8C 96 84 14 88 6C 8C 3E 4F 3D 41 -B2 41 BE 21 B0 12 9A 89 BA 40 85 12 FC FF BA 40 -3E 8C FE FF 28 83 8A 48 00 00 BA 40 6C 80 02 00 -A2 52 C0 21 BD 3E 0E 93 B8 37 39 40 10 00 29 83 -B9 43 80 FF FC 23 B9 40 F0 81 FE FF 29 83 B9 40 -E0 81 FE FF 39 90 AE FF F9 23 39 40 10 18 B2 49 -E0 FF 3B 42 3A 40 3A 18 B0 12 DC 8B 82 43 4A 18 -9C 3F 12 12 BE 21 84 12 E0 85 42 86 96 80 02 8D -E2 8C 3C 4E 3C 80 87 12 0A 24 1C 53 02 20 2E 4E -06 3C BE 90 3E 8C 00 00 01 20 3E 52 2E 83 21 53 -30 41 EC 86 96 80 0A 8D FE 8C 0C 8D B2 41 BE 21 -30 41 92 83 BE 21 3E 40 28 00 0A 4E 3D 15 B0 12 -D2 8C 15 20 3E 40 2B 00 B0 12 D2 8C 06 20 3E 40 -2D 00 B0 12 D2 8C 92 83 BE 21 0E 12 1E 41 02 00 -84 12 E0 85 EC 86 96 80 24 89 4C 8D 3E 51 3A 17 -30 41 B0 12 12 8D 19 42 C0 21 89 4E 00 00 A2 53 -C0 21 3E 40 29 00 92 53 BE 21 1A 42 BE 21 3D 15 -84 12 E0 85 EC 86 96 80 84 8D 7C 8D 3E 90 10 00 -E6 2B 7E 2D 86 8D A2 41 BE 21 E1 3F 03 20 B0 12 -6A 8D 47 20 7A 90 23 00 23 20 B0 12 1A 8D 3C 40 -00 03 0E 93 40 24 3C 40 10 03 1E 93 3C 24 3C 40 -20 03 2E 93 38 24 3C 40 20 02 2E 92 34 24 3C 40 -30 02 3E 92 30 24 3C 40 30 03 3E 93 2C 24 3C 40 -30 00 19 42 C0 21 A2 53 C0 21 89 4E 00 00 23 3C -7A 90 26 00 05 20 3C 40 10 02 B0 12 1A 8D F1 3F -7A 90 40 00 0C 20 3C 40 20 00 B0 12 66 8D 11 20 -3C D0 10 00 3E 40 2B 00 B0 12 6A 8D 04 20 3C D0 -10 00 B0 12 52 8D 92 92 BA 21 BE 21 02 24 92 53 -BE 21 8E 10 0C 5E 3E 4F 30 4D 03 20 B0 12 6A 8D -F9 23 7A 90 26 00 03 20 3C D0 82 00 D6 3F 3C D0 -80 00 B0 12 52 8D EE 23 30 40 24 88 0C 43 1B 42 -C0 21 A2 53 C0 21 3A 40 20 00 19 42 BE 21 19 52 -BC 21 7A 99 FE 27 5A 49 FF FF 19 82 BC 21 82 49 -BE 21 7A 90 52 00 30 4D 00 00 08 52 45 54 49 00 -0D 12 84 12 00 80 00 13 54 89 4C 85 00 80 2C 00 -4C 8E 8C 8D 86 85 56 8E 2A 8E 9C 8E 3D 41 2C DE -8B 4C 00 00 C0 3F 00 00 06 4D 4F 56 85 12 8C 8E -00 40 A8 8E 0A 4D 4F 56 2E 42 85 12 8C 8E 40 40 -00 00 06 41 44 44 85 12 8C 8E 00 50 C2 8E 0A 41 -44 44 2E 42 85 12 8C 8E 40 50 CE 8E 08 41 44 44 -43 00 85 12 8C 8E 00 60 DC 8E 0C 41 44 44 43 2E -42 00 85 12 8C 8E 40 60 4A 8B 08 53 55 42 43 00 -85 12 8C 8E 00 70 FA 8E 0C 53 55 42 43 2E 42 00 -85 12 8C 8E 40 70 08 8F 06 53 55 42 85 12 8C 8E -00 80 18 8F 0A 53 55 42 2E 42 85 12 8C 8E 40 80 -24 8F 06 43 4D 50 85 12 8C 8E 00 90 32 8F 0A 43 -4D 50 2E 42 85 12 8C 8E 40 90 00 00 08 44 41 44 -44 00 85 12 8C 8E 00 A0 4C 8F 0C 44 41 44 44 2E -42 00 85 12 8C 8E 40 A0 7A 8E 06 42 49 54 85 12 -8C 8E 00 B0 6A 8F 0A 42 49 54 2E 42 85 12 8C 8E -40 B0 76 8F 06 42 49 43 85 12 8C 8E 00 C0 84 8F -0A 42 49 43 2E 42 85 12 8C 8E 40 C0 90 8F 06 42 -49 53 85 12 8C 8E 00 D0 9E 8F 0A 42 49 53 2E 42 -85 12 8C 8E 40 D0 00 00 06 58 4F 52 85 12 8C 8E -00 E0 B8 8F 0A 58 4F 52 2E 42 85 12 8C 8E 40 E0 -EA 8E 06 41 4E 44 85 12 8C 8E 00 F0 D2 8F 0A 41 -4E 44 2E 42 85 12 8C 8E 40 F0 86 85 4C 8E 8C 8D -F2 8F 0A 4C 3C F0 70 00 8A 10 3A F0 0F 00 0C DA -4D 3F AA 8F 06 52 52 43 85 12 EA 8F 00 10 04 90 -0A 52 52 43 2E 42 85 12 EA 8F 40 10 3E 8F 08 53 -57 50 42 00 85 12 EA 8F 80 10 10 90 06 52 52 41 -85 12 EA 8F 00 11 2C 90 0A 52 52 41 2E 42 85 12 -EA 8F 40 11 1E 90 06 53 58 54 85 12 EA 8F 80 11 -00 00 08 50 55 53 48 00 85 12 EA 8F 00 12 52 90 -0C 50 55 53 48 2E 42 00 85 12 EA 8F 40 12 46 90 -08 43 41 4C 4C 00 85 12 EA 8F 80 12 1A 53 0E 4A -84 12 C4 85 14 80 0D 6F 75 74 20 6F 66 20 62 6F -75 6E 64 73 FC 80 70 90 06 53 3E 3D 86 12 00 38 -98 90 04 53 3C 00 86 12 00 34 60 90 06 30 3E 3D -86 12 00 30 AC 90 04 30 3C 00 86 12 00 30 2A 8B -04 55 3C 00 86 12 00 2C C0 90 06 55 3E 3D 86 12 -00 28 B6 90 06 30 3C 3E 86 12 00 24 D4 90 04 30 -3D 00 86 12 00 20 00 00 04 49 46 00 1A 42 C0 21 -8A 4E 00 00 A2 53 C0 21 0E 4A 30 4D 5A 8F 08 54 -48 45 4E 00 1A 42 C0 21 08 4E 3E 4F 09 48 29 53 -0A 89 3A 90 FF 03 B3 2F 0A 11 88 DA 00 00 30 4D -CA 90 08 45 4C 53 45 00 1A 42 C0 21 BA 40 00 3C -00 00 A2 53 C0 21 2F 83 8F 4A 00 00 E3 3F 38 90 -0A 42 45 47 49 4E 2F 83 8F 4E 00 00 1E 42 C0 21 -30 4D 22 91 0A 55 4E 54 49 4C 3A 4F 08 4E 3E 4F -19 42 C0 21 2A 83 0A 89 3A 90 00 FC 88 3B 0A 11 -3A F0 FF 03 08 DA 89 48 00 00 A2 53 C0 21 30 4D -DE 8F 0A 41 47 41 49 4E 0A 4E 38 40 00 3C E7 3F -00 00 0A 57 48 49 4C 45 0D 12 84 12 EC 90 8A 84 -4C 85 40 91 0C 52 45 50 45 41 54 00 0D 12 84 12 -88 91 04 91 4C 85 B8 91 3D 41 2E 4E 08 4E 3E 4F -2A 48 B2 92 BE 21 CA 2F 98 42 C0 21 00 00 30 4D -A4 91 06 42 57 31 85 12 B6 91 E0 21 D2 91 06 42 -57 32 85 12 B6 91 E2 21 DE 91 06 42 57 33 85 12 -B6 91 E4 21 F6 91 3D 41 1A 42 C0 21 2E 4E 28 4E -8E 43 00 00 B2 92 BE 21 80 2B BA 4F 00 00 A2 53 -C0 21 8E 4A 00 00 3E 4F 30 4D 00 00 06 46 57 31 -85 12 F4 91 E6 21 1C 92 06 46 57 32 85 12 F4 91 -EA 21 28 92 06 46 57 33 85 12 F4 91 EA 21 92 91 -08 47 4F 54 4F 00 2F 83 8F 4E 00 00 3E 40 00 3C -0D 12 84 12 16 89 14 88 4C 85 00 00 0A 3F 47 4F -54 4F 3E 90 00 30 F4 27 3E E0 00 04 3E B0 00 10 -EF 27 3E E0 00 08 EC 3F 00 80 2C 00 56 8E E0 85 -EC 86 96 80 24 89 86 85 4C 8E 2A 8E 8E 92 0A 4E -3E 4F 1A 83 F3 32 29 4E 59 0E 0A 28 08 4C 59 0A -01 28 0C 8A 08 8A 38 90 10 00 E8 2E 5A 0E A7 3E -2A 92 E4 2E 8A 10 5A 06 A2 3E EA 91 08 52 52 43 -4D 00 85 12 78 92 50 00 BC 92 08 52 52 41 4D 00 -85 12 78 92 50 01 CA 92 08 52 4C 41 4D 00 85 12 -78 92 50 02 D8 92 08 52 52 55 4D 00 85 12 78 92 -50 03 DE 90 0A 50 55 53 48 4D 85 12 78 92 00 15 -F4 92 08 50 4F 50 4D 00 85 12 78 92 00 17 +30 4D 82 9F DC 21 0B 24 84 12 30 83 0F 73 74 61 +63 6B 20 6D 69 73 6D 61 74 63 68 21 72 80 18 42 +D6 21 19 42 D8 21 A8 49 FE FF 89 48 00 00 30 4D +3E 89 03 3B 82 93 B4 21 E1 26 0D 12 84 12 1C 83 +58 85 54 89 F2 89 40 89 58 85 00 00 12 49 4D 4D +45 44 49 41 54 45 18 42 D6 21 D8 D3 00 00 30 4D +9C 88 0C 43 52 45 41 54 45 00 B0 12 9A 89 BA 40 +86 12 FC FF 8A 4A FE FF D6 3F EE 82 0A 44 4F 45 +53 3E 1A 42 DA 21 BA 40 85 12 00 00 8A 4D 02 00 +3D 41 30 4D 94 89 0E 3A 4E 4F 4E 41 4D 45 30 12 +E0 89 2F 83 8F 4E 00 00 1A 42 BE 21 1A B3 0A 63 +0E 4A 39 40 12 02 08 49 8F 3F 3C 8A 05 49 53 00 +0D 12 82 93 B4 21 08 20 84 12 16 89 BE 8A 3D 41 +BE 4F 02 00 3E 4F 30 4D 84 12 2C 89 1C 83 C0 8A +54 89 58 85 66 89 FC 88 00 8C 5C 8B 6C 8A 98 85 +3C 86 14 89 C0 8B AC 8A 86 8A 22 8A 52 89 4C 8C +94 86 00 00 00 00 F8 92 78 91 DC 92 98 90 F4 90 +4A 91 2A 92 36 92 BA 8F DE 90 00 00 00 00 AE 8B +AA 8E 00 00 52 92 F4 8A 52 8A 08 43 4F 44 45 00 +B0 12 9A 89 A2 82 BE 21 92 42 C4 21 C6 21 B2 40 +F6 8A C4 21 30 4D 72 85 0E 48 44 4E 43 4F 44 45 +12 12 C2 21 B2 40 F6 8A C2 21 0D 12 84 12 20 8B +52 8B 3D 41 B2 41 C2 21 30 4D 1A 8B 0E 43 4F 44 +45 4E 4E 4D 30 12 24 8B 94 3F 00 00 0E 45 4E 44 +43 4F 44 45 0B 4D 84 12 F2 89 7C 8B 0D 4B B2 40 +D4 8A C4 21 82 43 C6 21 30 4D 00 00 0A 43 4F 4C +4F 4E 1A 42 BE 21 BA 40 0D 12 00 00 BA 40 84 12 +02 00 A2 52 BE 21 B2 43 B4 21 E9 3F 00 00 0A 4C +4F 32 48 49 A2 83 BE 21 1A 42 BE 21 EF 3F 38 8B +0B 48 49 32 4C 4F A2 53 BE 21 1A 42 BE 21 8A 4A +FE FF 82 43 B4 21 A8 3F 2B 42 BA 49 00 00 2A 53 +1B 83 FB 23 30 41 00 00 0E 52 53 54 5F 53 45 54 +39 40 BE 21 3A 40 46 18 B0 12 D8 8B 30 4D E8 8B +0E 52 53 54 5F 52 45 54 39 40 46 18 3A 40 BE 21 +2C 49 B0 12 D8 8B 1A 42 C0 21 3B 40 10 00 09 4A +08 49 29 83 18 48 FE FF 0C 98 FC 2B 89 48 00 00 +1B 83 F6 23 2A 4A 0A 93 F0 23 30 4D 3E 8C B2 4E +46 18 BE 12 3E 4F 3D 41 DF 3F 48 89 0C 4D 41 52 +4B 45 52 00 12 12 BC 21 0D 12 84 12 D6 85 42 86 +6C 83 68 8C 70 84 14 88 6A 8C 3E 4F 3D 41 B2 41 +BC 21 B0 12 9A 89 BA 40 85 12 FC FF BA 40 3C 8C +FE FF 28 83 8A 48 00 00 BA 40 10 85 02 00 A2 52 +BE 21 BD 3E 0E 93 B8 37 39 40 10 00 29 83 B9 43 +80 FF FC 23 B9 40 46 81 FE FF 29 83 B9 40 36 81 +FE FF 39 90 AE FF F9 23 39 40 10 18 B2 49 E0 FF +3B 40 0A 00 3A 40 3C 18 B0 12 DA 8B 9D 3F 12 12 +BC 21 84 12 E0 85 42 86 6C 83 FE 8C DE 8C 3C 4E +3C 80 87 12 0A 24 1C 53 02 20 2E 4E 06 3C BE 90 +3C 8C 00 00 01 20 3E 52 2E 83 21 53 30 41 F0 86 +6C 83 06 8D FA 8C 08 8D B2 41 BC 21 30 41 92 83 +BC 21 3E 40 28 00 0A 4E 3D 15 B0 12 CE 8C 15 20 +3E 40 2B 00 B0 12 CE 8C 06 20 3E 40 2D 00 B0 12 +CE 8C 92 83 BC 21 0E 12 1E 41 02 00 84 12 E0 85 +F0 86 6C 83 24 89 48 8D 3E 51 3A 17 30 41 B0 12 +0E 8D 19 42 BE 21 89 4E 00 00 A2 53 BE 21 3E 40 +29 00 92 53 BC 21 1A 42 BC 21 3D 15 84 12 E0 85 +F0 86 6C 83 80 8D 78 8D 3E 90 10 00 E6 2B 7B 2D +82 8D A2 41 BC 21 E1 3F 03 20 B0 12 66 8D 44 20 +7A 90 23 00 23 20 B0 12 16 8D 3C 40 00 03 0E 93 +3D 24 3C 40 10 03 1E 93 39 24 3C 40 20 03 2E 93 +35 24 3C 40 30 03 3E 93 31 24 3C 40 20 02 2E 92 +2D 24 3C 40 30 02 3E 92 29 24 3C 40 30 00 19 42 +BE 21 A2 53 BE 21 89 4E 00 00 20 3C 7A 90 26 00 +05 20 3C 40 10 02 B0 12 16 8D F1 3F 7A 90 40 00 +0A 20 3C 40 20 00 B0 12 62 8D 0E 20 3E 40 2B 00 +B0 12 66 8D 02 20 B0 12 4E 8D 3C D0 10 00 3A 40 +FF 3F 0A 9C 82 63 BC 21 8E 10 0C 5E 3E 4F 30 4D +03 20 B0 12 66 8D F9 23 7A 90 26 00 03 20 3C D0 +82 00 D9 3F 3C D0 80 00 B0 12 4E 8D EE 23 30 40 +24 88 0C 43 1B 42 BE 21 A2 53 BE 21 3A 40 20 00 +19 42 BC 21 19 52 BA 21 7A 99 FE 27 5A 49 FF FF +19 82 BA 21 82 49 BC 21 7A 90 52 00 30 4D 00 00 +08 52 45 54 49 00 0D 12 84 12 1C 83 00 13 54 89 +58 85 1C 83 2C 00 42 8E 88 8D 92 85 4C 8E 20 8E +92 8E 3D 41 2C DE 8B 4C 00 00 C0 3F 00 00 06 4D +4F 56 85 12 82 8E 00 40 9E 8E 0A 4D 4F 56 2E 42 +85 12 82 8E 40 40 00 00 06 41 44 44 85 12 82 8E +00 50 B8 8E 0A 41 44 44 2E 42 85 12 82 8E 40 50 +C4 8E 08 41 44 44 43 00 85 12 82 8E 00 60 D2 8E +0C 41 44 44 43 2E 42 00 85 12 82 8E 40 60 8C 8B +08 53 55 42 43 00 85 12 82 8E 00 70 F0 8E 0C 53 +55 42 43 2E 42 00 85 12 82 8E 40 70 FE 8E 06 53 +55 42 85 12 82 8E 00 80 0E 8F 0A 53 55 42 2E 42 +85 12 82 8E 40 80 1A 8F 06 43 4D 50 85 12 82 8E +00 90 28 8F 0A 43 4D 50 2E 42 85 12 82 8E 40 90 +00 00 08 44 41 44 44 00 85 12 82 8E 00 A0 42 8F +0C 44 41 44 44 2E 42 00 85 12 82 8E 40 A0 70 8E +06 42 49 54 85 12 82 8E 00 B0 60 8F 0A 42 49 54 +2E 42 85 12 82 8E 40 B0 6C 8F 06 42 49 43 85 12 +82 8E 00 C0 7A 8F 0A 42 49 43 2E 42 85 12 82 8E +40 C0 86 8F 06 42 49 53 85 12 82 8E 00 D0 94 8F +0A 42 49 53 2E 42 85 12 82 8E 40 D0 00 00 06 58 +4F 52 85 12 82 8E 00 E0 AE 8F 0A 58 4F 52 2E 42 +85 12 82 8E 40 E0 E0 8E 06 41 4E 44 85 12 82 8E +00 F0 C8 8F 0A 41 4E 44 2E 42 85 12 82 8E 40 F0 +92 85 42 8E 88 8D E8 8F 0A 4C 3C F0 70 00 8A 10 +3A F0 0F 00 0C DA 4D 3F A0 8F 06 52 52 43 85 12 +E0 8F 00 10 FA 8F 0A 52 52 43 2E 42 85 12 E0 8F +40 10 34 8F 08 53 57 50 42 00 85 12 E0 8F 80 10 +06 90 06 52 52 41 85 12 E0 8F 00 11 22 90 0A 52 +52 41 2E 42 85 12 E0 8F 40 11 14 90 06 53 58 54 +85 12 E0 8F 80 11 00 00 08 50 55 53 48 00 85 12 +E0 8F 00 12 48 90 0C 50 55 53 48 2E 42 00 85 12 +E0 8F 40 12 3C 90 08 43 41 4C 4C 00 85 12 E0 8F +80 12 1A 53 0E 4A 84 12 C0 85 30 83 0D 6F 75 74 +20 6F 66 20 62 6F 75 6E 64 73 72 80 66 90 06 53 +3E 3D 86 12 00 38 8E 90 04 53 3C 00 86 12 00 34 +56 90 06 30 3E 3D 86 12 00 30 A2 90 04 30 3C 00 +86 12 00 30 6C 8B 04 55 3C 00 86 12 00 2C B6 90 +06 55 3E 3D 86 12 00 28 AC 90 06 30 3C 3E 86 12 +00 24 CA 90 04 30 3D 00 86 12 00 20 00 00 04 49 +46 00 1A 42 BE 21 8A 4E 00 00 A2 53 BE 21 0E 4A +30 4D 50 8F 08 54 48 45 4E 00 1A 42 BE 21 08 4E +3E 4F 09 48 29 53 0A 89 3A 90 FF 03 B3 2F 0A 11 +88 DA 00 00 30 4D C0 90 08 45 4C 53 45 00 1A 42 +BE 21 BA 40 00 3C 00 00 A2 53 BE 21 2F 83 8F 4A +00 00 E3 3F 2E 90 0A 42 45 47 49 4E 2F 83 8F 4E +00 00 1E 42 BE 21 30 4D 18 91 0A 55 4E 54 49 4C +3A 4F 08 4E 3E 4F 19 42 BE 21 2A 83 0A 89 3A 90 +00 FC 88 3B 0A 11 3A F0 FF 03 08 DA 89 48 00 00 +A2 53 BE 21 30 4D D4 8F 0A 41 47 41 49 4E 0A 4E +38 40 00 3C E7 3F 00 00 0A 57 48 49 4C 45 0D 12 +84 12 E2 90 64 84 58 85 36 91 0C 52 45 50 45 41 +54 00 0D 12 84 12 7E 91 FA 90 58 85 AE 91 3D 41 +2E 4E 08 4E 3E 4F 2A 48 B2 92 BC 21 CA 2F 98 42 +BE 21 00 00 30 4D 9A 91 06 42 57 31 85 12 AC 91 +DE 21 C8 91 06 42 57 32 85 12 AC 91 E0 21 D4 91 +06 42 57 33 85 12 AC 91 E2 21 EC 91 3D 41 1A 42 +BE 21 2E 4E 28 4E 8E 43 00 00 B2 92 BC 21 80 2B +BA 4F 00 00 A2 53 BE 21 8E 4A 00 00 3E 4F 30 4D +00 00 06 46 57 31 85 12 EA 91 E4 21 12 92 06 46 +57 32 85 12 EA 91 E8 21 1E 92 06 46 57 33 85 12 +EA 91 E8 21 88 91 08 47 4F 54 4F 00 2F 83 8F 4E +00 00 3E 40 00 3C 0D 12 84 12 16 89 14 88 58 85 +00 00 0A 3F 47 4F 54 4F 3E 90 00 30 F4 27 3E E0 +00 04 3E B0 00 10 EF 27 3E E0 00 08 EC 3F 1C 83 +2C 00 4C 8E E0 85 F0 86 6C 83 24 89 92 85 42 8E +20 8E 84 92 0A 4E 3E 4F 1A 83 F3 32 29 4E 59 0E +0A 28 08 4C 59 0A 01 28 0C 8A 08 8A 38 90 10 00 +E8 2E 5A 0E A7 3E 2A 92 E4 2E 8A 10 5A 06 A2 3E +E0 91 08 52 52 43 4D 00 85 12 6E 92 50 00 B2 92 +08 52 52 41 4D 00 85 12 6E 92 50 01 C0 92 08 52 +4C 41 4D 00 85 12 6E 92 50 02 CE 92 08 52 52 55 +4D 00 85 12 6E 92 50 03 D4 90 0A 50 55 53 48 4D +85 12 6E 92 00 15 EA 92 08 50 4F 50 4D 00 85 12 +6E 92 00 17 @FF80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF -77 00 10 00 12 00 14 00 16 00 00 00 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -CC 82 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 F0 81 +77 00 10 00 12 00 14 00 16 00 00 00 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +32 82 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 46 81 q diff --git a/binaries/LP_MSP430FR2476_16MHz_4MBds.txt b/binaries/LP_MSP430FR2476_16MHz_4MBds.txt index 03ae198..107115a 100644 --- a/binaries/LP_MSP430FR2476_16MHz_4MBds.txt +++ b/binaries/LP_MSP430FR2476_16MHz_4MBds.txt @@ -1,323 +1,323 @@ @1800 -80 3E 04 00 00 00 18 00 FD FF 90 01 10 00 A8 19 -CC 82 6A 81 70 81 44 81 2A 83 0E 93 D8 8B 96 8B -96 8B 98 82 5E 83 26 83 3C 21 E0 20 4C 85 A0 80 -AE 80 8C 84 20 00 0A 00 00 20 6A 81 70 81 44 81 -2A 83 0E 93 D8 8B 96 8B 96 8B 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 00 00 +80 3E 04 00 00 00 18 00 FD FF 91 01 10 00 90 19 +32 82 C0 80 48 80 C6 80 9A 80 90 82 04 93 16 8B +D4 8A D4 8A 00 00 FE 81 C4 82 8C 82 3C 21 E0 20 +58 85 76 83 84 83 66 84 0A 00 00 20 C0 80 48 80 +C6 80 9A 80 90 82 04 93 16 8B D4 8A D4 8A 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @8000 -2F 83 8F 4E 00 00 3E 4D 30 4D 8F 4E FE FF AF 4F -FC FF 2F 82 2F 82 8F 4E 02 00 7E 4D 8F 4D 00 00 -0D 5E 1D B3 0D 63 30 4D 0B 4E 1C 4F 02 00 2E 4F -0A 43 35 40 20 00 0E 93 04 20 05 11 0E 4C 0C 43 -09 43 0A 9B 01 28 0A 8B 09 69 08 68 15 83 07 30 -0C 5C 0E 6E 0A 6A F5 2B 0A 8B 12 D3 F5 3F 35 40 -A0 80 8F 4A 02 00 8F 49 00 00 0E 48 30 41 82 43 -BE 21 B2 4F BC 21 82 4E BA 21 3E 4F 30 4D 2F 82 -8F 4E 02 00 3E 40 54 00 BF 40 3C 21 00 00 AF 4F -FE FF 2F 83 FF 3C 0E 93 3E 4F 99 21 2D 4D 30 4D -2F 83 8F 4E 00 00 3E 41 0D 12 3D 4E 30 4D 2F 83 -8F 4E 00 00 3E 41 2E 4E 30 4D 3D 41 39 40 22 18 -B2 49 96 82 B2 49 5C 83 B2 49 24 83 B2 49 8A 80 -31 49 34 49 35 49 36 49 37 49 B2 49 B8 21 B2 49 -B6 21 B2 49 00 20 82 43 B4 21 92 12 3C 18 30 40 -96 8C 8F 93 02 00 02 20 2F 52 BF 3F 30 12 20 81 -B0 12 2A 83 92 C3 1C 05 18 42 00 18 39 40 41 00 -19 83 FE 23 18 83 FA 23 92 B3 1C 05 F3 23 30 41 -B0 12 BA 80 96 84 96 80 42 81 6C 83 14 80 04 1B -5B 37 6D 00 8E 83 8E 83 14 80 04 1B 5B 30 6D 00 -8E 83 C0 88 B2 40 81 00 00 05 92 42 02 18 06 05 -92 42 04 18 08 05 F2 D0 30 00 0A 02 92 C3 00 05 -92 D3 1A 05 92 C3 30 01 30 41 92 B3 0A 05 FD 23 -30 41 92 12 3E 18 84 12 6C 83 14 80 07 0D 0A 1B -5B 37 6D 23 8E 83 C4 85 14 80 19 46 61 73 74 46 -6F 72 74 68 20 A9 4A 2E 4D 2E 54 68 6F 6F 72 65 -6E 73 2C 20 8E 83 00 80 40 FF 46 91 9E 84 90 85 -14 80 0A 62 79 74 65 73 20 66 72 65 65 00 9C 80 -36 81 00 00 06 53 59 53 92 12 3A 18 0E 93 06 38 -02 24 1E B3 03 24 B0 12 BA 80 72 81 82 4E 08 18 -D2 B3 21 02 02 20 B2 43 08 18 B2 40 04 A5 20 01 -92 D3 04 01 B2 D0 10 00 00 01 B2 40 80 5A CC 01 -3F 40 80 20 31 40 E0 20 B2 D3 06 02 B2 40 FE FF -02 02 B2 D3 26 02 B2 40 FF 7F 22 02 B2 D3 46 02 -B2 40 FC FF 42 02 E2 D3 45 02 F2 40 A5 00 A1 01 -F2 40 10 00 A0 01 D2 43 A1 01 B2 40 00 A5 60 01 -B2 D0 10 00 86 01 F2 C3 82 01 F2 D0 0A 00 82 01 -B2 40 E8 01 84 01 39 40 5C 00 18 42 00 18 18 83 -FE 23 19 83 FA 23 39 40 00 20 29 83 89 43 00 20 -FC 23 19 42 5E 01 1E 42 08 18 82 43 08 18 3E B3 -01 20 0E 49 B0 12 BA 80 72 81 00 00 0C 41 43 43 -45 50 54 00 30 40 98 82 08 4E 2E 4F 08 5E 39 40 -0D 00 3A 40 20 00 3B 40 FE 82 3C 40 0A 83 5D 15 -92 12 40 18 12 D2 06 18 FB 3F A2 B3 1C 05 FD 27 -B2 40 13 00 0E 05 E2 D3 43 02 30 41 21 52 3A 17 -58 42 0C 05 48 9C 08 2C 48 9B EF 27 78 92 11 20 -2E 9F 0F 24 1E 83 05 3C 0E 9A 03 2C CE 48 00 00 -1E 53 A2 B3 1C 05 FD 27 C2 48 0E 05 30 4D 00 83 -2D 83 92 B3 1C 05 E4 23 FC 3F 92 B3 1C 05 FD 27 -58 42 0C 05 3E 8F 3D 41 48 4C EB 3F 00 00 06 4B -45 59 30 40 26 83 30 12 3C 83 A2 B3 1C 05 FD 27 -B2 40 11 00 0E 05 E2 C3 43 02 30 41 2F 83 8F 4E -00 00 92 B3 1C 05 FD 27 B0 12 BA 82 1E 42 0C 05 -30 4D 00 00 08 45 4D 49 54 00 30 40 5E 83 08 4E -3E 4F C7 3F 54 83 08 45 43 48 4F 00 B2 40 A2 B3 -F2 82 30 4D 00 00 0C 4E 4F 45 43 48 4F 00 B2 40 -30 4D F2 82 30 4D 00 00 08 54 59 50 45 00 0D 12 -3D 40 A4 83 39 4F 2D 83 2F 83 8F 4E 00 00 7E 49 -DC 3F A4 83 5E 83 F7 23 18 24 1E 83 0D 5B 54 48 -45 4E 5D 00 30 4D 0C 4E 38 4F 3C 9F 39 4F 3E 4F -6D 22 F9 98 00 00 6A 22 19 53 1C 83 FA 23 2D 53 -30 4D 2F 53 3E 4F 1E 83 61 22 3E 4F 3D 41 30 4D -AC 83 0D 5B 45 4C 53 45 5D 00 0D 12 84 12 00 80 -01 00 9C 80 04 84 14 80 05 0D 6B 6F 20 0A 8E 83 -84 80 6E 80 D6 85 90 88 9A 80 F6 83 0A 80 06 5B -54 48 45 4E 5D 00 B6 83 1E 84 D2 83 04 84 0A 80 -06 5B 45 4C 53 45 5D 00 B6 83 30 84 D2 83 3C 84 -14 80 04 5B 49 46 5D 00 B6 83 04 84 A2 84 9C 80 -04 84 E2 83 09 5B 49 46 5D 00 0E 93 3E 4F CD 27 -30 4D 44 84 17 5B 55 4E 44 45 46 49 4E 45 44 5D -0D 12 84 12 D6 85 42 86 6A 84 1E 83 0E 7E 3D 41 -2F 53 30 4D 54 84 13 5B 44 45 46 49 4E 45 44 5D -0D 12 84 12 D6 85 42 86 6E 84 3F 12 2F 83 8F 4E -00 00 3E 41 30 4D 2F 83 8F 4E 00 00 30 4D 3E 8F -3E E3 1E 53 30 4D 00 00 02 40 2E 4E 30 4D 8C 82 -02 21 BE 4F 00 00 3E 4F 30 4D C4 81 05 53 22 00 -2F 83 8F 4E 00 00 3E 40 22 00 0B 43 0D 12 84 12 -00 80 14 80 54 89 E4 85 DA 84 1A 53 1A B3 82 6A -C0 21 7B 3F 76 83 05 2E 22 00 0D 12 84 12 C0 84 -00 80 8E 83 54 89 4C 85 00 00 04 3C 23 00 B2 40 -B2 21 B2 21 30 4D BC 84 02 23 1B 42 B6 21 2C 4F -2F 83 B0 12 30 80 BF 4F 00 00 7A 90 0A 00 02 28 -7A 50 07 00 7A 50 30 00 92 83 B2 21 18 42 B2 21 -C8 4A 00 00 30 4D 08 85 04 23 53 00 0D 12 84 12 -0A 85 44 85 2D 83 09 DE 09 93 E1 23 3D 41 30 4D -38 85 04 23 3E 00 9F 42 B2 21 00 00 3E 40 B2 21 -2E 8F 30 4D 00 00 08 48 4F 4C 44 00 4A 4E 3E 4F -DB 3F 52 85 08 53 49 47 4E 00 0E 93 3E 4F 7A 40 -2D 00 D2 33 30 4D 86 12 20 00 66 83 04 55 2E 00 -0C 43 2F 83 8F 4E 00 00 0E 4C 1D 15 3E F3 06 34 -BF E3 00 00 3E E3 9F 53 00 00 0E 63 84 12 FE 84 -86 85 6C 85 3C 85 8C 84 7A 85 56 85 8E 83 4C 85 -E6 84 02 2E 0E 93 E4 37 3C 43 E3 3F 00 00 08 57 +00 00 02 40 2E 4E 30 4D 00 00 02 21 BE 4F 00 00 +3E 4F 30 4D 3D 41 39 40 26 18 B2 49 FC 81 B2 49 +C2 82 B2 49 8A 82 B2 49 60 83 31 49 34 49 35 49 +36 49 37 49 B2 49 B6 21 B2 49 00 20 82 43 B4 21 +92 12 40 18 30 40 94 8C B0 12 90 82 92 C3 1C 05 +18 42 00 18 39 40 41 00 19 83 FE 23 18 83 FA 23 +92 B3 1C 05 F3 23 30 41 8F 93 02 00 02 20 2F 52 +A2 3D 92 12 3E 18 B0 12 14 80 70 84 6C 83 98 80 +D2 82 30 83 04 1B 5B 37 6D 00 F4 82 F4 82 30 83 +04 1B 5B 30 6D 00 F4 82 C0 88 B2 40 81 00 00 05 +92 42 02 18 06 05 92 42 04 18 08 05 F2 D0 30 00 +0A 02 92 C3 00 05 92 D3 1A 05 92 C3 30 01 30 41 +92 B3 0A 05 FD 23 30 41 92 12 42 18 84 12 D2 82 +30 83 07 0D 0A 1B 5B 37 6D 23 F4 82 C0 85 30 83 +19 46 61 73 74 46 6F 72 74 68 20 A9 4A 2E 4D 2E +54 68 6F 6F 72 65 6E 73 2C 20 F4 82 1C 83 40 FF +3C 91 78 84 9C 85 30 83 0A 62 79 74 65 73 20 66 +72 65 65 00 72 83 8C 80 00 00 06 53 59 53 92 12 +3C 18 0E 93 06 38 02 24 1E B3 03 24 B0 12 14 80 +C8 80 82 4E 08 18 D2 B3 21 02 02 20 B2 43 08 18 +B2 40 04 A5 20 01 92 D3 04 01 B2 D0 10 00 00 01 +B2 40 80 5A CC 01 3F 40 80 20 31 40 E0 20 B2 D3 +06 02 B2 40 FE FF 02 02 B2 D3 26 02 B2 40 FF 7F +22 02 B2 D3 46 02 B2 40 FC FF 42 02 E2 D3 45 02 +F2 40 A5 00 A1 01 F2 40 10 00 A0 01 D2 43 A1 01 +B2 40 00 A5 60 01 B2 D0 10 00 86 01 F2 C3 82 01 +F2 D0 0A 00 82 01 B2 40 E8 01 84 01 39 40 5C 00 +18 42 00 18 18 83 FE 23 19 83 FA 23 39 40 00 20 +29 83 89 43 00 20 FC 23 19 42 5A 01 59 0E 09 59 +19 D2 5C 01 59 0E 59 06 59 D2 5E 01 1E 42 08 18 +82 43 08 18 3E B3 01 20 0E 49 B0 12 14 80 C8 80 +0A 80 0C 41 43 43 45 50 54 00 30 40 FE 81 08 4E +2E 4F 08 5E 39 40 0D 00 3A 40 20 00 3B 40 64 82 +3C 40 70 82 5D 15 92 12 44 18 12 D2 06 18 FB 3F +A2 B3 1C 05 FD 27 B2 40 13 00 0E 05 E2 D3 43 02 +30 41 21 52 3A 17 58 42 0C 05 48 9C 08 2C 48 9B +EF 27 78 92 11 20 2E 9F 0F 24 1E 83 05 3C 0E 9A +03 2C CE 48 00 00 1E 53 A2 B3 1C 05 FD 27 C2 48 +0E 05 30 4D 66 82 2D 83 92 B3 1C 05 E4 23 FC 3F +92 B3 1C 05 FD 27 58 42 0C 05 3E 8F 3D 41 48 4C +EB 3F 00 00 06 4B 45 59 30 40 8C 82 30 12 A2 82 +A2 B3 1C 05 FD 27 B2 40 11 00 0E 05 E2 C3 43 02 +30 41 2F 83 8F 4E 00 00 92 B3 1C 05 FD 27 B0 12 +20 82 1E 42 0C 05 30 4D 00 00 08 45 4D 49 54 00 +30 40 C4 82 08 4E 3E 4F C7 3F BA 82 08 45 43 48 +4F 00 B2 40 A2 B3 58 82 30 4D 00 00 0C 4E 4F 45 +43 48 4F 00 B2 40 30 4D 58 82 30 4D 00 00 08 54 +59 50 45 00 0D 12 3D 40 0A 83 39 4F 2D 83 2F 83 +8F 4E 00 00 7E 49 DC 3F 0A 83 5E 83 F7 23 52 24 +84 82 0D 5B 54 48 45 4E 5D 00 30 4D 2F 83 8F 4E +00 00 3E 4D 30 4D 8F 4E FE FF AF 4F FC FF 2F 82 +2F 82 8F 4E 02 00 7E 4D 8F 4D 00 00 0D 5E 1D B3 +0D 63 30 4D 82 43 BC 21 B2 4F BA 21 82 4E B8 21 +3E 4F 30 4D 2F 82 8F 4E 02 00 3E 40 54 00 BF 40 +3C 21 00 00 AF 4F FE FF 2F 83 47 3F 0E 93 3E 4F +1B 20 2D 4D 30 4D 2F 83 8F 4E 00 00 3E 41 0D 12 +3D 4E 30 4D 2F 83 8F 4E 00 00 3E 41 2E 4E 30 4D +0C 4E 38 4F 3C 9F 39 4F 3E 4F EB 23 F9 98 00 00 +E8 23 19 53 1C 83 FA 23 2D 53 30 4D 2F 53 3E 4F +1E 83 DF 23 3D 41 3E 4F 30 4D 12 83 0D 5B 45 4C +53 45 5D 00 0D 12 84 12 1C 83 01 00 72 83 DE 83 +30 83 05 0D 6B 6F 20 0A F4 82 5A 83 44 83 D6 85 +A2 88 70 83 D0 83 26 83 06 5B 54 48 45 4E 5D 00 +90 83 F8 83 AC 83 DE 83 26 83 06 5B 45 4C 53 45 +5D 00 90 83 0A 84 AC 83 16 84 30 83 04 5B 49 46 +5D 00 90 83 DE 83 7C 84 72 83 DE 83 BC 83 09 5B +49 46 5D 00 0E 93 3E 4F CD 27 30 4D 1E 84 17 5B +55 4E 44 45 46 49 4E 45 44 5D 0D 12 84 12 D6 85 +42 86 44 84 1E 83 0E 7E 3D 41 2F 53 30 4D 2E 84 +13 5B 44 45 46 49 4E 45 44 5D 0D 12 84 12 D6 85 +42 86 48 84 3F 12 2F 83 8F 4E 00 00 3E 41 30 4D +2F 83 8F 4E 00 00 30 4D 3E 8F 3E E3 1E 53 30 4D +1A 81 05 53 22 00 2F 83 8F 4E 00 00 3E 40 22 00 +0B 43 0D 12 84 12 1C 83 30 83 54 89 E4 85 A0 84 +1A 53 1A B3 82 6A BE 21 85 3F DC 82 05 2E 22 00 +0D 12 84 12 86 84 1C 83 F4 82 54 89 58 85 00 00 +04 3C 23 00 B2 40 B2 21 B2 21 30 4D 0B 4E 1C 4F +02 00 2E 4F 0A 43 35 40 20 00 0E 93 04 20 05 11 +0E 4C 0C 43 09 43 0A 9B 01 28 0A 8B 09 69 08 68 +15 83 07 30 0C 5C 0E 6E 0A 6A F5 2B 0A 8B 12 D3 +F5 3F 35 40 76 83 8F 4A 02 00 8F 49 00 00 0E 48 +30 41 82 84 02 23 1B 42 B6 21 2C 4F 2F 83 B0 12 +D4 84 BF 4F 00 00 7A 90 0A 00 02 28 7A 50 07 00 +7A 50 30 00 92 83 B2 21 18 42 B2 21 C8 4A 00 00 +30 4D 14 85 04 23 53 00 0D 12 84 12 16 85 50 85 +2D 83 09 DE 09 93 E1 23 3D 41 30 4D 44 85 04 23 +3E 00 9F 42 B2 21 00 00 3E 40 B2 21 2E 8F 30 4D +00 00 08 48 4F 4C 44 00 4A 4E 3E 4F DB 3F 5E 85 +08 53 49 47 4E 00 0E 93 3E 4F 7A 40 2D 00 D2 33 +30 4D 86 12 20 00 CC 82 04 55 2E 00 0C 43 2F 83 +8F 4E 00 00 0E 43 1D 15 84 12 C4 84 92 85 78 85 +48 85 66 84 86 85 62 85 F4 82 58 85 AC 84 02 2E +0E 93 EC 37 3E E3 1E 53 3C 43 E9 3F 00 00 08 57 4F 52 44 00 05 3C 2F 83 8F 4E 00 00 3E 40 20 00 -1B 42 B8 21 3C 40 BA 21 39 4C 38 4C 09 58 38 5C -2A 4C 08 99 1C 2C 7E 98 FC 27 18 83 F8 90 27 00 +3B 40 20 00 3C 40 B8 21 39 4C 38 4C 09 58 38 5C +2A 4C 08 99 18 2C 7E 98 FC 27 18 83 F8 90 27 00 02 00 01 20 0B 43 CA 4C 00 00 08 99 0C 24 7C 48 4E 9C 09 24 1A 53 7C 90 61 00 F5 2B 7C 90 7B 00 -F2 2F 4C 8B F0 3F 18 82 BC 21 82 48 BE 21 1E 42 -C0 21 0A 8E CE 4A 00 00 30 4D 00 00 08 46 49 4E -44 00 2F 83 0C 4E 3B 40 C6 21 3E 4B 0E 93 1E 24 +F2 2F 4C 8B F0 3F 18 82 BA 21 82 48 BC 21 1E 42 +BE 21 0A 8E CE 4A 00 00 30 4D 00 00 08 46 49 4E +44 00 2F 83 0C 4E 3B 40 C4 21 3E 4B 0E 93 1E 24 58 4C 01 00 78 F0 0F 00 08 58 0E 58 2E 53 1E 4E FE FF 0E 93 F2 27 09 4E 78 49 48 11 68 9C F7 23 0A 4C FA 99 01 00 F3 23 1A 53 58 83 FA 23 19 B3 09 63 0C 49 6E 4E 1E F3 01 20 1E 83 8F 4C 00 00 -30 4D C2 85 0E 3E 4E 55 4D 42 45 52 1B 42 B6 21 +30 4D BE 85 0E 3E 4E 55 4D 42 45 52 1B 42 B6 21 3C 4F 38 4F 29 4F 2F 82 82 4B C0 04 6A 4C 7A 80 3A 00 03 28 7A 80 07 00 12 28 7A 50 0A 00 0A 9B 22 C3 0D 2C 82 49 E0 04 82 48 E2 04 19 42 E4 04 18 42 E6 04 09 5A 08 63 1C 53 1E 83 E7 23 8F 4C -00 00 8F 48 02 00 8F 49 04 00 30 4D 32 C0 00 02 -3F 82 8F 4E 06 00 08 43 09 43 1B 42 B6 21 0C 4E -0E 43 1E 15 3D 40 4C 87 7E 4C 6A 4C 7A 80 2D 00 -16 24 CA 2F 2B 43 7A 52 14 24 3B 52 6A 53 11 24 -3B 40 10 00 5A 93 0D 24 6A 92 41 20 3E 90 03 00 -3E 20 FC 9C 01 00 6C 4C 8F 4C 04 00 38 3C B1 43 -02 00 1E 83 FC 9C 00 00 E0 23 AE 27 4E 87 2F 24 -2D 83 6A 4C 7A 90 5F 00 BF 27 32 B0 00 02 27 20 -32 D0 00 02 7A 80 2E 00 B7 27 6A 53 20 20 0A 4E -09 43 8F 49 02 00 5A 83 09 4A 09 5C 69 49 79 80 -3A 00 03 28 79 80 07 00 0C 28 79 50 0A 00 09 9B -08 2C 8F 49 00 00 0E 4B 2C 15 B0 12 28 80 2A 17 -E8 3F 9F 4F 04 00 02 00 AF 4F 04 00 4A 93 1D 17 -04 24 3F 50 06 00 0E F3 30 4D 2F 53 9F 4F 02 00 -04 00 BF 4F 00 00 3E E3 09 20 3E E3 BF E3 02 00 -BF E3 00 00 9F 53 02 00 8F 63 00 00 32 B0 00 02 -47 26 30 4D FA 84 03 5C 92 42 BA 21 BE 21 30 4D -0D 12 84 12 6E 80 D6 85 9A 80 38 88 42 86 00 88 -0A 4E 3E 4F 3D 40 1A 88 71 27 3D 40 F6 87 1A E2 +00 00 8F 48 02 00 8F 49 04 00 30 4D 3D 40 1A 88 +32 C0 00 02 3F 82 8F 4E 06 00 08 43 09 43 1B 42 +B6 21 0C 4E 0E 43 1E 15 3D 40 50 87 7E 4C 6A 4C +7A 80 2D 00 16 24 C8 2F 2B 43 7A 52 14 24 3B 52 +6A 53 11 24 3B 40 10 00 5A 93 0D 24 6A 92 41 20 +3E 90 03 00 3E 20 FC 9C 01 00 6C 4C 8F 4C 04 00 +38 3C B1 43 02 00 1E 83 FC 9C 00 00 E0 23 AC 27 +52 87 2F 24 2D 83 6A 4C 7A 90 5F 00 BD 27 32 B0 +00 02 27 20 32 D0 00 02 7A 80 2E 00 B5 27 6A 53 +20 20 0A 4E 09 43 8F 49 02 00 5A 83 09 4A 09 5C +69 49 79 80 3A 00 03 28 79 80 07 00 0C 28 79 50 +0A 00 09 9B 08 2C 8F 49 00 00 0E 4B 2C 15 B0 12 +CC 84 2A 17 E8 3F 9F 4F 04 00 02 00 AF 4F 04 00 +4A 93 1D 17 04 24 3F 50 06 00 0E F3 30 4D 2F 53 +9F 4F 02 00 04 00 BF 4F 00 00 3E E3 09 20 3E E3 +BF E3 02 00 BF E3 00 00 9F 53 02 00 8F 63 00 00 +32 B0 00 02 32 26 30 4D C0 84 03 5C 92 42 B8 21 +BC 21 30 4D 0D 12 84 12 44 83 D6 85 70 83 38 88 +42 86 04 88 0A 4E 3E 4F 71 27 3D 40 FA 87 1A E2 B4 21 A0 24 0E 12 3E 4F 30 41 1C 88 3E 4F 3D 40 -F6 87 10 20 3D 40 0E 8A DE 53 00 00 68 4E 08 5E -F8 40 3F 00 00 00 2C 3C DA 83 E6 87 0F 4C 49 54 -45 52 41 4C 82 93 B4 21 0D 24 09 4E 1A 42 C0 21 -A2 52 C0 21 BA 40 00 80 00 00 8A 49 02 00 3E 4F +FA 87 10 20 3D 40 0C 8A DE 53 00 00 68 4E 08 5E +F8 40 3F 00 00 00 35 3C B4 83 EA 87 0F 4C 49 54 +45 52 41 4C 82 93 B4 21 0D 24 09 4E 1A 42 BE 21 +A2 52 BE 21 BA 40 1C 83 00 00 8A 49 02 00 3E 4F 32 B0 00 02 32 C0 00 02 03 24 8A 4E 02 00 EE 3F 30 4D 8F 4E FE FF 3E 40 80 20 0E 8F 0E 11 2F 83 -0E 5E 0E 7E 3E E3 30 4D 74 85 0A 43 4F 55 4E 54 -2F 83 7A 4E 8F 4E 00 00 0E 4A 3E F3 30 4D 2F 83 -8F 4E 00 00 0E 43 B2 90 40 FF C0 21 EB 2F 30 4D -B0 84 0A 41 4C 4C 4F 54 82 5E C0 21 3E 4F 30 4D -3F 40 80 20 0E 43 84 12 14 80 02 0D 0A 00 8E 83 -7E 80 F0 87 72 88 14 80 0B 73 74 61 63 6B 20 65 -6D 70 74 79 F2 80 9E 88 14 80 09 4D 41 49 4E 20 -66 75 6C 6C F2 80 9C 80 C8 88 B2 88 0D 41 42 4F -52 54 22 00 0D 12 84 12 C0 84 00 80 F2 80 54 89 -4C 85 CE 85 02 27 0D 12 84 12 D6 85 42 86 96 80 -24 89 4C 85 24 88 76 84 07 5B 27 5D 0D 12 84 12 -16 89 00 80 00 80 54 89 54 89 4C 85 28 89 03 5B +0E 5E 0E 7E 3E E3 30 4D 2F 83 8F 4E 00 00 0E 43 +B2 90 40 FF BE 21 F6 2F 30 4D 80 85 0A 43 4F 55 +4E 54 2F 83 7A 4E 8F 4E 00 00 0E 4A 3E F3 30 4D +F2 81 0A 41 4C 4C 4F 54 82 5E BE 21 3E 4F 30 4D +3F 40 80 20 0E 43 84 12 30 83 02 0D 0A 00 F4 82 +54 83 F4 87 72 88 30 83 0B 73 74 61 63 6B 20 65 +6D 70 74 79 68 80 88 88 30 83 09 4D 41 49 4E 20 +66 75 6C 6C 68 80 72 83 C8 88 B2 88 0D 41 42 4F +52 54 22 00 0D 12 84 12 86 84 1C 83 68 80 54 89 +58 85 CE 85 02 27 0D 12 84 12 D6 85 42 86 6C 83 +24 89 58 85 24 88 50 84 07 5B 27 5D 0D 12 84 12 +16 89 1C 83 1C 83 54 89 54 89 58 85 28 89 03 5B 82 43 B4 21 30 4D 00 00 02 5D B2 43 B4 21 30 4D -3C 88 02 2C A2 53 C0 21 1A 42 C0 21 8A 4E FE FF -3E 4F 30 4D A8 84 11 50 4F 53 54 50 4F 4E 45 00 -0D 12 84 12 D6 85 42 86 9A 80 24 89 80 88 96 80 -8E 89 00 80 00 80 54 89 54 89 00 80 54 89 54 89 -4C 85 00 00 02 3A 30 12 E0 89 92 B3 C0 21 A2 63 -C0 21 0D 12 84 12 D6 85 AA 89 3D 41 5A D3 5A 53 -0A 5E 19 42 C4 21 08 4E FE 5E FF FF 6E 4E 3E F0 -0F 00 0E 5E 09 5E 3E 4F 82 48 D8 21 82 49 DA 21 -82 4A DC 21 82 4F DE 21 2A 52 82 4A C0 21 30 41 +3C 88 02 2C A2 53 BE 21 1A 42 BE 21 8A 4E FE FF +3E 4F 30 4D 02 80 11 50 4F 53 54 50 4F 4E 45 00 +0D 12 84 12 D6 85 42 86 70 83 24 89 80 88 6C 83 +8E 89 1C 83 1C 83 54 89 54 89 1C 83 54 89 54 89 +58 85 00 00 02 3A 30 12 E0 89 92 B3 BE 21 A2 63 +BE 21 0D 12 84 12 D6 85 AA 89 3D 41 5A D3 5A 53 +0A 5E 19 42 C2 21 08 4E FE 5E FF FF 6E 4E 3E F0 +0F 00 0E 5E 09 5E 3E 4F 82 48 D6 21 82 49 D8 21 +82 4A DA 21 82 4F DC 21 2A 52 82 4A BE 21 30 41 BA 40 0D 12 FC FF BA 40 84 12 FE FF B2 43 B4 21 -30 4D 82 9F DE 21 01 20 0B 24 84 12 14 80 0F 73 -74 61 63 6B 20 6D 69 73 6D 61 74 63 68 21 FC 80 -18 42 D8 21 19 42 DA 21 A8 49 FE FF 89 48 00 00 -30 4D 3E 89 03 3B 82 93 B4 21 DE 26 0D 12 84 12 -00 80 4C 85 54 89 F2 89 40 89 4C 85 00 00 12 49 -4D 4D 45 44 49 41 54 45 18 42 D8 21 D8 D3 00 00 -30 4D 8A 88 0C 43 52 45 41 54 45 00 B0 12 9A 89 -BA 40 86 12 FC FF 8A 4A FE FF D6 3F 88 83 0A 44 -4F 45 53 3E 1A 42 DC 21 BA 40 85 12 00 00 8A 4D -02 00 3D 41 30 4D 94 89 0E 3A 4E 4F 4E 41 4D 45 -30 12 E0 89 2F 83 8F 4E 00 00 1A 42 C0 21 1A B3 -0A 63 0E 4A 39 40 12 02 08 49 8E 3F 3E 8A 05 49 -53 00 0D 12 82 93 B4 21 08 20 84 12 16 89 C0 8A -3D 41 BE 4F 02 00 3E 4F 30 4D 84 12 2C 89 00 80 -C2 8A 54 89 4C 85 54 8A 08 43 4F 44 45 00 B0 12 -9A 89 A2 82 C0 21 92 42 C6 21 C8 21 B2 40 B8 8B -C6 21 30 4D 66 85 0E 48 44 4E 43 4F 44 45 12 12 -C4 21 B2 40 B8 8B C4 21 0D 12 84 12 DE 8A 10 8B -3D 41 B2 41 C4 21 30 4D D8 8A 0E 43 4F 44 45 4E -4E 4D 30 12 E2 8A B6 3F 00 00 0E 45 4E 44 43 4F -44 45 0B 4D 84 12 F2 89 3A 8B 0D 4B B2 40 96 8B -C6 21 82 43 C8 21 30 4D 00 00 0A 43 4F 4C 4F 4E -1A 42 C0 21 BA 40 0D 12 00 00 BA 40 84 12 02 00 -A2 52 C0 21 B2 43 B4 21 E9 3F 00 00 0A 4C 4F 32 -48 49 A2 83 C0 21 1A 42 C0 21 EF 3F F6 8A 0B 48 -49 32 4C 4F A2 53 C0 21 1A 42 C0 21 8A 4A FE FF -82 43 B4 21 A8 3F 66 89 FC 88 02 8C 1A 8B 6E 8A -8C 85 3C 86 14 89 7E 8B AE 8A 88 8A 24 8A 52 89 -4E 8C 94 86 00 00 00 00 02 93 82 91 E6 92 A2 90 -FE 90 54 91 34 92 40 92 C4 8F E8 90 00 00 00 00 -6C 8B B4 8E 00 00 5C 92 B6 8B 2B 42 BA 49 00 00 -2A 53 1B 83 FB 23 30 41 00 00 0E 52 53 54 5F 53 -45 54 39 40 C0 21 3A 40 42 18 B0 12 DA 8B 30 4D -EA 8B 0E 52 53 54 5F 52 45 54 39 40 42 18 3A 40 -C0 21 2C 49 B0 12 DA 8B 1A 42 C2 21 3B 40 10 00 -09 4A 08 49 29 83 18 48 FE FF 0C 98 FC 2B 89 48 -00 00 1B 83 F6 23 2A 4A 0A 93 F0 23 30 4D 40 8C -B2 4E 42 18 BE 12 3E 4F 3D 41 DF 3F 48 89 0C 4D -41 52 4B 45 52 00 12 12 BE 21 0D 12 84 12 D6 85 -42 86 96 80 6A 8C 96 84 14 88 6C 8C 3E 4F 3D 41 -B2 41 BE 21 B0 12 9A 89 BA 40 85 12 FC FF BA 40 -3E 8C FE FF 28 83 8A 48 00 00 BA 40 6C 80 02 00 -A2 52 C0 21 BD 3E 0E 93 B8 37 39 40 10 00 29 83 -B9 43 80 FF FC 23 B9 40 F0 81 FE FF 29 83 B9 40 -E0 81 FE FF 39 90 AE FF F9 23 39 40 10 18 B2 49 -E0 FF 3B 42 3A 40 3A 18 B0 12 DC 8B 82 43 4A 18 -9C 3F 12 12 BE 21 84 12 E0 85 42 86 96 80 02 8D -E2 8C 3C 4E 3C 80 87 12 0A 24 1C 53 02 20 2E 4E -06 3C BE 90 3E 8C 00 00 01 20 3E 52 2E 83 21 53 -30 41 EC 86 96 80 0A 8D FE 8C 0C 8D B2 41 BE 21 -30 41 92 83 BE 21 3E 40 28 00 0A 4E 3D 15 B0 12 -D2 8C 15 20 3E 40 2B 00 B0 12 D2 8C 06 20 3E 40 -2D 00 B0 12 D2 8C 92 83 BE 21 0E 12 1E 41 02 00 -84 12 E0 85 EC 86 96 80 24 89 4C 8D 3E 51 3A 17 -30 41 B0 12 12 8D 19 42 C0 21 89 4E 00 00 A2 53 -C0 21 3E 40 29 00 92 53 BE 21 1A 42 BE 21 3D 15 -84 12 E0 85 EC 86 96 80 84 8D 7C 8D 3E 90 10 00 -E6 2B 7E 2D 86 8D A2 41 BE 21 E1 3F 03 20 B0 12 -6A 8D 47 20 7A 90 23 00 23 20 B0 12 1A 8D 3C 40 -00 03 0E 93 40 24 3C 40 10 03 1E 93 3C 24 3C 40 -20 03 2E 93 38 24 3C 40 20 02 2E 92 34 24 3C 40 -30 02 3E 92 30 24 3C 40 30 03 3E 93 2C 24 3C 40 -30 00 19 42 C0 21 A2 53 C0 21 89 4E 00 00 23 3C -7A 90 26 00 05 20 3C 40 10 02 B0 12 1A 8D F1 3F -7A 90 40 00 0C 20 3C 40 20 00 B0 12 66 8D 11 20 -3C D0 10 00 3E 40 2B 00 B0 12 6A 8D 04 20 3C D0 -10 00 B0 12 52 8D 92 92 BA 21 BE 21 02 24 92 53 -BE 21 8E 10 0C 5E 3E 4F 30 4D 03 20 B0 12 6A 8D -F9 23 7A 90 26 00 03 20 3C D0 82 00 D6 3F 3C D0 -80 00 B0 12 52 8D EE 23 30 40 24 88 0C 43 1B 42 -C0 21 A2 53 C0 21 3A 40 20 00 19 42 BE 21 19 52 -BC 21 7A 99 FE 27 5A 49 FF FF 19 82 BC 21 82 49 -BE 21 7A 90 52 00 30 4D 00 00 08 52 45 54 49 00 -0D 12 84 12 00 80 00 13 54 89 4C 85 00 80 2C 00 -4C 8E 8C 8D 86 85 56 8E 2A 8E 9C 8E 3D 41 2C DE -8B 4C 00 00 C0 3F 00 00 06 4D 4F 56 85 12 8C 8E -00 40 A8 8E 0A 4D 4F 56 2E 42 85 12 8C 8E 40 40 -00 00 06 41 44 44 85 12 8C 8E 00 50 C2 8E 0A 41 -44 44 2E 42 85 12 8C 8E 40 50 CE 8E 08 41 44 44 -43 00 85 12 8C 8E 00 60 DC 8E 0C 41 44 44 43 2E -42 00 85 12 8C 8E 40 60 4A 8B 08 53 55 42 43 00 -85 12 8C 8E 00 70 FA 8E 0C 53 55 42 43 2E 42 00 -85 12 8C 8E 40 70 08 8F 06 53 55 42 85 12 8C 8E -00 80 18 8F 0A 53 55 42 2E 42 85 12 8C 8E 40 80 -24 8F 06 43 4D 50 85 12 8C 8E 00 90 32 8F 0A 43 -4D 50 2E 42 85 12 8C 8E 40 90 00 00 08 44 41 44 -44 00 85 12 8C 8E 00 A0 4C 8F 0C 44 41 44 44 2E -42 00 85 12 8C 8E 40 A0 7A 8E 06 42 49 54 85 12 -8C 8E 00 B0 6A 8F 0A 42 49 54 2E 42 85 12 8C 8E -40 B0 76 8F 06 42 49 43 85 12 8C 8E 00 C0 84 8F -0A 42 49 43 2E 42 85 12 8C 8E 40 C0 90 8F 06 42 -49 53 85 12 8C 8E 00 D0 9E 8F 0A 42 49 53 2E 42 -85 12 8C 8E 40 D0 00 00 06 58 4F 52 85 12 8C 8E -00 E0 B8 8F 0A 58 4F 52 2E 42 85 12 8C 8E 40 E0 -EA 8E 06 41 4E 44 85 12 8C 8E 00 F0 D2 8F 0A 41 -4E 44 2E 42 85 12 8C 8E 40 F0 86 85 4C 8E 8C 8D -F2 8F 0A 4C 3C F0 70 00 8A 10 3A F0 0F 00 0C DA -4D 3F AA 8F 06 52 52 43 85 12 EA 8F 00 10 04 90 -0A 52 52 43 2E 42 85 12 EA 8F 40 10 3E 8F 08 53 -57 50 42 00 85 12 EA 8F 80 10 10 90 06 52 52 41 -85 12 EA 8F 00 11 2C 90 0A 52 52 41 2E 42 85 12 -EA 8F 40 11 1E 90 06 53 58 54 85 12 EA 8F 80 11 -00 00 08 50 55 53 48 00 85 12 EA 8F 00 12 52 90 -0C 50 55 53 48 2E 42 00 85 12 EA 8F 40 12 46 90 -08 43 41 4C 4C 00 85 12 EA 8F 80 12 1A 53 0E 4A -84 12 C4 85 14 80 0D 6F 75 74 20 6F 66 20 62 6F -75 6E 64 73 FC 80 70 90 06 53 3E 3D 86 12 00 38 -98 90 04 53 3C 00 86 12 00 34 60 90 06 30 3E 3D -86 12 00 30 AC 90 04 30 3C 00 86 12 00 30 2A 8B -04 55 3C 00 86 12 00 2C C0 90 06 55 3E 3D 86 12 -00 28 B6 90 06 30 3C 3E 86 12 00 24 D4 90 04 30 -3D 00 86 12 00 20 00 00 04 49 46 00 1A 42 C0 21 -8A 4E 00 00 A2 53 C0 21 0E 4A 30 4D 5A 8F 08 54 -48 45 4E 00 1A 42 C0 21 08 4E 3E 4F 09 48 29 53 -0A 89 3A 90 FF 03 B3 2F 0A 11 88 DA 00 00 30 4D -CA 90 08 45 4C 53 45 00 1A 42 C0 21 BA 40 00 3C -00 00 A2 53 C0 21 2F 83 8F 4A 00 00 E3 3F 38 90 -0A 42 45 47 49 4E 2F 83 8F 4E 00 00 1E 42 C0 21 -30 4D 22 91 0A 55 4E 54 49 4C 3A 4F 08 4E 3E 4F -19 42 C0 21 2A 83 0A 89 3A 90 00 FC 88 3B 0A 11 -3A F0 FF 03 08 DA 89 48 00 00 A2 53 C0 21 30 4D -DE 8F 0A 41 47 41 49 4E 0A 4E 38 40 00 3C E7 3F -00 00 0A 57 48 49 4C 45 0D 12 84 12 EC 90 8A 84 -4C 85 40 91 0C 52 45 50 45 41 54 00 0D 12 84 12 -88 91 04 91 4C 85 B8 91 3D 41 2E 4E 08 4E 3E 4F -2A 48 B2 92 BE 21 CA 2F 98 42 C0 21 00 00 30 4D -A4 91 06 42 57 31 85 12 B6 91 E0 21 D2 91 06 42 -57 32 85 12 B6 91 E2 21 DE 91 06 42 57 33 85 12 -B6 91 E4 21 F6 91 3D 41 1A 42 C0 21 2E 4E 28 4E -8E 43 00 00 B2 92 BE 21 80 2B BA 4F 00 00 A2 53 -C0 21 8E 4A 00 00 3E 4F 30 4D 00 00 06 46 57 31 -85 12 F4 91 E6 21 1C 92 06 46 57 32 85 12 F4 91 -EA 21 28 92 06 46 57 33 85 12 F4 91 EA 21 92 91 -08 47 4F 54 4F 00 2F 83 8F 4E 00 00 3E 40 00 3C -0D 12 84 12 16 89 14 88 4C 85 00 00 0A 3F 47 4F -54 4F 3E 90 00 30 F4 27 3E E0 00 04 3E B0 00 10 -EF 27 3E E0 00 08 EC 3F 00 80 2C 00 56 8E E0 85 -EC 86 96 80 24 89 86 85 4C 8E 2A 8E 8E 92 0A 4E -3E 4F 1A 83 F3 32 29 4E 59 0E 0A 28 08 4C 59 0A -01 28 0C 8A 08 8A 38 90 10 00 E8 2E 5A 0E A7 3E -2A 92 E4 2E 8A 10 5A 06 A2 3E EA 91 08 52 52 43 -4D 00 85 12 78 92 50 00 BC 92 08 52 52 41 4D 00 -85 12 78 92 50 01 CA 92 08 52 4C 41 4D 00 85 12 -78 92 50 02 D8 92 08 52 52 55 4D 00 85 12 78 92 -50 03 DE 90 0A 50 55 53 48 4D 85 12 78 92 00 15 -F4 92 08 50 4F 50 4D 00 85 12 78 92 00 17 +30 4D 82 9F DC 21 0B 24 84 12 30 83 0F 73 74 61 +63 6B 20 6D 69 73 6D 61 74 63 68 21 72 80 18 42 +D6 21 19 42 D8 21 A8 49 FE FF 89 48 00 00 30 4D +3E 89 03 3B 82 93 B4 21 E1 26 0D 12 84 12 1C 83 +58 85 54 89 F2 89 40 89 58 85 00 00 12 49 4D 4D +45 44 49 41 54 45 18 42 D6 21 D8 D3 00 00 30 4D +9C 88 0C 43 52 45 41 54 45 00 B0 12 9A 89 BA 40 +86 12 FC FF 8A 4A FE FF D6 3F EE 82 0A 44 4F 45 +53 3E 1A 42 DA 21 BA 40 85 12 00 00 8A 4D 02 00 +3D 41 30 4D 94 89 0E 3A 4E 4F 4E 41 4D 45 30 12 +E0 89 2F 83 8F 4E 00 00 1A 42 BE 21 1A B3 0A 63 +0E 4A 39 40 12 02 08 49 8F 3F 3C 8A 05 49 53 00 +0D 12 82 93 B4 21 08 20 84 12 16 89 BE 8A 3D 41 +BE 4F 02 00 3E 4F 30 4D 84 12 2C 89 1C 83 C0 8A +54 89 58 85 66 89 FC 88 00 8C 5C 8B 6C 8A 98 85 +3C 86 14 89 C0 8B AC 8A 86 8A 22 8A 52 89 4C 8C +94 86 00 00 00 00 F8 92 78 91 DC 92 98 90 F4 90 +4A 91 2A 92 36 92 BA 8F DE 90 00 00 00 00 AE 8B +AA 8E 00 00 52 92 F4 8A 52 8A 08 43 4F 44 45 00 +B0 12 9A 89 A2 82 BE 21 92 42 C4 21 C6 21 B2 40 +F6 8A C4 21 30 4D 72 85 0E 48 44 4E 43 4F 44 45 +12 12 C2 21 B2 40 F6 8A C2 21 0D 12 84 12 20 8B +52 8B 3D 41 B2 41 C2 21 30 4D 1A 8B 0E 43 4F 44 +45 4E 4E 4D 30 12 24 8B 94 3F 00 00 0E 45 4E 44 +43 4F 44 45 0B 4D 84 12 F2 89 7C 8B 0D 4B B2 40 +D4 8A C4 21 82 43 C6 21 30 4D 00 00 0A 43 4F 4C +4F 4E 1A 42 BE 21 BA 40 0D 12 00 00 BA 40 84 12 +02 00 A2 52 BE 21 B2 43 B4 21 E9 3F 00 00 0A 4C +4F 32 48 49 A2 83 BE 21 1A 42 BE 21 EF 3F 38 8B +0B 48 49 32 4C 4F A2 53 BE 21 1A 42 BE 21 8A 4A +FE FF 82 43 B4 21 A8 3F 2B 42 BA 49 00 00 2A 53 +1B 83 FB 23 30 41 00 00 0E 52 53 54 5F 53 45 54 +39 40 BE 21 3A 40 46 18 B0 12 D8 8B 30 4D E8 8B +0E 52 53 54 5F 52 45 54 39 40 46 18 3A 40 BE 21 +2C 49 B0 12 D8 8B 1A 42 C0 21 3B 40 10 00 09 4A +08 49 29 83 18 48 FE FF 0C 98 FC 2B 89 48 00 00 +1B 83 F6 23 2A 4A 0A 93 F0 23 30 4D 3E 8C B2 4E +46 18 BE 12 3E 4F 3D 41 DF 3F 48 89 0C 4D 41 52 +4B 45 52 00 12 12 BC 21 0D 12 84 12 D6 85 42 86 +6C 83 68 8C 70 84 14 88 6A 8C 3E 4F 3D 41 B2 41 +BC 21 B0 12 9A 89 BA 40 85 12 FC FF BA 40 3C 8C +FE FF 28 83 8A 48 00 00 BA 40 10 85 02 00 A2 52 +BE 21 BD 3E 0E 93 B8 37 39 40 10 00 29 83 B9 43 +80 FF FC 23 B9 40 46 81 FE FF 29 83 B9 40 36 81 +FE FF 39 90 AE FF F9 23 39 40 10 18 B2 49 E0 FF +3B 40 0A 00 3A 40 3C 18 B0 12 DA 8B 9D 3F 12 12 +BC 21 84 12 E0 85 42 86 6C 83 FE 8C DE 8C 3C 4E +3C 80 87 12 0A 24 1C 53 02 20 2E 4E 06 3C BE 90 +3C 8C 00 00 01 20 3E 52 2E 83 21 53 30 41 F0 86 +6C 83 06 8D FA 8C 08 8D B2 41 BC 21 30 41 92 83 +BC 21 3E 40 28 00 0A 4E 3D 15 B0 12 CE 8C 15 20 +3E 40 2B 00 B0 12 CE 8C 06 20 3E 40 2D 00 B0 12 +CE 8C 92 83 BC 21 0E 12 1E 41 02 00 84 12 E0 85 +F0 86 6C 83 24 89 48 8D 3E 51 3A 17 30 41 B0 12 +0E 8D 19 42 BE 21 89 4E 00 00 A2 53 BE 21 3E 40 +29 00 92 53 BC 21 1A 42 BC 21 3D 15 84 12 E0 85 +F0 86 6C 83 80 8D 78 8D 3E 90 10 00 E6 2B 7B 2D +82 8D A2 41 BC 21 E1 3F 03 20 B0 12 66 8D 44 20 +7A 90 23 00 23 20 B0 12 16 8D 3C 40 00 03 0E 93 +3D 24 3C 40 10 03 1E 93 39 24 3C 40 20 03 2E 93 +35 24 3C 40 30 03 3E 93 31 24 3C 40 20 02 2E 92 +2D 24 3C 40 30 02 3E 92 29 24 3C 40 30 00 19 42 +BE 21 A2 53 BE 21 89 4E 00 00 20 3C 7A 90 26 00 +05 20 3C 40 10 02 B0 12 16 8D F1 3F 7A 90 40 00 +0A 20 3C 40 20 00 B0 12 62 8D 0E 20 3E 40 2B 00 +B0 12 66 8D 02 20 B0 12 4E 8D 3C D0 10 00 3A 40 +FF 3F 0A 9C 82 63 BC 21 8E 10 0C 5E 3E 4F 30 4D +03 20 B0 12 66 8D F9 23 7A 90 26 00 03 20 3C D0 +82 00 D9 3F 3C D0 80 00 B0 12 4E 8D EE 23 30 40 +24 88 0C 43 1B 42 BE 21 A2 53 BE 21 3A 40 20 00 +19 42 BC 21 19 52 BA 21 7A 99 FE 27 5A 49 FF FF +19 82 BA 21 82 49 BC 21 7A 90 52 00 30 4D 00 00 +08 52 45 54 49 00 0D 12 84 12 1C 83 00 13 54 89 +58 85 1C 83 2C 00 42 8E 88 8D 92 85 4C 8E 20 8E +92 8E 3D 41 2C DE 8B 4C 00 00 C0 3F 00 00 06 4D +4F 56 85 12 82 8E 00 40 9E 8E 0A 4D 4F 56 2E 42 +85 12 82 8E 40 40 00 00 06 41 44 44 85 12 82 8E +00 50 B8 8E 0A 41 44 44 2E 42 85 12 82 8E 40 50 +C4 8E 08 41 44 44 43 00 85 12 82 8E 00 60 D2 8E +0C 41 44 44 43 2E 42 00 85 12 82 8E 40 60 8C 8B +08 53 55 42 43 00 85 12 82 8E 00 70 F0 8E 0C 53 +55 42 43 2E 42 00 85 12 82 8E 40 70 FE 8E 06 53 +55 42 85 12 82 8E 00 80 0E 8F 0A 53 55 42 2E 42 +85 12 82 8E 40 80 1A 8F 06 43 4D 50 85 12 82 8E +00 90 28 8F 0A 43 4D 50 2E 42 85 12 82 8E 40 90 +00 00 08 44 41 44 44 00 85 12 82 8E 00 A0 42 8F +0C 44 41 44 44 2E 42 00 85 12 82 8E 40 A0 70 8E +06 42 49 54 85 12 82 8E 00 B0 60 8F 0A 42 49 54 +2E 42 85 12 82 8E 40 B0 6C 8F 06 42 49 43 85 12 +82 8E 00 C0 7A 8F 0A 42 49 43 2E 42 85 12 82 8E +40 C0 86 8F 06 42 49 53 85 12 82 8E 00 D0 94 8F +0A 42 49 53 2E 42 85 12 82 8E 40 D0 00 00 06 58 +4F 52 85 12 82 8E 00 E0 AE 8F 0A 58 4F 52 2E 42 +85 12 82 8E 40 E0 E0 8E 06 41 4E 44 85 12 82 8E +00 F0 C8 8F 0A 41 4E 44 2E 42 85 12 82 8E 40 F0 +92 85 42 8E 88 8D E8 8F 0A 4C 3C F0 70 00 8A 10 +3A F0 0F 00 0C DA 4D 3F A0 8F 06 52 52 43 85 12 +E0 8F 00 10 FA 8F 0A 52 52 43 2E 42 85 12 E0 8F +40 10 34 8F 08 53 57 50 42 00 85 12 E0 8F 80 10 +06 90 06 52 52 41 85 12 E0 8F 00 11 22 90 0A 52 +52 41 2E 42 85 12 E0 8F 40 11 14 90 06 53 58 54 +85 12 E0 8F 80 11 00 00 08 50 55 53 48 00 85 12 +E0 8F 00 12 48 90 0C 50 55 53 48 2E 42 00 85 12 +E0 8F 40 12 3C 90 08 43 41 4C 4C 00 85 12 E0 8F +80 12 1A 53 0E 4A 84 12 C0 85 30 83 0D 6F 75 74 +20 6F 66 20 62 6F 75 6E 64 73 72 80 66 90 06 53 +3E 3D 86 12 00 38 8E 90 04 53 3C 00 86 12 00 34 +56 90 06 30 3E 3D 86 12 00 30 A2 90 04 30 3C 00 +86 12 00 30 6C 8B 04 55 3C 00 86 12 00 2C B6 90 +06 55 3E 3D 86 12 00 28 AC 90 06 30 3C 3E 86 12 +00 24 CA 90 04 30 3D 00 86 12 00 20 00 00 04 49 +46 00 1A 42 BE 21 8A 4E 00 00 A2 53 BE 21 0E 4A +30 4D 50 8F 08 54 48 45 4E 00 1A 42 BE 21 08 4E +3E 4F 09 48 29 53 0A 89 3A 90 FF 03 B3 2F 0A 11 +88 DA 00 00 30 4D C0 90 08 45 4C 53 45 00 1A 42 +BE 21 BA 40 00 3C 00 00 A2 53 BE 21 2F 83 8F 4A +00 00 E3 3F 2E 90 0A 42 45 47 49 4E 2F 83 8F 4E +00 00 1E 42 BE 21 30 4D 18 91 0A 55 4E 54 49 4C +3A 4F 08 4E 3E 4F 19 42 BE 21 2A 83 0A 89 3A 90 +00 FC 88 3B 0A 11 3A F0 FF 03 08 DA 89 48 00 00 +A2 53 BE 21 30 4D D4 8F 0A 41 47 41 49 4E 0A 4E +38 40 00 3C E7 3F 00 00 0A 57 48 49 4C 45 0D 12 +84 12 E2 90 64 84 58 85 36 91 0C 52 45 50 45 41 +54 00 0D 12 84 12 7E 91 FA 90 58 85 AE 91 3D 41 +2E 4E 08 4E 3E 4F 2A 48 B2 92 BC 21 CA 2F 98 42 +BE 21 00 00 30 4D 9A 91 06 42 57 31 85 12 AC 91 +DE 21 C8 91 06 42 57 32 85 12 AC 91 E0 21 D4 91 +06 42 57 33 85 12 AC 91 E2 21 EC 91 3D 41 1A 42 +BE 21 2E 4E 28 4E 8E 43 00 00 B2 92 BC 21 80 2B +BA 4F 00 00 A2 53 BE 21 8E 4A 00 00 3E 4F 30 4D +00 00 06 46 57 31 85 12 EA 91 E4 21 12 92 06 46 +57 32 85 12 EA 91 E8 21 1E 92 06 46 57 33 85 12 +EA 91 E8 21 88 91 08 47 4F 54 4F 00 2F 83 8F 4E +00 00 3E 40 00 3C 0D 12 84 12 16 89 14 88 58 85 +00 00 0A 3F 47 4F 54 4F 3E 90 00 30 F4 27 3E E0 +00 04 3E B0 00 10 EF 27 3E E0 00 08 EC 3F 1C 83 +2C 00 4C 8E E0 85 F0 86 6C 83 24 89 92 85 42 8E +20 8E 84 92 0A 4E 3E 4F 1A 83 F3 32 29 4E 59 0E +0A 28 08 4C 59 0A 01 28 0C 8A 08 8A 38 90 10 00 +E8 2E 5A 0E A7 3E 2A 92 E4 2E 8A 10 5A 06 A2 3E +E0 91 08 52 52 43 4D 00 85 12 6E 92 50 00 B2 92 +08 52 52 41 4D 00 85 12 6E 92 50 01 C0 92 08 52 +4C 41 4D 00 85 12 6E 92 50 02 CE 92 08 52 52 55 +4D 00 85 12 6E 92 50 03 D4 90 0A 50 55 53 48 4D +85 12 6E 92 00 15 EA 92 08 50 4F 50 4D 00 85 12 +6E 92 00 17 @FF80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF -77 00 10 00 12 00 14 00 16 00 00 00 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -CC 82 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 F0 81 +77 00 10 00 12 00 14 00 16 00 00 00 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +32 82 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 46 81 q diff --git a/binaries/LP_MSP430FR2476_16MHz_I2C.txt b/binaries/LP_MSP430FR2476_16MHz_I2C.txt index e1820bd..afa1322 100644 --- a/binaries/LP_MSP430FR2476_16MHz_I2C.txt +++ b/binaries/LP_MSP430FR2476_16MHz_I2C.txt @@ -1,321 +1,321 @@ @1800 -80 3E 12 00 00 00 F8 00 FD FF 90 01 10 00 A8 03 -A6 82 5A 81 5A 81 34 81 30 81 F0 92 BA 8B 78 8B -78 8B 8C 82 2C 83 F8 82 3C 21 E0 20 2E 85 A0 80 -AE 80 6E 84 20 00 0A 00 00 20 5A 81 5A 81 34 81 -30 81 F0 92 BA 8B 78 8B 78 8B 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 00 00 +80 3E 12 00 00 00 F8 00 FD FF 91 01 10 00 90 03 +0C 82 B0 80 48 80 B0 80 8A 80 86 80 E6 92 F8 8A +B6 8A B6 8A 00 00 F2 81 92 82 5E 82 3C 21 E0 20 +3A 85 58 83 66 83 48 84 0A 00 00 20 B0 80 48 80 +B0 80 8A 80 86 80 E6 92 F8 8A B6 8A B6 8A 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @8000 -2F 83 8F 4E 00 00 3E 4D 30 4D 8F 4E FE FF AF 4F -FC FF 2F 82 2F 82 8F 4E 02 00 7E 4D 8F 4D 00 00 -0D 5E 1D B3 0D 63 30 4D 0B 4E 1C 4F 02 00 2E 4F -0A 43 35 40 20 00 0E 93 04 20 05 11 0E 4C 0C 43 -09 43 0A 9B 01 28 0A 8B 09 69 08 68 15 83 07 30 -0C 5C 0E 6E 0A 6A F5 2B 0A 8B 12 D3 F5 3F 35 40 -A0 80 8F 4A 02 00 8F 49 00 00 0E 48 30 41 82 43 -BE 21 B2 4F BC 21 82 4E BA 21 3E 4F 30 4D 2F 82 -8F 4E 02 00 3E 40 54 00 BF 40 3C 21 00 00 AF 4F -FE FF 2F 83 F9 3C 0E 93 3E 4F 8A 21 2D 4D 30 4D -2F 83 8F 4E 00 00 3E 41 0D 12 3D 4E 30 4D 2F 83 -8F 4E 00 00 3E 41 2E 4E 30 4D 3D 41 39 40 22 18 -B2 49 8A 82 B2 49 2A 83 B2 49 F6 82 B2 49 8A 80 -31 49 34 49 35 49 36 49 37 49 B2 49 B8 21 B2 49 -B6 21 B2 49 00 20 82 43 B4 21 92 12 3C 18 30 40 -78 8C 8F 93 02 00 02 20 2F 52 BF 3F 30 12 04 81 -78 43 FD 3C B0 12 BA 80 78 84 96 80 2E 81 44 83 -14 80 05 1B 5B 37 6D 40 70 83 00 80 02 18 8C 84 -A6 85 70 83 14 80 04 1B 5B 30 6D 00 70 83 A2 88 -48 43 E5 3C B2 D0 C0 07 80 05 18 42 02 18 08 11 -38 D0 00 04 82 48 94 05 F2 D0 0C 00 2A 02 92 C3 -80 05 A2 D2 AA 05 92 C3 30 01 30 41 92 12 3E 18 -84 12 44 83 14 80 07 0D 0A 1B 5B 37 6D 40 70 83 -00 80 02 18 8C 84 A6 85 00 80 23 00 28 83 A6 85 -14 80 19 46 61 73 74 46 6F 72 74 68 20 A9 4A 2E -4D 2E 54 68 6F 6F 72 65 6E 73 2C 20 70 83 00 80 -40 FF 28 91 80 84 72 85 14 80 0A 62 79 74 65 73 -20 66 72 65 65 00 9C 80 22 81 00 00 06 53 59 53 -92 12 3A 18 0E 93 06 38 02 24 1E B3 03 24 B0 12 -BA 80 5C 81 82 4E 08 18 D2 B3 21 02 02 20 B2 43 -08 18 B2 40 04 A5 20 01 92 D3 04 01 B2 D0 10 00 -00 01 B2 40 80 5A CC 01 31 40 E0 20 3F 40 80 20 -B2 D3 06 02 B2 40 FE FF 02 02 B2 D3 26 02 B2 40 -FF 7F 22 02 B2 D3 46 02 B2 40 FC FF 42 02 F2 40 -A5 00 A1 01 F2 40 10 00 A0 01 D2 43 A1 01 B2 40 -00 A5 60 01 B2 D0 10 00 86 01 F2 C3 82 01 F2 D0 -0A 00 82 01 B2 40 E8 01 84 01 39 40 5C 00 18 42 -00 18 18 83 FE 23 19 83 FA 23 39 40 00 20 29 83 -89 43 00 20 FC 23 19 42 5E 01 1E 42 08 18 82 43 -08 18 7E B3 01 20 0E 49 B0 12 BA 80 5C 81 00 00 -0C 41 43 43 45 50 54 00 30 40 8C 82 0A 4E 2E 4F -0A 5E 3B 40 0A 00 3C 40 20 00 3D 15 92 12 40 18 -12 D2 06 18 FB 3F 21 52 A2 C2 AC 05 B2 B0 10 00 -80 05 F4 23 3A 17 92 B3 AC 05 FD 27 58 42 8C 05 -48 9C 08 2C 48 9B 0C 24 78 92 F5 23 2E 9F F3 27 -1E 83 F1 3F 0E 9A EF 2F CE 48 00 00 1E 53 EB 3F -B2 B0 10 00 80 05 FC 27 3E 8F 08 4C 21 3C 00 00 -06 4B 45 59 30 40 F8 82 30 12 0A 83 58 43 A2 B3 -AC 05 FD 27 C2 48 8E 05 30 41 2F 83 8F 4E 00 00 -92 B3 AC 05 FD 27 1E 42 8C 05 B0 12 30 81 30 4D -00 00 08 45 4D 49 54 00 30 40 2C 83 08 4E 3E 4F -A2 B3 AC 05 FD 27 C2 48 8E 05 30 4D 22 83 08 45 -43 48 4F 00 B2 40 A2 B3 30 83 78 40 05 00 B0 12 -FE 82 30 4D 00 00 0C 4E 4F 45 43 48 4F 00 B2 40 -30 4D 30 83 68 42 F3 3F 00 00 08 54 59 50 45 00 -0D 12 3D 40 86 83 39 4F 2D 83 2F 83 8F 4E 00 00 -7E 49 D2 3F 86 83 5E 83 F7 23 18 24 F0 82 0D 5B -54 48 45 4E 5D 00 30 4D 0C 4E 38 4F 3C 9F 39 4F -3E 4F 7C 22 F9 98 00 00 79 22 19 53 1C 83 FA 23 -2D 53 30 4D 2F 53 3E 4F 1E 83 70 22 3E 4F 3D 41 -30 4D 8E 83 0D 5B 45 4C 53 45 5D 00 0D 12 84 12 -00 80 01 00 9C 80 E6 83 14 80 05 0D 6B 6F 20 0A -70 83 84 80 6E 80 B8 85 72 88 9A 80 D8 83 0A 80 -06 5B 54 48 45 4E 5D 00 98 83 00 84 B4 83 E6 83 -0A 80 06 5B 45 4C 53 45 5D 00 98 83 12 84 B4 83 -1E 84 14 80 04 5B 49 46 5D 00 98 83 E6 83 84 84 -9C 80 E6 83 C4 83 09 5B 49 46 5D 00 0E 93 3E 4F -CD 27 30 4D 26 84 17 5B 55 4E 44 45 46 49 4E 45 -44 5D 0D 12 84 12 B8 85 24 86 4C 84 1E 83 0E 7E -3D 41 2F 53 30 4D 36 84 13 5B 44 45 46 49 4E 45 -44 5D 0D 12 84 12 B8 85 24 86 50 84 3F 12 2F 83 -8F 4E 00 00 3E 41 30 4D 2F 83 8F 4E 00 00 30 4D -3E 8F 3E E3 1E 53 30 4D 00 00 02 40 2E 4E 30 4D -80 82 02 21 BE 4F 00 00 3E 4F 30 4D BC 81 05 53 -22 00 2F 83 8F 4E 00 00 3E 40 22 00 0B 43 0D 12 -84 12 00 80 14 80 36 89 C6 85 BC 84 1A 53 1A B3 -82 6A C0 21 7B 3F 56 83 05 2E 22 00 0D 12 84 12 -A2 84 00 80 70 83 36 89 2E 85 00 00 04 3C 23 00 -B2 40 B2 21 B2 21 30 4D 9E 84 02 23 1B 42 B6 21 -2C 4F 2F 83 B0 12 30 80 BF 4F 00 00 7A 90 0A 00 -02 28 7A 50 07 00 7A 50 30 00 92 83 B2 21 18 42 -B2 21 C8 4A 00 00 30 4D EA 84 04 23 53 00 0D 12 -84 12 EC 84 26 85 2D 83 09 DE 09 93 E1 23 3D 41 -30 4D 1A 85 04 23 3E 00 9F 42 B2 21 00 00 3E 40 -B2 21 2E 8F 30 4D 00 00 08 48 4F 4C 44 00 4A 4E -3E 4F DB 3F 34 85 08 53 49 47 4E 00 0E 93 3E 4F -7A 40 2D 00 D2 33 30 4D 86 12 20 00 3E 83 04 55 -2E 00 0C 43 2F 83 8F 4E 00 00 0E 4C 1D 15 3E F3 -06 34 BF E3 00 00 3E E3 9F 53 00 00 0E 63 84 12 -E0 84 68 85 4E 85 1E 85 6E 84 5C 85 38 85 70 83 -2E 85 C8 84 02 2E 0E 93 E4 37 3C 43 E3 3F 00 00 +00 00 02 40 2E 4E 30 4D 00 00 02 21 BE 4F 00 00 +3E 4F 30 4D 3D 41 39 40 26 18 B2 49 F0 81 B2 49 +90 82 B2 49 5C 82 B2 49 42 83 31 49 34 49 35 49 +36 49 37 49 B2 49 B6 21 B2 49 00 20 82 43 B4 21 +92 12 40 18 30 40 76 8C 78 43 0C 3D 8F 93 02 00 +02 20 2F 52 A1 3D 92 12 3E 18 B0 12 14 80 52 84 +4E 83 84 80 AA 82 12 83 05 1B 5B 37 6D 40 D6 82 +FE 82 02 18 04 80 A2 85 D6 82 12 83 04 1B 5B 30 +6D 00 D6 82 A2 88 48 43 ED 3C B2 D0 C0 07 80 05 +18 42 02 18 08 11 38 D0 00 04 82 48 94 05 F2 D0 +0C 00 2A 02 92 C3 80 05 A2 D2 AA 05 92 C3 30 01 +30 41 92 12 42 18 84 12 AA 82 12 83 07 0D 0A 1B +5B 37 6D 40 D6 82 FE 82 02 18 04 80 A2 85 FE 82 +23 00 8E 82 A2 85 12 83 19 46 61 73 74 46 6F 72 +74 68 20 A9 4A 2E 4D 2E 54 68 6F 6F 72 65 6E 73 +2C 20 D6 82 FE 82 40 FF 1E 91 5A 84 7E 85 12 83 +0A 62 79 74 65 73 20 66 72 65 65 00 54 83 78 80 +00 00 06 53 59 53 92 12 3C 18 0E 93 06 38 02 24 +1E B3 03 24 B0 12 14 80 B2 80 82 4E 08 18 D2 B3 +21 02 02 20 B2 43 08 18 B2 40 04 A5 20 01 92 D3 +04 01 B2 D0 10 00 00 01 B2 40 80 5A CC 01 31 40 +E0 20 3F 40 80 20 B2 D3 06 02 B2 40 FE FF 02 02 +B2 D3 26 02 B2 40 FF 7F 22 02 B2 D3 46 02 B2 40 +FC FF 42 02 F2 40 A5 00 A1 01 F2 40 10 00 A0 01 +D2 43 A1 01 B2 40 00 A5 60 01 B2 D0 10 00 86 01 +F2 C3 82 01 F2 D0 0A 00 82 01 B2 40 E8 01 84 01 +39 40 5C 00 18 42 00 18 18 83 FE 23 19 83 FA 23 +39 40 00 20 29 83 89 43 00 20 FC 23 19 42 5A 01 +59 0E 09 59 19 D2 5C 01 59 0E 59 06 59 D2 5E 01 +1E 42 08 18 82 43 08 18 7E B3 01 20 0E 49 B0 12 +14 80 B2 80 0A 80 0C 41 43 43 45 50 54 00 30 40 +F2 81 0A 4E 2E 4F 0A 5E 3B 40 0A 00 3C 40 20 00 +3D 15 92 12 44 18 12 D2 06 18 FB 3F 21 52 A2 C2 +AC 05 B2 B0 10 00 80 05 F4 23 3A 17 92 B3 AC 05 +FD 27 58 42 8C 05 48 9C 08 2C 48 9B 0C 24 78 92 +F5 23 2E 9F F3 27 1E 83 F1 3F 0E 9A EF 2F CE 48 +00 00 1E 53 EB 3F B2 B0 10 00 80 05 FC 27 3E 8F +08 4C 21 3C 00 00 06 4B 45 59 30 40 5E 82 30 12 +70 82 58 43 A2 B3 AC 05 FD 27 C2 48 8E 05 30 41 +2F 83 8F 4E 00 00 92 B3 AC 05 FD 27 1E 42 8C 05 +B0 12 86 80 30 4D 00 00 08 45 4D 49 54 00 30 40 +92 82 08 4E 3E 4F A2 B3 AC 05 FD 27 C2 48 8E 05 +30 4D 88 82 08 45 43 48 4F 00 B2 40 A2 B3 96 82 +78 40 05 00 B0 12 64 82 30 4D 00 00 0C 4E 4F 45 +43 48 4F 00 B2 40 30 4D 96 82 68 42 F3 3F 00 00 +08 54 59 50 45 00 0D 12 3D 40 EC 82 39 4F 2D 83 +2F 83 8F 4E 00 00 7E 49 D2 3F EC 82 5E 83 F7 23 +52 24 56 82 0D 5B 54 48 45 4E 5D 00 30 4D 2F 83 +8F 4E 00 00 3E 4D 30 4D 8F 4E FE FF AF 4F FC FF +2F 82 2F 82 8F 4E 02 00 7E 4D 8F 4D 00 00 0D 5E +1D B3 0D 63 30 4D 82 43 BC 21 B2 4F BA 21 82 4E +B8 21 3E 4F 30 4D 2F 82 8F 4E 02 00 3E 40 54 00 +BF 40 3C 21 00 00 AF 4F FE FF 2F 83 50 3F 0E 93 +3E 4F 1B 20 2D 4D 30 4D 2F 83 8F 4E 00 00 3E 41 +0D 12 3D 4E 30 4D 2F 83 8F 4E 00 00 3E 41 2E 4E +30 4D 0C 4E 38 4F 3C 9F 39 4F 3E 4F EB 23 F9 98 +00 00 E8 23 19 53 1C 83 FA 23 2D 53 30 4D 2F 53 +3E 4F 1E 83 DF 23 3D 41 3E 4F 30 4D F4 82 0D 5B +45 4C 53 45 5D 00 0D 12 84 12 FE 82 01 00 54 83 +C0 83 12 83 05 0D 6B 6F 20 0A D6 82 3C 83 26 83 +B8 85 84 88 52 83 B2 83 08 83 06 5B 54 48 45 4E +5D 00 72 83 DA 83 8E 83 C0 83 08 83 06 5B 45 4C +53 45 5D 00 72 83 EC 83 8E 83 F8 83 12 83 04 5B +49 46 5D 00 72 83 C0 83 5E 84 54 83 C0 83 9E 83 +09 5B 49 46 5D 00 0E 93 3E 4F CD 27 30 4D 00 84 +17 5B 55 4E 44 45 46 49 4E 45 44 5D 0D 12 84 12 +B8 85 24 86 26 84 1E 83 0E 7E 3D 41 2F 53 30 4D +10 84 13 5B 44 45 46 49 4E 45 44 5D 0D 12 84 12 +B8 85 24 86 2A 84 3F 12 2F 83 8F 4E 00 00 3E 41 +30 4D 2F 83 8F 4E 00 00 30 4D 3E 8F 3E E3 1E 53 +30 4D 12 81 05 53 22 00 2F 83 8F 4E 00 00 3E 40 +22 00 0B 43 0D 12 84 12 FE 82 12 83 36 89 C6 85 +82 84 1A 53 1A B3 82 6A BE 21 85 3F BC 82 05 2E +22 00 0D 12 84 12 68 84 FE 82 D6 82 36 89 3A 85 +00 00 04 3C 23 00 B2 40 B2 21 B2 21 30 4D 0B 4E +1C 4F 02 00 2E 4F 0A 43 35 40 20 00 0E 93 04 20 +05 11 0E 4C 0C 43 09 43 0A 9B 01 28 0A 8B 09 69 +08 68 15 83 07 30 0C 5C 0E 6E 0A 6A F5 2B 0A 8B +12 D3 F5 3F 35 40 58 83 8F 4A 02 00 8F 49 00 00 +0E 48 30 41 64 84 02 23 1B 42 B6 21 2C 4F 2F 83 +B0 12 B6 84 BF 4F 00 00 7A 90 0A 00 02 28 7A 50 +07 00 7A 50 30 00 92 83 B2 21 18 42 B2 21 C8 4A +00 00 30 4D F6 84 04 23 53 00 0D 12 84 12 F8 84 +32 85 2D 83 09 DE 09 93 E1 23 3D 41 30 4D 26 85 +04 23 3E 00 9F 42 B2 21 00 00 3E 40 B2 21 2E 8F +30 4D 00 00 08 48 4F 4C 44 00 4A 4E 3E 4F DB 3F +40 85 08 53 49 47 4E 00 0E 93 3E 4F 7A 40 2D 00 +D2 33 30 4D 86 12 20 00 A4 82 04 55 2E 00 0C 43 +2F 83 8F 4E 00 00 0E 43 1D 15 84 12 A6 84 74 85 +5A 85 2A 85 48 84 68 85 44 85 D6 82 3A 85 8E 84 +02 2E 0E 93 EC 37 3E E3 1E 53 3C 43 E9 3F 00 00 08 57 4F 52 44 00 05 3C 2F 83 8F 4E 00 00 3E 40 -20 00 1B 42 B8 21 3C 40 BA 21 39 4C 38 4C 09 58 -38 5C 2A 4C 08 99 1C 2C 7E 98 FC 27 18 83 F8 90 +20 00 3B 40 20 00 3C 40 B8 21 39 4C 38 4C 09 58 +38 5C 2A 4C 08 99 18 2C 7E 98 FC 27 18 83 F8 90 27 00 02 00 01 20 0B 43 CA 4C 00 00 08 99 0C 24 7C 48 4E 9C 09 24 1A 53 7C 90 61 00 F5 2B 7C 90 -7B 00 F2 2F 4C 8B F0 3F 18 82 BC 21 82 48 BE 21 -1E 42 C0 21 0A 8E CE 4A 00 00 30 4D 00 00 08 46 -49 4E 44 00 2F 83 0C 4E 3B 40 C6 21 3E 4B 0E 93 +7B 00 F2 2F 4C 8B F0 3F 18 82 BA 21 82 48 BC 21 +1E 42 BE 21 0A 8E CE 4A 00 00 30 4D 00 00 08 46 +49 4E 44 00 2F 83 0C 4E 3B 40 C4 21 3E 4B 0E 93 1E 24 58 4C 01 00 78 F0 0F 00 08 58 0E 58 2E 53 1E 4E FE FF 0E 93 F2 27 09 4E 78 49 48 11 68 9C F7 23 0A 4C FA 99 01 00 F3 23 1A 53 58 83 FA 23 19 B3 09 63 0C 49 6E 4E 1E F3 01 20 1E 83 8F 4C -00 00 30 4D A4 85 0E 3E 4E 55 4D 42 45 52 1B 42 +00 00 30 4D A0 85 0E 3E 4E 55 4D 42 45 52 1B 42 B6 21 3C 4F 38 4F 29 4F 2F 82 82 4B C0 04 6A 4C 7A 80 3A 00 03 28 7A 80 07 00 12 28 7A 50 0A 00 0A 9B 22 C3 0D 2C 82 49 E0 04 82 48 E2 04 19 42 E4 04 18 42 E6 04 09 5A 08 63 1C 53 1E 83 E7 23 -8F 4C 00 00 8F 48 02 00 8F 49 04 00 30 4D 32 C0 -00 02 3F 82 8F 4E 06 00 08 43 09 43 1B 42 B6 21 -0C 4E 0E 43 1E 15 3D 40 2E 87 7E 4C 6A 4C 7A 80 -2D 00 16 24 CA 2F 2B 43 7A 52 14 24 3B 52 6A 53 -11 24 3B 40 10 00 5A 93 0D 24 6A 92 41 20 3E 90 -03 00 3E 20 FC 9C 01 00 6C 4C 8F 4C 04 00 38 3C -B1 43 02 00 1E 83 FC 9C 00 00 E0 23 AE 27 30 87 -2F 24 2D 83 6A 4C 7A 90 5F 00 BF 27 32 B0 00 02 -27 20 32 D0 00 02 7A 80 2E 00 B7 27 6A 53 20 20 -0A 4E 09 43 8F 49 02 00 5A 83 09 4A 09 5C 69 49 -79 80 3A 00 03 28 79 80 07 00 0C 28 79 50 0A 00 -09 9B 08 2C 8F 49 00 00 0E 4B 2C 15 B0 12 28 80 -2A 17 E8 3F 9F 4F 04 00 02 00 AF 4F 04 00 4A 93 -1D 17 04 24 3F 50 06 00 0E F3 30 4D 2F 53 9F 4F -02 00 04 00 BF 4F 00 00 3E E3 09 20 3E E3 BF E3 -02 00 BF E3 00 00 9F 53 02 00 8F 63 00 00 32 B0 -00 02 47 26 30 4D DC 84 03 5C 92 42 BA 21 BE 21 -30 4D 0D 12 84 12 6E 80 B8 85 9A 80 1A 88 24 86 -E2 87 0A 4E 3E 4F 3D 40 FC 87 71 27 3D 40 D8 87 +8F 4C 00 00 8F 48 02 00 8F 49 04 00 30 4D 3D 40 +FC 87 32 C0 00 02 3F 82 8F 4E 06 00 08 43 09 43 +1B 42 B6 21 0C 4E 0E 43 1E 15 3D 40 32 87 7E 4C +6A 4C 7A 80 2D 00 16 24 C8 2F 2B 43 7A 52 14 24 +3B 52 6A 53 11 24 3B 40 10 00 5A 93 0D 24 6A 92 +41 20 3E 90 03 00 3E 20 FC 9C 01 00 6C 4C 8F 4C +04 00 38 3C B1 43 02 00 1E 83 FC 9C 00 00 E0 23 +AC 27 34 87 2F 24 2D 83 6A 4C 7A 90 5F 00 BD 27 +32 B0 00 02 27 20 32 D0 00 02 7A 80 2E 00 B5 27 +6A 53 20 20 0A 4E 09 43 8F 49 02 00 5A 83 09 4A +09 5C 69 49 79 80 3A 00 03 28 79 80 07 00 0C 28 +79 50 0A 00 09 9B 08 2C 8F 49 00 00 0E 4B 2C 15 +B0 12 AE 84 2A 17 E8 3F 9F 4F 04 00 02 00 AF 4F +04 00 4A 93 1D 17 04 24 3F 50 06 00 0E F3 30 4D +2F 53 9F 4F 02 00 04 00 BF 4F 00 00 3E E3 09 20 +3E E3 BF E3 02 00 BF E3 00 00 9F 53 02 00 8F 63 +00 00 32 B0 00 02 32 26 30 4D A2 84 03 5C 92 42 +B8 21 BC 21 30 4D 0D 12 84 12 26 83 B8 85 52 83 +1A 88 24 86 E6 87 0A 4E 3E 4F 71 27 3D 40 DC 87 1A E2 B4 21 A0 24 0E 12 3E 4F 30 41 FE 87 3E 4F -3D 40 D8 87 10 20 3D 40 F0 89 DE 53 00 00 68 4E -08 5E F8 40 3F 00 00 00 2C 3C BC 83 C8 87 0F 4C +3D 40 DC 87 10 20 3D 40 EE 89 DE 53 00 00 68 4E +08 5E F8 40 3F 00 00 00 35 3C 96 83 CC 87 0F 4C 49 54 45 52 41 4C 82 93 B4 21 0D 24 09 4E 1A 42 -C0 21 A2 52 C0 21 BA 40 00 80 00 00 8A 49 02 00 +BE 21 A2 52 BE 21 BA 40 FE 82 00 00 8A 49 02 00 3E 4F 32 B0 00 02 32 C0 00 02 03 24 8A 4E 02 00 EE 3F 30 4D 8F 4E FE FF 3E 40 80 20 0E 8F 0E 11 -2F 83 0E 5E 0E 7E 3E E3 30 4D 56 85 0A 43 4F 55 -4E 54 2F 83 7A 4E 8F 4E 00 00 0E 4A 3E F3 30 4D -2F 83 8F 4E 00 00 0E 43 B2 90 40 FF C0 21 EB 2F -30 4D 92 84 0A 41 4C 4C 4F 54 82 5E C0 21 3E 4F -30 4D 3F 40 80 20 0E 43 84 12 14 80 02 0D 0A 00 -70 83 7E 80 D2 87 54 88 14 80 0B 73 74 61 63 6B -20 65 6D 70 74 79 F2 80 80 88 14 80 09 4D 41 49 -4E 20 66 75 6C 6C F2 80 9C 80 AA 88 94 88 0D 41 -42 4F 52 54 22 00 0D 12 84 12 A2 84 00 80 F2 80 -36 89 2E 85 B0 85 02 27 0D 12 84 12 B8 85 24 86 -96 80 06 89 2E 85 06 88 58 84 07 5B 27 5D 0D 12 -84 12 F8 88 00 80 00 80 36 89 36 89 2E 85 0A 89 +2F 83 0E 5E 0E 7E 3E E3 30 4D 2F 83 8F 4E 00 00 +0E 43 B2 90 40 FF BE 21 F6 2F 30 4D 62 85 0A 43 +4F 55 4E 54 2F 83 7A 4E 8F 4E 00 00 0E 4A 3E F3 +30 4D E6 81 0A 41 4C 4C 4F 54 82 5E BE 21 3E 4F +30 4D 3F 40 80 20 0E 43 84 12 12 83 02 0D 0A 00 +D6 82 36 83 D6 87 54 88 12 83 0B 73 74 61 63 6B +20 65 6D 70 74 79 4C 80 6A 88 12 83 09 4D 41 49 +4E 20 66 75 6C 6C 4C 80 54 83 AA 88 94 88 0D 41 +42 4F 52 54 22 00 0D 12 84 12 68 84 FE 82 4C 80 +36 89 3A 85 B0 85 02 27 0D 12 84 12 B8 85 24 86 +4E 83 06 89 3A 85 06 88 32 84 07 5B 27 5D 0D 12 +84 12 F8 88 FE 82 FE 82 36 89 36 89 3A 85 0A 89 03 5B 82 43 B4 21 30 4D 00 00 02 5D B2 43 B4 21 -30 4D 1E 88 02 2C A2 53 C0 21 1A 42 C0 21 8A 4E -FE FF 3E 4F 30 4D 8A 84 11 50 4F 53 54 50 4F 4E -45 00 0D 12 84 12 B8 85 24 86 9A 80 06 89 62 88 -96 80 70 89 00 80 00 80 36 89 36 89 00 80 36 89 -36 89 2E 85 00 00 02 3A 30 12 C2 89 92 B3 C0 21 -A2 63 C0 21 0D 12 84 12 B8 85 8C 89 3D 41 5A D3 -5A 53 0A 5E 19 42 C4 21 08 4E FE 5E FF FF 6E 4E -3E F0 0F 00 0E 5E 09 5E 3E 4F 82 48 D8 21 82 49 -DA 21 82 4A DC 21 82 4F DE 21 2A 52 82 4A C0 21 +30 4D 1E 88 02 2C A2 53 BE 21 1A 42 BE 21 8A 4E +FE FF 3E 4F 30 4D 02 80 11 50 4F 53 54 50 4F 4E +45 00 0D 12 84 12 B8 85 24 86 52 83 06 89 62 88 +4E 83 70 89 FE 82 FE 82 36 89 36 89 FE 82 36 89 +36 89 3A 85 00 00 02 3A 30 12 C2 89 92 B3 BE 21 +A2 63 BE 21 0D 12 84 12 B8 85 8C 89 3D 41 5A D3 +5A 53 0A 5E 19 42 C2 21 08 4E FE 5E FF FF 6E 4E +3E F0 0F 00 0E 5E 09 5E 3E 4F 82 48 D6 21 82 49 +D8 21 82 4A DA 21 82 4F DC 21 2A 52 82 4A BE 21 30 41 BA 40 0D 12 FC FF BA 40 84 12 FE FF B2 43 -B4 21 30 4D 82 9F DE 21 01 20 0B 24 84 12 14 80 -0F 73 74 61 63 6B 20 6D 69 73 6D 61 74 63 68 21 -FC 80 18 42 D8 21 19 42 DA 21 A8 49 FE FF 89 48 -00 00 30 4D 20 89 03 3B 82 93 B4 21 DE 26 0D 12 -84 12 00 80 2E 85 36 89 D4 89 22 89 2E 85 00 00 -12 49 4D 4D 45 44 49 41 54 45 18 42 D8 21 D8 D3 -00 00 30 4D 6C 88 0C 43 52 45 41 54 45 00 B0 12 -7C 89 BA 40 86 12 FC FF 8A 4A FE FF D6 3F 6A 83 -0A 44 4F 45 53 3E 1A 42 DC 21 BA 40 85 12 00 00 -8A 4D 02 00 3D 41 30 4D 76 89 0E 3A 4E 4F 4E 41 -4D 45 30 12 C2 89 2F 83 8F 4E 00 00 1A 42 C0 21 -1A B3 0A 63 0E 4A 39 40 12 02 08 49 8E 3F 20 8A -05 49 53 00 0D 12 82 93 B4 21 08 20 84 12 F8 88 -A2 8A 3D 41 BE 4F 02 00 3E 4F 30 4D 84 12 0E 89 -00 80 A4 8A 36 89 2E 85 36 8A 08 43 4F 44 45 00 -B0 12 7C 89 A2 82 C0 21 92 42 C6 21 C8 21 B2 40 -9A 8B C6 21 30 4D 48 85 0E 48 44 4E 43 4F 44 45 -12 12 C4 21 B2 40 9A 8B C4 21 0D 12 84 12 C0 8A -F2 8A 3D 41 B2 41 C4 21 30 4D BA 8A 0E 43 4F 44 -45 4E 4E 4D 30 12 C4 8A B6 3F 00 00 0E 45 4E 44 -43 4F 44 45 0B 4D 84 12 D4 89 1C 8B 0D 4B B2 40 -78 8B C6 21 82 43 C8 21 30 4D 00 00 0A 43 4F 4C -4F 4E 1A 42 C0 21 BA 40 0D 12 00 00 BA 40 84 12 -02 00 A2 52 C0 21 B2 43 B4 21 E9 3F 00 00 0A 4C -4F 32 48 49 A2 83 C0 21 1A 42 C0 21 EF 3F D8 8A -0B 48 49 32 4C 4F A2 53 C0 21 1A 42 C0 21 8A 4A -FE FF 82 43 B4 21 A8 3F 48 89 DE 88 E4 8B FC 8A -50 8A 6E 85 1E 86 F6 88 60 8B 90 8A 6A 8A 06 8A -34 89 30 8C 76 86 00 00 00 00 E4 92 64 91 C8 92 -84 90 E0 90 36 91 16 92 22 92 A6 8F CA 90 00 00 -00 00 4E 8B 96 8E 00 00 3E 92 98 8B 2B 42 BA 49 -00 00 2A 53 1B 83 FB 23 30 41 00 00 0E 52 53 54 -5F 53 45 54 39 40 C0 21 3A 40 42 18 B0 12 BC 8B -30 4D CC 8B 0E 52 53 54 5F 52 45 54 39 40 42 18 -3A 40 C0 21 2C 49 B0 12 BC 8B 1A 42 C2 21 3B 40 -10 00 09 4A 08 49 29 83 18 48 FE FF 0C 98 FC 2B -89 48 00 00 1B 83 F6 23 2A 4A 0A 93 F0 23 30 4D -22 8C B2 4E 42 18 BE 12 3E 4F 3D 41 DF 3F 2A 89 -0C 4D 41 52 4B 45 52 00 12 12 BE 21 0D 12 84 12 -B8 85 24 86 96 80 4C 8C 78 84 F6 87 4E 8C 3E 4F -3D 41 B2 41 BE 21 B0 12 7C 89 BA 40 85 12 FC FF -BA 40 20 8C FE FF 28 83 8A 48 00 00 BA 40 6C 80 -02 00 A2 52 C0 21 BD 3E 0E 93 B8 37 39 40 10 00 -29 83 B9 43 80 FF FC 23 B9 40 E8 81 FE FF 29 83 -B9 40 D8 81 FE FF 39 90 AE FF F9 23 39 40 10 18 -B2 49 DA FF 3B 42 3A 40 3A 18 B0 12 BE 8B 82 43 -4A 18 9C 3F 12 12 BE 21 84 12 C2 85 24 86 96 80 -E4 8C C4 8C 3C 4E 3C 80 87 12 0A 24 1C 53 02 20 -2E 4E 06 3C BE 90 20 8C 00 00 01 20 3E 52 2E 83 -21 53 30 41 CE 86 96 80 EC 8C E0 8C EE 8C B2 41 -BE 21 30 41 92 83 BE 21 3E 40 28 00 0A 4E 3D 15 -B0 12 B4 8C 15 20 3E 40 2B 00 B0 12 B4 8C 06 20 -3E 40 2D 00 B0 12 B4 8C 92 83 BE 21 0E 12 1E 41 -02 00 84 12 C2 85 CE 86 96 80 06 89 2E 8D 3E 51 -3A 17 30 41 B0 12 F4 8C 19 42 C0 21 89 4E 00 00 -A2 53 C0 21 3E 40 29 00 92 53 BE 21 1A 42 BE 21 -3D 15 84 12 C2 85 CE 86 96 80 66 8D 5E 8D 3E 90 -10 00 E6 2B 7E 2D 68 8D A2 41 BE 21 E1 3F 03 20 -B0 12 4C 8D 47 20 7A 90 23 00 23 20 B0 12 FC 8C -3C 40 00 03 0E 93 40 24 3C 40 10 03 1E 93 3C 24 -3C 40 20 03 2E 93 38 24 3C 40 20 02 2E 92 34 24 -3C 40 30 02 3E 92 30 24 3C 40 30 03 3E 93 2C 24 -3C 40 30 00 19 42 C0 21 A2 53 C0 21 89 4E 00 00 -23 3C 7A 90 26 00 05 20 3C 40 10 02 B0 12 FC 8C -F1 3F 7A 90 40 00 0C 20 3C 40 20 00 B0 12 48 8D -11 20 3C D0 10 00 3E 40 2B 00 B0 12 4C 8D 04 20 -3C D0 10 00 B0 12 34 8D 92 92 BA 21 BE 21 02 24 -92 53 BE 21 8E 10 0C 5E 3E 4F 30 4D 03 20 B0 12 -4C 8D F9 23 7A 90 26 00 03 20 3C D0 82 00 D6 3F -3C D0 80 00 B0 12 34 8D EE 23 30 40 06 88 0C 43 -1B 42 C0 21 A2 53 C0 21 3A 40 20 00 19 42 BE 21 -19 52 BC 21 7A 99 FE 27 5A 49 FF FF 19 82 BC 21 -82 49 BE 21 7A 90 52 00 30 4D 00 00 08 52 45 54 -49 00 0D 12 84 12 00 80 00 13 36 89 2E 85 00 80 -2C 00 2E 8E 6E 8D 68 85 38 8E 0C 8E 7E 8E 3D 41 -2C DE 8B 4C 00 00 C0 3F 00 00 06 4D 4F 56 85 12 -6E 8E 00 40 8A 8E 0A 4D 4F 56 2E 42 85 12 6E 8E -40 40 00 00 06 41 44 44 85 12 6E 8E 00 50 A4 8E -0A 41 44 44 2E 42 85 12 6E 8E 40 50 B0 8E 08 41 -44 44 43 00 85 12 6E 8E 00 60 BE 8E 0C 41 44 44 -43 2E 42 00 85 12 6E 8E 40 60 2C 8B 08 53 55 42 -43 00 85 12 6E 8E 00 70 DC 8E 0C 53 55 42 43 2E -42 00 85 12 6E 8E 40 70 EA 8E 06 53 55 42 85 12 -6E 8E 00 80 FA 8E 0A 53 55 42 2E 42 85 12 6E 8E -40 80 06 8F 06 43 4D 50 85 12 6E 8E 00 90 14 8F -0A 43 4D 50 2E 42 85 12 6E 8E 40 90 00 00 08 44 -41 44 44 00 85 12 6E 8E 00 A0 2E 8F 0C 44 41 44 -44 2E 42 00 85 12 6E 8E 40 A0 5C 8E 06 42 49 54 -85 12 6E 8E 00 B0 4C 8F 0A 42 49 54 2E 42 85 12 -6E 8E 40 B0 58 8F 06 42 49 43 85 12 6E 8E 00 C0 -66 8F 0A 42 49 43 2E 42 85 12 6E 8E 40 C0 72 8F -06 42 49 53 85 12 6E 8E 00 D0 80 8F 0A 42 49 53 -2E 42 85 12 6E 8E 40 D0 00 00 06 58 4F 52 85 12 -6E 8E 00 E0 9A 8F 0A 58 4F 52 2E 42 85 12 6E 8E -40 E0 CC 8E 06 41 4E 44 85 12 6E 8E 00 F0 B4 8F -0A 41 4E 44 2E 42 85 12 6E 8E 40 F0 68 85 2E 8E -6E 8D D4 8F 0A 4C 3C F0 70 00 8A 10 3A F0 0F 00 -0C DA 4D 3F 8C 8F 06 52 52 43 85 12 CC 8F 00 10 -E6 8F 0A 52 52 43 2E 42 85 12 CC 8F 40 10 20 8F -08 53 57 50 42 00 85 12 CC 8F 80 10 F2 8F 06 52 -52 41 85 12 CC 8F 00 11 0E 90 0A 52 52 41 2E 42 -85 12 CC 8F 40 11 00 90 06 53 58 54 85 12 CC 8F -80 11 00 00 08 50 55 53 48 00 85 12 CC 8F 00 12 -34 90 0C 50 55 53 48 2E 42 00 85 12 CC 8F 40 12 -28 90 08 43 41 4C 4C 00 85 12 CC 8F 80 12 1A 53 -0E 4A 84 12 A6 85 14 80 0D 6F 75 74 20 6F 66 20 -62 6F 75 6E 64 73 FC 80 52 90 06 53 3E 3D 86 12 -00 38 7A 90 04 53 3C 00 86 12 00 34 42 90 06 30 -3E 3D 86 12 00 30 8E 90 04 30 3C 00 86 12 00 30 -0C 8B 04 55 3C 00 86 12 00 2C A2 90 06 55 3E 3D -86 12 00 28 98 90 06 30 3C 3E 86 12 00 24 B6 90 -04 30 3D 00 86 12 00 20 00 00 04 49 46 00 1A 42 -C0 21 8A 4E 00 00 A2 53 C0 21 0E 4A 30 4D 3C 8F -08 54 48 45 4E 00 1A 42 C0 21 08 4E 3E 4F 09 48 -29 53 0A 89 3A 90 FF 03 B3 2F 0A 11 88 DA 00 00 -30 4D AC 90 08 45 4C 53 45 00 1A 42 C0 21 BA 40 -00 3C 00 00 A2 53 C0 21 2F 83 8F 4A 00 00 E3 3F -1A 90 0A 42 45 47 49 4E 2F 83 8F 4E 00 00 1E 42 -C0 21 30 4D 04 91 0A 55 4E 54 49 4C 3A 4F 08 4E -3E 4F 19 42 C0 21 2A 83 0A 89 3A 90 00 FC 88 3B -0A 11 3A F0 FF 03 08 DA 89 48 00 00 A2 53 C0 21 -30 4D C0 8F 0A 41 47 41 49 4E 0A 4E 38 40 00 3C -E7 3F 00 00 0A 57 48 49 4C 45 0D 12 84 12 CE 90 -6C 84 2E 85 22 91 0C 52 45 50 45 41 54 00 0D 12 -84 12 6A 91 E6 90 2E 85 9A 91 3D 41 2E 4E 08 4E -3E 4F 2A 48 B2 92 BE 21 CA 2F 98 42 C0 21 00 00 -30 4D 86 91 06 42 57 31 85 12 98 91 E0 21 B4 91 -06 42 57 32 85 12 98 91 E2 21 C0 91 06 42 57 33 -85 12 98 91 E4 21 D8 91 3D 41 1A 42 C0 21 2E 4E -28 4E 8E 43 00 00 B2 92 BE 21 80 2B BA 4F 00 00 -A2 53 C0 21 8E 4A 00 00 3E 4F 30 4D 00 00 06 46 -57 31 85 12 D6 91 E6 21 FE 91 06 46 57 32 85 12 -D6 91 EA 21 0A 92 06 46 57 33 85 12 D6 91 EA 21 -74 91 08 47 4F 54 4F 00 2F 83 8F 4E 00 00 3E 40 -00 3C 0D 12 84 12 F8 88 F6 87 2E 85 00 00 0A 3F -47 4F 54 4F 3E 90 00 30 F4 27 3E E0 00 04 3E B0 -00 10 EF 27 3E E0 00 08 EC 3F 00 80 2C 00 38 8E -C2 85 CE 86 96 80 06 89 68 85 2E 8E 0C 8E 70 92 -0A 4E 3E 4F 1A 83 F3 32 29 4E 59 0E 0A 28 08 4C -59 0A 01 28 0C 8A 08 8A 38 90 10 00 E8 2E 5A 0E -A7 3E 2A 92 E4 2E 8A 10 5A 06 A2 3E CC 91 08 52 -52 43 4D 00 85 12 5A 92 50 00 9E 92 08 52 52 41 -4D 00 85 12 5A 92 50 01 AC 92 08 52 4C 41 4D 00 -85 12 5A 92 50 02 BA 92 08 52 52 55 4D 00 85 12 -5A 92 50 03 C0 90 0A 50 55 53 48 4D 85 12 5A 92 -00 15 D6 92 08 50 4F 50 4D 00 85 12 5A 92 00 17 +B4 21 30 4D 82 9F DC 21 0B 24 84 12 12 83 0F 73 +74 61 63 6B 20 6D 69 73 6D 61 74 63 68 21 56 80 +18 42 D6 21 19 42 D8 21 A8 49 FE FF 89 48 00 00 +30 4D 20 89 03 3B 82 93 B4 21 E1 26 0D 12 84 12 +FE 82 3A 85 36 89 D4 89 22 89 3A 85 00 00 12 49 +4D 4D 45 44 49 41 54 45 18 42 D6 21 D8 D3 00 00 +30 4D 7E 88 0C 43 52 45 41 54 45 00 B0 12 7C 89 +BA 40 86 12 FC FF 8A 4A FE FF D6 3F D0 82 0A 44 +4F 45 53 3E 1A 42 DA 21 BA 40 85 12 00 00 8A 4D +02 00 3D 41 30 4D 76 89 0E 3A 4E 4F 4E 41 4D 45 +30 12 C2 89 2F 83 8F 4E 00 00 1A 42 BE 21 1A B3 +0A 63 0E 4A 39 40 12 02 08 49 8F 3F 1E 8A 05 49 +53 00 0D 12 82 93 B4 21 08 20 84 12 F8 88 A0 8A +3D 41 BE 4F 02 00 3E 4F 30 4D 84 12 0E 89 FE 82 +A2 8A 36 89 3A 85 48 89 DE 88 E2 8B 3E 8B 4E 8A +7A 85 1E 86 F6 88 A2 8B 8E 8A 68 8A 04 8A 34 89 +2E 8C 76 86 00 00 00 00 DA 92 5A 91 BE 92 7A 90 +D6 90 2C 91 0C 92 18 92 9C 8F C0 90 00 00 00 00 +90 8B 8C 8E 00 00 34 92 D6 8A 34 8A 08 43 4F 44 +45 00 B0 12 7C 89 A2 82 BE 21 92 42 C4 21 C6 21 +B2 40 D8 8A C4 21 30 4D 54 85 0E 48 44 4E 43 4F +44 45 12 12 C2 21 B2 40 D8 8A C2 21 0D 12 84 12 +02 8B 34 8B 3D 41 B2 41 C2 21 30 4D FC 8A 0E 43 +4F 44 45 4E 4E 4D 30 12 06 8B 94 3F 00 00 0E 45 +4E 44 43 4F 44 45 0B 4D 84 12 D4 89 5E 8B 0D 4B +B2 40 B6 8A C4 21 82 43 C6 21 30 4D 00 00 0A 43 +4F 4C 4F 4E 1A 42 BE 21 BA 40 0D 12 00 00 BA 40 +84 12 02 00 A2 52 BE 21 B2 43 B4 21 E9 3F 00 00 +0A 4C 4F 32 48 49 A2 83 BE 21 1A 42 BE 21 EF 3F +1A 8B 0B 48 49 32 4C 4F A2 53 BE 21 1A 42 BE 21 +8A 4A FE FF 82 43 B4 21 A8 3F 2B 42 BA 49 00 00 +2A 53 1B 83 FB 23 30 41 00 00 0E 52 53 54 5F 53 +45 54 39 40 BE 21 3A 40 46 18 B0 12 BA 8B 30 4D +CA 8B 0E 52 53 54 5F 52 45 54 39 40 46 18 3A 40 +BE 21 2C 49 B0 12 BA 8B 1A 42 C0 21 3B 40 10 00 +09 4A 08 49 29 83 18 48 FE FF 0C 98 FC 2B 89 48 +00 00 1B 83 F6 23 2A 4A 0A 93 F0 23 30 4D 20 8C +B2 4E 46 18 BE 12 3E 4F 3D 41 DF 3F 2A 89 0C 4D +41 52 4B 45 52 00 12 12 BC 21 0D 12 84 12 B8 85 +24 86 4E 83 4A 8C 52 84 F6 87 4C 8C 3E 4F 3D 41 +B2 41 BC 21 B0 12 7C 89 BA 40 85 12 FC FF BA 40 +1E 8C FE FF 28 83 8A 48 00 00 BA 40 F2 84 02 00 +A2 52 BE 21 BD 3E 0E 93 B8 37 39 40 10 00 29 83 +B9 43 80 FF FC 23 B9 40 3E 81 FE FF 29 83 B9 40 +2E 81 FE FF 39 90 AE FF F9 23 39 40 10 18 B2 49 +DA FF 3B 40 0A 00 3A 40 3C 18 B0 12 BC 8B 9D 3F +12 12 BC 21 84 12 C2 85 24 86 4E 83 E0 8C C0 8C +3C 4E 3C 80 87 12 0A 24 1C 53 02 20 2E 4E 06 3C +BE 90 1E 8C 00 00 01 20 3E 52 2E 83 21 53 30 41 +D2 86 4E 83 E8 8C DC 8C EA 8C B2 41 BC 21 30 41 +92 83 BC 21 3E 40 28 00 0A 4E 3D 15 B0 12 B0 8C +15 20 3E 40 2B 00 B0 12 B0 8C 06 20 3E 40 2D 00 +B0 12 B0 8C 92 83 BC 21 0E 12 1E 41 02 00 84 12 +C2 85 D2 86 4E 83 06 89 2A 8D 3E 51 3A 17 30 41 +B0 12 F0 8C 19 42 BE 21 89 4E 00 00 A2 53 BE 21 +3E 40 29 00 92 53 BC 21 1A 42 BC 21 3D 15 84 12 +C2 85 D2 86 4E 83 62 8D 5A 8D 3E 90 10 00 E6 2B +7B 2D 64 8D A2 41 BC 21 E1 3F 03 20 B0 12 48 8D +44 20 7A 90 23 00 23 20 B0 12 F8 8C 3C 40 00 03 +0E 93 3D 24 3C 40 10 03 1E 93 39 24 3C 40 20 03 +2E 93 35 24 3C 40 30 03 3E 93 31 24 3C 40 20 02 +2E 92 2D 24 3C 40 30 02 3E 92 29 24 3C 40 30 00 +19 42 BE 21 A2 53 BE 21 89 4E 00 00 20 3C 7A 90 +26 00 05 20 3C 40 10 02 B0 12 F8 8C F1 3F 7A 90 +40 00 0A 20 3C 40 20 00 B0 12 44 8D 0E 20 3E 40 +2B 00 B0 12 48 8D 02 20 B0 12 30 8D 3C D0 10 00 +3A 40 FF 3F 0A 9C 82 63 BC 21 8E 10 0C 5E 3E 4F +30 4D 03 20 B0 12 48 8D F9 23 7A 90 26 00 03 20 +3C D0 82 00 D9 3F 3C D0 80 00 B0 12 30 8D EE 23 +30 40 06 88 0C 43 1B 42 BE 21 A2 53 BE 21 3A 40 +20 00 19 42 BC 21 19 52 BA 21 7A 99 FE 27 5A 49 +FF FF 19 82 BA 21 82 49 BC 21 7A 90 52 00 30 4D +00 00 08 52 45 54 49 00 0D 12 84 12 FE 82 00 13 +36 89 3A 85 FE 82 2C 00 24 8E 6A 8D 74 85 2E 8E +02 8E 74 8E 3D 41 2C DE 8B 4C 00 00 C0 3F 00 00 +06 4D 4F 56 85 12 64 8E 00 40 80 8E 0A 4D 4F 56 +2E 42 85 12 64 8E 40 40 00 00 06 41 44 44 85 12 +64 8E 00 50 9A 8E 0A 41 44 44 2E 42 85 12 64 8E +40 50 A6 8E 08 41 44 44 43 00 85 12 64 8E 00 60 +B4 8E 0C 41 44 44 43 2E 42 00 85 12 64 8E 40 60 +6E 8B 08 53 55 42 43 00 85 12 64 8E 00 70 D2 8E +0C 53 55 42 43 2E 42 00 85 12 64 8E 40 70 E0 8E +06 53 55 42 85 12 64 8E 00 80 F0 8E 0A 53 55 42 +2E 42 85 12 64 8E 40 80 FC 8E 06 43 4D 50 85 12 +64 8E 00 90 0A 8F 0A 43 4D 50 2E 42 85 12 64 8E +40 90 00 00 08 44 41 44 44 00 85 12 64 8E 00 A0 +24 8F 0C 44 41 44 44 2E 42 00 85 12 64 8E 40 A0 +52 8E 06 42 49 54 85 12 64 8E 00 B0 42 8F 0A 42 +49 54 2E 42 85 12 64 8E 40 B0 4E 8F 06 42 49 43 +85 12 64 8E 00 C0 5C 8F 0A 42 49 43 2E 42 85 12 +64 8E 40 C0 68 8F 06 42 49 53 85 12 64 8E 00 D0 +76 8F 0A 42 49 53 2E 42 85 12 64 8E 40 D0 00 00 +06 58 4F 52 85 12 64 8E 00 E0 90 8F 0A 58 4F 52 +2E 42 85 12 64 8E 40 E0 C2 8E 06 41 4E 44 85 12 +64 8E 00 F0 AA 8F 0A 41 4E 44 2E 42 85 12 64 8E +40 F0 74 85 24 8E 6A 8D CA 8F 0A 4C 3C F0 70 00 +8A 10 3A F0 0F 00 0C DA 4D 3F 82 8F 06 52 52 43 +85 12 C2 8F 00 10 DC 8F 0A 52 52 43 2E 42 85 12 +C2 8F 40 10 16 8F 08 53 57 50 42 00 85 12 C2 8F +80 10 E8 8F 06 52 52 41 85 12 C2 8F 00 11 04 90 +0A 52 52 41 2E 42 85 12 C2 8F 40 11 F6 8F 06 53 +58 54 85 12 C2 8F 80 11 00 00 08 50 55 53 48 00 +85 12 C2 8F 00 12 2A 90 0C 50 55 53 48 2E 42 00 +85 12 C2 8F 40 12 1E 90 08 43 41 4C 4C 00 85 12 +C2 8F 80 12 1A 53 0E 4A 84 12 A2 85 12 83 0D 6F +75 74 20 6F 66 20 62 6F 75 6E 64 73 56 80 48 90 +06 53 3E 3D 86 12 00 38 70 90 04 53 3C 00 86 12 +00 34 38 90 06 30 3E 3D 86 12 00 30 84 90 04 30 +3C 00 86 12 00 30 4E 8B 04 55 3C 00 86 12 00 2C +98 90 06 55 3E 3D 86 12 00 28 8E 90 06 30 3C 3E +86 12 00 24 AC 90 04 30 3D 00 86 12 00 20 00 00 +04 49 46 00 1A 42 BE 21 8A 4E 00 00 A2 53 BE 21 +0E 4A 30 4D 32 8F 08 54 48 45 4E 00 1A 42 BE 21 +08 4E 3E 4F 09 48 29 53 0A 89 3A 90 FF 03 B3 2F +0A 11 88 DA 00 00 30 4D A2 90 08 45 4C 53 45 00 +1A 42 BE 21 BA 40 00 3C 00 00 A2 53 BE 21 2F 83 +8F 4A 00 00 E3 3F 10 90 0A 42 45 47 49 4E 2F 83 +8F 4E 00 00 1E 42 BE 21 30 4D FA 90 0A 55 4E 54 +49 4C 3A 4F 08 4E 3E 4F 19 42 BE 21 2A 83 0A 89 +3A 90 00 FC 88 3B 0A 11 3A F0 FF 03 08 DA 89 48 +00 00 A2 53 BE 21 30 4D B6 8F 0A 41 47 41 49 4E +0A 4E 38 40 00 3C E7 3F 00 00 0A 57 48 49 4C 45 +0D 12 84 12 C4 90 46 84 3A 85 18 91 0C 52 45 50 +45 41 54 00 0D 12 84 12 60 91 DC 90 3A 85 90 91 +3D 41 2E 4E 08 4E 3E 4F 2A 48 B2 92 BC 21 CA 2F +98 42 BE 21 00 00 30 4D 7C 91 06 42 57 31 85 12 +8E 91 DE 21 AA 91 06 42 57 32 85 12 8E 91 E0 21 +B6 91 06 42 57 33 85 12 8E 91 E2 21 CE 91 3D 41 +1A 42 BE 21 2E 4E 28 4E 8E 43 00 00 B2 92 BC 21 +80 2B BA 4F 00 00 A2 53 BE 21 8E 4A 00 00 3E 4F +30 4D 00 00 06 46 57 31 85 12 CC 91 E4 21 F4 91 +06 46 57 32 85 12 CC 91 E8 21 00 92 06 46 57 33 +85 12 CC 91 E8 21 6A 91 08 47 4F 54 4F 00 2F 83 +8F 4E 00 00 3E 40 00 3C 0D 12 84 12 F8 88 F6 87 +3A 85 00 00 0A 3F 47 4F 54 4F 3E 90 00 30 F4 27 +3E E0 00 04 3E B0 00 10 EF 27 3E E0 00 08 EC 3F +FE 82 2C 00 2E 8E C2 85 D2 86 4E 83 06 89 74 85 +24 8E 02 8E 66 92 0A 4E 3E 4F 1A 83 F3 32 29 4E +59 0E 0A 28 08 4C 59 0A 01 28 0C 8A 08 8A 38 90 +10 00 E8 2E 5A 0E A7 3E 2A 92 E4 2E 8A 10 5A 06 +A2 3E C2 91 08 52 52 43 4D 00 85 12 50 92 50 00 +94 92 08 52 52 41 4D 00 85 12 50 92 50 01 A2 92 +08 52 4C 41 4D 00 85 12 50 92 50 02 B0 92 08 52 +52 55 4D 00 85 12 50 92 50 03 B6 90 0A 50 55 53 +48 4D 85 12 50 92 00 15 CC 92 08 50 4F 50 4D 00 +85 12 50 92 00 17 @FF80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF -77 00 10 00 12 00 14 00 16 00 00 00 D8 81 D8 81 -D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 -D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 -D8 81 D8 81 D8 81 D8 81 D8 81 A6 82 D8 81 D8 81 -D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 -D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 E8 81 +77 00 10 00 12 00 14 00 16 00 00 00 2E 81 2E 81 +2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 +2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 +2E 81 2E 81 2E 81 2E 81 2E 81 0C 82 2E 81 2E 81 +2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 +2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 3E 81 q diff --git a/binaries/LP_MSP430FR2476_1MHz_115200.txt b/binaries/LP_MSP430FR2476_1MHz_115200.txt index 0468738..095f860 100644 --- a/binaries/LP_MSP430FR2476_1MHz_115200.txt +++ b/binaries/LP_MSP430FR2476_1MHz_115200.txt @@ -1,322 +1,321 @@ @1800 -E8 03 08 00 00 D6 18 00 FD FF 90 01 10 00 A8 19 -B6 82 6A 81 70 81 44 81 14 83 F8 92 C2 8B 80 8B -80 8B 82 82 48 83 10 83 3C 21 E0 20 36 85 A0 80 -AE 80 76 84 20 00 0A 00 00 20 6A 81 70 81 44 81 -14 83 F8 92 C2 8B 80 8B 80 8B 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 00 00 +E8 03 08 00 00 D6 18 00 FD FF 91 01 10 00 90 19 +1C 82 C0 80 48 80 C6 80 9A 80 7A 82 EE 92 00 8B +BE 8A BE 8A 00 00 E8 81 AE 82 76 82 3C 21 E0 20 +42 85 60 83 6E 83 50 84 0A 00 00 20 C0 80 48 80 +C6 80 9A 80 7A 82 EE 92 00 8B BE 8A BE 8A 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @8000 -2F 83 8F 4E 00 00 3E 4D 30 4D 8F 4E FE FF AF 4F -FC FF 2F 82 2F 82 8F 4E 02 00 7E 4D 8F 4D 00 00 -0D 5E 1D B3 0D 63 30 4D 0B 4E 1C 4F 02 00 2E 4F -0A 43 35 40 20 00 0E 93 04 20 05 11 0E 4C 0C 43 -09 43 0A 9B 01 28 0A 8B 09 69 08 68 15 83 07 30 -0C 5C 0E 6E 0A 6A F5 2B 0A 8B 12 D3 F5 3F 35 40 -A0 80 8F 4A 02 00 8F 49 00 00 0E 48 30 41 82 43 -BE 21 B2 4F BC 21 82 4E BA 21 3E 4F 30 4D 2F 82 +00 00 02 40 2E 4E 30 4D 00 00 02 21 BE 4F 00 00 +3E 4F 30 4D 3D 41 39 40 26 18 B2 49 E6 81 B2 49 +AC 82 B2 49 74 82 B2 49 4A 83 31 49 34 49 35 49 +36 49 37 49 B2 49 B6 21 B2 49 00 20 82 43 B4 21 +92 12 40 18 30 40 7E 8C B0 12 7A 82 92 C3 1C 05 +18 42 00 18 39 40 41 00 19 83 FE 23 18 83 FA 23 +92 B3 1C 05 F3 23 30 41 8F 93 02 00 02 20 2F 52 +97 3D 92 12 3E 18 B0 12 14 80 5A 84 56 83 98 80 +BC 82 1A 83 04 1B 5B 37 6D 00 DE 82 DE 82 1A 83 +04 1B 5B 30 6D 00 DE 82 AA 88 B2 40 81 00 00 05 +92 42 02 18 06 05 92 42 04 18 08 05 F2 D0 30 00 +0A 02 92 C3 00 05 92 D3 1A 05 92 C3 30 01 30 41 +92 B3 0A 05 FD 23 30 41 92 12 42 18 84 12 BC 82 +1A 83 07 0D 0A 1B 5B 37 6D 23 DE 82 AA 85 1A 83 +19 46 61 73 74 46 6F 72 74 68 20 A9 4A 2E 4D 2E +54 68 6F 6F 72 65 6E 73 2C 20 DE 82 06 83 40 FF +26 91 62 84 86 85 1A 83 0A 62 79 74 65 73 20 66 +72 65 65 00 5C 83 8C 80 00 00 06 53 59 53 92 12 +3C 18 0E 93 06 38 02 24 1E B3 03 24 B0 12 14 80 +C8 80 82 4E 08 18 D2 B3 21 02 02 20 B2 43 08 18 +B2 40 04 A5 20 01 92 D3 04 01 B2 D0 10 00 00 01 +B2 40 80 5A CC 01 3F 40 80 20 31 40 E0 20 B2 D3 +06 02 B2 40 FE FF 02 02 B2 D3 26 02 B2 40 FF 7F +22 02 B2 D3 46 02 B2 40 FC FF 42 02 E2 D3 45 02 +B2 40 00 A5 60 01 B2 D0 10 00 86 01 F2 C3 82 01 +B2 40 1E 00 84 01 39 40 5C 00 18 42 00 18 18 83 +FE 23 19 83 FA 23 39 40 00 20 29 83 89 43 00 20 +FC 23 19 42 5A 01 59 0E 09 59 19 D2 5C 01 59 0E +59 06 59 D2 5E 01 1E 42 08 18 82 43 08 18 3E B3 +01 20 0E 49 B0 12 14 80 C8 80 0A 80 0C 41 43 43 +45 50 54 00 30 40 E8 81 08 4E 2E 4F 08 5E 39 40 +0D 00 3A 40 20 00 3B 40 4E 82 3C 40 5A 82 5D 15 +92 12 44 18 12 D2 06 18 FB 3F A2 B3 1C 05 FD 27 +B2 40 13 00 0E 05 E2 D3 43 02 30 41 21 52 3A 17 +58 42 0C 05 48 9C 08 2C 48 9B EF 27 78 92 11 20 +2E 9F 0F 24 1E 83 05 3C 0E 9A 03 2C CE 48 00 00 +1E 53 A2 B3 1C 05 FD 27 C2 48 0E 05 30 4D 50 82 +2D 83 92 B3 1C 05 E4 23 FC 3F 92 B3 1C 05 FD 27 +58 42 0C 05 3E 8F 3D 41 48 4C EB 3F 00 00 06 4B +45 59 30 40 76 82 30 12 8C 82 A2 B3 1C 05 FD 27 +B2 40 11 00 0E 05 E2 C3 43 02 30 41 2F 83 8F 4E +00 00 92 B3 1C 05 FD 27 B0 12 0A 82 1E 42 0C 05 +30 4D 00 00 08 45 4D 49 54 00 30 40 AE 82 08 4E +3E 4F C7 3F A4 82 08 45 43 48 4F 00 B2 40 A2 B3 +42 82 30 4D 00 00 0C 4E 4F 45 43 48 4F 00 B2 40 +30 4D 42 82 30 4D 00 00 08 54 59 50 45 00 0D 12 +3D 40 F4 82 39 4F 2D 83 2F 83 8F 4E 00 00 7E 49 +DC 3F F4 82 5E 83 F7 23 52 24 6E 82 0D 5B 54 48 +45 4E 5D 00 30 4D 2F 83 8F 4E 00 00 3E 4D 30 4D +8F 4E FE FF AF 4F FC FF 2F 82 2F 82 8F 4E 02 00 +7E 4D 8F 4D 00 00 0D 5E 1D B3 0D 63 30 4D 82 43 +BC 21 B2 4F BA 21 82 4E B8 21 3E 4F 30 4D 2F 82 8F 4E 02 00 3E 40 54 00 BF 40 3C 21 00 00 AF 4F -FE FF 2F 83 F4 3C 0E 93 3E 4F 8E 21 2D 4D 30 4D +FE FF 2F 83 47 3F 0E 93 3E 4F 1B 20 2D 4D 30 4D 2F 83 8F 4E 00 00 3E 41 0D 12 3D 4E 30 4D 2F 83 -8F 4E 00 00 3E 41 2E 4E 30 4D 3D 41 39 40 22 18 -B2 49 80 82 B2 49 46 83 B2 49 0E 83 B2 49 8A 80 -31 49 34 49 35 49 36 49 37 49 B2 49 B8 21 B2 49 -B6 21 B2 49 00 20 82 43 B4 21 92 12 3C 18 30 40 -80 8C 8F 93 02 00 02 20 2F 52 BF 3F 30 12 20 81 -B0 12 14 83 92 C3 1C 05 18 42 00 18 39 40 41 00 -19 83 FE 23 18 83 FA 23 92 B3 1C 05 F3 23 30 41 -B0 12 BA 80 80 84 96 80 42 81 56 83 14 80 04 1B -5B 37 6D 00 78 83 78 83 14 80 04 1B 5B 30 6D 00 -78 83 AA 88 B2 40 81 00 00 05 92 42 02 18 06 05 -92 42 04 18 08 05 F2 D0 30 00 0A 02 92 C3 00 05 -92 D3 1A 05 92 C3 30 01 30 41 92 B3 0A 05 FD 23 -30 41 92 12 3E 18 84 12 56 83 14 80 07 0D 0A 1B -5B 37 6D 23 78 83 AE 85 14 80 19 46 61 73 74 46 -6F 72 74 68 20 A9 4A 2E 4D 2E 54 68 6F 6F 72 65 -6E 73 2C 20 78 83 00 80 40 FF 30 91 88 84 7A 85 -14 80 0A 62 79 74 65 73 20 66 72 65 65 00 9C 80 -36 81 00 00 06 53 59 53 92 12 3A 18 0E 93 06 38 -02 24 1E B3 03 24 B0 12 BA 80 72 81 82 4E 08 18 -D2 B3 21 02 02 20 B2 43 08 18 B2 40 04 A5 20 01 -92 D3 04 01 B2 D0 10 00 00 01 B2 40 80 5A CC 01 -3F 40 80 20 31 40 E0 20 B2 D3 06 02 B2 40 FE FF -02 02 B2 D3 26 02 B2 40 FF 7F 22 02 B2 D3 46 02 -B2 40 FC FF 42 02 E2 D3 45 02 B2 40 00 A5 60 01 -B2 D0 10 00 86 01 F2 C3 82 01 B2 40 1E 00 84 01 -39 40 5C 00 18 42 00 18 18 83 FE 23 19 83 FA 23 -39 40 00 20 29 83 89 43 00 20 FC 23 19 42 5E 01 -1E 42 08 18 82 43 08 18 3E B3 01 20 0E 49 B0 12 -BA 80 72 81 00 00 0C 41 43 43 45 50 54 00 30 40 -82 82 08 4E 2E 4F 08 5E 39 40 0D 00 3A 40 20 00 -3B 40 E8 82 3C 40 F4 82 5D 15 92 12 40 18 12 D2 -06 18 FB 3F A2 B3 1C 05 FD 27 B2 40 13 00 0E 05 -E2 D3 43 02 30 41 21 52 3A 17 58 42 0C 05 48 9C -08 2C 48 9B EF 27 78 92 11 20 2E 9F 0F 24 1E 83 -05 3C 0E 9A 03 2C CE 48 00 00 1E 53 A2 B3 1C 05 -FD 27 C2 48 0E 05 30 4D EA 82 2D 83 92 B3 1C 05 -E4 23 FC 3F 92 B3 1C 05 FD 27 58 42 0C 05 3E 8F -3D 41 48 4C EB 3F 00 00 06 4B 45 59 30 40 10 83 -30 12 26 83 A2 B3 1C 05 FD 27 B2 40 11 00 0E 05 -E2 C3 43 02 30 41 2F 83 8F 4E 00 00 92 B3 1C 05 -FD 27 B0 12 A4 82 1E 42 0C 05 30 4D 00 00 08 45 -4D 49 54 00 30 40 48 83 08 4E 3E 4F C7 3F 3E 83 -08 45 43 48 4F 00 B2 40 A2 B3 DC 82 30 4D 00 00 -0C 4E 4F 45 43 48 4F 00 B2 40 30 4D DC 82 30 4D -00 00 08 54 59 50 45 00 0D 12 3D 40 8E 83 39 4F -2D 83 2F 83 8F 4E 00 00 7E 49 DC 3F 8E 83 5E 83 -F7 23 18 24 08 83 0D 5B 54 48 45 4E 5D 00 30 4D -0C 4E 38 4F 3C 9F 39 4F 3E 4F 78 22 F9 98 00 00 -75 22 19 53 1C 83 FA 23 2D 53 30 4D 2F 53 3E 4F -1E 83 6C 22 3E 4F 3D 41 30 4D 96 83 0D 5B 45 4C -53 45 5D 00 0D 12 84 12 00 80 01 00 9C 80 EE 83 -14 80 05 0D 6B 6F 20 0A 78 83 84 80 6E 80 C0 85 -7A 88 9A 80 E0 83 0A 80 06 5B 54 48 45 4E 5D 00 -A0 83 08 84 BC 83 EE 83 0A 80 06 5B 45 4C 53 45 -5D 00 A0 83 1A 84 BC 83 26 84 14 80 04 5B 49 46 -5D 00 A0 83 EE 83 8C 84 9C 80 EE 83 CC 83 09 5B -49 46 5D 00 0E 93 3E 4F CD 27 30 4D 2E 84 17 5B -55 4E 44 45 46 49 4E 45 44 5D 0D 12 84 12 C0 85 -2C 86 54 84 1E 83 0E 7E 3D 41 2F 53 30 4D 3E 84 -13 5B 44 45 46 49 4E 45 44 5D 0D 12 84 12 C0 85 -2C 86 58 84 3F 12 2F 83 8F 4E 00 00 3E 41 30 4D -2F 83 8F 4E 00 00 30 4D 3E 8F 3E E3 1E 53 30 4D -00 00 02 40 2E 4E 30 4D 76 82 02 21 BE 4F 00 00 -3E 4F 30 4D C4 81 05 53 22 00 2F 83 8F 4E 00 00 -3E 40 22 00 0B 43 0D 12 84 12 00 80 14 80 3E 89 -CE 85 C4 84 1A 53 1A B3 82 6A C0 21 7B 3F 60 83 -05 2E 22 00 0D 12 84 12 AA 84 00 80 78 83 3E 89 -36 85 00 00 04 3C 23 00 B2 40 B2 21 B2 21 30 4D -A6 84 02 23 1B 42 B6 21 2C 4F 2F 83 B0 12 30 80 -BF 4F 00 00 7A 90 0A 00 02 28 7A 50 07 00 7A 50 -30 00 92 83 B2 21 18 42 B2 21 C8 4A 00 00 30 4D -F2 84 04 23 53 00 0D 12 84 12 F4 84 2E 85 2D 83 -09 DE 09 93 E1 23 3D 41 30 4D 22 85 04 23 3E 00 -9F 42 B2 21 00 00 3E 40 B2 21 2E 8F 30 4D 00 00 -08 48 4F 4C 44 00 4A 4E 3E 4F DB 3F 3C 85 08 53 -49 47 4E 00 0E 93 3E 4F 7A 40 2D 00 D2 33 30 4D -86 12 20 00 50 83 04 55 2E 00 0C 43 2F 83 8F 4E -00 00 0E 4C 1D 15 3E F3 06 34 BF E3 00 00 3E E3 -9F 53 00 00 0E 63 84 12 E8 84 70 85 56 85 26 85 -76 84 64 85 40 85 78 83 36 85 D0 84 02 2E 0E 93 -E4 37 3C 43 E3 3F 00 00 08 57 4F 52 44 00 05 3C -2F 83 8F 4E 00 00 3E 40 20 00 1B 42 B8 21 3C 40 -BA 21 39 4C 38 4C 09 58 38 5C 2A 4C 08 99 1C 2C +8F 4E 00 00 3E 41 2E 4E 30 4D 0C 4E 38 4F 3C 9F +39 4F 3E 4F EB 23 F9 98 00 00 E8 23 19 53 1C 83 +FA 23 2D 53 30 4D 2F 53 3E 4F 1E 83 DF 23 3D 41 +3E 4F 30 4D FC 82 0D 5B 45 4C 53 45 5D 00 0D 12 +84 12 06 83 01 00 5C 83 C8 83 1A 83 05 0D 6B 6F +20 0A DE 82 44 83 2E 83 C0 85 8C 88 5A 83 BA 83 +10 83 06 5B 54 48 45 4E 5D 00 7A 83 E2 83 96 83 +C8 83 10 83 06 5B 45 4C 53 45 5D 00 7A 83 F4 83 +96 83 00 84 1A 83 04 5B 49 46 5D 00 7A 83 C8 83 +66 84 5C 83 C8 83 A6 83 09 5B 49 46 5D 00 0E 93 +3E 4F CD 27 30 4D 08 84 17 5B 55 4E 44 45 46 49 +4E 45 44 5D 0D 12 84 12 C0 85 2C 86 2E 84 1E 83 +0E 7E 3D 41 2F 53 30 4D 18 84 13 5B 44 45 46 49 +4E 45 44 5D 0D 12 84 12 C0 85 2C 86 32 84 3F 12 +2F 83 8F 4E 00 00 3E 41 30 4D 2F 83 8F 4E 00 00 +30 4D 3E 8F 3E E3 1E 53 30 4D 1A 81 05 53 22 00 +2F 83 8F 4E 00 00 3E 40 22 00 0B 43 0D 12 84 12 +06 83 1A 83 3E 89 CE 85 8A 84 1A 53 1A B3 82 6A +BE 21 85 3F C6 82 05 2E 22 00 0D 12 84 12 70 84 +06 83 DE 82 3E 89 42 85 00 00 04 3C 23 00 B2 40 +B2 21 B2 21 30 4D 0B 4E 1C 4F 02 00 2E 4F 0A 43 +35 40 20 00 0E 93 04 20 05 11 0E 4C 0C 43 09 43 +0A 9B 01 28 0A 8B 09 69 08 68 15 83 07 30 0C 5C +0E 6E 0A 6A F5 2B 0A 8B 12 D3 F5 3F 35 40 60 83 +8F 4A 02 00 8F 49 00 00 0E 48 30 41 6C 84 02 23 +1B 42 B6 21 2C 4F 2F 83 B0 12 BE 84 BF 4F 00 00 +7A 90 0A 00 02 28 7A 50 07 00 7A 50 30 00 92 83 +B2 21 18 42 B2 21 C8 4A 00 00 30 4D FE 84 04 23 +53 00 0D 12 84 12 00 85 3A 85 2D 83 09 DE 09 93 +E1 23 3D 41 30 4D 2E 85 04 23 3E 00 9F 42 B2 21 +00 00 3E 40 B2 21 2E 8F 30 4D 00 00 08 48 4F 4C +44 00 4A 4E 3E 4F DB 3F 48 85 08 53 49 47 4E 00 +0E 93 3E 4F 7A 40 2D 00 D2 33 30 4D 86 12 20 00 +B6 82 04 55 2E 00 0C 43 2F 83 8F 4E 00 00 0E 43 +1D 15 84 12 AE 84 7C 85 62 85 32 85 50 84 70 85 +4C 85 DE 82 42 85 96 84 02 2E 0E 93 EC 37 3E E3 +1E 53 3C 43 E9 3F 00 00 08 57 4F 52 44 00 05 3C +2F 83 8F 4E 00 00 3E 40 20 00 3B 40 20 00 3C 40 +B8 21 39 4C 38 4C 09 58 38 5C 2A 4C 08 99 18 2C 7E 98 FC 27 18 83 F8 90 27 00 02 00 01 20 0B 43 CA 4C 00 00 08 99 0C 24 7C 48 4E 9C 09 24 1A 53 7C 90 61 00 F5 2B 7C 90 7B 00 F2 2F 4C 8B F0 3F -18 82 BC 21 82 48 BE 21 1E 42 C0 21 0A 8E CE 4A +18 82 BA 21 82 48 BC 21 1E 42 BE 21 0A 8E CE 4A 00 00 30 4D 00 00 08 46 49 4E 44 00 2F 83 0C 4E -3B 40 C6 21 3E 4B 0E 93 1E 24 58 4C 01 00 78 F0 +3B 40 C4 21 3E 4B 0E 93 1E 24 58 4C 01 00 78 F0 0F 00 08 58 0E 58 2E 53 1E 4E FE FF 0E 93 F2 27 09 4E 78 49 48 11 68 9C F7 23 0A 4C FA 99 01 00 F3 23 1A 53 58 83 FA 23 19 B3 09 63 0C 49 6E 4E -1E F3 01 20 1E 83 8F 4C 00 00 30 4D AC 85 0E 3E +1E F3 01 20 1E 83 8F 4C 00 00 30 4D A8 85 0E 3E 4E 55 4D 42 45 52 1B 42 B6 21 3C 4F 38 4F 29 4F 2F 82 82 4B C0 04 6A 4C 7A 80 3A 00 03 28 7A 80 07 00 12 28 7A 50 0A 00 0A 9B 22 C3 0D 2C 82 49 E0 04 82 48 E2 04 19 42 E4 04 18 42 E6 04 09 5A 08 63 1C 53 1E 83 E7 23 8F 4C 00 00 8F 48 02 00 -8F 49 04 00 30 4D 32 C0 00 02 3F 82 8F 4E 06 00 -08 43 09 43 1B 42 B6 21 0C 4E 0E 43 1E 15 3D 40 -36 87 7E 4C 6A 4C 7A 80 2D 00 16 24 CA 2F 2B 43 -7A 52 14 24 3B 52 6A 53 11 24 3B 40 10 00 5A 93 -0D 24 6A 92 41 20 3E 90 03 00 3E 20 FC 9C 01 00 -6C 4C 8F 4C 04 00 38 3C B1 43 02 00 1E 83 FC 9C -00 00 E0 23 AE 27 38 87 2F 24 2D 83 6A 4C 7A 90 -5F 00 BF 27 32 B0 00 02 27 20 32 D0 00 02 7A 80 -2E 00 B7 27 6A 53 20 20 0A 4E 09 43 8F 49 02 00 -5A 83 09 4A 09 5C 69 49 79 80 3A 00 03 28 79 80 -07 00 0C 28 79 50 0A 00 09 9B 08 2C 8F 49 00 00 -0E 4B 2C 15 B0 12 28 80 2A 17 E8 3F 9F 4F 04 00 -02 00 AF 4F 04 00 4A 93 1D 17 04 24 3F 50 06 00 -0E F3 30 4D 2F 53 9F 4F 02 00 04 00 BF 4F 00 00 -3E E3 09 20 3E E3 BF E3 02 00 BF E3 00 00 9F 53 -02 00 8F 63 00 00 32 B0 00 02 47 26 30 4D E4 84 -03 5C 92 42 BA 21 BE 21 30 4D 0D 12 84 12 6E 80 -C0 85 9A 80 22 88 2C 86 EA 87 0A 4E 3E 4F 3D 40 -04 88 71 27 3D 40 E0 87 1A E2 B4 21 A0 24 0E 12 -3E 4F 30 41 06 88 3E 4F 3D 40 E0 87 10 20 3D 40 -F8 89 DE 53 00 00 68 4E 08 5E F8 40 3F 00 00 00 -2C 3C C4 83 D0 87 0F 4C 49 54 45 52 41 4C 82 93 -B4 21 0D 24 09 4E 1A 42 C0 21 A2 52 C0 21 BA 40 -00 80 00 00 8A 49 02 00 3E 4F 32 B0 00 02 32 C0 +8F 49 04 00 30 4D 3D 40 04 88 32 C0 00 02 3F 82 +8F 4E 06 00 08 43 09 43 1B 42 B6 21 0C 4E 0E 43 +1E 15 3D 40 3A 87 7E 4C 6A 4C 7A 80 2D 00 16 24 +C8 2F 2B 43 7A 52 14 24 3B 52 6A 53 11 24 3B 40 +10 00 5A 93 0D 24 6A 92 41 20 3E 90 03 00 3E 20 +FC 9C 01 00 6C 4C 8F 4C 04 00 38 3C B1 43 02 00 +1E 83 FC 9C 00 00 E0 23 AC 27 3C 87 2F 24 2D 83 +6A 4C 7A 90 5F 00 BD 27 32 B0 00 02 27 20 32 D0 +00 02 7A 80 2E 00 B5 27 6A 53 20 20 0A 4E 09 43 +8F 49 02 00 5A 83 09 4A 09 5C 69 49 79 80 3A 00 +03 28 79 80 07 00 0C 28 79 50 0A 00 09 9B 08 2C +8F 49 00 00 0E 4B 2C 15 B0 12 B6 84 2A 17 E8 3F +9F 4F 04 00 02 00 AF 4F 04 00 4A 93 1D 17 04 24 +3F 50 06 00 0E F3 30 4D 2F 53 9F 4F 02 00 04 00 +BF 4F 00 00 3E E3 09 20 3E E3 BF E3 02 00 BF E3 +00 00 9F 53 02 00 8F 63 00 00 32 B0 00 02 32 26 +30 4D AA 84 03 5C 92 42 B8 21 BC 21 30 4D 0D 12 +84 12 2E 83 C0 85 5A 83 22 88 2C 86 EE 87 0A 4E +3E 4F 71 27 3D 40 E4 87 1A E2 B4 21 A0 24 0E 12 +3E 4F 30 41 06 88 3E 4F 3D 40 E4 87 10 20 3D 40 +F6 89 DE 53 00 00 68 4E 08 5E F8 40 3F 00 00 00 +35 3C 9E 83 D4 87 0F 4C 49 54 45 52 41 4C 82 93 +B4 21 0D 24 09 4E 1A 42 BE 21 A2 52 BE 21 BA 40 +06 83 00 00 8A 49 02 00 3E 4F 32 B0 00 02 32 C0 00 02 03 24 8A 4E 02 00 EE 3F 30 4D 8F 4E FE FF 3E 40 80 20 0E 8F 0E 11 2F 83 0E 5E 0E 7E 3E E3 -30 4D 5E 85 0A 43 4F 55 4E 54 2F 83 7A 4E 8F 4E -00 00 0E 4A 3E F3 30 4D 2F 83 8F 4E 00 00 0E 43 -B2 90 40 FF C0 21 EB 2F 30 4D 9A 84 0A 41 4C 4C -4F 54 82 5E C0 21 3E 4F 30 4D 3F 40 80 20 0E 43 -84 12 14 80 02 0D 0A 00 78 83 7E 80 DA 87 5C 88 -14 80 0B 73 74 61 63 6B 20 65 6D 70 74 79 F2 80 -88 88 14 80 09 4D 41 49 4E 20 66 75 6C 6C F2 80 -9C 80 B2 88 9C 88 0D 41 42 4F 52 54 22 00 0D 12 -84 12 AA 84 00 80 F2 80 3E 89 36 85 B8 85 02 27 -0D 12 84 12 C0 85 2C 86 96 80 0E 89 36 85 0E 88 -60 84 07 5B 27 5D 0D 12 84 12 00 89 00 80 00 80 -3E 89 3E 89 36 85 12 89 03 5B 82 43 B4 21 30 4D +30 4D 2F 83 8F 4E 00 00 0E 43 B2 90 40 FF BE 21 +F6 2F 30 4D 6A 85 0A 43 4F 55 4E 54 2F 83 7A 4E +8F 4E 00 00 0E 4A 3E F3 30 4D DC 81 0A 41 4C 4C +4F 54 82 5E BE 21 3E 4F 30 4D 3F 40 80 20 0E 43 +84 12 1A 83 02 0D 0A 00 DE 82 3E 83 DE 87 5C 88 +1A 83 0B 73 74 61 63 6B 20 65 6D 70 74 79 68 80 +72 88 1A 83 09 4D 41 49 4E 20 66 75 6C 6C 68 80 +5C 83 B2 88 9C 88 0D 41 42 4F 52 54 22 00 0D 12 +84 12 70 84 06 83 68 80 3E 89 42 85 B8 85 02 27 +0D 12 84 12 C0 85 2C 86 56 83 0E 89 42 85 0E 88 +3A 84 07 5B 27 5D 0D 12 84 12 00 89 06 83 06 83 +3E 89 3E 89 42 85 12 89 03 5B 82 43 B4 21 30 4D 00 00 02 5D B2 43 B4 21 30 4D 26 88 02 2C A2 53 -C0 21 1A 42 C0 21 8A 4E FE FF 3E 4F 30 4D 92 84 +BE 21 1A 42 BE 21 8A 4E FE FF 3E 4F 30 4D 02 80 11 50 4F 53 54 50 4F 4E 45 00 0D 12 84 12 C0 85 -2C 86 9A 80 0E 89 6A 88 96 80 78 89 00 80 00 80 -3E 89 3E 89 00 80 3E 89 3E 89 36 85 00 00 02 3A -30 12 CA 89 92 B3 C0 21 A2 63 C0 21 0D 12 84 12 -C0 85 94 89 3D 41 5A D3 5A 53 0A 5E 19 42 C4 21 +2C 86 5A 83 0E 89 6A 88 56 83 78 89 06 83 06 83 +3E 89 3E 89 06 83 3E 89 3E 89 42 85 00 00 02 3A +30 12 CA 89 92 B3 BE 21 A2 63 BE 21 0D 12 84 12 +C0 85 94 89 3D 41 5A D3 5A 53 0A 5E 19 42 C2 21 08 4E FE 5E FF FF 6E 4E 3E F0 0F 00 0E 5E 09 5E -3E 4F 82 48 D8 21 82 49 DA 21 82 4A DC 21 82 4F -DE 21 2A 52 82 4A C0 21 30 41 BA 40 0D 12 FC FF -BA 40 84 12 FE FF B2 43 B4 21 30 4D 82 9F DE 21 -01 20 0B 24 84 12 14 80 0F 73 74 61 63 6B 20 6D -69 73 6D 61 74 63 68 21 FC 80 18 42 D8 21 19 42 -DA 21 A8 49 FE FF 89 48 00 00 30 4D 28 89 03 3B -82 93 B4 21 DE 26 0D 12 84 12 00 80 36 85 3E 89 -DC 89 2A 89 36 85 00 00 12 49 4D 4D 45 44 49 41 -54 45 18 42 D8 21 D8 D3 00 00 30 4D 74 88 0C 43 -52 45 41 54 45 00 B0 12 84 89 BA 40 86 12 FC FF -8A 4A FE FF D6 3F 72 83 0A 44 4F 45 53 3E 1A 42 -DC 21 BA 40 85 12 00 00 8A 4D 02 00 3D 41 30 4D -7E 89 0E 3A 4E 4F 4E 41 4D 45 30 12 CA 89 2F 83 -8F 4E 00 00 1A 42 C0 21 1A B3 0A 63 0E 4A 39 40 -12 02 08 49 8E 3F 28 8A 05 49 53 00 0D 12 82 93 -B4 21 08 20 84 12 00 89 AA 8A 3D 41 BE 4F 02 00 -3E 4F 30 4D 84 12 16 89 00 80 AC 8A 3E 89 36 85 -3E 8A 08 43 4F 44 45 00 B0 12 84 89 A2 82 C0 21 -92 42 C6 21 C8 21 B2 40 A2 8B C6 21 30 4D 50 85 -0E 48 44 4E 43 4F 44 45 12 12 C4 21 B2 40 A2 8B -C4 21 0D 12 84 12 C8 8A FA 8A 3D 41 B2 41 C4 21 -30 4D C2 8A 0E 43 4F 44 45 4E 4E 4D 30 12 CC 8A -B6 3F 00 00 0E 45 4E 44 43 4F 44 45 0B 4D 84 12 -DC 89 24 8B 0D 4B B2 40 80 8B C6 21 82 43 C8 21 -30 4D 00 00 0A 43 4F 4C 4F 4E 1A 42 C0 21 BA 40 -0D 12 00 00 BA 40 84 12 02 00 A2 52 C0 21 B2 43 -B4 21 E9 3F 00 00 0A 4C 4F 32 48 49 A2 83 C0 21 -1A 42 C0 21 EF 3F E0 8A 0B 48 49 32 4C 4F A2 53 -C0 21 1A 42 C0 21 8A 4A FE FF 82 43 B4 21 A8 3F -50 89 E6 88 EC 8B 04 8B 58 8A 76 85 26 86 FE 88 -68 8B 98 8A 72 8A 0E 8A 3C 89 38 8C 7E 86 00 00 -00 00 EC 92 6C 91 D0 92 8C 90 E8 90 3E 91 1E 92 -2A 92 AE 8F D2 90 00 00 00 00 56 8B 9E 8E 00 00 -46 92 A0 8B 2B 42 BA 49 00 00 2A 53 1B 83 FB 23 -30 41 00 00 0E 52 53 54 5F 53 45 54 39 40 C0 21 -3A 40 42 18 B0 12 C4 8B 30 4D D4 8B 0E 52 53 54 -5F 52 45 54 39 40 42 18 3A 40 C0 21 2C 49 B0 12 -C4 8B 1A 42 C2 21 3B 40 10 00 09 4A 08 49 29 83 -18 48 FE FF 0C 98 FC 2B 89 48 00 00 1B 83 F6 23 -2A 4A 0A 93 F0 23 30 4D 2A 8C B2 4E 42 18 BE 12 -3E 4F 3D 41 DF 3F 32 89 0C 4D 41 52 4B 45 52 00 -12 12 BE 21 0D 12 84 12 C0 85 2C 86 96 80 54 8C -80 84 FE 87 56 8C 3E 4F 3D 41 B2 41 BE 21 B0 12 -84 89 BA 40 85 12 FC FF BA 40 28 8C FE FF 28 83 -8A 48 00 00 BA 40 6C 80 02 00 A2 52 C0 21 BD 3E -0E 93 B8 37 39 40 10 00 29 83 B9 43 80 FF FC 23 -B9 40 F0 81 FE FF 29 83 B9 40 E0 81 FE FF 39 90 -AE FF F9 23 39 40 10 18 B2 49 E0 FF 3B 42 3A 40 -3A 18 B0 12 C6 8B 82 43 4A 18 9C 3F 12 12 BE 21 -84 12 CA 85 2C 86 96 80 EC 8C CC 8C 3C 4E 3C 80 -87 12 0A 24 1C 53 02 20 2E 4E 06 3C BE 90 28 8C -00 00 01 20 3E 52 2E 83 21 53 30 41 D6 86 96 80 -F4 8C E8 8C F6 8C B2 41 BE 21 30 41 92 83 BE 21 -3E 40 28 00 0A 4E 3D 15 B0 12 BC 8C 15 20 3E 40 -2B 00 B0 12 BC 8C 06 20 3E 40 2D 00 B0 12 BC 8C -92 83 BE 21 0E 12 1E 41 02 00 84 12 CA 85 D6 86 -96 80 0E 89 36 8D 3E 51 3A 17 30 41 B0 12 FC 8C -19 42 C0 21 89 4E 00 00 A2 53 C0 21 3E 40 29 00 -92 53 BE 21 1A 42 BE 21 3D 15 84 12 CA 85 D6 86 -96 80 6E 8D 66 8D 3E 90 10 00 E6 2B 7E 2D 70 8D -A2 41 BE 21 E1 3F 03 20 B0 12 54 8D 47 20 7A 90 -23 00 23 20 B0 12 04 8D 3C 40 00 03 0E 93 40 24 -3C 40 10 03 1E 93 3C 24 3C 40 20 03 2E 93 38 24 -3C 40 20 02 2E 92 34 24 3C 40 30 02 3E 92 30 24 -3C 40 30 03 3E 93 2C 24 3C 40 30 00 19 42 C0 21 -A2 53 C0 21 89 4E 00 00 23 3C 7A 90 26 00 05 20 -3C 40 10 02 B0 12 04 8D F1 3F 7A 90 40 00 0C 20 -3C 40 20 00 B0 12 50 8D 11 20 3C D0 10 00 3E 40 -2B 00 B0 12 54 8D 04 20 3C D0 10 00 B0 12 3C 8D -92 92 BA 21 BE 21 02 24 92 53 BE 21 8E 10 0C 5E -3E 4F 30 4D 03 20 B0 12 54 8D F9 23 7A 90 26 00 -03 20 3C D0 82 00 D6 3F 3C D0 80 00 B0 12 3C 8D -EE 23 30 40 0E 88 0C 43 1B 42 C0 21 A2 53 C0 21 -3A 40 20 00 19 42 BE 21 19 52 BC 21 7A 99 FE 27 -5A 49 FF FF 19 82 BC 21 82 49 BE 21 7A 90 52 00 -30 4D 00 00 08 52 45 54 49 00 0D 12 84 12 00 80 -00 13 3E 89 36 85 00 80 2C 00 36 8E 76 8D 70 85 -40 8E 14 8E 86 8E 3D 41 2C DE 8B 4C 00 00 C0 3F -00 00 06 4D 4F 56 85 12 76 8E 00 40 92 8E 0A 4D -4F 56 2E 42 85 12 76 8E 40 40 00 00 06 41 44 44 -85 12 76 8E 00 50 AC 8E 0A 41 44 44 2E 42 85 12 -76 8E 40 50 B8 8E 08 41 44 44 43 00 85 12 76 8E -00 60 C6 8E 0C 41 44 44 43 2E 42 00 85 12 76 8E -40 60 34 8B 08 53 55 42 43 00 85 12 76 8E 00 70 -E4 8E 0C 53 55 42 43 2E 42 00 85 12 76 8E 40 70 -F2 8E 06 53 55 42 85 12 76 8E 00 80 02 8F 0A 53 -55 42 2E 42 85 12 76 8E 40 80 0E 8F 06 43 4D 50 -85 12 76 8E 00 90 1C 8F 0A 43 4D 50 2E 42 85 12 -76 8E 40 90 00 00 08 44 41 44 44 00 85 12 76 8E -00 A0 36 8F 0C 44 41 44 44 2E 42 00 85 12 76 8E -40 A0 64 8E 06 42 49 54 85 12 76 8E 00 B0 54 8F -0A 42 49 54 2E 42 85 12 76 8E 40 B0 60 8F 06 42 -49 43 85 12 76 8E 00 C0 6E 8F 0A 42 49 43 2E 42 -85 12 76 8E 40 C0 7A 8F 06 42 49 53 85 12 76 8E -00 D0 88 8F 0A 42 49 53 2E 42 85 12 76 8E 40 D0 -00 00 06 58 4F 52 85 12 76 8E 00 E0 A2 8F 0A 58 -4F 52 2E 42 85 12 76 8E 40 E0 D4 8E 06 41 4E 44 -85 12 76 8E 00 F0 BC 8F 0A 41 4E 44 2E 42 85 12 -76 8E 40 F0 70 85 36 8E 76 8D DC 8F 0A 4C 3C F0 -70 00 8A 10 3A F0 0F 00 0C DA 4D 3F 94 8F 06 52 -52 43 85 12 D4 8F 00 10 EE 8F 0A 52 52 43 2E 42 -85 12 D4 8F 40 10 28 8F 08 53 57 50 42 00 85 12 -D4 8F 80 10 FA 8F 06 52 52 41 85 12 D4 8F 00 11 -16 90 0A 52 52 41 2E 42 85 12 D4 8F 40 11 08 90 -06 53 58 54 85 12 D4 8F 80 11 00 00 08 50 55 53 -48 00 85 12 D4 8F 00 12 3C 90 0C 50 55 53 48 2E -42 00 85 12 D4 8F 40 12 30 90 08 43 41 4C 4C 00 -85 12 D4 8F 80 12 1A 53 0E 4A 84 12 AE 85 14 80 -0D 6F 75 74 20 6F 66 20 62 6F 75 6E 64 73 FC 80 -5A 90 06 53 3E 3D 86 12 00 38 82 90 04 53 3C 00 -86 12 00 34 4A 90 06 30 3E 3D 86 12 00 30 96 90 -04 30 3C 00 86 12 00 30 14 8B 04 55 3C 00 86 12 -00 2C AA 90 06 55 3E 3D 86 12 00 28 A0 90 06 30 -3C 3E 86 12 00 24 BE 90 04 30 3D 00 86 12 00 20 -00 00 04 49 46 00 1A 42 C0 21 8A 4E 00 00 A2 53 -C0 21 0E 4A 30 4D 44 8F 08 54 48 45 4E 00 1A 42 -C0 21 08 4E 3E 4F 09 48 29 53 0A 89 3A 90 FF 03 -B3 2F 0A 11 88 DA 00 00 30 4D B4 90 08 45 4C 53 -45 00 1A 42 C0 21 BA 40 00 3C 00 00 A2 53 C0 21 -2F 83 8F 4A 00 00 E3 3F 22 90 0A 42 45 47 49 4E -2F 83 8F 4E 00 00 1E 42 C0 21 30 4D 0C 91 0A 55 -4E 54 49 4C 3A 4F 08 4E 3E 4F 19 42 C0 21 2A 83 -0A 89 3A 90 00 FC 88 3B 0A 11 3A F0 FF 03 08 DA -89 48 00 00 A2 53 C0 21 30 4D C8 8F 0A 41 47 41 -49 4E 0A 4E 38 40 00 3C E7 3F 00 00 0A 57 48 49 -4C 45 0D 12 84 12 D6 90 74 84 36 85 2A 91 0C 52 -45 50 45 41 54 00 0D 12 84 12 72 91 EE 90 36 85 -A2 91 3D 41 2E 4E 08 4E 3E 4F 2A 48 B2 92 BE 21 -CA 2F 98 42 C0 21 00 00 30 4D 8E 91 06 42 57 31 -85 12 A0 91 E0 21 BC 91 06 42 57 32 85 12 A0 91 -E2 21 C8 91 06 42 57 33 85 12 A0 91 E4 21 E0 91 -3D 41 1A 42 C0 21 2E 4E 28 4E 8E 43 00 00 B2 92 -BE 21 80 2B BA 4F 00 00 A2 53 C0 21 8E 4A 00 00 -3E 4F 30 4D 00 00 06 46 57 31 85 12 DE 91 E6 21 -06 92 06 46 57 32 85 12 DE 91 EA 21 12 92 06 46 -57 33 85 12 DE 91 EA 21 7C 91 08 47 4F 54 4F 00 -2F 83 8F 4E 00 00 3E 40 00 3C 0D 12 84 12 00 89 -FE 87 36 85 00 00 0A 3F 47 4F 54 4F 3E 90 00 30 -F4 27 3E E0 00 04 3E B0 00 10 EF 27 3E E0 00 08 -EC 3F 00 80 2C 00 40 8E CA 85 D6 86 96 80 0E 89 -70 85 36 8E 14 8E 78 92 0A 4E 3E 4F 1A 83 F3 32 -29 4E 59 0E 0A 28 08 4C 59 0A 01 28 0C 8A 08 8A -38 90 10 00 E8 2E 5A 0E A7 3E 2A 92 E4 2E 8A 10 -5A 06 A2 3E D4 91 08 52 52 43 4D 00 85 12 62 92 -50 00 A6 92 08 52 52 41 4D 00 85 12 62 92 50 01 -B4 92 08 52 4C 41 4D 00 85 12 62 92 50 02 C2 92 -08 52 52 55 4D 00 85 12 62 92 50 03 C8 90 0A 50 -55 53 48 4D 85 12 62 92 00 15 DE 92 08 50 4F 50 -4D 00 85 12 62 92 00 17 +3E 4F 82 48 D6 21 82 49 D8 21 82 4A DA 21 82 4F +DC 21 2A 52 82 4A BE 21 30 41 BA 40 0D 12 FC FF +BA 40 84 12 FE FF B2 43 B4 21 30 4D 82 9F DC 21 +0B 24 84 12 1A 83 0F 73 74 61 63 6B 20 6D 69 73 +6D 61 74 63 68 21 72 80 18 42 D6 21 19 42 D8 21 +A8 49 FE FF 89 48 00 00 30 4D 28 89 03 3B 82 93 +B4 21 E1 26 0D 12 84 12 06 83 42 85 3E 89 DC 89 +2A 89 42 85 00 00 12 49 4D 4D 45 44 49 41 54 45 +18 42 D6 21 D8 D3 00 00 30 4D 86 88 0C 43 52 45 +41 54 45 00 B0 12 84 89 BA 40 86 12 FC FF 8A 4A +FE FF D6 3F D8 82 0A 44 4F 45 53 3E 1A 42 DA 21 +BA 40 85 12 00 00 8A 4D 02 00 3D 41 30 4D 7E 89 +0E 3A 4E 4F 4E 41 4D 45 30 12 CA 89 2F 83 8F 4E +00 00 1A 42 BE 21 1A B3 0A 63 0E 4A 39 40 12 02 +08 49 8F 3F 26 8A 05 49 53 00 0D 12 82 93 B4 21 +08 20 84 12 00 89 A8 8A 3D 41 BE 4F 02 00 3E 4F +30 4D 84 12 16 89 06 83 AA 8A 3E 89 42 85 50 89 +E6 88 EA 8B 46 8B 56 8A 82 85 26 86 FE 88 AA 8B +96 8A 70 8A 0C 8A 3C 89 36 8C 7E 86 00 00 00 00 +E2 92 62 91 C6 92 82 90 DE 90 34 91 14 92 20 92 +A4 8F C8 90 00 00 00 00 98 8B 94 8E 00 00 3C 92 +DE 8A 3C 8A 08 43 4F 44 45 00 B0 12 84 89 A2 82 +BE 21 92 42 C4 21 C6 21 B2 40 E0 8A C4 21 30 4D +5C 85 0E 48 44 4E 43 4F 44 45 12 12 C2 21 B2 40 +E0 8A C2 21 0D 12 84 12 0A 8B 3C 8B 3D 41 B2 41 +C2 21 30 4D 04 8B 0E 43 4F 44 45 4E 4E 4D 30 12 +0E 8B 94 3F 00 00 0E 45 4E 44 43 4F 44 45 0B 4D +84 12 DC 89 66 8B 0D 4B B2 40 BE 8A C4 21 82 43 +C6 21 30 4D 00 00 0A 43 4F 4C 4F 4E 1A 42 BE 21 +BA 40 0D 12 00 00 BA 40 84 12 02 00 A2 52 BE 21 +B2 43 B4 21 E9 3F 00 00 0A 4C 4F 32 48 49 A2 83 +BE 21 1A 42 BE 21 EF 3F 22 8B 0B 48 49 32 4C 4F +A2 53 BE 21 1A 42 BE 21 8A 4A FE FF 82 43 B4 21 +A8 3F 2B 42 BA 49 00 00 2A 53 1B 83 FB 23 30 41 +00 00 0E 52 53 54 5F 53 45 54 39 40 BE 21 3A 40 +46 18 B0 12 C2 8B 30 4D D2 8B 0E 52 53 54 5F 52 +45 54 39 40 46 18 3A 40 BE 21 2C 49 B0 12 C2 8B +1A 42 C0 21 3B 40 10 00 09 4A 08 49 29 83 18 48 +FE FF 0C 98 FC 2B 89 48 00 00 1B 83 F6 23 2A 4A +0A 93 F0 23 30 4D 28 8C B2 4E 46 18 BE 12 3E 4F +3D 41 DF 3F 32 89 0C 4D 41 52 4B 45 52 00 12 12 +BC 21 0D 12 84 12 C0 85 2C 86 56 83 52 8C 5A 84 +FE 87 54 8C 3E 4F 3D 41 B2 41 BC 21 B0 12 84 89 +BA 40 85 12 FC FF BA 40 26 8C FE FF 28 83 8A 48 +00 00 BA 40 FA 84 02 00 A2 52 BE 21 BD 3E 0E 93 +B8 37 39 40 10 00 29 83 B9 43 80 FF FC 23 B9 40 +46 81 FE FF 29 83 B9 40 36 81 FE FF 39 90 AE FF +F9 23 39 40 10 18 B2 49 E0 FF 3B 40 0A 00 3A 40 +3C 18 B0 12 C4 8B 9D 3F 12 12 BC 21 84 12 CA 85 +2C 86 56 83 E8 8C C8 8C 3C 4E 3C 80 87 12 0A 24 +1C 53 02 20 2E 4E 06 3C BE 90 26 8C 00 00 01 20 +3E 52 2E 83 21 53 30 41 DA 86 56 83 F0 8C E4 8C +F2 8C B2 41 BC 21 30 41 92 83 BC 21 3E 40 28 00 +0A 4E 3D 15 B0 12 B8 8C 15 20 3E 40 2B 00 B0 12 +B8 8C 06 20 3E 40 2D 00 B0 12 B8 8C 92 83 BC 21 +0E 12 1E 41 02 00 84 12 CA 85 DA 86 56 83 0E 89 +32 8D 3E 51 3A 17 30 41 B0 12 F8 8C 19 42 BE 21 +89 4E 00 00 A2 53 BE 21 3E 40 29 00 92 53 BC 21 +1A 42 BC 21 3D 15 84 12 CA 85 DA 86 56 83 6A 8D +62 8D 3E 90 10 00 E6 2B 7B 2D 6C 8D A2 41 BC 21 +E1 3F 03 20 B0 12 50 8D 44 20 7A 90 23 00 23 20 +B0 12 00 8D 3C 40 00 03 0E 93 3D 24 3C 40 10 03 +1E 93 39 24 3C 40 20 03 2E 93 35 24 3C 40 30 03 +3E 93 31 24 3C 40 20 02 2E 92 2D 24 3C 40 30 02 +3E 92 29 24 3C 40 30 00 19 42 BE 21 A2 53 BE 21 +89 4E 00 00 20 3C 7A 90 26 00 05 20 3C 40 10 02 +B0 12 00 8D F1 3F 7A 90 40 00 0A 20 3C 40 20 00 +B0 12 4C 8D 0E 20 3E 40 2B 00 B0 12 50 8D 02 20 +B0 12 38 8D 3C D0 10 00 3A 40 FF 3F 0A 9C 82 63 +BC 21 8E 10 0C 5E 3E 4F 30 4D 03 20 B0 12 50 8D +F9 23 7A 90 26 00 03 20 3C D0 82 00 D9 3F 3C D0 +80 00 B0 12 38 8D EE 23 30 40 0E 88 0C 43 1B 42 +BE 21 A2 53 BE 21 3A 40 20 00 19 42 BC 21 19 52 +BA 21 7A 99 FE 27 5A 49 FF FF 19 82 BA 21 82 49 +BC 21 7A 90 52 00 30 4D 00 00 08 52 45 54 49 00 +0D 12 84 12 06 83 00 13 3E 89 42 85 06 83 2C 00 +2C 8E 72 8D 7C 85 36 8E 0A 8E 7C 8E 3D 41 2C DE +8B 4C 00 00 C0 3F 00 00 06 4D 4F 56 85 12 6C 8E +00 40 88 8E 0A 4D 4F 56 2E 42 85 12 6C 8E 40 40 +00 00 06 41 44 44 85 12 6C 8E 00 50 A2 8E 0A 41 +44 44 2E 42 85 12 6C 8E 40 50 AE 8E 08 41 44 44 +43 00 85 12 6C 8E 00 60 BC 8E 0C 41 44 44 43 2E +42 00 85 12 6C 8E 40 60 76 8B 08 53 55 42 43 00 +85 12 6C 8E 00 70 DA 8E 0C 53 55 42 43 2E 42 00 +85 12 6C 8E 40 70 E8 8E 06 53 55 42 85 12 6C 8E +00 80 F8 8E 0A 53 55 42 2E 42 85 12 6C 8E 40 80 +04 8F 06 43 4D 50 85 12 6C 8E 00 90 12 8F 0A 43 +4D 50 2E 42 85 12 6C 8E 40 90 00 00 08 44 41 44 +44 00 85 12 6C 8E 00 A0 2C 8F 0C 44 41 44 44 2E +42 00 85 12 6C 8E 40 A0 5A 8E 06 42 49 54 85 12 +6C 8E 00 B0 4A 8F 0A 42 49 54 2E 42 85 12 6C 8E +40 B0 56 8F 06 42 49 43 85 12 6C 8E 00 C0 64 8F +0A 42 49 43 2E 42 85 12 6C 8E 40 C0 70 8F 06 42 +49 53 85 12 6C 8E 00 D0 7E 8F 0A 42 49 53 2E 42 +85 12 6C 8E 40 D0 00 00 06 58 4F 52 85 12 6C 8E +00 E0 98 8F 0A 58 4F 52 2E 42 85 12 6C 8E 40 E0 +CA 8E 06 41 4E 44 85 12 6C 8E 00 F0 B2 8F 0A 41 +4E 44 2E 42 85 12 6C 8E 40 F0 7C 85 2C 8E 72 8D +D2 8F 0A 4C 3C F0 70 00 8A 10 3A F0 0F 00 0C DA +4D 3F 8A 8F 06 52 52 43 85 12 CA 8F 00 10 E4 8F +0A 52 52 43 2E 42 85 12 CA 8F 40 10 1E 8F 08 53 +57 50 42 00 85 12 CA 8F 80 10 F0 8F 06 52 52 41 +85 12 CA 8F 00 11 0C 90 0A 52 52 41 2E 42 85 12 +CA 8F 40 11 FE 8F 06 53 58 54 85 12 CA 8F 80 11 +00 00 08 50 55 53 48 00 85 12 CA 8F 00 12 32 90 +0C 50 55 53 48 2E 42 00 85 12 CA 8F 40 12 26 90 +08 43 41 4C 4C 00 85 12 CA 8F 80 12 1A 53 0E 4A +84 12 AA 85 1A 83 0D 6F 75 74 20 6F 66 20 62 6F +75 6E 64 73 72 80 50 90 06 53 3E 3D 86 12 00 38 +78 90 04 53 3C 00 86 12 00 34 40 90 06 30 3E 3D +86 12 00 30 8C 90 04 30 3C 00 86 12 00 30 56 8B +04 55 3C 00 86 12 00 2C A0 90 06 55 3E 3D 86 12 +00 28 96 90 06 30 3C 3E 86 12 00 24 B4 90 04 30 +3D 00 86 12 00 20 00 00 04 49 46 00 1A 42 BE 21 +8A 4E 00 00 A2 53 BE 21 0E 4A 30 4D 3A 8F 08 54 +48 45 4E 00 1A 42 BE 21 08 4E 3E 4F 09 48 29 53 +0A 89 3A 90 FF 03 B3 2F 0A 11 88 DA 00 00 30 4D +AA 90 08 45 4C 53 45 00 1A 42 BE 21 BA 40 00 3C +00 00 A2 53 BE 21 2F 83 8F 4A 00 00 E3 3F 18 90 +0A 42 45 47 49 4E 2F 83 8F 4E 00 00 1E 42 BE 21 +30 4D 02 91 0A 55 4E 54 49 4C 3A 4F 08 4E 3E 4F +19 42 BE 21 2A 83 0A 89 3A 90 00 FC 88 3B 0A 11 +3A F0 FF 03 08 DA 89 48 00 00 A2 53 BE 21 30 4D +BE 8F 0A 41 47 41 49 4E 0A 4E 38 40 00 3C E7 3F +00 00 0A 57 48 49 4C 45 0D 12 84 12 CC 90 4E 84 +42 85 20 91 0C 52 45 50 45 41 54 00 0D 12 84 12 +68 91 E4 90 42 85 98 91 3D 41 2E 4E 08 4E 3E 4F +2A 48 B2 92 BC 21 CA 2F 98 42 BE 21 00 00 30 4D +84 91 06 42 57 31 85 12 96 91 DE 21 B2 91 06 42 +57 32 85 12 96 91 E0 21 BE 91 06 42 57 33 85 12 +96 91 E2 21 D6 91 3D 41 1A 42 BE 21 2E 4E 28 4E +8E 43 00 00 B2 92 BC 21 80 2B BA 4F 00 00 A2 53 +BE 21 8E 4A 00 00 3E 4F 30 4D 00 00 06 46 57 31 +85 12 D4 91 E4 21 FC 91 06 46 57 32 85 12 D4 91 +E8 21 08 92 06 46 57 33 85 12 D4 91 E8 21 72 91 +08 47 4F 54 4F 00 2F 83 8F 4E 00 00 3E 40 00 3C +0D 12 84 12 00 89 FE 87 42 85 00 00 0A 3F 47 4F +54 4F 3E 90 00 30 F4 27 3E E0 00 04 3E B0 00 10 +EF 27 3E E0 00 08 EC 3F 06 83 2C 00 36 8E CA 85 +DA 86 56 83 0E 89 7C 85 2C 8E 0A 8E 6E 92 0A 4E +3E 4F 1A 83 F3 32 29 4E 59 0E 0A 28 08 4C 59 0A +01 28 0C 8A 08 8A 38 90 10 00 E8 2E 5A 0E A7 3E +2A 92 E4 2E 8A 10 5A 06 A2 3E CA 91 08 52 52 43 +4D 00 85 12 58 92 50 00 9C 92 08 52 52 41 4D 00 +85 12 58 92 50 01 AA 92 08 52 4C 41 4D 00 85 12 +58 92 50 02 B8 92 08 52 52 55 4D 00 85 12 58 92 +50 03 BE 90 0A 50 55 53 48 4D 85 12 58 92 00 15 +D4 92 08 50 4F 50 4D 00 85 12 58 92 00 17 @FF80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF -77 00 10 00 12 00 14 00 16 00 00 00 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -B6 82 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 F0 81 +77 00 10 00 12 00 14 00 16 00 00 00 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +1C 82 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 46 81 q diff --git a/binaries/LP_MSP430FR2476_8MHz_115200.txt b/binaries/LP_MSP430FR2476_8MHz_115200.txt index 58bd2b6..3faf4a8 100644 --- a/binaries/LP_MSP430FR2476_8MHz_115200.txt +++ b/binaries/LP_MSP430FR2476_8MHz_115200.txt @@ -1,322 +1,322 @@ @1800 -40 1F 04 00 51 55 18 00 FD FF 90 01 10 00 A8 19 -BC 82 6A 81 70 81 44 81 1A 83 FE 92 C8 8B 86 8B -86 8B 88 82 4E 83 16 83 3C 21 E0 20 3C 85 A0 80 -AE 80 7C 84 20 00 0A 00 00 20 6A 81 70 81 44 81 -1A 83 FE 92 C8 8B 86 8B 86 8B 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 00 00 +40 1F 04 00 51 55 18 00 FD FF 91 01 10 00 90 19 +22 82 C0 80 48 80 C6 80 9A 80 80 82 F4 92 06 8B +C4 8A C4 8A 00 00 EE 81 B4 82 7C 82 3C 21 E0 20 +48 85 66 83 74 83 56 84 0A 00 00 20 C0 80 48 80 +C6 80 9A 80 80 82 F4 92 06 8B C4 8A C4 8A 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @8000 -2F 83 8F 4E 00 00 3E 4D 30 4D 8F 4E FE FF AF 4F -FC FF 2F 82 2F 82 8F 4E 02 00 7E 4D 8F 4D 00 00 -0D 5E 1D B3 0D 63 30 4D 0B 4E 1C 4F 02 00 2E 4F -0A 43 35 40 20 00 0E 93 04 20 05 11 0E 4C 0C 43 -09 43 0A 9B 01 28 0A 8B 09 69 08 68 15 83 07 30 -0C 5C 0E 6E 0A 6A F5 2B 0A 8B 12 D3 F5 3F 35 40 -A0 80 8F 4A 02 00 8F 49 00 00 0E 48 30 41 82 43 -BE 21 B2 4F BC 21 82 4E BA 21 3E 4F 30 4D 2F 82 -8F 4E 02 00 3E 40 54 00 BF 40 3C 21 00 00 AF 4F -FE FF 2F 83 F7 3C 0E 93 3E 4F 91 21 2D 4D 30 4D -2F 83 8F 4E 00 00 3E 41 0D 12 3D 4E 30 4D 2F 83 -8F 4E 00 00 3E 41 2E 4E 30 4D 3D 41 39 40 22 18 -B2 49 86 82 B2 49 4C 83 B2 49 14 83 B2 49 8A 80 -31 49 34 49 35 49 36 49 37 49 B2 49 B8 21 B2 49 -B6 21 B2 49 00 20 82 43 B4 21 92 12 3C 18 30 40 -86 8C 8F 93 02 00 02 20 2F 52 BF 3F 30 12 20 81 -B0 12 1A 83 92 C3 1C 05 18 42 00 18 39 40 41 00 -19 83 FE 23 18 83 FA 23 92 B3 1C 05 F3 23 30 41 -B0 12 BA 80 86 84 96 80 42 81 5C 83 14 80 04 1B -5B 37 6D 00 7E 83 7E 83 14 80 04 1B 5B 30 6D 00 -7E 83 B0 88 B2 40 81 00 00 05 92 42 02 18 06 05 -92 42 04 18 08 05 F2 D0 30 00 0A 02 92 C3 00 05 -92 D3 1A 05 92 C3 30 01 30 41 92 B3 0A 05 FD 23 -30 41 92 12 3E 18 84 12 5C 83 14 80 07 0D 0A 1B -5B 37 6D 23 7E 83 B4 85 14 80 19 46 61 73 74 46 -6F 72 74 68 20 A9 4A 2E 4D 2E 54 68 6F 6F 72 65 -6E 73 2C 20 7E 83 00 80 40 FF 36 91 8E 84 80 85 -14 80 0A 62 79 74 65 73 20 66 72 65 65 00 9C 80 -36 81 00 00 06 53 59 53 92 12 3A 18 0E 93 06 38 -02 24 1E B3 03 24 B0 12 BA 80 72 81 82 4E 08 18 -D2 B3 21 02 02 20 B2 43 08 18 B2 40 04 A5 20 01 -92 D3 04 01 B2 D0 10 00 00 01 B2 40 80 5A CC 01 -3F 40 80 20 31 40 E0 20 B2 D3 06 02 B2 40 FE FF -02 02 B2 D3 26 02 B2 40 FF 7F 22 02 B2 D3 46 02 -B2 40 FC FF 42 02 E2 D3 45 02 B2 40 00 A5 60 01 -B2 D0 10 00 86 01 F2 C3 82 01 F2 D0 06 00 82 01 -B2 40 F4 00 84 01 39 40 5C 00 18 42 00 18 18 83 -FE 23 19 83 FA 23 39 40 00 20 29 83 89 43 00 20 -FC 23 19 42 5E 01 1E 42 08 18 82 43 08 18 3E B3 -01 20 0E 49 B0 12 BA 80 72 81 00 00 0C 41 43 43 -45 50 54 00 30 40 88 82 08 4E 2E 4F 08 5E 39 40 -0D 00 3A 40 20 00 3B 40 EE 82 3C 40 FA 82 5D 15 -92 12 40 18 12 D2 06 18 FB 3F A2 B3 1C 05 FD 27 -B2 40 13 00 0E 05 E2 D3 43 02 30 41 21 52 3A 17 -58 42 0C 05 48 9C 08 2C 48 9B EF 27 78 92 11 20 -2E 9F 0F 24 1E 83 05 3C 0E 9A 03 2C CE 48 00 00 -1E 53 A2 B3 1C 05 FD 27 C2 48 0E 05 30 4D F0 82 -2D 83 92 B3 1C 05 E4 23 FC 3F 92 B3 1C 05 FD 27 -58 42 0C 05 3E 8F 3D 41 48 4C EB 3F 00 00 06 4B -45 59 30 40 16 83 30 12 2C 83 A2 B3 1C 05 FD 27 -B2 40 11 00 0E 05 E2 C3 43 02 30 41 2F 83 8F 4E -00 00 92 B3 1C 05 FD 27 B0 12 AA 82 1E 42 0C 05 -30 4D 00 00 08 45 4D 49 54 00 30 40 4E 83 08 4E -3E 4F C7 3F 44 83 08 45 43 48 4F 00 B2 40 A2 B3 -E2 82 30 4D 00 00 0C 4E 4F 45 43 48 4F 00 B2 40 -30 4D E2 82 30 4D 00 00 08 54 59 50 45 00 0D 12 -3D 40 94 83 39 4F 2D 83 2F 83 8F 4E 00 00 7E 49 -DC 3F 94 83 5E 83 F7 23 18 24 0E 83 0D 5B 54 48 -45 4E 5D 00 30 4D 0C 4E 38 4F 3C 9F 39 4F 3E 4F -75 22 F9 98 00 00 72 22 19 53 1C 83 FA 23 2D 53 -30 4D 2F 53 3E 4F 1E 83 69 22 3E 4F 3D 41 30 4D -9C 83 0D 5B 45 4C 53 45 5D 00 0D 12 84 12 00 80 -01 00 9C 80 F4 83 14 80 05 0D 6B 6F 20 0A 7E 83 -84 80 6E 80 C6 85 80 88 9A 80 E6 83 0A 80 06 5B -54 48 45 4E 5D 00 A6 83 0E 84 C2 83 F4 83 0A 80 -06 5B 45 4C 53 45 5D 00 A6 83 20 84 C2 83 2C 84 -14 80 04 5B 49 46 5D 00 A6 83 F4 83 92 84 9C 80 -F4 83 D2 83 09 5B 49 46 5D 00 0E 93 3E 4F CD 27 -30 4D 34 84 17 5B 55 4E 44 45 46 49 4E 45 44 5D -0D 12 84 12 C6 85 32 86 5A 84 1E 83 0E 7E 3D 41 -2F 53 30 4D 44 84 13 5B 44 45 46 49 4E 45 44 5D -0D 12 84 12 C6 85 32 86 5E 84 3F 12 2F 83 8F 4E -00 00 3E 41 30 4D 2F 83 8F 4E 00 00 30 4D 3E 8F -3E E3 1E 53 30 4D 00 00 02 40 2E 4E 30 4D 7C 82 -02 21 BE 4F 00 00 3E 4F 30 4D C4 81 05 53 22 00 -2F 83 8F 4E 00 00 3E 40 22 00 0B 43 0D 12 84 12 -00 80 14 80 44 89 D4 85 CA 84 1A 53 1A B3 82 6A -C0 21 7B 3F 66 83 05 2E 22 00 0D 12 84 12 B0 84 -00 80 7E 83 44 89 3C 85 00 00 04 3C 23 00 B2 40 -B2 21 B2 21 30 4D AC 84 02 23 1B 42 B6 21 2C 4F -2F 83 B0 12 30 80 BF 4F 00 00 7A 90 0A 00 02 28 -7A 50 07 00 7A 50 30 00 92 83 B2 21 18 42 B2 21 -C8 4A 00 00 30 4D F8 84 04 23 53 00 0D 12 84 12 -FA 84 34 85 2D 83 09 DE 09 93 E1 23 3D 41 30 4D -28 85 04 23 3E 00 9F 42 B2 21 00 00 3E 40 B2 21 -2E 8F 30 4D 00 00 08 48 4F 4C 44 00 4A 4E 3E 4F -DB 3F 42 85 08 53 49 47 4E 00 0E 93 3E 4F 7A 40 -2D 00 D2 33 30 4D 86 12 20 00 56 83 04 55 2E 00 -0C 43 2F 83 8F 4E 00 00 0E 4C 1D 15 3E F3 06 34 -BF E3 00 00 3E E3 9F 53 00 00 0E 63 84 12 EE 84 -76 85 5C 85 2C 85 7C 84 6A 85 46 85 7E 83 3C 85 -D6 84 02 2E 0E 93 E4 37 3C 43 E3 3F 00 00 08 57 +00 00 02 40 2E 4E 30 4D 00 00 02 21 BE 4F 00 00 +3E 4F 30 4D 3D 41 39 40 26 18 B2 49 EC 81 B2 49 +B2 82 B2 49 7A 82 B2 49 50 83 31 49 34 49 35 49 +36 49 37 49 B2 49 B6 21 B2 49 00 20 82 43 B4 21 +92 12 40 18 30 40 84 8C B0 12 80 82 92 C3 1C 05 +18 42 00 18 39 40 41 00 19 83 FE 23 18 83 FA 23 +92 B3 1C 05 F3 23 30 41 8F 93 02 00 02 20 2F 52 +9A 3D 92 12 3E 18 B0 12 14 80 60 84 5C 83 98 80 +C2 82 20 83 04 1B 5B 37 6D 00 E4 82 E4 82 20 83 +04 1B 5B 30 6D 00 E4 82 B0 88 B2 40 81 00 00 05 +92 42 02 18 06 05 92 42 04 18 08 05 F2 D0 30 00 +0A 02 92 C3 00 05 92 D3 1A 05 92 C3 30 01 30 41 +92 B3 0A 05 FD 23 30 41 92 12 42 18 84 12 C2 82 +20 83 07 0D 0A 1B 5B 37 6D 23 E4 82 B0 85 20 83 +19 46 61 73 74 46 6F 72 74 68 20 A9 4A 2E 4D 2E +54 68 6F 6F 72 65 6E 73 2C 20 E4 82 0C 83 40 FF +2C 91 68 84 8C 85 20 83 0A 62 79 74 65 73 20 66 +72 65 65 00 62 83 8C 80 00 00 06 53 59 53 92 12 +3C 18 0E 93 06 38 02 24 1E B3 03 24 B0 12 14 80 +C8 80 82 4E 08 18 D2 B3 21 02 02 20 B2 43 08 18 +B2 40 04 A5 20 01 92 D3 04 01 B2 D0 10 00 00 01 +B2 40 80 5A CC 01 3F 40 80 20 31 40 E0 20 B2 D3 +06 02 B2 40 FE FF 02 02 B2 D3 26 02 B2 40 FF 7F +22 02 B2 D3 46 02 B2 40 FC FF 42 02 E2 D3 45 02 +B2 40 00 A5 60 01 B2 D0 10 00 86 01 F2 C3 82 01 +F2 D0 06 00 82 01 B2 40 F4 00 84 01 39 40 5C 00 +18 42 00 18 18 83 FE 23 19 83 FA 23 39 40 00 20 +29 83 89 43 00 20 FC 23 19 42 5A 01 59 0E 09 59 +19 D2 5C 01 59 0E 59 06 59 D2 5E 01 1E 42 08 18 +82 43 08 18 3E B3 01 20 0E 49 B0 12 14 80 C8 80 +0A 80 0C 41 43 43 45 50 54 00 30 40 EE 81 08 4E +2E 4F 08 5E 39 40 0D 00 3A 40 20 00 3B 40 54 82 +3C 40 60 82 5D 15 92 12 44 18 12 D2 06 18 FB 3F +A2 B3 1C 05 FD 27 B2 40 13 00 0E 05 E2 D3 43 02 +30 41 21 52 3A 17 58 42 0C 05 48 9C 08 2C 48 9B +EF 27 78 92 11 20 2E 9F 0F 24 1E 83 05 3C 0E 9A +03 2C CE 48 00 00 1E 53 A2 B3 1C 05 FD 27 C2 48 +0E 05 30 4D 56 82 2D 83 92 B3 1C 05 E4 23 FC 3F +92 B3 1C 05 FD 27 58 42 0C 05 3E 8F 3D 41 48 4C +EB 3F 00 00 06 4B 45 59 30 40 7C 82 30 12 92 82 +A2 B3 1C 05 FD 27 B2 40 11 00 0E 05 E2 C3 43 02 +30 41 2F 83 8F 4E 00 00 92 B3 1C 05 FD 27 B0 12 +10 82 1E 42 0C 05 30 4D 00 00 08 45 4D 49 54 00 +30 40 B4 82 08 4E 3E 4F C7 3F AA 82 08 45 43 48 +4F 00 B2 40 A2 B3 48 82 30 4D 00 00 0C 4E 4F 45 +43 48 4F 00 B2 40 30 4D 48 82 30 4D 00 00 08 54 +59 50 45 00 0D 12 3D 40 FA 82 39 4F 2D 83 2F 83 +8F 4E 00 00 7E 49 DC 3F FA 82 5E 83 F7 23 52 24 +74 82 0D 5B 54 48 45 4E 5D 00 30 4D 2F 83 8F 4E +00 00 3E 4D 30 4D 8F 4E FE FF AF 4F FC FF 2F 82 +2F 82 8F 4E 02 00 7E 4D 8F 4D 00 00 0D 5E 1D B3 +0D 63 30 4D 82 43 BC 21 B2 4F BA 21 82 4E B8 21 +3E 4F 30 4D 2F 82 8F 4E 02 00 3E 40 54 00 BF 40 +3C 21 00 00 AF 4F FE FF 2F 83 47 3F 0E 93 3E 4F +1B 20 2D 4D 30 4D 2F 83 8F 4E 00 00 3E 41 0D 12 +3D 4E 30 4D 2F 83 8F 4E 00 00 3E 41 2E 4E 30 4D +0C 4E 38 4F 3C 9F 39 4F 3E 4F EB 23 F9 98 00 00 +E8 23 19 53 1C 83 FA 23 2D 53 30 4D 2F 53 3E 4F +1E 83 DF 23 3D 41 3E 4F 30 4D 02 83 0D 5B 45 4C +53 45 5D 00 0D 12 84 12 0C 83 01 00 62 83 CE 83 +20 83 05 0D 6B 6F 20 0A E4 82 4A 83 34 83 C6 85 +92 88 60 83 C0 83 16 83 06 5B 54 48 45 4E 5D 00 +80 83 E8 83 9C 83 CE 83 16 83 06 5B 45 4C 53 45 +5D 00 80 83 FA 83 9C 83 06 84 20 83 04 5B 49 46 +5D 00 80 83 CE 83 6C 84 62 83 CE 83 AC 83 09 5B +49 46 5D 00 0E 93 3E 4F CD 27 30 4D 0E 84 17 5B +55 4E 44 45 46 49 4E 45 44 5D 0D 12 84 12 C6 85 +32 86 34 84 1E 83 0E 7E 3D 41 2F 53 30 4D 1E 84 +13 5B 44 45 46 49 4E 45 44 5D 0D 12 84 12 C6 85 +32 86 38 84 3F 12 2F 83 8F 4E 00 00 3E 41 30 4D +2F 83 8F 4E 00 00 30 4D 3E 8F 3E E3 1E 53 30 4D +1A 81 05 53 22 00 2F 83 8F 4E 00 00 3E 40 22 00 +0B 43 0D 12 84 12 0C 83 20 83 44 89 D4 85 90 84 +1A 53 1A B3 82 6A BE 21 85 3F CC 82 05 2E 22 00 +0D 12 84 12 76 84 0C 83 E4 82 44 89 48 85 00 00 +04 3C 23 00 B2 40 B2 21 B2 21 30 4D 0B 4E 1C 4F +02 00 2E 4F 0A 43 35 40 20 00 0E 93 04 20 05 11 +0E 4C 0C 43 09 43 0A 9B 01 28 0A 8B 09 69 08 68 +15 83 07 30 0C 5C 0E 6E 0A 6A F5 2B 0A 8B 12 D3 +F5 3F 35 40 66 83 8F 4A 02 00 8F 49 00 00 0E 48 +30 41 72 84 02 23 1B 42 B6 21 2C 4F 2F 83 B0 12 +C4 84 BF 4F 00 00 7A 90 0A 00 02 28 7A 50 07 00 +7A 50 30 00 92 83 B2 21 18 42 B2 21 C8 4A 00 00 +30 4D 04 85 04 23 53 00 0D 12 84 12 06 85 40 85 +2D 83 09 DE 09 93 E1 23 3D 41 30 4D 34 85 04 23 +3E 00 9F 42 B2 21 00 00 3E 40 B2 21 2E 8F 30 4D +00 00 08 48 4F 4C 44 00 4A 4E 3E 4F DB 3F 4E 85 +08 53 49 47 4E 00 0E 93 3E 4F 7A 40 2D 00 D2 33 +30 4D 86 12 20 00 BC 82 04 55 2E 00 0C 43 2F 83 +8F 4E 00 00 0E 43 1D 15 84 12 B4 84 82 85 68 85 +38 85 56 84 76 85 52 85 E4 82 48 85 9C 84 02 2E +0E 93 EC 37 3E E3 1E 53 3C 43 E9 3F 00 00 08 57 4F 52 44 00 05 3C 2F 83 8F 4E 00 00 3E 40 20 00 -1B 42 B8 21 3C 40 BA 21 39 4C 38 4C 09 58 38 5C -2A 4C 08 99 1C 2C 7E 98 FC 27 18 83 F8 90 27 00 +3B 40 20 00 3C 40 B8 21 39 4C 38 4C 09 58 38 5C +2A 4C 08 99 18 2C 7E 98 FC 27 18 83 F8 90 27 00 02 00 01 20 0B 43 CA 4C 00 00 08 99 0C 24 7C 48 4E 9C 09 24 1A 53 7C 90 61 00 F5 2B 7C 90 7B 00 -F2 2F 4C 8B F0 3F 18 82 BC 21 82 48 BE 21 1E 42 -C0 21 0A 8E CE 4A 00 00 30 4D 00 00 08 46 49 4E -44 00 2F 83 0C 4E 3B 40 C6 21 3E 4B 0E 93 1E 24 +F2 2F 4C 8B F0 3F 18 82 BA 21 82 48 BC 21 1E 42 +BE 21 0A 8E CE 4A 00 00 30 4D 00 00 08 46 49 4E +44 00 2F 83 0C 4E 3B 40 C4 21 3E 4B 0E 93 1E 24 58 4C 01 00 78 F0 0F 00 08 58 0E 58 2E 53 1E 4E FE FF 0E 93 F2 27 09 4E 78 49 48 11 68 9C F7 23 0A 4C FA 99 01 00 F3 23 1A 53 58 83 FA 23 19 B3 09 63 0C 49 6E 4E 1E F3 01 20 1E 83 8F 4C 00 00 -30 4D B2 85 0E 3E 4E 55 4D 42 45 52 1B 42 B6 21 +30 4D AE 85 0E 3E 4E 55 4D 42 45 52 1B 42 B6 21 3C 4F 38 4F 29 4F 2F 82 82 4B C0 04 6A 4C 7A 80 3A 00 03 28 7A 80 07 00 12 28 7A 50 0A 00 0A 9B 22 C3 0D 2C 82 49 E0 04 82 48 E2 04 19 42 E4 04 18 42 E6 04 09 5A 08 63 1C 53 1E 83 E7 23 8F 4C -00 00 8F 48 02 00 8F 49 04 00 30 4D 32 C0 00 02 -3F 82 8F 4E 06 00 08 43 09 43 1B 42 B6 21 0C 4E -0E 43 1E 15 3D 40 3C 87 7E 4C 6A 4C 7A 80 2D 00 -16 24 CA 2F 2B 43 7A 52 14 24 3B 52 6A 53 11 24 -3B 40 10 00 5A 93 0D 24 6A 92 41 20 3E 90 03 00 -3E 20 FC 9C 01 00 6C 4C 8F 4C 04 00 38 3C B1 43 -02 00 1E 83 FC 9C 00 00 E0 23 AE 27 3E 87 2F 24 -2D 83 6A 4C 7A 90 5F 00 BF 27 32 B0 00 02 27 20 -32 D0 00 02 7A 80 2E 00 B7 27 6A 53 20 20 0A 4E -09 43 8F 49 02 00 5A 83 09 4A 09 5C 69 49 79 80 -3A 00 03 28 79 80 07 00 0C 28 79 50 0A 00 09 9B -08 2C 8F 49 00 00 0E 4B 2C 15 B0 12 28 80 2A 17 -E8 3F 9F 4F 04 00 02 00 AF 4F 04 00 4A 93 1D 17 -04 24 3F 50 06 00 0E F3 30 4D 2F 53 9F 4F 02 00 -04 00 BF 4F 00 00 3E E3 09 20 3E E3 BF E3 02 00 -BF E3 00 00 9F 53 02 00 8F 63 00 00 32 B0 00 02 -47 26 30 4D EA 84 03 5C 92 42 BA 21 BE 21 30 4D -0D 12 84 12 6E 80 C6 85 9A 80 28 88 32 86 F0 87 -0A 4E 3E 4F 3D 40 0A 88 71 27 3D 40 E6 87 1A E2 +00 00 8F 48 02 00 8F 49 04 00 30 4D 3D 40 0A 88 +32 C0 00 02 3F 82 8F 4E 06 00 08 43 09 43 1B 42 +B6 21 0C 4E 0E 43 1E 15 3D 40 40 87 7E 4C 6A 4C +7A 80 2D 00 16 24 C8 2F 2B 43 7A 52 14 24 3B 52 +6A 53 11 24 3B 40 10 00 5A 93 0D 24 6A 92 41 20 +3E 90 03 00 3E 20 FC 9C 01 00 6C 4C 8F 4C 04 00 +38 3C B1 43 02 00 1E 83 FC 9C 00 00 E0 23 AC 27 +42 87 2F 24 2D 83 6A 4C 7A 90 5F 00 BD 27 32 B0 +00 02 27 20 32 D0 00 02 7A 80 2E 00 B5 27 6A 53 +20 20 0A 4E 09 43 8F 49 02 00 5A 83 09 4A 09 5C +69 49 79 80 3A 00 03 28 79 80 07 00 0C 28 79 50 +0A 00 09 9B 08 2C 8F 49 00 00 0E 4B 2C 15 B0 12 +BC 84 2A 17 E8 3F 9F 4F 04 00 02 00 AF 4F 04 00 +4A 93 1D 17 04 24 3F 50 06 00 0E F3 30 4D 2F 53 +9F 4F 02 00 04 00 BF 4F 00 00 3E E3 09 20 3E E3 +BF E3 02 00 BF E3 00 00 9F 53 02 00 8F 63 00 00 +32 B0 00 02 32 26 30 4D B0 84 03 5C 92 42 B8 21 +BC 21 30 4D 0D 12 84 12 34 83 C6 85 60 83 28 88 +32 86 F4 87 0A 4E 3E 4F 71 27 3D 40 EA 87 1A E2 B4 21 A0 24 0E 12 3E 4F 30 41 0C 88 3E 4F 3D 40 -E6 87 10 20 3D 40 FE 89 DE 53 00 00 68 4E 08 5E -F8 40 3F 00 00 00 2C 3C CA 83 D6 87 0F 4C 49 54 -45 52 41 4C 82 93 B4 21 0D 24 09 4E 1A 42 C0 21 -A2 52 C0 21 BA 40 00 80 00 00 8A 49 02 00 3E 4F +EA 87 10 20 3D 40 FC 89 DE 53 00 00 68 4E 08 5E +F8 40 3F 00 00 00 35 3C A4 83 DA 87 0F 4C 49 54 +45 52 41 4C 82 93 B4 21 0D 24 09 4E 1A 42 BE 21 +A2 52 BE 21 BA 40 0C 83 00 00 8A 49 02 00 3E 4F 32 B0 00 02 32 C0 00 02 03 24 8A 4E 02 00 EE 3F 30 4D 8F 4E FE FF 3E 40 80 20 0E 8F 0E 11 2F 83 -0E 5E 0E 7E 3E E3 30 4D 64 85 0A 43 4F 55 4E 54 -2F 83 7A 4E 8F 4E 00 00 0E 4A 3E F3 30 4D 2F 83 -8F 4E 00 00 0E 43 B2 90 40 FF C0 21 EB 2F 30 4D -A0 84 0A 41 4C 4C 4F 54 82 5E C0 21 3E 4F 30 4D -3F 40 80 20 0E 43 84 12 14 80 02 0D 0A 00 7E 83 -7E 80 E0 87 62 88 14 80 0B 73 74 61 63 6B 20 65 -6D 70 74 79 F2 80 8E 88 14 80 09 4D 41 49 4E 20 -66 75 6C 6C F2 80 9C 80 B8 88 A2 88 0D 41 42 4F -52 54 22 00 0D 12 84 12 B0 84 00 80 F2 80 44 89 -3C 85 BE 85 02 27 0D 12 84 12 C6 85 32 86 96 80 -14 89 3C 85 14 88 66 84 07 5B 27 5D 0D 12 84 12 -06 89 00 80 00 80 44 89 44 89 3C 85 18 89 03 5B +0E 5E 0E 7E 3E E3 30 4D 2F 83 8F 4E 00 00 0E 43 +B2 90 40 FF BE 21 F6 2F 30 4D 70 85 0A 43 4F 55 +4E 54 2F 83 7A 4E 8F 4E 00 00 0E 4A 3E F3 30 4D +E2 81 0A 41 4C 4C 4F 54 82 5E BE 21 3E 4F 30 4D +3F 40 80 20 0E 43 84 12 20 83 02 0D 0A 00 E4 82 +44 83 E4 87 62 88 20 83 0B 73 74 61 63 6B 20 65 +6D 70 74 79 68 80 78 88 20 83 09 4D 41 49 4E 20 +66 75 6C 6C 68 80 62 83 B8 88 A2 88 0D 41 42 4F +52 54 22 00 0D 12 84 12 76 84 0C 83 68 80 44 89 +48 85 BE 85 02 27 0D 12 84 12 C6 85 32 86 5C 83 +14 89 48 85 14 88 40 84 07 5B 27 5D 0D 12 84 12 +06 89 0C 83 0C 83 44 89 44 89 48 85 18 89 03 5B 82 43 B4 21 30 4D 00 00 02 5D B2 43 B4 21 30 4D -2C 88 02 2C A2 53 C0 21 1A 42 C0 21 8A 4E FE FF -3E 4F 30 4D 98 84 11 50 4F 53 54 50 4F 4E 45 00 -0D 12 84 12 C6 85 32 86 9A 80 14 89 70 88 96 80 -7E 89 00 80 00 80 44 89 44 89 00 80 44 89 44 89 -3C 85 00 00 02 3A 30 12 D0 89 92 B3 C0 21 A2 63 -C0 21 0D 12 84 12 C6 85 9A 89 3D 41 5A D3 5A 53 -0A 5E 19 42 C4 21 08 4E FE 5E FF FF 6E 4E 3E F0 -0F 00 0E 5E 09 5E 3E 4F 82 48 D8 21 82 49 DA 21 -82 4A DC 21 82 4F DE 21 2A 52 82 4A C0 21 30 41 +2C 88 02 2C A2 53 BE 21 1A 42 BE 21 8A 4E FE FF +3E 4F 30 4D 02 80 11 50 4F 53 54 50 4F 4E 45 00 +0D 12 84 12 C6 85 32 86 60 83 14 89 70 88 5C 83 +7E 89 0C 83 0C 83 44 89 44 89 0C 83 44 89 44 89 +48 85 00 00 02 3A 30 12 D0 89 92 B3 BE 21 A2 63 +BE 21 0D 12 84 12 C6 85 9A 89 3D 41 5A D3 5A 53 +0A 5E 19 42 C2 21 08 4E FE 5E FF FF 6E 4E 3E F0 +0F 00 0E 5E 09 5E 3E 4F 82 48 D6 21 82 49 D8 21 +82 4A DA 21 82 4F DC 21 2A 52 82 4A BE 21 30 41 BA 40 0D 12 FC FF BA 40 84 12 FE FF B2 43 B4 21 -30 4D 82 9F DE 21 01 20 0B 24 84 12 14 80 0F 73 -74 61 63 6B 20 6D 69 73 6D 61 74 63 68 21 FC 80 -18 42 D8 21 19 42 DA 21 A8 49 FE FF 89 48 00 00 -30 4D 2E 89 03 3B 82 93 B4 21 DE 26 0D 12 84 12 -00 80 3C 85 44 89 E2 89 30 89 3C 85 00 00 12 49 -4D 4D 45 44 49 41 54 45 18 42 D8 21 D8 D3 00 00 -30 4D 7A 88 0C 43 52 45 41 54 45 00 B0 12 8A 89 -BA 40 86 12 FC FF 8A 4A FE FF D6 3F 78 83 0A 44 -4F 45 53 3E 1A 42 DC 21 BA 40 85 12 00 00 8A 4D -02 00 3D 41 30 4D 84 89 0E 3A 4E 4F 4E 41 4D 45 -30 12 D0 89 2F 83 8F 4E 00 00 1A 42 C0 21 1A B3 -0A 63 0E 4A 39 40 12 02 08 49 8E 3F 2E 8A 05 49 -53 00 0D 12 82 93 B4 21 08 20 84 12 06 89 B0 8A -3D 41 BE 4F 02 00 3E 4F 30 4D 84 12 1C 89 00 80 -B2 8A 44 89 3C 85 44 8A 08 43 4F 44 45 00 B0 12 -8A 89 A2 82 C0 21 92 42 C6 21 C8 21 B2 40 A8 8B -C6 21 30 4D 56 85 0E 48 44 4E 43 4F 44 45 12 12 -C4 21 B2 40 A8 8B C4 21 0D 12 84 12 CE 8A 00 8B -3D 41 B2 41 C4 21 30 4D C8 8A 0E 43 4F 44 45 4E -4E 4D 30 12 D2 8A B6 3F 00 00 0E 45 4E 44 43 4F -44 45 0B 4D 84 12 E2 89 2A 8B 0D 4B B2 40 86 8B -C6 21 82 43 C8 21 30 4D 00 00 0A 43 4F 4C 4F 4E -1A 42 C0 21 BA 40 0D 12 00 00 BA 40 84 12 02 00 -A2 52 C0 21 B2 43 B4 21 E9 3F 00 00 0A 4C 4F 32 -48 49 A2 83 C0 21 1A 42 C0 21 EF 3F E6 8A 0B 48 -49 32 4C 4F A2 53 C0 21 1A 42 C0 21 8A 4A FE FF -82 43 B4 21 A8 3F 56 89 EC 88 F2 8B 0A 8B 5E 8A -7C 85 2C 86 04 89 6E 8B 9E 8A 78 8A 14 8A 42 89 -3E 8C 84 86 00 00 00 00 F2 92 72 91 D6 92 92 90 -EE 90 44 91 24 92 30 92 B4 8F D8 90 00 00 00 00 -5C 8B A4 8E 00 00 4C 92 A6 8B 2B 42 BA 49 00 00 -2A 53 1B 83 FB 23 30 41 00 00 0E 52 53 54 5F 53 -45 54 39 40 C0 21 3A 40 42 18 B0 12 CA 8B 30 4D -DA 8B 0E 52 53 54 5F 52 45 54 39 40 42 18 3A 40 -C0 21 2C 49 B0 12 CA 8B 1A 42 C2 21 3B 40 10 00 -09 4A 08 49 29 83 18 48 FE FF 0C 98 FC 2B 89 48 -00 00 1B 83 F6 23 2A 4A 0A 93 F0 23 30 4D 30 8C -B2 4E 42 18 BE 12 3E 4F 3D 41 DF 3F 38 89 0C 4D -41 52 4B 45 52 00 12 12 BE 21 0D 12 84 12 C6 85 -32 86 96 80 5A 8C 86 84 04 88 5C 8C 3E 4F 3D 41 -B2 41 BE 21 B0 12 8A 89 BA 40 85 12 FC FF BA 40 -2E 8C FE FF 28 83 8A 48 00 00 BA 40 6C 80 02 00 -A2 52 C0 21 BD 3E 0E 93 B8 37 39 40 10 00 29 83 -B9 43 80 FF FC 23 B9 40 F0 81 FE FF 29 83 B9 40 -E0 81 FE FF 39 90 AE FF F9 23 39 40 10 18 B2 49 -E0 FF 3B 42 3A 40 3A 18 B0 12 CC 8B 82 43 4A 18 -9C 3F 12 12 BE 21 84 12 D0 85 32 86 96 80 F2 8C -D2 8C 3C 4E 3C 80 87 12 0A 24 1C 53 02 20 2E 4E -06 3C BE 90 2E 8C 00 00 01 20 3E 52 2E 83 21 53 -30 41 DC 86 96 80 FA 8C EE 8C FC 8C B2 41 BE 21 -30 41 92 83 BE 21 3E 40 28 00 0A 4E 3D 15 B0 12 -C2 8C 15 20 3E 40 2B 00 B0 12 C2 8C 06 20 3E 40 -2D 00 B0 12 C2 8C 92 83 BE 21 0E 12 1E 41 02 00 -84 12 D0 85 DC 86 96 80 14 89 3C 8D 3E 51 3A 17 -30 41 B0 12 02 8D 19 42 C0 21 89 4E 00 00 A2 53 -C0 21 3E 40 29 00 92 53 BE 21 1A 42 BE 21 3D 15 -84 12 D0 85 DC 86 96 80 74 8D 6C 8D 3E 90 10 00 -E6 2B 7E 2D 76 8D A2 41 BE 21 E1 3F 03 20 B0 12 -5A 8D 47 20 7A 90 23 00 23 20 B0 12 0A 8D 3C 40 -00 03 0E 93 40 24 3C 40 10 03 1E 93 3C 24 3C 40 -20 03 2E 93 38 24 3C 40 20 02 2E 92 34 24 3C 40 -30 02 3E 92 30 24 3C 40 30 03 3E 93 2C 24 3C 40 -30 00 19 42 C0 21 A2 53 C0 21 89 4E 00 00 23 3C -7A 90 26 00 05 20 3C 40 10 02 B0 12 0A 8D F1 3F -7A 90 40 00 0C 20 3C 40 20 00 B0 12 56 8D 11 20 -3C D0 10 00 3E 40 2B 00 B0 12 5A 8D 04 20 3C D0 -10 00 B0 12 42 8D 92 92 BA 21 BE 21 02 24 92 53 -BE 21 8E 10 0C 5E 3E 4F 30 4D 03 20 B0 12 5A 8D -F9 23 7A 90 26 00 03 20 3C D0 82 00 D6 3F 3C D0 -80 00 B0 12 42 8D EE 23 30 40 14 88 0C 43 1B 42 -C0 21 A2 53 C0 21 3A 40 20 00 19 42 BE 21 19 52 -BC 21 7A 99 FE 27 5A 49 FF FF 19 82 BC 21 82 49 -BE 21 7A 90 52 00 30 4D 00 00 08 52 45 54 49 00 -0D 12 84 12 00 80 00 13 44 89 3C 85 00 80 2C 00 -3C 8E 7C 8D 76 85 46 8E 1A 8E 8C 8E 3D 41 2C DE -8B 4C 00 00 C0 3F 00 00 06 4D 4F 56 85 12 7C 8E -00 40 98 8E 0A 4D 4F 56 2E 42 85 12 7C 8E 40 40 -00 00 06 41 44 44 85 12 7C 8E 00 50 B2 8E 0A 41 -44 44 2E 42 85 12 7C 8E 40 50 BE 8E 08 41 44 44 -43 00 85 12 7C 8E 00 60 CC 8E 0C 41 44 44 43 2E -42 00 85 12 7C 8E 40 60 3A 8B 08 53 55 42 43 00 -85 12 7C 8E 00 70 EA 8E 0C 53 55 42 43 2E 42 00 -85 12 7C 8E 40 70 F8 8E 06 53 55 42 85 12 7C 8E -00 80 08 8F 0A 53 55 42 2E 42 85 12 7C 8E 40 80 -14 8F 06 43 4D 50 85 12 7C 8E 00 90 22 8F 0A 43 -4D 50 2E 42 85 12 7C 8E 40 90 00 00 08 44 41 44 -44 00 85 12 7C 8E 00 A0 3C 8F 0C 44 41 44 44 2E -42 00 85 12 7C 8E 40 A0 6A 8E 06 42 49 54 85 12 -7C 8E 00 B0 5A 8F 0A 42 49 54 2E 42 85 12 7C 8E -40 B0 66 8F 06 42 49 43 85 12 7C 8E 00 C0 74 8F -0A 42 49 43 2E 42 85 12 7C 8E 40 C0 80 8F 06 42 -49 53 85 12 7C 8E 00 D0 8E 8F 0A 42 49 53 2E 42 -85 12 7C 8E 40 D0 00 00 06 58 4F 52 85 12 7C 8E -00 E0 A8 8F 0A 58 4F 52 2E 42 85 12 7C 8E 40 E0 -DA 8E 06 41 4E 44 85 12 7C 8E 00 F0 C2 8F 0A 41 -4E 44 2E 42 85 12 7C 8E 40 F0 76 85 3C 8E 7C 8D -E2 8F 0A 4C 3C F0 70 00 8A 10 3A F0 0F 00 0C DA -4D 3F 9A 8F 06 52 52 43 85 12 DA 8F 00 10 F4 8F -0A 52 52 43 2E 42 85 12 DA 8F 40 10 2E 8F 08 53 -57 50 42 00 85 12 DA 8F 80 10 00 90 06 52 52 41 -85 12 DA 8F 00 11 1C 90 0A 52 52 41 2E 42 85 12 -DA 8F 40 11 0E 90 06 53 58 54 85 12 DA 8F 80 11 -00 00 08 50 55 53 48 00 85 12 DA 8F 00 12 42 90 -0C 50 55 53 48 2E 42 00 85 12 DA 8F 40 12 36 90 -08 43 41 4C 4C 00 85 12 DA 8F 80 12 1A 53 0E 4A -84 12 B4 85 14 80 0D 6F 75 74 20 6F 66 20 62 6F -75 6E 64 73 FC 80 60 90 06 53 3E 3D 86 12 00 38 -88 90 04 53 3C 00 86 12 00 34 50 90 06 30 3E 3D -86 12 00 30 9C 90 04 30 3C 00 86 12 00 30 1A 8B -04 55 3C 00 86 12 00 2C B0 90 06 55 3E 3D 86 12 -00 28 A6 90 06 30 3C 3E 86 12 00 24 C4 90 04 30 -3D 00 86 12 00 20 00 00 04 49 46 00 1A 42 C0 21 -8A 4E 00 00 A2 53 C0 21 0E 4A 30 4D 4A 8F 08 54 -48 45 4E 00 1A 42 C0 21 08 4E 3E 4F 09 48 29 53 -0A 89 3A 90 FF 03 B3 2F 0A 11 88 DA 00 00 30 4D -BA 90 08 45 4C 53 45 00 1A 42 C0 21 BA 40 00 3C -00 00 A2 53 C0 21 2F 83 8F 4A 00 00 E3 3F 28 90 -0A 42 45 47 49 4E 2F 83 8F 4E 00 00 1E 42 C0 21 -30 4D 12 91 0A 55 4E 54 49 4C 3A 4F 08 4E 3E 4F -19 42 C0 21 2A 83 0A 89 3A 90 00 FC 88 3B 0A 11 -3A F0 FF 03 08 DA 89 48 00 00 A2 53 C0 21 30 4D -CE 8F 0A 41 47 41 49 4E 0A 4E 38 40 00 3C E7 3F -00 00 0A 57 48 49 4C 45 0D 12 84 12 DC 90 7A 84 -3C 85 30 91 0C 52 45 50 45 41 54 00 0D 12 84 12 -78 91 F4 90 3C 85 A8 91 3D 41 2E 4E 08 4E 3E 4F -2A 48 B2 92 BE 21 CA 2F 98 42 C0 21 00 00 30 4D -94 91 06 42 57 31 85 12 A6 91 E0 21 C2 91 06 42 -57 32 85 12 A6 91 E2 21 CE 91 06 42 57 33 85 12 -A6 91 E4 21 E6 91 3D 41 1A 42 C0 21 2E 4E 28 4E -8E 43 00 00 B2 92 BE 21 80 2B BA 4F 00 00 A2 53 -C0 21 8E 4A 00 00 3E 4F 30 4D 00 00 06 46 57 31 -85 12 E4 91 E6 21 0C 92 06 46 57 32 85 12 E4 91 -EA 21 18 92 06 46 57 33 85 12 E4 91 EA 21 82 91 -08 47 4F 54 4F 00 2F 83 8F 4E 00 00 3E 40 00 3C -0D 12 84 12 06 89 04 88 3C 85 00 00 0A 3F 47 4F -54 4F 3E 90 00 30 F4 27 3E E0 00 04 3E B0 00 10 -EF 27 3E E0 00 08 EC 3F 00 80 2C 00 46 8E D0 85 -DC 86 96 80 14 89 76 85 3C 8E 1A 8E 7E 92 0A 4E -3E 4F 1A 83 F3 32 29 4E 59 0E 0A 28 08 4C 59 0A -01 28 0C 8A 08 8A 38 90 10 00 E8 2E 5A 0E A7 3E -2A 92 E4 2E 8A 10 5A 06 A2 3E DA 91 08 52 52 43 -4D 00 85 12 68 92 50 00 AC 92 08 52 52 41 4D 00 -85 12 68 92 50 01 BA 92 08 52 4C 41 4D 00 85 12 -68 92 50 02 C8 92 08 52 52 55 4D 00 85 12 68 92 -50 03 CE 90 0A 50 55 53 48 4D 85 12 68 92 00 15 -E4 92 08 50 4F 50 4D 00 85 12 68 92 00 17 +30 4D 82 9F DC 21 0B 24 84 12 20 83 0F 73 74 61 +63 6B 20 6D 69 73 6D 61 74 63 68 21 72 80 18 42 +D6 21 19 42 D8 21 A8 49 FE FF 89 48 00 00 30 4D +2E 89 03 3B 82 93 B4 21 E1 26 0D 12 84 12 0C 83 +48 85 44 89 E2 89 30 89 48 85 00 00 12 49 4D 4D +45 44 49 41 54 45 18 42 D6 21 D8 D3 00 00 30 4D +8C 88 0C 43 52 45 41 54 45 00 B0 12 8A 89 BA 40 +86 12 FC FF 8A 4A FE FF D6 3F DE 82 0A 44 4F 45 +53 3E 1A 42 DA 21 BA 40 85 12 00 00 8A 4D 02 00 +3D 41 30 4D 84 89 0E 3A 4E 4F 4E 41 4D 45 30 12 +D0 89 2F 83 8F 4E 00 00 1A 42 BE 21 1A B3 0A 63 +0E 4A 39 40 12 02 08 49 8F 3F 2C 8A 05 49 53 00 +0D 12 82 93 B4 21 08 20 84 12 06 89 AE 8A 3D 41 +BE 4F 02 00 3E 4F 30 4D 84 12 1C 89 0C 83 B0 8A +44 89 48 85 56 89 EC 88 F0 8B 4C 8B 5C 8A 88 85 +2C 86 04 89 B0 8B 9C 8A 76 8A 12 8A 42 89 3C 8C +84 86 00 00 00 00 E8 92 68 91 CC 92 88 90 E4 90 +3A 91 1A 92 26 92 AA 8F CE 90 00 00 00 00 9E 8B +9A 8E 00 00 42 92 E4 8A 42 8A 08 43 4F 44 45 00 +B0 12 8A 89 A2 82 BE 21 92 42 C4 21 C6 21 B2 40 +E6 8A C4 21 30 4D 62 85 0E 48 44 4E 43 4F 44 45 +12 12 C2 21 B2 40 E6 8A C2 21 0D 12 84 12 10 8B +42 8B 3D 41 B2 41 C2 21 30 4D 0A 8B 0E 43 4F 44 +45 4E 4E 4D 30 12 14 8B 94 3F 00 00 0E 45 4E 44 +43 4F 44 45 0B 4D 84 12 E2 89 6C 8B 0D 4B B2 40 +C4 8A C4 21 82 43 C6 21 30 4D 00 00 0A 43 4F 4C +4F 4E 1A 42 BE 21 BA 40 0D 12 00 00 BA 40 84 12 +02 00 A2 52 BE 21 B2 43 B4 21 E9 3F 00 00 0A 4C +4F 32 48 49 A2 83 BE 21 1A 42 BE 21 EF 3F 28 8B +0B 48 49 32 4C 4F A2 53 BE 21 1A 42 BE 21 8A 4A +FE FF 82 43 B4 21 A8 3F 2B 42 BA 49 00 00 2A 53 +1B 83 FB 23 30 41 00 00 0E 52 53 54 5F 53 45 54 +39 40 BE 21 3A 40 46 18 B0 12 C8 8B 30 4D D8 8B +0E 52 53 54 5F 52 45 54 39 40 46 18 3A 40 BE 21 +2C 49 B0 12 C8 8B 1A 42 C0 21 3B 40 10 00 09 4A +08 49 29 83 18 48 FE FF 0C 98 FC 2B 89 48 00 00 +1B 83 F6 23 2A 4A 0A 93 F0 23 30 4D 2E 8C B2 4E +46 18 BE 12 3E 4F 3D 41 DF 3F 38 89 0C 4D 41 52 +4B 45 52 00 12 12 BC 21 0D 12 84 12 C6 85 32 86 +5C 83 58 8C 60 84 04 88 5A 8C 3E 4F 3D 41 B2 41 +BC 21 B0 12 8A 89 BA 40 85 12 FC FF BA 40 2C 8C +FE FF 28 83 8A 48 00 00 BA 40 00 85 02 00 A2 52 +BE 21 BD 3E 0E 93 B8 37 39 40 10 00 29 83 B9 43 +80 FF FC 23 B9 40 46 81 FE FF 29 83 B9 40 36 81 +FE FF 39 90 AE FF F9 23 39 40 10 18 B2 49 E0 FF +3B 40 0A 00 3A 40 3C 18 B0 12 CA 8B 9D 3F 12 12 +BC 21 84 12 D0 85 32 86 5C 83 EE 8C CE 8C 3C 4E +3C 80 87 12 0A 24 1C 53 02 20 2E 4E 06 3C BE 90 +2C 8C 00 00 01 20 3E 52 2E 83 21 53 30 41 E0 86 +5C 83 F6 8C EA 8C F8 8C B2 41 BC 21 30 41 92 83 +BC 21 3E 40 28 00 0A 4E 3D 15 B0 12 BE 8C 15 20 +3E 40 2B 00 B0 12 BE 8C 06 20 3E 40 2D 00 B0 12 +BE 8C 92 83 BC 21 0E 12 1E 41 02 00 84 12 D0 85 +E0 86 5C 83 14 89 38 8D 3E 51 3A 17 30 41 B0 12 +FE 8C 19 42 BE 21 89 4E 00 00 A2 53 BE 21 3E 40 +29 00 92 53 BC 21 1A 42 BC 21 3D 15 84 12 D0 85 +E0 86 5C 83 70 8D 68 8D 3E 90 10 00 E6 2B 7B 2D +72 8D A2 41 BC 21 E1 3F 03 20 B0 12 56 8D 44 20 +7A 90 23 00 23 20 B0 12 06 8D 3C 40 00 03 0E 93 +3D 24 3C 40 10 03 1E 93 39 24 3C 40 20 03 2E 93 +35 24 3C 40 30 03 3E 93 31 24 3C 40 20 02 2E 92 +2D 24 3C 40 30 02 3E 92 29 24 3C 40 30 00 19 42 +BE 21 A2 53 BE 21 89 4E 00 00 20 3C 7A 90 26 00 +05 20 3C 40 10 02 B0 12 06 8D F1 3F 7A 90 40 00 +0A 20 3C 40 20 00 B0 12 52 8D 0E 20 3E 40 2B 00 +B0 12 56 8D 02 20 B0 12 3E 8D 3C D0 10 00 3A 40 +FF 3F 0A 9C 82 63 BC 21 8E 10 0C 5E 3E 4F 30 4D +03 20 B0 12 56 8D F9 23 7A 90 26 00 03 20 3C D0 +82 00 D9 3F 3C D0 80 00 B0 12 3E 8D EE 23 30 40 +14 88 0C 43 1B 42 BE 21 A2 53 BE 21 3A 40 20 00 +19 42 BC 21 19 52 BA 21 7A 99 FE 27 5A 49 FF FF +19 82 BA 21 82 49 BC 21 7A 90 52 00 30 4D 00 00 +08 52 45 54 49 00 0D 12 84 12 0C 83 00 13 44 89 +48 85 0C 83 2C 00 32 8E 78 8D 82 85 3C 8E 10 8E +82 8E 3D 41 2C DE 8B 4C 00 00 C0 3F 00 00 06 4D +4F 56 85 12 72 8E 00 40 8E 8E 0A 4D 4F 56 2E 42 +85 12 72 8E 40 40 00 00 06 41 44 44 85 12 72 8E +00 50 A8 8E 0A 41 44 44 2E 42 85 12 72 8E 40 50 +B4 8E 08 41 44 44 43 00 85 12 72 8E 00 60 C2 8E +0C 41 44 44 43 2E 42 00 85 12 72 8E 40 60 7C 8B +08 53 55 42 43 00 85 12 72 8E 00 70 E0 8E 0C 53 +55 42 43 2E 42 00 85 12 72 8E 40 70 EE 8E 06 53 +55 42 85 12 72 8E 00 80 FE 8E 0A 53 55 42 2E 42 +85 12 72 8E 40 80 0A 8F 06 43 4D 50 85 12 72 8E +00 90 18 8F 0A 43 4D 50 2E 42 85 12 72 8E 40 90 +00 00 08 44 41 44 44 00 85 12 72 8E 00 A0 32 8F +0C 44 41 44 44 2E 42 00 85 12 72 8E 40 A0 60 8E +06 42 49 54 85 12 72 8E 00 B0 50 8F 0A 42 49 54 +2E 42 85 12 72 8E 40 B0 5C 8F 06 42 49 43 85 12 +72 8E 00 C0 6A 8F 0A 42 49 43 2E 42 85 12 72 8E +40 C0 76 8F 06 42 49 53 85 12 72 8E 00 D0 84 8F +0A 42 49 53 2E 42 85 12 72 8E 40 D0 00 00 06 58 +4F 52 85 12 72 8E 00 E0 9E 8F 0A 58 4F 52 2E 42 +85 12 72 8E 40 E0 D0 8E 06 41 4E 44 85 12 72 8E +00 F0 B8 8F 0A 41 4E 44 2E 42 85 12 72 8E 40 F0 +82 85 32 8E 78 8D D8 8F 0A 4C 3C F0 70 00 8A 10 +3A F0 0F 00 0C DA 4D 3F 90 8F 06 52 52 43 85 12 +D0 8F 00 10 EA 8F 0A 52 52 43 2E 42 85 12 D0 8F +40 10 24 8F 08 53 57 50 42 00 85 12 D0 8F 80 10 +F6 8F 06 52 52 41 85 12 D0 8F 00 11 12 90 0A 52 +52 41 2E 42 85 12 D0 8F 40 11 04 90 06 53 58 54 +85 12 D0 8F 80 11 00 00 08 50 55 53 48 00 85 12 +D0 8F 00 12 38 90 0C 50 55 53 48 2E 42 00 85 12 +D0 8F 40 12 2C 90 08 43 41 4C 4C 00 85 12 D0 8F +80 12 1A 53 0E 4A 84 12 B0 85 20 83 0D 6F 75 74 +20 6F 66 20 62 6F 75 6E 64 73 72 80 56 90 06 53 +3E 3D 86 12 00 38 7E 90 04 53 3C 00 86 12 00 34 +46 90 06 30 3E 3D 86 12 00 30 92 90 04 30 3C 00 +86 12 00 30 5C 8B 04 55 3C 00 86 12 00 2C A6 90 +06 55 3E 3D 86 12 00 28 9C 90 06 30 3C 3E 86 12 +00 24 BA 90 04 30 3D 00 86 12 00 20 00 00 04 49 +46 00 1A 42 BE 21 8A 4E 00 00 A2 53 BE 21 0E 4A +30 4D 40 8F 08 54 48 45 4E 00 1A 42 BE 21 08 4E +3E 4F 09 48 29 53 0A 89 3A 90 FF 03 B3 2F 0A 11 +88 DA 00 00 30 4D B0 90 08 45 4C 53 45 00 1A 42 +BE 21 BA 40 00 3C 00 00 A2 53 BE 21 2F 83 8F 4A +00 00 E3 3F 1E 90 0A 42 45 47 49 4E 2F 83 8F 4E +00 00 1E 42 BE 21 30 4D 08 91 0A 55 4E 54 49 4C +3A 4F 08 4E 3E 4F 19 42 BE 21 2A 83 0A 89 3A 90 +00 FC 88 3B 0A 11 3A F0 FF 03 08 DA 89 48 00 00 +A2 53 BE 21 30 4D C4 8F 0A 41 47 41 49 4E 0A 4E +38 40 00 3C E7 3F 00 00 0A 57 48 49 4C 45 0D 12 +84 12 D2 90 54 84 48 85 26 91 0C 52 45 50 45 41 +54 00 0D 12 84 12 6E 91 EA 90 48 85 9E 91 3D 41 +2E 4E 08 4E 3E 4F 2A 48 B2 92 BC 21 CA 2F 98 42 +BE 21 00 00 30 4D 8A 91 06 42 57 31 85 12 9C 91 +DE 21 B8 91 06 42 57 32 85 12 9C 91 E0 21 C4 91 +06 42 57 33 85 12 9C 91 E2 21 DC 91 3D 41 1A 42 +BE 21 2E 4E 28 4E 8E 43 00 00 B2 92 BC 21 80 2B +BA 4F 00 00 A2 53 BE 21 8E 4A 00 00 3E 4F 30 4D +00 00 06 46 57 31 85 12 DA 91 E4 21 02 92 06 46 +57 32 85 12 DA 91 E8 21 0E 92 06 46 57 33 85 12 +DA 91 E8 21 78 91 08 47 4F 54 4F 00 2F 83 8F 4E +00 00 3E 40 00 3C 0D 12 84 12 06 89 04 88 48 85 +00 00 0A 3F 47 4F 54 4F 3E 90 00 30 F4 27 3E E0 +00 04 3E B0 00 10 EF 27 3E E0 00 08 EC 3F 0C 83 +2C 00 3C 8E D0 85 E0 86 5C 83 14 89 82 85 32 8E +10 8E 74 92 0A 4E 3E 4F 1A 83 F3 32 29 4E 59 0E +0A 28 08 4C 59 0A 01 28 0C 8A 08 8A 38 90 10 00 +E8 2E 5A 0E A7 3E 2A 92 E4 2E 8A 10 5A 06 A2 3E +D0 91 08 52 52 43 4D 00 85 12 5E 92 50 00 A2 92 +08 52 52 41 4D 00 85 12 5E 92 50 01 B0 92 08 52 +4C 41 4D 00 85 12 5E 92 50 02 BE 92 08 52 52 55 +4D 00 85 12 5E 92 50 03 C4 90 0A 50 55 53 48 4D +85 12 5E 92 00 15 DA 92 08 50 4F 50 4D 00 85 12 +5E 92 00 17 @FF80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF -77 00 10 00 12 00 14 00 16 00 00 00 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -BC 82 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 -E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 E0 81 F0 81 +77 00 10 00 12 00 14 00 16 00 00 00 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +22 82 36 81 36 81 36 81 36 81 36 81 36 81 36 81 +36 81 36 81 36 81 36 81 36 81 36 81 36 81 46 81 q diff --git a/binaries/LP_MSP430FR2476_8MHz_I2C.txt b/binaries/LP_MSP430FR2476_8MHz_I2C.txt index 594bbba..2b8698b 100644 --- a/binaries/LP_MSP430FR2476_8MHz_I2C.txt +++ b/binaries/LP_MSP430FR2476_8MHz_I2C.txt @@ -1,320 +1,320 @@ @1800 -40 1F 12 00 00 00 F8 00 FD FF 90 01 10 00 A8 03 -96 82 5A 81 5A 81 34 81 30 81 E0 92 AA 8B 68 8B -68 8B 7C 82 1C 83 E8 82 3C 21 E0 20 1E 85 A0 80 -AE 80 5E 84 20 00 0A 00 00 20 5A 81 5A 81 34 81 -30 81 E0 92 AA 8B 68 8B 68 8B 00 00 00 00 00 00 -00 00 00 00 00 00 00 00 00 00 +40 1F 12 00 00 00 F8 00 FD FF 91 01 10 00 90 03 +FC 81 B0 80 48 80 B0 80 8A 80 86 80 D6 92 E8 8A +A6 8A A6 8A 00 00 E2 81 82 82 4E 82 3C 21 E0 20 +2A 85 48 83 56 83 38 84 0A 00 00 20 B0 80 48 80 +B0 80 8A 80 86 80 D6 92 E8 8A A6 8A A6 8A 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @8000 -2F 83 8F 4E 00 00 3E 4D 30 4D 8F 4E FE FF AF 4F -FC FF 2F 82 2F 82 8F 4E 02 00 7E 4D 8F 4D 00 00 -0D 5E 1D B3 0D 63 30 4D 0B 4E 1C 4F 02 00 2E 4F -0A 43 35 40 20 00 0E 93 04 20 05 11 0E 4C 0C 43 -09 43 0A 9B 01 28 0A 8B 09 69 08 68 15 83 07 30 -0C 5C 0E 6E 0A 6A F5 2B 0A 8B 12 D3 F5 3F 35 40 -A0 80 8F 4A 02 00 8F 49 00 00 0E 48 30 41 82 43 -BE 21 B2 4F BC 21 82 4E BA 21 3E 4F 30 4D 2F 82 -8F 4E 02 00 3E 40 54 00 BF 40 3C 21 00 00 AF 4F -FE FF 2F 83 F1 3C 0E 93 3E 4F 82 21 2D 4D 30 4D -2F 83 8F 4E 00 00 3E 41 0D 12 3D 4E 30 4D 2F 83 -8F 4E 00 00 3E 41 2E 4E 30 4D 3D 41 39 40 22 18 -B2 49 7A 82 B2 49 1A 83 B2 49 E6 82 B2 49 8A 80 -31 49 34 49 35 49 36 49 37 49 B2 49 B8 21 B2 49 -B6 21 B2 49 00 20 82 43 B4 21 92 12 3C 18 30 40 -68 8C 8F 93 02 00 02 20 2F 52 BF 3F 30 12 04 81 -78 43 F5 3C B0 12 BA 80 68 84 96 80 2E 81 34 83 -14 80 05 1B 5B 37 6D 40 60 83 00 80 02 18 7C 84 -96 85 60 83 14 80 04 1B 5B 30 6D 00 60 83 92 88 -48 43 DD 3C B2 D0 C0 07 80 05 18 42 02 18 08 11 -38 D0 00 04 82 48 94 05 F2 D0 0C 00 2A 02 92 C3 -80 05 A2 D2 AA 05 92 C3 30 01 30 41 92 12 3E 18 -84 12 34 83 14 80 07 0D 0A 1B 5B 37 6D 40 60 83 -00 80 02 18 7C 84 96 85 00 80 23 00 18 83 96 85 -14 80 19 46 61 73 74 46 6F 72 74 68 20 A9 4A 2E -4D 2E 54 68 6F 6F 72 65 6E 73 2C 20 60 83 00 80 -40 FF 18 91 70 84 62 85 14 80 0A 62 79 74 65 73 -20 66 72 65 65 00 9C 80 22 81 00 00 06 53 59 53 -92 12 3A 18 0E 93 06 38 02 24 1E B3 03 24 B0 12 -BA 80 5C 81 82 4E 08 18 D2 B3 21 02 02 20 B2 43 -08 18 B2 40 04 A5 20 01 92 D3 04 01 B2 D0 10 00 -00 01 B2 40 80 5A CC 01 31 40 E0 20 3F 40 80 20 -B2 D3 06 02 B2 40 FE FF 02 02 B2 D3 26 02 B2 40 -FF 7F 22 02 B2 D3 46 02 B2 40 FC FF 42 02 B2 40 -00 A5 60 01 B2 D0 10 00 86 01 F2 C3 82 01 F2 D0 -06 00 82 01 B2 40 F4 00 84 01 39 40 5C 00 18 42 -00 18 18 83 FE 23 19 83 FA 23 39 40 00 20 29 83 -89 43 00 20 FC 23 19 42 5E 01 1E 42 08 18 82 43 -08 18 7E B3 01 20 0E 49 B0 12 BA 80 5C 81 00 00 -0C 41 43 43 45 50 54 00 30 40 7C 82 0A 4E 2E 4F -0A 5E 3B 40 0A 00 3C 40 20 00 3D 15 92 12 40 18 -12 D2 06 18 FB 3F 21 52 A2 C2 AC 05 B2 B0 10 00 -80 05 F4 23 3A 17 92 B3 AC 05 FD 27 58 42 8C 05 -48 9C 08 2C 48 9B 0C 24 78 92 F5 23 2E 9F F3 27 -1E 83 F1 3F 0E 9A EF 2F CE 48 00 00 1E 53 EB 3F -B2 B0 10 00 80 05 FC 27 3E 8F 08 4C 21 3C 00 00 -06 4B 45 59 30 40 E8 82 30 12 FA 82 58 43 A2 B3 -AC 05 FD 27 C2 48 8E 05 30 41 2F 83 8F 4E 00 00 -92 B3 AC 05 FD 27 1E 42 8C 05 B0 12 30 81 30 4D -00 00 08 45 4D 49 54 00 30 40 1C 83 08 4E 3E 4F -A2 B3 AC 05 FD 27 C2 48 8E 05 30 4D 12 83 08 45 -43 48 4F 00 B2 40 A2 B3 20 83 78 40 05 00 B0 12 -EE 82 30 4D 00 00 0C 4E 4F 45 43 48 4F 00 B2 40 -30 4D 20 83 68 42 F3 3F 00 00 08 54 59 50 45 00 -0D 12 3D 40 76 83 39 4F 2D 83 2F 83 8F 4E 00 00 -7E 49 D2 3F 76 83 5E 83 F7 23 18 24 E0 82 0D 5B -54 48 45 4E 5D 00 30 4D 0C 4E 38 4F 3C 9F 39 4F -3E 4F 84 22 F9 98 00 00 81 22 19 53 1C 83 FA 23 -2D 53 30 4D 2F 53 3E 4F 1E 83 78 22 3E 4F 3D 41 -30 4D 7E 83 0D 5B 45 4C 53 45 5D 00 0D 12 84 12 -00 80 01 00 9C 80 D6 83 14 80 05 0D 6B 6F 20 0A -60 83 84 80 6E 80 A8 85 62 88 9A 80 C8 83 0A 80 -06 5B 54 48 45 4E 5D 00 88 83 F0 83 A4 83 D6 83 -0A 80 06 5B 45 4C 53 45 5D 00 88 83 02 84 A4 83 -0E 84 14 80 04 5B 49 46 5D 00 88 83 D6 83 74 84 -9C 80 D6 83 B4 83 09 5B 49 46 5D 00 0E 93 3E 4F -CD 27 30 4D 16 84 17 5B 55 4E 44 45 46 49 4E 45 -44 5D 0D 12 84 12 A8 85 14 86 3C 84 1E 83 0E 7E -3D 41 2F 53 30 4D 26 84 13 5B 44 45 46 49 4E 45 -44 5D 0D 12 84 12 A8 85 14 86 40 84 3F 12 2F 83 -8F 4E 00 00 3E 41 30 4D 2F 83 8F 4E 00 00 30 4D -3E 8F 3E E3 1E 53 30 4D 00 00 02 40 2E 4E 30 4D -70 82 02 21 BE 4F 00 00 3E 4F 30 4D BC 81 05 53 -22 00 2F 83 8F 4E 00 00 3E 40 22 00 0B 43 0D 12 -84 12 00 80 14 80 26 89 B6 85 AC 84 1A 53 1A B3 -82 6A C0 21 7B 3F 46 83 05 2E 22 00 0D 12 84 12 -92 84 00 80 60 83 26 89 1E 85 00 00 04 3C 23 00 -B2 40 B2 21 B2 21 30 4D 8E 84 02 23 1B 42 B6 21 -2C 4F 2F 83 B0 12 30 80 BF 4F 00 00 7A 90 0A 00 -02 28 7A 50 07 00 7A 50 30 00 92 83 B2 21 18 42 -B2 21 C8 4A 00 00 30 4D DA 84 04 23 53 00 0D 12 -84 12 DC 84 16 85 2D 83 09 DE 09 93 E1 23 3D 41 -30 4D 0A 85 04 23 3E 00 9F 42 B2 21 00 00 3E 40 -B2 21 2E 8F 30 4D 00 00 08 48 4F 4C 44 00 4A 4E -3E 4F DB 3F 24 85 08 53 49 47 4E 00 0E 93 3E 4F -7A 40 2D 00 D2 33 30 4D 86 12 20 00 2E 83 04 55 -2E 00 0C 43 2F 83 8F 4E 00 00 0E 4C 1D 15 3E F3 -06 34 BF E3 00 00 3E E3 9F 53 00 00 0E 63 84 12 -D0 84 58 85 3E 85 0E 85 5E 84 4C 85 28 85 60 83 -1E 85 B8 84 02 2E 0E 93 E4 37 3C 43 E3 3F 00 00 +00 00 02 40 2E 4E 30 4D 00 00 02 21 BE 4F 00 00 +3E 4F 30 4D 3D 41 39 40 26 18 B2 49 E0 81 B2 49 +80 82 B2 49 4C 82 B2 49 32 83 31 49 34 49 35 49 +36 49 37 49 B2 49 B6 21 B2 49 00 20 82 43 B4 21 +92 12 40 18 30 40 66 8C 78 43 04 3D 8F 93 02 00 +02 20 2F 52 99 3D 92 12 3E 18 B0 12 14 80 42 84 +3E 83 84 80 9A 82 02 83 05 1B 5B 37 6D 40 C6 82 +EE 82 02 18 04 80 92 85 C6 82 02 83 04 1B 5B 30 +6D 00 C6 82 92 88 48 43 E5 3C B2 D0 C0 07 80 05 +18 42 02 18 08 11 38 D0 00 04 82 48 94 05 F2 D0 +0C 00 2A 02 92 C3 80 05 A2 D2 AA 05 92 C3 30 01 +30 41 92 12 42 18 84 12 9A 82 02 83 07 0D 0A 1B +5B 37 6D 40 C6 82 EE 82 02 18 04 80 92 85 EE 82 +23 00 7E 82 92 85 02 83 19 46 61 73 74 46 6F 72 +74 68 20 A9 4A 2E 4D 2E 54 68 6F 6F 72 65 6E 73 +2C 20 C6 82 EE 82 40 FF 0E 91 4A 84 6E 85 02 83 +0A 62 79 74 65 73 20 66 72 65 65 00 44 83 78 80 +00 00 06 53 59 53 92 12 3C 18 0E 93 06 38 02 24 +1E B3 03 24 B0 12 14 80 B2 80 82 4E 08 18 D2 B3 +21 02 02 20 B2 43 08 18 B2 40 04 A5 20 01 92 D3 +04 01 B2 D0 10 00 00 01 B2 40 80 5A CC 01 31 40 +E0 20 3F 40 80 20 B2 D3 06 02 B2 40 FE FF 02 02 +B2 D3 26 02 B2 40 FF 7F 22 02 B2 D3 46 02 B2 40 +FC FF 42 02 B2 40 00 A5 60 01 B2 D0 10 00 86 01 +F2 C3 82 01 F2 D0 06 00 82 01 B2 40 F4 00 84 01 +39 40 5C 00 18 42 00 18 18 83 FE 23 19 83 FA 23 +39 40 00 20 29 83 89 43 00 20 FC 23 19 42 5A 01 +59 0E 09 59 19 D2 5C 01 59 0E 59 06 59 D2 5E 01 +1E 42 08 18 82 43 08 18 7E B3 01 20 0E 49 B0 12 +14 80 B2 80 0A 80 0C 41 43 43 45 50 54 00 30 40 +E2 81 0A 4E 2E 4F 0A 5E 3B 40 0A 00 3C 40 20 00 +3D 15 92 12 44 18 12 D2 06 18 FB 3F 21 52 A2 C2 +AC 05 B2 B0 10 00 80 05 F4 23 3A 17 92 B3 AC 05 +FD 27 58 42 8C 05 48 9C 08 2C 48 9B 0C 24 78 92 +F5 23 2E 9F F3 27 1E 83 F1 3F 0E 9A EF 2F CE 48 +00 00 1E 53 EB 3F B2 B0 10 00 80 05 FC 27 3E 8F +08 4C 21 3C 00 00 06 4B 45 59 30 40 4E 82 30 12 +60 82 58 43 A2 B3 AC 05 FD 27 C2 48 8E 05 30 41 +2F 83 8F 4E 00 00 92 B3 AC 05 FD 27 1E 42 8C 05 +B0 12 86 80 30 4D 00 00 08 45 4D 49 54 00 30 40 +82 82 08 4E 3E 4F A2 B3 AC 05 FD 27 C2 48 8E 05 +30 4D 78 82 08 45 43 48 4F 00 B2 40 A2 B3 86 82 +78 40 05 00 B0 12 54 82 30 4D 00 00 0C 4E 4F 45 +43 48 4F 00 B2 40 30 4D 86 82 68 42 F3 3F 00 00 +08 54 59 50 45 00 0D 12 3D 40 DC 82 39 4F 2D 83 +2F 83 8F 4E 00 00 7E 49 D2 3F DC 82 5E 83 F7 23 +52 24 46 82 0D 5B 54 48 45 4E 5D 00 30 4D 2F 83 +8F 4E 00 00 3E 4D 30 4D 8F 4E FE FF AF 4F FC FF +2F 82 2F 82 8F 4E 02 00 7E 4D 8F 4D 00 00 0D 5E +1D B3 0D 63 30 4D 82 43 BC 21 B2 4F BA 21 82 4E +B8 21 3E 4F 30 4D 2F 82 8F 4E 02 00 3E 40 54 00 +BF 40 3C 21 00 00 AF 4F FE FF 2F 83 50 3F 0E 93 +3E 4F 1B 20 2D 4D 30 4D 2F 83 8F 4E 00 00 3E 41 +0D 12 3D 4E 30 4D 2F 83 8F 4E 00 00 3E 41 2E 4E +30 4D 0C 4E 38 4F 3C 9F 39 4F 3E 4F EB 23 F9 98 +00 00 E8 23 19 53 1C 83 FA 23 2D 53 30 4D 2F 53 +3E 4F 1E 83 DF 23 3D 41 3E 4F 30 4D E4 82 0D 5B +45 4C 53 45 5D 00 0D 12 84 12 EE 82 01 00 44 83 +B0 83 02 83 05 0D 6B 6F 20 0A C6 82 2C 83 16 83 +A8 85 74 88 42 83 A2 83 F8 82 06 5B 54 48 45 4E +5D 00 62 83 CA 83 7E 83 B0 83 F8 82 06 5B 45 4C +53 45 5D 00 62 83 DC 83 7E 83 E8 83 02 83 04 5B +49 46 5D 00 62 83 B0 83 4E 84 44 83 B0 83 8E 83 +09 5B 49 46 5D 00 0E 93 3E 4F CD 27 30 4D F0 83 +17 5B 55 4E 44 45 46 49 4E 45 44 5D 0D 12 84 12 +A8 85 14 86 16 84 1E 83 0E 7E 3D 41 2F 53 30 4D +00 84 13 5B 44 45 46 49 4E 45 44 5D 0D 12 84 12 +A8 85 14 86 1A 84 3F 12 2F 83 8F 4E 00 00 3E 41 +30 4D 2F 83 8F 4E 00 00 30 4D 3E 8F 3E E3 1E 53 +30 4D 12 81 05 53 22 00 2F 83 8F 4E 00 00 3E 40 +22 00 0B 43 0D 12 84 12 EE 82 02 83 26 89 B6 85 +72 84 1A 53 1A B3 82 6A BE 21 85 3F AC 82 05 2E +22 00 0D 12 84 12 58 84 EE 82 C6 82 26 89 2A 85 +00 00 04 3C 23 00 B2 40 B2 21 B2 21 30 4D 0B 4E +1C 4F 02 00 2E 4F 0A 43 35 40 20 00 0E 93 04 20 +05 11 0E 4C 0C 43 09 43 0A 9B 01 28 0A 8B 09 69 +08 68 15 83 07 30 0C 5C 0E 6E 0A 6A F5 2B 0A 8B +12 D3 F5 3F 35 40 48 83 8F 4A 02 00 8F 49 00 00 +0E 48 30 41 54 84 02 23 1B 42 B6 21 2C 4F 2F 83 +B0 12 A6 84 BF 4F 00 00 7A 90 0A 00 02 28 7A 50 +07 00 7A 50 30 00 92 83 B2 21 18 42 B2 21 C8 4A +00 00 30 4D E6 84 04 23 53 00 0D 12 84 12 E8 84 +22 85 2D 83 09 DE 09 93 E1 23 3D 41 30 4D 16 85 +04 23 3E 00 9F 42 B2 21 00 00 3E 40 B2 21 2E 8F +30 4D 00 00 08 48 4F 4C 44 00 4A 4E 3E 4F DB 3F +30 85 08 53 49 47 4E 00 0E 93 3E 4F 7A 40 2D 00 +D2 33 30 4D 86 12 20 00 94 82 04 55 2E 00 0C 43 +2F 83 8F 4E 00 00 0E 43 1D 15 84 12 96 84 64 85 +4A 85 1A 85 38 84 58 85 34 85 C6 82 2A 85 7E 84 +02 2E 0E 93 EC 37 3E E3 1E 53 3C 43 E9 3F 00 00 08 57 4F 52 44 00 05 3C 2F 83 8F 4E 00 00 3E 40 -20 00 1B 42 B8 21 3C 40 BA 21 39 4C 38 4C 09 58 -38 5C 2A 4C 08 99 1C 2C 7E 98 FC 27 18 83 F8 90 +20 00 3B 40 20 00 3C 40 B8 21 39 4C 38 4C 09 58 +38 5C 2A 4C 08 99 18 2C 7E 98 FC 27 18 83 F8 90 27 00 02 00 01 20 0B 43 CA 4C 00 00 08 99 0C 24 7C 48 4E 9C 09 24 1A 53 7C 90 61 00 F5 2B 7C 90 -7B 00 F2 2F 4C 8B F0 3F 18 82 BC 21 82 48 BE 21 -1E 42 C0 21 0A 8E CE 4A 00 00 30 4D 00 00 08 46 -49 4E 44 00 2F 83 0C 4E 3B 40 C6 21 3E 4B 0E 93 +7B 00 F2 2F 4C 8B F0 3F 18 82 BA 21 82 48 BC 21 +1E 42 BE 21 0A 8E CE 4A 00 00 30 4D 00 00 08 46 +49 4E 44 00 2F 83 0C 4E 3B 40 C4 21 3E 4B 0E 93 1E 24 58 4C 01 00 78 F0 0F 00 08 58 0E 58 2E 53 1E 4E FE FF 0E 93 F2 27 09 4E 78 49 48 11 68 9C F7 23 0A 4C FA 99 01 00 F3 23 1A 53 58 83 FA 23 19 B3 09 63 0C 49 6E 4E 1E F3 01 20 1E 83 8F 4C -00 00 30 4D 94 85 0E 3E 4E 55 4D 42 45 52 1B 42 +00 00 30 4D 90 85 0E 3E 4E 55 4D 42 45 52 1B 42 B6 21 3C 4F 38 4F 29 4F 2F 82 82 4B C0 04 6A 4C 7A 80 3A 00 03 28 7A 80 07 00 12 28 7A 50 0A 00 0A 9B 22 C3 0D 2C 82 49 E0 04 82 48 E2 04 19 42 E4 04 18 42 E6 04 09 5A 08 63 1C 53 1E 83 E7 23 -8F 4C 00 00 8F 48 02 00 8F 49 04 00 30 4D 32 C0 -00 02 3F 82 8F 4E 06 00 08 43 09 43 1B 42 B6 21 -0C 4E 0E 43 1E 15 3D 40 1E 87 7E 4C 6A 4C 7A 80 -2D 00 16 24 CA 2F 2B 43 7A 52 14 24 3B 52 6A 53 -11 24 3B 40 10 00 5A 93 0D 24 6A 92 41 20 3E 90 -03 00 3E 20 FC 9C 01 00 6C 4C 8F 4C 04 00 38 3C -B1 43 02 00 1E 83 FC 9C 00 00 E0 23 AE 27 20 87 -2F 24 2D 83 6A 4C 7A 90 5F 00 BF 27 32 B0 00 02 -27 20 32 D0 00 02 7A 80 2E 00 B7 27 6A 53 20 20 -0A 4E 09 43 8F 49 02 00 5A 83 09 4A 09 5C 69 49 -79 80 3A 00 03 28 79 80 07 00 0C 28 79 50 0A 00 -09 9B 08 2C 8F 49 00 00 0E 4B 2C 15 B0 12 28 80 -2A 17 E8 3F 9F 4F 04 00 02 00 AF 4F 04 00 4A 93 -1D 17 04 24 3F 50 06 00 0E F3 30 4D 2F 53 9F 4F -02 00 04 00 BF 4F 00 00 3E E3 09 20 3E E3 BF E3 -02 00 BF E3 00 00 9F 53 02 00 8F 63 00 00 32 B0 -00 02 47 26 30 4D CC 84 03 5C 92 42 BA 21 BE 21 -30 4D 0D 12 84 12 6E 80 A8 85 9A 80 0A 88 14 86 -D2 87 0A 4E 3E 4F 3D 40 EC 87 71 27 3D 40 C8 87 +8F 4C 00 00 8F 48 02 00 8F 49 04 00 30 4D 3D 40 +EC 87 32 C0 00 02 3F 82 8F 4E 06 00 08 43 09 43 +1B 42 B6 21 0C 4E 0E 43 1E 15 3D 40 22 87 7E 4C +6A 4C 7A 80 2D 00 16 24 C8 2F 2B 43 7A 52 14 24 +3B 52 6A 53 11 24 3B 40 10 00 5A 93 0D 24 6A 92 +41 20 3E 90 03 00 3E 20 FC 9C 01 00 6C 4C 8F 4C +04 00 38 3C B1 43 02 00 1E 83 FC 9C 00 00 E0 23 +AC 27 24 87 2F 24 2D 83 6A 4C 7A 90 5F 00 BD 27 +32 B0 00 02 27 20 32 D0 00 02 7A 80 2E 00 B5 27 +6A 53 20 20 0A 4E 09 43 8F 49 02 00 5A 83 09 4A +09 5C 69 49 79 80 3A 00 03 28 79 80 07 00 0C 28 +79 50 0A 00 09 9B 08 2C 8F 49 00 00 0E 4B 2C 15 +B0 12 9E 84 2A 17 E8 3F 9F 4F 04 00 02 00 AF 4F +04 00 4A 93 1D 17 04 24 3F 50 06 00 0E F3 30 4D +2F 53 9F 4F 02 00 04 00 BF 4F 00 00 3E E3 09 20 +3E E3 BF E3 02 00 BF E3 00 00 9F 53 02 00 8F 63 +00 00 32 B0 00 02 32 26 30 4D 92 84 03 5C 92 42 +B8 21 BC 21 30 4D 0D 12 84 12 16 83 A8 85 42 83 +0A 88 14 86 D6 87 0A 4E 3E 4F 71 27 3D 40 CC 87 1A E2 B4 21 A0 24 0E 12 3E 4F 30 41 EE 87 3E 4F -3D 40 C8 87 10 20 3D 40 E0 89 DE 53 00 00 68 4E -08 5E F8 40 3F 00 00 00 2C 3C AC 83 B8 87 0F 4C +3D 40 CC 87 10 20 3D 40 DE 89 DE 53 00 00 68 4E +08 5E F8 40 3F 00 00 00 35 3C 86 83 BC 87 0F 4C 49 54 45 52 41 4C 82 93 B4 21 0D 24 09 4E 1A 42 -C0 21 A2 52 C0 21 BA 40 00 80 00 00 8A 49 02 00 +BE 21 A2 52 BE 21 BA 40 EE 82 00 00 8A 49 02 00 3E 4F 32 B0 00 02 32 C0 00 02 03 24 8A 4E 02 00 EE 3F 30 4D 8F 4E FE FF 3E 40 80 20 0E 8F 0E 11 -2F 83 0E 5E 0E 7E 3E E3 30 4D 46 85 0A 43 4F 55 -4E 54 2F 83 7A 4E 8F 4E 00 00 0E 4A 3E F3 30 4D -2F 83 8F 4E 00 00 0E 43 B2 90 40 FF C0 21 EB 2F -30 4D 82 84 0A 41 4C 4C 4F 54 82 5E C0 21 3E 4F -30 4D 3F 40 80 20 0E 43 84 12 14 80 02 0D 0A 00 -60 83 7E 80 C2 87 44 88 14 80 0B 73 74 61 63 6B -20 65 6D 70 74 79 F2 80 70 88 14 80 09 4D 41 49 -4E 20 66 75 6C 6C F2 80 9C 80 9A 88 84 88 0D 41 -42 4F 52 54 22 00 0D 12 84 12 92 84 00 80 F2 80 -26 89 1E 85 A0 85 02 27 0D 12 84 12 A8 85 14 86 -96 80 F6 88 1E 85 F6 87 48 84 07 5B 27 5D 0D 12 -84 12 E8 88 00 80 00 80 26 89 26 89 1E 85 FA 88 +2F 83 0E 5E 0E 7E 3E E3 30 4D 2F 83 8F 4E 00 00 +0E 43 B2 90 40 FF BE 21 F6 2F 30 4D 52 85 0A 43 +4F 55 4E 54 2F 83 7A 4E 8F 4E 00 00 0E 4A 3E F3 +30 4D D6 81 0A 41 4C 4C 4F 54 82 5E BE 21 3E 4F +30 4D 3F 40 80 20 0E 43 84 12 02 83 02 0D 0A 00 +C6 82 26 83 C6 87 44 88 02 83 0B 73 74 61 63 6B +20 65 6D 70 74 79 4C 80 5A 88 02 83 09 4D 41 49 +4E 20 66 75 6C 6C 4C 80 44 83 9A 88 84 88 0D 41 +42 4F 52 54 22 00 0D 12 84 12 58 84 EE 82 4C 80 +26 89 2A 85 A0 85 02 27 0D 12 84 12 A8 85 14 86 +3E 83 F6 88 2A 85 F6 87 22 84 07 5B 27 5D 0D 12 +84 12 E8 88 EE 82 EE 82 26 89 26 89 2A 85 FA 88 03 5B 82 43 B4 21 30 4D 00 00 02 5D B2 43 B4 21 -30 4D 0E 88 02 2C A2 53 C0 21 1A 42 C0 21 8A 4E -FE FF 3E 4F 30 4D 7A 84 11 50 4F 53 54 50 4F 4E -45 00 0D 12 84 12 A8 85 14 86 9A 80 F6 88 52 88 -96 80 60 89 00 80 00 80 26 89 26 89 00 80 26 89 -26 89 1E 85 00 00 02 3A 30 12 B2 89 92 B3 C0 21 -A2 63 C0 21 0D 12 84 12 A8 85 7C 89 3D 41 5A D3 -5A 53 0A 5E 19 42 C4 21 08 4E FE 5E FF FF 6E 4E -3E F0 0F 00 0E 5E 09 5E 3E 4F 82 48 D8 21 82 49 -DA 21 82 4A DC 21 82 4F DE 21 2A 52 82 4A C0 21 +30 4D 0E 88 02 2C A2 53 BE 21 1A 42 BE 21 8A 4E +FE FF 3E 4F 30 4D 02 80 11 50 4F 53 54 50 4F 4E +45 00 0D 12 84 12 A8 85 14 86 42 83 F6 88 52 88 +3E 83 60 89 EE 82 EE 82 26 89 26 89 EE 82 26 89 +26 89 2A 85 00 00 02 3A 30 12 B2 89 92 B3 BE 21 +A2 63 BE 21 0D 12 84 12 A8 85 7C 89 3D 41 5A D3 +5A 53 0A 5E 19 42 C2 21 08 4E FE 5E FF FF 6E 4E +3E F0 0F 00 0E 5E 09 5E 3E 4F 82 48 D6 21 82 49 +D8 21 82 4A DA 21 82 4F DC 21 2A 52 82 4A BE 21 30 41 BA 40 0D 12 FC FF BA 40 84 12 FE FF B2 43 -B4 21 30 4D 82 9F DE 21 01 20 0B 24 84 12 14 80 -0F 73 74 61 63 6B 20 6D 69 73 6D 61 74 63 68 21 -FC 80 18 42 D8 21 19 42 DA 21 A8 49 FE FF 89 48 -00 00 30 4D 10 89 03 3B 82 93 B4 21 DE 26 0D 12 -84 12 00 80 1E 85 26 89 C4 89 12 89 1E 85 00 00 -12 49 4D 4D 45 44 49 41 54 45 18 42 D8 21 D8 D3 -00 00 30 4D 5C 88 0C 43 52 45 41 54 45 00 B0 12 -6C 89 BA 40 86 12 FC FF 8A 4A FE FF D6 3F 5A 83 -0A 44 4F 45 53 3E 1A 42 DC 21 BA 40 85 12 00 00 -8A 4D 02 00 3D 41 30 4D 66 89 0E 3A 4E 4F 4E 41 -4D 45 30 12 B2 89 2F 83 8F 4E 00 00 1A 42 C0 21 -1A B3 0A 63 0E 4A 39 40 12 02 08 49 8E 3F 10 8A -05 49 53 00 0D 12 82 93 B4 21 08 20 84 12 E8 88 -92 8A 3D 41 BE 4F 02 00 3E 4F 30 4D 84 12 FE 88 -00 80 94 8A 26 89 1E 85 26 8A 08 43 4F 44 45 00 -B0 12 6C 89 A2 82 C0 21 92 42 C6 21 C8 21 B2 40 -8A 8B C6 21 30 4D 38 85 0E 48 44 4E 43 4F 44 45 -12 12 C4 21 B2 40 8A 8B C4 21 0D 12 84 12 B0 8A -E2 8A 3D 41 B2 41 C4 21 30 4D AA 8A 0E 43 4F 44 -45 4E 4E 4D 30 12 B4 8A B6 3F 00 00 0E 45 4E 44 -43 4F 44 45 0B 4D 84 12 C4 89 0C 8B 0D 4B B2 40 -68 8B C6 21 82 43 C8 21 30 4D 00 00 0A 43 4F 4C -4F 4E 1A 42 C0 21 BA 40 0D 12 00 00 BA 40 84 12 -02 00 A2 52 C0 21 B2 43 B4 21 E9 3F 00 00 0A 4C -4F 32 48 49 A2 83 C0 21 1A 42 C0 21 EF 3F C8 8A -0B 48 49 32 4C 4F A2 53 C0 21 1A 42 C0 21 8A 4A -FE FF 82 43 B4 21 A8 3F 38 89 CE 88 D4 8B EC 8A -40 8A 5E 85 0E 86 E6 88 50 8B 80 8A 5A 8A F6 89 -24 89 20 8C 66 86 00 00 00 00 D4 92 54 91 B8 92 -74 90 D0 90 26 91 06 92 12 92 96 8F BA 90 00 00 -00 00 3E 8B 86 8E 00 00 2E 92 88 8B 2B 42 BA 49 -00 00 2A 53 1B 83 FB 23 30 41 00 00 0E 52 53 54 -5F 53 45 54 39 40 C0 21 3A 40 42 18 B0 12 AC 8B -30 4D BC 8B 0E 52 53 54 5F 52 45 54 39 40 42 18 -3A 40 C0 21 2C 49 B0 12 AC 8B 1A 42 C2 21 3B 40 -10 00 09 4A 08 49 29 83 18 48 FE FF 0C 98 FC 2B -89 48 00 00 1B 83 F6 23 2A 4A 0A 93 F0 23 30 4D -12 8C B2 4E 42 18 BE 12 3E 4F 3D 41 DF 3F 1A 89 -0C 4D 41 52 4B 45 52 00 12 12 BE 21 0D 12 84 12 -A8 85 14 86 96 80 3C 8C 68 84 E6 87 3E 8C 3E 4F -3D 41 B2 41 BE 21 B0 12 6C 89 BA 40 85 12 FC FF -BA 40 10 8C FE FF 28 83 8A 48 00 00 BA 40 6C 80 -02 00 A2 52 C0 21 BD 3E 0E 93 B8 37 39 40 10 00 -29 83 B9 43 80 FF FC 23 B9 40 E8 81 FE FF 29 83 -B9 40 D8 81 FE FF 39 90 AE FF F9 23 39 40 10 18 -B2 49 DA FF 3B 42 3A 40 3A 18 B0 12 AE 8B 82 43 -4A 18 9C 3F 12 12 BE 21 84 12 B2 85 14 86 96 80 -D4 8C B4 8C 3C 4E 3C 80 87 12 0A 24 1C 53 02 20 -2E 4E 06 3C BE 90 10 8C 00 00 01 20 3E 52 2E 83 -21 53 30 41 BE 86 96 80 DC 8C D0 8C DE 8C B2 41 -BE 21 30 41 92 83 BE 21 3E 40 28 00 0A 4E 3D 15 -B0 12 A4 8C 15 20 3E 40 2B 00 B0 12 A4 8C 06 20 -3E 40 2D 00 B0 12 A4 8C 92 83 BE 21 0E 12 1E 41 -02 00 84 12 B2 85 BE 86 96 80 F6 88 1E 8D 3E 51 -3A 17 30 41 B0 12 E4 8C 19 42 C0 21 89 4E 00 00 -A2 53 C0 21 3E 40 29 00 92 53 BE 21 1A 42 BE 21 -3D 15 84 12 B2 85 BE 86 96 80 56 8D 4E 8D 3E 90 -10 00 E6 2B 7E 2D 58 8D A2 41 BE 21 E1 3F 03 20 -B0 12 3C 8D 47 20 7A 90 23 00 23 20 B0 12 EC 8C -3C 40 00 03 0E 93 40 24 3C 40 10 03 1E 93 3C 24 -3C 40 20 03 2E 93 38 24 3C 40 20 02 2E 92 34 24 -3C 40 30 02 3E 92 30 24 3C 40 30 03 3E 93 2C 24 -3C 40 30 00 19 42 C0 21 A2 53 C0 21 89 4E 00 00 -23 3C 7A 90 26 00 05 20 3C 40 10 02 B0 12 EC 8C -F1 3F 7A 90 40 00 0C 20 3C 40 20 00 B0 12 38 8D -11 20 3C D0 10 00 3E 40 2B 00 B0 12 3C 8D 04 20 -3C D0 10 00 B0 12 24 8D 92 92 BA 21 BE 21 02 24 -92 53 BE 21 8E 10 0C 5E 3E 4F 30 4D 03 20 B0 12 -3C 8D F9 23 7A 90 26 00 03 20 3C D0 82 00 D6 3F -3C D0 80 00 B0 12 24 8D EE 23 30 40 F6 87 0C 43 -1B 42 C0 21 A2 53 C0 21 3A 40 20 00 19 42 BE 21 -19 52 BC 21 7A 99 FE 27 5A 49 FF FF 19 82 BC 21 -82 49 BE 21 7A 90 52 00 30 4D 00 00 08 52 45 54 -49 00 0D 12 84 12 00 80 00 13 26 89 1E 85 00 80 -2C 00 1E 8E 5E 8D 58 85 28 8E FC 8D 6E 8E 3D 41 -2C DE 8B 4C 00 00 C0 3F 00 00 06 4D 4F 56 85 12 -5E 8E 00 40 7A 8E 0A 4D 4F 56 2E 42 85 12 5E 8E -40 40 00 00 06 41 44 44 85 12 5E 8E 00 50 94 8E -0A 41 44 44 2E 42 85 12 5E 8E 40 50 A0 8E 08 41 -44 44 43 00 85 12 5E 8E 00 60 AE 8E 0C 41 44 44 -43 2E 42 00 85 12 5E 8E 40 60 1C 8B 08 53 55 42 -43 00 85 12 5E 8E 00 70 CC 8E 0C 53 55 42 43 2E -42 00 85 12 5E 8E 40 70 DA 8E 06 53 55 42 85 12 -5E 8E 00 80 EA 8E 0A 53 55 42 2E 42 85 12 5E 8E -40 80 F6 8E 06 43 4D 50 85 12 5E 8E 00 90 04 8F -0A 43 4D 50 2E 42 85 12 5E 8E 40 90 00 00 08 44 -41 44 44 00 85 12 5E 8E 00 A0 1E 8F 0C 44 41 44 -44 2E 42 00 85 12 5E 8E 40 A0 4C 8E 06 42 49 54 -85 12 5E 8E 00 B0 3C 8F 0A 42 49 54 2E 42 85 12 -5E 8E 40 B0 48 8F 06 42 49 43 85 12 5E 8E 00 C0 -56 8F 0A 42 49 43 2E 42 85 12 5E 8E 40 C0 62 8F -06 42 49 53 85 12 5E 8E 00 D0 70 8F 0A 42 49 53 -2E 42 85 12 5E 8E 40 D0 00 00 06 58 4F 52 85 12 -5E 8E 00 E0 8A 8F 0A 58 4F 52 2E 42 85 12 5E 8E -40 E0 BC 8E 06 41 4E 44 85 12 5E 8E 00 F0 A4 8F -0A 41 4E 44 2E 42 85 12 5E 8E 40 F0 58 85 1E 8E -5E 8D C4 8F 0A 4C 3C F0 70 00 8A 10 3A F0 0F 00 -0C DA 4D 3F 7C 8F 06 52 52 43 85 12 BC 8F 00 10 -D6 8F 0A 52 52 43 2E 42 85 12 BC 8F 40 10 10 8F -08 53 57 50 42 00 85 12 BC 8F 80 10 E2 8F 06 52 -52 41 85 12 BC 8F 00 11 FE 8F 0A 52 52 41 2E 42 -85 12 BC 8F 40 11 F0 8F 06 53 58 54 85 12 BC 8F -80 11 00 00 08 50 55 53 48 00 85 12 BC 8F 00 12 -24 90 0C 50 55 53 48 2E 42 00 85 12 BC 8F 40 12 -18 90 08 43 41 4C 4C 00 85 12 BC 8F 80 12 1A 53 -0E 4A 84 12 96 85 14 80 0D 6F 75 74 20 6F 66 20 -62 6F 75 6E 64 73 FC 80 42 90 06 53 3E 3D 86 12 -00 38 6A 90 04 53 3C 00 86 12 00 34 32 90 06 30 -3E 3D 86 12 00 30 7E 90 04 30 3C 00 86 12 00 30 -FC 8A 04 55 3C 00 86 12 00 2C 92 90 06 55 3E 3D -86 12 00 28 88 90 06 30 3C 3E 86 12 00 24 A6 90 -04 30 3D 00 86 12 00 20 00 00 04 49 46 00 1A 42 -C0 21 8A 4E 00 00 A2 53 C0 21 0E 4A 30 4D 2C 8F -08 54 48 45 4E 00 1A 42 C0 21 08 4E 3E 4F 09 48 -29 53 0A 89 3A 90 FF 03 B3 2F 0A 11 88 DA 00 00 -30 4D 9C 90 08 45 4C 53 45 00 1A 42 C0 21 BA 40 -00 3C 00 00 A2 53 C0 21 2F 83 8F 4A 00 00 E3 3F -0A 90 0A 42 45 47 49 4E 2F 83 8F 4E 00 00 1E 42 -C0 21 30 4D F4 90 0A 55 4E 54 49 4C 3A 4F 08 4E -3E 4F 19 42 C0 21 2A 83 0A 89 3A 90 00 FC 88 3B -0A 11 3A F0 FF 03 08 DA 89 48 00 00 A2 53 C0 21 -30 4D B0 8F 0A 41 47 41 49 4E 0A 4E 38 40 00 3C -E7 3F 00 00 0A 57 48 49 4C 45 0D 12 84 12 BE 90 -5C 84 1E 85 12 91 0C 52 45 50 45 41 54 00 0D 12 -84 12 5A 91 D6 90 1E 85 8A 91 3D 41 2E 4E 08 4E -3E 4F 2A 48 B2 92 BE 21 CA 2F 98 42 C0 21 00 00 -30 4D 76 91 06 42 57 31 85 12 88 91 E0 21 A4 91 -06 42 57 32 85 12 88 91 E2 21 B0 91 06 42 57 33 -85 12 88 91 E4 21 C8 91 3D 41 1A 42 C0 21 2E 4E -28 4E 8E 43 00 00 B2 92 BE 21 80 2B BA 4F 00 00 -A2 53 C0 21 8E 4A 00 00 3E 4F 30 4D 00 00 06 46 -57 31 85 12 C6 91 E6 21 EE 91 06 46 57 32 85 12 -C6 91 EA 21 FA 91 06 46 57 33 85 12 C6 91 EA 21 -64 91 08 47 4F 54 4F 00 2F 83 8F 4E 00 00 3E 40 -00 3C 0D 12 84 12 E8 88 E6 87 1E 85 00 00 0A 3F -47 4F 54 4F 3E 90 00 30 F4 27 3E E0 00 04 3E B0 -00 10 EF 27 3E E0 00 08 EC 3F 00 80 2C 00 28 8E -B2 85 BE 86 96 80 F6 88 58 85 1E 8E FC 8D 60 92 -0A 4E 3E 4F 1A 83 F3 32 29 4E 59 0E 0A 28 08 4C -59 0A 01 28 0C 8A 08 8A 38 90 10 00 E8 2E 5A 0E -A7 3E 2A 92 E4 2E 8A 10 5A 06 A2 3E BC 91 08 52 -52 43 4D 00 85 12 4A 92 50 00 8E 92 08 52 52 41 -4D 00 85 12 4A 92 50 01 9C 92 08 52 4C 41 4D 00 -85 12 4A 92 50 02 AA 92 08 52 52 55 4D 00 85 12 -4A 92 50 03 B0 90 0A 50 55 53 48 4D 85 12 4A 92 -00 15 C6 92 08 50 4F 50 4D 00 85 12 4A 92 00 17 +B4 21 30 4D 82 9F DC 21 0B 24 84 12 02 83 0F 73 +74 61 63 6B 20 6D 69 73 6D 61 74 63 68 21 56 80 +18 42 D6 21 19 42 D8 21 A8 49 FE FF 89 48 00 00 +30 4D 10 89 03 3B 82 93 B4 21 E1 26 0D 12 84 12 +EE 82 2A 85 26 89 C4 89 12 89 2A 85 00 00 12 49 +4D 4D 45 44 49 41 54 45 18 42 D6 21 D8 D3 00 00 +30 4D 6E 88 0C 43 52 45 41 54 45 00 B0 12 6C 89 +BA 40 86 12 FC FF 8A 4A FE FF D6 3F C0 82 0A 44 +4F 45 53 3E 1A 42 DA 21 BA 40 85 12 00 00 8A 4D +02 00 3D 41 30 4D 66 89 0E 3A 4E 4F 4E 41 4D 45 +30 12 B2 89 2F 83 8F 4E 00 00 1A 42 BE 21 1A B3 +0A 63 0E 4A 39 40 12 02 08 49 8F 3F 0E 8A 05 49 +53 00 0D 12 82 93 B4 21 08 20 84 12 E8 88 90 8A +3D 41 BE 4F 02 00 3E 4F 30 4D 84 12 FE 88 EE 82 +92 8A 26 89 2A 85 38 89 CE 88 D2 8B 2E 8B 3E 8A +6A 85 0E 86 E6 88 92 8B 7E 8A 58 8A F4 89 24 89 +1E 8C 66 86 00 00 00 00 CA 92 4A 91 AE 92 6A 90 +C6 90 1C 91 FC 91 08 92 8C 8F B0 90 00 00 00 00 +80 8B 7C 8E 00 00 24 92 C6 8A 24 8A 08 43 4F 44 +45 00 B0 12 6C 89 A2 82 BE 21 92 42 C4 21 C6 21 +B2 40 C8 8A C4 21 30 4D 44 85 0E 48 44 4E 43 4F +44 45 12 12 C2 21 B2 40 C8 8A C2 21 0D 12 84 12 +F2 8A 24 8B 3D 41 B2 41 C2 21 30 4D EC 8A 0E 43 +4F 44 45 4E 4E 4D 30 12 F6 8A 94 3F 00 00 0E 45 +4E 44 43 4F 44 45 0B 4D 84 12 C4 89 4E 8B 0D 4B +B2 40 A6 8A C4 21 82 43 C6 21 30 4D 00 00 0A 43 +4F 4C 4F 4E 1A 42 BE 21 BA 40 0D 12 00 00 BA 40 +84 12 02 00 A2 52 BE 21 B2 43 B4 21 E9 3F 00 00 +0A 4C 4F 32 48 49 A2 83 BE 21 1A 42 BE 21 EF 3F +0A 8B 0B 48 49 32 4C 4F A2 53 BE 21 1A 42 BE 21 +8A 4A FE FF 82 43 B4 21 A8 3F 2B 42 BA 49 00 00 +2A 53 1B 83 FB 23 30 41 00 00 0E 52 53 54 5F 53 +45 54 39 40 BE 21 3A 40 46 18 B0 12 AA 8B 30 4D +BA 8B 0E 52 53 54 5F 52 45 54 39 40 46 18 3A 40 +BE 21 2C 49 B0 12 AA 8B 1A 42 C0 21 3B 40 10 00 +09 4A 08 49 29 83 18 48 FE FF 0C 98 FC 2B 89 48 +00 00 1B 83 F6 23 2A 4A 0A 93 F0 23 30 4D 10 8C +B2 4E 46 18 BE 12 3E 4F 3D 41 DF 3F 1A 89 0C 4D +41 52 4B 45 52 00 12 12 BC 21 0D 12 84 12 A8 85 +14 86 3E 83 3A 8C 42 84 E6 87 3C 8C 3E 4F 3D 41 +B2 41 BC 21 B0 12 6C 89 BA 40 85 12 FC FF BA 40 +0E 8C FE FF 28 83 8A 48 00 00 BA 40 E2 84 02 00 +A2 52 BE 21 BD 3E 0E 93 B8 37 39 40 10 00 29 83 +B9 43 80 FF FC 23 B9 40 3E 81 FE FF 29 83 B9 40 +2E 81 FE FF 39 90 AE FF F9 23 39 40 10 18 B2 49 +DA FF 3B 40 0A 00 3A 40 3C 18 B0 12 AC 8B 9D 3F +12 12 BC 21 84 12 B2 85 14 86 3E 83 D0 8C B0 8C +3C 4E 3C 80 87 12 0A 24 1C 53 02 20 2E 4E 06 3C +BE 90 0E 8C 00 00 01 20 3E 52 2E 83 21 53 30 41 +C2 86 3E 83 D8 8C CC 8C DA 8C B2 41 BC 21 30 41 +92 83 BC 21 3E 40 28 00 0A 4E 3D 15 B0 12 A0 8C +15 20 3E 40 2B 00 B0 12 A0 8C 06 20 3E 40 2D 00 +B0 12 A0 8C 92 83 BC 21 0E 12 1E 41 02 00 84 12 +B2 85 C2 86 3E 83 F6 88 1A 8D 3E 51 3A 17 30 41 +B0 12 E0 8C 19 42 BE 21 89 4E 00 00 A2 53 BE 21 +3E 40 29 00 92 53 BC 21 1A 42 BC 21 3D 15 84 12 +B2 85 C2 86 3E 83 52 8D 4A 8D 3E 90 10 00 E6 2B +7B 2D 54 8D A2 41 BC 21 E1 3F 03 20 B0 12 38 8D +44 20 7A 90 23 00 23 20 B0 12 E8 8C 3C 40 00 03 +0E 93 3D 24 3C 40 10 03 1E 93 39 24 3C 40 20 03 +2E 93 35 24 3C 40 30 03 3E 93 31 24 3C 40 20 02 +2E 92 2D 24 3C 40 30 02 3E 92 29 24 3C 40 30 00 +19 42 BE 21 A2 53 BE 21 89 4E 00 00 20 3C 7A 90 +26 00 05 20 3C 40 10 02 B0 12 E8 8C F1 3F 7A 90 +40 00 0A 20 3C 40 20 00 B0 12 34 8D 0E 20 3E 40 +2B 00 B0 12 38 8D 02 20 B0 12 20 8D 3C D0 10 00 +3A 40 FF 3F 0A 9C 82 63 BC 21 8E 10 0C 5E 3E 4F +30 4D 03 20 B0 12 38 8D F9 23 7A 90 26 00 03 20 +3C D0 82 00 D9 3F 3C D0 80 00 B0 12 20 8D EE 23 +30 40 F6 87 0C 43 1B 42 BE 21 A2 53 BE 21 3A 40 +20 00 19 42 BC 21 19 52 BA 21 7A 99 FE 27 5A 49 +FF FF 19 82 BA 21 82 49 BC 21 7A 90 52 00 30 4D +00 00 08 52 45 54 49 00 0D 12 84 12 EE 82 00 13 +26 89 2A 85 EE 82 2C 00 14 8E 5A 8D 64 85 1E 8E +F2 8D 64 8E 3D 41 2C DE 8B 4C 00 00 C0 3F 00 00 +06 4D 4F 56 85 12 54 8E 00 40 70 8E 0A 4D 4F 56 +2E 42 85 12 54 8E 40 40 00 00 06 41 44 44 85 12 +54 8E 00 50 8A 8E 0A 41 44 44 2E 42 85 12 54 8E +40 50 96 8E 08 41 44 44 43 00 85 12 54 8E 00 60 +A4 8E 0C 41 44 44 43 2E 42 00 85 12 54 8E 40 60 +5E 8B 08 53 55 42 43 00 85 12 54 8E 00 70 C2 8E +0C 53 55 42 43 2E 42 00 85 12 54 8E 40 70 D0 8E +06 53 55 42 85 12 54 8E 00 80 E0 8E 0A 53 55 42 +2E 42 85 12 54 8E 40 80 EC 8E 06 43 4D 50 85 12 +54 8E 00 90 FA 8E 0A 43 4D 50 2E 42 85 12 54 8E +40 90 00 00 08 44 41 44 44 00 85 12 54 8E 00 A0 +14 8F 0C 44 41 44 44 2E 42 00 85 12 54 8E 40 A0 +42 8E 06 42 49 54 85 12 54 8E 00 B0 32 8F 0A 42 +49 54 2E 42 85 12 54 8E 40 B0 3E 8F 06 42 49 43 +85 12 54 8E 00 C0 4C 8F 0A 42 49 43 2E 42 85 12 +54 8E 40 C0 58 8F 06 42 49 53 85 12 54 8E 00 D0 +66 8F 0A 42 49 53 2E 42 85 12 54 8E 40 D0 00 00 +06 58 4F 52 85 12 54 8E 00 E0 80 8F 0A 58 4F 52 +2E 42 85 12 54 8E 40 E0 B2 8E 06 41 4E 44 85 12 +54 8E 00 F0 9A 8F 0A 41 4E 44 2E 42 85 12 54 8E +40 F0 64 85 14 8E 5A 8D BA 8F 0A 4C 3C F0 70 00 +8A 10 3A F0 0F 00 0C DA 4D 3F 72 8F 06 52 52 43 +85 12 B2 8F 00 10 CC 8F 0A 52 52 43 2E 42 85 12 +B2 8F 40 10 06 8F 08 53 57 50 42 00 85 12 B2 8F +80 10 D8 8F 06 52 52 41 85 12 B2 8F 00 11 F4 8F +0A 52 52 41 2E 42 85 12 B2 8F 40 11 E6 8F 06 53 +58 54 85 12 B2 8F 80 11 00 00 08 50 55 53 48 00 +85 12 B2 8F 00 12 1A 90 0C 50 55 53 48 2E 42 00 +85 12 B2 8F 40 12 0E 90 08 43 41 4C 4C 00 85 12 +B2 8F 80 12 1A 53 0E 4A 84 12 92 85 02 83 0D 6F +75 74 20 6F 66 20 62 6F 75 6E 64 73 56 80 38 90 +06 53 3E 3D 86 12 00 38 60 90 04 53 3C 00 86 12 +00 34 28 90 06 30 3E 3D 86 12 00 30 74 90 04 30 +3C 00 86 12 00 30 3E 8B 04 55 3C 00 86 12 00 2C +88 90 06 55 3E 3D 86 12 00 28 7E 90 06 30 3C 3E +86 12 00 24 9C 90 04 30 3D 00 86 12 00 20 00 00 +04 49 46 00 1A 42 BE 21 8A 4E 00 00 A2 53 BE 21 +0E 4A 30 4D 22 8F 08 54 48 45 4E 00 1A 42 BE 21 +08 4E 3E 4F 09 48 29 53 0A 89 3A 90 FF 03 B3 2F +0A 11 88 DA 00 00 30 4D 92 90 08 45 4C 53 45 00 +1A 42 BE 21 BA 40 00 3C 00 00 A2 53 BE 21 2F 83 +8F 4A 00 00 E3 3F 00 90 0A 42 45 47 49 4E 2F 83 +8F 4E 00 00 1E 42 BE 21 30 4D EA 90 0A 55 4E 54 +49 4C 3A 4F 08 4E 3E 4F 19 42 BE 21 2A 83 0A 89 +3A 90 00 FC 88 3B 0A 11 3A F0 FF 03 08 DA 89 48 +00 00 A2 53 BE 21 30 4D A6 8F 0A 41 47 41 49 4E +0A 4E 38 40 00 3C E7 3F 00 00 0A 57 48 49 4C 45 +0D 12 84 12 B4 90 36 84 2A 85 08 91 0C 52 45 50 +45 41 54 00 0D 12 84 12 50 91 CC 90 2A 85 80 91 +3D 41 2E 4E 08 4E 3E 4F 2A 48 B2 92 BC 21 CA 2F +98 42 BE 21 00 00 30 4D 6C 91 06 42 57 31 85 12 +7E 91 DE 21 9A 91 06 42 57 32 85 12 7E 91 E0 21 +A6 91 06 42 57 33 85 12 7E 91 E2 21 BE 91 3D 41 +1A 42 BE 21 2E 4E 28 4E 8E 43 00 00 B2 92 BC 21 +80 2B BA 4F 00 00 A2 53 BE 21 8E 4A 00 00 3E 4F +30 4D 00 00 06 46 57 31 85 12 BC 91 E4 21 E4 91 +06 46 57 32 85 12 BC 91 E8 21 F0 91 06 46 57 33 +85 12 BC 91 E8 21 5A 91 08 47 4F 54 4F 00 2F 83 +8F 4E 00 00 3E 40 00 3C 0D 12 84 12 E8 88 E6 87 +2A 85 00 00 0A 3F 47 4F 54 4F 3E 90 00 30 F4 27 +3E E0 00 04 3E B0 00 10 EF 27 3E E0 00 08 EC 3F +EE 82 2C 00 1E 8E B2 85 C2 86 3E 83 F6 88 64 85 +14 8E F2 8D 56 92 0A 4E 3E 4F 1A 83 F3 32 29 4E +59 0E 0A 28 08 4C 59 0A 01 28 0C 8A 08 8A 38 90 +10 00 E8 2E 5A 0E A7 3E 2A 92 E4 2E 8A 10 5A 06 +A2 3E B2 91 08 52 52 43 4D 00 85 12 40 92 50 00 +84 92 08 52 52 41 4D 00 85 12 40 92 50 01 92 92 +08 52 4C 41 4D 00 85 12 40 92 50 02 A0 92 08 52 +52 55 4D 00 85 12 40 92 50 03 A6 90 0A 50 55 53 +48 4D 85 12 40 92 00 15 BC 92 08 50 4F 50 4D 00 +85 12 40 92 00 17 @FF80 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF -77 00 10 00 12 00 14 00 16 00 00 00 D8 81 D8 81 -D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 -D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 -D8 81 D8 81 D8 81 D8 81 D8 81 96 82 D8 81 D8 81 -D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 -D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 D8 81 E8 81 +77 00 10 00 12 00 14 00 16 00 00 00 2E 81 2E 81 +2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 +2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 +2E 81 2E 81 2E 81 2E 81 2E 81 FC 81 2E 81 2E 81 +2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 +2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 2E 81 3E 81 q diff --git a/binaries/MSP430FRerase_total.bat b/binaries/MSP430FRerase_total.bat deleted file mode 100644 index fe8664f..0000000 --- a/binaries/MSP430FRerase_total.bat +++ /dev/null @@ -1,2 +0,0 @@ -a:\prog\MSP430Flasher\msp430flasher -e ERASE_TOTAL -pause diff --git a/binaries/MSP430erase_total.bat - Raccourci.lnk b/binaries/MSP430erase_total.bat - Raccourci.lnk new file mode 100644 index 0000000000000000000000000000000000000000..37e086a2a9d89b0721c916f9cf4076b628fab8b2 GIT binary patch literal 1208 zcmb7DUr3Wt6#s21X;^Kg_P>otFv>NXnJpJizxii1H`qo+i}|_coT(FCWKcm-MlgGb z0wD~IsUZsW5E5ZX@6jkStA~m(q!6(lRu4hveEUY*LxlI^ch0@%p6_?hIrrQn02Fyj zlEAbiQF8~`(9(Qz{)Kbk(yXF)acFMr`>f*HhtS{^(#I2iP{=x|EQ&m693Sm5?N?(^ zb#FEsyY%{jjo2d?JxQMwZAFQ+s&L;rtVSRhMmchjiN&XawZAXmu5HrMzEHqUIg;mJ zaeh7@0R#~y(^|M>rhxlPPz7J8qd6D=4#{jW*Za%7!)#@0=E!7`GDZvj1hzkT_QR_pEtp+qP~Zj2p_$78?t_nuf#M@~nT zkB9G%{BM7r8j>1i&_;YEPKR?rKlQE}*K0?A#@0o6RC$2mZRjs^AOHbza>alla`K5zGPmXA#j2t zt-d1D?U(9DGnlr&-4Nplwy^`B%zgFmi(O8GFe7k)z=u98Xcs2>I_pO3Ds@p)Ph>0E cTiBtFV3?VUyKWZRCsyqK{Co1vNwz1)AJ`}M*Z=?k literal 0 HcmV?d00001 diff --git a/binaries/MSP430erase_total.bat.lnk b/binaries/MSP430erase_total.bat.lnk deleted file mode 100644 index eecc6f2cd649dc3bd89e99fdf5776b75db91eb1c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1004 zcmbVLT}YE*6n?h6(1@C}BqQ32Btx8AdNr8t2en1toNSQM2X3y-K2ay`qoRwDuClxu zEC|vfoK|#MghVmw#ydwz^mmaEL`8{rK@dG>-&VT|d&hImd(L;>^YgyXjsq}R&6Gf) zB++vfwXk#V^>r?vyuNCx==_6gbHSxmQ;QJ?Q(0HkPgr3Kf9NaPzqmEa?bo$vaXM!k z(dKunm6$3Wg{x$Bg{Bn?66x`jHVky44mDVRno}-h<%@$c{T2z_Rf_&AUQVX{fElV94zwQY_Jx$7 zI;`pNyUSOg8eJzR;A&#tU|e;oBReXhSUGjCqX-&y$A_nTxx9rJfHpDPlMd~-f| z8^Cn$;*a9a`Aq7-Vfs%?EgP|os2;?QX87TT1j$+>B#CpQ>Ct-c9!q}19GjW@df!9; zRtbagKB`l9tHjrBV6&aLYr+fD0puW>4-#{lix%^u5_#?5BU91W08&A-D4X JkIn>D>o+f5%TfRU diff --git a/binaries/MSP430read.bat b/binaries/MSP430read.bat deleted file mode 100644 index acb7507..0000000 --- a/binaries/MSP430read.bat +++ /dev/null @@ -1,13 +0,0 @@ - -:: usage: MSP430Read RAM|INFO|MAIN|BSL output - -set howtoread=%1 -set readfile=%2 -if "%1" == "" set howtoread=MAIN -if "%2" == "" set readfile=DUMP - -A:\prog\MSP430Flasher\msp430flasher -m SBW2 -r [%readfile%_%howtoread%.HEX,%howtoread%] -z [VCC=3000] -::A:\prog\srecord\srec_cat %readfile%_%howtoread%.HEX -intel -output %readfile%_%howtoread%.bin -Binary -::A:\prog\HxD\HxD.exe" %readfile%_%howtoread%.bin - -pause diff --git a/binaries/MSP430read.bat - Raccourci.lnk b/binaries/MSP430read.bat - Raccourci.lnk new file mode 100644 index 0000000000000000000000000000000000000000..7fb78f68ffadbd6ba26ec224729e63989f542269 GIT binary patch literal 1149 zcmah|Ur1A76#s2XX|39Fibk~&2}ZeQ6D`wldHuIFH`pBoEpl#i-o>2gs2(CHCgWKjt*jTT#dQl}2$?l`4 z`*S(iYqbs(VZTu2|Le43I8Y`}s(m+|21KL;4k8!XSbQNk`uifj#x@K67Yf)ZSN2>H z7ry2r0tpFP+6qx+iuk@rdIaO0?NS6dqOv8$kC*umvsDZ8SN$rsG=Q8=2!1*rNb%C!4ql}UBS|5 zIM5lB)VWTmpL9R3Xt~l~{^t7F;nZ^ScjeWS3x?h^L)xdq4@Um?KS{NqE*NwXUzykA zU9e7msKd3!(O=2Dp`P|#oU;(0Wg>8*GOuMu$*R!zup^Bb0+U&niYFEux9NwMw5`2& zzdvNM4eY>VTL^2{P^l98p_WC~Ymwg#mrloXHqwu#nQXcLn3{{1Kj_Wcq3HoHNds8i@u=YHm#%p3Gv({k|~CncK+@ zeDV&$zl*tc8!!itLj*qPaY0NN@9SzBZK|~l)tv8T?hbZnBG_i%ffxZAr>ZQL2?5=)T%!Q^5R;+@;>_F##vdO z^`j{m&~`|>N)*lZq9Z)5cwwZHacdMf2M;Q+^(L!a&+v{!oQqy2R@>}d@o~Hf22w~O z4h!UpV@RL{TwX``w<1D`sBNwCjTR}`6$QdOk*6|QWh%pw-E|zVl10hLuU85RB2dwW zR>+uu2^}#=7@;{$%oBvc!t7k0CHPqPO-4#~)v{5UKV4!el z&8c(3)ML_!o<?9L7v!C$q;Ld5!^5kcqNdzagf$oF#2d(OG%ea?G6-a`OXxoYCT zxWr+(jST2X-g^I)yZ6GR3Il!9!`~-W(;w%r@@`kjj>;x0#P_Rmk?)#v#`Rw-M9rPa z3~VzWEVPKzv7Wcfr$bT5ET+0~g%#zliDPI*t6cIELCLM(i z?I;B&8unfi^{~5LWhUeKQo{kW2RNL9{8~cJmXMbvp|ZHXU;%cx;X)ZqFcNAA0W`t} z2P|;HfCkbziw#6)l|4<_xjvOdexf`gwm*3G;U=vhMTnDa@w<8n{g%j?5?=YPe2?z(bpM%#5VrhYtdckqAzr>H+P z8U1#`D{;HrGsdxZHMnLST8QVwI+_Z&evKR}pNNZ=oSq&|#aCFwX zPBSp4_ILGtySInzE7*a-a)_4JSGjYm_+T}&wC5gvQ{2uh)>%kAC>zPrY;p)52n&s4 z5Y5CxG&*`pCPbXGXr(Ve11npOkO#|AoJI$oW6+gEQpm)!W&IQpCpXvW1p74Y8^-T^q^X%no%#ritl! U&y7Oo$nqVZeviI6&i2Im15?iKXaE2J literal 0 HcmV?d00001 diff --git a/binaries/MSP430readMAIN.bat - Raccourci.lnk b/binaries/MSP430readMAIN.bat - Raccourci.lnk new file mode 100644 index 0000000000000000000000000000000000000000..6894136e1bbc92c0027279ad8957a8b5db052663 GIT binary patch literal 1185 zcma)5YeSWlV05un1VR{5h*&>XLC`th_nGrY9hFU1h#ywvBF{bJiW|O^i<&!$ z4D2?U`Zr>aQ11Whv?SP3A}JNVn@6>Xirv_cOr&G}sbKHxjr!_>M*1)4*(p=kx&AZZfThS3!#UK8YHH+S{7MC~!zYi+kT+=0A*9re%zDW+`jLoTmz*9c^eLOgaiZ zIX5$fy7dXBQ`L%?cEg`Q;L1l5Xt^p2s;6^FTFcE450ffnB zfelU=5hR_n*g|w(+0&Gr>r+A0NTefT`-5lSPibfuEM5z!uv9mxxI4(kZOkQ-ml}S* zySmt3V{tlc?59-5FDKI(34|RMo6{H!bW?OAeSV}?!M~!LuZ4heIw^N!IYJ{{gzh|e zLb*{#sJJB(XloS}Jxi#WbUi6^Ug;}+d423)@>l%lzMh6TZS3@r`tk7Hk^lXlq5jZh z3_1v}#N+nNnI_*=<7(aLk9f{dS5rRMFU+y>h`4B}=^0SC?CQJNk=6$y1~V-bOw8A9 z(hM)C8)E}s?;Rlf8g^i?9HN!=Rqot6K3K&p?YWoV6t^>rbru#Ml#OI*HaP?jL@kYD z2+hPJG&%-KCPJLEXr(Ve11nqV$%Ex~oJAL%W6*3ODdgg_W&I2hCpXd(Dy+QqLi=bM zQ?9og;y$u(V+W4Bo#@|9UD;SL7B8+E2Yje+6~=oztfST{<51vwa@Z4|U8k=Sr7$6 zC=zpqB-9U)2t)cGj3S-&M+hSdG4qE71-6m{h)b;iR-PKJ-`Y+_MQKn?MEG~b} zMGzvoNtFYa!W49W5;gFL+grpSa8zN7yFOg!Kg?FFWsY<0%LbYB$>usIzTv+0V(c+Bbo-6#7gGryCVvnA#=DXhFaKeGfIoN&MbGfe1206sLM z5mwS0(L_6rVH@F+GN&msXQ!0lCFBxV|Mb=3Sq;sC)nx^xm9i$Kb{FZmh&qBi)bMy5 z6@_(`)&^TG+bMbR$f0xwe9etko3Y8)jjiN}5gw$bz_SXs*F!)Fos$c(^1PS4AcqG| zDeiRm3)=#|_K>LTvxLfV`-|d+o4uB|cZQEF{fhrQcHgYbiem?j(_P_rLDh)No zfQ|TyoDS!lY5aW!ZdVWeh;NK`wd~~NHS=A10%t5WI0Fh+xW1bWX-pHC%(Rd{HebC( zGq|AkM*6=#IY9b#Y`|nWgw>RkOO{PQIg7N{E`Ca^%;G&SlJBUN)>2C{J$FJCb)g@v zBm>kj1_~rVk|PMw=c7KAH7Ch}*I`^h7oB6$4Fu`RJ00X;}7$J>*)Xh literal 0 HcmV?d00001 diff --git a/binaries/MSP430reset.bat b/binaries/MSP430reset.bat deleted file mode 100644 index 70cbe7a..0000000 --- a/binaries/MSP430reset.bat +++ /dev/null @@ -1 +0,0 @@ -a:\prog\MSP430Flasher\msp430flasher -m SBW2 -z [RESET,VCC=3300] \ No newline at end of file diff --git a/binaries/MSP430reset.bat - Raccourci.lnk b/binaries/MSP430reset.bat - Raccourci.lnk new file mode 100644 index 0000000000000000000000000000000000000000..602586f4967cfa9c067e7cdde0437b5bf24fefdf GIT binary patch literal 1154 zcmah|Ur1A76#s1+X_#%Ml2L6$f>ExmiRIF8dAI3mZm^Al7CP5Qx`4~^k1lCr(((T9~<~o z0TE#&$W#W8j3jzLhE)i}qM@(|oRra0o_E*y52Mwq8KaO{&YCo86amB#MTjsd6qUG) zqu`5*-erpx4!6ZB)L%8|PMJM`YZLOKgshT~x8$I*T9y>yfSV%fV1yoh2qI3DfDT>o zOZo31zkVW?1+wJIG!k_ZRS>cL(TndLDw2ZPV+NI!Dkhcn0NJ>Kx?VxKT^MrT|d979=?=RKAm_tneTs!Mvg{d+(CE- zx68e%pMTqe8@8#Rsh!DqXg`m2^K5T?bh@ZsBII{+Tf-u3HZYvnr=6BgH1{k6g)`r zqLrQkIfzt5+WLc6l_E;eOK%1nwf-FRq*gTa=0U-k-K>pz$XmXd_h#pPZ{E(gM*%oI zPO?DJv>3dGMhG;2{WG<4@@m;(`$*WgHL_fG_^muRs@`@Lc+jSN7%2(s0mFTBtq}($ zY2J&jU_iBVYJ42s=Bh6`E4!g((n(_iI1CpWPi2Wl+L9pZk*r(XiRCHDLs*%G^{0_zPsza zV|+X^U%dF~{pGXIKYxD|?`{9md}VIIxx9FLsowibqyZQ4hl#H{ro_HUkKcwcJ9O(u zY3D*V={rF2aXzb!u#HgLFaaHA$(+RFC4ot#jrNC?p;q_ehI4f8`qz6blO|4J5|%=} z-mp@35YW$N<(a8s4sr#ij%*1J)4G9!OwFwuBq?b)O;)G23sk&LmaCqmCqZJfBF8C% z=NX(MX;`GDjQVL||0p!2E!L%$Qd&oE;YIWPS169W*q}{Y^nwtOI0C%ffY7oX{cW;l7JUYXu#^@3!(mL@wgasWs3v`_2@bk zPumbf78xX NUL +start %~dp0CopyTo_SD_Card.bat %1 +@PAUSE > NUL exit :sendF -call %~dp1..\config\Select.bat SelectTemplate - -@start %~dp1..\config\CopyTo_SD_Card.bat %1 %~dp1..\inc\%template% %2 - -::PAUSE > NUL +call %~dp0Select.bat SelectTarget +@start %~dp0CopyTo_SD_Card.bat %1 %~dp1..\inc\%target% +@PAUSE > NUL exit + +:: %~dp0 is the path of this file.bat :: %1 is file.f or file.4th to be send -:: optionnal %2 may be used by CopyTo_SD_Card.bat diff --git a/config/CopyTo_SD_Card.bat b/config/CopyTo_SD_Card.bat index 048c32c..6b1840b 100644 --- a/config/CopyTo_SD_Card.bat +++ b/config/CopyTo_SD_Card.bat @@ -4,7 +4,7 @@ ::echo %2 ::echo %~dp1..\inc\%~n2.pat -@ECHO OFF +::@ECHO OFF ::first select part .4TH or .f @@ -12,6 +12,7 @@ IF /I "%~x1" == ".4TH" GOTO 4TH :: ============================================================================================== :: source file.f part +:: %~dp0 is the path of this file.bat :: %~dpn1.f is the symbolic source file.f described as drive\path\name.f :: %~d1\inc\%~n2.pat is the pattern file for preprocessor gema.exe :: %~dpn1.4TH is the source file.4TH to be sent to the target @@ -33,15 +34,12 @@ echo %~dpn1.f not found! goto badend ) -IF NOT EXIST %~dp1..\inc\%~n2.pat ( -echo %~dp1..\inc\%~n2.pat not found! +IF NOT EXIST %~dp0..\inc\%~n2.pat ( +echo %~dp0..\inc\%~n2.pat not found! goto badend ) IF /I "%3" == "" GOTO preprocessF -IF /I "%3" == "ECHO" GOTO preprocessF -IF /I "%3" == "NOECHO" GOTO preprocessF -IF /I "%3" == "HALF" GOTO preprocessF echo unexpected third parameter %3 ! @@ -51,26 +49,27 @@ exit :preprocessF -@%~d1\prog\gema.exe -nobackup -line -t '-\r\n=\r\n' -f %~dp1..\inc\%~n2.pat %~dpn1.f %~dpn1.4TH -@call %~dp1..\config\Select.bat SelectDeviceId %~dp1..\inc\%~n2.pat +%~dp0..\prog\gema.exe -nobackup -line -t '-\r\n=\r\n' -f %~dp0..\inc\%~n2.pat %~dpn1.f %~dpn1.4TH +call %~dp0Select.bat SelectDeviceId %~dp0..\inc\%~n2.pat :DownloadF -@taskkill /F /IM ttermpro.exe 1> NUL 2>&1 +taskkill /F /IM ttermpro.exe 1> NUL 2>&1 :win32F -@"C:\Program Files\teraterm\ttpmacro.exe" /V %~dp1..\config\SendToSD.ttl %~dpn1.4TH /C %deviceid% 1> NUL 2>&1 -@IF NOT ERRORLEVEL 1 GOTO EndF +"C:\Program Files\teraterm\ttpmacro.exe" /V %~dp0SendToSD.ttl %~dpn1.4TH /C %deviceid% 1> NUL 2>&1 +IF NOT ERRORLEVEL 1 GOTO EndF :win64F -@"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~dp1..\config\SendToSD.ttl %~dpn1.4TH /C %deviceid% +"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~dp0SendToSD.ttl %~dpn1.4TH /C %deviceid% :EndF -MOVE "%~dpn1.4TH" "%~dp1\LAST.4TH" > NUL +MOVE "%~dpn1.4TH" "%~dp1LAST.4TH" > NUL exit :: ============================================================================================== :: source file.4TH part +:: %~dp0 is the path of this file.bat :: %~dpn1.4TH is the file to be sent described as drive\path\name.4TH :: %~d1 is the drive of param %1 :: %~nx0 is name.ext of this bat file @@ -90,25 +89,21 @@ goto badend ) if /I "%2"=="" GOTO Download4th -if /I "%2"=="ECHO" GOTO Download4th -if /I "%2"=="NOECHO" GOTO Download4th -if /I "%2"=="HALF" GOTO Download4th echo unexpected 2th parameter %2 ! goto badend :Download4th -@taskkill /F /IM ttermpro.exe 1> NUL 2>&1 +taskkill /F /IM ttermpro.exe 1> NUL 2>&1 :win324th -@"C:\Program Files\teraterm\ttpmacro.exe" /V %~d0\config\SendtoSD.ttl %~dpn1.4TH /C 0 1> NUL 2>&1 -@IF NOT ERRORLEVEL 1 GOTO End4th +"C:\Program Files\teraterm\ttpmacro.exe" /V %~dp0SendtoSD.ttl %~dpn1.4TH /C 0 1> NUL 2>&1 +IF NOT ERRORLEVEL 1 GOTO End4th :win644th -@"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~d0\config\SendtoSD.ttl %~dpn1.4TH /C 0 +"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~dp0SendtoSD.ttl %~dpn1.4TH /C 0 :End4th -@COPY "%~dpn1.4TH" "%~dp1\LAST.4TH" > NUL exit diff --git a/config/FET_prog.bat b/config/FET_prog.bat index 52e05a4..c6678b7 100644 --- a/config/FET_prog.bat +++ b/config/FET_prog.bat @@ -1,34 +1,20 @@ ::@echo off set target=%~n1 -IF EXIST config\Select.bat ( -:: used by scite commands Ctrl+1 or Ctrl+4 - call config\Select.bat SelectDevice %%target%% - IF EXIST %~dp1binaries\%~n1.txt ( - call %~dp1prog\msp430flasher -s -m SBW2 -u -n %%device%% -v -w %~dp1binaries\%~n1.txt -z [RESET,VCC] - ) else ( -:: hex files generate error 60: verify error - IF EXIST %~dp1binaries\%~n1.hex ( - call %~dp1prog\msp430flasher -s -m SBW2 -u -n %%device%% -v -w %~dp1binaries\%~n1.hex -z [RESET,VCC] - ) - ) -) else ( - IF EXIST %~dp1..\config\Select.bat ( -:: used by drag n drop on \binaries\FET_prog.bat - call %~dp1..\config\Select.bat SelectDevice %%target%% - IF EXIST %~n1.txt ( - call %~dp1..\prog\msp430flasher -s -m SBW2 -u -n %%device%% -v -w %~n1.txt -z [RESET,VCC] - ) else ( + +call %~dp0Select.bat SelectDevice %target% +IF EXIST %~dp0..\binaries\%~n1.txt ( + call %~dp0..\prog\MSP430Flasher -s -m SBW2 -u -n %device% -v -w %~dp0..\binaries\%~n1.txt -z [RESET,VCC] + ) else ( :: hex files generate error 60: verify error - IF EXIST %~n1.hex ( - call %~dp1..\prog\msp430flasher -s -m SBW2 -u -n %%device%% -v -w %~n1.hex -z [RESET,VCC] - ) - ) - ) -) + IF EXIST %~dp0..\binaries\%~n1.hex ( + call %~dp0..\prog\MSP430Flasher -s -m SBW2 -u -n %device% -v -w %~dp0..\binaries\%~n1.hex -z [RESET,VCC] + ) + ) ::pause @exit +:: %~dp0 is the path of this file.bat :: %n1 = filename of file to flash :: -s : force update :: -m : select SBW2 mode diff --git a/config/Log/log.txt b/config/Log/log.txt new file mode 100644 index 0000000..68bb933 --- /dev/null +++ b/config/Log/log.txt @@ -0,0 +1,39 @@ +Mon Nov 7 14:29:12 2022: * -----/|-------------------------------------------------------------------- * +Mon Nov 7 14:29:12 2022: * / |__ * +Mon Nov 7 14:29:12 2022: * /_ / MSP Flasher v1.3.20 * +Mon Nov 7 14:29:12 2022: * | / * +Mon Nov 7 14:29:12 2022: * -----|/-------------------------------------------------------------------- * +Mon Nov 7 14:29:12 2022: * +Mon Nov 7 14:29:12 2022: * Evaluating triggers...done +Mon Nov 7 14:29:12 2022: * Checking for available FET debuggers: +Mon Nov 7 14:29:12 2022: * Found USB FET @ COM11 <- Selected +Mon Nov 7 14:29:12 2022: * Initializing interface @ COM11...done +Mon Nov 7 14:29:12 2022: * Checking firmware compatibility: +Mon Nov 7 14:29:12 2022: * FET firmware is up to date. +Mon Nov 7 14:29:12 2022: * Reading FW version... +Mon Nov 7 14:29:12 2022: * Debugger does not support target voltages other than 3000 mV! +Mon Nov 7 14:29:12 2022: * Setting VCC to 3000 mV...done +Mon Nov 7 14:29:13 2022: * Accessing device...done +Mon Nov 7 14:29:13 2022: * Reading device information...done +Mon Nov 7 14:29:14 2022: * +Mon Nov 7 14:29:14 2022: * ---------------------------------------------------------------------------- +Mon Nov 7 14:29:14 2022: * Arguments : -m SBW2 -z [RESET,VCC=3300] +Mon Nov 7 14:29:14 2022: * ---------------------------------------------------------------------------- +Mon Nov 7 14:29:14 2022: * Driver : loaded +Mon Nov 7 14:29:14 2022: * Dll Version : 31400000 +Mon Nov 7 14:29:14 2022: * FwVersion : 31200000 +Mon Nov 7 14:29:14 2022: * Interface : TIUSB +Mon Nov 7 14:29:14 2022: * HwVersion : E 4.0 +Mon Nov 7 14:29:14 2022: * JTAG Mode : AUTO +Mon Nov 7 14:29:14 2022: * Device : MSP430FR5994 +Mon Nov 7 14:29:14 2022: * EEM : Level 5, ClockCntrl 2 +Mon Nov 7 14:29:14 2022: * VCC ON : 3000 mV +Mon Nov 7 14:29:14 2022: * ---------------------------------------------------------------------------- +Mon Nov 7 14:29:14 2022: * Resetting device (RST/NMI)...done +Mon Nov 7 14:29:15 2022: * Starting target code execution...done +Mon Nov 7 14:29:15 2022: * Disconnecting from device...done +Mon Nov 7 14:29:15 2022: * +Mon Nov 7 14:29:15 2022: * ---------------------------------------------------------------------------- +Mon Nov 7 14:29:15 2022: * Driver : closed (No error) +Mon Nov 7 14:29:15 2022: * ---------------------------------------------------------------------------- +Mon Nov 7 14:29:15 2022: */ diff --git a/config/MSP430erase_total.bat b/config/MSP430erase_total.bat index 0dc0881..995a8b2 100644 --- a/config/MSP430erase_total.bat +++ b/config/MSP430erase_total.bat @@ -1,2 +1,3 @@ -\prog\msp430flasher -e ERASE_TOTAL +:: %~dp0 is the path of this file.bat +%~dp0..\prog\msp430flasher -e ERASE_TOTAL pause diff --git a/config/MSP430read.bat b/config/MSP430read.bat index 4a6c849..3ec4a3f 100644 --- a/config/MSP430read.bat +++ b/config/MSP430read.bat @@ -1,13 +1,15 @@ :: usage: MSP430Read RAM|INFO|MAIN|BSL output +:: %~dp0 is the path of this file.bat set howtoread=%1 set readfile=%2 if "%1" == "" set howtoread=MAIN -if "%2" == "" set readfile=MAIN_DUMP +if "%2" == "" set readfile=Target_MAIN -%~d1\prog\msp430flasher -m SBW2 -r [%readfile%.HEX,%howtoread%] -z [VCC=3000] -::%~d1\prog\srec_cat %readfile%_%howtoread%.HEX -intel -output %readfile%_%howtoread%.bin -Binary -::%~d1\prog\HxD\HxD.exe" %readfile%_%howtoread%.bin +%~dp0..\prog\msp430flasher -m SBW2 -r [%readfile%.HEX,%howtoread%] -z [VCC=3000] + +::%~dp0..\prog\srec_cat %readfile%_%howtoread%.HEX -intel -output %readfile%_%howtoread%.bin -Binary +::%~dp0..\prog\HxD\HxD.exe" %readfile%_%howtoread%.bin pause diff --git a/config/MSP430readINFO.bat b/config/MSP430readINFO.bat index fbf5de6..4ca4d0e 100644 --- a/config/MSP430readINFO.bat +++ b/config/MSP430readINFO.bat @@ -1,13 +1,9 @@ :: usage: MSP430Read RAM|INFO|MAIN|BSL output +:: %~dp0 is the path of this file.bat -::set howtoread=%1 -::set readfile=%2 -::if "%1" == "" set howtoread=MAIN -::if "%2" == "" set readfile=MAIN_DUMP - -%~d1\prog\msp430flasher -m SBW2 -r [target_INFO.txt,INFO] -z [VCC=3000] -::%~d1\prog\srec_cat %readfile%_%howtoread%.HEX -intel -output %readfile%_%howtoread%.bin -Binary -::%~d1\prog\HxD\HxD.exe" %readfile%_%howtoread%.bin +%~dp0..\prog\msp430flasher -m SBW2 -r [target_INFO.txt,INFO] -z [VCC=3000] +::%~dp0..\prog\srec_cat %readfile%_%howtoread%.HEX -intel -output %readfile%_%howtoread%.bin -Binary +::%~dp0..\prog\HxD\HxD.exe" %readfile%_%howtoread%.bin pause diff --git a/config/MSP430readMAIN.bat b/config/MSP430readMAIN.bat index 6e45532..2bf5f03 100644 --- a/config/MSP430readMAIN.bat +++ b/config/MSP430readMAIN.bat @@ -1,13 +1,9 @@ :: usage: MSP430Read RAM|INFO|MAIN|BSL output +:: %~dp0 is the path of this file.bat -::set howtoread=%1 -::set readfile=%2 -::if "%1" == "" set howtoread=MAIN -::if "%2" == "" set readfile=MAIN_DUMP - -%~d1\prog\msp430flasher -m SBW2 -r [target_MAIN.txt,MAIN] -z [VCC=3000] -::%~d1\prog\srec_cat %readfile%_%howtoread%.HEX -intel -output %readfile%_%howtoread%.bin -Binary -::%~d1\prog\HxD\HxD.exe" %readfile%_%howtoread%.bin +%~dp0..\prog\msp430flasher -m SBW2 -r [target_MAIN.txt,MAIN] -z [VCC=3000] +::%~dp0..\prog\srec_cat %readfile%_%howtoread%.HEX -intel -output %readfile%_%howtoread%.bin -Binary +::%~dp0..\prog\HxD\HxD.exe" %readfile%_%howtoread%.bin pause diff --git a/config/MSP430readRAM.bat b/config/MSP430readRAM.bat index f6e05c3..d74e041 100644 --- a/config/MSP430readRAM.bat +++ b/config/MSP430readRAM.bat @@ -1,13 +1,9 @@ :: usage: MSP430Read RAM|INFO|MAIN|BSL output +:: %~dp0 is the path of this file.bat -::set howtoread=%1 -::set readfile=%2 -::if "%1" == "" set howtoread=MAIN -::if "%2" == "" set readfile=MAIN_DUMP - -%~d1\prog\msp430flasher -m SBW2 -r [target_RAM.txt,RAM] -z [VCC=3000] -::%~d1\prog\srec_cat %readfile%_%howtoread%.HEX -intel -output %readfile%_%howtoread%.bin -Binary -::%~d1\prog\HxD\HxD.exe" %readfile%_%howtoread%.bin +%~dp0..\prog\msp430flasher -m SBW2 -r [target_RAM.txt,RAM] -z [VCC=3000] +::%~dp0..\prog\srec_cat %readfile%_%howtoread%.HEX -intel -output %readfile%_%howtoread%.bin -Binary +::%~dp0..\prog\HxD\HxD.exe" %readfile%_%howtoread%.bin pause diff --git a/config/MSP430reset.bat b/config/MSP430reset.bat index 974b297..ef9c7e4 100644 --- a/config/MSP430reset.bat +++ b/config/MSP430reset.bat @@ -1 +1,3 @@ -%~d1\prog\msp430flasher -m SBW2 -z [RESET,VCC=3300] \ No newline at end of file +:: %~dp0 is the path of this file.bat + +%~dp0..\prog\msp430flasher -m SBW2 -z [RESET,VCC=3300] \ No newline at end of file diff --git a/config/Preprocess.bat b/config/Preprocess.bat index ded1c4e..e08f469 100644 --- a/config/Preprocess.bat +++ b/config/Preprocess.bat @@ -1,5 +1,5 @@ ::Preprocess.bat -::used by PreprocessSourceFile.bat or by scite editor Tools menu +::used to preprocess source.f files, from PreprocessSourceFile.bat or scite editor Tools menu ::@ECHO OFF @@ -16,8 +16,8 @@ echo %~dpn1.f not found! goto badend ) -IF NOT EXIST %~dp1..\inc\%~n2.pat ( -echo %~dp1..\inc\%~n2.pat not found! +IF NOT EXIST %~dp0..\inc\%~n2.pat ( +echo %~dp0..\inc\%~n2.pat not found! goto badend ) @@ -31,16 +31,17 @@ exit :preprocess -%~dp1..\prog\gema.exe -nobackup -line -t '-\r\n=\r\n' -f %~dp1..\inc\%~n2.pat %~dpn1.f %~dp1LAST.4TH +%~dp0..\prog\gema.exe -nobackup -line -t '-\r\n=\r\n' -f %~dp0..\inc\%~n2.pat %~dpn1.f %~dp1LAST.4TH set target=%~n2 -call %~dp1..\config\Select.bat SelectDevice %%target%% +call %~dp0Select.bat SelectDevice %%target%% if not exist %~dp1SD_%device:~3% MD %~dp1SD_%device:~3% > NUL COPY /y %~dp1LAST.4TH %~dp1SD_%device:~3%\%~n1.4TH > NUL -::pause +::pause > NUL exit +:: %~dp0 is the path of this file.bat :: %~dpn1.f is the symbolic source file -:: %~dp1..\inc\%~n2.pat is the pattern file for preprocessor gema.exe +:: %~dp0..\inc\%~n2.pat is the pattern file for preprocessor gema.exe :: %~dp1LAST.4TH is the output source file (ready to send to the target) :: %~d1 is the drive of arg %1 :: %~n2 is your selected template by SelectTarget.bat or your scite $(1) diff --git a/config/PreprocessSourceFile.bat b/config/PreprocessSourceFile.bat index 324af35..9567f5a 100644 --- a/config/PreprocessSourceFile.bat +++ b/config/PreprocessSourceFile.bat @@ -1,10 +1,11 @@ ::PreProcessSourceFile.bat -::used as link in any folder to drag and drop file.f on it. +::used as link in any folder to drag and drop source file.f on it. +:: %~dp0 is the path of this file.bat :: %1 is file.f to be preprocessed -:: %2 is used by Preprocess.bat as error : "unexpected third parameter" -call ..\config\Select.bat SelectTemplate -call ..\config\Preprocess.bat %1 ..\inc\%template% %2 -pause +call %~dp0Select.bat SelectTarget +start %~dp0Preprocess.bat %1 %~dp0..\inc\%target% + +@pause > NUL exit diff --git a/config/SciTEUser.properties b/config/SciTEUser.properties index c2c4123..91652b0 100644 --- a/config/SciTEUser.properties +++ b/config/SciTEUser.properties @@ -41,6 +41,7 @@ split.vertical=1 output.horizontal.size=400 output.vertical.size=600 output.initial.hide=1 +output.wrap=1 #horizontal.scrollbar=0 #horizontal.scroll.width=10000 #horizontal.scroll.width.tracking=0 @@ -226,9 +227,6 @@ style.errorlist.3=fore:#0080FF # command or return status style.errorlist.4=fore:#FF00FF -# Text matched with find in files and message part of GCC errors -style.errorlist.21=fore:#FF0000 - # Printing - only works on Windows if PLAT_WIN #print.colour.mode=1 diff --git a/config/Select.bat b/config/Select.bat index 1a32d46..2fc9ad7 100644 --- a/config/Select.bat +++ b/config/Select.bat @@ -2,7 +2,7 @@ @goto %1 -:SelectTemplate +:SelectTarget :: called by PreprocessSourceFile.bat, SendSourceFileToTarget.bat and CopySourceFileToTarget_SD_Card.bat :: just before calling Preprocess.bat, SendSource.bat and CopyToTarget_SD_Card.bat @@ -19,18 +19,17 @@ @echo 7 CHIPSTICK_FR2433 @echo 8 MSP_EXP430FR2355 @echo 9 LP_MSP430FR2476 - @set /p choice=your choice: -@if %choice% == 1 set template=MSP_EXP430FR5739 -@if %choice% == 2 set template=MSP_EXP430FR5969 -@if %choice% == 3 set template=MSP_EXP430FR5994 -@if %choice% == 4 set template=MSP_EXP430FR6989 -@if %choice% == 5 set template=MSP_EXP430FR4133 -@if %choice% == 6 set template=MSP_EXP430FR2433 -@if %choice% == 7 set template=CHIPSTICK_FR2433 -@if %choice% == 8 set template=MSP_EXP430FR2355 -@if %choice% == 9 set template=LP_MSP430FR2476 +@if %choice% == 1 set target=MSP_EXP430FR5739 +@if %choice% == 2 set target=MSP_EXP430FR5969 +@if %choice% == 3 set target=MSP_EXP430FR5994 +@if %choice% == 4 set target=MSP_EXP430FR6989 +@if %choice% == 5 set target=MSP_EXP430FR4133 +@if %choice% == 6 set target=MSP_EXP430FR2433 +@if %choice% == 7 set target=CHIPSTICK_FR2433 +@if %choice% == 8 set target=MSP_EXP430FR2355 +@if %choice% == 9 set target=LP_MSP430FR2476 @exit /b @@ -45,7 +44,6 @@ @if /I %target:~0,16% == CHIPSTICK_FR2433 set device=MSP430FR2433 @if /I %target:~0,16% == MSP_EXP430FR2355 set device=MSP430FR2355 @if /I %target:~0,15% == LP_MSP430FR2476 set device=MSP430FR2476 - ::pause @exit /b diff --git a/config/SendFile.ttl b/config/SendFile.ttl index edf1dec..c12e6a8 100644 --- a/config/SendFile.ttl +++ b/config/SendFile.ttl @@ -7,18 +7,19 @@ connect param3 -inputbox 'Send this file to the MSP430FR target:' ' ' param2 - -setecho 0 ; no echo from Teraterm -showtt 0 ; close teraterm windows - - ;logfile = '\teraterm.log' ;dirname logdir param2 ; logir = dir of file.4TH to be sent ;strconcat logdir logfile ;logopen logdir 1 + + +inputbox 'Send this file to the MSP430FR target:' ' ' param2 + +setecho 0 ; no echo from Teraterm +showtt 0 ; close teraterm windows + ; DEVICE ID TEST ; ============== @@ -26,7 +27,7 @@ sendln 'CODE ?ID' ; CODE ?ID sendln 'CMP #0,R14 0<> IF SUB &$1A04,R14 THEN' ; CMP #0,TOS 0<> IF SUB &DEVICEID,TOS THEN sendln 'COLON ' ; COLON sendln '$1B EMIT $63 EMIT' ; $1B EMIT $63 EMIT \ send 'ESC c' (clear screen) -;sendln '13 EMIT $10 EMIT' ; CR +;sendln '13 EMIT $10 EMIT' ; CR sendln ' ABORT" Device'39's ID mismatch!" ' ; ABORT" Device's ID mismatch!" sendln 'RST_RET ;' ; RST_RET ; @@ -59,11 +60,9 @@ endif uptime timeend ; stops chrono... diff = timeend - timestart - -;sprintf2 resultat " %s download and execute: %d msec" param2 diff filestat param2 size KBds = 10 * size / diff -sprintf2 resultat " %s download compile execute: %d msec (%d kBds eff.)" param2 diff KBds +sprintf2 resultat " download compile execute %s in %d ms (%d kBds eff.)" param2 diff KBds showtt 1 ; display teraterm window @@ -72,6 +71,3 @@ messagebox resultat "teraterm.exe" ;logclose ;unlink -;end - - diff --git a/config/SendSource.bat b/config/SendSource.bat index e082a12..c2ef015 100644 --- a/config/SendSource.bat +++ b/config/SendSource.bat @@ -12,6 +12,7 @@ IF /I "%~x1" == ".4TH" GOTO 4TH :: ============================================================================================== :: source file.f part +:: %~dp0 is the path of this file.bat :: %~dpn1.f is the symbolic source file.f described as drive\path\name.f :: %~d1\inc\%~n2.pat is the pattern file for preprocessor gema.exe :: %~dpn1.4TH is the source file.4TH to be sent to the target @@ -33,8 +34,8 @@ echo %~dpn1.f not found! goto badend ) -IF NOT EXIST %~dp1..\inc\%~n2.pat ( -echo %~dp1..\inc\%~n2.pat not found! +IF NOT EXIST %~dp0..\inc\%~n2.pat ( +echo %~dp0..\inc\%~n2.pat not found! goto badend ) @@ -51,22 +52,22 @@ exit :preprocessF -%~dp1..\prog\gema.exe -nobackup -line -t '-\r\n=\r\n' -f %~dp1..\inc\%~n2.pat %~dpn1.f %~dpn1.4TH -call %~dp1..\config\Select.bat SelectDeviceId %~dp1..\inc\%~n2.pat +%~dp0..\prog\gema.exe -nobackup -line -t '-\r\n=\r\n' -f %~dp0..\inc\%~n2.pat %~dpn1.f %~dpn1.4TH +call %~dp0Select.bat SelectDeviceId %~dp0..\inc\%~n2.pat :DownloadF taskkill /F /IM ttermpro.exe 1> NUL 2>&1 :Win32F -"C:\Program Files\teraterm\ttpmacro.exe" /V %~dp1..\config\SendFile.ttl %~dpn1.4TH /C %3 %deviceid% 1> NUL 2>&1 +"C:\Program Files\teraterm\ttpmacro.exe" /V %~dp0SendFile.ttl %~dpn1.4TH /C %3 %deviceid% 1> NUL 2>&1 IF NOT ERRORLEVEL 1 GOTO EndF :Win64F -"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~dp1..\config\SendFile.ttl %~dpn1.4TH /C %3 %deviceid% +"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~dp0SendFile.ttl %~dpn1.4TH /C %3 %deviceid% :EndF MOVE "%~dpn1.4TH" "%~dp1LAST.4TH" > NUL -call %~dp1..\config\Select.bat SelectDevice %~dp1..\inc\%~n2.pat +call %~dp0Select.bat SelectDevice %~dp0..\inc\%~n2.pat if not exist %~dp1SD_%device:~3% MD %~dp1SD_%device:~3% > NUL COPY /y %~dp1LAST.4TH %~dp1SD_%device:~3%\%~n1.4TH > NUL exit @@ -74,6 +75,7 @@ exit :: ============================================================================================== :: source file.4TH part +:: %~dp0 is the path of this file.bat :: %~dpn1.4TH is the file to be sent described as drive\path\name.4TH :: %~d1 is the drive of param %1 :: %~nx0 is name.ext of this bat file @@ -106,13 +108,12 @@ goto badend taskkill /F /IM ttermpro.exe 1> NUL 2>&1 :Win324th -"C:\Program Files\teraterm\ttpmacro.exe" /V %~dp1..\config\SendFile.ttl %~dpn1.4TH /C %2 0 1> NUL 2>&1 +"C:\Program Files\teraterm\ttpmacro.exe" /V %~dp0..\config\SendFile.ttl %~dpn1.4TH /C %2 0 1> NUL 2>&1 IF NOT ERRORLEVEL 1 GOTO End4th :Win644th -"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~dp1..\config\SendFile.ttl %~dpn1.4TH /C %2 0 +"C:\Program Files (x86)\teraterm\ttpmacro.exe" /V %~dp0..\config\SendFile.ttl %~dpn1.4TH /C %2 0 :End4th -::@COPY "%~dpn1.4TH" "%~dp1LAST.4TH" > NUL exit diff --git a/config/SendSourceFileToTarget.bat b/config/SendSourceFileToTarget.bat index d3afbe4..ccf94ee 100644 --- a/config/SendSourceFileToTarget.bat +++ b/config/SendSourceFileToTarget.bat @@ -1,6 +1,7 @@ ::SendSourceFileToTarget.bat ::used as link in any folder to drag and drop file.f or file.4th on it. +:: %~dp0 is the path of this file.bat :: %1 is file.f to be send ::@ECHO OFF @@ -9,16 +10,14 @@ IF /I "%~x1" == ".f" goto sendF :send4th -start %~dp1..\config\SendSource.bat %1 ECHO -::PAUSE > NUL +start %~dp0SendSource.bat %1 ECHO +@PAUSE > NUL exit :sendF -call %~dp1..\config\Select.bat SelectTemplate - -start %~dp1..\config\SendSource.bat %1 %~dp1..\inc\%template% ECHO - -::PAUSE > NUL +call %~dp0Select.bat SelectTarget +start %~dp0SendSource.bat %1 %~dp0..\inc\%target% ECHO +@PAUSE > NUL exit diff --git a/config/SendToSD.ttl b/config/SendToSD.ttl index d7a3857..ce411f1 100644 --- a/config/SendToSD.ttl +++ b/config/SendToSD.ttl @@ -18,7 +18,7 @@ connect param3 inputbox 'here you can change path of the file: ' 'Send this file to SD_CARD target' fname setecho 0 ; no echo from Teraterm -showtt 0 ; close teraterm windows +showtt 0 ; collapse teraterm window ; DEVICE ID TEST ; ============== @@ -31,29 +31,24 @@ sendln '$1B EMIT $63 EMIT' ; $1B EMIT $63 EMIT \ send 'ES sendln ' ABORT" Device'39's ID mismatch!" ' ; ABORT" Device's ID mismatch!" sendln 'RST_RET ;' ; RST_RET ; -;sendln param4 ' ?ID NOECHO' ; send: %deviceID% ?ID -sendln param4 ' ?ID ECHO' ; send: %deviceID% ?ID +sendln param4 ' ?ID ECHO' ; send: %deviceID% ?ID +;sendln param4 ' ?ID' ; send: %deviceID% ?ID -sendln 'NOBOOT' ; sendln 'TERM2SD" ' inputstr '"' ; send to FastForth the command 'TERM2SD" \file.4TH"' ...with optionnal path added in inputbox - uptime timestart ; starts chrono... - sendfile param2 0 ; binary flag = 0 to send text file (enabling software XON/XOFF) - sendln #4 ; send ETX to ask TERM2SD" to close file uptime timeend ; stops chrono... diff = timeend - timestart - -;sendln 'ECHO' +filestat param2 size +KBds = 10 * size / diff +sprintf2 resultat " download %s and write it to SD_Card in %d ms (%d kBds eff.)" param2 diff KBds showtt 1 ; display teraterm window -sprintf2 resultat " %s download to SD Card: %d msec" param2 diff messagebox resultat "teraterm.exe" - ;logclose -unlink +;unlink diff --git a/config/build.bat b/config/build.bat index 9ec3ded..2a61e1b 100644 --- a/config/build.bat +++ b/config/build.bat @@ -1,11 +1,12 @@ ::@ECHO OFF -%~dp1prog\asw -x -q -L -i %~dp1inc %1 -o %~dp1binaries\%2.p -%~dp1prog\p2hex %~dp1binaries\%2.p -r 0x0000-0xffff -%~dp1prog\srec_cat -contradictory-bytes=warning %~dp1binaries\%2.hex -intel -output %~dp1binaries\%2.txt -ti-txt -del %~dp1binaries\%2.p -del %~dp1binaries\%2.hex +%~dp0..\prog\asw -x -q -L -i %~dp0..\inc %1 -o %~dp0..\binaries\%2.p +%~dp0..\prog\p2hex %~dp0..\binaries\%2.p -r 0x0000-0xffff +%~dp0..\prog\srec_cat -contradictory-bytes=warning %~dp0..\binaries\%2.hex -intel -output %~dp0..\binaries\%2.txt -ti-txt +del %~dp0..\binaries\%2.p +del %~dp0..\binaries\%2.hex ::pause exit -rem %1 is the input file.asm -rem %2 is the target name +:: %~dp0 is the path of this file.bat +:: %1 is the input file.asm +:: %2 is the target name diff --git a/config/upload_include.ttl b/config/upload_include.ttl new file mode 100644 index 0000000..48349c4 --- /dev/null +++ b/config/upload_include.ttl @@ -0,0 +1,151 @@ +; +; tera term mecrisp-stellaris forth upload helper +; Copyright (C) 2015 Jean Jonethal +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see . + +; small upload macro for uploading forth source via tera term tested with version 4.88 +; Tera Term website http://ttssh2.osdn.jp/index.html.en +; tera term supports call stack up to 10 levels on my laptop so using iterative approach here + +; upload source file to target line by line and waits for "ok." after transmission of line. +; supports nesting include with pathname +; line containing include directive is not sent to target +; max source line length is 511 +; include path\filename.ext + +; example project.txt : +; include dump.txt +; include ..\common\disassembler-m3.txt +; include demo2.fth + +; TODO: +; "require" - support for single inclusion +; error handling for MAXLEVEL +; path handling relative to root file +; test path handling + +; global definitions +MAXLEVEL = 20 ; max nesting level up to 65536 levels might be supported by tera term +MAX_LINE_LENGTH = 511 ; max string/line length supported by tera term +INCLUDE_PATTERN = "include\s+([\.\w/:\\-]+)" ; this pattern marks our include file +SOURCE_PATTERN = "^([^\\]+)" ; skip line commants +timeout = 5 ; you might tune this for longer response times +mtimeout = 500 ; wait 500 ms for "ok." response +infilehandle = -1 ; current file handle +fname = "" ; current filename +newfileHandle = -1 ; store the new file handle +; parameter stack ; stack rised upwards +level = 1 ; current include level +intdim cfh MAXLEVEL ; file handle stack +intdim clp MAXLEVEL ; line position stack - unused at the moment +strdim cln MAXLEVEL ; line stack - unused at the moment +strdim cfn MAXLEVEL ; filename stack + + +; check for macro parameter +if paramcnt = 2 then ; if there is a macro parameter use it as input file name + fname = param2 +endif +strlen fname +if result = 0 then ; if there is no valid parameter open file dialog for selection + filenamebox "select file" 0 + fname = inputstr + messagebox fname "opened" +endif + +dirname prjdir fname ; setup current directory to fname +setdir prjdir ; set macrodir to directory containing file fname + +call uploading +goto ende + +:uploading + fileopen infilehandle fname 0 1 + if infilehandle <> -1 then ; if file open successful + level = 1 ; we start at level 1 + cfn[level] = fname + cfh[level] = infilehandle + while 1 + infilehandle = cfh[level] ; update current file handle + filereadln infilehandle line ; get next line from this file + if result = 0 then + call processLine + else ; end of file + call levelback ; close file , back one nesting level + if level < 1 then ; upper most file ended + messagebox fname "Finished" ; notify user + break + endif + endif + endwhile + endif +return + +:levelback +; close file and switch to previous level + + fileclose infilehandle + infilehandle = -1 + cfh[level] = -1 + level = level - 1 + if level > 0 then ; back to previous level + infilehandle = cfh[level] + fname = cfn[level] + endif +return + +:processLine +; scan every line for include filename or send to target and wait for "ok." +; line contains current line to be scanned + + strmatch line INCLUDE_PATTERN ; scan the line for include pattern + if result > 0 then + fname = groupmatchstr1 ; found new include line + call openNewFile + else + call skipComment + send line #10 + wait "ok." + endif +return + +:openNewFile +; start a new include level when open successfull +; fname contains new include filename +; notify user if failed to open included file + + fileopen newfileHandle fname 0 1 + if newfileHandle <> -1 then ; new include file opened + level = level + 1 + infilehandle = newfileHandle + cfn[level] = fname + cfh[level] = infilehandle + else + messagebox fname "open failed" ; notify user about failed file + endif +return + +:skipComment +; dont transfer comments + strmatch line SOURCE_PATTERN ; skip comments + if result > 0 then + line = groupmatchstr1 + else + line = "" + endif +return + + +:ende \ No newline at end of file diff --git a/forthMSP430FR.asm b/forthMSP430FR.asm index 0a8846a..10113c3 100644 --- a/forthMSP430FR.asm +++ b/forthMSP430FR.asm @@ -5,18 +5,21 @@ ; Ajoutez quelquefois, et souvent effacez. Boileau, L'Art poétique ;------------------------------------------------------------------------------- -;------------------------------------------------------------------------------- -; SCITE editor: copy https://www.scintilla.org/Sc4xx.exe to \prog\scite.exe -;------------------------------------------------------------------------------- -; MACRO ASSEMBLER AS -; unzip http://john.ccac.rwth-aachen.de:8000/ftp/as/precompiled/i386-unknown-win32/aswcurr.zip -;------------------------------------------------------------------------------- +;=============================================================================== +; SCITE editor: copy https://www.scintilla.org/Sc531.exe to \prog\scite.exe +; copy \config\SciTEUser.properties in your $HOME directory +;=============================================================================== + +;=============================================================================== +; MACRO ASSEMBLER AS: unzip to \prog +; http://john.ccac.rwth-aachen.de:8000/ftp/as/precompiled/i386-unknown-win32/aswcurr.zip +;=============================================================================== .listing purecode ; reduce listing to true conditionnal parts MACEXP_DFT noif ; reduce macros listing to true part .PAGE 0 ; listing without pagination ;------------------------------------------------------------------------------- -VER .equ "V400" ; FORTH version +VER .equ "V401" ; FORTH version ;=============================================================================== ; before assembling or programming you must set TARGET in scite param1 (SHIFT+F8) @@ -25,16 +28,16 @@ VER .equ "V400" ; FORTH version ; TARGET ; ;MSP_EXP430FR5739 ; compile for MSP-EXP430FR5739 launchpad ;MSP_EXP430FR5969 ; compile for MSP-EXP430FR5969 launchpad -MSP_EXP430FR5994 ;; compile for MSP-EXP430FR5994 launchpad +;MSP_EXP430FR5994 ; compile for MSP-EXP430FR5994 launchpad ;MSP_EXP430FR6989 ; compile for MSP-EXP430FR6989 launchpad ;MSP_EXP430FR4133 ; compile for MSP-EXP430FR4133 launchpad -;MSP_EXP430FR2355 ; compile for MSP-EXP430FR2355 launchpad +MSP_EXP430FR2355 ;; compile for MSP-EXP430FR2355 launchpad ;MSP_EXP430FR2433 ; compile for MSP-EXP430FR2433 launchpad ;LP_MSP430FR2476 ; compile for LP_MSP430FR2476 launchpad ;CHIPSTICK_FR2433 ; compile for "CHIPSTICK" of M. Ken BOAK ; choose DTC model (Direct Threaded Code); if you don't know, choose 2 -DTC .equ 2 ; DTC model 1 : DOCOL = CALL rDOCOL 14 cycles 1 word shortest DTC model +DTC .equ 2 ; DTC model 1 : DOCOL = CALL rDOCOL 14 cycles 1 word shortest but a little slow DTC model ; DTC model 2 : DOCOL = PUSH IP, CALL rEXIT 13 cycles 2 words best compromize to mix FORTH/ASM code ; DTC model 3 : inlined DOCOL (and LO2HI) 9 cycles 4 words fastest @@ -42,14 +45,14 @@ THREADS .equ 16 ; 1, 2 , 4 , 8 , 16, 32 search entries in word-set. ; +0, +28, +48, +56, +90, +154 bytes, usefull to speed up compilation; ; the FORTH interpreter is speed up by about a square root factor of THREADS. -FREQUENCY .equ 8 ; fully tested at 1,2,4,8,16 MHz, plus 24 MHz for MSP430FR57xx,MSP430FR2355 +FREQUENCY .equ 24 ; fully tested at 1,2,4,8,16 MHz, plus 24 MHz for MSP430FR57xx,MSP430FR2355 ; ============================================================================== -;UART_TERMINAL ; COMMENT TO SWITCH FROM UART TO I2C TERMINAL +UART_TERMINAL ; COMMENT TO SWITCH FROM UART TO I2C TERMINAL ; ============================================================================== .IFDEF UART_TERMINAL -TERMINALBAUDRATE .equ 4000000 +TERMINALBAUDRATE .equ 115200 TERMINAL3WIRES ;; + 18 bytes enable 3 wires XON/XOFF software flow control TERMINAL4WIRES ;; + 12 bytes enable 4 wires RTS hardware flow control ;TERMINAL5WIRES ; + 10 bytes enable 5 wires RTS/CTS hardware flow control @@ -63,13 +66,12 @@ I2C_TERM_ADR .equ 18 ; I2C_TERMINAL_Slave_Address << 1 ;=============================================================================== DOUBLE_INPUT ;; + 60 bytes : adds the interpretation engine for double numbers (numbers with dot) FIXPOINT_INPUT ;; + 68 bytes : adds the interpretation engine for Q15.16 numbers (numbers with comma) -VOCABULARY_SET ;; + 194 bytes : adds words: WORDSET FORTH hidden PREVIOUS ONLY DEFINITIONS -SD_CARD_LOADER ;; + 1582 bytes : to load source files from SD_card -BOOTLOADER ;; + 82 bytes : includes in WARM process the bootloader SD_CARD\BOOT.4TH. -SD_CARD_READ_WRITE ;; + 1168 bytes : to read, create, write and del files + copy text files from PC to target SD_Card -LARGE_CODE ;; + 506 bytes : allows assembler to execute code up to 1MB. -LARGE_DATA ;; + 1212 bytes : extended assembler to 20 bits addresses and datas. -;PROMPT ; + 18 bytes : to display the prompt "ok ", (obsolete). +;VOCABULARY_SET ; + 194 bytes : adds words: WORDSET FORTH hidden PREVIOUS ONLY DEFINITIONS +;SD_CARD_LOADER ; + 1664 bytes : to load source files from SD_card +;SD_CARD_READ_WRITE ; + 1168 bytes : to read, create, write and del files + copy text files from PC to target SD_Card +;LARGE_CODE ; + 506 bytes : extended assembler to 20 bits addresses (1MB). +;LARGE_DATA ; + 1212 bytes : extended assembler to 20 bits datas. +;PROMPT ; + 18 bytes : to display the prompt "ok" (deprecated). ;=============================================================================== ;------------------------------------------------------------------------------- @@ -81,151 +83,105 @@ LARGE_DATA ;; + 1212 bytes : extended assembler to 20 bits addresses an ;UTILITY ; + 434/524 bytes (1/16threads) : add .S .RS WORDS U.R DUMP ? UTILITY.f ;SD_TOOLS ; + 142 bytes for trivial DIR, FAT, CLUSTR. and SECTOR. view, (adds UTILITY) SD_TOOLS.f ;DOUBLE ; DOUBLE word set DOUBLE.f - .save - .listing off -;=============================================================================== -; Software control flow XON/XOFF configuration: -;=============================================================================== -; Launchpad <-> UARTtoUSB device <-> TeraTerm TERMINAL -; RX <-- TX -; TX --> RX -; GND <-> GND -; -; TERATERM config terminal: NewLine receive : LF, -; NewLine transmit : CR+LF -; Size : 96 chars x 49 lines (adjust lines according to your display) -; -; TERATERM config serial port: TERMINALBAUDRATE value, -; 8 bits, no parity, 1 Stop bit, -; XON/XOFF flow control, -; delay = 0ms/line, 0ms/char -; -; don't forget to save always new TERATERM configuration ! ; ------------------------------------------------------------------------------ -; Only two usb2uart bridges correctly handle XON / XOFF: cp2102 and pl2303. -; ------------------------------------------------------------------------------ -; the best and cheapest: UARTtoUSB cable with Prolific PL2303HXD (or PL2303TA) -; works well in 3 WIRES (XON/XOFF) and 4WIRES (GND,RX,TX,RTS) config -; ------------------------------------------------------------------------------ -; PL2303TA 4 wires CABLE PL2303HXD 6 wires CABLE -; pads upside: 3V3,txd,rxd,gnd,5V pads upside: gnd, 3V3,txd,rxd,5V -; downside: cts,dcd,dsr,rts,dtr downside: rts,cts -; ------------------------------------------------------------------------------ -; WARNING ! if you use PL2303TA/HXD cable as supply, open the box before to weld red wire on 3v3 pad ! -; ------------------------------------------------------------------------------ -; up to 115200 Bds (500kHz) -; up to 230400 Bds (1MHz) -; up to 460800 Bds (2MHz) -; up to 921600 Bds (4MHz) -; up to 1843200 Bds (8MHz) -; up to 3 MBds (12MHz,PL2303HXD with shortened cable < 80cm) -; up to 4 MBds (16MHz,PL2303HXD with shortened cable < 60cm) -; up to 5 MBds (20MHz,PL2303HXD with shortened cable < 40cm) -; up to 6 MBds (24MHz,PL2303HXD with shortened cable < 20cm) - -; UARTtoUSB module with Silabs CP2102 (supply current = 20 mA) -; ------------------------------------------------------------------------------ -; WARNING ! if you use it as supply, buy a CP2102 module with a VCC switch 5V/3V3 and swith on 3V3 ! -; ------------------------------------------------------------------------------ -; 9600,19200,38400 (250kHz) -; + 57600, 115200 (500kHz) -; + 134400,230400 (1MHz) -; + 460800 (2MHz) -; + 921600 (4MHz,8MHz,16MHz,24MHz) - -;=============================================================================== -; Hardware control flow configuration: RTS is wired on UART2USB CTS pin -;=============================================================================== + .include "ThingsInFirst.inc" ; macros, target definitions, RAM & INFO variables... +;------------------------------------------------------------------------------- + .org MAIN_ORG +;------------------------------------------------------------------------------- +; MEMORY OPERATIONS +;------------------------------------------------------------------------------- + FORTHWORD "@" +; https://forth-standard.org/standard/core/Fetch +; @ a-addr -- x fetch cell from memory +FETCH MOV @TOS,TOS + MOV @IP+,PC -; Launchpad <-> UARTtoUSB -; RX <-- TX -; TX --> RX -; RTS --> CTS (see launchpad.asm for RTS selected pin) -; GND <-> GND + FORTHWORD "!" +; https://forth-standard.org/standard/core/Store +; ! x a-addr -- store cell in memory +STORE MOV @PSP+,0(TOS);4 + MOV @PSP+,TOS ;2 + MOV @IP+,PC ;4 -; RTS pin may be permanently wired on SBWTCK/TEST pin without disturbing SBW 2 wires programming +;-----------------------------------; +; modifying TOs is forbidden here ! ; +;-----------------------------------; +INIT_FORTH ; common QABORT|WARM subroutine +;-----------------------------------; + MOV @RSP+,IP ; init IP with CALLER next address +; ; + MOV #PUC_ABORT_ORG,X ; FRAM INFO FRAM MAIN +; ; --------- --------- + MOV @X+,&PFAACCEPT ; BODYACCEPT --> PFAACCEPT + MOV @X+,&PFAEMIT ; BODYEMIT --> PFAEMIT + MOV @X+,&PFAKEY ; BODYKEY --> PFAKEY + MOV @X+,&CIB_ORG ; TIB_ORG --> CIB_ORG TIB = Terminal Input Buffer, CIB = Current Input Buffer +; ; +; ; FRAM INFO REG|RAM +; ; --------- ------- + MOV @X+,RSP ; INIT_RSTACK --> R1=RSP PSP is initialised with ABORT + MOV @X+,rDOCOL ; EXIT --> R4=rDOCOL (if DTC=2) + MOV @X+,rDODOES ; XDODOES --> R5=rDODOES + MOV @X+,rDOCON ; XDOCON --> R6=rDOCON + MOV @X+,rDOVAR ; RFROM --> R7=rDOVAR + MOV @X+,&BASEADR ; INIT_BASE --> RAM BASE init decimal base + MOV @X+,&LEAVEPTR ; INIT_LEAVE --> RAM LEAVEPTR + MOV #0,&STATE ; 0 --> RAM STATE + CALL &SOFT_APP ; default SOFT_APP = INIT_SOFT = RET_ADR, value set by DEEP_RESET. + MOV #SEL_RST,PC ; goto PUC 7 to select the user's choice from TOS value: RST_RET|DEEP_RESET +;-----------------------------------; -; TERATERM config terminal : NewLine receive : LF, -; NewLine transmit : CR+LF -; Size : 96 chars x 49 lines (adjust lines to your display) +;------------------------------------------------------------------------------- +; DTCforthMSP430FR5xxx program (FRAM) memory +;------------------------------------------------------------------------------- -; TERATERM config serial port : TERMINALBAUDRATE value, -; 8bits, no parity, 1Stopbit, -; Hardware flow control, -; delay = 0ms/line, 0ms/char + .IFNDEF UART_TERMINAL + .include "forthMSP430FR_TERM_I2C.asm" + .ELSE + .IFDEF HALFDUPLEX + .include "forthMSP430FR_TERM_HALF.asm" + .ELSE + .include "forthMSP430FR_TERM_UART.asm" + .ENDIF + .ENDIF + .IFDEF SD_CARD_LOADER + .include "forthMSP430FR_SD_ACCEPT.asm" + .ENDIF -; don't forget : save new TERATERM configuration ! + .IF DTC = 1 ; DOCOL = CALL rDOCOL, [rDOCOL] = XDOCOL +XDOCOL MOV @RSP+,W ; 2 + PUSH IP ; 3 save old IP on return stack + MOV W,IP ; 1 set new IP to PFA + MOV @IP+,PC ; 4 = NEXT + .ENDIF ; 10 cycles -; notice that the control flow seems not necessary for TX (CTS <-- RTS) + FORTHWORD "TYPE" +;https://forth-standard.org/standard/core/TYPE +;C TYPE adr u -- type string to terminal +TYPE PUSH IP ;3 + MOV #TYPE_NEXT+2,IP ;2 because SUB #2,IP + MOV @PSP+,X ;2 -- len X = adr +TYPELOOP SUB #2,IP ;1 [IP] = TYPE_NEXT + SUB #2,PSP ;1 -- x len + MOV TOS,0(PSP) ;3 -- len len + MOV.B @X+,TOS ;2 -- len char + JMP EMIT ;22 S T W regs are free +TYPE_NEXT mNEXTADR ; -- len + SUB.B #1,TOS ;1 -- len-1 byte operation, according to the /COUNTED-STRING value + JNZ TYPELOOP ;2 32~/19~ EMIT loop 312/526 kBds/MHz --> 7.5MBds @ 24 MHz + JZ DROPEXIT ;2 -; UARTtoUSB module with PL2303TA/HXD ; ------------------------------------------------------------------------------ -; WARNING ! if you use PL2303TA/HXD cable as supply, open the box before to weld red wire on 3v3 pad ! -; ------------------------------------------------------------------------------ -; up to 250 kbds / MHz -; ---------------------------------- -; 9600,19200,38400,57600 (250kHz) -; + 115200 (500kHz) -; + 201600,230400,250000 (1MHz) -; + 403200,460800 (2MHz) -; + 806400,921600 (4MHz) -; + 1843200 (8MHz) -; + 2764800 (12MHz) -; + 4000000 (16MHz) -; + 5000000 (20MHz) -; + 6000000 (24MHz) - -; UARTtoUSB module with FTDI FT232RL (FT230X don't work correctly) -; ------------------------------------------------------------------------------ -; WARNING ! buy a FT232RL module with a switch 5V/3V3 and select 3V3 ! -; ------------------------------------------------------------------------------ -; 9600,19200,38400,57600,115200 (500kHz) -; + 230400 (1MHz) -; + 460800 (2MHz) -; + 921600 (4,8,16 MHz) - +; forthMSP430FR : CONDITIONNAL COMPILATION, 114/109 words ; ------------------------------------------------------------------------------ -; UARTtoBluetooth 2.0 module (RN42 sparkfun bluesmirf) at 921600bds +; goal: speed up the false conditionnal to reach true|false equal time: reached! ; ------------------------------------------------------------------------------ -; 9600,19200,38400,57600,115200 (500kHz) -; + 230400 (1MHz) -; + 460800 (2MHz) -; + 921600 (4,8,16 MHz) - -; RN42 config : connect RN41/RN42 module on teraterm, via USBtoUART bridge, -; ----------- 8n1, 115200 bds, no flow control, echo on -; $$$ // enter control mode, response: AOK -; SU,92 // set 921600 bds, response: AOK -; R,1 // reset module to take effect -; -; connect RN42 module on FastForth target -; add new bluetooth device on windows, password=1234 -; open the created output COMx port with TERATERM at 921600bds - -; TERATERM config terminal : NewLine receive : LF, -; NewLine transmit : CR+LF -; Size : 80 chars x 44 lines (adjust lines to your display) - -; TERATERM config serial port : TERMINALBAUDRATE value, -; 8bits, no parity, 1Stopbit, -; Hardware flow control or software flow control or ...no flow control! -; delay = 0ms/line, 0ms/char - -; don't forget : save new TERATERM configuration ! + FORTHWORDIMM "[THEN]" ; does nothing +; https://forth-standard.org/standard/tools/BracketTHEN + MOV @IP+,PC -; in fact, compared to using a UART USB bridge, only the COMx port is to be updated. - .restore -; ------------------------------------------------------------------------------ - .include "ThingsInFirst.inc" ; macros, target definitions, RAM & INFO variables... -;------------------------------------------------------------------------------- - .org MAIN_ORG -;------------------------------------------------------------------------------- -; DTCforthMSP430FR5xxx program (FRAM) memory -;------------------------------------------------------------------------------- -; here we place the FORTH primitives without name. -; User can access them via declarations made in \inc\MSP430FRxxxx.pat ; ------------------------------------------------------------------------------ ; COMPILING OPERATORS ; ------------------------------------------------------------------------------ @@ -252,62 +208,12 @@ XSQUOTE SUB #4,PSP ; 1 push old TOS on stack ADDC #0,IP ; 1 IP=addr+u aligned MOV @IP+,PC ; 4 16~ -; primitive MU/MOD; used by ?NUMBER UM/MOD, and M*/ in DOUBLE word set -; MU/MOD UDVDlo UDVDhi UDIVlo -- UREMlo UQUOTlo UQUOThi -;------------------------------------------------------------------------------- -; unsigned 32-BIT DiViDend : 16-BIT DIVisor --> 32-BIT QUOTient 16-BIT REMainder -;------------------------------------------------------------------------------- -; two times faster if 16 bits DiViDend (cases of U. and . among others) - -; reg division MU/MOD NUM M*/ -; --------------------------------------------------------------------- -; S = DVD(15-0) = ud1lo = ud1lo ud1lo -; TOS = DVD(31-16) = ud1hi = ud1hi ud1mi -; W = DVD(47-32)/REM = rem = digit --> char --> -[HP] ud1hi -; T = DIV(15-0) = BASE = BASE ud2 -; X = QUOTlo = ud2lo = ud2lo QUOTlo -; Y = QUOThi = ud2hi = ud2hi QUOThi -; rDODOES = count - -MUSMOD MOV TOS,T ;1 T = DIVlo - MOV 2(PSP),S ;3 S = DVDlo - MOV @PSP,TOS ;2 TOS = DVDhi -MUSMOD1 MOV #0,W ;1 W = REMlo = 0 - MOV #32,rDODOES ;2 init loop count - CMP #0,TOS ;1 DVDhi=0 ? - JNZ MDIV1 ;2 no -; ----------------------------------; -MDIV1DIV2 RRA rDODOES ;1 yes:loop count / 2 - MOV S,TOS ;1 DVDhi <-- DVDlo - MOV #0,S ;1 DVDlo <-- 0 - MOV #0,X ;1 QUOTlo <-- 0 (to do QUOThi = 0 at the end of division) -; ----------------------------------; -MDIV1 CMP T,W ;1 REMlo U>= DIVlo ? - JNC MDIV2 ;2 no : carry is reset - SUB T,W ;1 yes: REMlo - DIVlo ; carry is set -MDIV2 ADDC X,X ;1 RLC quotLO - ADDC Y,Y ;1 RLC quotHI - SUB #1,rDODOES ;1 Decrement loop counter - JN ENDMDIV ;2 - ADD S,S ;1 RLA DVDlo - ADDC TOS,TOS ;1 RLC DVDhi - ADDC W,W ;1 RLC REMlo - JNC MDIV1 ;2 - SUB T,W ;1 REMlo - DIVlo - BIS #1,SR ;1 SETC - JMP MDIV2 ;2 -ENDMDIV MOV #XDODOES,rDODOES ;2 restore rDODOES - MOV W,2(PSP) ;3 REMlo in 2(PSP) - MOV X,0(PSP) ;3 QUOTlo in 0(PSP) - MOV Y,TOS ;1 QUOThi in TOS -RET_ADR MOV @RSP+,PC ;4 35 words, about 466/246 cycles, not FORTH executable ! - ; : SETIB SOURCE 2! 0 >IN ! ; ; SETIB org len -- set Input Buffer, shared by INTERPRET and [ELSE] SETIB MOV #0,&TOIN ;3 MOV @PSP+,&SOURCE_ORG ;4 -- len MOV TOS,&SOURCE_LEN ;3 -- len -DROP MOV @PSP+,TOS ;2 -- + MOV @PSP+,TOS ;2 -- MOV @IP+,PC ;4 ; REFILL accept one line to input buffer and leave org len' of the filled input buffer @@ -347,53 +253,6 @@ XDOCON ; 4 for CALL rDOCON MOV @TOS,TOS ;+2 TOS = CONSTANT value MOV @IP+,PC ;+4 = 16~ = ITC+4 - - .IFNDEF UART_TERMINAL - .include "forthMSP430FR_TERM_I2C.asm" - .ELSE - .IFDEF HALFDUPLEX - .include "forthMSP430FR_TERM_HALF.asm" - .ELSE - .include "forthMSP430FR_TERM_UART.asm" - .ENDIF - .ENDIF - .IFDEF SD_CARD_LOADER - .include "forthMSP430FR_SD_ACCEPT.asm" - .ENDIF - - .IF DTC = 1 ; DOCOL = CALL rDOCOL, [rDOCOL] = XDOCOL -XDOCOL MOV @RSP+,W ; 2 - PUSH IP ; 3 save old IP on return stack - MOV W,IP ; 1 set new IP to PFA - MOV @IP+,PC ; 4 = NEXT - .ENDIF ; 10 cycles - - FORTHWORD "TYPE" -;https://forth-standard.org/standard/core/TYPE -;C TYPE adr u -- type string to terminal -TYPE PUSH IP ;3 - MOV #TYPE_NEXT+2,IP ;2 because SUB #2,IP - MOV @PSP+,X ;2 -- len X = adr -TYPELOOP SUB #2,IP ;1 [IP] = TYPE_NEXT - SUB #2,PSP ;1 -- x len - MOV TOS,0(PSP) ;3 -- len len - MOV.B @X+,TOS ;2 -- len char - JMP EMIT ;22 S T W regs are free -TYPE_NEXT mNEXTADR ; -- len - SUB.B #1,TOS ;1 -- len-1 byte operation, according to the /COUNTED-STRING value - JNZ TYPELOOP ;2 32~/19~ EMIT loop 312/526 kBds/MHz --> 7.5MBds @ 24 MHz - JZ DROPEXIT ;2 - -; ------------------------------------------------------------------------------ -; forthMSP430FR : CONDITIONNAL COMPILATION, 114/109 words -; ------------------------------------------------------------------------------ -; goal: speed up the false conditionnal to reach true|false equal time: reached! -; ------------------------------------------------------------------------------ - - FORTHWORDIMM "[THEN]" ; does nothing -; https://forth-standard.org/standard/tools/BracketTHEN - MOV @IP+,PC - ; ------------------------------------------------------------------------------ ; BRanch if BAD strings COMParaison, [COMPARE ZEROEQUAL QFBRAN] replacement QBRBADCOMP ; addr1 u1 addr2 u2 -- @@ -417,8 +276,8 @@ QBRNEXTCMP ; -- cnt addr u MOV @PSP+,TOS ;2 -- cnt + DROP = TWODROP SUB #1,TOS ;3 -- cnt-1 ONEMINUS JNZ BRAN ;2 -- cnt-1 branch to next comparaison if <> 0 -DROPEXIT MOV @PSP+,TOS ;2 -- - MOV @RSP+,IP ;2 +DROPEXIT MOV @RSP+,IP ;2 +DROP MOV @PSP+,TOS ;2 -- MOV @IP+,PC ;4 FORTHWORDIMM "[ELSE]" @@ -437,11 +296,11 @@ BRACKETELSE mDOCOL .word BRAN,BRACKTELSE1 ; 6~ versus 5~ for ONEPLUS BRACKTELSE0 .word XSQUOTE ; end of skiped line .byte 5,13,"ko ",10 ; send CR + "ko " + LF - .word TYPE ; CR ." ko " LF - .word TWODROP_REFILL ; REFILL Input Buffer with next line + .word TYPE ; -- cnt addr 0 + .word TWODROP_REFILL ; -- cnt REFILL Input Buffer with next line .word SETIB ; SET Input Buffer pointers SOURCE_LEN, SOURCE_ORG and clear >IN BRACKTELSE1 .word BL_WORD,COUNT ; -- cnt addr u Z = 1 if u = 0 - .word ZBRAN,BRACKTELSE0 ; -- cnt addr 0 Z = 1 --> end of line, -6~ + .word ZBRAN,BRACKTELSE0 ; cnt addr 0 -- Z = 1 --> end of line, -6~ .word TWODUP_XSQUOTE ; 24 ~ .byte 6,"[THEN]" ; -- cnt addr u addr1 u1 addr2 u2 .word QBRBADCOMP,BRACKTELSE2 ; -- cnt addr u if [THEN] not found, jump for next comparaison @@ -468,7 +327,7 @@ BRACKTELSE4 .word ONEPLUS ; -- cnt+1 if found, same ;If the parse area becomes exhausted, it is refilled as with REFILL. [IF] is an immediate word. ;An ambiguous condition exists if [IF] is POSTPONEd, ; or if the end of the input buffer is reached and cannot be refilled before the terminating [ELSE] or [THEN] is parsed. -BRACKETIF CMP #0,TOS ; -- f + CMP #0,TOS ; -- f MOV @PSP+,TOS ; -- JZ BRACKETELSE ; if false flag output MOV @IP+,PC ; if true flag output @@ -485,7 +344,7 @@ BRACKETIF CMP #0,TOS ; -- f .word BL_WORD,FIND mNEXTADR SUB #1,TOS ;1 borrow if TOS was 0 - SUBC TOS,TOS ;1 TOS=-1 if borrow was set + SUBC TOS,TOS ;1 TOS=-1 if borrow is set NIP_EXIT MOV @RSP+,IP NIP ADD #2,PSP ;1 MOV @IP+,PC ;4 @@ -499,7 +358,7 @@ NIP ADD #2,PSP ;1 ;Skip leading space delimiters. Parse name delimited by a space. ;Return a true flag if name is the name of a word that can be found, ;otherwise return a false flag. [DEFINED] is an immediate word. -DEFINED mDOCOL + mDOCOL .word BL_WORD,FIND .word NIP_EXIT @@ -533,27 +392,11 @@ NEGATE XOR #-1,TOS ;1 ONEPLUS ADD #1,TOS ;1 -- n3 = -(n2-n1) = n1-n2 MOV @IP+,PC -;------------------------------------------------------------------------------- -; MEMORY OPERATIONS -;------------------------------------------------------------------------------- - FORTHWORD "@" -; https://forth-standard.org/standard/core/Fetch -; @ a-addr -- x fetch cell from memory -FETCH MOV @TOS,TOS - MOV @IP+,PC - - FORTHWORD "!" -; https://forth-standard.org/standard/core/Store -; ! x a-addr -- store cell in memory -STORE MOV @PSP+,0(TOS);4 - MOV @PSP+,TOS ;2 - MOV @IP+,PC ;4 - ; ------------------------------------------------------------------------------ ; STRINGS PROCESSING ; ------------------------------------------------------------------------------ -; use SQUOTE+10 to enable separator select +; use SQUOTE+10 if you want to define another separator FORTHWORDIMM "S\34" ; immediate ; https://forth-standard.org/standard/core/Sq @@ -561,8 +404,7 @@ STORE MOV @PSP+,0(TOS);4 SQUOTE SUB #2,PSP ; first choose separator MOV TOS,0(PSP) MOV #'"',TOS ; separator = '"' -; SQUOTE+10 address ; - MOV #0,T ; volatile CAPS OFF, only for WORDD+4 below + MOV #0,T ; volatile CAPS OFF, paired with WORDD+4 mDOCOL .word LIT,XSQUOTE,COMMA ; obviously use not T register... .word WORDD+4 ; -- c-addr = DP, W=Count_of_chars @@ -592,6 +434,56 @@ DOTQUOTE mDOCOL LESSNUM MOV #HOLD_BASE,&HP MOV @IP+,PC +; primitive MU/MOD; used by ?NUMBER UM/MOD, and M*/ in DOUBLE word set +; MU/MOD UDVDlo UDVDhi UDIVlo -- UREMlo UQUOTlo UQUOThi +;------------------------------------------------------------------------------- +; unsigned 32-BIT DiViDend : 16-BIT DIVisor --> 32-BIT QUOTient 16-BIT REMainder +;------------------------------------------------------------------------------- +; two times faster if 16 bits DiViDend (cases of U. and . among others) + +; reg division MU/MOD NUM M*/ +; --------------------------------------------------------------------- +; S = DVD(15-0) = ud1lo = ud1lo ud1lo +; TOS = DVD(31-16) = ud1hi = ud1hi ud1mi +; W = DVD(47-32)/REM = rem = digit --> char --> -[HP] ud1hi +; T = DIV(15-0) = BASE = BASE ud2 +; X = QUOTlo = ud2lo = ud2lo QUOTlo +; Y = QUOThi = ud2hi = ud2hi QUOThi +; rDODOES = count + +MUSMOD MOV TOS,T ;1 T = DIVlo + MOV 2(PSP),S ;3 S = DVDlo + MOV @PSP,TOS ;2 TOS = DVDhi +MUSMOD1 MOV #0,W ;1 W = REMlo = 0 + MOV #32,rDODOES ;2 init loop count + CMP #0,TOS ;1 DVDhi=0 ? + JNZ MDIV1 ;2 no +; ----------------------------------; +MDIV1DIV2 RRA rDODOES ;1 yes:loop count / 2 + MOV S,TOS ;1 DVDhi <-- DVDlo + MOV #0,S ;1 DVDlo <-- 0 + MOV #0,X ;1 QUOTlo <-- 0 (to do QUOThi = 0 at the end of division) +; ----------------------------------; +MDIV1 CMP T,W ;1 REMlo U>= DIVlo ? + JNC MDIV2 ;2 no : carry is reset + SUB T,W ;1 yes: REMlo - DIVlo ; carry is set +MDIV2 ADDC X,X ;1 RLC quotLO + ADDC Y,Y ;1 RLC quotHI + SUB #1,rDODOES ;1 Decrement loop counter + JN ENDMDIV ;2 + ADD S,S ;1 RLA DVDlo + ADDC TOS,TOS ;1 RLC DVDhi + ADDC W,W ;1 RLC REMlo + JNC MDIV1 ;2 14~ + SUB T,W ;1 REMlo - DIVlo + BIS #1,SR ;1 SETC + JMP MDIV2 ;2 14~ +ENDMDIV MOV #XDODOES,rDODOES ;2 restore rDODOES + MOV W,2(PSP) ;3 REMlo in 2(PSP) + MOV X,0(PSP) ;3 QUOTlo in 0(PSP) + MOV Y,TOS ;1 QUOThi in TOS +RET_ADR MOV @RSP+,PC ;4 35 words, about 440/240 cycles, not FORTH executable ! + FORTHWORD "#" ; https://forth-standard.org/standard/core/num ; # ud1lo ud1hi -- ud2lo ud2hi convert 1 digit of output @@ -617,7 +509,7 @@ NUMS mDOCOL mNEXTADR ; next adr SUB #2,IP ;1 restore NUM return BIS TOS,X ;1 - CMP #0,X ;1 ud = 0 ? + CMP #0,X ;1 -- ud2lo ud2hi ud = 0 ? JNZ NUM1 ;2 EXIT MOV @RSP+,IP ;2 when DTC=2 rDOCOL is loaded with this EXIT address MOV @IP+,PC ;4 10 words, about 294|494 cycles for u|ud one digit @@ -640,50 +532,46 @@ HOLD MOV.B TOS,W ;1 FORTHWORD "SIGN" ; https://forth-standard.org/standard/core/SIGN ; SIGN n -- add minus sign if n<0 -SIGN CMP #0,TOS - MOV @PSP+,TOS - MOV.B #'-',W - JN HOLDW ; jump if 0< - MOV @IP+,PC +SIGN CMP #0,TOS ; 1 + MOV @PSP+,TOS ; 2 + MOV.B #'-',W ; 2 + JN HOLDW ; 2 jump if 0< + MOV @IP+,PC ; 4 BL CALL rDOCON - .word 20h + .word ' ' FORTHWORD "U." ; https://forth-standard.org/standard/core/Ud ; U. u -- display u (unsigned) ; note: DDOT = UDOT + 10 (see DOUBLE.f) -UDOT MOV #0,S ; 1 -- hi=0 - SUB #2,PSP ; 1 convert n|u to d|ud with Y = -1|0 - MOV TOS,0(PSP) ; 3 -- lo lo - MOV S,TOS ; 1 -- lo hi -DDOT PUSHM #2,IP ; 4 R-- IP S=sign - AND #-1,TOS ; clear V, set N - JGE DDOTNEXT ; if hi positive (N=0) - XOR #-1,0(PSP) ;4 - XOR #-1,TOS ;1 - ADD #1,0(PSP) ;4 - ADDC #0,TOS ;1 -DDOTNEXT mASM2FORTH ;10 +UDOT MOV #0,S ; 1 S=sign + SUB #2,PSP ; 1 + MOV TOS,0(PSP) ; 3 -- |lo| x + MOV #0,TOS ; 1 -- |lo| |hi| +UDOTNEXT PUSHM #2,IP ; 4 R-- IP sign + mASM2FORTH ;10 .word LESSNUM - .word BL,HOLD ; add a trailing space - .word NUMS ; R-- IP sign - .word RFROM,SIGN ; R-- IP + .word BL,HOLD ; add a trailing space + .word NUMS ; + .word RFROM,SIGN ; IP sign R-- IP .word NUMGREATER,TYPE - .word EXIT + .word EXIT ; IP R-- FORTHWORD "." ; https://forth-standard.org/standard/core/d ; . n -- display n (signed) DOT CMP #0,TOS JGE UDOT - MOV #-1,S + XOR #-1,TOS ;1 set TOS = |lo| + ADD #1,TOS ;1 + MOV #-1,S ;1 set S = minus sign JMP UDOT+2 ;------------------------------------------------------------------------------- ; INTERPRETER ;------------------------------------------------------------------------------- - +; ; https://forth-standard.org/standard/core/WORD ; WORD char -- addr Z=1 if len=0 ; parse a word delimited by char separator. @@ -692,12 +580,13 @@ DOT CMP #0,TOS ; notice that the average lenght of all CORE definitions is about 4. FORTHWORD "WORD" JMP WORDD ;2 + ;-------------------------------; BL_WORD SUB #2,PSP ;1 ) MOV TOS,0(PSP) ;3 > 6~ instead of 16~ for CONSTANT BL runtime MOV #' ',TOS ;2 -- BL ) -WORDD MOV &CAPS,T ;3 CAPS OFF = 0, CAPS ON = $20. - MOV #SOURCE_LEN,S ;2 -- WORDD+4 address +WORDD MOV #20h,T ;3 -- sep CAPS OFF = 0, CAPS ON = $20. + MOV #SOURCE_LEN,S ;2 WORD+16 address MOV @S+,X ;2 X = src_len MOV @S+,Y ;2 Y = src_org ADD Y,X ;1 X = src_len + src_org = src_end @@ -708,13 +597,13 @@ SKIPSEPLOOP CMP X,Y ;1 src_ptr >= src_end ? JC SKIPSEPEND ;2 if yes : End Of Line ! CMP.B @Y+,TOS ;2 does char = separator ? JZ SKIPSEPLOOP ;2 if yes; 7~ loop -;-------------------------------; SUB #1,Y ;1 decrement the post incremented src_ptr -SCANTICK CMP.B #"'",2(Y) ;4 third char = TICK ? (allow ' as first char for a defined word) +;-------------------------------; +SCANTICK CMP.B #"'",2(Y) ;4 third char = TICK ? (that allows ' as first char for a definition name) JNZ SCANWRDLOOP ;2 no - MOV #0,T ;1 don't change to upper case for a 'char' input + MOV #0,T ;1 don't capitalize a 'char' input ;-------------------------------; -SCANWRDLOOP MOV.B S,0(W) ;3 first, S makes room in dst for word length; next, put char here. +SCANWRDLOOP MOV.B S,0(W) ;3 first, make room in dst for word length; next, put char here. CMP X,Y ;1 src_ptr = src_end ? JZ SCANWRDEND ;2 if yes MOV.B @Y+,S ;2 S=char @@ -727,9 +616,10 @@ SCANWRDLOOP MOV.B S,0(W) ;3 first, S makes room in dst for w JC SCANWRDLOOP ;2 U>= loopback if yes SUB.B T,S ;1 convert a...z to A...Z if CAPS ON (T=$20) JMP SCANWRDLOOP ;2 23~ lower case char loop +SKIPSEPEND SCANWRDEND SUB &SOURCE_ORG,Y ;3 -- sep Y=src_ptr - src_org = new >IN (first char separator next) - MOV Y,&TOIN ;3 update >IN for next word search in this input stream -SKIPSEPEND MOV &DP,TOS ;3 -- addr TOS = HERE + MOV Y,&TOIN ;3 update >IN for next search in this input stream + MOV &DP,TOS ;3 -- addr TOS = HERE SUB TOS,W ;1 W = Word_Length >= 0 MOV.B W,0(TOS) ;3 -- c-addr MOV @IP+,PC ;4 Z=1 <==> Word_Length = 0 <==> EOL, tested by INTERPRET @@ -740,12 +630,12 @@ SKIPSEPEND MOV &DP,TOS ;3 -- addr TOS = HERE ; CFA -1 if found ; flag Z=0 ; CFA 1 if immediate ; flag Z=0 ; compare WORD at c-addr (HERE) with each of words in each of listed vocabularies in CONTEXT -; start of FIND : 5 cycles -; VOCLOOP : 5/12 cycles, -; mismatch word loop: +14 cycles on len, +; start of FIND : 24/33 cycles ; +7 cycles on first char, -; +10 cycles char loop, -; WORDFOUND to end : 15/16 cycles. +; +10 cycles x (n-1 char), +; WORDFOUND to end : 16 cycles. +; VOCLOOP : 12/19 cycles. +; name loop : 8 cycles. ; note: with 16 threads vocabularies, FIND takes only! 75% of CORETEST.4th processing time FIND SUB #2,PSP ;1 -- ???? c-addr reserve one cell, not at FINDEND which would kill the Z flag MOV TOS,S ;1 S=c-addr @@ -786,71 +676,6 @@ WORDFOUND BIT #1,X ;1 FINDEND MOV S,0(PSP) ;3 -- xt -1/0/1 if not found: -- c-addr 0 flag Z=1 MOV @IP+,PC ;4 34/40 words return to interpreter -; FORTHWORD "FIND" ; -; ; https://forth-standard.org/standard/core/FIND -; ; FIND addr -- c-addr 0 if not found ; flag Z=1 c-addr at transient RAM area (HERE) -; ; CFA -1 if found ; flag Z=0 -; ; CFA 1 if immediate ; flag Z=0 -; ; compare WORD at c-addr (HERE) with each of words in each of listed vocabularies in CONTEXT -; ; start of FIND : 4/11 cycles -; ; VOCLOOP : 6 cycles, -; ; mismatch word loop: +14 cycles on len, -; ; +7 cycles on first char, -; ; +10 cycles char loop, -; ; WORDFOUND to end : 15/17 cycles. -; ; note: with 16 threads vocabularies, FIND takes only! 75% of CORETEST.4th processing time -; FIND ; -; .SWITCH THREADS ; -; .CASE 1 ; nothing to do -; .ELSECASE ; searching thread adds 7 cycles & 6 words -; MOV.B 1(TOS),rDOCON ;3 S=c-addr rDOCON=first char of c-addr string -; AND.B #(THREADS-1),rDOCON;2 rDOCON=thread_x -; ADD rDOCON,rDOCON ;1 rDOCON=thread_offset_x -; ADD #2,rDOCON ;1 rDOCON=thread_offset_x+2 -; .ENDCASE -; SUB #2,PSP ;1 -- ???? c-addr reserve one cell, not at FINDEND which would kill the Z flag -; MOV TOS,S ;1 S=c-addr -; MOV #CONTEXT,T ;2 T = first cell addr of CONTEXT stack -; VOCLOOP MOV @T+,TOS ;2 -- ???? VOC_PFA T=CTXT+2 -; CMP #0,TOS ;1 no more vocabulary in CONTEXT ? -; JZ FINDEND ;2 -- ???? 0 yes ==> exit; Z=1 -; .SWITCH THREADS -; .CASE 1 ; nothing to do -; ADD #2,TOS ;1 -- ???? VOC_PFAx+2 -; .ELSECASE ; searching thread adds 7 cycles & 6 words -; ADD rDOCON,TOS ;1 -- ???? VOC_PFAx+2 TOS = words set entry -; .ENDCASE -; WORDLOOP MOV -2(TOS),TOS ;3 -- ???? NFA -2(TOS) = [VOC_PFAx] first, then [LFA] -; CMP #0,TOS ;1 no more word in the thread ? -; JZ VOCLOOP ;2 yes ==> search next voc in context -; MOV TOS,X ;1 -; MOV.B @X+,Y ;2 TOS = NFA, X= NFA+1, Y = NFA_first_byte = cnt<<2+i (i= immediate flag) -; RRA.B Y ;1 remove immediate flag, the remainder is the count of the definition name. -; LENCOMP CMP.B @S,Y ;2 compare lenght -; JNZ WORDLOOP ;2 14~ word loop on lenght mismatch -; MOV S,W ;1 S=W=c-addr -; CHARCOMP CMP.B @X+,1(W) ;4 compare chars -; JNZ WORDLOOP ;2 21~ word loop on first char mismatch -; ADD #1,W ;1 -; SUB.B #1,Y ;1 decr count -; JNZ CHARCOMP ;2 10~ char loop -; WORDFOUND BIT #1,X ;1 -; ADDC #0,X ;1 -; MOV X,S ;1 S=aligned CFA -; MOV.B @TOS,TOS ;2 -- ???? NFA_1st_byte -; AND #1,TOS ;1 -- ???? 0|1 test immediate flag -; JNZ FINDEND ;2 -- ???? 1 jump if bit 1 is set, as immediate bit -; SUB #1,TOS ;1 -- ???? -1 -; FINDEND -; .CASE 1 ; nothing to do -; .ELSECASE ; searching thread adds 7 cycles & 6 words -; MOV #XDOCON,rDOCON ;2 -; .ENDCASE -; MOV S,0(PSP) ;3 -- xt -1/0/1 if not found: -- c-addr 0 flag Z=1 -; MOV @IP+,PC ;4 34/40 words return to interpreter - - .IFDEF MPY_32 ; if 32 bits hardware multiplier - FORTHWORD ">NUMBER" ; >NUMBER ud1lo ud1hi addr1 cnt1 -- ud2lo ud2hi addr2 cnt2 ; https://forth-standard.org/standard/core/toNUMBER @@ -861,36 +686,66 @@ FINDEND MOV S,0(PSP) ;3 -- xt -1/0/1 if not found: -- c-addr ; or the first character past the end of the string if the string was entirely converted. ; cnt2 is the number of unconverted characters in the string. ; An ambiguous condition exists if ud2 overflows during the conversion. -TONUMBER MOV &BASEADR,T ;3 T = base + + MOV &BASEADR,T ;3 T = base MOV @PSP+,S ;2 -- ud1lo ud1hi cnt1 S = addr1 MOV @PSP+,Y ;2 -- ud1lo cnt1 Y = ud1hi MOV @PSP,X ;2 -- x cnt1 X = ud1lo SUB #4,PSP ;1 -- x x x cnt1 -TONUMLD_OP1 MOV T,&MPY ;3 base = MPY = OP1 loaded out of TONUMLOOP +TONUM_INPUT ; for QNUMBER + .IFDEF MPY_32 ; if 32 bits hardware multiplier + MOV T,&MPY ;3 base = MPY = OP1 loaded out of TONUMLOOP + .ENDIF TONUMLOOP MOV.B @S,W ;2 -- x x x cnt S=adr, T=base, W=char, X=udlo, Y=udhi DDIGITQ SUB.B #':',W ;2 all Ctrl_Chars < '0' and all chars '0' to '9' become negative JNC DDIGITQNEXT ;2 accept all chars U< ':' (accept $0 up to $39) SUB.B #7,W ;2 W = char - (':' + $07 = 'A') JNC TONUMEND ;2 -- x x x cnt reject all Ctrl_Chars U< 'A', (with Z flag = 0) DDIGITQNEXT ADD.B #0Ah,W ;2 restore digit value: 0 to 15 (and beyond) - CMP T,W ;1 digit-base (U>= comparaison rejects all Ctrl_Chars) - BIC #Z,SR ;1 reset Z before return to QNUMBER because else + CMP T,W ;1 digit - base + BIC #Z,SR ;1 clear Z before return to QNUMBER JC TONUMEND ;2 to avoid QNUMBER conversion true with digit=base :-( + .IFDEF MPY_32 ; if 32 bits hardware multiplier (ud * base) + digit --> ud MOV X,&OP2L ;3 Load 2nd operand (ud1lo) MOV Y,&OP2H ;3 Load 2nd operand (ud1hi) MOV &RES0,X ;3 lo result in X (ud2lo) MOV &RES1,Y ;3 hi result in Y (ud2hi) - ADD W,X ;1 ud2lo + digit +ADD_DIGIT ADD W,X ;1 ud2lo + digit ADDC #0,Y ;1 ud2hi + carry TONUMPLUS ADD #1,S ;1 adr+1 - SUB #1,TOS ;1 -- x x x cnt cnt-1 - JNZ TONUMLOOP ;2 if count <>0 34~ digit loop + SUB #1,TOS ;1 -- x x x cnt-1 cnt-1 + JNZ TONUMLOOP ;2 if count <>0 33~ per digit TONUMEND MOV S,0(PSP) ;3 -- x x addr2 cnt2 + .ELSE ; no hardware multiplier (ud * base) + digit --> ud + MOV #0,rDODOES ;1 RESlo=0 + MOV #0,rDOCON ;1 REShi=0 + MOV #1,rDOVAR ;1 BIT TEST for base +MUL_LOOP BIT rDOVAR,T ;1 test actual bit in base (OP1) + JZ MUL_SHIFT ;2 + ADD X,rDODOES ;1 IF 1: ADD ud1lo TO RESlo (OP2L + RES0 --> RES0) + ADDC Y,rDOCON ;1 ADDC ud1hi TO REShi (OP2H + RES1 + C --> RES1) +MUL_SHIFT ADD X,X ;1 (RLA LSBs) ud1lo *2 (OP2L*2) + ADDC Y,Y ;1 (RLC MSBs) ud1hi *2 (OP2H*2) + ADD rDOVAR,rDOVAR ;1 (RLA) NEXT BIT TO TEST (BIT_TEST<1) + JNC MUL_LOOP ;2 IF BIT IN CARRY: FINISHED + MOV rDODOES,X ;1 RESlo --> ud2lo + MOV rDOCON,Y ;1 REShi --> ud2hi +ADD_DIGIT ADD W,X ;1 ud2lo + digit + ADDC #0,Y ;1 ud2hi + carry +TONUMPLUS ADD #1,S ;1 adr+1 + SUB #1,TOS ;1 -- x x x cnt-1 cnt-1 + JNZ TONUMLOOP ;2 if count <>0 158/160/158 ~ per digit with base 2/10/16 +TONUMEND MOV #FORTH_ORG+4,W ;2 + MOV @W+,rDODOES ;2 XDODOES --> R5=rDODOES + MOV @W+,rDOCON ;2 XDOCON --> R6=rDOCON + MOV @W,rDOVAR ;2 RFROM --> R7=rDOVAR + MOV S,0(PSP) ;3 -- x x addr2 cnt2 + .ENDIF MOV Y,2(PSP) ;3 -- x ud2hi addr2 cnt2 MOV X,4(PSP) ;3 -- ud2lo ud2hi addr2 cnt2 - MOV @IP+,PC ;4 40 words + MOV @IP+,PC ;4 -; ?NUMBER makes the interface between INTERPRET and >NUMBER; it's a subset of INTERPRET. +; ?NUMBER makes the interface between INTERPRET and >NUMBER; also used by ASSEMBLER. ; convert a string to a signed number; FORTH 2012 prefixes $ % # are recognized, ; FORTH 2012 'char' numbers also, digits separator '_' also. ; with DOUBLE_INPUT option, 32 bits signed numbers (with decimal point) are recognized, @@ -899,12 +754,14 @@ TONUMEND MOV S,0(PSP) ;3 -- x x addr2 cnt2 ; chars . , _ are processed as >NUMBER exits. ;Z ?NUMBER addr -- n|d -1 if convert ok ; flag Z=0, UF9=1 if double ;Z addr -- addr 0 if convert ko ; flag Z=1 + +INTQNUM MOV #INTQNUMNEXT,IP ;2 INTQNUMNEXT is the next of QNUMBER QNUMBER ; -- addr .IFDEF DOUBLE_NUMBERS ; DOUBLE_NUMBERS = DOUBLE_INPUT | FIXPOINT_INPUT - BIC #UF9,SR ;2 reset UserFlag_9 used as double number flag + BIC #UF9,SR ;2 clear UserFlag_9 used as double number flag .ENDIF ; SUB #8,PSP ;1 -- x x x x addr make room for >NUMBER - MOV TOS,6(PSP) ;3 -- addr x x x addr save TOS + MOV TOS,6(PSP) ;3 -- addr x x x addr save TOS for TONUMEXIT MOV #0,Y ;1 Y=ud1hi=0 MOV #0,X ;1 X=ud1lo=0 MOV &BASEADR,T ;3 T=BASE @@ -914,9 +771,9 @@ QNUMBER ; -- addr MOV #TONUMEXIT,IP ;2 set TONUMEXIT as return from >NUMBER MOV.B @S+,TOS ;2 -- addr x x x cnt TOS=count, S=addr+1 QNUMLDCHAR MOV.B @S,W ;2 W=char - SUB.B #'-',W ;2 - JZ QNUMMINUS ;2 - JC TONUMLD_OP1 ;2 -- addr x x x cnt jump if char U> '-', case of numeric chars + SUB.B #'-',W ;2 char '-' ? + JZ QNUMMINUS ;2 negate sign + JC TONUM_INPUT ;2 -- addr x x x cnt jump if char U> '-', case of numeric chars QBINARY MOV #2,T ;1 preset base 2 ADD.B #8,W ;1 binary '%' prefix ? '%' + 8 = '-' JZ PREFIXNEXT ;2 yes @@ -933,12 +790,12 @@ QTICK CMP.B #4,W ;1 ' prefix ? CMP.B @S+,1(S) ;4 -- addr x x x 3 3rd char = 1st char ? MOV.B @S,S ;2 does byte to word conversion MOV S,4(PSP) ;3 -- addr ud2lo x x 3 ud2lo = ASCII code of 'char' - JMP QNUMNEXT ;2 -- addr ud2lo x x 3 with happy end only if 3rd char = 1st char = "'" + JMP QNUMNEXT ;2 -- addr ud2lo x x 3 with happy end only if 3rd char = 1st char = ' QNUMMINUS MOV #-1,2(RSP) ;3 R-- sign IP set sign flag PREFIXNEXT SUB #1,TOS ;1 -- addr x x x cnt-1 TOS=count-1 CMP.B @S+,0(S) ;4 S=adr+1; same prefix ? JNZ QNUMLDCHAR ;2 loopback if no - JZ TONUMLD_OP1 ;2 if yes, this 2nd prefix will be rejected by >NUMBER + JZ TONUM_INPUT ;2 if yes, this double prefix will be rejected by >NUMBER ; ------------------------------;46 TONUMEXIT mNEXTADR ; -- addr ud2lo-hi addr2 cnt2 R-- IP sign BASE S=addr2 JZ QNUMNEXT ;2 TOS=0 and Z=1 if conversion is ok @@ -962,9 +819,10 @@ TONUMEXIT mNEXTADR ; -- addr ud2lo-hi addr2 cnt2 R-- IP sign CMP.B #',',W ;2 rejected char by >NUMBER is a comma ? .ENDIF ; JNZ QNUMNEXT ;2 no: with Z=0 ==> goto QNUMKO -S15Q16 MOV TOS,W ;1 -- addr ud2lo x x x W=cnt2 - MOV #0,X ;1 -- addr ud2lo x 0 x init X = ud2lo' = 0 -S15Q16LOOP MOV X,2(PSP) ;3 -- addr ud2lo ud2lo' 0 x 2(PSP) = ud2lo' +; ------------------------------; -- addr ud2lo x x x S=addr2, T=base +S15Q16 MOV TOS,W ;1 -- addr ud2lo x x x W=cnt2 + MOV #0,X ;1 -- addr ud2lo x x x init X = ud2lo' = 0 +S15Q16LOOP MOV X,2(PSP) ;3 -- addr ud2lo ud2lo' x x 2(PSP) = X = ud2lo' = 0 then uqlo SUB.B #1,W ;1 decrement cnt2 MOV W,X ;1 X = cnt2-1 ADD S,X ;1 X = end_of_string-1,-2,-3... @@ -975,15 +833,15 @@ S15Q16LOOP MOV X,2(PSP) ;3 -- addr ud2lo ud2lo' 0 x 2(PSP) = ud2 JNC S15Q16EOC ;2 reject all chars U< 'A' QS15Q16DIGI ADD.B #10,X ;2 restore digit value CMP T,X ;1 T=Base, is X a digit ? - JC S15Q16EOC ;2 -- addr ud2lo ud2lo' ud2lo' x if not a digit - MOV X,0(PSP) ;3 -- addr ud2lo ud2lo' digit x - MOV T,TOS ;1 -- addr ud2lo ud2lo' digit base R-- IP sign - PUSHM #3,S ;5 PUSH S,T,W: R-- IP sign addr2 base cnt2 - CALL #MUSMOD ;4 -- addr ud2lo ur uqlo uqhi CALL MU/MOD - POPM #3,S ;5 restore W,T,S: R-- IP sign - JMP S15Q16LOOP ;2 W=cnt -S15Q16EOC MOV 4(PSP),2(PSP) ;5 -- addr ud2lo ud2hi uqlo x ud2lo from >NUMBER becomes here ud2hi part of Q15.16 - MOV @PSP,4(PSP) ;4 -- addr ud2lo ud2hi x x uqlo becomes ud2lo part of Q15.16 + JC S15Q16EOC ;2 -- addr ud2lo ud2lo' x x if not a digit, --> goto QNUMKO + MOV X,0(PSP) ;3 -- addr ud2lo ud2lo' digit x + MOV T,TOS ;1 -- addr ud2lo ud2lo' digit base R-- IP sign + PUSHM #3,S ;5 -- addr ud2lo ud2lo' ud2hi' base PUSH S,T,W: R-- IP sign addr2 base cnt2 + CALL #MUSMOD ;4 CALL MU/MOD + POPM #3,S ;5 -- addr ud2lo ur uqlo uqhi restore W,T,S: R-- IP sign + JMP S15Q16LOOP ;2 X=uqlo +S15Q16EOC MOV 4(PSP),2(PSP) ;5 -- addr ud2lo ud2hi uqlo uqhi ud2lo from >NUMBER becomes ud2hi part of Q15.16 + MOV @PSP,4(PSP) ;4 -- addr ud2lo ud2hi uqlo uqhi uqlo becomes ud2lo part of Q15.16 CMP.B #0,W ;1 count = 0 if end of conversion ok .ENDIF ; FIXPOINT_INPUT ; ------------------------------; @@ -1006,8 +864,8 @@ QDNEGATE XOR #-1,2(PSP) ;3 -- udlo udhi -1 ADD #1,2(PSP) ;3 ADDC #0,0(PSP) ;3 QDOUBLE BIT #UF9,SR ;2 -- dlo dhi tf decimal point or comma fixpoint ? - JZ NIP ;2 no, goto leave number -QNUMEND MOV @IP+,PC ;4 TOS<>0 and Z=0 ==> conversion ok + JZ NIP ;2 no, remove dhi, set Z=0 +QNUMEND MOV @IP+,PC ;4 TOS=tf and Z=0 ==> conversion ok .ELSE QNUMOK ADD #4,PSP ;1 -- addr ud2lo sign MOV @PSP,2(PSP) ;4 -- u u sign note : PSP is incremented before write back !!! @@ -1020,203 +878,6 @@ QNUMEND ADD #2,PSP ;1 -- n tf MOV @IP+,PC ;4 TOS=-1 and Z=0 ==> conversion ok .ENDIF ; DOUBLE_NUMBERS ; - .ELSE ; if no hardware MPY - FORTHWORD "UM*" -; T.I. UNSIGNED MULTIPLY SUBROUTINE: U1 x U2 -> Ud -; https://forth-standard.org/standard/core/UMTimes -; UM* u1 u2 -- ud unsigned 16x16->32 mult. -UMSTAR MOV @PSP,S ;2 MDlo -UMSTAR1 MOV #0,T ;1 MDhi=0 - MOV #0,X ;1 RES0=0 - MOV #0,Y ;1 RES1=0 - MOV #1,W ;1 BIT TEST REGISTER -UMSTARLOOP BIT W,TOS ;1 TEST ACTUAL BIT MRlo - JZ UMSTARNEXT ;2 IF 0: DO NOTHING - ADD S,X ;1 IF 1: ADD MDlo TO RES0 - ADDC T,Y ;1 ADDC MDhi TO RES1 -UMSTARNEXT ADD S,S ;1 (RLA LSBs) MDlo x 2 - ADDC T,T ;1 (RLC MSBs) MDhi x 2 - ADD W,W ;1 (RLA) NEXT BIT TO TEST - JNC UMSTARLOOP ;2 IF BIT IN CARRY: FINISHED 10~ loop - MOV X,0(PSP) ;3 low result on stack - MOV Y,TOS ;1 high result in TOS - MOV @IP+,PC ;4 17 words - - FORTHWORD ">NUMBER" -; https://forth-standard.org/standard/core/toNUMBER -; ud2 is the unsigned result of converting the characters within the string specified by c-addr1 u1 into digits, -; using the number in BASE, and adding each into ud1 after multiplying ud1 by the number in BASE. -; Conversion continues left-to-right until a character that is not convertible, including '.', ',' or '_', -; is encountered or the string is entirely converted. c-addr2 is the location of the first unconverted character -; or the first character past the end of the string if the string was entirely converted. -; u2 is the number of unconverted characters in the string. -; An ambiguous condition exists if ud2 overflows during the conversion. -; >NUMBER ud1lo|ud1hi addr1 count1 -- ud2lo|ud2hi addr2 count2 -TONUMBER MOV &BASEADR,W ;3 W = base - MOV @PSP,S ;2 S=adr - MOV TOS,T ;1 T=count -TONUMLOOP MOV.B @S,Y ;2 -- ud1lo ud1hi x x S=adr, T=count, W=BASE, Y=char -DDIGITQ SUB.B #':',Y ;2 - JNC DDIGITQNEXT ;2 accept all chars <= 9 - SUB.B #07,Y ;2 reject all chars between "9" and "A" - JNC TONUMEND ;2 yes: for bad end -DDIGITQNEXT ADD.B #10,Y ;2 restore number - CMP W,Y ;1 -- ud1lo ud1hi x x digit-base - BIC #Z,SR ;1 reset Z before jmp TONUMEND because... - JC TONUMEND ;2 ...QNUMBER conversion will be true if Z = 1 :-( -UDSTAR PUSHM #6,IP ;8 -- ud1lo ud1hi x x save IP S T W X Y used by UM* r-- IP adr count base x digit - MOV 2(PSP),S ;3 -- ud1lo ud1hi x x S=ud1hi - MOV W,TOS ;1 -- ud1lo ud1hi x base - MOV #UMSTARNEXT1,IP ;2 -UMSTARONE JMP UMSTAR1 ;2 ud1hi * base -- x ud3hi X=ud3lo -UMSTARNEXT1 mNEXTADR ; -- ud1lo ud1hi x ud3hi - MOV X,2(RSP) ;3 r-- IP adr count base ud3lo digit - MOV 4(PSP),S ;3 -- ud1lo ud1hi x ud3hi S=ud1lo - MOV 4(RSP),TOS ;3 -- ud1lo ud1hi x base - MOV #UMSTARNEXT2,IP ;2 -UMSTARTWO JMP UMSTAR1 ;2 -- ud1lo ud1hi x ud4hi X=ud4lo -UMSTARNEXT2 mNEXTADR ; -- ud1lo ud1hi x ud4hi - ADD @RSP+,X ;2 -- ud1lo ud1hi x ud4hi X=ud4lo+digit=ud2lo r-- IP adr count base ud3lo - ADDC @RSP+,TOS ;2 -- ud1lo ud1hi x ud2hi TOS=ud4hi+ud3lo+carry=ud2hi r-- IP adr count base - MOV X,4(PSP) ;3 -- ud2lo ud1hi x ud2hi - MOV TOS,2(PSP) ;3 -- ud2lo ud2hi x x r-- IP adr count base - POPM #4,IP ;6 -- ud2lo ud2hi x x W=base, T=count, S=adr, IP=prevIP r-- -TONUMPLUS ADD #1,S ;1 - SUB #1,T ;1 - JNZ TONUMLOOP ;2 -- ud2lo ud2hi x x S=adr+1, T=count-1, W=base 68 cycles char loop -TONUMEND MOV S,0(PSP) ;3 -- ud2lo ud2hi adr2 count2 - MOV T,TOS ;1 -- ud2lo ud2hi adr2 count2 - MOV @IP+,PC ;4 48/82 words/cycles, W = BASE - -; ?NUMBER makes the interface between >NUMBER and INTERPRET; it's a subset of INTERPRET. -; convert a string to a signed number; FORTH 2012 prefixes ' $, %, # are recognized -; digits separator '_' also. -; with DOUBLE_INPUT switched ON, 32 bits signed numbers (with decimal point) are recognized -; with FIXPOINT_INPUT switched ON, Q15.16 signed numbers (with comma) are recognized. -; prefixes ' # % $ - are processed before calling >NUMBER -; chars . , _ are processed as >NUMBER exits -;Z ?NUMBER addr -- n|d -1 if convert ok ; flag Z=0, UF9=1 if double -;Z addr -- addr 0 if convert ko ; flag Z=1 -QNUMBER - .IFDEF DOUBLE_NUMBERS ; DOUBLE_NUMBERS = DOUBLE_INPUT | FIXPOINT_INPUT - BIC #UF9,SR ;2 reset flag UF9, before use as double number flag - .ENDIF ; - SUB #8,PSP ;1 -- x x x x addr - MOV TOS,6(PSP) ;3 -- addr x x x addr save TOS - MOV #0,4(PSP) ;3 ud1hi=0 - MOV #0,2(PSP) ;3 -- addr 0 0 x addr ud1lo=0 - MOV &BASEADR,W ;3 W=BASE - MOV TOS,S ;1 -- addr ud=0 x x S=addr - MOV #0,TOS ;1 - PUSHM #2,TOS ;4 R-- sign IP (push TOS,IP) - MOV #TONUMEXIT,IP ;2 define >NUMBER return - MOV.B @S+,T ;2 S=addr+1, T=count -QNUMLDCHAR MOV.B @S,Y ;2 Y=char - SUB.B #'-',Y ;2 -- addr ud=0 x x sign minus ? - JZ QNUMMINUS ;2 yes - JC TONUMLOOP ;2 if char U> '-' -QBINARY MOV #2,W ;1 preset base 2 - ADD.B #8,Y ;1 binary prefix ? '%' = '-' + 8 - JZ PREFIXNEXT ;2 yes -QDECIMAL ADD #8,W ;1 preset base 10 - ADD.B #2,Y ;1 decimal prefix ? '#' = '%' + 2 - JZ PREFIXNEXT ;2 yes -QHEXA MOV #16,W ;2 preset base 16 - CMP.B #1,Y ;1 hex prefix ? '$' = '#' + 1 - JZ PREFIXNEXT ;2 yes -QTICK CMP.B #4,Y ;1 prefix = ' ? "'" = '#' + 4 - JNZ QNUMNEXT ;2 -- addr x x x cnt no, abort because other prefixes not recognized - CMP #3,TOS ; - JNZ QNUMNEXT ; - CMP.B @S+,1(S) ;4 compare 3rd with first char ' - MOV.B @S,S ;2 does char to word conversion - MOV S,4(PSP) ;5 -- addr ud2lo x x 3 ud2lo = ASCII code of 'char' - JMP QNUMNEXT ;2 with happy end if flag Z = 1 -QNUMMINUS MOV #-1,2(RSP) ;3 R-- sign IP set sign flag -PREFIXNEXT SUB #1,T ;1 T=count-1 - CMP.B @S+,0(S) ;4 S=adr+1; same prefix ? - JNZ QNUMLDCHAR ;2 no - JZ TONUMLOOP ;2 yes, that will abort conversion -; ------------------------------;43 -TONUMEXIT mNEXTADR ; -- addr ud2lo-hi addr2 cnt2 R-- IP sign BASE S=addr2,T=cnt2 - JZ QNUMNEXT ;2 if conversion is ok - SUB #2,IP - MOV.B @S,Y ; regenerate rejected char - CMP.B #'_',Y ;2 rejected char by >NUMBER is a underscore ? - JZ TONUMPLUS ; yes: loopback to >NUMBER to skip char - .IFDEF DOUBLE_NUMBERS ; DOUBLE_NUMBERS = DOUBLE_INPUT | FIXPOINT_INPUT - BIT #UF9,SR ; UF9 already set ? (you have wrongly typed two points) - JNZ QNUMNEXT ; yes, goto QNUMKO - BIS #UF9,SR ;2 set double number flag - .ENDIF - .IFDEF DOUBLE_INPUT - SUB.B #'.',Y ;1 rejected char by >NUMBER is a decimal point ? - JZ TONUMPLUS ;2 to terminate conversion - .ENDIF - .IFDEF FIXPOINT_INPUT ; - .IFDEF DOUBLE_INPUT - ADD.B #2,Y ;1 rejected char by >NUMBER is a comma ? - .ELSE - SUB.B #',',Y ;1 rejected char by >NUMBER is a comma ? - .ENDIF - JNZ QNUMNEXT ;2 no, goto QNUMKO -S15Q16 MOV #0,X ;1 -- addr ud2lo x 0 x init ud2lo' = 0 -S15Q16LOOP MOV X,2(PSP) ;3 -- addr ud2lo ud2lo' ud2lo' x X = 0(PSP) = ud2lo' - SUB.B #1,T ;1 decrement cnt2 - MOV T,X ;1 X = cnt2-1 - ADD S,X ;1 X = end_of_string-1, first... - MOV.B @X,X ;2 X = last char of string, first... - SUB.B #':',X ;2 - JNC QS15Q16DIGI ;2 accept all chars U< ':' - SUB.B #7,X ;2 - JNC S15Q16EOC ;2 reject all chars U< 'A' -QS15Q16DIGI ADD.B #10,X ;2 restore number - CMP W,X ;1 W=BASE, is X a digit ? - JC S15Q16EOC ;2 -- addr ud2lo ud2lo' x ud2lo' if not a digit - MOV X,0(PSP) ;3 -- addr ud2lo ud2lo' digit x - MOV W,TOS ;1 -- addr ud2lo ud2lo' digit base R-- IP sign - PUSHM #3,S ;5 PUSH S,T,W: R-- IP sign addr2 cnt2 base - CALL #MUSMOD ;4 -- addr ud2lo ur uqlo uqhi - POPM #3,S ;5 restore W,T,S: R-- IP sign - JMP S15Q16LOOP ;2 W=cnt -S15Q16EOC MOV 4(PSP),2(PSP) ;5 -- addr ud2lo ud2lo uqlo x ud2lo from >NUMBER part1 becomes here ud2hi=S15 part2 - MOV @PSP,4(PSP) ;4 -- addr ud2lo ud2hi x x uqlo becomes ud2lo - CMP.B #0,T ;1 cnt2 = 0 if end of conversion ok - .ENDIF ; FIXPOINT_INPUT ; -; ------------------------------;97 -QNUMNEXT POPM #2,TOS ;4 -- addr ud2lo-hi x sign R: -- POPM IP,TOS TOS = sign flag = {-1;0} - JZ QNUMOK ;2 -- addr ud2lo-hi x sign conversion OK if Z=1 -; ------------------------------; -QNUMKO ADD #6,PSP ;1 -- addr sign - AND #0,TOS ;1 -- addr ff TOS=0 and Z=1 ==> conversion ko - MOV @IP+,PC ;4 -; ------------------------------; - .IFDEF DOUBLE_NUMBERS -QNUMOK ADD #2,PSP ;1 -- addr ud2lo ud2hi sign - MOV 2(PSP),4(PSP) ; -- udlo udlo udhi sign - MOV @PSP+,0(PSP) ;4 -- udlo udhi sign note : PSP is incremented before write back !!! - XOR #-1,TOS ;1 -- udlo udhi inv(sign) - JNZ QDOUBLE ;2 if jump : TOS=-1 and Z=0 ==> conversion ok - XOR #-1,TOS ;1 -- udlo udhi tf -Q2NEGATE XOR #-1,2(PSP) ;3 - XOR #-1,0(PSP) ;3 - ADD #1,2(PSP) ;3 - ADDC #0,0(PSP) ;3 -- dlo dhi tf -QDOUBLE BIT #UF9,SR ;2 -- dlo dhi tf decimal point added ? - JZ NIP ; no, goto leave number, Z=0 -QNUMEND MOV @IP+,PC ;4 TOS=-1 and Z=0 ==> conversion ok - .ELSE -QNUMOK ADD #4,PSP ;1 -- addr ud2lo sign - MOV @PSP,2(PSP) ;4 -- udlo udlo sign note : PSP is incremented before write back !!! - XOR #-1,TOS ;1 -- udlo udlo inv(sign) - JNZ QNUMEND ;2 if jump : TOS=-1 and Z=0 ==> conversion ok - XOR #-1,TOS ;1 -- udlo udlo tf TOS=-1 and Z=0 -QNEGATE XOR #-1,2(PSP) ;3 - ADD #1,2(PSP) ;3 -- n udlo tf -QNUMEND ADD #2,PSP ;1 - MOV @IP+,PC ;4 TOS=-1 and Z=0 ==> conversion ok - .ENDIF ; DOUBLE_NUMBERS - .ENDIF ; of Hardware/Software MPY FORTHWORDIMM "\\" ; immediate ; https://forth-standard.org/standard/block/bs @@ -1226,7 +887,10 @@ BACKSLASH MOV &SOURCE_LEN,&TOIN ; MOV @IP+,PC ; ------------------------------; -; INTERPRET = BACKSLASH + 8 ; +; INTERPRET=\\+8 ; +; EXECUTE=\\+$28; ; +; ------------------------------; + ; ------------------------------; ; INTERPRET i*x addr u -- j*x interpret given buffer ; This is the common factor of EVALUATE and QUIT. @@ -1239,9 +903,8 @@ INTLOOP .word BL_WORD ; -- c-addr flag Z = 1 <=> End Of Line mNEXTADR ; -- xt|c-addr|xt -1|0|+1 Z=1 --> not found MOV TOS,W ; W = flag = (-1|0|+1) as (not_immediate|not_found|immediate) MOV @PSP+,TOS ; -- xt|c-addr|xt - MOV #INTQNUMNEXT,IP ;2 INTQNUMNEXT is the next of QNUMBER - JZ QNUMBER ;2 if Z=1 --> not found, search a number - MOV #INTLOOP,IP ;2 INTLOOP is the continuation of EXECUTE|COMMA + JZ INTQNUM ;2 if Z=1 --> not found, search a number from c_addr + MOV #INTLOOP,IP ;2 INTLOOP is the next of EXECUTE|COMMA XOR &STATE,W ;3 JZ COMMA ;2 -- xt if W xor STATE = 0 compile xt, then loop back to INTLOOP EXECUTE PUSH TOS ;3 -- xt @@ -1250,9 +913,9 @@ EXECUTE PUSH TOS ;3 -- xt ; ------------------------------; INTQNUMNEXT mNEXTADR ; -- n|c-addr fl Z = 1 --> not a number, SR(UF9) double number request MOV @PSP+,TOS ;2 -- n|c-addr - MOV #INTLOOP,IP ;2 INTLOOP is the continuation of LITERAL. + MOV #INTLOOP,IP ;2 INTLOOP is the next of LITERAL. JNZ LITERAL ;2 n -- Z = 0 --> is a number, execute LITERAL then loop back to INTLOOP -NOTFOUND MOV #FABORT_TERM,IP ;2 ABORT_TERM becomes the end of INTERPRET +NOTFOUND MOV #FQABORT_YES,IP ;2 QABORT_YES becomes the end of INTERPRET ADD.B #1,0(TOS) ;3 c-addr -- Z = 1 --> Not a Number : incr string count to add '?' MOV.B @TOS,Y ;2 Y=count+1 ADD TOS,Y ;1 Y=end of string addr @@ -1306,6 +969,13 @@ ZEROLESS ADD TOS,TOS ;1 set carry if TOS negative INVERT XOR #-1,TOS ;1 TOS=-1 if carry was set MOV @IP+,PC ;4 +QFRAM_FULL SUB #2,PSP ; 2 + MOV TOS,0(PSP) ; 3 + MOV #0,TOS ; 1 + CMP #FRAM_FULL,&DP ; 4 + JC INVERT ; 2 + MOV @IP+,PC ; 4 16~ + FORTHWORD "COUNT" ; https://forth-standard.org/standard/core/COUNT ; COUNT c-addr1 -- adr len counted->adr/len @@ -1316,17 +986,10 @@ COUNT SUB #2,PSP ;1 AND #-1,TOS ;1 Z is set if u=0 MOV @IP+,PC ;4 12~ -QFRAM_FULL SUB #2,PSP ; 2 - MOV TOS,0(PSP) ; 3 - MOV #0,TOS ; 1 - CMP #FRAM_FULL,&DP ; 4 - JC INVERT ; 2 - MOV @IP+,PC ; 4 16~ - FORTHWORD "ALLOT" ; https://forth-standard.org/standard/core/ALLOT ; ALLOT n -- allocate n bytes -ALLOT ADD TOS,&DP + ADD TOS,&DP MOV @PSP+,TOS MOV @IP+,PC @@ -1353,7 +1016,7 @@ QUIT2 .word XSQUOTE ; 16~ .byte 2,13,10 ; CR+LF .ENDIF .word TYPE ; 79~ - .word REFILL ; -- org len refill the input line buffer from ACCEPT +QUIT3 .word REFILL ; -- org len refill the input line buffer from ACCEPT QUIT4 .word INTERPRET ; interpret it QUIT5 .word QDEPTH ; 15~ stack empty test .word XSQUOTE ; 16~ ABORT" stack empty" @@ -1371,8 +1034,8 @@ QUIT5 .word QDEPTH ; 15~ stack empty test .ENDIF .word BRAN,QUIT2 ; 6~ - FORTHWORDIMM "ABORT\34" -; ; ABORT" is enabled in interpretation mode (+ 11 words) : +; FORTHWORDIMM "ABORT\34" +; ; ABORT" is enabled in interpretation mode (+ 10 words) : ; PUSH IP ; CMP #0,&STATE ; JNZ COMP_QABORT @@ -1380,11 +1043,12 @@ QUIT5 .word QDEPTH ; 15~ stack empty test ; mASM2FORTH ; .word LIT,'"',WORDD+4,COUNT,QABORT ; .word DROPEXIT -;COMP_QABORT mASM2FORTH -; .word SQUOTE -; .word LIT,QABORT,COMMA ; see QABORT in forthMSP430FR_TERM_xxx.asm -;FEXIT .word EXIT +; COMP_QABORT mASM2FORTH +; .word SQUOTE +; .word LIT,QABORT,COMMA ; see QABORT in forthMSP430FR_TERM_xxx.asm +; FEXIT .word EXIT + FORTHWORDIMM "ABORT\34" ; https://forth-standard.org/standard/core/ABORTq ; ABORT" " (empty string) displays nothing ; ABORT" i*x flag -- i*x R: j*x -- j*x flag=0 @@ -1450,7 +1114,7 @@ POST1 .word COMMA,EXIT ; then compile xt of word found if immediate FORTHWORD ":" ; https://forth-standard.org/standard/core/Colon ; : -- begin a colon definition -COLON PUSH #COLONNEXT ;3 define COLONNEXT as HEADER return + PUSH #COLONNEXT ;3 define COLONNEXT as HEADER return ;-----------------------------------; HEADER BIT #1,&DP ;3 carry set if odd ADDC #2,&DP ;4 align and make room for LFA @@ -1502,12 +1166,12 @@ COLONNEXT ; Y is NFA ) ;;Z ?REVEAL -- if no stack mismatch, link this new word in the CURRENT vocabulary QREVEAL CMP PSP,&LAST_PSP ; Check SP with its saved value by , :NONAME CODE... - JNZ BAD_CSP ; JZ LINK_NFA ; -BAD_CSP mASM2FORTH ; if stack mismatch. + mASM2FORTH ; if stack mismatch. .word XSQUOTE - .byte 15,"stack mismatch!" -FABORT_TERM .word ABORT_TERM + .byte 15,"stack mismatch!" ; -- addr cnt +FQABORT_YES .word QABORT_YES ; + LINK_NFA MOV &LAST_NFA,Y ; if no error, link this definition in its thread MOV &LAST_THREAD,X ; REVEAL MOV @X,-2(Y) ; [LAST_THREAD] --> LFA (for NONAME: LFA --> 210h unused PA reg) @@ -1527,7 +1191,7 @@ SEMICOLON CMP #0,&STATE ; if interpret mode, semicolon becomes a com ; https://forth-standard.org/standard/core/IMMEDIATE ; IMMEDIATE -- make last definition immediate IMMEDIATE MOV &LAST_NFA,Y ;3 - BIS.B #1,0(Y) ;4 FIND process more easier with bit0 for IMMEDIATE flag than bit7 + BIS.B #1,0(Y) ;4 FIND process more easier with bit0 than bit7 for IMMEDIATE flag MOV @IP+,PC FORTHWORD "CREATE" @@ -1538,7 +1202,7 @@ IMMEDIATE MOV &LAST_NFA,Y ;3 CREATE CALL #HEADER ; -- W = DP MOV #DOCON,-4(W) ;4 -4(W) = CFA = CALL rDOCON MOV W,-2(W) ;3 -2(W) = PFA = W = next address -CREATENEXT JMP REVEAL ; to link the definition in vocabulary + JMP REVEAL ; to link the definition in vocabulary FORTHWORD "DOES>" ; https://forth-standard.org/standard/core/DOES @@ -1563,8 +1227,8 @@ HEADERLESS SUB #2,PSP ; -- TOS common part of :NONAME and CODEN BIT #1,W ; ADDC #0,W ; W = aligned CFA MOV W,TOS ; -- xt aligned CFA of :NONAME | CODENNM - MOV #212h,X ; MOV Y,0(X) writes to 212h = unused PA register address (lure for REVEAL) - MOV X,Y ; MOV @X,-2(Y) writes to 210h = unused PA register address (lure for REVEAL and IMMEDIATE) + MOV #212h,X ; MOV Y,0(X) will write to 212h = unused PA register address (lure for REVEAL) + MOV X,Y ; MOV @X,-2(Y) will write to 210h = unused PA register address (lure for REVEAL and IMMEDIATE) JMP HEADEREND ; ;; https://forth-standard.org/standard/core/DEFER @@ -1592,11 +1256,11 @@ HEADERLESS SUB #2,PSP ; -- TOS common part of :NONAME and CODEN ; or in a definition : ... ['] U. IS DISPLAY ... ; ; KEY, EMIT, CR, ACCEPT are examples of DEFERred words -; IS xt -- FORTHWORDIMM "IS" ; immediate IS PUSH IP CMP #0,&STATE JNZ IS_COMPILE +; IS xt -- IS_EXEC mASM2FORTH .word TICK mNEXTADR @@ -1609,101 +1273,10 @@ IS_COMPILE mASM2FORTH .word LIT,DEFERSTORE ; compile DEFERSTORE .word COMMA,EXIT -;------------------------------------------------------------------------------- -; ASSEMBLER building definitions -;------------------------------------------------------------------------------- - FORTHWORD "CODE" ; a CODE word must be finished with ENDCODE -ASMCODE CALL #HEADER ; (that sets CFA and PFA) -ASMCODE1 SUB #4,&DP ; remove default room for CFA + PFA - .IFDEF VOCABULARY_SET ; if VOCABULARY_SET - JMP hidden ; add hidden word set in CONTEXT stack - .ELSE ; -hidden MOV &CONTEXT,&CONTEXT+2 ; add hidden word set in CONTEXT stack - MOV #BODYhidden,&CONTEXT; - MOV @IP+,PC ; - .ENDIF - -; HDNCODE (hidden CODE) is used to define a CODE word which must not to be executed by FORTH interpreter -; i.e. typically the case of an assembler definition called by CALL and ended by RET, or an interrupt routine. -; HDNCODE words are only usable in ASSEMBLER CONTEXT. - FORTHWORD "HDNCODE" - PUSH &CURRENT ; save CURRENT - MOV #BODYhidden,&CURRENT; select hidden word set as CURRENT to link HDNCODE definition - mDOCOL - .word ASMCODE - mNEXTADR - MOV @RSP+,IP - MOV @RSP+,&CURRENT ; restore CURRENT - MOV @IP+,PC ; - - FORTHWORD "CODENNM" ; CODENoNaMe is the assembly counterpart of :NONAME -CODENNM PUSH #ASMCODE1 ; define HEADERLESS return - JMP HEADERLESS ; that makes room for CFA and PFA - - asmword "ENDCODE" ; -ENDCODE MOV IP,T ; T is unused by QREVEAL - mASM2FORTH ; - .word QREVEAL - mNEXTADR - MOV T,IP .IFDEF VOCABULARY_SET - JMP PREVIOUS ; remove hidden word set from CONTEXT stack - .ELSE ; -PREVIOUS MOV #BODYFORTH,&CONTEXT ; remove hidden word set from CONTEXT stack - MOV #0,&CONTEXT+2 ; - MOV @IP+,PC - .ENDIF - -; here are 3 words used to switch FORTH <--> ASSEMBLER - -; COLON -- compile DOCOL, remove ASSEMBLER from CONTEXT stack, switch to compilation state - asmword "COLON" - MOV &DP,W - .SWITCH DTC - .CASE 1 - MOV #DOCOL,0(W) ; compile CALL R4 = rDOCOL ([rDOCOL] = XDOCOL) - ADD #2,&DP - .CASE 2 - MOV #120Dh,0(W) ; compile PUSH IP -COLON1 MOV #DOCOL,2(W) ; compile CALL R4 = rDOCOL - ADD #4,&DP - .CASE 3 ; inlined DOCOL - MOV #120Dh,0(W) ; compile PUSH IP -COLON1 MOV #400Dh,2(W) ; compile MOV PC,IP - MOV #522Dh,4(W) ; compile ADD #4,IP - MOV #4D30h,6(W) ; compile MOV @IP+,PC - ADD #8,&DP ; - .ENDCASE ; DTC -COLON2 MOV #-1,&STATE ; enter in compile state - JMP PREVIOUS ; to restore CONTEXT - -; LO2HI -- same as COLON but without saving IP - asmword "LO2HI" - .SWITCH DTC - .CASE 1 ; compile 2 words - MOV &DP,W - MOV #12B0h,0(W) ; compile CALL #EXIT, 2 words 4+6=10~ - MOV #EXIT,2(W) - ADD #4,&DP - JMP COLON2 - .ELSECASE ; CASE 2 : compile 1 word, CASE 3 : compile 3 words - SUB #2,&DP ; to skip PUSH IP - MOV &DP,W - JMP COLON1 - .ENDCASE - -; HI2LO -- immediate, switch to low level, set interpretation state, add ASSEMBLER to CONTEXT - FORTHWORDIMM "HI2LO" ; - ADD #2,&DP ; HERE+2 - MOV &DP,W ; W = HERE+2 - MOV W,-2(W) ; compile HERE+2 to HERE - MOV #0,&STATE ; LEFTBRACKET - JMP hidden ; to save CURRENT and add ASSEMBLER in context - ;------------------------------------------------------------------------------- ; WORDS SET for VOCABULARY, not ANS compliant, ;------------------------------------------------------------------------------- - .IFDEF VOCABULARY_SET FORTHWORD "WORDSET" ;X VOCABULARY -- create a new word_set @@ -1738,27 +1311,27 @@ ALSOLOOP SUB #2,X FORTHWORD "DEFINITIONS" ;X DEFINITIONS -- set last context vocabulary as entry for further defining words -DEFINITIONS MOV &CONTEXT,&CURRENT + MOV &CONTEXT,&CURRENT MOV @IP+,PC FORTHWORD "ONLY" ;X ONLY -- fill the context stack with 0 to access only the first word-set, ex.: FORTH ONLY - MOV #8,T + MOV #8,W MOV #0,X -ONLY_LOOP ADD #2,X - MOV #0,CONTEXT(X) - SUB #1,T +ONLY_LOOP MOV #0,CONTEXT+2(X) + ADD #2,X + SUB #1,W JNZ ONLY_LOOP MOV @IP+,PC FORTHWORD "PREVIOUS" ;X PREVIOUS -- pop first word-set out of context stack -PREVIOUS MOV #8,Y ;1 move down 8 words, first with CONTEXT+2 addr, last with NULL_WORD one +PREVIOUS MOV #8,W ;1 move down 8 words, first with CONTEXT+2 addr, last with NULL_WORD one MOV #CONTEXT+2,X ;2 X = org = CONTEXT+2, X-2 = dst = CONTEXT CMP #0,0(X) ;3 [org] = 0 ? JZ PREVIOUSEND ;2 to avoid scratch of the first CONTEXT cell by human mistake PREVIOUSLOO MOV @X+,-4(X) ;4 - SUB #1,Y ;1 + SUB #1,W ;1 dec word JNZ PREVIOUSLOO ;2 8~ loop * 8 = 64 ~ PREVIOUSEND MOV @IP+,PC ;4 @@ -1838,11 +1411,11 @@ BODYFORTH .word lastforthword ; BODY of FORTH voclink .set $-2 .IFDEF VOCABULARY_SET - FORTHWORD "hidden" ; cannot be found by FORTH interpreter because the string is not capitalized + FORTHWORD "hidden" ; cannot be found by FORTH interpreter because the string is not capitalized hidden CALL rDODOES .word VOCDOES .ENDIF -BODYhidden .word lastasmword ; BODY of hidden words +BODYhidden .word lastasmword ; BODY of hidden words .SWITCH THREADS .CASE 2 .word lastasmword1 @@ -1912,6 +1485,97 @@ BODYhidden .word lastasmword ; BODY of hidden words voclink .set $-2 ;------------------------------------------------------------------------------- +; ASSEMBLER building definitions +;------------------------------------------------------------------------------- + FORTHWORD "CODE" ; a CODE word must be finished with ENDCODE +ASMCODE CALL #HEADER ; (that sets CFA and PFA) +ASMCODE1 SUB #4,&DP ; remove default room for CFA + PFA + .IFDEF VOCABULARY_SET ; if VOCABULARY_SET + JMP hidden ; add hidden word set in CONTEXT stack + .ELSE ; +hidden MOV &CONTEXT,&CONTEXT+2 ; add hidden word set in CONTEXT stack + MOV #BODYhidden,&CONTEXT; + MOV @IP+,PC ; + .ENDIF + +; HDNCODE (hidden CODE) is used to define a CODE word which must not to be executed by FORTH interpreter +; i.e. typically the case of an assembler definition called by CALL and ended by RET, or an interrupt routine. +; HDNCODE words are only usable in ASSEMBLER CONTEXT. + FORTHWORD "HDNCODE" + PUSH &CURRENT ; save CURRENT word-set + MOV #BODYhidden,&CURRENT; select hidden word set as CURRENT + mDOCOL + .word ASMCODE ; thus, the created links of HDNCODE definitions are relative to the hidden word-set + mNEXTADR + MOV @RSP+,IP + MOV @RSP+,&CURRENT ; restore previous CURRENT word-set + MOV @IP+,PC ; + + FORTHWORD "CODENNM" ; CODENoNaMe is the assembly counterpart of :NONAME + PUSH #ASMCODE1 ; define HEADERLESS return + JMP HEADERLESS ; that makes room for CFA and PFA + + asmword "ENDCODE" ; +ENDCODE MOV IP,T ; T is unused by QREVEAL + mASM2FORTH ; + .word QREVEAL + mNEXTADR + MOV T,IP + .IFDEF VOCABULARY_SET + JMP PREVIOUS ; remove hidden word set from CONTEXT stack + .ELSE ; +PREVIOUS MOV #BODYFORTH,&CONTEXT ; remove hidden word set from CONTEXT stack + MOV #0,&CONTEXT+2 ; + MOV @IP+,PC + .ENDIF + +; here are 3 words used to switch FORTH <--> ASSEMBLER + +; COLON -- compile DOCOL, remove ASSEMBLER from CONTEXT stack, switch to compilation state + asmword "COLON" + MOV &DP,W + .SWITCH DTC + .CASE 1 + MOV #DOCOL,0(W) ; compile CALL R4 = rDOCOL ([rDOCOL] = XDOCOL) + ADD #2,&DP + .CASE 2 + MOV #120Dh,0(W) ; compile PUSH IP +COLON1 MOV #DOCOL,2(W) ; compile CALL R4 = rDOCOL + ADD #4,&DP + .CASE 3 ; inlined DOCOL + MOV #120Dh,0(W) ; compile PUSH IP +COLON1 MOV #400Dh,2(W) ; compile MOV PC,IP + MOV #522Dh,4(W) ; compile ADD #4,IP + MOV #4D30h,6(W) ; compile MOV @IP+,PC + ADD #8,&DP ; + .ENDCASE ; DTC +COLON2 MOV #-1,&STATE ; enter in compile state + JMP PREVIOUS ; to restore CONTEXT + +; LO2HI -- same as COLON but without saving IP + asmword "LO2HI" + .SWITCH DTC + .CASE 1 ; compile 2 words + MOV &DP,W + MOV #12B0h,0(W) ; compile CALL #EXIT, 2 words 4+6=10~ + MOV #EXIT,2(W) + ADD #4,&DP + JMP COLON2 + .ELSECASE ; CASE 2 : compile 1 word, CASE 3 : compile 3 words + SUB #2,&DP ; to skip PUSH IP + MOV &DP,W + JMP COLON1 + .ENDCASE + +; HI2LO -- immediate, switch to low level, set interpretation state, add ASSEMBLER to CONTEXT + FORTHWORDIMM "HI2LO" ; + ADD #2,&DP ; HERE+2 + MOV &DP,W ; W = HERE+2 + MOV W,-2(W) ; compile HERE+2 to HERE + MOV #0,&STATE ; LEFTBRACKET + JMP hidden ; to add ASSEMBLER in context stack + +;------------------------------------------------------------------------------- ; FASTFORTH environment management: RST_SET RST_RET MARKER ;------------------------------------------------------------------------------- ENV_COPY ; mini MOVE T words from X to W @@ -2002,8 +1666,8 @@ MARKER_DOES ; execution part of MARKER definition mDOCOL .word BL_WORD,FIND ; -- addr flag .word QFBRAN,MARKER_NEXT; -- addr if not found - .word DUP,EXECUTE ; -- MARKER_DOES execute it -MARKER_NEXT mNEXTADR ; -- addr|MARKER_DOES + .word DUP,EXECUTE ; execute it +MARKER_NEXT mNEXTADR ; -- addr MOV @PSP+,TOS ; -- MOV @RSP+,IP ; MOV @RSP+,&TOIN ; restore >IN for HEADER @@ -2054,14 +1718,13 @@ INIVECLOOP SUB #2,X ; MOV #DEEP_ORG,X ; DEEP_ORG values are in FRAM INFO, see \inc\ThingsInFirst.inc MOV @X+,&TERM_VEC ; TERMINAL_INT as default vector --> FRAM TERM_VEC ;-----------------------------------; -; DEEP INIT FRAM RST values ; [COLD,SOFT,HARD,BACKGRND]_APP + RST_[DP,LASTVOC,CURRENT,CONTEXT] +; DEEP INIT FRAM RST values ; {COLD,ABORT,SOFT,HARD,BACKGRND}_APP + RST_{DP,LASTVOC,CURRENT,CONTEXT,0} ;-----------------------------------; MOV #RST_LEN/2,T ; T = words count MOV #RST_ORG,W ; W = dst, X = org CALL #MOV_WORDS ; - MOV #0,&RST_CONTEXT+2 ; to do FORTH ONLY ;-----------------------------------; - .IFDEF BOOTLOADER ; does NOBOOT: + .IFDEF SD_CARD_LOADER ; does NOBOOT: MOV #WARM,&PUCNEXT ; removes XBOOT from PUC chain. .ENDIF ;-----------------------------------; @@ -2070,9 +1733,6 @@ INIVECLOOP SUB #2,X ; JMP RST_RET ; then go to DUP|PUCNEXT, resp. in QABORT|RESET ;-----------------------------------; -;=============================================================================== -; ASSEMBLER KERNEL OPTION -;=============================================================================== .IFDEF LARGE_DATA .include "forthMSP430FR_EXTD_ASM.asm" .ELSE diff --git a/forthMSP430FR_ASM.asm b/forthMSP430FR_ASM.asm index b60822e..7dd2c7f 100644 --- a/forthMSP430FR_ASM.asm +++ b/forthMSP430FR_ASM.asm @@ -31,68 +31,67 @@ ; DTCforthMSP430FR5xxx ASSEMBLER : search argument "xxxx" ; ---------------------------------------------------------------------- -; common code for maxi 3 successive SearchARG: SearchARG, SearchARG+Offset, SearchARG-offset +; common code for 3 successive Searches: ARG, ARG+Offset, ARG-offset +; part I: search symbolic ARG, ; leave PFA of VARIABLE, [PFA] of CONSTANT, User_Parameter_Field_Address of MARKER_DOES, CFA for all others. -; if the ARGument is not found after those three SearchARg, the 'not found' error is issued by SrchOfst. -; ----------------------------------; -SearchARGn PUSH &TOIN ; push TOIN, for next SearchARGn if any +SearchARGn PUSH &TOIN ;4 push TOIN for iterative SearchARGn mASM2FORTH ; -- sep sep = ','|'('|' ' - .word WORDD,FIND ; -- addr search string name first - .word QFBRAN,SRCHARGNUM ; -- addr if string name not found -COMPUTEARG mNEXTADR ; -- CFA of named definition + .word WORDD,FIND ; -- addr search definition + .word QFBRAN,SRCHARGNUM ; -- addr if not found + mNEXTADR ; -- CFA of this definition MOV @TOS+,S ; -- PFA S=DOxxx -QDOVAR SUB #1287h,S ; CFA = DOxxx = 1287h = CALL R7 = rDOVAR -ISDOVAR JZ ARGFOUND ; -- addr PFA = adr of VARIABLE -QDOCON ADD #1,S ; CFA = DOxxx = 1286h = DOCON - JNZ QMARKER ; -ISDOCON MOV @TOS,TOS ; -- cte + SUB #1287h,S ; if CFA is DOVAR ? + JZ ARGFOUND ; -- addr yes, PFA = adr of VARIABLE + ADD #1,S ; is CFA is DOCON ? + JNZ QMARKER ; no + MOV @TOS,TOS ; -- cte yes, TOS = constant JMP ARGFOUND ; -- cte QMARKER CMP #MARKER_DOES,0(TOS) ; -- PFA search if PFA = [MARKER_DOES] JNZ ISOTHER ; -- PFA .IFDEF VOCABULARY_SET ; -- PFA -ISMARKER ADD #30,TOS ; -- UPFA+2 skip room for DP, CURRENT, CONTEXT(8), null_word, LASTVOC, RET_ADR 2+(2+2+16+2+2+2) +2 bytes + ADD #30,TOS ; -- UPFA+2 skip room for DP, CURRENT, CONTEXT(8), null_word, LASTVOC, RET_ADR 2+(2+2+16+2+2+2) bytes +2 ! .ELSE ; -ISMARKER ADD #8,TOS ; -- UPFA+2 skip room for DP, RET_ADR 2+(2+2) +2 bytes + ADD #8,TOS ; -- UPFA+2 skip room for DP, RET_ADR 2+(2+2) bytes +2 ! .ENDIF ; -ISOTHER SUB #2,TOS ; -- CFA|UPFA UPFA = MARKER_DOES User_Parameter_Field_Address +ISOTHER SUB #2,TOS ; -- ARG for all other cases ARGFOUND ADD #2,RSP ; remove TOIN -SEARCHRET MOV @RSP+,PC ;24 SR(Z)=0 if ARG found - + MOV @RSP+,PC ;24 SR(Z)=0 if ARG found +; Part II: search numeric ARG if symbolic ARG not found SRCHARGNUM .word QNUMBER ; .word QFBRAN,ARGNOTFOUND; -- addr - .word ARGFOUND ; -- value -ARGNOTFOUND mNEXTADR ; -- x + .word ARGFOUND ; -- ARG +ARGNOTFOUND mNEXTADR ; -- addr MOV @RSP+,&TOIN ; restore TOIN - MOV @RSP+,PC ;32 SR(Z)=1 if ARG not found + MOV @RSP+,PC ;32 return to caller with SR(Z)=1 if ARG not found ; ----------------------------------; ; ----------------------------------; SearchIndex -; Search index of "xxxx(REG)," ; <== ComputeIDXpREG <== PARAM1IDX -; Search index of ",xxxx(REG)" ; <== ComputeIDXpREG <== PARAM2IDX +; Search index of "xxxx(REG)," ; <== CompIdxSrchRn <== PARAM1IDX +; Search index of ",xxxx(REG)" ; <== CompIdxSrchRn <== PARAM2IDX ; Search index of "xxxx(REG)," ; <== CALLA, MOVA ; Search index of ",xxxx(REG)" ; <== MOVA - SUB #1,&TOIN ; move >IN back one (unskip 'R') + SUB #1,&TOIN ; move >IN back one (unskip first_char) MOV #'(',TOS ; addr -- "(" as WORD separator to find xxxx of "xxxx(REG)," SearchARG ; sep -- n|d or abort" not found" -; Search ARG of "#xxxx," ; <== PARAM1SHARP -; Search ARG of "&xxxx," ; <== PARAMXAMP -; Search ARG of ",&xxxx" ; <== PARAMXAMP <== PARAM2AMP +; Search ARG of "#xxxx," ; <== PARAM1SHARP sep = ',' +; Search ARG of "&xxxx," ; <== PARAMXAMP sep = ',' +; Search ARG of ",&xxxx" ; <== PARAMXAMP <== PARAM2AMP sep = ' ' MOV TOS,W ; PUSHM #4,IP ; -- sep PUSHM IP,S,T,W as IP_RET,OPCODE,OPCODEADR,sep - CALL #SearchARGn ; first search argument without offset + CALL #SearchARGn ; first: search ARG without offset JNZ SrchEnd ; -- ARG if ARG found -SearchArgPl MOV #'+',TOS ; -- '+' - CALL #SearchARGn ; 2th search argument with '+' as separator + MOV #'+',TOS ; -- '+' + CALL #SearchARGn ; 2th: search ARG + offset JNZ ArgPlusOfst ; -- ARG if ARG of ARG+offset found -SearchArgMi MOV #'-',TOS ; -- '-' - CALL #SearchARGn ; 3th search argument with '-' as separator + MOV #'-',TOS ; -- '-' + CALL #SearchARGn ; 3th: search ARG - offset SUB #1,&TOIN ; to handle offset with its minus sign -ArgPlusOfst PUSH TOS ; -- ARG save ARG on stack +ArgPlusOfst PUSH TOS ; -- ARG R-- IP_RET,OPCODE,OPCODEADR,sep,ARG MOV 2(RSP),TOS ; -- sep reload offset sep -SrchOfst mASM2FORTH ; + mASM2FORTH ; search offset .word WORDD,QNUMBER ; -- Ofst|c-addr flag - .word QFBRAN,FNOTFOUND ; -- c-addr no return, see INTERPRET + .word QFBRAN,FNOTFOUND ; -- c-addr no return, see TICK mNEXTADR ; -- Ofst ADD @RSP+,TOS ; -- Arg+Ofst SrchEnd POPM #4,IP ; POPM W,T,S,IP common return for SearchARG and SearchRn @@ -101,23 +100,22 @@ SrchEnd POPM #4,IP ; POPM W,T,S,IP common ret ; ---------------------------------------------------------------------- ; DTCforthMSP430FR5xxx ASSEMBLER : search REG ; ---------------------------------------------------------------------- -; compute index of "xxxx(REG)," ; <== PARAM1IDX, sep=',' -; compute index of ",xxxx(REG)" ; <== PARAM2IDX, sep=' ' -ComputeIDXpREG ; addr -- Rn|addr +; compute index of "xxxx(REG)," ; <== PARAM1IDX, sep=',' +; compute index of ",xxxx(REG)" ; <== PARAM2IDX, sep=' ' +CompIdxSrchRn ; addr -- Rn|addr CALL #SearchIndex ; -- xxxx aborted if not found MOV &DP,X MOV TOS,0(X) ; -- xxxx compile ARG xxxx ADD #2,&DP MOV #')',TOS ; -- ")" prepare separator to search REG of "xxxx(REG)" -; search REG of "xxxx(REG)," separator = ')' -; search REG of ",xxxx(REG)" separator = ')' -; search REG of "@REG," separator = ',' <== PARAM1AT -; search REG of "@REG+," separator = '+' <== PARAM1ATPL -SkipRSearchRn - ADD #1,&TOIN ; skip "R" in input buffer -; search REG of "REG," separator = ',' <== PARAM1REG -; search REG of ",REG" separator = ' ' <== PARAM2REG -SearchRn MOV &TOIN,W ; +; search REG of "xxxx(REG)," +; search REG of ",xxxx(REG)" +; search REG of "@REG," sep = ',' ; <== PARAM1AT +SkipRSrchRn ADD #1,&TOIN ; skip 'R' in input buffer +; search REG of "@REG+," sep = '+' ; <== PARAM1ATPL +; search REG of "REG," sep = ',' ; <== PARAM1REG +; search REG of ",REG" sep = ' ' ; <== PARAM2REG +SearchRn MOV &TOIN,W ;3 PUSHM #4,IP ; PUSHM IP,S,T,W as IP_RET,OPCODE,OPCODEADR,TOIN mASM2FORTH ; search xx of Rxx .word WORDD,QNUMBER ; @@ -127,7 +125,7 @@ SearchRn MOV &TOIN,W ; JNC SrchEnd ; -- Rn SR(Z)=0, Rn found, JC REGNUM_ERR ; abort if Rn out of bounds -REGNOTFOUND mNEXTADR ; -- addr SR(Z)=1, (case of @REG not found), +REGNOTFOUND mNEXTADR ; -- addr SR(Z)=1, (used in case of @REG not found), MOV @RSP,&TOIN ; -- addr restore TOIN, ready for next SearchRn JMP SrchEnd ; -- addr SR(Z)=1 ==> not a register @@ -137,12 +135,14 @@ REGNOTFOUND mNEXTADR ; -- addr SR(Z)=1, (case of @REG not f ; PARAM1 separator -- ; parse input buffer until separator and compute first operand of opcode ; sep is "," for src TYPE II and " " for dst (TYPE II). PARAM1 JNZ QPARAM1SHARP ; -- sep if prefix <> 'R' -PARAM1REG CALL #SearchRn ; case of "REG," - JNZ REGSHFT8L ; -- 000R REG of "REG," found, S=OPCODE=0 +;PARAM1REG + CALL #SearchRn ; case of "REG," + JNZ SWAPREG ; -- 000R REG of "REG," found, S=OPCODE=0 ; ----------------------------------; QPARAM1SHARP CMP.B #'#',W ; -- sep W=first char JNE QPARAM1AMP -PARAM1SHARP CALL #SearchARG ; -- xxxx abort if not found +;PARAM1SHARP + CALL #SearchARG ; -- xxxx abort if not found MOV #0300h,S ; OPCODE = 0300h : MOV #0,dst is coded MOV R3,dst CMP #0,TOS ; -- xxxx #0 ? JZ PARAMENDOF @@ -152,56 +152,57 @@ PARAM1SHARP CALL #SearchARG ; -- xxxx abort if not found MOV #0320h,S ; OPCODE = 0320h : MOV #2,dst is coded MOV @R3,dst CMP #2,TOS ; -- xxxx #2 ? JZ PARAMENDOF + MOV #0330h,S ; OPCODE = 0330h : MOV #-1,dst is coded MOV @R3+,dst + CMP #-1,TOS ; -- xxxx #-1 ? + JZ PARAMENDOF MOV #0220h,S ; OPCODE = 0220h : MOV #4,dst is coded MOV @R2,dst CMP #4,TOS ; -- xxxx #4 ? JZ PARAMENDOF MOV #0230h,S ; OPCODE = 0230h : MOV #8,dst is coded MOV @R2+,dst CMP #8,TOS ; -- xxxx #8 ? JZ PARAMENDOF - MOV #0330h,S ; OPCODE = 0330h : MOV #-1,dst is coded MOV @R3+,dst - CMP #-1,TOS ; -- xxxx #-1 ? - JZ PARAMENDOF MOV #0030h,S ; -- xxxx for all other cases : MOV @PC+,dst ; endcase of "&xxxx," ; <== PARAM1AMP ; endcase of ",&xxxx" ; <== PARAMXAMP <== PARAM2AMP StoreArg MOV &DP,X ; ADD #2,&DP ; cell allot for arg MOV TOS,0(X) ; compile arg - JMP PARAMENDOF + JMP PARAMENDOF ; ----------------------------------; -QPARAM1AMP CMP.B #'&',W ; -- sep - JNE QPARAM1AT +QPARAM1AMP CMP.B #'&',W ; -- sep + JNE QPARAM1AT ; case of "&xxxx," ; search for "&xxxx," -PARAM1AMP MOV #0210h,S ; set code type : xxxx(R2) with AS=0b01 ==> x210h +PARAM1AMP MOV #0210h,S ; set code type : xxxx(R2) with AS=0b01 ==> x210h ; case of "&xxxx,"|",&xxxx" ; <== PARAM2AMP -PARAMXAMP CALL #SearchARG ; -- sep - JMP StoreArg ; -- arg abort if not found +PARAMXAMP CALL #SearchARG ; + JMP StoreArg ; -- then ret ; ----------------------------------; -QPARAM1AT CMP.B #'@',W ; -- sep - JNE PARAM1IDX +QPARAM1AT CMP.B #'@',W ; -- sep + JNE PARAM1IDX ; case of "@REG,"|"@REG+," -PARAM1AT MOV #0020h,S ; -- sep init OPCODE with indirect code type : AS=0b10 - CALL #SkipRSearchRn ; Z = not found - JNZ REGSHFT8L ; -- Rn REG of "@REG," found +PARAM1AT MOV #0020h,S ; -- sep init OPCODE with indirect code type : AS=0b10 + CALL #SkipRSrchRn ; Z = not found + JNZ SWAPREG ; -- Rn REG of "@REG," found ; case of "@REG+," ; -- addr search REG of "@REG+" -PARAM1ATPL BIS #0010h,S ; change OPCODE from @REG to @REG+ type - MOV #'+',TOS ; -- sep - CALL #SearchRn ; - JNZ QSKIPCOMMA ; -- Rn REG found +PARAM1ATPL MOV #'+',TOS ; -- sep + CALL #SearchRn ; + JNZ PARAM1ATPLX ; -- Rn REG found ; ----------------------------------; REG not found -; case of "xxxx(REG)," ; -- sep -PARAM1IDX BIS #0010h,S ; AS=0b01 for indexing address - CALL #ComputeIDXpREG ; compile index xxxx and search REG of "(REG)", abort if xxxx not found -; case of "@REG+,"|"xxxx(REG)," ; <== PARAM1ATPL -QSKIPCOMMA CMP &SOURCE_LEN,&TOIN ; test OPCODE II parameter ending by REG+ or (REG) without comma, - JZ REGSHFT8L ; i.e. >IN = SOURCE_LEN : don't skip char CR ! -SKIPCOMMA ADD #1,&TOIN ; -- 000R with OPCODE I, skip "," ready for the second operand search +; case of "xxxx(REG)," ; -- sep OPCODE I +; case of "xxxx(REG)" ; -- sep OPCODE II +PARAM1IDX CALL #CompIdxSrchRn ; -- 000R compile index xxxx and search REG of "(REG)", abort if xxxx not found +; case of "@REG+,"|"xxxx(REG)," ; <== PARAM1ATPL OPCODE I +; case of "@REG+"|"xxxx(REG)" ; <== PARAM1ATPL OPCODE II +PARAM1ATPLX BIS #0010h,S ; AS=0b01 for indexing address, AS=0b11 for @REG+ + MOV #3FFFh,W ;2 4000h = first OPCODE type I + CMP S,W ;1 with OPCODE II @REG or xxxx(REG) don't skip CR ! + ADDC #0,&TOIN ;1 with OPCODE I, @REG+, or xxxx(REG), skip "," ready for the second operand search ; endcase of "@REG," ; -- 000R <== PARAM1AT ; endcase of "REG," ; -- 000R <== PARAM1REG -REGSHFT8L SWPB TOS ; -- 0R00 swap bytes because it's not a dst REG typeI (not a 2 ops inst.) -; endcase of ",REG" ; -- 000R <== PARAM2REG (dst REG typeI) -; endcase of ",xxxx(REG)" ; -- 000R <== PARAM2IDX (dst REG typeI) -OPCODEPLREG ADD TOS,S ; -- 0R00|000R +SWAPREG SWPB TOS ; -- 0R00 swap bytes because it's not a dst REG typeI (not a 2 ops inst.) +; endcase of ",REG" ; -- 0R0D <== PARAM2REG (dst REG typeI) +; endcase of ",xxxx(REG)" ; -- 0R0D <== PARAM2IDX (dst REG typeI) +OPCODEPLREG ADD TOS,S ; -- 0R00|0R0D ; endcase of all ; <== PARAM1SHARP PARAM1AMP PARAM2AMP PARAMENDOF MOV @PSP+,TOS ; -- MOV @IP+,PC ; -- S=OPCODE,T=OPCODEADR @@ -212,7 +213,7 @@ PARAMENDOF MOV @PSP+,TOS ; -- ; ---------------------------------------------------------------------- PARAM2 JNZ QPARAM2AMP ; -- sep if prefix <> 'R' PARAM2REG CALL #SearchRn ; -- sep case of ",REG" - JNZ OPCODEPLREG ; -- 000R REG of ",REG" found + JNZ OPCODEPLREG ; -- 000D REG of ",REG" found ; ----------------------------------; QPARAM2AMP CMP.B #'&',W ; JNZ PARAM2IDX ; '&' not found @@ -222,8 +223,8 @@ PARAM2AMP BIS #0082h,S ; change OPCODE : AD=1, dst = ; ----------------------------------; ; case of ",xxxx(REG) ; -- sep PARAM2IDX BIS #0080h,S ; set AD=1 - CALL #ComputeIDXpREG ; compile index xxxx and search REG of ",xxxx(REG)", abort if xxxx not found - JNZ OPCODEPLREG ; -- 000R if REG found + CALL #CompIdxSrchRn ; compile index xxxx and search REG of ",xxxx(REG)", abort if xxxx not found + JNZ OPCODEPLREG ; -- 000D if REG found MOV #NOTFOUND,PC ; does ABORT" ?" ; ----------------------------------; @@ -235,7 +236,7 @@ InitAndSkipPrfx MOV #0,S ; reset OPCODE MOV &DP,T ; HERE --> OPCODEADR ADD #2,&DP ; cell allot for opcode -; SkipPrfx ; -- skip all occurring char 'BL' plus one prefix +; SkipPrfx ; -- skip all occurring char 'BL', plus one prefix SkipPrfx MOV #20h,W ; -- W=BL MOV &TOIN,X ; -- ADD &SOURCE_ORG,X ; @@ -277,10 +278,10 @@ SKIPLOOP CMP.B @X+,W ; -- W=BL does character mat ; ---------------------------------------------------------------------- ; TYPE1DOES -- BODYDOES search and compute PARAM1 & PARAM2 as src and dst operands then compile instruction -TYPE1DOES .word lit,',' +TYPE1DOES .word lit,',' ; -- sep .word InitAndSkipPrfx ; init S=0, T=DP, DP=DP+2 then skip prefix, SR(Z)=1 if prefix = 'R' .word PARAM1 ; -- BODYDOES S=OPCODE,T=OPCODEADR - .word BL,SkipPrfx ; SR(Z)=1 if prefix = 'R' + .word BL,SkipPrfx ; -- sep SR(Z)=1 if prefix = 'R' .word PARAM2 ; -- BODYDOES S=OPCODE,T=OPCODEADR mNEXTADR ; MAKEOPCODE MOV @RSP+,IP @@ -428,7 +429,7 @@ REGNUM_ERR ; <== REG number error mASM2FORTH ; -- n n = value out of bounds .word DOT,XSQUOTE .byte 13,"out of bounds" - .word ABORT_TERM + .word QABORT_YES ; ---------------------------------------------------------------------- ; DTCforthMSP430FR5xxx ASSEMBLER, CONDITIONAL BRANCHS @@ -499,7 +500,7 @@ ASM_THEN1 MOV @PSP+,TOS ; -- ; ELSE @OPCODE1 -- @OPCODE2 branch for IF..ELSE asmword "ELSE" -ASM_ELSE MOV &DP,W ; -- W=HERE + MOV &DP,W ; -- W=HERE MOV #3C00h,0(W) ; compile unconditionnal branch ADD #2,&DP ; -- DP+2 SUB #2,PSP @@ -515,7 +516,7 @@ HERE SUB #2,PSP ; UNTIL @BEGIN OPCODE -- resolve conditional backward branch asmword "UNTIL" -ASM_UNTIL MOV @PSP+,W ; -- OPCODE W=@BEGIN + MOV @PSP+,W ; -- OPCODE W=@BEGIN ASM_UNTIL1 MOV TOS,Y ; Y=OPCODE W=@BEGIN ASM_UNTIL2 MOV @PSP+,TOS ; -- MOV &DP,X ; -- Y=OPCODE X=HERE W=dst @@ -539,12 +540,12 @@ ASM_AGAIN MOV TOS,W ; W=@BEGIN ; WHILE @BEGIN OPCODE -- @WHILE @BEGIN asmword "WHILE" -ASM_WHILE mDOCOL ; -- @BEGIN OPCODE + mDOCOL ; -- @BEGIN OPCODE .word ASM_IF,SWAP,EXIT ; REPEAT @WHILE @BEGIN -- resolve WHILE loop asmword "REPEAT" -ASM_REPEAT mDOCOL ; -- @WHILE @BEGIN + mDOCOL ; -- @WHILE @BEGIN .word ASM_AGAIN,ASM_THEN,EXIT ; ------------------------------------------------------------------------------------------ @@ -562,8 +563,8 @@ BACKWDOES mNEXTADR MOV @PSP+,TOS ; -- MOV @Y,W ; W = LABEL CMP #8,&TOIN ; are we colon 8 or more ? -BACKWUSE JC ASM_UNTIL1 ; yes, use this label -BACKWSET MOV &DP,0(Y) ; no, set LABEL = DP + JC ASM_UNTIL1 ; yes, use this label + MOV &DP,0(Y) ; no, set LABEL = DP MOV @IP+,PC ; backward label 1 @@ -744,7 +745,7 @@ CALLA02 RLAM #4,S ; (opcode>>4)<<4 = opcode CALLA1 ADD #2,S ; -- sep 136h<<4 = opcode for CALLA @REG CMP.B #'@',W ; Search @REG JNZ CALLA2 ; -CALLA11 CALL #SkipRSearchRn ; +CALLA11 CALL #SkipRSrchRn ; JNZ CALLA02 ; if REG found, update opcode ;-----------------------------------; ADD #1,S ; 137h<<4 = opcode for CALLA @REG+ @@ -810,7 +811,7 @@ MOVA12 CMP.B #'&',W ; -- sep case of MOVA &$x.xxxx MOVA13 BIC #00F0h,S ; set MOVA @REG, opcode CMP.B #'@',W ; -- sep JNZ MOVA14 ; - CALL #SkipRSearchRn ; -- Rn + CALL #SkipRSrchRn ; -- Rn JNZ ACMS102 ; if @REG found BIS #0010h,S ; set @REG+ opcode MOV #'+',TOS ; -- '+' @@ -823,7 +824,7 @@ MOVA14 BIS #0030h,S ; -- sep set xxxx(REG), opcode CALL #SearchIndex ; -- n MOV TOS,2(T) ; -- n store $xxxx as 2th word MOV #')',TOS ; -- ')' - CALL #SkipRSearchRn ; -- Rn + CALL #SkipRSrchRn ; -- Rn JMP MOVA132 ; ; 2th argument process ACMS2 @@ -848,7 +849,7 @@ MOVA23 BIS #070h,S ; set ,xxxx(REG) opcode CALL #SearchIndex ; -- n MOV TOS,2(T) ; -- n write $xxxx of ,$xxxx(REG) as 2th word MOV #')',TOS ; -- ")" as WORD separator to find REG of "xxxx(REG)," - CALL #SkipRSearchRn ; -- Rn + CALL #SkipRSrchRn ; -- Rn JMP ACMS103 ; -------------------------------------------------------------------------------- diff --git a/forthMSP430FR_EXTD_ASM.asm b/forthMSP430FR_EXTD_ASM.asm index c01a47c..74a155e 100644 --- a/forthMSP430FR_EXTD_ASM.asm +++ b/forthMSP430FR_EXTD_ASM.asm @@ -7,23 +7,23 @@ ; ---------------------------------------------------------------------- ; MOV(.B) SR,dst is coded as follow : MOV(.B) R2,dst ; 1 cycle, one word AS=00 (register mode) ; MOV(.B) #0,dst is coded as follow : MOV(.B) R3,dst ; 1 cycle, one word AS=00 (register mode) -; MOV(.B) &EDE,dst is coded as follow : MOV(.B) EDE(R2),dst ; 3 cycles, two words AS=01 ( x(reg) mode) -; MOV(.B) #1,dst is coded as follow : MOV(.B) 0(R3),dst ; 1 cycle, one word AS=01 ( x(reg) mode) +; MOV(.B) #1,dst is coded as follow : MOV(.B) (R3),dst ; 1 cycle, one word AS=01 ( x(reg) mode) ; MOV(.B) #4,dst is coded as follow : MOV(.B) @R2,dst ; 1 cycle, one word AS=10 ( @reg mode) ; MOV(.B) #2,dst is coded as follow : MOV(.B) @R3,dst ; 1 cycle, one word AS=10 ( @reg mode) ; MOV(.B) #8,dst is coded as follow : MOV(.B) @R2+,dst ; 1 cycle, one word AS=11 ( @reg+ mode) ; MOV(.B) #-1,dst is coded as follow : MOV(.B) @R3+,dst ; 1 cycle, one word AS=11 ( @reg+ mode) ; ---------------------------------------------------------------------- +; MOV(.B) &EDE,dst is coded as follow : MOV(.B) EDE(R2),dst ; 3 cycles, two words AS=01 ( x(reg) mode) ; MOV(.B) #xxxx,dst is coded as follow: MOV(.B) @PC+,dst ; 2 cycles, two words AS=11 ( @reg+ mode) ; ---------------------------------------------------------------------- -; PUSHM order : PSP,TOS, IP, S, T, W, X, Y, rEXIT,rDOVAR,rDOCON, rDODOES, R3, SR,RSP, PC -; PUSHM order : R15,R14,R13,R12,R11,R10, R9, R8, R7 , R6 , R5 , R4 , R3, R2, R1, R0 +; PUSHM order : PSP,TOS, IP, S, T, W, X, Y, rDOVAR,rDOCON,rDODOES, rDOCOL, R3, SR,RSP, PC +; PUSHM order : R15,R14,R13,R12,R11,R10, R9, R8, R7 , R6 , R5 , R4 , R3, R2, R1, R0 ; example : PUSHM #6,IP pushes IP,S,T,W,X,Y registers to return stack ; -; POPM order : PC,RSP, SR, R3, rDODOES,rDOCON,rDOVAR,rEXIT, Y, X, W, T, S, IP,TOS,PSP -; POPM order : R0, R1, R2, R3, R4 , R5 , R6 , R7 , R8, R9,R10,R11,R12,R13,R14,R15 +; POPM order : PC,RSP, SR, R3, rDOCOL,rDODOES,rDOCON,rDOVAR, Y, X, W, T, S, IP,TOS,PSP +; POPM order : R0, R1, R2, R3, R4 , R5 , R6 , R7 , R8, R9,R10,R11,R12,R13,R14,R15 ; example : POPM #6,IP pop Y,X,W,T,S,IP registers from return stack @@ -31,61 +31,63 @@ ; DTCforthMSP430FR5xxx ASSEMBLER : search argument "xxxx" ; ---------------------------------------------------------------------- -; common code for maxi three successive SearchARG: SearchARG, SearchARG+Offset, SearchARG-offset +; common code for maxi 3 successive SearchARG: SearchARG, SearchARG+Offset, SearchARG-offset ; leave PFA of VARIABLE, [PFA] of CONSTANT, User_Parameter_Field_Address of MARKER_DOES, CFA for all others. -; if the ARGument is not found after those three SearchARg, the 'not found' error is issued by the last SrchOfst. -SearchARGn PUSH &TOIN ; push TOIN, for next SearchARGn if any +; if the ARGument is not found after those three SearchARg, the 'not found' error is issued by SrchOfst. +SearchARGn PUSH &TOIN ; push TOIN for iterative SearchARGn if any mASM2FORTH ; -- sep sep = ','|'('|' ' - .word WORDD,FIND ; -- addr search string name first - .word QFBRAN,SRCHARGNUM ; -- addr if string name not found - mNEXTADR ; -- CFA + .word WORDD,FIND ; -- addr search definition + .word QFBRAN,SRCHARGNUM ; -- addr if not found + mNEXTADR ; -- CFA of this definition MOV @TOS+,S ; -- PFA S=DOxxx -QDOVAR SUB #1287h,S ; DOxxx = 1287h = CALL R7 = rDOVAR -ISDOVAR JZ ARGFOUND ; -- addr PFA = adr of VARIABLE -QDOCON ADD #1,S ; DOxxx = 1286h = DOCON - JNZ QMARKER ; if not DOCON -ISDOCON MOV @TOS,TOS ; -- +QDOVAR SUB #1287h,S ; if CFA is DOVAR ? +ISDOVAR JZ ARGFOUND ; -- addr yes, PFA = adr of VARIABLE +QDOCON ADD #1,S ; is CFA is DOCON ? + JNZ QMARKER ; no +ISDOCON MOV @TOS,TOS ; -- cte yes, TOS = constant JMP ARGFOUND ; -- cte QMARKER CMP #MARKER_DOES,0(TOS) ; -- PFA search if PFA = [MARKER_DOES] JNZ ISOTHER ; -- PFA .IFDEF VOCABULARY_SET ; -- PFA - ADD #30,TOS ; -- UPFA+2 skip room for DP, CURRENT, CONTEXT(8), null_word, LASTVOC, RET_ADR 2+(2+2+16+2+2+2) +2 bytes +ISMARKER ADD #30,TOS ; -- UPFA+2 skip room for DP, CURRENT, CONTEXT(8), null_word, LASTVOC, RET_ADR 2+(2+2+16+2+2+2) bytes +2 ! .ELSE ; - ADD #8,TOS ; -- UPFA+2 skip room for DP, RET_ADR 2+(2+2) +2 bytes +ISMARKER ADD #8,TOS ; -- UPFA+2 skip room for DP, RET_ADR 2+(2+2) bytes +2 ! .ENDIF ; ISOTHER SUB #2,TOS ; -- CFA|UPFA UPFA = MARKER_DOES User_Parameter_Field_Address ARGFOUND ADD #2,RSP ; remove TOIN -SEARCHRET MOV @RSP+,PC ;24 SR(Z)=0 if ARG found + MOV @RSP+,PC ;24 SR(Z)=0 if ARG found SRCHARGNUM .word QNUMBER ; .word QFBRAN,ARGNOTFOUND; -- addr .word ARGFOUND ; -- value -ARGNOTFOUND mNEXTADR ; -- x +ARGNOTFOUND mNEXTADR ; -- addr MOV @RSP+,&TOIN ; restore TOIN MOV @RSP+,PC ;32 SR(Z)=1 if ARG not found ; ----------------------------------; ; ----------------------------------; SearchIndex -; Search index of "xxxx(REG)," ; <== ComputeIDXpREG <== PARAM1IDX -; Search index of ",xxxx(REG)" ; <== ComputeIDXpREG <== PARAM2IDX +; Search index of "xxxx(REG)," ; <== CompIdxSrchRn <== PARAM1IDX +; Search index of ",xxxx(REG)" ; <== CompIdxSrchRn <== PARAM2IDX +; Search index of "xxxx(REG)," ; <== CALLA, MOVA +; Search index of ",xxxx(REG)" ; <== MOVA + SUB #1,&TOIN ; move >IN back one (unskip first_char) MOV #'(',TOS ; addr -- "(" as WORD separator to find xxxx of "xxxx(REG)," - SUB #1,&TOIN ; move >IN back one (unskip 'R') SearchARG ; sep -- n|d or abort" not found" -; Search ARG of "#xxxx," ; <== PARAM1SHARP -; Search ARG of "&xxxx," ; <== PARAMXAMP -; Search ARG of ",&xxxx" ; <== PARAMXAMP <== PARAM2AMP - MOV TOS,W +; Search ARG of "#xxxx," ; <== PARAM1SHARP sep = ',' +; Search ARG of "&xxxx," ; <== PARAMXAMP sep = ',' +; Search ARG of ",&xxxx" ; <== PARAMXAMP <== PARAM2AMP sep = ' ' + MOV TOS,W ; PUSHM #4,IP ; -- sep PUSHM IP,S,T,W as IP_RET,OPCODE,OPCODEADR,sep CALL #SearchARGn ; first search argument without offset JNZ SrchEnd ; -- ARG if ARG found -SearchArgPl MOV #'+',TOS ; -- '+' +SearchArgPl MOV #'+',TOS ; -- '+' CALL #SearchARGn ; 2th search argument with '+' as separator JNZ ArgPlusOfst ; -- ARG if ARG of ARG+offset found -SearchArgMi MOV #'-',TOS ; -- '-' +SearchArgMi MOV #'-',TOS ; -- '-' CALL #SearchARGn ; 3th search argument with '-' as separator SUB #1,&TOIN ; to handle offset with its minus sign -ArgPlusOfst PUSH TOS ; -- ARG save ARG on stack +ArgPlusOfst PUSH TOS ; -- ARG R-- IP_RET,OPCODE,OPCODEADR,sep,ARG MOV 2(RSP),TOS ; -- sep reload offset sep SrchOfst mASM2FORTH ; .word WORDD,QNUMBER ; -- Ofst|c-addr flag @@ -104,23 +106,22 @@ ARGD2SEND MOV @RSP+,PC ; ; ---------------------------------------------------------------------- ; DTCforthMSP430FR5xxx ASSEMBLER : search REG ; ---------------------------------------------------------------------- -; compute index of "xxxx(REG)," ; <== PARAM1IDX, sep=',' -; compute index of ",xxxx(REG)" ; <== PARAM2IDX, sep=' ' -ComputeIDXpREG ; addr -- Rn|addr +; compute index of "xxxx(REG)," ; <== PARAM1IDX, sep=',' +; compute index of ",xxxx(REG)" ; <== PARAM2IDX, sep=' ' +CompIdxSrchRn ; addr -- Rn|addr CALL #SearchIndex ; -- xxxx aborted if not found CALL #ARGD2S ; skip arg_hi if DOUBLE MOV &DP,X MOV TOS,0(X) ; -- xxxx compile ARG xxxx ADD #2,&DP MOV #')',TOS ; -- ")" prepare separator to search REG of "xxxx(REG)" -; search REG of "xxxx(REG)," separator = ')' -; search REG of ",xxxx(REG)" separator = ')' -; search REG of "@REG," separator = ',' <== PARAM1AT -; search REG of "@REG+," separator = '+' <== PARAM1ATPL -SkipRSearchRn - ADD #1,&TOIN ; skip "R" in input buffer -; search REG of "REG," separator = ',' <== PARAM1REG -; search REG of ",REG" separator = ' ' <== PARAM2REG +; search REG of "xxxx(REG)," +; search REG of ",xxxx(REG)" +; search REG of "@REG," sep = ',' ; <== PARAM1AT +SkipRSrchRn ADD #1,&TOIN ; skip 'R' in input buffer +; search REG of "@REG+," sep = '+' ; <== PARAM1ATPL +; search REG of "REG," sep = ',' ; <== PARAM1REG +; search REG of ",REG" sep = ' ' ; <== PARAM2REG SearchRn MOV &TOIN,W ; PUSHM #4,IP ; PUSHM IP,S,T,W as IP_RET,OPCODE,OPCODEADR,TOIN mASM2FORTH ; search xx of Rxx @@ -129,9 +130,9 @@ SearchRn MOV &TOIN,W ; mNEXTADR ; -- Rn number is found CMP #16,TOS ; -- Rn JNC SrchEnd ; -- Rn SR(Z)=0, Rn found, - JC BOUNDERROR ; abort if Rn out of bounds + JC REGNUM_ERR ; abort if Rn out of bounds -REGNOTFOUND mNEXTADR ; -- addr SR(Z)=1, (case of @REG not found), +REGNOTFOUND mNEXTADR ; -- addr SR(Z)=1, (used in case of @REG not found), MOV @RSP,&TOIN ; -- addr restore TOIN, ready for next SearchRn JMP SrchEnd ; -- addr SR(Z)=1 ==> not a register @@ -142,7 +143,7 @@ REGNOTFOUND mNEXTADR ; -- addr SR(Z)=1, (case of @REG not f ; sep is "," for src TYPE II and " " for dst (TYPE II). PARAM1 JNZ QPARAM1SHARP ; -- sep if prefix <> 'R' PARAM1REG CALL #SearchRn ; case of "REG," - JNZ REGSHFT8L ; -- 000R REG of "REG," found, S=OPCODE=0 + JNZ SWAPREG ; -- 000R REG of "REG," found, S=OPCODE=0 ; ----------------------------------; QPARAM1SHARP CMP.B #'#',W ; -- sep W=first char JNE QPARAM1AMP @@ -157,57 +158,58 @@ PARAM1SHARP CALL #SearchARG ; -- xxxx abort if not found MOV #0320h,S ; OPCODE = 0320h : MOV #2,dst is coded MOV @R3,dst CMP #2,TOS ; -- xxxx #2 ? JZ PARAMENDOF + MOV #0330h,S ; OPCODE = 0330h : MOV #-1,dst is coded MOV @R3+,dst + CMP #-1,TOS ; -- xxxx #-1 ? + JZ PARAMENDOF MOV #0220h,S ; OPCODE = 0220h : MOV #4,dst is coded MOV @R2,dst CMP #4,TOS ; -- xxxx #4 ? JZ PARAMENDOF MOV #0230h,S ; OPCODE = 0230h : MOV #8,dst is coded MOV @R2+,dst CMP #8,TOS ; -- xxxx #8 ? JZ PARAMENDOF - MOV #0330h,S ; OPCODE = 0330h : MOV #-1,dst is coded MOV @R3+,dst - CMP #-1,TOS ; -- xxxx #-1 ? - JZ PARAMENDOF - MOV #0030h,S ; -- xxxx for all other cases : MOV @PC+,dst +SHARPOTHERS MOV #0030h,S ; -- xxxx for all other cases : MOV @PC+,dst ; endcase of "&xxxx," ; <== PARAM1AMP ; endcase of ",&xxxx" ; <== PARAMXAMP <== PARAM2AMP StoreArg MOV &DP,X ; ADD #2,&DP ; cell allot for arg MOV TOS,0(X) ; compile arg - JMP PARAMENDOF + JMP PARAMENDOF ; ----------------------------------; -QPARAM1AMP CMP.B #'&',W ; -- sep - JNE QPARAM1AT +QPARAM1AMP CMP.B #'&',W ; -- sep + JNE QPARAM1AT ; case of "&xxxx," ; search for "&xxxx," -PARAM1AMP MOV #0210h,S ; set code type : xxxx(R2) with AS=0b01 ==> x210h +PARAM1AMP MOV #0210h,S ; set code type : xxxx(R2) with AS=0b01 ==> x210h ; case of "&xxxx,"|",&xxxx" ; <== PARAM2AMP -PARAMXAMP CALL #SearchARG ; -- sep - CALL #ARGD2S ; skip arg_hi of OPCODE type V - JMP StoreArg ; -- then ret +PARAMXAMP CALL #SearchARG ; + CALL #ARGD2S ; skip arg_hi of OPCODE type V + JMP StoreArg ; -- then ret ; ----------------------------------; -QPARAM1AT CMP.B #'@',W ; -- sep - JNE PARAM1IDX +QPARAM1AT CMP.B #'@',W ; -- sep + JNE PARAM1IDX ; case of "@REG,"|"@REG+," -PARAM1AT MOV #0020h,S ; -- sep init OPCODE with indirect code type : AS=0b10 - CALL #SkipRSearchRn ; Z = not found - JNZ REGSHFT8L ; -- Rn REG of "@REG," found +PARAM1AT MOV #0020h,S ; -- sep init OPCODE with indirect code type : AS=0b10 + CALL #SkipRSrchRn ; Z = not found + JNZ SWAPREG ; -- Rn REG of "@REG," found ; case of "@REG+," ; -- addr search REG of "@REG+" -PARAM1ATPL BIS #0010h,S ; change OPCODE from @REG to @REG+ type - MOV #'+',TOS ; -- sep - CALL #SearchRn ; - JNZ QSKIPCOMMA ; -- Rn REG found +PARAM1ATPL MOV #'+',TOS ; -- sep + CALL #SearchRn ; + JNZ PARAM1ATPLX ; -- Rn REG found ; ----------------------------------; REG not found -; case of "xxxx(REG)," ; -- sep -PARAM1IDX BIS #0010h,S ; AS=0b01 for indexing address - CALL #ComputeIDXpREG ; compile index xxxx and search REG of "(REG)", abort if xxxx not found -; case of "@REG+,"|"xxxx(REG)," ; <== PARAM1ATPL -QSKIPCOMMA CMP &SOURCE_LEN,&TOIN ; test OPCODE II parameter ending by REG+ or (REG) without comma, - JZ REGSHFT8L ; i.e. >IN = SOURCE_LEN : don't skip char CR ! -SKIPCOMMA ADD #1,&TOIN ; -- 000R with OPCODE I, skip "," ready for the second operand search +; case of "xxxx(REG)," ; -- sep OPCODE I +; case of "xxxx(REG)" ; -- sep OPCODE II +PARAM1IDX CALL #CompIdxSrchRn ; -- 000R compile index xxxx and search REG of "(REG)", abort if xxxx not found +; case of "@REG+,"|"xxxx(REG)," ; <== PARAM1ATPL OPCODE I +; case of "@REG+"|"xxxx(REG)" ; <== PARAM1ATPL OPCODE II +PARAM1ATPLX BIS #0010h,S ; AS=0b01 for indexing address, AS=0b11 for @REG+ + MOV #3FFFh,W ;2 4000h = first OPCODE type I + CMP S,W ;1 with OPCODE II @REG or xxxx(REG) don't skip CR ! + ADDC #0,&TOIN ;1 with OPCODE I, @REG+, or xxxx(REG), skip "," ready for the second operand search ; endcase of "@REG," ; -- 000R <== PARAM1AT ; endcase of "REG," ; -- 000R <== PARAM1REG -REGSHFT8L SWPB TOS ; -- 0R00 swap bytes because it's not a dst REG typeI (not a 2 ops inst.) -; endcase of ",REG" ; -- 000R <== PARAM2REG (dst REG typeI) -; endcase of ",xxxx(REG)" ; -- 000R <== PARAM2IDX (dst REG typeI) -OPCODEPLREG ADD TOS,S ; -- 0R00|000R +SWAPREG SWPB TOS ; -- 0R00 swap bytes because it's not a dst REG typeI (not a 2 ops inst.) +; endcase of ",REG" ; -- 0R0D <== PARAM2REG (dst REG typeI) +; endcase of ",xxxx(REG)" ; -- 0R0D <== PARAM2IDX (dst REG typeI) +OPCODEPLREG ADD TOS,S ; -- 0R00|0R0D ; endcase of all ; <== PARAM1SHARP PARAM1AMP PARAM2AMP PARAMENDOF MOV @PSP+,TOS ; -- MOV @IP+,PC ; -- S=OPCODE,T=OPCODEADR @@ -218,7 +220,7 @@ PARAMENDOF MOV @PSP+,TOS ; -- ; ---------------------------------------------------------------------- PARAM2 JNZ QPARAM2AMP ; -- sep if prefix <> 'R' PARAM2REG CALL #SearchRn ; -- sep case of ",REG" - JNZ OPCODEPLREG ; -- 000R REG of ",REG" found + JNZ OPCODEPLREG ; -- 000D REG of ",REG" found ; ----------------------------------; QPARAM2AMP CMP.B #'&',W ; JNZ PARAM2IDX ; '&' not found @@ -228,8 +230,8 @@ PARAM2AMP BIS #0082h,S ; change OPCODE : AD=1, dst = ; ----------------------------------; ; case of ",xxxx(REG) ; -- sep PARAM2IDX BIS #0080h,S ; set AD=1 - CALL #ComputeIDXpREG ; compile index xxxx and search REG of ",xxxx(REG)", abort if xxxx not found - JNZ OPCODEPLREG ; -- 000R if REG found + CALL #CompIdxSrchRn ; compile index xxxx and search REG of ",xxxx(REG)", abort if xxxx not found + JNZ OPCODEPLREG ; -- 000D if REG found MOV #NOTFOUND,PC ; does ABORT" ?" ; ----------------------------------; @@ -241,7 +243,7 @@ InitAndSkipPrfx MOV #0,S ; reset OPCODE MOV &DP,T ; HERE --> OPCODEADR ADD #2,&DP ; cell allot for opcode -; SkipPrfx ; -- skip all occurring char 'BL' plus one prefix +; SkipPrfx ; -- skip all occurring char 'BL', plus one prefix SkipPrfx MOV #20h,W ; -- W=BL MOV &TOIN,X ; -- ADD &SOURCE_ORG,X ; @@ -424,13 +426,17 @@ BIS_ASMTYPE BIS W,S ; -- BODYDOES add it in OPCODE CALL rDODOES .word TYPE2DOES,1280h -BOUNDERRWM1 ADD #1,W ; <== RRAM|RRUM|RRCM|RLAM error -BOUNDERRORW MOV W,TOS ; <== PUSHM|POPM|ASM_branch error -BOUNDERROR ; <== REG number error +; ---------------------------------------------------------------------- +; errors output +; ---------------------------------------------------------------------- + +MUL_REG_ERR ADD #1,W ; <== PUSHM|POPM|RRAM|RRUM|RRCM|RLAM error +BRANCH_ERR MOV W,TOS ; <== ASM_branch error +REGNUM_ERR ; <== REG number error mASM2FORTH ; -- n n = value out of bounds .word DOT,XSQUOTE .byte 13,"out of bounds" - .word ABORT_TERM + .word QABORT_YES ; ---------------------------------------------------------------------- ; DTCforthMSP430FR5xxx ASSEMBLER, CONDITIONAL BRANCHS @@ -447,23 +453,23 @@ BOUNDERROR ; <== REG number error asmword "S>=" ; if >= assertion (opposite of jump if < ) CALL rDOCON - .word 3800h ; JL + .word 3800h asmword "S<" ; if < assertion CALL rDOCON - .word 3400h ; JGE + .word 3400h asmword "0>=" ; if 0>= assertion ; use only with IF UNTIL WHILE ! CALL rDOCON - .word 3000h ; JN + .word 3000h asmword "0<" ; jump if 0< ; use only with ?GOTO ! CALL rDOCON - .word 3000h ; JN + .word 3000h asmword "U<" ; if U< assertion CALL rDOCON - .word 2C00h ; + .word 2C00h asmword "U>=" ; if U>= assertion CALL rDOCON @@ -492,14 +498,14 @@ ASM_THEN MOV &DP,W ; -- @OPCODE W=dst ASM_THEN1 MOV @PSP+,TOS ; -- MOV Y,X ; ADD #2,X ; -- Y=@OPCODE W=dst X=src+2 - SUB X,W ; -- Y=@OPCODE W=dst-src+2=displacement*2 (bytes) + SUB X,W ; -- Y=@OPCODE W=dst-src+2=displacement (bytes) CMP #1023,W - JC BOUNDERRORW ; (JHS) unsigned branch if displ. > 1022 bytes + JC BRANCH_ERR ; (JHS) unsigned branch if displ. > 1022 bytes RRA W ; -- Y=@OPCODE W=displacement (words) BIS W,0(Y) ; -- [@OPCODE]=OPCODE completed MOV @IP+,PC -;C ELSE @OPCODE1 -- @OPCODE2 branch for IF..ELSE +; ELSE @OPCODE1 -- @OPCODE2 branch for IF..ELSE asmword "ELSE" ASM_ELSE MOV &DP,W ; -- W=HERE MOV #3C00h,0(W) ; compile unconditionnal branch @@ -524,7 +530,7 @@ ASM_UNTIL2 MOV @PSP+,TOS ; -- SUB #2,W ; -- Y=OPCODE X=HERE W=dst-2 SUB X,W ; -- Y=OPCODE X=src W=src-dst-2=displacement (bytes) CMP #-1024,W ; - JL BOUNDERRORW ; signed branch if displ. < -1024 bytes + JL BRANCH_ERR ; signed branch if displ. < -1024 bytes RRA W ; -- Y=OPCODE X=HERE W=displacement (words) AND #3FFh,W ; -- Y=OPCODE X=HERE W=troncated negative displacement (words) BIS W,Y ; -- Y=OPCODE (completed) @@ -553,9 +559,9 @@ ASM_REPEAT mDOCOL ; -- @WHILE @BEGIN ; DTCforthMSP430FR5xxx ASSEMBLER : branch up to 3 backward labels and up to 3 forward labels ; ------------------------------------------------------------------------------------------ ; used for non canonical branchs, as BASIC language: "goto line x" -; labels BWx and FWx must be respectively set and used at the beginning of line (>IN < 8). -; FWx at the beginning of a line can resolve only one previous GOTO|?GOTO FWx. -; BWx at the beginning of a line can be resolved by any subsequent GOTO|?GOTO BWx. +; labels BWx and FWx must be set at the beginning of line (>IN < 8). +; FWx can resolve only one previous GOTO|?GOTO FWx. +; BWx can resolve any subsequent GOTO|?GOTO BWx. BACKWDOES mNEXTADR MOV @RSP+,IP ; @@ -664,7 +670,7 @@ TYPE3DOES ; -- BODYDOES MOV TOS,W ; -- BODYDOES n W = n MOV @PSP+,TOS ; -- BODYDOES SUB #1,W ; W = n floored to 0 - JN BOUNDERRWM1 + JN MUL_REG_ERR MOV @TOS,X ; X=OPCODE RLAM #4,X ; OPCODE bit 1000h --> C JNC RxxMINSTRU ; if bit 1000h = 0 @@ -674,11 +680,11 @@ PxxxINSTRU MOV S,Y ; S=REG, Y=REG to test POPMINSTRU SUB W,S ; to make POPM opcode, compute first REG to POP; TI is complicated.... PUSHMINSTRU SUB W,Y ; Y=REG-(n-1) CMP #16,Y - JC BOUNDERRWM1 ; JC=JHS (U>=) + JC MUL_REG_ERR ; JC=JHS (U>=) RLAM #4,W ; W = n << 4 JMP BIS_ASMTYPE ; BODYDOES -- RxxMINSTRU CMP #4,W ; - JC BOUNDERRWM1 ; JC=JHS (U>=) + JC MUL_REG_ERR ; JC=JHS (U>=) SWPB W ; W = n << 8 RLAM #2,W ; W = N << 10 JMP BIS_ASMTYPE ; BODYDOES -- @@ -723,7 +729,7 @@ RxxMINSTRU CMP #4,W ; ; -------------------------------------------------------------------------------- ; DTCforthMSP430FR5xxx ASSEMBLER: OPCODE TYPE III bis: CALLA (without extended word) ; -------------------------------------------------------------------------------- -; absolute and immediate instructions must be written as $x.xxxx (DOUBLE numbers) +; absolute and immediate instructions must be written as $x.xxxx (DOUBLE numbers with dot) ; indexed instructions must be written as $xxxx(REG) ; -------------------------------------------------------------------------------- asmword "CALLA" @@ -744,7 +750,7 @@ CALLA02 RLAM #4,S ; (opcode>>4)<<4 = opcode CALLA1 ADD #2,S ; -- sep 136h<<4 = opcode for CALLA @REG CMP.B #'@',W ; Search @REG JNZ CALLA2 ; -CALLA11 CALL #SkipRSearchRn ; +CALLA11 CALL #SkipRSrchRn ; JNZ CALLA02 ; if REG found, update opcode ;-----------------------------------; ADD #1,S ; 137h<<4 = opcode for CALLA @REG+ @@ -774,7 +780,7 @@ CALLA41 CALL #SearchIndex ; -- n ; to allow data access beyond $FFFF ; =============================================================== -; MOVA (#$x.xxxx|&$x.xxxx|$xxxx(Rs)|Rs|@Rs|@Rs+ , &|Rd|$xxxx(Rd)) +; MOVA #$x.xxxx|&$x.xxxx|$xxxx(Rs)|Rs|@Rs|@Rs+ , &$x.xxxx|$xxxx(Rd)|Rd ; ADDA (#$x.xxxx|Rs , Rd) ; CMPA (#$x.xxxx|Rs , Rd) ; SUBA (#$x.xxxx|Rs , Rd) @@ -810,7 +816,7 @@ MOVA12 CMP.B #'&',W ; -- sep case of MOVA &$x.xxxx MOVA13 BIC #00F0h,S ; set MOVA @REG, opcode CMP.B #'@',W ; -- sep JNZ MOVA14 ; - CALL #SkipRSearchRn ; -- Rn + CALL #SkipRSrchRn ; -- Rn JNZ ACMS102 ; if @REG found BIS #0010h,S ; set @REG+ opcode MOV #'+',TOS ; -- '+' @@ -823,7 +829,7 @@ MOVA14 BIS #0030h,S ; -- sep set xxxx(REG), opcode CALL #SearchIndex ; -- n MOV TOS,2(T) ; -- n store $xxxx as 2th word MOV #')',TOS ; -- ')' - CALL #SkipRSearchRn ; -- Rn + CALL #SkipRSrchRn ; -- Rn JMP MOVA132 ; ; 2th argument process ACMS2 @@ -848,7 +854,7 @@ MOVA23 BIS #070h,S ; set ,xxxx(REG) opcode CALL #SearchIndex ; -- n MOV TOS,2(T) ; -- n write $xxxx of ,$xxxx(REG) as 2th word MOV #')',TOS ; -- ")" as WORD separator to find REG of "xxxx(REG)," - CALL #SkipRSearchRn ; -- Rn + CALL #SkipRSrchRn ; -- Rn JMP ACMS103 ; -------------------------------------------------------------------------------- @@ -902,7 +908,7 @@ PRMX12 CMP.B #'&',W ; -- sep ;-----------------------------------; PRMX13 CMP.B #'@',W ; -- sep JNZ PRMX14 -PRMX131 CALL #SkipRSearchRn ; -- Rn Rn of @REG, +PRMX131 CALL #SkipRSrchRn ; -- Rn Rn of @REG, JNZ PRMX102 ; if Rn found ;-----------------------------------; MOV #'+',TOS ; -- '+' @@ -915,7 +921,7 @@ PRMX134 CMP &SOURCE_LEN,&TOIN ; test case of TYPE VI fir PRMX14 CALL #SearchIndex ; -- n MOV TOS,0(PSP) ; -- Hi Hi PRMX141 MOV #')',TOS ; -- Hi ')' - CALL #SkipRSearchRn ; -- Hi Rn + CALL #SkipRSrchRn ; -- Hi Rn MOV @PSP+,TOS ; -- Hi AND #0Fh,TOS BIS TOS,S diff --git a/forthMSP430FR_SD_ACCEPT.asm b/forthMSP430FR_SD_ACCEPT.asm index dfea19b..d48b794 100644 --- a/forthMSP430FR_SD_ACCEPT.asm +++ b/forthMSP430FR_SD_ACCEPT.asm @@ -12,66 +12,68 @@ ; see CloseHandle. ; used variables : BufferPtr, BufferLen -; EMIT uses only IP TOS and Y registers +; QYEMIT uses only IP and Y registers ; ==================================; -; FORTHWORD "SD_ACCEPT" ; SDIB_org SDIB_org SDIB_len -- SDIB len 94 bytes +; FORTHWORD "SD_ACCEPT" ; SDIB_org SDIB_org SDIB_len -- SDIB_org len IP = QUIT4 ; ==================================; -SD_ACCEPT ; sequentially move from SD_BUF to SDIB (PAD if RAM=1k) a line of chars delimited by CRLF +SD_ACCEPT ; sequentially move from SD_BUF to SDIB a line of chars delimited by CRLF + PUSH IP ; R-- IP + MOV #SDA_YEMIT_RET,IP ; set QYEMIT return ; ----------------------------------; up to CPL = 80 chars - PUSH IP ; - MOV #SDA_YEMIT_RET,IP ; set YEMIT return -; ----------------------------------; MOV &CurrentHdl,T ; prepare a link for a next LOADed file, if any... MOV &BufferPtr,HDLW_BUFofst(T) ; ...see usage : GetFreeHandle(CheckCaseOfLoadFileToken) ; ----------------------------------; ; SDA_InitDstAddr ; ; ----------------------------------; - MOV @PSP+,W ; -- SDIB_org SDIB_len W=SDIB_ptr - MOV TOS,X ; X=SDIB_len - MOV #0,TOS ; -- SDIB_org len of moved bytes from SD_buf to SDIB -; ----------------------------------; -SDA_InitSrcAddr ; <== SDA_GetFileNextSect -; ----------------------------------; - MOV &BufferPtr,S ; S=SD_buf_ptr - MOV &BufferLen,T ; T=SD_buf_len - JMP SDA_ComputeChar ; + ADD TOS,0(PSP) ; -- SDIB_org SDIB_end SDIB_len + MOV 2(PSP),TOS ; -- SDIB_org SDIB_end SDIB_ptr +; ==================================; +SDA_InitSrcAddr ; -- SDIB_org SDIB_end SDIB_ptr <== Read_File return +; ==================================; + MOV &BufferPtr,S ; + MOV &BufferLen,T ; + MOV @PSP,W ; W = SDIB_end + MOV.B #32,X ; X = BL + JMP SDA_ComputeCharLoop ; ; ----------------------------------; SDA_YEMIT_RET ; ; ----------------------------------; mNEXTADR ; - SUB #2,IP ; 1 restore YEMIT return + SUB #2,IP ; 1 restore YEMIT return ; ----------------------------------; -SDA_ComputeChar ; -- SDIB_org len +SDA_ComputeCharLoop ; -- SDIB_org SDIB_end SDIB_ptr ; ----------------------------------; CMP T,S ; 1 SD_buf_ptr >= SD_buf_len ? JC SDA_GetFileNextSect ; 2 if yes MOV.B SD_BUF(S),Y ; 3 Y = char ADD #1,S ; 1 increment SD_buf_ptr - CMP.B #32,Y ; 2 ascii printable char ? + CMP.B X,Y ; 1 ascii printable char ? JC SDA_MoveChar ; 2 yes CMP.B #10,Y ; 2 control char = 'LF' ? - JNZ SDA_ComputeChar ; 2 no, loop back + JNZ SDA_ComputeCharLoop ; 2 no, loop back ; ----------------------------------; -SDA_EndOfLine ; -- SDIB_org len +;SDA_EndOfLine ; ; ----------------------------------; - MOV S,&BufferPtr ; yes save SD_buf_ptr for next line - MOV @RSP+,IP ; - MOV #32,S ; S = BL - JMP ACCEPT_EOL ; -- SDIB_org len ==> output + MOV S,&BufferPtr ; save SD_buf_ptr for next line loop +; ==================================; +SDA_EndOfFile ; -- SDIB_org SDIB_end SDIB_ptr <== CloseHandle return +; ==================================; + MOV @RSP+,IP ; R-- + ADD #2,PSP ; -- SDIB_ORG SDIB_PTR + SUB @PSP,TOS ; -- SDIB_ORG LEN + MOV.B X,Y ; Y = BL + JMP QYEMIT ; -- org len ==> output of SD_ACCEPT ==> INTERPRET ; ----------------------------------; -SDA_MoveChar ; +SDA_MoveChar ; -- SDIB_ORG SDIB_END SDIB_PTR ; ----------------------------------; - CMP TOS,X ; 1 len = SDIB_len ? + CMP W,TOS ; 1 SDIB_ptr = SDIB_end ? JZ QYEMIT ; 2 yes, don't move char to dst - MOV.B Y,0(W) ; 3 move char to dst - ADD #1,W ; 1 increment SDIB_ptr - ADD #1,TOS ; 1 increment len of moved chars + MOV.B Y,0(TOS) ; 3 move char to dst + ADD #1,TOS ; 1 increment SDIB_ptr JMP QYEMIT ; 9/6~ send echo to terminal if ECHO, do nothing if NOECHO -; ----------------------------------; 29/26~ char loop, add 14~ for readsectorW one char ==> 43/40~ ==> 186/200 kbytes/s @ 8MHz -SDA_GetFileNextSect ; -- SDIB_org len +; ----------------------------------; 27/24~ char loop, add 14~ for readsectorW one char ==> 41/38~ ==> 195/210 kbytes/s @ 8MHz +SDA_GetFileNextSect ; -- SDIB_org SDIB_end SDIB_ptr ; ----------------------------------; - PUSHM #2,W ; save SDIB_ptr, SDIB_len - CALL #Read_File ; which clears SD_buf_ptr and set SD_buf_len - POPM #2,W ; restore SDIB_ptr, SDIB_len - JMP SDA_InitSrcAddr ; loopback to end the line + PUSH #SDA_InitSrcAddr ; set the default return of Read_File, modified by CloseHandle when the end of file is reached + MOV #Read_File,PC ; ; ----------------------------------; \ No newline at end of file diff --git a/forthMSP430FR_SD_LOAD.asm b/forthMSP430FR_SD_LOAD.asm index bea8a1e..8218f02 100644 --- a/forthMSP430FR_SD_LOAD.asm +++ b/forthMSP430FR_SD_LOAD.asm @@ -109,7 +109,6 @@ CCFS_LOOP ; CCFS_ENTRY RRA W ;1 shift one right multiplicator JNC CCFS_LOOP ;2 C = 0 loop back -CCFS_NEXT ; C = 1, it's done ADD &OrgClusters,X ;3 OrgClusters = sector of virtual_cluster_0, word size ADDC #0,Y ;1 MOV X,&SectorL ;3 low result @@ -118,7 +117,6 @@ CCFS_NEXT ; C = 1, it's done ; ----------------------------------;32~ + 5~ by 2* shift .ENDIF ; MPY ; ----------------------------------; -CCFS_RET ; MOV @RSP+,PC ; ; ----------------------------------; @@ -155,7 +153,7 @@ SearchHandleLoop ; ; ----------------------------------; CMP.B #0,HDLB_Token(T) ; free handle ? JZ FreeHandleFound ; yes -AlreadyOpenTest ; no +;AlreadyOpenTest ; no CMP &ClusterH,HDLH_FirstClus(T); JNE SearchNextHandle ; CMP &ClusterL,HDLL_FirstClus(T); @@ -174,13 +172,13 @@ FreeHandleFound ; T = new handle, X = previous handle MOV T,&CurrentHdl ; MOV X,HDLW_PrevHDL(T) ; link to previous handle ; ----------------------------------; -CheckCaseOfPreviousToken ; +;CheckCaseOfPreviousToken ; ; ----------------------------------; CMP #0,X ; existing previous handle? JZ InitHandle ; no ADD &TOIN,HDLW_BUFofst(X) ; in previous handle, add interpret offset to Buffer offset ; ----------------------------------; -CheckCaseOfLoadFileToken ; +;CheckCaseOfLoadFileToken ; ; ----------------------------------; CMP.B #0,W ; open_type is LOAD (-1) ? JGE InitHandle ; W>=0, no @@ -204,13 +202,13 @@ InitHandle ; MOV SD_BUF+30(Y),HDLH_CurSize(T); = 0 if new DIRentry (create write file) MOV #0,&BufferPtr ; reset BufferPtr all type of files CMP.B #2,W ; del file request (2) ? - JZ InitHandleRET ; + JZ HandleRET ; JGE HDLCurClusPlsOfst2sectorHL ; set ClusterHL and SectorHL for all WRITE requests ; ----------------------------------; MOV #0,HDLW_BUFofst(T) ; < 2, is a READ or a LOAD request CMP.B #-1,W ; JZ ReplaceInputBuffer ; case of first loaded file - JL SaveBufferContext ; case of other loaded file + JL SaveAcceptContext ; case of other loaded file JMP SetBufLenLoadCurSector ; case of READ file ; ----------------------------------; ReplaceInputBuffer ; @@ -218,23 +216,16 @@ ReplaceInputBuffer ; MOV #SDIB_ORG,&CIB_ORG ; set SD Input Buffer as Current Input Buffer before return to QUIT MOV #SD_ACCEPT,&PFAACCEPT ; redirect ACCEPT to SD_ACCEPT before return to QUIT ; ----------------------------------; -SaveBufferContext ; (see CloseHandle) +SaveAcceptContext ; (see CloseHandle) ; ----------------------------------; - MOV &SOURCE_LEN,HDLW_PrevLEN(T) ; = CPL - SUB &TOIN,HDLW_PrevLEN(T) ; PREVLEN = CPL - >IN - MOV &SOURCE_ORG,HDLW_PrevORG(T) ; = CIB - ADD &TOIN,HDLW_PrevORG(T) ; PrevORG = CIB + >IN + MOV &SOURCE_LEN,HDLW_PrevLEN(T) ; + MOV &SOURCE_ORG,HDLW_PrevORG(T) ; + MOV &TOIN,HDLW_PrevTOIN(T) ; JMP SetBufLenLoadCurSector ; then RET ; ----------------------------------; -InitHandleRET ; -; ----------------------------------; - MOV @RSP+,PC ; -; ----------------------------------; -; sequentially load in SD_BUF bytsPerSec bytes of a file opened as read or as load -; if new bufferLen have a size <= BufferPtr, closes the file then RET. -; if previous bufferLen had a size < bytsPerSec, closes the file and reloads previous LOADed file if exist. +; sequentially load in SD_BUF bytsPerSec bytes of a file opened as read or load ; HDLL_CurSize leaves the not yet read size ; All used registers must be initialized. ; ==================================; @@ -266,7 +257,7 @@ SetBufLenLoadCurSector ;WXY <== previous handle reLOAD with BufferP CMP #0,HDLH_CurSize(T) ; CurSize > 65535 ? JNZ LoadCurSectorHL ; yes CMP HDLL_CurSize(T),&BufferPtr ; BufferPtr >= CurSize ? (BufferPtr = 0 or see RestorePreviousLoadedBuffer) - JC CloseHandle ; yes + JC TokenToCloseTest ; yes because all the file is already read CMP #bytsPerSec,HDLL_CurSize(T) ; CurSize >= 512 ? JC LoadCurSectorHL ; yes MOV HDLL_CurSize(T),&BufferLen ; no: adjust BufferLen @@ -279,33 +270,35 @@ ReadSectorHL ; ; ==================================; MOV &SectorL,W ; Low MOV &SectorH,X ; High - JMP ReadSectorWX ; SWX then RET with W = 0 + JMP ReadSectorWX ; SWX then RET with W = 0, SR(Z) = 1 ; ----------------------------------; ; ==================================; -CloseHandle ; <== CLOSE, Read_File, TERM2SD", OPEN_DEL +CloseHandle ; <== CLOSE, TERM2SD", OPEN_DEL ; ==================================; MOV &CurrentHdl,T ; CMP #0,T ; no handle? - JZ CloseHandleRet ; RET + JZ HandleRet ; RET ; ----------------------------------; .IFDEF SD_CARD_READ_WRITE +; ----------------------------------; CMP.B #4,HDLB_Token(T) ; WRITE file ? - JL TestClosedToken ; no, case of DEL READ LOAD file + JL TokenToCloseTest ; no, case of DEL READ LOAD file ;; ----------------------------------; optionnal ; MOV &BufferPtr,W ; ;RemFillZero ;the remainder of sector ; CMP #BytsPerSec,W ;2 buffer full ? -; JZ UpdateWriteSector ;2 remainding of buffer is full filled with 0 -; MOV.B #0,SD_BUF(W) ;3 +; JZ UpdateWriteSector ;2 remainding of buffer is full filled with $FF +; MOV.B #-1,SD_BUF(W) ;3 ; ADD #1,W ;1 ; JMP RemFillZero ;2 -;; ----------------------------------; -UpdateWriteSector +; ----------------------------------; +;UpdateWriteSector ; case of any WRITE file +; ----------------------------------; CALL #WriteSD_Buf ;SWX ; ----------------------------------; -;Load Update Save DirEntry ;SWXY +;Load Update DirEntry ;SWXY ; ----------------------------------; MOV HDLL_DIRsect(T),W ; MOV HDLH_DIRsect(T),X ; @@ -321,59 +314,65 @@ UpdateWriteSector MOV HDLH_DIRsect(T),X ; CALL #WriteSectorWX ;SWX ; ----------------------------------; - .ENDIF ; -; ----------------------------------; -TestClosedToken ; -; ----------------------------------; - CMP.B #0,HDLB_Token(T) ; + .ENDIF +; ==================================; +TokenToCloseTest ; <== Read_File +; ==================================; + CMP.B #-1,HDLB_Token(T) ; + JZ RestoreDefaultACCEPT ; + JL LoadFileToClose ; ; ----------------------------------; -CaseOfAnyReadWriteDelFileIsClosed ; token >= 0 +;CaseOfAnyReadWriteDelFileIsClosed ; token >= -1 ; ----------------------------------; - JGE CloseHandleT ; then RET + JMP CloseHandleRightNow ; then RET ; ----------------------------------; -CaseOfAnyLoadedFileIsClosed ; -- org' len' R-- QUIT3 dst_ptr dst_len SD_ACCEPT +RestoreDefaultACCEPT ; ; ----------------------------------; -RestoreSD_ACCEPTContext ; + MOV #TIB_ORG,&CIB_ORG ; restore TIB as Current Input Buffer and.. + MOV #BODYACCEPT,&PFAACCEPT ; restore default ACCEPT for next line (next loop of QUIT) ; ----------------------------------; - MOV HDLW_PrevLEN(T),TOS ; - MOV HDLW_PrevORG(T),0(PSP) ; -- org len +LoadFileToClose ; R-- SD_ACCEPT(SDA_InitSrcAddr) ; ----------------------------------; -ReturnOfSD_ACCEPT ; + MOV #SDA_RetOfCloseHandle,0(RSP); R-- SD_ACCEPT(SDA_RetOfCloseHandle) ; ----------------------------------; - ADD #6,RSP ; R-- QUIT3 empties return stack - MOV @RSP+,IP ; skip return to SD_ACCEPT +;RestorePreviousContext ; ready for the next QUIT loop ; ----------------------------------; - PUSH #CheckFirstLoadedFile ; defines the RETurn of CloseHandleT + MOV HDLW_PrevLEN(T),&SOURCE_LEN ; + MOV HDLW_PrevORG(T),&SOURCE_ORG ; + MOV HDLW_PrevTOIN(T),&TOIN ; ; ----------------------------------; -CloseHandleT ; +CloseHandleRightNow ; ; ----------------------------------; MOV.B #0,HDLB_Token(T) ; release the handle MOV @T,T ; T = previous handle MOV T,&CurrentHdl ; becomes current handle - CMP #0,T ; - JZ CloseHandleRet ; if no more handle + CMP #0,T ; no more handle ? + JZ HandleRet ; with SR(Z) = 1 ; ----------------------------------; RestorePreviousLoadedBuffer ; ; ----------------------------------; MOV HDLW_BUFofst(T),&BufferPtr ; restore previous BufferPtr - CALL #SetBufLenLoadCurSector ; then reload previous buffer - BIC #Z,SR ; + CALL #SetBufLenLoadCurSector ; then reload previous buffer + BIC #Z,SR ; force SR(Z) = 0 ; ----------------------------------; -CloseHandleRet ; - MOV @RSP+,PC ; Z = 1 if no more handle, then RET +HandleRet ; ; ----------------------------------; -CheckFirstLoadedFile ; + MOV @RSP+,PC ; SR(Z) state is used by SD_ACCEPT(SDA_RetOfCloseHandle) ; ----------------------------------; - JZ RestoreDefaultACCEPT ; - MOV #NOECHO,PC ; -- org len if return to SD_ACCEPT + +; ----------------------------------; +SDA_EOF_IP .word SDA_EndOfFile ; defines return address from ECHO|NOECHO to SD_ACCEPT ; ----------------------------------; -RestoreDefaultACCEPT ; if no more handle, first loaded file is closed... +SDA_RetOfCloseHandle ; -- SDIB_org SDIB_end SDIB_ptr R-- closed_handle Z = 1 if no more handle ; ----------------------------------; - MOV #TIB_ORG,&CIB_ORG ; restore TIB as Current Input Buffer for next line (next QUIT) - MOV #BODYACCEPT,&PFAACCEPT ; restore default ACCEPT for next line (next QUIT) - MOV #ECHO,PC ; -- org len if return to Terminal ACCEPT + MOV #SDA_EOF_IP,IP ; + JZ EchoForDefaultAccept ; + MOV #NOECHO,PC ; +EchoForDefaultAccept ; + MOV #ECHO,PC ; ; ----------------------------------; + .IFDEF SD_CARD_READ_WRITE ; ==================================; @@ -423,7 +422,6 @@ READDQ ; ==================================; FORTHWORDIMM "DEL\34" ; immediate ; ==================================; -DELDQ MOV.B #2,W ; W = DEL request JMP Open_File ; ; ----------------------------------; @@ -445,7 +443,6 @@ WRITEDQ ; ==================================; FORTHWORDIMM "APPEND\34" ; immediate ; ==================================; -APPENDQ MOV.B #8,W ; W = APPEND request JMP Open_File ; ; ----------------------------------; @@ -505,7 +502,7 @@ Open_File ; -- CMP #0,&STATE ; JZ OPEN_EXEC ; ; ----------------------------------; -OPEN_COMP ; +;OPEN_COMP ; mDOCOL ; if compile state R-- LOAD"_return .word lit,lit,COMMA,COMMA ; compile open_type as literal .word SQUOTE ; compile string_exec + string @@ -518,10 +515,9 @@ OPEN_EXEC ; mNEXTADR ; MOV @RSP+,IP ; ; ----------------------------------; -ParenOpen ; -- open_type addr cnt -; ----------------------------------; +ParenOpen ; -- open_type addr cnt execution of OPEN_COMP: IP points to OPEN_COMP(EXIT), +; ----------------------------------; case of OPEN_EXEC: IP points to INTERPRET(INTLOOP). MOV #0,S ; -Q_SD_present ; BIT.B #CD_SD,&SD_CDIN ; SD_memory in SD_Card module ? JZ Q_SD_not_init ; yes BIC #BUS_SD,&SD_SEL ; no, hide SIMO, SOMI & SCK pins (SD not initialized memory) @@ -543,7 +539,7 @@ OPEN_LetUsGo ; MOV &DIRClusterL,&ClusterL ; set DIR cluster MOV &DIRClusterH,&ClusterH ; ; ----------------------------------; -OPN_AntiSlashFirstTest ; +;OPN_AntiSlashFirstTest ; ; ----------------------------------; CMP.B #'\\',0(rDOCON) ; "\" as first char ? JNZ OPN_SearchInDIR ; no @@ -645,10 +641,10 @@ OPN_DIRentryMismatch ; JZ OPN_NoSuchFile ; yes, NoSuchFile error = 2 ===> .ELSE ; JNZ OPN_SetNextDIRcluster ; no -OPN_QcreateDIRentry ; -- open_type EOS +;OPN_QcreateDIRentry ; -- open_type EOS CMP #4,0(PSP) ; open type = WRITE" or APPEND" ? JNC OPN_NoSuchFile ; no: NoSuchFile error = 2 ===> -OPN_AddDIRcluster ; yes +;OPN_AddDIRcluster ; yes PUSH #OPN_LoadDIRcluster ; as RETurn of GetNewCluster: ===> loopback to load this new DIR cluster ; ==================================; GetNewCluster ; called by Write_File @@ -659,7 +655,7 @@ GetNewCluster ; called by Write_File CMP @RSP,W ; previous and new clusters are in same FATsector? JZ LinkClusters ; yes ; ----------------------------------; -UpdateNewClusterFATs ; +;UpdateNewClusterFATs ; ; ----------------------------------; MOV @RSP,W ; W = previous FATsector CALL #ReadFAT1SectorW ;SWX reload previous FATsector in buffer to link clusters @@ -687,11 +683,10 @@ OPN_EntryFound ; Y points on the file attribute (11th byte ; MOV W,&DIREntryOfst ; MOV SD_BUF+14H(W),&ClusterH ; first clusterH of file MOV SD_BUF+1Ah(W),&ClusterL ; first clusterL of file -OPN_EntryFoundNext BIT.B #10h,SD_BUF+0Bh(W) ; test if Directory or File JZ OPN_FileFound ; is a file ; ----------------------------------; -OPN_DIRfound ; entry is a DIRECTORY +;OPN_DIRfound ; entry is a DIRECTORY ; ----------------------------------; CMP #0,&ClusterH ; case of ".." entry, when parent directory is root JNZ OPN_DIRfoundNext ; @@ -703,7 +698,7 @@ OPN_DIRfoundNext ; CMP TOS,rDOCON ; EOS reached ? JNC OPN_SearchInDIR ; no: (rDOCON points after "\") ==> loop back ; ----------------------------------; -OPN_SetCurrentDIR ; -- open_type ptr PathName_PTR is set on name of this DIR +;OPN_SetCurrentDIR ; -- open_type ptr PathName_PTR is set on name of this DIR ; ----------------------------------; MOV &ClusterL,&DIRClusterL ; MOV &ClusterH,&DIRclusterH ; @@ -722,6 +717,10 @@ OPN_Dir ; MOV @PSP+,W ; -- ptr W = open_type MOV @PSP+,TOS ; -- ; ----------------------------------; then go to selected OpenType subroutine (OpenType = W register) + CMP #0,W ; + JNZ OPEN_QLOAD ; + MOV @IP+,PC ; nothing else to do +; ----------------------------------; ; ====================================================================== @@ -733,12 +732,6 @@ OPN_Dir ; ; ====================================================================== ; ----------------------------------; -OPEN_QDIR ; -; ----------------------------------; - CMP #0,W ; - JNZ OPEN_QLOAD ; nothing else to do - MOV @IP+,PC ; -; ----------------------------------; OPEN_QLOAD ; ; ----------------------------------; .IFDEF SD_CARD_READ_WRITE ; @@ -746,12 +739,11 @@ OPEN_QLOAD ; JNZ OPEN_1W ; next step .ENDIF ; ; ----------------------------------; here W is free -OPEN_LOAD ; +;OPEN_LOAD ; ; ----------------------------------; CMP #0,S ; open file happy end ? JNZ OPEN_Error ; no -OPEN_LOAD_END ; - MOV #NOECHO,PC ; + MOV #NOECHO,PC ; return to QUIT5 then SD_ACCEPT ; MOV @IP+,PC ; ; ----------------------------------; @@ -766,7 +758,6 @@ OPEN_Error ; S= error MOV #SD_CARD_FILE_ERROR,PC ; ; ----------------------------------; - .IFDEF BOOTLOADER ; to enable bootstrap: BOOT ; to disable bootstrap: NOBOOT @@ -793,4 +784,3 @@ XBOOT CALL &HARD_APP ; WARM first calls HARD_APP (which includes ; ==================================; NOBOOT MOV #WARM,&PUCNEXT ; removes XBOOT from PUC chain. MOV @IP+,PC ; - .ENDIF diff --git a/forthMSP430FR_SD_LowLvl.asm b/forthMSP430FR_SD_LowLvl.asm index e75665b..87dda3b 100644 --- a/forthMSP430FR_SD_LowLvl.asm +++ b/forthMSP430FR_SD_LowLvl.asm @@ -11,7 +11,7 @@ RW_Sector_CMD ;WX <=== CMD17 or CMD24 (read or write Secto ; ==================================; BIC.B #CS_SD,&SD_CSOUT ; set Chip Select low ; ----------------------------------; -ComputePhysicalSector ; input = logical sector... +;ComputePhysicalSector ; input = logical sector... ; ----------------------------------; ADD &BS_FirstSectorL,W ;3 ADDC &BS_FirstSectorH,X ;3 @@ -148,7 +148,7 @@ ReadWriteHappyEnd ; <==== WriteSector ; ----------------------------------; BIC #3,S ; Clear read and write errors BIS.B #CS_SD,&SD_CSOUT ; Chip Select high - MOV @RSP+,PC ; W = 0 + MOV @RSP+,PC ; W = 0 SR(Z) = 1 ; ----------------------------------; .IFDEF SD_CARD_READ_WRITE @@ -173,12 +173,12 @@ WriteSectorLoop ; 11 cycles loop write, starts with X = 0 CMP #BytsPerSec,X ; 2 JNZ WriteSectorLoop ; 2 ; ----------------------------------; -WriteSkipCRC16 ; CRC16 not used in SPI mode +;WriteSkipCRC16 ; CRC16 not used in SPI mode ; ----------------------------------; MOV #3,X ; PUT 3 times to skip CRC16 CALL #SPI_X_GET ; and to get data token in W ; ----------------------------------; -CheckWriteState ; +;CheckWriteState ; ; ----------------------------------; BIC.B #0E1h,W ; apply mask for Data response SUB.B #4,W ; data accepted diff --git a/forthMSP430FR_SD_RW.asm b/forthMSP430FR_SD_RW.asm index 6139dea..e9bfa48 100644 --- a/forthMSP430FR_SD_RW.asm +++ b/forthMSP430FR_SD_RW.asm @@ -16,7 +16,7 @@ OPEN_1W ; CMP #1,W ; open_type = READ" ? JNZ OPEN_2W ; no : goto next step ; ----------------------------------; -OPEN_READ ; +;OPEN_READ ; ; ----------------------------------; CMP #0,S ; open file happy end ? JNZ OPEN_Error ; no @@ -55,14 +55,11 @@ GetAndFreeCluster ; ; ----------------------------------; MOV SD_BUF(Y),W ; get [clusterLO] MOV #0,SD_BUF(Y) ; free CLusterLO -GetAndFreeClusterHi ; MOV SD_BUF+2(Y),X ; get [clusterHI] MOV #0,SD_BUF+2(Y) ; free CLusterHI -ClusterHiTest AND #00FFFh,X ; select 12 bits significant CMP #00FFFh,X ; [ClusterHI] was = 0FFFh? JNE SearchNextCluster2free ; no -ClusterLoTest ; CMP #-1,W ; [ClusterLO] was = FFFFh? last cluster used for this file JZ EndOfFileCluster ; yes ; ----------------------------------; @@ -120,17 +117,15 @@ LoadFATsectorLoop ; ; ----------------------------------; SearchFreeClusterLoop ; ; ----------------------------------; -ClusterHighWordTest ; CMP #0,SD_BUF+2(Y) ;3 cluster address hi word = 0 ? JNZ SearchNextNewCluster ;2 -ClusterLowWordTest ; CMP #0,SD_BUF(Y) ;3 Cluster address lo word = 0 ? JZ FreeClusterFound ;2 SearchNextNewCluster ; ADD #4,Y ;1 increment SD_BUF offset by size of Cluster address CMP #BytsPerSec,Y ;2 JNC SearchFreeClusterLoop ;2 18/15~ loopback while X U< BytsPerSec -IncrementFATsector ;1 +;IncrementFATsector ;1 ADD #1,0(RSP) ;3 increment FATsector MOV #0,Y ; clear FAToffset JMP LoadFATsectorLoop ;5 34/23~ loopback @@ -142,7 +137,7 @@ FreeClusterFound ; X = cluster number low word in SD_BUF = F MOV.B @RSP,W ; W = 0:FATsectorLo MOV #0FFFh,SD_BUF+2(Y) ; mark New Cluster high word as end cluster (0x0FFF) in SD_BUF ; ----------------------------------; -FAT32ClustAdrToClustNum ; convert FAT32 cluster address to cluster number (CluNum = CluAddr / 4) +;FAT32ClustAdrToClustNum ; convert FAT32 cluster address to cluster number (CluNum = CluAddr / 4) ; ----------------------------------; RRA Y ; Y = FATOffset>>1, (bytes to words conversion) SWPB W ; W = FATsectorLo:0 @@ -261,7 +256,7 @@ FillDIRentryName ;SWXY use CMP T,&PathName_END ; EOS < PTR ? JNC OPWC_CompleteWithSpaces ; yes ; ----------------------------------; -SkipForbiddenChars ; +;SkipForbiddenChars ; ; ----------------------------------; PUSH IP ;3 MOV #15,IP ;2 forbidden chars count @@ -323,7 +318,7 @@ Write_File ;STWXY <== WRITE, SD_EMIT, TERM2SD", BUT NOT CALL #WriteSD_Buf ;SWX write SD_BUF and update Handle informations only for DIRentry update MOV #0,&BufferPtr ; reset buffer pointer ; ----------------------------------; -PostIncrementSector ; +;PostIncrementSector ; ; ----------------------------------; ADD.B #1,HDLB_ClustOfst(T) ; increment current Cluster offset CMP.B &SecPerClus,HDLB_ClustOfst(T) ; out of bound ? @@ -463,13 +458,13 @@ OPEN_8W ; CMP #0,S ; already opened file ? JNZ OPWC_Write_Errors ; no ; ==================================; -OPEN_WRITE_APPEND ; yes, handle is already created +;OPEN_WRITE_APPEND ; yes, handle is already created ; ==================================; -SearchLastClust ;SWXY input: HDLL_FirstClus(T) +;SearchLastClust ;SWXY input: HDLL_FirstClus(T) ; ----------------------------------; CALL #HDLFrstClus2FATsecWofstY ;WXY output: W = FATsector, Y=FAToffset ; ----------------------------------; -SrchFAT1sectorWloop ; +;SrchFAT1sectorWloop ; ; ----------------------------------; MOV W,&FATsector ; FATsector memory CALL #ReadFAT1SectorW ;SWX @@ -529,8 +524,11 @@ LastClusterFound ; in ClusterHL FORTHWORD "TERM2SD\34" ; ; ==================================; mDOCOL ; + .word NOBOOT ; on ne tente pas le diable... .word WRITEDQ ; if already exist Free All Clusters else create it as WRITE file +; ----------------------------------; mNEXTADR ; + MOV @RSP+,IP ; ; ----------------------------------; T2S_GetSliceLoop ; tranfert by slices of 512 bytes from terminal input to file on SD_CARD via SD_BUF ; ----------------------------------; @@ -545,15 +543,13 @@ T2S_Get_a_Char_Loop ; CMP.B #4,X ;1 EOT sent by TERATERM ? JZ T2S_End_Of_File ;2 yes ; ----------------------------------; -; MOV.B X,&TERM_TXBUF ; uncomment this line to echo chars -; ----------------------------------; MOV.B X,SD_BUF(W) ;3 ADD #1,W ;1 CMP #BytsPerSec-1,W ;2 JZ T2S_XOFF ;2 W = BytsPerSec-1 send XOFF after RX 511th char JNC T2S_Get_a_Char_Loop ;2 W < BytsPerSec-1 21 cycles char loop (476 kBds/MHz) ; ----------------------------------; -T2S_WriteFile ;2 W = BytsPerSec +;T2S_WriteFile ;2 W = BytsPerSec ; ----------------------------------; CALL #Write_File ;STWXY write all the buffer JMP T2S_GetSliceLoop ;2 @@ -579,9 +575,7 @@ T2S_Wait_LF ; warning! EOT must be followed by CR+LF (TE ; ----------------------------------; MOV W,&BufferPtr ;3 CALL #CloseHandle ;4 -; ----------------------------------; - MOV @RSP+,IP ; - MOV @IP+,PC ; + MOV #ECHO,PC ; then NEXT_ADR ; ----------------------------------; .ELSE ; if I2C_TERMINAL @@ -594,14 +588,14 @@ T2S_Wait_LF ; warning! EOT must be followed by CR+LF (TE FORTHWORD "TERM2SD\34" ; here, I2C_Master is reSTARTed in RX mode ; ==================================; mDOCOL ; + .word NOBOOT ; on ne tente pas le diable... + .word NOECHO ; .word WRITEDQ ; if already exist FreeAllClusters else create it as WRITE file ; ----------------------------------; - .word NOECHO ; comment this line to echo chars -; ----------------------------------; mNEXTADR ; + MOV @RSP+,IP ; ; ----------------------------------; MOV #0,W ; clear W = SD_Buf_Ptr - MOV.B #0Ah,IP ; IP = char 'LF' ; ----------------------------------; T2S_GetLineLoop ; tranfert line by line from terminal input to SD_BUF ; ----------------------------------; @@ -609,12 +603,12 @@ T2S_GetLineLoop ; tranfert line by line from terminal input ; ----------------------------------; T2S_Get_a_Char_Loop ; ; ----------------------------------; -T2S_Q_BufferFull ; test it before to take data in RX buffer and so to do SCL strech low during Write_File !!!! +;T2S_Q_BufferFull ; test it before to take data in RX buffer and so to do SCL strech low during Write_File !!!! ; ----------------------------------; CMP #BytsPerSec,W ;2 buffer full ? JNC T2S_Get_a_Char ;2 no ; ----------------------------------; -T2S_WriteFile ; tranfert all 512 bytes of SD_BUF to the opened file in SD_CARD +;T2S_WriteFile ; tranfert all 512 bytes of SD_BUF to the opened file in SD_CARD ; ----------------------------------; SCL is stretched low by Slave (it's my) CALL #Write_File ;STWXY Write_File write always all the buffer MOV #0,W ; reset SD_Buf_Ptr @@ -625,16 +619,14 @@ T2S_Get_a_Char ; JZ T2S_Get_a_Char ;2 no MOV.B &TERM_RXBUF,X ;3 SCL is released here ; ----------------------------------; -T2S_Q_EOF ; -; ----------------------------------; CMP.B #4,X ;1 EOT sent by TERMINAL (teraterm.exe) ? JZ T2S_End_Of_File ;2 yes MOV.B X,SD_BUF(W) ;3 ADD #1,W ;1 ; ----------------------------------; -T2S_Q_Char_LF ; when Master send the Ack on char 'LF', it reStarts automatically in RX mode +;T2S_Q_Char_LF ; when Master send the Ack on char 'LF', it reStarts automatically in RX mode ; ----------------------------------; - CMP.B IP,X ;1 Char LF received ? + CMP.B #0Ah,X ;1 Char LF received ? JNZ T2S_Get_a_Char_Loop ;2 no, 22 cycles loop back (< 1us @ 24 MHz) ; ----------------------------------; T2S_Send_CR ; because I2C_Master doesn't echo it on TERMINAL @@ -647,7 +639,7 @@ T2S_Send_LF ; because I2C_Master doesn't echo it on TERM ; ----------------------------------; BIT #TX_TERM,&TERM_IFG ; JZ T2S_Send_LF ; wait TX buffer empty - MOV.B IP,&TERM_TXBUF ; send LF to beautify TERMINAL display (if ECHO is ON, obviously) + MOV.B #0Ah,&TERM_TXBUF ; send LF to beautify TERMINAL display (if ECHO is ON, obviously) ; ----------------------------------; JMP T2S_GetLineLoop ; ; ----------------------------------; @@ -655,14 +647,12 @@ T2S_End_Of_File ; ; ----------------------------------; T2S_Wait_LF ; warning! EOT is followed by CR+LF, because I2C_Master uses LF to switch from TX to RX ; ----------------------------------; - CMP.B IP,&TERM_RXBUF ; and also clears RX_IFG ! + CMP.B #0Ah,&TERM_RXBUF ; and also clears RX_IFG for CR char! JNZ T2S_Wait_LF ; ; ----------------------------------; here I2C_Master switches from TX to RX MOV W,&BufferPtr ; to add it to HDLL_CurSize CALL #CloseHandle ; tranfert SD_BUF to last sector of opened file in SD_CARD then close it -; ----------------------------------; - MOV @RSP+,IP ; - MOV #ECHO,PC ; + MOV #ECHO,PC ; then NEXT_ADR ; ----------------------------------; .ENDIF diff --git a/forthMSP430FR_TERM_HALF.asm b/forthMSP430FR_TERM_HALF.asm index 22a2c27..6e29692 100644 --- a/forthMSP430FR_TERM_HALF.asm +++ b/forthMSP430FR_TERM_HALF.asm @@ -11,7 +11,7 @@ ; FastForth target: TXD RXD RTS connected to : CTS TXD RXD of UARTtoUSB <--> COMx <--> TERMINAL ; ---------------- --- --- --- --- --- --- ------------------------------------- ; MSP_EXP430FR5739 P2.0 P2.1 P2.2 PL2303TA TERATERM.EXE -; MSP_EXP430FR5969 P2.0 P2.1 P4.1 PL2303HXD +; MSP_EXP430FR5969 P2.0 P2.1 P4.1 PL2303HXD/GC ; MSP_EXP430FR5994 P2.0 P2.1 P4.2 CP2102 ; MSP_EXP430FR6989 P3.4 P3.5 P3.0 ; MSP_EXP430FR4133 P1.0 P1.1 P2.3 @@ -20,47 +20,13 @@ ; MSP_EXP430FR2355 P4.3 P4.2 P2.0 ; LP_MSP430FR2476 P1.4 P1.5 P6.1 ; -;------------------------------------------------------------------------------- -; UART TERMINAL: QABORT ABORT_TERM INIT_BACKGRND RXON INIT_FORTH INIT_TERM INIT_COLD INIT_SOFT -;------------------------------------------------------------------------------- - -;-----------------------------------; -INIT_FORTH ; common ABORT_TERM|WARM subroutine, to init DEFERed definitions + INIT_FORTH -;-----------------------------------; - MOV @RSP+,IP ; init IP with CALLER next address -; ; - MOV #PUC_ABORT_ORG,X ; FRAM INFO FRAM MAIN -; ; --------- --------- - MOV @X+,&PFAACCEPT ; BODYACCEPT --> PFAACCEPT - MOV @X+,&PFAEMIT ; BODYEMIT --> PFAEMIT - MOV @X+,&PFAKEY ; BODYKEY --> PFAKEY - MOV @X+,&CIB_ORG ; TIB_ORG --> CIB_ORG -; ; -; ; FRAM INFO REG|RAM -; ; --------- ------- - MOV @X+,RSP ; INIT_RSTACK --> R1=RSP - MOV @X+,rDOCOL ; EXIT --> R4=rDOCOL (if DTC=2) - MOV @X+,rDODOES ; XDODOES --> R5=rDODOES - MOV @X+,rDOCON ; XDOCON --> R6=rDOCON - MOV @X+,rDOVAR ; RFROM --> R7=rDOVAR - MOV @X+,&CAPS ; INIT_CAPS --> RAM CAPS init CAPS ON - MOV @X+,&BASEADR ; INIT_BASE --> RAM BASE init decimal base - MOV @X+,&LEAVEPTR ; INIT_LEAVE --> RAM LEAVEPTR - MOV #0,&STATE ; 0 --> RAM STATE - CALL &SOFT_APP ; default SOFT_APP = INIT_SOFT = RET_ADR, value set by DEEP_RESET. - MOV #SEL_RST,PC ; goto PUC 7 to select the user's choice from TOS value: RST_RET|DEEP_RESET -;-----------------------------------; +;------------------------------------------------------------------------------------------------------------ +; UART TERMINAL: ?ABORT, INIT values of ABORT_APP, BACKGRND_APP, HARD_APP, COLD_APP and SOFT_APP +;------------------------------------------------------------------------------------------------------------ -; ?ABORT defines the run-time part of ABORT" -;-----------------------------------; -QABORT CMP #0,2(PSP) ; -- f addr cnt if f is true abort current process then display ABORT" msg. - JNZ ABORT_TERM ; -THREEDROP ADD #4,PSP ; -- cnt - JMP DROP ; -ABORT_TERM PUSH #ABORT_INIT ; called by INTERPRET, QREVEAL, TYPE2DOES -; ----------------------------------; -UART_ABORT CALL #UART_RXON ; -; ----------------------------------; +; ==================================; +ABORT_TERM ; INIT value of ABORT_APP, used by SD_CARD_ERROR +; ==================================; A_UART_LOOP BIC #RX_TERM,&TERM_IFG ; clear RX_TERM MOV &FREQ_KHZ,Y ; 1000, 2000, 4000, 8000, 16000, 24000 A_USB_LOOPJ MOV #65,X ; 2~ <-------+ linux with minicom seems very very slow... @@ -71,8 +37,17 @@ A_USB_LOOPI SUB #1,X ; 1~ <---+ | ...to refill its USB b BIT #RX_TERM,&TERM_IFG ; 4 new char in TERMRXBUF after 200ms delay ? JNZ A_UART_LOOP ; 2 yes, the input stream is still active: loop back MOV @RSP+,PC + +; ?ABORT defines the run-time part of ABORT" +;-----------------------------------; +QABORT CMP #0,2(PSP) ; -- f addr cnt if f is true abort current process then display ABORT" msg. + JNZ QABORT_YES ; + ADD #4,PSP ; -- cnt + JMP DROP ; +; ----------------------------------; +QABORT_YES CALL &ABORT_APP ; QABORT_YES called by INTERPRET, QREVEAL, TYPE2DOES ; ----------------------------------; -ABORT_INIT CALL #INIT_FORTH ; common ?ABORT|PUC subroutine + CALL #INIT_FORTH ; common ?ABORT|PUC subroutine .word DUP ; -- f addr cnt cnt .word QFBRAN,ABORT_END; -- f addr 0 don't force ECHO, no display if ABORT" is an empty string .word ECHO ; -- f addr cnt force ECHO @@ -92,10 +67,10 @@ ABORT_END .word ABORT ; -- f no return ;------------------------------------------------------------------------------- ; INIT TERMinal then enable I/O ; ;------------------------------------------------------------------------------- -INIT_HARD ; -; ----------------------------------; -INIT_TERM ; default content of HARD_APP called by WARM -; ----------------------------------; + +; ==================================; +INIT_TERM ; INIT value of HARD_APP called by WARM +; ==================================; MOV #0081h,&TERM_CTLW0 ; 8 bits, UC SWRST + UCLK = SMCLK, max 6MBds @24MHz MOV &TERMBRW_RST,&TERM_BRW ; init value in FRAM INFO MOV &TERMMCTLW_RST,&TERM_MCTLW ; init value in FRAM INFO @@ -106,13 +81,15 @@ INIT_TERM ; default content of HARD_APP called by WARM MOV @RSP+,PC ; RET ; ----------------------------------; -; ----------------------------------; -INIT_STOP ; default STOP_APP, called by SYS: wait end of TX to TERMINAL -; ----------------------------------; +; ==================================; +INIT_STOP ; INIT value of STOP_APP, called by SYS: wait end of TX to TERMINAL +; ==================================; TX_IDLE BIT #1,&TERM_STATW ;3 uart busy ? JNZ TX_IDLE ;2 loop back while TERM_UART is busy -; ----------------------------------; -INIT_SOFT MOV @RSP+,PC ; +; ==================================; +INIT_SOFT ; +; ==================================; + MOV @RSP+,PC ; ; ----------------------------------; ;------------------------------------------------------------------------------- @@ -122,7 +99,7 @@ INIT_SOFT MOV @RSP+,PC ; ;-----------------------------------; UART_WARM ; (n) -- ;-----------------------------------; -WARM CALL &HARD_APP ; default HARD_APP = INIT_TERM, value set by DEEP_RESET. +WARM CALL &HARD_APP ; mASM2FORTH ; .word ECHO ; .word XSQUOTE ; @@ -184,29 +161,41 @@ RESET ; <--- RST vector <----------- PUC <--- POR ;------------------------------------------------------------------------------- ; PUC 4: init RAM to 0 ;------------------------------------------------------------------------------- - MOV #RAM_LEN,X ; 2 RAM_LEN must be even and > 1, obviously. + MOV #RAM_LEN,X ; 2 RAM_LEN must be even and > 0, obviously. INITRAMLOOP SUB #2,X ; 1 MOV #0,RAM_ORG(X) ; 3 - JNZ INITRAMLOOP ; 2 6 cycles loop ! + JNZ INITRAMLOOP ; 2 6 cycles loop ! +; ;------------------------------------------------------------------------------- +; ; PUC 5: GET SYSRSTIV and USERSYS +; ;------------------------------------------------------------------------------- +; MOV &SYSRSTIV,X ; X <-- SYSRSTIV <-- 0 ;------------------------------------------------------------------------------- -; PUC 5: GET SYSRSTIV and USERSYS +; PUC 5: GET SYSUNIV_SYSSNIV_SYSRSTIV ( %0_UUU0_SSSS0_RRRRR0) and USERSYS +;------------------------------------------------------------------------------- + MOV &SYSUNIV,X ; 0 --> SYSUNIV --> X (%0000_0000_0000_UUU0) (7 values) + RLAM #4,X ; make room for SYSSNIV (%0000_0000_UUU0_0000) + ADD X,X ; (%0000_000U_UU00_0000) + BIS &SYSSNIV,X ; 0 --> SYSSNIV --> X (%0000_000U_UU0S_SSS0) (15 values) + RLAM #4,X ; make room for SYSRSTIV(%000U_UU0S_SSS0_0000) + RLAM #2,X ; (%0UUU_0SSS_S000_0000) + BIS.B &SYSRSTIV,X ; 0 --> SYSRSTIV --> X (%0UUU_0SSS_S0RR_RRR0) (31 values) ;------------------------------------------------------------------------------- - MOV &SYSRSTIV,X ; X <-- SYSRSTIV <-- 0 MOV &USERSYS,TOS ; TOS = FRAM USERSYS MOV #0,&USERSYS ; clear FRAM USERSYS BIT #-1,TOS ; JNZ PUC6 ; if TOS <> 0, keep USERSYS value MOV X,TOS ; else TOS <-- SYSRSTIV ;------------------------------------------------------------------------------- -; PUC 6: START FORTH engine: WARM (BOOT) +; PUC 6: START FORTH engine: WARM|BOOT ;------------------------------------------------------------------------------- PUC6 CALL #INIT_FORTH ; common part of QABORT|PUC PUCNEXT .word WARM ; no return. May be redirected by BOOT. ;-----------------------------------; ;------------------------------------------------------------------------------- -; INTERPRETER INPUT: ACCEPT RXOFF KEY EMIT ECHO NOECHO +; INTERPRETER INPUT: ACCEPT KEY EMIT ECHO NOECHO ;------------------------------------------------------------------------------- + FORTHWORD "ACCEPT" ; ;-----------------------------------; ;https://forth-standard.org/standard/core/ACCEPT @@ -294,11 +283,10 @@ CR_NEXT BIT #RX_TERM,&TERM_IFG ; char 'LF' is received ? ; ----------------------------------; SUB @PSP+,TOS ; -- len' R-- ACCEPT_NEXT MOV @RSP+,IP ; R-- -ACCEPT_EOL MOV.B S,Y ; output a BL on TERMINAL (for the case of error occuring) + MOV.B S,Y ; output a BL on TERMINAL (for the case of error occuring) JMP QYEMIT ; before return to QUIT to interpret line ; **********************************; UF9 to UF11 will be resetted. -;-----------------------------------; FORTHWORD "KEY" ;-----------------------------------; ; https://forth-standard.org/standard/core/KEY @@ -306,9 +294,9 @@ ACCEPT_EOL MOV.B S,Y ; output a BL on TERMINAL (for KEY MOV @PC+,PC ;4 Code Field Address (CFA) of KEY PFAKEY .word BODYKEY ; Parameter Field Address (PFA) of KEY, with default value BODYKEY PUSH #KEYNEXT ; -; ----------------------------------; -INIT_BACKGRND ; default content of BACKGRND_APP called by BACKGRND -; ----------------------------------; +; ==================================; +INIT_BACKGRND ; INIT value of BACKGRND_APP +; ==================================; UART_RXON ; ; ----------------------------------; .IFDEF TERMINAL3WIRES ; first software flow control @@ -330,7 +318,6 @@ KEYLOOP BIT #RX_TERM,&TERM_IFG ; loop if bit0 = 0 in interupt flag register MOV @IP+,PC ;-----------------------------------; -;-----------------------------------; FORTHWORD "EMIT" ;-----------------------------------; ; https://forth-standard.org/standard/core/EMIT @@ -348,14 +335,12 @@ QYEMIT1 BIT.B #CTS,&HANDSHAKIN ; MOV.B Y,&TERM_TXBUF ; 3 MOV @IP+,PC ; -;-----------------------------------; FORTHWORD "ECHO" ; -- connect EMIT to TERMINAL (default) ;-----------------------------------; ECHO MOV #0B3A2h,&QYEMIT ; MOV #'BIT #TX_TERM,0(PC)',&QYEMIT MOV @IP+,PC ; ;-----------------------------------; -;-----------------------------------; FORTHWORD "NOECHO" ; -- disconnect TERMINAL from EMIT ;-----------------------------------; NOECHO MOV #4D30h,&QYEMIT ; MOV #'MOV @IP+,PC',&QYEMIT diff --git a/forthMSP430FR_TERM_I2C.asm b/forthMSP430FR_TERM_I2C.asm index 70de350..2ccfc19 100644 --- a/forthMSP430FR_TERM_I2C.asm +++ b/forthMSP430FR_TERM_I2C.asm @@ -1,77 +1,55 @@ ; -*- coding: utf-8 -*- ; -; --------------------------------------------------- --------------------------- -; TERMINAL driver for I2CFastForth target (I2C Slave) see MSP430-FORTH/UARTI2CS.f -; --------------------------------------------------- --------------------------- -; | | -; | GND------------------------------GND | -; | Vcc-------------o---o------------Vcc | -; | | | | -; | 3 3 | -; | k k | -; v 3 3 v -; I2C_FastForth | | UARTI2C +---------------------------------------+ -; hardware +--------------|---o-------------+ Software | +-----------------------------+ | -; I2C Slave | +-------o----------+ | I2C Master | | +------(option)-----+ | | -; | | | | | | | | | | -; I2CFastForth target SCL SDA connected to: SDA SCL of UART to I2C bridge TXD RXD RTS connected to : CTS TXD RXD UARTtoUSB <--> COMx <--> TERMINAL -; ------------------ ---- ---- ---- ---- ------------------ --- --- --- --- --- --- ------------------------------------- -; MSP_EXP430FR5739 P1.7 P1.6 P4.0 P4.1 MSP_EXP430FR5739 P2.0 P2.1 P2.2 PL2303TA TERATERM.EXE -; MSP_EXP430FR5969 P1.7 P1.6 P1.2 P1.3 MSP_EXP430FR5969 P2.0 P2.1 P4.1 PL2303HXD -; MSP_EXP430FR5994 P7.1 P7.0 P8.2 P8.1 MSP_EXP430FR5994 P2.0 P2.1 P4.2 CP2102 -; MSP_EXP430FR6989 P1.7 P1.6 P1.3 P1.5 MSP_EXP430FR6989 P3.4 P3.5 P3.0 -; MSP_EXP430FR4133 P5.3 P5.2 P8.2 P8.3 MSP_EXP430FR4133 P1.0 P1.1 P2.3 -; CHIPSTICK_FR2433 P1.3 P1.2 P2.0 P2.2 CHIPSTICK_FR2433 P1.4 P1.5 P3.2 -; MSP_EXP430FR2433 P1.3 P1.2 P3.2 P3.1 MSP_EXP430FR2433 P1.4 P1.5 P1.0 -; MSP_EXP430FR2355 P1.3 P1.2 P3.2 P3.3 MSP_EXP430FR2355 P4.3 P4.2 P2.0 -; LP_MSP430FR2476 P4.3 P4.4 P3.2 P3.3 LP_MSP430FR2476 P1.4 P1.5 P6.1 +; --------------------------------------------------- --------------------------- +; TERMINAL driver for I2CFastForth target (I2C Slave) see MSP430-FORTH/UARTI2CS.f +; --------------------------------------------------- --------------------------- +; | | +; | | +; | GND------------------------------GND | +; | 3V3-------------o---o------------3V3 | +; | | | | +; | 1 1 | +; | k k Txy.z output | +; v 0 0 to v GND-------------------------------------GND +; I2C_FastForth | | Px.y int UARTI2CS +-------------------------------------->+ +; (hardware +<-------------|---o------------>+ jumper (Software | +<----------------------------+ | +; I2C Slave) ^ +<------o----------+ ^ +--->+ I2C Master) | | +------(option)---->+ | | +; v v ^ v ^ | ^ v ^ v ^ v +; I2C_FastForth(s) SDA SCL connected to: SCL SDA | v I2C_to_UART_bridge TXD RXD RTS connected to : CTS TXD RXD UARTtoUSB <--> COMx <--> TERMINAL +; ------------------ ---- ---- ---- ---- ---------------- --- --- --- --- --- --- --------- ---- -------- +; MSP_EXP430FR2355 P1.2 P1.3 P3.3 P3.2 P1.7 P1.6 MSP_EXP430FR2355 (24MHz) P4.3 P4.2 P2.0 PL2303GC | +; MSP_EXP430FR5739 P1.6 P1.7 P4.1 P4.0 P1.1 P1.0 MSP_EXP430FR5739 (24MHz) P2.0 P2.1 P2.2 PL2303HXD v +; MSP_EXP430FR5969 P1.6 P1.7 P1.3 P1.2 P2.2 P3.4 MSP_EXP430FR5969 (16MHz) P2.0 P2.1 P4.1 PL2303TA TERATERM.EXE +; MSP_EXP430FR5994 P7.0 P7.1 P8.1 P8.2 P1.5 P1.4 MSP_EXP430FR5994 (16MHz) P2.0 P2.1 P4.2 CP2102 +; MSP_EXP430FR6989 P1.6 P1.7 P1.5 P1.3 P3.6 P3.7 MSP_EXP430FR6989 (16MHz) P3.4 P3.5 P3.0 +; MSP_EXP430FR4133 P5.2 P5.3 P8.3 P8.2 P1.6 P1.7 MSP_EXP430FR4133 (16MHz) P1.0 P1.1 P2.3 +; MSP_EXP430FR2433 P1.2 P1.3 P3.1 P3.2 P1.2 P1.3 MSP_EXP430FR2433 (16MHz) P1.4 P1.5 P1.0 +; LP_MSP430FR2476 P4.4 P4.3 P3.3 P3.2 P1.2 P1.1 LP_MSP430FR2476 (16MHz) P1.4 P1.5 P6.1 ; ; don't forget to link 3V3 and GND on each side and to add 3k3 pullup resistors on SDA and SCL. ; -;------------------------------------------------------------------------------- -; I2C TERMINAL: QABORT ABORT_TERM INIT_FORTH INIT_TERM COLD_TERM RXON I2C_CTRL_CH -;------------------------------------------------------------------------------- +;----------------------------------------------------------------------------------------------------------- +; I2C TERMINAL: ?ABORT, INIT values of ABORT_APP, BACKGRND_APP, HARD_APP, COLD_APP and SOFT_APP +;----------------------------------------------------------------------------------------------------------- -;-----------------------------------; -INIT_FORTH ; common ABORT_TERM|WARM subroutine, to init DEFERed definitions + INIT_FORTH -;-----------------------------------; - MOV @RSP+,IP ; init IP with CALLER next address -; ; - MOV #PUC_ABORT_ORG,X ; FRAM INFO FRAM MAIN -; ; --------- --------- - MOV @X+,&PFAACCEPT ; BODYACCEPT --> PFAACCEPT - MOV @X+,&PFAEMIT ; BODYEMIT --> PFAEMIT - MOV @X+,&PFAKEY ; BODYKEY --> PFAKEY - MOV @X+,&CIB_ORG ; TIB_ORG --> CIB_ORG -; ; -; ; FRAM INFO REG|RAM -; ; --------- ------- - MOV @X+,RSP ; INIT_RSTACK --> R1=RSP - MOV @X+,rDOCOL ; EXIT --> R4=rDOCOL (if DTC=2) - MOV @X+,rDODOES ; XDODOES --> R5=rDODOES - MOV @X+,rDOCON ; XDOCON --> R6=rDOCON - MOV @X+,rDOVAR ; RFROM --> R7=rDOVAR - MOV @X+,&CAPS ; INIT_CAPS --> RAM CAPS init CAPS ON - MOV @X+,&BASEADR ; INIT_BASE --> RAM BASE init decimal base - MOV @X+,&LEAVEPTR ; INIT_LEAVE --> RAM LEAVEPTR - MOV #0,&STATE ; 0 --> RAM STATE - CALL &SOFT_APP ; default SOFT_APP = INIT_SOFT = RET_ADR, value set by DEEP_RESET. - MOV #SEL_RST,PC ; goto PUC 7 to select the user's choice from TOS value: RST_RET|DEEP_RESET +; ==================================; +ABORT_TERM ; INIT value of ABORT_APP, used by SD_CARD_ERROR +; ==================================; + MOV.B #-1,Y ; send $FF (QABORT_YES Ctrl_Char) to UARTtoI2C bridge (I2C Master), used by SD_CARD_ERROR + JMP I2C_CTRL_CH ; then RET ;-----------------------------------; ; ?ABORT defines the run-time part of ABORT" ;-----------------------------------; QABORT CMP #0,2(PSP) ; -- f addr cnt if f is true abort current process then display ABORT" msg. - JNZ ABORT_TERM ; -THREEDROP ADD #4,PSP ; -- cnt + JNZ QABORT_YES ; + ADD #4,PSP ; -- cnt JMP DROP ; ; ----------------------------------; -ABORT_TERM PUSH #ABORT_INIT ; called by INTERPRET, QREVEAL, TYPE2DOES +QABORT_YES CALL &ABORT_APP ; QABORT_YES called by INTERPRET, QREVEAL, TYPE2DOES ; ----------------------------------; -I2C_ABORT MOV.B #-1,Y ; send $FF (ABORT_TERM Ctrl_Char) to UARTtoI2C bridge (I2C Master) - JMP I2C_CTRL_CH ; -ABORT_INIT CALL #INIT_FORTH ; common ?ABORT|PUC subroutine -A_TERM_END .word DUP ; -- f addr cnt cnt + CALL #INIT_FORTH ; common ?ABORT|PUC subroutine + .word DUP ; -- f addr cnt cnt .word QFBRAN,ABORT_END; -- f addr 0 if cnt = 0 display nothing .word ECHO ; -- f addr cnt force ECHO .word XSQUOTE ; @@ -89,20 +67,20 @@ SDABORT_END .word XSQUOTE ; set normal video Display ABORT_END .word ABORT ; -- f|f addr 0 no return ; ----------------------------------; -; ----------------------------------; -INIT_BACKGRND ; default content of BACKGRND_APP called by BACKGRND -; ----------------------------------; -I2C_INIT_BACKGRND ; -; ----------------------------------; +; ==================================; +INIT_BACKGRND ; INIT value of BACKGRND_APP +; ==================================; I2C_ACCEPT MOV.B #0,Y ; ACCEPT request Ctrl_Char = $00 - JMP I2C_CTRL_CH ; + JMP I2C_CTRL_CH ; then RET ; ----------------------------------; ;------------------------------------------------------------------------------- ; INIT TERMinal then enable I/O ;------------------------------------------------------------------------------- -INIT_TERM ; default content of HARD_APP called by WARM -; ----------------------------------; TOS = USERSYS, don't change + +; ==================================; +INIT_TERM ; INIT value of HARD_APP called by WARM +; ==================================; BIS #07C0h,&TERM_CTLW0 ; set I2C_Slave in RX mode to receive I2C_address MOV &I2CSLAVEADR,Y ; I2C_Slave_address<<1 value found in FRAM INFO RRA Y ; shift it right one @@ -112,10 +90,12 @@ INIT_TERM ; default content of HARD_APP called by WARM BIC #1,&TERM_CTLW0 ; release UC_TERM from reset... BIS #WAKE_UP,&TERM_IE ; ...enable interrupt for wake up on START BIC #LOCKLPM5,&PM5CTL0 ; then activate all previous I/O settings. -; ----------------------------------; -INIT_STOP ; default content of STOP_APP called by SYS, does nothing -; ----------------------------------; -INIT_SOFT MOV @RSP+,PC ; default content of SOFT_APP called by INIT_FORTH, does nothing +; ==================================; +INIT_STOP ; INIT value of STOP_APP called by SYS, does nothing +; ==================================; +INIT_SOFT ; INIT value of SOFT_APP +; ==================================; + MOV @RSP+,PC ; ; ----------------------------------; ;------------------------------------------------------------------------------- @@ -146,7 +126,6 @@ WARM ; (n) -- .word BRAN,ABORT_TYPE ; no return ;-----------------------------------; -;-----------------------------------; FORTHWORD "SYS" ; n -- select COLD, DEEP_COLD, WARM (as software RST,DEEP_RST,WARM) ;-----------------------------------; SYS CALL &STOP_APP ; default STOP_APP = INIT_STOP, set by DEEP_RESET. @@ -192,10 +171,21 @@ RESET ; <-- RST vect. <-- SYS_failures PUC POR BOR INITRAMLOOP SUB #2,X ; 1 MOV #0,RAM_ORG(X) ; 3 JNZ INITRAMLOOP ; 2 6 cycles loop ! +; ;------------------------------------------------------------------------------- +; ; PUC 5: GET SYSRSTIV and USERSYS +; ;------------------------------------------------------------------------------- +; MOV &SYSRSTIV,X ; X <-- SYSRSTIV <-- 0 ;------------------------------------------------------------------------------- -; PUC 5: GET SYSRSTIV and USERSYS +; PUC 5: GET SYSUNIV_SYSSNIV_SYSRSTIV ( %0_UUU0_SSSS0_RRRRR0) and USERSYS +;------------------------------------------------------------------------------- + MOV &SYSUNIV,X ; 0 --> SYSUNIV --> X (%0000_0000_0000_UUU0) (7 values) + RLAM #4,X ; make room for SYSSNIV (%0000_0000_UUU0_0000) + ADD X,X ; (%0000_000U_UU00_0000) + BIS &SYSSNIV,X ; 0 --> SYSSNIV --> X (%0000_000U_UU0S_SSS0) (15 values) + RLAM #4,X ; make room for SYSRSTIV(%000U_UU0S_SSS0_0000) + RLAM #2,X ; (%0UUU_0SSS_S000_0000) + BIS.B &SYSRSTIV,X ; 0 --> SYSRSTIV --> X (%0UUU_0SSS_S0RR_RRR0) (31 values) ;------------------------------------------------------------------------------- - MOV &SYSRSTIV,X ; X <-- SYSRSTIV <-- 0 MOV &USERSYS,TOS ; TOS = USERSYS (FRAM) MOV #0,&USERSYS ; and clear USERSYS BIT.B #-1,TOS ; high byte reserved use @@ -211,6 +201,7 @@ PUCNEXT .word WARM ; no return. May be replaced by XBOOT by BOO ;------------------------------------------------------------------------------- ; INTERPRETER INPUT: ACCEPT KEY EMIT ECHO NOECHO ;------------------------------------------------------------------------------- + FORTHWORD "ACCEPT" ; ; ----------------------------------; ;https://forth-standard.org/standard/core/ACCEPT @@ -278,11 +269,10 @@ LF_NEXT BIT #10h,&TERM_CTLW0 ;4 test UCTR, instead of BUS idle becau JZ LF_NEXT ; wait until Master switched from TX to RX ; ----------------------------------; SUB @PSP+,TOS ; -- len' -ACCEPT_EOL MOV S,Y ; output a BL on TERMINAL (for the case of error occuring) + MOV S,Y ; output a BL on TERMINAL (for the case of error occuring) JMP QYEMIT ; before going to INTERPRET ; **********************************; -; ----------------------------------; FORTHWORD "KEY" ; ; ----------------------------------; ; https://forth-standard.org/standard/core/KEY @@ -306,7 +296,6 @@ BKEYLOOP BIT #RX_TERM,&TERM_IFG ; received char ? BKEYEND MOV @IP+,PC ; -- char ; ----------------------------------; -; ----------------------------------; FORTHWORD "EMIT" ; ; ----------------------------------; ; https://forth-standard.org/standard/core/EMIT @@ -321,7 +310,6 @@ QYEMIT BIT #TX_TERM,&TERM_IFG ;3 NOECHO stores here : MOV @IP+,PC, ECHO st MOV @IP+,PC ;4 11 words ; ----------------------------------; -;-----------------------------------; FORTHWORD "ECHO" ; -- connect EMIT to TERMINAL (default) ;-----------------------------------; ECHO MOV #0B3A2h,&QYEMIT ; MOV #'BIT #TX_TERM,0(PC)',&QYEMIT @@ -330,7 +318,6 @@ ECHOEND CALL #I2C_CTRL_CH ; MOV @IP+,PC ; ; ----------------------------------; -;-----------------------------------; FORTHWORD "NOECHO" ; -- disconnect TERMINAL from EMIT ;-----------------------------------; NOECHO MOV #4D30h,&QYEMIT ; MOV #'MOV @IP+,PC',&QYEMIT diff --git a/forthMSP430FR_TERM_UART.asm b/forthMSP430FR_TERM_UART.asm index 43149c8..a239df6 100644 --- a/forthMSP430FR_TERM_UART.asm +++ b/forthMSP430FR_TERM_UART.asm @@ -20,49 +20,14 @@ ; MSP_EXP430FR2355 P4.3 P4.2 P2.0 ; LP_MSP430FR2476 P1.4 P1.5 P6.1 ; -;------------------------------------------------------------------------------- -; UART TERMINAL: QABORT ABORT_TERM INIT_BACKGRND RXON INIT_FORTH INIT_TERM INIT_COLD INIT_SOFT -;------------------------------------------------------------------------------- -; -;-----------------------------------; -; modifying TOs is forbidden here ! ; -;-----------------------------------; -INIT_FORTH ; common ABORT_TERM|WARM subroutine, to init DEFERed definitions + INIT_FORTH -;-----------------------------------; - MOV @RSP+,IP ; init IP with CALLER next address -; ; - MOV #PUC_ABORT_ORG,X ; FRAM INFO FRAM MAIN -; ; --------- --------- - MOV @X+,&PFAACCEPT ; BODYACCEPT --> PFAACCEPT - MOV @X+,&PFAEMIT ; BODYEMIT --> PFAEMIT - MOV @X+,&PFAKEY ; BODYKEY --> PFAKEY - MOV @X+,&CIB_ORG ; TIB_ORG --> CIB_ORG TIB = Terminal Input Buffer, CIB = Current Input Buffer -; ; -; ; FRAM INFO REG|RAM -; ; --------- ------- - MOV @X+,RSP ; INIT_RSTACK --> R1=RSP PSP is initialised with ABORT - MOV @X+,rDOCOL ; EXIT --> R4=rDOCOL (if DTC=2) - MOV @X+,rDODOES ; XDODOES --> R5=rDODOES - MOV @X+,rDOCON ; XDOCON --> R6=rDOCON - MOV @X+,rDOVAR ; RFROM --> R7=rDOVAR - MOV @X+,&CAPS ; INIT_CAPS --> RAM CAPS init CAPS ON - MOV @X+,&BASEADR ; INIT_BASE --> RAM BASE init decimal base - MOV @X+,&LEAVEPTR ; INIT_LEAVE --> RAM LEAVEPTR - MOV #0,&STATE ; 0 --> RAM STATE - CALL &SOFT_APP ; default SOFT_APP = INIT_SOFT = RET_ADR, value set by DEEP_RESET. - MOV #SEL_RST,PC ; goto PUC 7 to select the user's choice from TOS value: RST_RET|DEEP_RESET -;-----------------------------------; +;------------------------------------------------------------------------------------------------------------ +; UART TERMINAL: ?ABORT, INIT values of ABORT_APP, BACKGRND_APP, HARD_APP, COLD_APP and SOFT_APP +;------------------------------------------------------------------------------------------------------------ -; ?ABORT defines the run-time part of ABORT" -;-----------------------------------; -QABORT CMP #0,2(PSP) ; -- f addr cnt if f is true abort current process then display ABORT" msg. - JNZ ABORT_TERM ; -THREEDROP ADD #4,PSP ; -- cnt - JMP DROP ; -ABORT_TERM PUSH #ABORT_INIT ; ABORT_TERM is called by INTERPRET, QREVEAL, TYPE2DOES -; ----------------------------------; -UART_ABORT CALL #UART_RXON ; -; ----------------------------------; +; ==================================; +ABORT_TERM ; INIT value of ABORT_APP, used by SD_CARD_ERROR +; ==================================; + CALL #UART_RXON ; A_UART_LOOP BIC #RX_TERM,&TERM_IFG ; clear RX_TERM MOV &FREQ_KHZ,Y ; 1000, 2000, 4000, 8000, 16000, 24000 A_USB_LOOPJ MOV #65,X ; 2~ <-------+ linux with minicom seems very very slow... @@ -73,8 +38,17 @@ A_USB_LOOPI SUB #1,X ; 1~ <---+ | ...to refill its USB b BIT #RX_TERM,&TERM_IFG ; 4 new char in TERMRXBUF after 200ms delay ? JNZ A_UART_LOOP ; 2 yes, the input stream is still active: loop back MOV @RSP+,PC + +; ?ABORT defines the run-time part of ABORT" +;-----------------------------------; +QABORT CMP #0,2(PSP) ; -- f addr cnt if f is true abort current process then display ABORT" msg. + JNZ QABORT_YES ; + ADD #4,PSP ; -- cnt + JMP DROP ; +; ----------------------------------; +QABORT_YES CALL &ABORT_APP ; QABORT_YES called by INTERPRET, QREVEAL, TYPE2DOES ; ----------------------------------; -ABORT_INIT CALL #INIT_FORTH ; common ?ABORT|PUC subroutine + CALL #INIT_FORTH ; common ?ABORT|PUC subroutine .word DUP ; -- f addr cnt cnt .word QFBRAN,ABORT_END; -- f addr 0 don't force ECHO, no display if ABORT" is an empty string .word ECHO ; -- f addr cnt force ECHO @@ -82,22 +56,22 @@ ABORT_INIT CALL #INIT_FORTH ; common ?ABORT|PUC subrou .byte 4,27,"[7m" ; .word TYPE ; ESC [7m = set reverse video ; ----------------------------------; -; Display QABORT|WARM message ; -- addr cnt <== WARM jumps here +; Display QABORT|WARM message ; -- f addr cnt <== WARM jumps here ; ----------------------------------; ABORT_TYPE .word TYPE ; -- f type QABORT|WARM message SDABORT_END .word XSQUOTE ; set normal video Display then goto ABORT .byte 4,27,"[0m" ; .word TYPE ; ESC [0m = set normal video -ABORT_END .word ABORT ; -- f no return +ABORT_END .word ABORT ; -- f no return, param stack is cleared.. ; ----------------------------------; ;------------------------------------------------------------------------------- ; INIT TERMinal then enable I/O ; ;------------------------------------------------------------------------------- -INIT_HARD ; -; ----------------------------------; -INIT_TERM ; default content of HARD_APP called by WARM -; ----------------------------------; + +; ==================================; +INIT_TERM ; INIT value of HARD_APP called by WARM +; ==================================; MOV #0081h,&TERM_CTLW0 ; 8 bits, UC SWRST + UCLK = SMCLK, max 6MBds @24MHz MOV &TERMBRW_RST,&TERM_BRW ; init value in FRAM INFO MOV &TERMMCTLW_RST,&TERM_MCTLW ; init value in FRAM INFO @@ -108,13 +82,15 @@ INIT_TERM ; default content of HARD_APP called by WARM MOV @RSP+,PC ; RET ; ----------------------------------; -; ----------------------------------; -INIT_STOP ; default STOP_APP, called by SYS: wait end of TX to TERMINAL -; ----------------------------------; +; ==================================; +INIT_STOP ; INIT value of STOP_APP, called by SYS: wait end of TX to TERMINAL +; ==================================; TX_IDLE BIT #1,&TERM_STATW ;3 uart busy ? JNZ TX_IDLE ;2 loop back while TERM_UART is busy -; ----------------------------------; -INIT_SOFT MOV @RSP+,PC ; +; ==================================; +INIT_SOFT ; +; ==================================; + MOV @RSP+,PC ; ; ----------------------------------; ;------------------------------------------------------------------------------- @@ -124,7 +100,7 @@ INIT_SOFT MOV @RSP+,PC ; ;-----------------------------------; UART_WARM ; (n) -- ;-----------------------------------; -WARM CALL &HARD_APP ; default HARD_APP = INIT_TERM, value set by DEEP_RESET. +WARM CALL &HARD_APP ; mASM2FORTH ; .word ECHO ; .word XSQUOTE ; @@ -142,7 +118,6 @@ WARM CALL &HARD_APP ; default HARD_APP = INIT_TERM, value set by .word BRAN,ABORT_TYPE ; no return ;-----------------------------------; -;-----------------------------------; FORTHWORD "SYS" ; n -- select COLD, DEEP_COLD, WARM (as software RST,DEEP_RST,WARM) ;-----------------------------------; SYS CALL &STOP_APP ; default STOP_APP = INIT_STOP, set by DEEP_RESET. @@ -190,17 +165,28 @@ RESET ; <--- RST vector <----------- PUC <--- POR INITRAMLOOP SUB #2,X ; 1 MOV #0,RAM_ORG(X) ; 3 JNZ INITRAMLOOP ; 2 6 cycles loop ! +; ;------------------------------------------------------------------------------- +; ; PUC 5: GET SYSRSTIV and USERSYS +; ;------------------------------------------------------------------------------- +; MOV &SYSRSTIV,X ; X <-- SYSRSTIV <-- 0 ;------------------------------------------------------------------------------- -; PUC 5: GET SYSRSTIV and USERSYS +; PUC 5: GET SYSUNIV_SYSSNIV_SYSRSTIV ( %0_UUU0_SSSS0_RRRRR0) and USERSYS +;------------------------------------------------------------------------------- + MOV &SYSUNIV,X ; 0 --> SYSUNIV --> X (%0000_0000_0000_UUU0) (7 values) + RLAM #4,X ; make room for SYSSNIV (%0000_0000_UUU0_0000) + ADD X,X ; (%0000_000U_UU00_0000) + BIS &SYSSNIV,X ; 0 --> SYSSNIV --> X (%0000_000U_UU0S_SSS0) (15 values) + RLAM #4,X ; make room for SYSRSTIV(%000U_UU0S_SSS0_0000) + RLAM #2,X ; (%0UUU_0SSS_S000_0000) + BIS.B &SYSRSTIV,X ; 0 --> SYSRSTIV --> X (%0UUU_0SSS_S0RR_RRR0) (31 values) ;------------------------------------------------------------------------------- - MOV &SYSRSTIV,X ; X <-- SYSRSTIV <-- 0 MOV &USERSYS,TOS ; TOS = FRAM USERSYS MOV #0,&USERSYS ; clear FRAM USERSYS BIT #-1,TOS ; JNZ PUC6 ; if TOS <> 0, keep USERSYS value MOV X,TOS ; else TOS <-- SYSRSTIV ;------------------------------------------------------------------------------- -; PUC 6: START FORTH engine: WARM (BOOT) +; PUC 6: START FORTH engine: WARM|BOOT ;------------------------------------------------------------------------------- PUC6 CALL #INIT_FORTH ; common part of QABORT|PUC PUCNEXT .word WARM ; no return. May be redirected by BOOT. @@ -209,6 +195,7 @@ PUCNEXT .word WARM ; no return. May be redirected by BOOT. ;------------------------------------------------------------------------------- ; INTERPRETER INPUT: ACCEPT KEY EMIT ECHO NOECHO ;------------------------------------------------------------------------------- + FORTHWORD "ACCEPT" ; ;-----------------------------------; ;https://forth-standard.org/standard/core/ACCEPT @@ -307,11 +294,10 @@ CR_NEXT BIT #RX_TERM,&TERM_IFG ; char 'LF' is received ? ; ----------------------------------; SUB @PSP+,TOS ; -- len' R-- ACCEPT_NEXT MOV @RSP+,IP ; R-- -ACCEPT_EOL MOV.B S,Y ; output a BL on TERMINAL (for the case of error occuring) + MOV.B S,Y ; output a BL on TERMINAL (for the case of error occuring) JMP QYEMIT ; before return to QUIT to interpret line ; **********************************; UF9 to UF11 will be resetted. -;-----------------------------------; FORTHWORD "KEY" ;-----------------------------------; ; https://forth-standard.org/standard/core/KEY @@ -319,9 +305,9 @@ ACCEPT_EOL MOV.B S,Y ; output a BL on TERMINAL (for KEY MOV @PC+,PC ;4 Code Field Address (CFA) of KEY PFAKEY .word BODYKEY ; Parameter Field Address (PFA) of KEY, with default value BODYKEY PUSH #KEYNEXT ; -; ----------------------------------; -INIT_BACKGRND ; default content of BACKGRND_APP called by BACKGRND -; ----------------------------------; +; ==================================; +INIT_BACKGRND ; INIT value of BACKGRND_APP +; ==================================; UART_RXON ; ; ----------------------------------; .IFDEF TERMINAL3WIRES ; first software flow control @@ -343,7 +329,6 @@ KEYLOOP BIT #RX_TERM,&TERM_IFG ; loop if bit0 = 0 in interupt flag register MOV @IP+,PC ;-----------------------------------; -;-----------------------------------; FORTHWORD "EMIT" ; save X before use if used ;-----------------------------------; ; https://forth-standard.org/standard/core/EMIT @@ -355,14 +340,12 @@ BODYEMIT MOV TOS,Y ;1 output character to the default output: T JMP QYEMIT ;2 + 12~ ;-----------------------------------; -;-----------------------------------; FORTHWORD "ECHO" ; -- connect ACCEPT and EMIT to TERMINAL input (default) ;-----------------------------------; ECHO MOV #0B3A2h,&QYEMIT ; MOV #'BIT #TX_TERM,0(PC)',&QYEMIT MOV @IP+,PC ; ;-----------------------------------; -;-----------------------------------; FORTHWORD "NOECHO" ; -- disconnect ACCEPT and EMIT from TERMINAL input ;-----------------------------------; NOECHO MOV #4D30h,&QYEMIT ; MOV #'MOV @IP+,PC',&QYEMIT diff --git a/inc/CHIPSTICK_FR2433.pat b/inc/CHIPSTICK_FR2433.pat index a7afe30..100d13a 100644 --- a/inc/CHIPSTICK_FR2433.pat +++ b/inc/CHIPSTICK_FR2433.pat @@ -1,24 +1,20 @@ @set-syntax{C;\;}! tell GEMA to replace default Comment separator '!' by ';' -; ChipStick_FR2433.pat ; \.f=\.4th for ChipStick_FR2433; to change file type + ; ======================== ; remove comments ; ======================== \\*\n= \s\\*\n=\n + ; ====================================================================== ; MSP430FR2433 Config ; ====================================================================== + @reset-syntax{}; to enable good interpreting of next line @define{@read{@mergepath{@inpath{};MSP430FR2433.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} -@reset-syntax{}; enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FR2xxx.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} ; --------------------------------------------------- ; CHIPSTICK_FR2433 <--> OUTPUT WORLD diff --git a/inc/FastForthREGtoTI.pat b/inc/FastForthREGtoTI.pat index 6497dd2..0569893 100644 --- a/inc/FastForthREGtoTI.pat +++ b/inc/FastForthREGtoTI.pat @@ -48,6 +48,7 @@ R\@=R\@ \>R=\>R S\>=S\> +S\"=S\" \>S=\>S S\<=S\< S\>\==S\>\= @@ -61,8 +62,9 @@ S\?=S\? \#\!=\#\! \#\@=\#\@ -T\{=T\{; CORETEST filter -\}T=\}T; CORETEST filter +T\{=T\{; CORETEST filter +\}T=\}T; CORETEST filter +\?FLOORED=\?FLOORED; CORETEST filter U\.R=U\.R diff --git a/inc/LP_MSP430FR2476.pat b/inc/LP_MSP430FR2476.pat index ba77814..dc64d83 100644 --- a/inc/LP_MSP430FR2476.pat +++ b/inc/LP_MSP430FR2476.pat @@ -11,14 +11,9 @@ ; ====================================================================== ; LP_MSP430FR2476 Config ; ====================================================================== + @reset-syntax{}; to enable good interpreting of next line @define{@read{@mergepath{@inpath{};MSP430FR2476.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} -@reset-syntax{}; enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FR2xxx.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} ; ====================================================================== ; LP_MSP430FR2476 board @@ -319,10 +314,16 @@ INT_IN_IFG=\$21C; P1IFG INT_IN_VEC=\$FFD6; P1VEC ;local variables +OLD_STOP_APP=\{UARTI2CS\}; +OLD_HARD_APP=\{UARTI2CS\}\+2; +OLD_BACKGRND_APP=\{UARTI2CS\}\+4; +OLD_TERM_VEC=\{UARTI2CS\}+6; <-- TERM_VEC +OLD_INT_IN_VEC=\{UARTI2CS\}+8; <-- INT_IN_VEC UARTI2CS_ADR=\{UARTI2CS\}\+10; <-- I2C_Slave_Addr<<1 TIMER_CONF=\{UARTI2CS\}\+12; <-- TIM_CTL configuration COLLISION_DLY=\{UARTI2CS\}\+14; <-- 20 us resolution delay after I2C collision DUPLEX_MODE=\{UARTI2CS\}\+15; <-- flag = 4 --> NOECHO, <> 4 --> ECHO, -1 = I2C link lost + ; ============================================ ; RC5toLCD APPLICATION ; ============================================ diff --git a/inc/MSP430FR2355.pat b/inc/MSP430FR2355.pat index fff45cc..a81a8b7 100644 --- a/inc/MSP430FR2355.pat +++ b/inc/MSP430FR2355.pat @@ -1,8 +1,19 @@ @set-syntax{C;\;}! tell GEMA to replace default Comment separator '!' by ';' + ; ======================== ;MSP430FR2355.pat ; ======================== + +@reset-syntax{}; enable good interpreting of next line +@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} + +@reset-syntax{}; enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} + +@reset-syntax{}; enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FR2xxx.pat;}}} + ; ---------------------------------------------- ; MSP430FR2355 MEMORY MAP ; ---------------------------------------------- @@ -12,9 +23,7 @@ ; 1000-17FF = ROM bootstrap loader BSL1 (2k) ; 1800-19FF = information memory (FRAM 512 B) ; 1A00-1A31 = TLV device descriptor info (FRAM 128 B) -; 1A80-1FFF = unused ; 2000-2FFF = RAM (4 KB) -; 2800-7FFF = unused ; 8000-FF7F = code memory (FRAM 15232 B) ; FF80-FFFF = interrupt vectors (FRAM 128 B) ; FFC00-FFFFF = BSL2 (2k) @@ -40,56 +49,30 @@ BSL2=\$FFC00; ; ============================================ ; FRAM INFO ; ============================================ -INFO_ORG=\$1800; -INFO_LEN=\$0200; -; See MSP430FRxxxx.pat +; See MSP430FRxxxx.pat for defined addresses in FRAM INFO ; ============================================ ; FRAM TLV ; ============================================ -; See MSP430FRxxxx.pat +; See MSP430FRxxxx.pat for defined addresses in FRAM TLV ; ============================================ -; RAM area cleared by any PUC event +; RAM ; ============================================ RAM_ORG=\$2000; RAM_LEN=\$1000; ; -; --------------------------------------- -; FORTH RAM areas : -; --------------------------------------- - -; See MSP430FR2xxx.pat +; See MSP430FR2xxx.pat for defined addresses in RAM ; ============================================ ; FRAM MAIN ; ============================================ MAIN_ORG=\$8000; Code space start ; ---------------------------------------------- -\#LIT=\#\$8000; asm CODE run time of LITERAL -\#XSQUOTE=\#\$8014; asm CODE run time of QUOTE -\#MUSMOD=\#\$8028; asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD -\#MDIV1DIV2=\#\$803A; asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/ -\#MDIV1=\#\$8042; asm CODE input for 48/16 unsigned division, see DOUBLE M*/ -\#RET_ADR=\#\$806C; asm CODE of INIT_SOFT_PFA and MARKER+8 definitions, -\#SETIB=\#\$806E; CODE Set Input Buffer with org & len values, reset >IN pointer -\#REFILL=\#\$807E; CODE accept one line from input and leave org len of input buffer -\#CIB_ORG=\#\$808A; [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG -\#QFBRAN=\#\$8096; CODE compiled by IF UNTIL -\#BRAN=\#\$809C; CODE compiled by ELSE REPEAT AGAIN -\#NEXT_ADR=\#\$809E; CODE NEXT instruction (MOV @IP+,PC) -\#XDODOES=\#\$80A0; to restore rDODOES: MOV #XDODOES,rDODOES -\#XDOCON=\#\$80AE; to restore rDOCON: MOV #XDOCON,rDOCON -; to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR -; to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL -\#INIT_FORTH=\#\$80BA; -\#ABORT_TERM=\#\$8100; CALL to discard pending download -\#UART_WARM=\#\$8172; WARM address for UART TERMINAL -\#I2C_WARM=\#\$815C; WARM address for I2C TERMINAL - -; See MSP430FRxxxx.pat for defined addresses from FORTH definitions + +; See MSP430FRxxxx.pat for defined addresses in MAIN ; ---------------------------------------------- ; Interrupt Vectors and signatures - MSP430FR2355 diff --git a/inc/MSP430FR2433.pat b/inc/MSP430FR2433.pat index c409b80..11db5eb 100644 --- a/inc/MSP430FR2433.pat +++ b/inc/MSP430FR2433.pat @@ -1,6 +1,17 @@ + @set-syntax{C;\;}! replace ! by semicolon + ;MSP430FR2433.pat +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} + +@reset-syntax{}; enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FR2xxx.pat;}}} + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} + ; ---------------------------------------------- ; MSP430FR2433 MEMORY MAP ; ---------------------------------------------- @@ -46,193 +57,14 @@ RAM_LEN=\$1000; ; FORTH RAM areas : ; --------------------------------------- -; See MSP430FRxxxx.pat - -; --------------------------------------- -; 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; base address for HOLDS -HOLD_BASE=\$21B2; BASE HOLD area, grow down -; -HP=\$21B2; HOLD ptr -STATEADR=\$21B4; Interpreter state -BASEADR=\$21B6; base -CAPS=\$21B8; CAPS ON/OFF -SOURCE_LEN=\$21BA; len of input stream -SOURCE_ORG=\$21BC; adr of input stream -TOIN=\$21BE; >IN -; -DP=\$21C0; dictionary ptr -LASTVOC=\$21C2; keep VOC-LINK -CURRENT=\$21C4; CURRENT dictionnary ptr -CONTEXT=\$21C6; CONTEXT dictionnary space (8 + Null CELLS) -; -; --------------------------------------- -; RAM_ORG + $1D8 : may be shared between FORTH compiler and user application -; --------------------------------------- -LAST_NFA=\$21D8; -LAST_THREAD=\$21DA; -LAST_CFA=\$21DC; -LAST_PSP=\$21DE; -ASMBW1=\$21E0; 3 backward labels -ASMBW2=\$21E2; -ASMBW3=\$21E4; -ASMFW1=\$21E6; 3 forward labels -ASMFW2=\$21E8; -ASMFW3=\$21EA; -; -; --------------------------------------- -; RAM_ORG + $1EC RAM free -; --------------------------------------- -; -; --------------------------------------- -; RAM_ORG + $1FC: SD buffer -; --------------------------------------- -SD_BUF_I2ADR=\$21FC; -SD_BUF_I2CNT=\$21FE; -SD_BUF=\$2200; \ SD_Card buffer -BUFEND=\$2400; - -; --------------------------------------- -; FAT16 FileSystemInfos -; --------------------------------------- -FATtype=\$2402; -BS_FirstSectorL=\$2404; -BS_FirstSectorH=\$2406; -OrgFAT1=\$2408; -FATSize=\$240A; -OrgFAT2=\$240C; -OrgRootDir=\$240E; -OrgClusters=\$2410; Sector of Cluster 0 -SecPerClus=\$2412; - -; --------------------------------------- -; SD command -; --------------------------------------- -SD_CMD_FRM=\$2414; 6 bytes SD_CMDx inverted frame \${CRC,ll,LL,hh,HH,CMD} -SD_CMD_FRM0=\$2414; CRC:ll word access -SD_CMD_FRM1=\$2415; ll byte access -SD_CMD_FRM2=\$2416; LL:hh word access -SD_CMD_FRM3=\$2417; hh byte access -SD_CMD_FRM4=\$2418; HH:CMD word access -SD_CMD_FRM5=\$2419; CMD byte access -SectorL=\$241A; 2 words -SectorH=\$241C; - -; --------------------------------------- -; BUFFER management -; --------------------------------------- -BufferPtr=\$241E; -BufferLen=\$2420; - -; --------------------------------------- -; FAT entry -; --------------------------------------- -ClusterL=\$2422; 16 bits wide (FAT16) -ClusterH=\$2424; 16 bits wide (FAT16) -LastFATsector=\$2426; Set by FreeAllClusters, used by OPEN_OVERWRITE -LastFAToffset=\$2428; Set by FreeAllClusters, used by OPEN_OVERWRITE -FATsector=\$242A; used by APPEND" - -; --------------------------------------- -; DIR entry -; --------------------------------------- -DIRclusterL=\$242C; contains the Cluster of current directory ; 1 if FAT16 root directory -DIRclusterH=\$242E; contains the Cluster of current directory ; 1 if FAT16 root directory -EntryOfst=\$2430; - -; --------------------------------------- -; Handle Pointer -; --------------------------------------- -CurrentHdl=\$2432; contains the address of the last opened file structure, or 0 - -; --------------------------------------- -; Load file operation -; --------------------------------------- -pathname=\$2434; -EndOfPath=\$2436; - -; --------------------------------------- -; Handle structure -; --------------------------------------- -; three handle tokens : -; token = 0 : free handle -; token = 1 : file to read -; token = 2 : file updated (write) -; token =-1 : LOAD"ed file (source file) - -; offset values -HDLW_PrevHDL=0; previous handle ; used by LOAD" -HDLB_Token=2; token -HDLB_ClustOfst=3; Current sector offset in current cluster (Byte) -HDLL_DIRsect=4; Dir SectorL (Long) -HDLH_DIRsect=6; -HDLW_DIRofst=8; BUFFER offset of Dir entry -HDLL_FirstClus=10; File First ClusterLo (identify the file) -HDLH_FirstClus=12; File First ClusterHi (byte) -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 - - -;OpenedFirstFile ; "openedFile" structure -HandleMax=8; -HandleLenght=28; -FirstHandle=\$2438; -HandleEnd=\$2518; - -;SD_card Input Buffer -SDIB_I2CADR=\$2518; -SDIB_I2CCNT=\$251A; -SDIB_ORG=\$251C; - -SD_END=\$2570; -SD_LEN=\$16E; +; See MSP430FR2xxx.pat ; ============================================ ; FRAM MAIN ; ============================================ MAIN_ORG=\$C400; Code space start -; ---------------------------------------------- -\#LIT=\#\$C400; asm CODE run time of LITERAL -\#XSQUOTE=\#\$C414; asm CODE run time of QUOTE -\#MUSMOD=\#\$C428; asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD -\#MDIV1DIV2=\#\$C43A; asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/ -\#MDIV1=\#\$C442; asm CODE input for 48/16 unsigned division, see DOUBLE M*/ -\#RET_ADR=\#\$C46C; asm CODE of INIT_SOFT_PFA and MARKER+8 definitions, -\#SETIB=\#\$C46E; CODE Set Input Buffer with org & len values, reset >IN pointer -\#REFILL=\#\$C47E; CODE accept one line from input and leave org len of input buffer -\#CIB_ORG=\#\$C48A; [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG -\#QFBRAN=\#\$C496; CODE compiled by IF UNTIL -\#BRAN=\#\$C49C; CODE compiled by ELSE REPEAT AGAIN -\#NEXT_ADR=\#\$C49E; CODE NEXT instruction (MOV @IP+,PC) -\#XDODOES=\#\$C4A0; to restore rDODOES: MOV #XDODOES,rDODOES -\#XDOCON=\#\$C4AE; to restore rDOCON: MOV #XDOCON,rDOCON -; to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR -; to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL -\#INIT_FORTH=\#\$C4BA; -\#ABORT_TERM=\#\$C500; CALL #ABORT_TERM to discard pending download -\#UART_WARM=\#\$C572; WARM address for UART TERMINAL -\#I2C_WARM=\#\$C55C; WARM address for I2C TERMINAL - -; See MSP430FRxxxx.pat for other addresses + +; See MSP430FRxxxx.pat ; ---------------------------------------------- ; Interrupt Vectors and signatures - MSP430FR2433 diff --git a/inc/MSP430FR2476.pat b/inc/MSP430FR2476.pat index e713f22..5a85328 100644 --- a/inc/MSP430FR2476.pat +++ b/inc/MSP430FR2476.pat @@ -1,6 +1,17 @@ + @set-syntax{C;\;}! replace ! by semicolon + ;MSP430FR2476.pat +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} + +@reset-syntax{}; enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FR2xxx.pat;}}} + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} + ; ---------------------------------------------- ; MSP430FR2476 MEMORY MAP ; ---------------------------------------------- @@ -53,195 +64,12 @@ INFO_LEN=\$0200; RAM_ORG=\$2000; RAM_LEN=\$2000; -; ---------------------------------------------- -; FORTH RAM areas : -; ---------------------------------------------- - -; See MSP430FRxxxx.pat - -; ---------------------------------------------- -; 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; base address for HOLDS -HOLD_BASE=\$21B2; BASE HOLD area, grow down -; -HP=\$21B2; HOLD ptr -STATEADR=\$21B4; Interpreter state -BASEADR=\$21B6; base -CAPS=\$21B8; CAPS ON/OFF -SOURCE_LEN=\$21BA; len of input stream -SOURCE_ORG=\$21BC; adr of input stream -TOIN=\$21BE; >IN -; -DP=\$21C0; dictionary ptr -LASTVOC=\$21C2; keep VOC-LINK -CURRENT=\$21C4; CURRENT dictionnary ptr -CONTEXT=\$21C6; CONTEXT dictionnary space (8 + Null CELLS) -; -; --------------------------------------- -; RAM_ORG + $1D8 : may be shared between FORTH compiler and user application -; --------------------------------------- -LAST_NFA=\$21D8; -LAST_THREAD=\$21DA; -LAST_CFA=\$21DC; -LAST_PSP=\$21DE; -ASMBW1=\$21E0; 3 backward labels -ASMBW2=\$21E2; -ASMBW3=\$21E4; -ASMFW1=\$21E6; 3 forward labels -ASMFW2=\$21E8; -ASMFW3=\$21EA; -; -; --------------------------------------- -; RAM_ORG + $1EC RAM free -; --------------------------------------- -; -; --------------------------------------- -; RAM_ORG + $1FC: SD buffer -; --------------------------------------- -SD_BUF_I2ADR=\$21FC; -SD_BUF_I2CNT=\$21FE; -SD_BUF=\$2200; \ SD_Card buffer -BUFEND=\$2400; - -; --------------------------------------- -; FAT16 FileSystemInfos -; --------------------------------------- -FATtype=\$2402; -BS_FirstSectorL=\$2404; -BS_FirstSectorH=\$2406; -OrgFAT1=\$2408; -FATSize=\$240A; -OrgFAT2=\$240C; -OrgRootDir=\$240E; -OrgClusters=\$2410; Sector of Cluster 0 -SecPerClus=\$2412; - -; --------------------------------------- -; SD command -; --------------------------------------- -SD_CMD_FRM=\$2414; 6 bytes SD_CMDx inverted frame \${CRC,ll,LL,hh,HH,CMD} -SD_CMD_FRM0=\$2414; CRC:ll word access -SD_CMD_FRM1=\$2415; ll byte access -SD_CMD_FRM2=\$2416; LL:hh word access -SD_CMD_FRM3=\$2417; hh byte access -SD_CMD_FRM4=\$2418; HH:CMD word access -SD_CMD_FRM5=\$2419; CMD byte access -SectorL=\$241A; 2 words -SectorH=\$241C; - -; --------------------------------------- -; BUFFER management -; --------------------------------------- -BufferPtr=\$241E; -BufferLen=\$2420; - -; --------------------------------------- -; FAT entry -; --------------------------------------- -ClusterL=\$2422; 16 bits wide (FAT16) -ClusterH=\$2424; 16 bits wide (FAT16) -LastFATsector=\$2426; Set by FreeAllClusters, used by OPEN_OVERWRITE -LastFAToffset=\$2428; Set by FreeAllClusters, used by OPEN_OVERWRITE -FATsector=\$242A; used by APPEND" - -; --------------------------------------- -; DIR entry -; --------------------------------------- -DIRclusterL=\$242C; contains the Cluster of current directory ; 1 if FAT16 root directory -DIRclusterH=\$242E; contains the Cluster of current directory ; 1 if FAT16 root directory -EntryOfst=\$2430; - -; --------------------------------------- -; Handle Pointer -; --------------------------------------- -CurrentHdl=\$2432; contains the address of the last opened file structure, or 0 - -; --------------------------------------- -; Load file operation -; --------------------------------------- -pathname=\$2434; -EndOfPath=\$2436; - -; --------------------------------------- -; Handle structure -; --------------------------------------- -; three handle tokens : -; token = 0 : free handle -; token = 1 : file to read -; token = 2 : file updated (write) -; token =-1 : LOAD"ed file (source file) - -; offset values -HDLW_PrevHDL=0; previous handle ; used by LOAD" -HDLB_Token=2; token -HDLB_ClustOfst=3; Current sector offset in current cluster (Byte) -HDLL_DIRsect=4; Dir SectorL (Long) -HDLH_DIRsect=6; -HDLW_DIRofst=8; BUFFER offset of Dir entry -HDLL_FirstClus=10; File First ClusterLo (identify the file) -HDLH_FirstClus=12; File First ClusterHi (byte) -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 - - -;OpenedFirstFile ; "openedFile" structure -HandleMax=8; -HandleLenght=28; -FirstHandle=\$2438; -HandleEnd=\$2518; - -;SD_card Input Buffer -SDIB_I2CADR=\$2518; -SDIB_I2CCNT=\$251A; -SDIB_ORG=\$251C; - -SD_END=\$2570; -SD_LEN=\$16E; +; See MSP430FR2xxx.pat ; ============================================ ; FRAM MAIN ; ============================================ MAIN_ORG=\$8000; Code space start -; ---------------------------------------------- -\#LIT=\#\$8000; asm CODE run time of LITERAL -\#XSQUOTE=\#\$8014; asm CODE run time of QUOTE -\#MUSMOD=\#\$8028; asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD -\#MDIV1DIV2=\#\$803A; asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/ -\#MDIV1=\#\$8042; asm CODE input for 48/16 unsigned division, see DOUBLE M*/ -\#RET_ADR=\#\$806C; asm CODE of INIT_SOFT_PFA and MARKER+8 definitions, -\#SETIB=\#\$806E; CODE Set Input Buffer with org & len values, reset >IN pointer -\#REFILL=\#\$807E; CODE accept one line from input and leave org len of input buffer -\#CIB_ORG=\#\$808A; [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG -\#QFBRAN=\#\$8096; CODE compiled by IF UNTIL -\#BRAN=\#\$809C; CODE compiled by ELSE REPEAT AGAIN -\#NEXT_ADR=\#\$809E; CODE NEXT instruction (MOV @IP+,PC) -\#XDODOES=\#\$80A0; to restore rDODOES: MOV #XDODOES,rDODOES -\#XDOCON=\#\$80AE; to restore rDOCON: MOV #XDOCON,rDOCON -; to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR -; to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL -\#INIT_FORTH=\#\$80BA; -\#ABORT_TERM=\#\$8100; CALL #ABORT_TERM to discard pending download -\#UART_WARM=\#\$8172; WARM address for UART TERMINAL -\#I2C_WARM=\#\$815C; WARM address for I2C TERMINAL ; See MSP430FRxxxx.pat for defined addresses from FORTH definitions diff --git a/inc/MSP430FR2633.pat b/inc/MSP430FR2633.pat index e48896b..f25c63b 100644 --- a/inc/MSP430FR2633.pat +++ b/inc/MSP430FR2633.pat @@ -1,6 +1,17 @@ + @set-syntax{C;\;}! replace ! by semicolon + ;MSP430FR2633.pat +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} + +@reset-syntax{}; enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FR2xxx.pat;}}} + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} + ; ---------------------------------------------- ; MSP430FR2633 MEMORY MAP ; ---------------------------------------------- @@ -42,197 +53,14 @@ INFO_LEN=\$0200; RAM_ORG=\$2000; RAM_LEN=\$1000; -; --------------------------------------- -; FORTH RAM areas : -; --------------------------------------- - -; See MSP430FRxxxx.pat - -; --------------------------------------- -; 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; base address for HOLDS -HOLD_BASE=\$21B2; BASE HOLD area, grow down -; -HP=\$21B2; HOLD ptr -STATEADR=\$21B4; Interpreter state -BASEADR=\$21B6; base -CAPS=\$21B8; CAPS ON/OFF -SOURCE_LEN=\$21BA; len of input stream -SOURCE_ORG=\$21BC; adr of input stream -TOIN=\$21BE; >IN -; -DP=\$21C0; dictionary ptr -LASTVOC=\$21C2; keep VOC-LINK -CURRENT=\$21C4; CURRENT dictionnary ptr -CONTEXT=\$21C6; CONTEXT dictionnary space (8 + Null CELLS) -; -; --------------------------------------- -; RAM_ORG + $1D8 : may be shared between FORTH compiler and user application -; --------------------------------------- -LAST_NFA=\$21D8; -LAST_THREAD=\$21DA; -LAST_CFA=\$21DC; -LAST_PSP=\$21DE; -ASMBW1=\$21E0; 3 backward labels -ASMBW2=\$21E2; -ASMBW3=\$21E4; -ASMFW1=\$21E6; 3 forward labels -ASMFW2=\$21E8; -ASMFW3=\$21EA; -; -; --------------------------------------- -; RAM_ORG + $1EC RAM free -; --------------------------------------- -; -; --------------------------------------- -; RAM_ORG + $1FC: SD buffer -; --------------------------------------- -SD_BUF_I2ADR=\$21FC; -SD_BUF_I2CNT=\$21FE; -SD_BUF=\$2200; \ SD_Card buffer -BUFEND=\$2400; - -; --------------------------------------- -; FAT16 FileSystemInfos -; --------------------------------------- -FATtype=\$2402; -BS_FirstSectorL=\$2404; -BS_FirstSectorH=\$2406; -OrgFAT1=\$2408; -FATSize=\$240A; -OrgFAT2=\$240C; -OrgRootDir=\$240E; -OrgClusters=\$2410; Sector of Cluster 0 -SecPerClus=\$2412; - -; --------------------------------------- -; SD command -; --------------------------------------- -SD_CMD_FRM=\$2414; 6 bytes SD_CMDx inverted frame \${CRC,ll,LL,hh,HH,CMD} -SD_CMD_FRM0=\$2414; CRC:ll word access -SD_CMD_FRM1=\$2415; ll byte access -SD_CMD_FRM2=\$2416; LL:hh word access -SD_CMD_FRM3=\$2417; hh byte access -SD_CMD_FRM4=\$2418; HH:CMD word access -SD_CMD_FRM5=\$2419; CMD byte access -SectorL=\$241A; 2 words -SectorH=\$241C; - -; --------------------------------------- -; BUFFER management -; --------------------------------------- -BufferPtr=\$241E; -BufferLen=\$2420; - -; --------------------------------------- -; FAT entry -; --------------------------------------- -ClusterL=\$2422; 16 bits wide (FAT16) -ClusterH=\$2424; 16 bits wide (FAT16) -LastFATsector=\$2426; Set by FreeAllClusters, used by OPEN_OVERWRITE -LastFAToffset=\$2428; Set by FreeAllClusters, used by OPEN_OVERWRITE -FATsector=\$242A; used by APPEND" - -; --------------------------------------- -; DIR entry -; --------------------------------------- -DIRclusterL=\$242C; contains the Cluster of current directory ; 1 if FAT16 root directory -DIRclusterH=\$242E; contains the Cluster of current directory ; 1 if FAT16 root directory -EntryOfst=\$2430; - -; --------------------------------------- -; Handle Pointer -; --------------------------------------- -CurrentHdl=\$2432; contains the address of the last opened file structure, or 0 - -; --------------------------------------- -; Load file operation -; --------------------------------------- -pathname=\$2434; -EndOfPath=\$2436; - -; --------------------------------------- -; Handle structure -; --------------------------------------- -; three handle tokens : -; token = 0 : free handle -; token = 1 : file to read -; token = 2 : file updated (write) -; token =-1 : LOAD"ed file (source file) - -; offset values -HDLW_PrevHDL=0; previous handle ; used by LOAD" -HDLB_Token=2; token -HDLB_ClustOfst=3; Current sector offset in current cluster (Byte) -HDLL_DIRsect=4; Dir SectorL (Long) -HDLH_DIRsect=6; -HDLW_DIRofst=8; BUFFER offset of Dir entry -HDLL_FirstClus=10; File First ClusterLo (identify the file) -HDLH_FirstClus=12; File First ClusterHi (byte) -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 - - -;OpenedFirstFile ; "openedFile" structure -HandleMax=8; -HandleLenght=28; -FirstHandle=\$2438; -HandleEnd=\$2518; - -;SD_card Input Buffer -SDIB_I2CADR=\$2518; -SDIB_I2CCNT=\$251A; -SDIB_ORG=\$251C; - -SD_END=\$2570; -SD_LEN=\$16E; +; See MSP430FR2xxx.pat ; ============================================ ; FRAM MAIN ; ============================================ MAIN_ORG=\$C400; Code space start -; ---------------------------------------------- -\#LIT=\#\$C400; asm CODE run time of LITERAL -\#XSQUOTE=\#\$C414; asm CODE run time of QUOTE -\#MUSMOD=\#\$C428; asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD -\#MDIV1DIV2=\#\$C43A; asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/ -\#MDIV1=\#\$C442; asm CODE input for 48/16 unsigned division, see DOUBLE M*/ -\#RET_ADR=\#\$C46C; asm CODE of INIT_SOFT_PFA and MARKER+8 definitions, -\#SETIB=\#\$C46E; CODE Set Input Buffer with org & len values, reset >IN pointer -\#REFILL=\#\$C47E; CODE accept one line from input and leave org len of input buffer -\#CIB_ORG=\#\$C48A; [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG -\#QFBRAN=\#\$C496; CODE compiled by IF UNTIL -\#BRAN=\#\$C49C; CODE compiled by ELSE REPEAT AGAIN -\#NEXT_ADR=\#\$C49E; CODE NEXT instruction (MOV @IP+,PC) -\#XDODOES=\#\$C4A0; to restore rDODOES: MOV #XDODOES,rDODOES -\#XDOCON=\#\$C4AE; to restore rDOCON: MOV #XDOCON,rDOCON -; to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR -; to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL -\#INIT_FORTH=\#\$C4BA; -\#ABORT_TERM=\#\$C500; CALL #ABORT_TERM to discard pending download -\#UART_WARM=\#\$C572; WARM address for UART TERMINAL -\#I2C_WARM=\#\$C55C; WARM address for I2C TERMINAL - -; See MSP430FRxxxx.pat for other addresses + +; See MSP430FRxxxx.pat ; ---------------------------------------------- ; Interrupt Vectors and signatures - MSP430FR2633 diff --git a/inc/MSP430FR2xxx.pat b/inc/MSP430FR2xxx.pat index 42cb413..fd9c6ac 100644 --- a/inc/MSP430FR2xxx.pat +++ b/inc/MSP430FR2xxx.pat @@ -1,13 +1,24 @@ @set-syntax{C;\;}! tell GEMA to replace default Comment separator '!' by ';' + ;MSP430fr2xxx.pat +; ; ============================================ -; RAM area cleared by any PUC event +; RAM ; ============================================ -; RAM_ORG=\$2000; ; ; ---------------------------------------------- -; FastForth RAM memory map: +; FORTH RAM areas : +; ---------------------------------------------- +LSTACK_SIZE=\#16; words +PSTACK_SIZE=\#48; words +RSTACK_SIZE=\#48; words +PAD_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 @@ -18,7 +29,7 @@ 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_I2CADR=\$2138; TX I2C address TIB_I2CCNT=\$213A; count of bytes TIB_ORG=\$213C; Terminal input buffer, 84 bytes, grow up ; @@ -28,35 +39,44 @@ HOLD_BASE=\$21B2; BASE HOLD area, grow down HP=\$21B2; HOLD ptr STATEADR=\$21B4; Interpreter state BASEADR=\$21B6; base -CAPS=\$21B8; CAPS ON/OFF -SOURCE_LEN=\$21BA; len of input stream -SOURCE_ORG=\$21BC; adr of input stream -TOIN=\$21BE; >IN +SOURCE_LEN=\$21B8; len of input stream +SOURCE_ORG=\$21BA; adr of input stream +TOIN=\$21BC; >IN ; -DP=\$21C0; dictionary ptr -LASTVOC=\$21C2; keep VOC-LINK -CURRENT=\$21C4; CURRENT dictionnary ptr -CONTEXT=\$21C6; CONTEXT dictionnary space (8 + Null CELLS) +DP=\$21BE; dictionary ptr +LASTVOC=\$21C0; keep VOC-LINK +CURRENT=\$21C2; CURRENT dictionnary ptr +CONTEXT=\$21C4; CONTEXT dictionnary space (8 + Null CELLS) ; ; --------------------------------------- -; RAM_ORG + $1D8 : may be shared between FORTH compiler and user application -; --------------------------------------- -LAST_NFA=\$21D8; -LAST_THREAD=\$21DA; -LAST_CFA=\$21DC; -LAST_PSP=\$21DE; -ASMBW1=\$21E0; 3 backward labels -ASMBW2=\$21E2; -ASMBW3=\$21E4; -ASMFW1=\$21E6; 3 forward labels -ASMFW2=\$21E8; -ASMFW3=\$21EA; +; RAM_ORG + $218 : may be shared between FORTH compiler and user application +; --------------------------------------- +LAST_NFA=\$21D6; +LAST_THREAD=\$21D8; +LAST_CFA=\$21DA; +LAST_PSP=\$21DC; +ASMBW1=\$21DE; 3 backward labels +ASMBW2=\$21E0; +ASMBW3=\$21E2; +ASMFW1=\$21E4; 3 forward labels +ASMFW2=\$21E6; +ASMFW3=\$21E8; +PREV_TOIN=\$21EA; +; --------------------------------------- +; RAM_ORG + $1EC RAM free +; --------------------------------------- ; ; --------------------------------------- ; RAM_ORG + $1EC RAM free ; --------------------------------------- ; ; --------------------------------------- +; RAM_ORG + $1FC: SD RAM +; --------------------------------------- +SD_ORG=\$21FC +SD_LEN=\$374; + +; --------------------------------------- ; RAM_ORG + $1FC: SD buffer ; --------------------------------------- SD_BUF_I2ADR=\$21FC; @@ -65,7 +85,7 @@ SD_BUF=\$2200; \ SD_Card buffer SD_BUF_END=\$2400; ; ; --------------------------------------- -; FAT16 FileSystemInfos +; FAT32 FileSystemInfos ; --------------------------------------- FATtype=\$2402; BS_FirstSectorL=\$2404; @@ -146,21 +166,20 @@ 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; 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 +HDLW_PrevLEN=24; interpret_buffer_LEN of previous handle +HDLW_PrevORG=26; interpret_buffer_ORG of previous handle +HDLW_PrevTOIN=28; interpret_buffer_PTR of previous handle +HDLW_PrevQYEMIT=30; echo state of previous handle ;OpenedFirstFile ; "openedFile" structure HandleMax=8; -HandleLenght=28; +HandleLenght=32; FirstHandle=\$2438; -HandleEnd=\$2518; +HandleEnd=\$2538; ;SD_card Input Buffer -SDIB_I2CADR=\$2518; -SDIB_I2CCNT=\$251A; -SDIB_ORG=\$251C; - -SD_END=\$2570; -SD_LEN=\$16E; - +SDIB_I2CADR=\$2538; +SDIB_I2CCNT=\$253A; +SDIB_ORG=\$253C; +SDIB_LEN=\$54; diff --git a/inc/MSP430FR4133.pat b/inc/MSP430FR4133.pat index ef2db1a..4e6c9a1 100644 --- a/inc/MSP430FR4133.pat +++ b/inc/MSP430FR4133.pat @@ -1,6 +1,17 @@ + @set-syntax{C;\;}! replace ! by semicolon + ;MSP430FR4133.pat +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} + +@reset-syntax{}; enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FR2xxx.pat;}}} + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} + ; ---------------------------------------------- ; MSP430FR4133 MEMORY MAP ; ---------------------------------------------- @@ -42,193 +53,13 @@ RAM_LEN=\$0800; ; FORTH RAM areas : ; --------------------------------------- -; See MSP430FRxxxx.pat - -; --------------------------------------- -; 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; base address for HOLDS -HOLD_BASE=\$21B2; BASE HOLD area, grow down -; -HP=\$21B2; HOLD ptr -STATEADR=\$21B4; Interpreter state -BASEADR=\$21B6; base -CAPS=\$21B8; CAPS ON/OFF -SOURCE_LEN=\$21BA; len of input stream -SOURCE_ORG=\$21BC; adr of input stream -TOIN=\$21BE; >IN -; -DP=\$21C0; dictionary ptr -LASTVOC=\$21C2; keep VOC-LINK -CURRENT=\$21C4; CURRENT dictionnary ptr -CONTEXT=\$21C6; CONTEXT dictionnary space (8 + Null CELLS) -; -; --------------------------------------- -; RAM_ORG + $1D8 : may be shared between FORTH compiler and user application -; --------------------------------------- -LAST_NFA=\$21D8; -LAST_THREAD=\$21DA; -LAST_CFA=\$21DC; -LAST_PSP=\$21DE; -ASMBW1=\$21E0; 3 backward labels -ASMBW2=\$21E2; -ASMBW3=\$21E4; -ASMFW1=\$21E6; 3 forward labels -ASMFW2=\$21E8; -ASMFW3=\$21EA; -; -; --------------------------------------- -; RAM_ORG + $1EC RAM free -; --------------------------------------- -; -; --------------------------------------- -; RAM_ORG + $1FC: SD buffer -; --------------------------------------- -SD_BUF_I2ADR=\$21FC; -SD_BUF_I2CNT=\$21FE; -SD_BUF=\$2200; \ SD_Card buffer -BUFEND=\$2400; - -; --------------------------------------- -; FAT16 FileSystemInfos -; --------------------------------------- -FATtype=\$2402; -BS_FirstSectorL=\$2404; -BS_FirstSectorH=\$2406; -OrgFAT1=\$2408; -FATSize=\$240A; -OrgFAT2=\$240C; -OrgRootDir=\$240E; -OrgClusters=\$2410; Sector of Cluster 0 -SecPerClus=\$2412; - -; --------------------------------------- -; SD command -; --------------------------------------- -SD_CMD_FRM=\$2414; 6 bytes SD_CMDx inverted frame \${CRC,ll,LL,hh,HH,CMD} -SD_CMD_FRM0=\$2414; CRC:ll word access -SD_CMD_FRM1=\$2415; ll byte access -SD_CMD_FRM2=\$2416; LL:hh word access -SD_CMD_FRM3=\$2417; hh byte access -SD_CMD_FRM4=\$2418; HH:CMD word access -SD_CMD_FRM5=\$2419; CMD byte access -SectorL=\$241A; 2 words -SectorH=\$241C; - -; --------------------------------------- -; BUFFER management -; --------------------------------------- -BufferPtr=\$241E; -BufferLen=\$2420; - -; --------------------------------------- -; FAT entry -; --------------------------------------- -ClusterL=\$2422; 16 bits wide (FAT16) -ClusterH=\$2424; 16 bits wide (FAT16) -LastFATsector=\$2426; Set by FreeAllClusters, used by OPEN_OVERWRITE -LastFAToffset=\$2428; Set by FreeAllClusters, used by OPEN_OVERWRITE -FATsector=\$242A; used by APPEND" - -; --------------------------------------- -; DIR entry -; --------------------------------------- -DIRclusterL=\$242C; contains the Cluster of current directory ; 1 if FAT16 root directory -DIRclusterH=\$242E; contains the Cluster of current directory ; 1 if FAT16 root directory -EntryOfst=\$2430; - -; --------------------------------------- -; Handle Pointer -; --------------------------------------- -CurrentHdl=\$2432; contains the address of the last opened file structure, or 0 - -; --------------------------------------- -; Load file operation -; --------------------------------------- -pathname=\$2434; -EndOfPath=\$2436; - -; --------------------------------------- -; Handle structure -; --------------------------------------- -; three handle tokens : -; token = 0 : free handle -; token = 1 : file to read -; token = 2 : file updated (write) -; token =-1 : LOAD"ed file (source file) - -; offset values -HDLW_PrevHDL=0; previous handle ; used by LOAD" -HDLB_Token=2; token -HDLB_ClustOfst=3; Current sector offset in current cluster (Byte) -HDLL_DIRsect=4; Dir SectorL (Long) -HDLH_DIRsect=6; -HDLW_DIRofst=8; BUFFER offset of Dir entry -HDLL_FirstClus=10; File First ClusterLo (identify the file) -HDLH_FirstClus=12; File First ClusterHi (byte) -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 - - -;OpenedFirstFile ; "openedFile" structure -HandleMax=8; -HandleLenght=28; -FirstHandle=\$2438; -HandleEnd=\$2518; - -;SD_card Input Buffer -SDIB_I2CADR=\$2518; -SDIB_I2CCNT=\$251A; -SDIB_ORG=\$251C; - -SD_END=\$2570; -SD_LEN=\$16E; +; See MSP430FR2xxx.pat ; ============================================ ; FRAM MAIN ; ============================================ -MAIN_ORG=\$C400; Code space start -; ---------------------------------------------- -\#LIT=\#\$C400; asm CODE run time of LITERAL -\#XSQUOTE=\#\$C414; asm CODE run time of QUOTE -\#MUSMOD=\#\$C428; asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD -\#MDIV1DIV2=\#\$C43A; asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/ -\#MDIV1=\#\$C442; asm CODE input for 48/16 unsigned division, see DOUBLE M*/ -\#RET_ADR=\#\$C46C; asm CODE of INIT_SOFT_PFA and MARKER+8 definitions, -\#SETIB=\#\$C46E; CODE Set Input Buffer with org & len values, reset >IN pointer -\#REFILL=\#\$C47E; CODE accept one line from input and leave org len of input buffer -\#CIB_ORG=\#\$C48A; [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG -\#QFBRAN=\#\$C496; CODE compiled by IF UNTIL -\#BRAN=\#\$C49C; CODE compiled by ELSE REPEAT AGAIN -\#NEXT_ADR=\#\$C49E; CODE NEXT instruction (MOV @IP+,PC) -\#XDODOES=\#\$C4A0; to restore rDODOES: MOV #XDODOES,rDODOES -\#XDOCON=\#\$C4AE; to restore rDOCON: MOV #XDOCON,rDOCON -; to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR -; to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL -\#INIT_FORTH=\#\$C4BA; -\#ABORT_TERM=\#\$C500; CALL #ABORT_TERM to discard pending download -\#UART_WARM=\#\$C572; WARM address for UART TERMINAL -\#I2C_WARM=\#\$C55C; WARM address for I2C TERMINAL - -; See MSP430FRxxxx.pat for other addresses + +; See MSP430FRxxxx.pat for symbolic addresses ; ---------------------------------------------- ; Interrupt Vectors and signatures - MSP430FR4133 diff --git a/inc/MSP430FR5738.inc b/inc/MSP430FR5738.inc index 472214c..ec4d46c 100644 --- a/inc/MSP430FR5738.inc +++ b/inc/MSP430FR5738.inc @@ -195,6 +195,8 @@ DIVM_32 .equ 0005h ; MCLK Source Divider 0 ; ---------------------------------------------------------------------- ; POWER ON RESET AND INITIALIZATION : SYS REGISTERS ; ---------------------------------------------------------------------- +SYSUNIV .equ SYS_SFR + 001Ah +SYSSNIV .equ SYS_SFR + 001Ch SYSRSTIV .equ SYS_SFR + 001Eh ; ---------------------------------------------------------------------- @@ -268,22 +270,6 @@ RXD .equ 2 ; P2.1 = RX BUS_TERM .equ 3 .ENDIF -WIPE_IN .equ P2IN -IO_WIPE .equ 1 ; P2.0 = TX + FORTH Deep_RST pin - - .IFDEF TERMINAL4WIRES -; RTS output is wired to the CTS input of UART2USB bridge -; configure RTS as output high to disable RX TERM during start FORTH -HANDSHAKOUT .equ P2OUT -HANDSHAKIN .equ P2IN -RTS .equ 4 ; P2.2 - .IFDEF TERMINAL5WIRES -; CTS input must be wired to the RTS output of UART2USB bridge -; configure CTS as input low (true) to avoid lock when CTS is not wired -CTS .equ 8 ; P2.3 - .ENDIF - .ENDIF - SD_CDIN .equ P2IN SD_CSOUT .equ P2OUT SD_CSDIR .equ P2DIR diff --git a/inc/MSP430FR5738.pat b/inc/MSP430FR5738.pat index 74c4f43..ecf0a30 100644 --- a/inc/MSP430FR5738.pat +++ b/inc/MSP430FR5738.pat @@ -1,10 +1,19 @@ -@set-syntax{C;\;}! replace ! by semicolon +@set-syntax{C;\;}! tell GEMA to replace default Comment separator '!' by ';' ; ---------------------------------------------- ;MSP430fr5738.pat ; ---------------------------------------------- +@reset-syntax{}; enable good interpreting of next line +@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} + +@reset-syntax{}; enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FR57xx.pat;}}} + +@reset-syntax{}; enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} + ; ---------------------------------------------- ; MSP430FR5738 MEMORY MAP ; ---------------------------------------------- @@ -55,26 +64,6 @@ RAM_LEN=\$0400; MAIN_ORG=\$C200; Code space start MAIN_LEN=\$3E00; 15.5 k FRAM ; ---------------------------------------------- -\#LIT=\#\$C200; asm CODE run time of LITERAL -\#XSQUOTE=\#\$C214; asm CODE run time of QUOTE -\#MUSMOD=\#\$C228; asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD -\#MDIV1DIV2=\#\$C23A; asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/ -\#MDIV1=\#\$C242; asm CODE input for 48/16 unsigned division, see DOUBLE M*/ -\#RET_ADR=\#\$C26C; asm CODE of INIT_SOFT_PFA and MARKER+8 definitions, -\#SETIB=\#\$C26E; CODE Set Input Buffer with org & len values, reset >IN pointer -\#REFILL=\#\$C27E; CODE accept one line from input and leave org len of input buffer -\#CIB_ORG=\#\$C28A; [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG -\#QFBRAN=\#\$C296; CODE compiled by IF UNTIL -\#BRAN=\#\$C29C; CODE compiled by ELSE REPEAT AGAIN -\#NEXT_ADR=\#\$C29E; CODE NEXT instruction (MOV @IP+,PC) -\#XDODOES=\#\$C2A0; to restore rDODOES: MOV #XDODOES,rDODOES -\#XDOCON=\#\$C2AE; to restore rDOCON: MOV #XDOCON,rDOCON -; to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR -; to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL -\#INIT_FORTH=\#\$C2BA; -\#ABORT_TERM=\#\$4300; CALL #ABORT_TERM to discard pending download -\#UART_WARM=\#\$C372; WARM address for UART TERMINAL -\#I2C_WARM=\#\$C35C; WARM address for I2C TERMINAL ; See MSP430FRxxxx.pat for other addresses diff --git a/inc/MSP430FR5739.inc b/inc/MSP430FR5739.inc index 3cfa00f..5010b2a 100644 --- a/inc/MSP430FR5739.inc +++ b/inc/MSP430FR5739.inc @@ -204,7 +204,8 @@ DIVM_32 .equ 0005h ; MCLK Source Divider 0 ; ---------------------------------------------------------------------- ; POWER ON RESET AND INITIALIZATION : SYS REGISTERS ; ---------------------------------------------------------------------- - +SYSUNIV .equ SYS_SFR + 001Ah +SYSSNIV .equ SYS_SFR + 001Ch SYSRSTIV .equ SYS_SFR + 001Eh diff --git a/inc/MSP430FR5739.pat b/inc/MSP430FR5739.pat index dccf448..6bd23ca 100644 --- a/inc/MSP430FR5739.pat +++ b/inc/MSP430FR5739.pat @@ -1,7 +1,17 @@ @set-syntax{C;\;}! replace ! by semicolon + ;MSP430fr5739.pat +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} + +@reset-syntax{}; enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FR57xx.pat;}}} + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} + ; ---------------------------------------------- ; MSP430FR5739 MEMORY MAP ; ---------------------------------------------- @@ -52,29 +62,6 @@ RAM_LEN=\$0400; ; ============================================ ; FRAM MAIN ; ============================================ -MAIN_ORG=\$C200; Code space start -MAIN_LEN=\$3E00; 15.5 k FRAM -; ---------------------------------------------- -\#LIT=\#\$C200; asm CODE run time of LITERAL -\#XSQUOTE=\#\$C214; asm CODE run time of QUOTE -\#MUSMOD=\#\$C228; asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD -\#MDIV1DIV2=\#\$C23A; asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/ -\#MDIV1=\#\$C242; asm CODE input for 48/16 unsigned division, see DOUBLE M*/ -\#RET_ADR=\#\$C26C; asm CODE of INIT_SOFT_PFA and MARKER+8 definitions, -\#SETIB=\#\$C26E; CODE Set Input Buffer with org & len values, reset >IN pointer -\#REFILL=\#\$C27E; CODE accept one line from input and leave org len of input buffer -\#CIB_ORG=\#\$C28A; [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG -\#QFBRAN=\#\$C296; CODE compiled by IF UNTIL -\#BRAN=\#\$C29C; CODE compiled by ELSE REPEAT AGAIN -\#NEXT_ADR=\#\$C29E; CODE NEXT instruction (MOV @IP+,PC) -\#XDODOES=\#\$C2A0; to restore rDODOES: MOV #XDODOES,rDODOES -\#XDOCON=\#\$C2AE; to restore rDOCON: MOV #XDOCON,rDOCON -; to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR -; to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL -\#INIT_FORTH=\#\$C2BA; -\#ABORT_TERM=\#\$4300; CALL #ABORT_TERM to discard pending download -\#UART_WARM=\#\$C372; WARM address for UART TERMINAL -\#I2C_WARM=\#\$C35C; WARM address for I2C TERMINAL ; See MSP430FRxxxx.pat for other addresses diff --git a/inc/MSP430FR57xx.pat b/inc/MSP430FR57xx.pat index 4464d1e..e372eb6 100644 --- a/inc/MSP430FR57xx.pat +++ b/inc/MSP430FR57xx.pat @@ -1,9 +1,23 @@ - @set-syntax{C;\;}! tell GEMA to replace default Comment separator '!' by ';' + ;MSP430FR57xx.pat +; ============================================ +; RAM +; ============================================ + ; ---------------------------------------------- -; FastForth RAM memory map (= 1k): +; FORTH RAM areas : +; ---------------------------------------------- +LSTACK_SIZE=\#16; words +PSTACK_SIZE=\#48; words +RSTACK_SIZE=\#48; words +PAD_LEN=\#84; bytes +CIB_LEN=\#84; bytes +HOLD_SIZE=\#34; bytes +; +; ---------------------------------------------- +; FastForth RAM memory map (>= 1k): ; ---------------------------------------------- LEAVEPTR=\$1C00; Leave-stack pointer, init by QUIT LSATCK=\$1C00; leave stack, grow up @@ -14,7 +28,7 @@ PAD_I2CADR=\$1CE0; RX I2C address PAD_I2CCNT=\$1CE2; count max PAD_ORG=\$1CE4; user scratch pad buffer, 84 bytes, grow up ; -TIB_I2CADR=\$1D38; TX I2C address +TIB_I2CADR=\$1D38; TX I2C address TIB_I2CCNT=\$1D3A; count of bytes TIB_ORG=\$1D3C; Terminal input buffer, 84 bytes, grow up ; @@ -24,31 +38,30 @@ HOLD_BASE=\$1DB2; BASE HOLD area, grow down HP=\$1DB2; HOLD ptr STATEADR=\$1DB4; Interpreter state BASEADR=\$1DB6; base -CAPS=\$1DB8; CAPS ON/OFF -SOURCE_LEN=\$1DBA; len of input stream -SOURCE_ORG=\$1DBC; adr of input stream -TOIN=\$1DBE; >IN +SOURCE_LEN=\$1DB8; len of input stream +SOURCE_ORG=\$1DBA; adr of input stream +TOIN=\$1DBC; >IN ; -DP=\$1DC0; dictionary ptr -LASTVOC=\$1DC2; keep VOC-LINK -CURRENT=\$1DC4; CURRENT dictionnary ptr -CONTEXT=\$1DC6; CONTEXT dictionnary space (8 + Null CELLS) +DP=\$1DBE; dictionary ptr +LASTVOC=\$1DC0; keep VOC-LINK +CURRENT=\$1DC2; CURRENT dictionnary ptr +CONTEXT=\$1DC4; CONTEXT dictionnary space (8 + Null CELLS) ; ; --------------------------------------- -; RAM_ORG + $1DD8 : may be shared between FORTH compiler and user application +; RAM_ORG + $1D8 : may be shared between FORTH compiler and user application ; --------------------------------------- -LAST_NFA=\$1DD8; -LAST_THREAD=\$1DDA; -LAST_CFA=\$1DDC; -LAST_PSP=\$1DDE; -ASMBW1=\$1DE0; 3 backward labels -ASMBW2=\$1DE2; -ASMBW3=\$1DE4; -ASMFW1=\$1DE6; 3 forward labels -ASMFW2=\$1DE8; -ASMFW3=\$1DEA; -; +LAST_NFA=\$1DD6; +LAST_THREAD=\$1DD8; +LAST_CFA=\$1DDA; +LAST_PSP=\$1DDC; +ASMBW1=\$1DDE; 3 backward labels +ASMBW2=\$1DE0; +ASMBW3=\$1DE2; +ASMFW1=\$1DE4; 3 forward labels +ASMFW2=\$1DE6; +ASMFW3=\$1DE8; +PREV_TOIN=\$1DEA; ; --------------------------------------- -; RAM_ORG + $1DEC RAM free +; RAM_ORG + $1EC RAM free ; --------------------------------------- ; diff --git a/inc/MSP430FR5948.pat b/inc/MSP430FR5948.pat index 9032296..6ddf351 100644 --- a/inc/MSP430FR5948.pat +++ b/inc/MSP430FR5948.pat @@ -1,7 +1,17 @@ @set-syntax{C;\;}! replace ! by semicolon + ;MSP430fr5948.pat +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FR5xxx.pat;}}} + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} + ; ---------------------------------------------- ; MSP430fr5948 MEMORY MAP ; ---------------------------------------------- @@ -39,200 +49,15 @@ INFO_LEN=\$0200; RAM_ORG=\$1C00; RAM_LEN=\$0800; -; --------------------------------------- -; FORTH RAM areas : -; --------------------------------------- - -; See MSP430FRxxxx.pat - -; --------------------------------------- -; FastForth RAM memory map (>= 1k) -; --------------------------------------- -LEAVEPTR=\$1C00; Leave-stack pointer, init by QUIT -LSATCK=\$1C00; leave stack, grow up -PSTACK=\$1C80; parameter stack, grow down -RSTACK=\$1CE0; Return stack, grow down -; -PAD_I2CADR=\$1CE0; RX I2C address -PAD_I2CCNT=\$1CE2; count max -PAD_ORG=\$1CE4; user scratch pad buffer, 84 bytes, grow up -; -TIB_I2CADR=\$1D38; TX I2C address -TIB_I2CCNT=\$1D3A; count of bytes -TIB_ORG=\$1D3C; Terminal input buffer, 84 bytes, grow up -; -HOLDS_ORG=\$1D90; base address for HOLDS -HOLD_BASE=\$1DB2; BASE HOLD area, grow down -; -HP=\$1DB2; HOLD ptr -STATEADR=\$1DB4; Interpreter state -BASEADR=\$1DB6; base -CAPS=\$1DB8; CAPS ON/OFF -SOURCE_LEN=\$1DBA; len of input stream -SOURCE_ORG=\$1DBC; adr of input stream -TOIN=\$1DBE; >IN -; -DP=\$1DC0; dictionary ptr -LASTVOC=\$1DC2; keep VOC-LINK -CURRENT=\$1DC4; CURRENT dictionnary ptr -CONTEXT=\$1DC6; CONTEXT dictionnary space (8 + Null CELLS) -; -; --------------------------------------- -; RAM_ORG + $1D8 : may be shared between FORTH compiler and user application -; --------------------------------------- -LAST_NFA=\$1DD8; -LAST_THREAD=\$1DDA; -LAST_CFA=\$1DDC; -LAST_PSP=\$1DDE; -ASM_CURR=\$1DE0; CODE saves CURRENT, ENDCODE restores CURRENT -ASMBW1=\$1DE2; 3 backward labels -ASMBW2=\$1DE4; -ASMBW3=\$1DE6; -ASMFW1=\$1DE8; 3 forward labels -ASMFW2=\$1DEA; -ASMFW3=\$1DEC; -; -; --------------------------------------- -; RAM_ORG + $1EE RAM free -; --------------------------------------- -; -; --------------------------------------- -; RAM_ORG + $1FC: SD buffer -; --------------------------------------- -SD_BUF_I2ADR=\$1DFC; -SD_BUF_I2CNT=\$1DFE; -SD_BUF=\$1E00; \ SD_Card buffer -BUFEND=\$2000; - -; --------------------------------------- -; FAT16 FileSystemInfos -; --------------------------------------- -FATtype=\$2002; -BS_FirstSectorL=\$2004; -BS_FirstSectorH=\$2006; -OrgFAT1=\$2008; -FATSize=\$200A; -OrgFAT2=\$200C; -OrgRootDir=\$200E; -OrgClusters=\$2010; Sector of Cluster 0 -SecPerClus=\$2012; - -; --------------------------------------- -; SD command -; --------------------------------------- -SD_CMD_FRM=\$2014; 6 bytes SD_CMDx inverted frame \${CRC,ll,LL,hh,HH,CMD} -SD_CMD_FRM0=\$2014; CRC:ll word access -SD_CMD_FRM1=\$2015; ll byte access -SD_CMD_FRM2=\$2016; LL:hh word access -SD_CMD_FRM3=\$2017; hh byte access -SD_CMD_FRM4=\$2018; HH:CMD word access -SD_CMD_FRM5=\$2019; CMD byte access -SectorL=\$201A; 2 words -SectorH=\$201C; - -; --------------------------------------- -; BUFFER management -; --------------------------------------- -BufferPtr=\$201E; -BufferLen=\$2020; - -; --------------------------------------- -; FAT entry -; --------------------------------------- -ClusterL=\$2022; 16 bits wide (FAT16) -ClusterH=\$2024; 16 bits wide (FAT16) -LastFATsector=\$2026; Set by FreeAllClusters, used by OPEN_OVERWRITE -LastFAToffset=\$2028; Set by FreeAllClusters, used by OPEN_OVERWRITE -FATsector=\$202A; used by APPEND" - -; --------------------------------------- -; DIR entry -; --------------------------------------- -DIRclusterL=\$202C; contains the Cluster of current directory ; 1 if FAT16 root directory -DIRclusterH=\$202E; contains the Cluster of current directory ; 1 if FAT16 root directory -EntryOfst=\$2030; - -; --------------------------------------- -; Handle Pointer -; --------------------------------------- -CurrentHdl=\$2032; contains the address of the last opened file structure, or 0 - -; --------------------------------------- -; Load file operation -; --------------------------------------- -pathname=\$2034; -EndOfPath=\$2036; - -; --------------------------------------- -; Handle structure -; --------------------------------------- -; three handle tokens : -; token = 0 : free handle -; token = 1 : file to read -; token = 2 : file updated (write) -; token =-1 : LOAD"ed file (source file) - -; offset values -HDLW_PrevHDL=0; previous handle ; used by LOAD" -HDLB_Token=2; token -HDLB_ClustOfst=3; Current sector offset in current cluster (Byte) -HDLL_DIRsect=4; Dir SectorL (Long) -HDLH_DIRsect=6; -HDLW_DIRofst=8; BUFFER offset of Dir entry -HDLL_FirstClus=10; File First ClusterLo (identify the file) -HDLH_FirstClus=12; File First ClusterHi (byte) -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 - - -;OpenedFirstFile ; "openedFile" structure -HandleMax=8; -HandleLenght=28; -FirstHandle=\$2038; -HandleEnd=\$2118; - -;SD_card Input Buffer -SDIB_I2CADR=\$2118; -SDIB_I2CCNT=\$211A; -SDIB_ORG=\$251C; -SDIB_LEN=\$54; - -SD_END=\$2170; -SD_LEN=\$16E; +; See MSP430FR5xxx.pat ; ============================================ ; FRAM MAIN ; ============================================ MAIN_ORG=\$4400; Code space start MAIN_LEN=\$BC00; 47 k FRAM -; ---------------------------------------------- -\#LIT=\#\$4400; asm CODE run time of LITERAL -\#XSQUOTE=\#\$4414; asm CODE run time of QUOTE -\#MUSMOD=\#\$4428; asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD -\#MDIV1DIV2=\#\$443A; asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/ -\#MDIV1=\#\$4442; asm CODE input for 48/16 unsigned division, see DOUBLE M*/ -\#RET_ADR=\#\$446C; asm CODE of INIT_SOFT_PFA and MARKER+8 definitions, -\#SETIB=\#\$446E; CODE Set Input Buffer with org & len values, reset >IN pointer -\#REFILL=\#\$447E; CODE accept one line from input and leave org len of input buffer -\#CIB_ORG=\#\$448A; [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG -\#QFBRAN=\#\$4496; CODE compiled by IF UNTIL -\#BRAN=\#\$449C; CODE compiled by ELSE REPEAT AGAIN -\#NEXT_ADR=\#\$449E; CODE NEXT instruction (MOV @IP+,PC) -\#XDODOES=\#\$44A0; to restore rDODOES: MOV #XDODOES,rDODOES -\#XDOCON=\#\$44AE; to restore rDOCON: MOV #XDOCON,rDOCON -; to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR -; to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL -\#INIT_FORTH=\#\$44BA; -\#ABORT_TERM=\#\$4500; CALL #ABORT_TERM to discard pending download -\#UART_WARM=\#\$4572; WARM address for UART TERMINAL -\#I2C_WARM=\#\$455C; WARM address for I2C TERMINAL - -; See MSP430FRxxxx.pat for other addresses + +; See MSP430FRxxxx.pat ; ---------------------------------------------- ; Interrupt Vectors and signatures - MSP430FR5948 diff --git a/inc/MSP430FR5969.pat b/inc/MSP430FR5969.pat index 4c278d8..ac878cd 100644 --- a/inc/MSP430FR5969.pat +++ b/inc/MSP430FR5969.pat @@ -1,7 +1,17 @@ @set-syntax{C;\;}! replace ! by semicolon + ;MSP430fr5969.pat +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} + +@reset-syntax{}; enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FR5xxx.pat;}}} + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} + ; ---------------------------------------------- ; MSP430FR5969 MEMORY MAP ; ---------------------------------------------- @@ -43,193 +53,13 @@ RAM_LEN=\$0800; ; FORTH RAM areas : ; --------------------------------------- -; See MSP430FRxxxx.pat - -; --------------------------------------- -; FastForth RAM memory map (>= 1k) -; --------------------------------------- -LEAVEPTR=\$1C00; Leave-stack pointer, init by QUIT -LSATCK=\$1C00; leave stack, grow up -PSTACK=\$1C80; parameter stack, grow down -RSTACK=\$1CE0; Return stack, grow down -; -PAD_I2CADR=\$1CE0; RX I2C address -PAD_I2CCNT=\$1CE2; count max -PAD_ORG=\$1CE4; user scratch pad buffer, 84 bytes, grow up -; -TIB_I2CADR=\$1D38; TX I2C address -TIB_I2CCNT=\$1D3A; count of bytes -TIB_ORG=\$1D3C; Terminal input buffer, 84 bytes, grow up -; -HOLDS_ORG=\$1D90; base address for HOLDS -HOLD_BASE=\$1DB2; BASE HOLD area, grow down -; -HP=\$1DB2; HOLD ptr -STATEADR=\$1DB4; Interpreter state -BASEADR=\$1DB6; base -CAPS=\$1DB8; CAPS ON/OFF -SOURCE_LEN=\$1DBA; len of input stream -SOURCE_ORG=\$1DBC; adr of input stream -TOIN=\$1DBE; >IN -; -DP=\$1DC0; dictionary ptr -LASTVOC=\$1DC2; keep VOC-LINK -CURRENT=\$1DC4; CURRENT dictionnary ptr -CONTEXT=\$1DC6; CONTEXT dictionnary space (8 + Null CELLS) -; -; --------------------------------------- -; RAM_ORG + $1D8 : may be shared between FORTH compiler and user application -; --------------------------------------- -LAST_NFA=\$1DD8; -LAST_THREAD=\$1DDA; -LAST_CFA=\$1DDC; -LAST_PSP=\$1DDE; -ASMBW1=\$1DE0; 3 backward labels -ASMBW2=\$1DE2; -ASMBW3=\$1DE4; -ASMFW1=\$1DE6; 3 forward labels -ASMFW2=\$1DE8; -ASMFW3=\$1DEA; -; -; --------------------------------------- -; RAM_ORG + $1EC RAM free -; --------------------------------------- -; -; --------------------------------------- -; RAM_ORG + $1FC: SD buffer -; --------------------------------------- -SD_BUF_I2ADR=\$1DFC; -SD_BUF_I2CNT=\$1DFE; -SD_BUF=\$1E00; \ SD_Card buffer -BUFEND=\$2000; - -; --------------------------------------- -; FAT16 FileSystemInfos -; --------------------------------------- -FATtype=\$2002; -BS_FirstSectorL=\$2004; -BS_FirstSectorH=\$2006; -OrgFAT1=\$2008; -FATSize=\$200A; -OrgFAT2=\$200C; -OrgRootDir=\$200E; -OrgClusters=\$2010; Sector of Cluster 0 -SecPerClus=\$2012; - -; --------------------------------------- -; SD command -; --------------------------------------- -SD_CMD_FRM=\$2014; 6 bytes SD_CMDx inverted frame \${CRC,ll,LL,hh,HH,CMD} -SD_CMD_FRM0=\$2014; CRC:ll word access -SD_CMD_FRM1=\$2015; ll byte access -SD_CMD_FRM2=\$2016; LL:hh word access -SD_CMD_FRM3=\$2017; hh byte access -SD_CMD_FRM4=\$2018; HH:CMD word access -SD_CMD_FRM5=\$2019; CMD byte access -SectorL=\$201A; 2 words -SectorH=\$201C; - -; --------------------------------------- -; BUFFER management -; --------------------------------------- -BufferPtr=\$201E; -BufferLen=\$2020; - -; --------------------------------------- -; FAT entry -; --------------------------------------- -ClusterL=\$2022; 16 bits wide (FAT16) -ClusterH=\$2024; 16 bits wide (FAT16) -LastFATsector=\$2026; Set by FreeAllClusters, used by OPEN_OVERWRITE -LastFAToffset=\$2028; Set by FreeAllClusters, used by OPEN_OVERWRITE -FATsector=\$202A; used by APPEND" - -; --------------------------------------- -; DIR entry -; --------------------------------------- -DIRclusterL=\$202C; contains the Cluster of current directory ; 1 if FAT16 root directory -DIRclusterH=\$202E; contains the Cluster of current directory ; 1 if FAT16 root directory -EntryOfst=\$2030; - -; --------------------------------------- -; Handle Pointer -; --------------------------------------- -CurrentHdl=\$2032; contains the address of the last opened file structure, or 0 - -; --------------------------------------- -; Load file operation -; --------------------------------------- -pathname=\$2034; -EndOfPath=\$2036; - -; --------------------------------------- -; Handle structure -; --------------------------------------- -; three handle tokens : -; token = 0 : free handle -; token = 1 : file to read -; token = 2 : file updated (write) -; token =-1 : LOAD"ed file (source file) - -; offset values -HDLW_PrevHDL=0; previous handle ; used by LOAD" -HDLB_Token=2; token -HDLB_ClustOfst=3; Current sector offset in current cluster (Byte) -HDLL_DIRsect=4; Dir SectorL (Long) -HDLH_DIRsect=6; -HDLW_DIRofst=8; BUFFER offset of Dir entry -HDLL_FirstClus=10; File First ClusterLo (identify the file) -HDLH_FirstClus=12; File First ClusterHi (byte) -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 - - -;OpenedFirstFile ; "openedFile" structure -HandleMax=8; -HandleLenght=28; -FirstHandle=\$2038; -HandleEnd=\$2118; - -;SD_card Input Buffer -SDIB_I2CADR=\$2118; -SDIB_I2CCNT=\$211A; -SDIB_ORG=\$251C; -SDIB_LEN=\$54; - -SD_END=\$2170; -SD_LEN=\$16E; +; See MSP430FR5xxx.pat ; ============================================ ; FRAM MAIN ; ============================================ MAIN_ORG=\$4400; Code space start MAIN_LEN=\$BC00; 47 k FRAM -; ---------------------------------------------- -\#LIT=\#\$4400; asm CODE run time of LITERAL -\#XSQUOTE=\#\$4414; asm CODE run time of QUOTE -\#MUSMOD=\#\$4428; asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD -\#MDIV1DIV2=\#\$443A; asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/ -\#MDIV1=\#\$4442; asm CODE input for 48/16 unsigned division, see DOUBLE M*/ -\#RET_ADR=\#\$446C; asm CODE of INIT_SOFT_PFA and MARKER+8 definitions, -\#SETIB=\#\$446E; CODE Set Input Buffer with org & len values, reset >IN pointer -\#REFILL=\#\$447E; CODE accept one line from input and leave org len of input buffer -\#CIB_ORG=\#\$448A; [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG -\#QFBRAN=\#\$4496; CODE compiled by IF UNTIL -\#BRAN=\#\$449C; CODE compiled by ELSE REPEAT AGAIN -\#NEXT_ADR=\#\$449E; CODE NEXT instruction (MOV @IP+,PC) -\#XDODOES=\#\$44A0; to restore rDODOES: MOV #XDODOES,rDODOES -\#XDOCON=\#\$44AE; to restore rDOCON: MOV #XDOCON,rDOCON -; to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR -; to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL -\#INIT_FORTH=\#\$44BA; -\#ABORT_TERM=\#\$4500; CALL #ABORT_TERM to discard pending download -\#UART_WARM=\#\$4572; WARM address for UART TERMINAL -\#I2C_WARM=\#\$455C; WARM address for I2C TERMINAL ; See MSP430FRxxxx.pat for other addresses @@ -283,7 +113,6 @@ RST_VEC=\$FFFE; ; Special Fonction Registers (SFR) ; ============================================ - SFRIE1=\$100; \ SFR enable register SFRIFG1=\$102; \ SFR flag register SFRRPCR=\$104; \ SFR reset pin control diff --git a/inc/MSP430FR5972.pat b/inc/MSP430FR5972.pat index 499e2a4..f6331a2 100644 --- a/inc/MSP430FR5972.pat +++ b/inc/MSP430FR5972.pat @@ -1,7 +1,17 @@ @set-syntax{C;\;}! replace ! by semicolon + ;MSP430FR5972.pat, duplicated from MSP430fr6989.pat +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} + +@reset-syntax{}; enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FR5xxx.pat;}}} + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} + ; ---------------------------------------------- ; MSP430FR5972 MEMORY MAP ; ---------------------------------------------- @@ -49,197 +59,13 @@ INFO_LEN=\$0200; RAM_ORG=\$1C00; RAM_LEN=\$0800; -; --------------------------------------- -; FORTH RAM areas : -; --------------------------------------- - -; See MSP430FRxxxx.pat - -; ---------------------------------------------- -; FastForth RAM memory map (>= 1k): -; ---------------------------------------------- -LEAVEPTR=\$1C00; Leave-stack pointer, init by QUIT -LSATCK=\$1C00; leave stack, grow up -PSTACK=\$1C80; parameter stack, grow down -RSTACK=\$1CE0; Return stack, grow down -; -PAD_I2CADR=\$1CE0; RX I2C address -PAD_I2CCNT=\$1CE2; count max -PAD_ORG=\$1CE4; user scratch pad buffer, 84 bytes, grow up -; -TIB_I2CADR=\$1D38; TX I2C address -TIB_I2CCNT=\$1D3A; count of bytes -TIB_ORG=\$1D3C; Terminal input buffer, 84 bytes, grow up -; -HOLDS_ORG=\$1D90; base address for HOLDS -HOLD_BASE=\$1DB2; BASE HOLD area, grow down -; -HP=\$1DB2; HOLD ptr -STATEADR=\$1DB4; Interpreter state -BASEADR=\$1DB6; base -CAPS=\$1DB8; CAPS ON/OFF -SOURCE_LEN=\$1DBA; len of input stream -SOURCE_ORG=\$1DBC; adr of input stream -TOIN=\$1DBE; >IN -; -DP=\$1DC0; dictionary ptr -LASTVOC=\$1DC2; keep VOC-LINK -CURRENT=\$1DC4; CURRENT dictionnary ptr -CONTEXT=\$1DC6; CONTEXT dictionnary space (8 + Null CELLS) -; -; --------------------------------------- -; RAM_ORG + $1D8 : may be shared between FORTH compiler and user application -; --------------------------------------- -LAST_NFA=\$1DD8; -LAST_THREAD=\$1DDA; -LAST_CFA=\$1DDC; -LAST_PSP=\$1DDE; -ASMBW1=\$1DE0; 3 backward labels -ASMBW2=\$1DE2; -ASMBW3=\$1DE4; -ASMFW1=\$1DE6; 3 forward labels -ASMFW2=\$1DE8; -ASMFW3=\$1DEA; -; -; --------------------------------------- -; RAM_ORG + $1EC RAM free -; --------------------------------------- -; -; --------------------------------------- -; RAM_ORG + $1FC: SD buffer -; --------------------------------------- -SD_BUF_I2ADR=\$1DFC; -SD_BUF_I2CNT=\$1DFE; -SD_BUF=\$1E00; \ SD_Card buffer -BUFEND=\$2000; - -; --------------------------------------- -; FAT16 FileSystemInfos -; --------------------------------------- -FATtype=\$2002; -BS_FirstSectorL=\$2004; -BS_FirstSectorH=\$2006; -OrgFAT1=\$2008; -FATSize=\$200A; -OrgFAT2=\$200C; -OrgRootDir=\$200E; -OrgClusters=\$2010; Sector of Cluster 0 -SecPerClus=\$2012; - -; --------------------------------------- -; SD command -; --------------------------------------- -SD_CMD_FRM=\$2014; 6 bytes SD_CMDx inverted frame \${CRC,ll,LL,hh,HH,CMD} -SD_CMD_FRM0=\$2014; CRC:ll word access -SD_CMD_FRM1=\$2015; ll byte access -SD_CMD_FRM2=\$2016; LL:hh word access -SD_CMD_FRM3=\$2017; hh byte access -SD_CMD_FRM4=\$2018; HH:CMD word access -SD_CMD_FRM5=\$2019; CMD byte access -SectorL=\$201A; 2 words -SectorH=\$201C; - -; --------------------------------------- -; BUFFER management -; --------------------------------------- -BufferPtr=\$201E; -BufferLen=\$2020; - -; --------------------------------------- -; FAT entry -; --------------------------------------- -ClusterL=\$2022; 16 bits wide (FAT16) -ClusterH=\$2024; 16 bits wide (FAT16) -LastFATsector=\$2026; Set by FreeAllClusters, used by OPEN_OVERWRITE -LastFAToffset=\$2028; Set by FreeAllClusters, used by OPEN_OVERWRITE -FATsector=\$202A; used by APPEND" - -; --------------------------------------- -; DIR entry -; --------------------------------------- -DIRclusterL=\$202C; contains the Cluster of current directory ; 1 if FAT16 root directory -DIRclusterH=\$202E; contains the Cluster of current directory ; 1 if FAT16 root directory -EntryOfst=\$2030; - -; --------------------------------------- -; Handle Pointer -; --------------------------------------- -CurrentHdl=\$2032; contains the address of the last opened file structure, or 0 - -; --------------------------------------- -; Load file operation -; --------------------------------------- -pathname=\$2034; -EndOfPath=\$2036; - -; --------------------------------------- -; Handle structure -; --------------------------------------- -; three handle tokens : -; token = 0 : free handle -; token = 1 : file to read -; token = 2 : file updated (write) -; token =-1 : LOAD"ed file (source file) - -; offset values -HDLW_PrevHDL=0; previous handle ; used by LOAD" -HDLB_Token=2; token -HDLB_ClustOfst=3; Current sector offset in current cluster (Byte) -HDLL_DIRsect=4; Dir SectorL (Long) -HDLH_DIRsect=6; -HDLW_DIRofst=8; BUFFER offset of Dir entry -HDLL_FirstClus=10; File First ClusterLo (identify the file) -HDLH_FirstClus=12; File First ClusterHi (byte) -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 - - -;OpenedFirstFile ; "openedFile" structure -HandleMax=8; -HandleLenght=28; -FirstHandle=\$2038; -HandleEnd=\$2118; - -;SD_card Input Buffer -SDIB_I2CADR=\$2118; -SDIB_I2CCNT=\$211A; -SDIB_ORG=\$211C; -SDIB_LEN=\$54; - -SD_END=\$2170; -SD_LEN=\$16E; +; See MSP430FR5xxx.pat ; ---------------------------------------------- ; FRAM ; ---------------------------------------------- MAIN_ORG=\$4400; Code space start MAIN_LEN=\$24000; 127 k FRAM -; ---------------------------------------------- -\#LIT=\#\$4400; asm CODE run time of LITERAL -\#XSQUOTE=\#\$4414; asm CODE run time of QUOTE -\#MUSMOD=\#\$4428; asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD -\#MDIV1DIV2=\#\$443A; asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/ -\#MDIV1=\#\$4442; asm CODE input for 48/16 unsigned division, see DOUBLE M*/ -\#RET_ADR=\#\$446C; asm CODE of INIT_SOFT_PFA and MARKER+8 definitions, -\#SETIB=\#\$446E; CODE Set Input Buffer with org & len values, reset >IN pointer -\#REFILL=\#\$447E; CODE accept one line from input and leave org len of input buffer -\#CIB_ORG=\#\$448A; [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG -\#QFBRAN=\#\$4496; CODE compiled by IF UNTIL -\#BRAN=\#\$449C; CODE compiled by ELSE REPEAT AGAIN -\#NEXT_ADR=\#\$449E; CODE NEXT instruction (MOV @IP+,PC) -\#XDODOES=\#\$44A0; to restore rDODOES: MOV #XDODOES,rDODOES -\#XDOCON=\#\$44AE; to restore rDOCON: MOV #XDOCON,rDOCON -; to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR -; to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL -\#INIT_FORTH=\#\$44BA; -\#ABORT_TERM=\#\$4500; CALL #ABORT_TERM to discard pending download -\#UART_WARM=\#\$4572; WARM address for UART TERMINAL -\#I2C_WARM=\#\$455C; WARM address for I2C TERMINAL ; See MSP430FRxxxx.pat for other addresses diff --git a/inc/MSP430FR5994.pat b/inc/MSP430FR5994.pat index a7bdeda..5967d8e 100644 --- a/inc/MSP430FR5994.pat +++ b/inc/MSP430FR5994.pat @@ -1,6 +1,18 @@ @set-syntax{C;\;}! replace ! by semicolon + +; ======================== ;MSP430fr5994.pat +; ======================== + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FR5xxx.pat;}}} + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} ; ---------------------------------------------- ; MSP430FR5994 MEMORY MAP @@ -30,20 +42,17 @@ TinyRAM_LEN=\$16; ; ============================================ BSL1=\$1000; - ; ============================================ ; FRAM INFO ; ============================================ -INFO_ORG=\$1800; -INFO_LEN=\$0200; -; See MSP430FRxxxx.pat +; See MSP430FRxxxx.pat for defined addresses in FRAM INFO ; ============================================ ; FRAM TLV ; ============================================ -; See MSP430FRxxxx.pat +; See MSP430FRxxxx.pat for defined addresses in FRAM TLV ; ============================================ ; RAM @@ -53,204 +62,20 @@ RAM_LEN=\$1000; SharedRAM_ORG=\$2C00; SharedRAM_LEN=\$1000; -; --------------------------------------- -; FORTH RAM areas : -; --------------------------------------- - -; See MSP430FRxxxx.pat - -; ---------------------------------------------- -; FastForth RAM memory map (>= 1k): -; ---------------------------------------------- -LEAVEPTR=\$1C00; Leave-stack pointer, init by QUIT -LSATCK=\$1C00; leave stack, grow up -PSTACK=\$1C80; parameter stack, grow down -RSTACK=\$1CE0; Return stack, grow down -; -PAD_I2CADR=\$1CE0; RX I2C address -PAD_I2CCNT=\$1CE2; count max -PAD_ORG=\$1CE4; user scratch pad buffer, 84 bytes, grow up -; -TIB_I2CADR=\$1D38; TX I2C address -TIB_I2CCNT=\$1D3A; count of bytes -TIB_ORG=\$1D3C; Terminal input buffer, 84 bytes, grow up -; -HOLDS_ORG=\$1D90; base address for HOLDS -HOLD_BASE=\$1DB2; BASE HOLD area, grow down -; -HP=\$1DB2; HOLD ptr -STATEADR=\$1DB4; Interpreter state -BASEADR=\$1DB6; base -CAPS=\$1DB8; CAPS ON/OFF -SOURCE_LEN=\$1DBA; len of input stream -SOURCE_ORG=\$1DBC; adr of input stream -TOIN=\$1DBE; >IN -; -DP=\$1DC0; dictionary ptr -LASTVOC=\$1DC2; keep VOC-LINK -CURRENT=\$1DC4; CURRENT dictionnary ptr -CONTEXT=\$1DC6; CONTEXT dictionnary space (8 + Null CELLS) -; -; --------------------------------------- -; RAM_ORG + $1D8 : may be shared between FORTH compiler and user application -; --------------------------------------- -LAST_NFA=\$1DD8; -LAST_THREAD=\$1DDA; -LAST_CFA=\$1DDC; -LAST_PSP=\$1DDE; -ASMBW1=\$1DE0; 3 backward labels -ASMBW2=\$1DE2; -ASMBW3=\$1DE4; -ASMFW1=\$1DE6; 3 forward labels -ASMFW2=\$1DE8; -ASMFW3=\$1DEA; -; -; --------------------------------------- -; RAM_ORG + $1EC RAM free -; --------------------------------------- -; -; --------------------------------------- -; RAM_ORG + $1FC: SD buffer -; --------------------------------------- -SD_BUF_I2ADR=\$1DFC; -SD_BUF_I2CNT=\$1DFE; -SD_BUF=\$1E00; \ SD_Card buffer -BUFEND=\$2000; - -; --------------------------------------- -; FAT16 FileSystemInfos -; --------------------------------------- -FATtype=\$2002; -BS_FirstSectorL=\$2004; -BS_FirstSectorH=\$2006; -OrgFAT1=\$2008; -FATSize=\$200A; -OrgFAT2=\$200C; -OrgRootDir=\$200E; -OrgClusters=\$2010; Sector of Cluster 0 -SecPerClus=\$2012; - -; --------------------------------------- -; SD command -; --------------------------------------- -SD_CMD_FRM=\$2014; 6 bytes SD_CMDx inverted frame \${CRC,ll,LL,hh,HH,CMD} -SD_CMD_FRM0=\$2014; CRC:ll word access -SD_CMD_FRM1=\$2015; ll byte access -SD_CMD_FRM2=\$2016; LL:hh word access -SD_CMD_FRM3=\$2017; hh byte access -SD_CMD_FRM4=\$2018; HH:CMD word access -SD_CMD_FRM5=\$2019; CMD byte access -SectorL=\$201A; 2 words -SectorH=\$201C; - -; --------------------------------------- -; BUFFER management -; --------------------------------------- -BufferPtr=\$201E; -BufferLen=\$2020; - -; --------------------------------------- -; FAT entry -; --------------------------------------- -ClusterL=\$2022; 16 bits wide (FAT16) -ClusterH=\$2024; 16 bits wide (FAT16) -LastFATsector=\$2026; Set by FreeAllClusters, used by OPEN_OVERWRITE -LastFAToffset=\$2028; Set by FreeAllClusters, used by OPEN_OVERWRITE -FATsector=\$202A; used by APPEND" - -; --------------------------------------- -; DIR entry -; --------------------------------------- -DIRclusterL=\$202C; contains the Cluster of current directory ; 1 if FAT16 root directory -DIRclusterH=\$202E; contains the Cluster of current directory ; 1 if FAT16 root directory -EntryOfst=\$2030; - -; --------------------------------------- -; Handle Pointer -; --------------------------------------- -CurrentHdl=\$2032; contains the address of the last opened file structure, or 0 - -; --------------------------------------- -; Load file operation -; --------------------------------------- -pathname=\$2034; -EndOfPath=\$2036; - -; --------------------------------------- -; Handle structure -; --------------------------------------- -; three handle tokens : -; token = 0 : free handle -; token = 1 : file to read -; token = 2 : file updated (write) -; token =-1 : LOAD"ed file (source file) - -; offset values -HDLW_PrevHDL=0; previous handle ; used by LOAD" -HDLB_Token=2; token -HDLB_ClustOfst=3; Current sector offset in current cluster (Byte) -HDLL_DIRsect=4; Dir SectorL (Long) -HDLH_DIRsect=6; -HDLW_DIRofst=8; BUFFER offset of Dir entry -HDLL_FirstClus=10; File First ClusterLo (identify the file) -HDLH_FirstClus=12; File First ClusterHi (byte) -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 - - -;OpenedFirstFile ; "openedFile" structure -HandleMax=8; -HandleLenght=28; -FirstHandle=\$2038; -HandleEnd=\$2118; - -;SD_card Input Buffer -SDIB_I2CADR=\$2118; -SDIB_I2CCNT=\$211A; -SDIB_ORG=\$211C; -SDIB_LEN=\$54; - -SD_END=\$2170; -SD_LEN=\$16E; +; See MSP430FR5xxx.pat for defined addresses in RAM ; ============================================ ; FRAM MAIN ; ============================================ MAIN_ORG=\$4000; Code space start MAIN_LEN=\$40000; 240 kb FRAM -; ---------------------------------------------- -\#LIT=\#\$4000; asm CODE run time of LITERAL -\#XSQUOTE=\#\$4014; asm CODE run time of QUOTE -\#MUSMOD=\#\$4028; asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD -\#MDIV1DIV2=\#\$403A; asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/ -\#MDIV1=\#\$4042; asm CODE input for 48/16 unsigned division, see DOUBLE M*/ -\#RET_ADR=\#\$406C; asm CODE of INIT_SOFT_PFA and MARKER+8 definitions, -\#SETIB=\#\$406E; CODE Set Input Buffer with org & len values, reset >IN pointer -\#REFILL=\#\$407E; CODE accept one line from input and leave org len of input buffer -\#CIB_ORG=\#\$408A; [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG -\#QFBRAN=\#\$4096; CODE compiled by IF UNTIL -\#BRAN=\#\$409C; CODE compiled by ELSE REPEAT AGAIN -\#NEXT_ADR=\#\$409E; CODE NEXT instruction (MOV @IP+,PC) -\#XDODOES=\#\$40A0; to restore rDODOES: MOV #XDODOES,rDODOES -\#XDOCON=\#\$40AE; to restore rDOCON: MOV #XDOCON,rDOCON -; to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR -; to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL -\#INIT_FORTH=\#\$40BA; -\#ABORT_TERM=\#\$4100; CALL #ABORT_TERM to discard pending download -\#UART_WARM=\#\$4172; WARM address for UART TERMINAL -\#I2C_WARM=\#\$415C; WARM address for I2C TERMINAL - -; See MSP430FRxxxx.pat for defined addresses from FORTH definitions + +; See MSP430FRxxxx.pat for defined addresses in MAIN ; ---------------------------------------------- ; Interrupt Vectors and signatures - MSP430FR5994 ; ---------------------------------------------- -FRAM_FULL=\$FF40; 64 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 + WORD use. SIGNATURES=\$FF80; JTAG/BSL signatures JTAG_SIG1=\$FF80; if 0, enable JTAG/SBW JTAG_SIG2=\$FF82; if JTAG_SIG1=\$AAAA, length of password string @ JTAG_PASSWORD @@ -264,7 +89,7 @@ JTAG_PASSWORD=\$FF88; 256 bits max IPE_SIG_VALID=\$FF88; one word IPE_STR_PTR_SRC=\$FF8A; one word BSL_PASSWORD=\$FFE0; 256 bits -VECT_ORG=\0FFB4; FFB4-FFFF +VECT_ORG=\$FFB4; FFB4-FFFF VECT_LEN=\$4C; diff --git a/inc/MSP430FR5xxx.pat b/inc/MSP430FR5xxx.pat index 8fab9f6..ff242c4 100644 --- a/inc/MSP430FR5xxx.pat +++ b/inc/MSP430FR5xxx.pat @@ -5,9 +5,18 @@ ; ============================================ ; RAM ; ============================================ -;RAM_ORG=\$1C00; ; ---------------------------------------------- +; FORTH RAM areas : +; ---------------------------------------------- +LSTACK_SIZE=\#16; words +PSTACK_SIZE=\#48; words +RSTACK_SIZE=\#48; words +PAD_LEN=\#84; bytes +CIB_LEN=\#84; bytes +HOLD_SIZE=\#34; bytes +; +; ---------------------------------------------- ; FastForth RAM memory map (>= 1k): ; ---------------------------------------------- LEAVEPTR=\$1C00; Leave-stack pointer, init by QUIT @@ -29,42 +38,45 @@ HOLD_BASE=\$1DB2; BASE HOLD area, grow down HP=\$1DB2; HOLD ptr STATEADR=\$1DB4; Interpreter state BASEADR=\$1DB6; base -CAPS=\$1DB8; CAPS ON/OFF -SOURCE_LEN=\$1DBA; len of input stream -SOURCE_ORG=\$1DBC; adr of input stream -TOIN=\$1DBE; >IN +SOURCE_LEN=\$1DB8; len of input stream +SOURCE_ORG=\$1DBA; adr of input stream +TOIN=\$1DBC; >IN ; -DP=\$1DC0; dictionary ptr -LASTVOC=\$1DC2; keep VOC-LINK -CURRENT=\$1DC4; CURRENT dictionnary ptr -CONTEXT=\$1DC6; CONTEXT dictionnary space (8 + Null CELLS) +DP=\$1DBE; dictionary ptr +LASTVOC=\$1DC0; keep VOC-LINK +CURRENT=\$1DC2; CURRENT dictionnary ptr +CONTEXT=\$1DC4; CONTEXT dictionnary space (8 + Null CELLS) ; ; --------------------------------------- ; RAM_ORG + $1D8 : may be shared between FORTH compiler and user application ; --------------------------------------- -LAST_NFA=\$1DD8; -LAST_THREAD=\$1DDA; -LAST_CFA=\$1DDC; -LAST_PSP=\$1DDE; -ASMBW1=\$1DE0; 3 backward labels -ASMBW2=\$1DE2; -ASMBW3=\$1DE4; -ASMFW1=\$1DE6; 3 forward labels -ASMFW2=\$1DE8; -ASMFW3=\$1DEA; -; +LAST_NFA=\$1DD6; +LAST_THREAD=\$1DD8; +LAST_CFA=\$1DDA; +LAST_PSP=\$1DDC; +ASMBW1=\$1DDE; 3 backward labels +ASMBW2=\$1DE0; +ASMBW3=\$1DE2; +ASMFW1=\$1DE4; 3 forward labels +ASMFW2=\$1DE6; +ASMFW3=\$1DE8; ; --------------------------------------- -; RAM_ORG + $1EC RAM free +; RAM_ORG + $1EA RAM free ; --------------------------------------- ; ; --------------------------------------- +; RAM_ORG + $1FC: SD RAM +; --------------------------------------- +SD_ORG=\$21FC; +SD_LEN=\$374; + +; --------------------------------------- ; RAM_ORG + $1FC: SD buffer ; --------------------------------------- SD_BUF_I2ADR=\$1DFC; SD_BUF_I2CNT=\$1DFE; SD_BUF=\$1E00; \ SD_Card buffer -BUFEND=\$2000; - +SD_BUF_END=\$2000; ; --------------------------------------- ; FAT16 FileSystemInfos ; --------------------------------------- @@ -77,7 +89,6 @@ OrgFAT2=\$200C; OrgRootDir=\$200E; OrgClusters=\$2010; Sector of Cluster 0 SecPerClus=\$2012; - ; --------------------------------------- ; SD command ; --------------------------------------- @@ -90,13 +101,11 @@ SD_CMD_FRM4=\$2018; HH:CMD word access SD_CMD_FRM5=\$2019; CMD byte access SectorL=\$201A; 2 words SectorH=\$201C; - ; --------------------------------------- ; BUFFER management ; --------------------------------------- BufferPtr=\$201E; BufferLen=\$2020; - ; --------------------------------------- ; FAT entry ; --------------------------------------- @@ -105,25 +114,21 @@ ClusterH=\$2024; 16 bits wide (FAT16) LastFATsector=\$2026; Set by FreeAllClusters, used by OPEN_OVERWRITE LastFAToffset=\$2028; Set by FreeAllClusters, used by OPEN_OVERWRITE FATsector=\$202A; used by APPEND" - ; --------------------------------------- ; DIR entry ; --------------------------------------- DIRclusterL=\$202C; contains the Cluster of current directory ; 1 if FAT16 root directory DIRclusterH=\$202E; contains the Cluster of current directory ; 1 if FAT16 root directory EntryOfst=\$2030; - ; --------------------------------------- ; Handle Pointer ; --------------------------------------- CurrentHdl=\$2032; contains the address of the last opened file structure, or 0 - ; --------------------------------------- ; Load file operation ; --------------------------------------- pathname=\$2034; EndOfPath=\$2036; - ; --------------------------------------- ; Handle structure ; --------------------------------------- @@ -146,23 +151,21 @@ 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; interpret_buffer_LEN of previous handle +HDLW_PrevORG=26; interpret_buffer_ORG of previous handle +HDLW_PrevTOIN=28; interpret_buffer_PTR of previous handle +HDLW_PrevQYEMIT=30; echo state of previous handle ;OpenedFirstFile ; "openedFile" structure HandleMax=8; -HandleLenght=28; +HandleLenght=32; FirstHandle=\$2038; -HandleEnd=\$2118; +HandleEnd=\$2138; ;SD_card Input Buffer -SDIB_I2CADR=\$2118; -SDIB_I2CCNT=\$211A; -SDIB_ORG=\$211C; +SDIB_I2CADR=\$2138; +SDIB_I2CCNT=\$213A; +SDIB_ORG=\$213C; SDIB_LEN=\$54; - -SD_END=\$2170; -SD_LEN=\$16E; - diff --git a/inc/MSP430FR6989.pat b/inc/MSP430FR6989.pat index 1c856f7..1f375f3 100644 --- a/inc/MSP430FR6989.pat +++ b/inc/MSP430FR6989.pat @@ -1,7 +1,17 @@ @set-syntax{C;\;}! replace ! by semicolon + ;MSP430fr6989.pat +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};MSP430FR5xxx.pat;}}} + +@reset-syntax{}; to enable good interpreting of next line +@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} + ; ---------------------------------------------- ; MSP430FR6989 MEMORY MAP ; ---------------------------------------------- @@ -53,193 +63,13 @@ RAM_LEN=\$0800; ; FORTH RAM areas : ; --------------------------------------- -; See MSP430FRxxxx.pat - -; ---------------------------------------------- -; FastForth RAM memory map (>= 1k): -; ---------------------------------------------- -LEAVEPTR=\$1C00; Leave-stack pointer, init by QUIT -LSATCK=\$1C00; leave stack, grow up -PSTACK=\$1C80; parameter stack, grow down -RSTACK=\$1CE0; Return stack, grow down -; -PAD_I2CADR=\$1CE0; RX I2C address -PAD_I2CCNT=\$1CE2; count max -PAD_ORG=\$1CE4; user scratch pad buffer, 84 bytes, grow up -; -TIB_I2CADR=\$1D38; TX I2C address -TIB_I2CCNT=\$1D3A; count of bytes -TIB_ORG=\$1D3C; Terminal input buffer, 84 bytes, grow up -; -HOLDS_ORG=\$1D90; base address for HOLDS -HOLD_BASE=\$1DB2; BASE HOLD area, grow down -; -HP=\$1DB2; HOLD ptr -STATEADR=\$1DB4; Interpreter state -BASEADR=\$1DB6; base -CAPS=\$1DB8; CAPS ON/OFF -SOURCE_LEN=\$1DBA; len of input stream -SOURCE_ORG=\$1DBC; adr of input stream -TOIN=\$1DBE; >IN -; -DP=\$1DC0; dictionary ptr -LASTVOC=\$1DC2; keep VOC-LINK -CURRENT=\$1DC4; CURRENT dictionnary ptr -CONTEXT=\$1DC6; CONTEXT dictionnary space (8 + Null CELLS) -; -; --------------------------------------- -; RAM_ORG + $1D8 : may be shared between FORTH compiler and user application -; --------------------------------------- -LAST_NFA=\$1DD8; -LAST_THREAD=\$1DDA; -LAST_CFA=\$1DDC; -LAST_PSP=\$1DDE; -ASMBW1=\$1DE0; 3 backward labels -ASMBW2=\$1DE2; -ASMBW3=\$1DE4; -ASMFW1=\$1DE6; 3 forward labels -ASMFW2=\$1DE8; -ASMFW3=\$1DEA; -; -; --------------------------------------- -; RAM_ORG + $1EC RAM free -; --------------------------------------- -; -; --------------------------------------- -; RAM_ORG + $1FC: SD buffer -; --------------------------------------- -SD_BUF_I2ADR=\$1DFC; -SD_BUF_I2CNT=\$1DFE; -SD_BUF=\$1E00; \ SD_Card buffer -BUFEND=\$2000; - -; --------------------------------------- -; FAT16 FileSystemInfos -; --------------------------------------- -FATtype=\$2002; -BS_FirstSectorL=\$2004; -BS_FirstSectorH=\$2006; -OrgFAT1=\$2008; -FATSize=\$200A; -OrgFAT2=\$200C; -OrgRootDir=\$200E; -OrgClusters=\$2010; Sector of Cluster 0 -SecPerClus=\$2012; - -; --------------------------------------- -; SD command -; --------------------------------------- -SD_CMD_FRM=\$2014; 6 bytes SD_CMDx inverted frame \${CRC,ll,LL,hh,HH,CMD} -SD_CMD_FRM0=\$2014; CRC:ll word access -SD_CMD_FRM1=\$2015; ll byte access -SD_CMD_FRM2=\$2016; LL:hh word access -SD_CMD_FRM3=\$2017; hh byte access -SD_CMD_FRM4=\$2018; HH:CMD word access -SD_CMD_FRM5=\$2019; CMD byte access -SectorL=\$201A; 2 words -SectorH=\$201C; - -; --------------------------------------- -; BUFFER management -; --------------------------------------- -BufferPtr=\$201E; -BufferLen=\$2020; - -; --------------------------------------- -; FAT entry -; --------------------------------------- -ClusterL=\$2022; 16 bits wide (FAT16) -ClusterH=\$2024; 16 bits wide (FAT16) -LastFATsector=\$2026; Set by FreeAllClusters, used by OPEN_OVERWRITE -LastFAToffset=\$2028; Set by FreeAllClusters, used by OPEN_OVERWRITE -FATsector=\$202A; used by APPEND" - -; --------------------------------------- -; DIR entry -; --------------------------------------- -DIRclusterL=\$202C; contains the Cluster of current directory ; 1 if FAT16 root directory -DIRclusterH=\$202E; contains the Cluster of current directory ; 1 if FAT16 root directory -EntryOfst=\$2030; - -; --------------------------------------- -; Handle Pointer -; --------------------------------------- -CurrentHdl=\$2032; contains the address of the last opened file structure, or 0 - -; --------------------------------------- -; Load file operation -; --------------------------------------- -pathname=\$2034; -EndOfPath=\$2036; - -; --------------------------------------- -; Handle structure -; --------------------------------------- -; three handle tokens : -; token = 0 : free handle -; token = 1 : file to read -; token = 2 : file updated (write) -; token =-1 : LOAD"ed file (source file) - -; offset values -HDLW_PrevHDL=0; previous handle ; used by LOAD" -HDLB_Token=2; token -HDLB_ClustOfst=3; Current sector offset in current cluster (Byte) -HDLL_DIRsect=4; Dir SectorL (Long) -HDLH_DIRsect=6; -HDLW_DIRofst=8; BUFFER offset of Dir entry -HDLL_FirstClus=10; File First ClusterLo (identify the file) -HDLH_FirstClus=12; File First ClusterHi (byte) -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 - - -;OpenedFirstFile ; "openedFile" structure -HandleMax=8; -HandleLenght=28; -FirstHandle=\$2038; -HandleEnd=\$2118; - -;SD_card Input Buffer -SDIB_I2CADR=\$2118; -SDIB_I2CCNT=\$211A; -SDIB_ORG=\$211C; -SDIB_LEN=\$54; - -SD_END=\$2170; -SD_LEN=\$16E; +; See MSP430FR5xxx.pat ; ---------------------------------------------- ; FRAM ; ---------------------------------------------- MAIN_ORG=\$4400; Code space start MAIN_LEN=\$24000; 127 k FRAM -; ---------------------------------------------- -\#LIT=\#\$4400; asm CODE run time of LITERAL -\#XSQUOTE=\#\$4414; asm CODE run time of QUOTE -\#MUSMOD=\#\$4428; asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD -\#MDIV1DIV2=\#\$443A; asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/ -\#MDIV1=\#\$4442; asm CODE input for 48/16 unsigned division, see DOUBLE M*/ -\#RET_ADR=\#\$446C; asm CODE of INIT_SOFT_PFA and MARKER+8 definitions, -\#SETIB=\#\$446E; CODE Set Input Buffer with org & len values, reset >IN pointer -\#REFILL=\#\$447E; CODE accept one line from input and leave org len of input buffer -\#CIB_ORG=\#\$448A; [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG -\#QFBRAN=\#\$4496; CODE compiled by IF UNTIL -\#BRAN=\#\$449C; CODE compiled by ELSE REPEAT AGAIN -\#NEXT_ADR=\#\$449E; CODE NEXT instruction (MOV @IP+,PC) -\#XDODOES=\#\$44A0; to restore rDODOES: MOV #XDODOES,rDODOES -\#XDOCON=\#\$44AE; to restore rDOCON: MOV #XDOCON,rDOCON -; to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR -; to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL -\#INIT_FORTH=\#\$44BA; -\#ABORT_TERM=\#\$4500; CALL #ABORT_TERM to discard pending download -\#UART_WARM=\#\$4572; WARM address for UART TERMINAL -\#I2C_WARM=\#\$455C; WARM address for I2C TERMINAL ; See MSP430FRxxxx.pat for other addresses diff --git a/inc/MSP430FRxxxx.pat b/inc/MSP430FRxxxx.pat index 7bf96b7..fe4dc8d 100644 --- a/inc/MSP430FRxxxx.pat +++ b/inc/MSP430FRxxxx.pat @@ -1,11 +1,14 @@ @set-syntax{C;\;}! tell GEMA to replace default Comment separator '!' by ';' + ;MSP430FRxxxx.pat +;FAST_FORTH V4.1 ; ============================================ ; FRAM INFO ; ============================================ -; INFO_ORG=\$1800; +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 @@ -32,63 +35,64 @@ LF_XTAL=\$4000; BIT14=LF_XTAL ; BIT8=Q15.16 input ; BIT7=DOUBLE input ; BIT6=assembler 20 bits -; BIT5=assembler 16 bits -; BIT4=assembler 16 bits with 20 bits addr -HMPY=8; BIT3=hardware MPY +; BIT5=assembler 16 bits with 20 bits addr +HMPY=\$10; BIT4=hardware MPY +; BIT3= ; BIT2= ; BIT1= ; BIT0= ; ---------------------------------------------- -DEEP_ORG=\$1810; MOV #DEEP_ORG,X -; ---------------------------------------------- -DEEP_TERM_VEC=\$1810; address of default TERMINAL vector -DEEP_STOP=\$1812; address of default STOP_APP -DEEP_SOFT=\$1814; address of default SOFT_APP -DEEP_HARD=\$1816; address of default HARD_APP -DEEP_BACKGRND=\$1818; address of default BACKGRND_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 -; +DEEP_ORG=\$1810; MOV #DEEP_ORG,X TERMINAL +; ---------------------------------------------- UART I2C +DEEP_TERM_VEC=\$1810; address of default TERMINAL vect.--> UCAx UCBx +DEEP_STOP=\$1812; address of default STOP_APP --> TX_IDLE RET +DEEP_ABORT=\$1814; address of default ABORT_APP: --> ABORT_TERM +DEEP_SOFT=\$1816; address of default SOFT_APP: --> RET +DEEP_HARD=\$1818; address of default HARD_APP: --> INIT_TERM +DEEP_BACKGRND=\$181A; address of default BACKGRND_APP: --> RX_ON I2C_ACCEPT +DEEP_DP=\$181C; to DEEP_INIT RST_DP +DEEP_LASTVOC=\$181E; to DEEP_INIT RST_LASTVOC +DEEP_CURRENT=\$1820; to DEEP_INIT RST_CURRENT +DEEP_CONTEXT=\$1822; to DEEP_INIT RST_CONTEXT +; NULL_WORD ; ---------------------------------------------- -PUC_ABORT_ORG=\$1822; MOV #PUC_ABORT_ORG,X +PUC_ABORT_ORG=\$1826; 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_ACCEPT=\$1826; to INIT PFA_ACCEPT +INIT_EMIT=\$1828; to INIT PFA_EMIT +INIT_KEY=\$182A; to INIT PFA_KEY +INIT_CIB=\$182C; to INIT CIB_ORG ; ; ---------------------------------------------- -FORTH_ORG=\$182A; MOV #FORTH_ORG,X \to preserve the state of DEFERed words +FORTH_ORG=\$182E; MOV #FORTH_ORG,X ; ---------------------------------------------- -INIT_RSP=\$182A; to INIT RSP +INIT_RSP=\$182E; to INIT RSP ; ---------------------------------------------- -INIT_DOXXX=\$182C; MOV #INIT_DOXXX,X \ to restore DOxxx registers +INIT_DOXXX=\$1830; MOV #INIT_DOXXX,X ; ---------------------------------------------- -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 +INIT_DOCOL=\$1830; to INIT rDOCOL (R4) +INIT_DODOES=\$1832; to INIT rDODOES (R5) +INIT_DOCON=\$1834; to INIT rDOCON (R6) +INIT_DOVAR=\$1836; to INIT rDOVAR (R7) +INIT_BASE=\$1838; to INIT BASE +INIT_LEAVE=\$183A; to INIT LEAVEPTR ; ; ---------------------------------------------- -RST_ORG=\$183A; -RST_LEN=\$10; 16 bytes +RST_ORG=\$183C; +RST_LEN=\$14; 20 bytes ; ---------------------------------------------- -STOP_APP=\$183A; address of current STOP_APP -SOFT_APP=\$183C; address of current SOFT_APP -HARD_APP=\$183E; address of current HARD_APP -BACKGRND_APP=\$1840; address of current BACKGRND_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) +STOP_APP=\$183C; address of current STOP_APP +ABORT_APP=\$183E; address of current ABORT_APP +SOFT_APP=\$1840; address of current SOFT_APP +HARD_APP=\$1842; address of current HARD_APP +BACKGRND_APP=\$1844; address of current BACKGRND_APP +RST_DP=\$1846; RST_RET value for (RAM) DDP +RST_LASTVOC=\$1848; RST_RET value for (RAM) LASTVOC +RST_CURRENT=\$184A; RST_RET value for (RAM) CURRENT +RST_CONTEXT=\$184C; RST_RET value for (RAM) CONTEXT (8 CELLS) + NULL_WORD ; ; =============================================== -; FAST FORTH V 4.0: FRAM usage, INFO space free from $185A to $19FF +; FAST FORTH V 4.0: FRAM usage, INFO space free from $1860 to $19FF ; =============================================== ; ; ============================================ @@ -99,33 +103,42 @@ TLV_LEN=\$0100; DEVICEID=\$1A04; ; ============================================ -; FORTH RAM areas : -; ============================================ -LSTACK_SIZE=\#16; words -PSTACK_SIZE=\#48; words -RSTACK_SIZE=\#48; words -PAD_LEN=\#84; bytes -CIB_LEN=\#84; bytes -HOLD_SIZE=\#34; bytes - -; ============================================ ; FRAM MAIN ; ============================================ ; to use in ASSEMBLER mode -; see device.pat for other addresses - -I2C_CTRL=KEY\+\$0A; used as is: MOV.B #,Y +; +\#INIT_FORTH=\#\!+8; common QABORT_YES|WARM subroutine used to init FORTH and its interpreter +\#ABORT_TERM=\#\!+\$3C; CALL #ABORT_TERM to discard pending TERMINAL download +\#TOS2WARM=\#SYS+\$0E; CALL #TOS2WARM to do WARM with TOS value +TOS2WARM=\' SYS \$0E + +\#TOS2COLD=\#SYS+\$14; CALL #TOS2COLD to do COLD with TOS value +TOS2COLD=\' SYS \$14 + +\#I2C_CTRL=\#KEY+\$0A; used as is: MOV.B #,Y ; CALL #I2C_CTRL -\#UART_RXON=\#KEY\+8; CALL #UART_RXON -\#UART_RXOFF=\#ACCEPT\+\$26; CALL #UART_RXOFF -\#BACKGRND=\#ACCEPT\+\$1C; MOV #BACKGRND,PC -\#STOP_APP=\&SYS\+2; CALL #STOP_APP -\#TOS2WARM=\#SYS\+\$0E; CALL #TOS2WARM WARM with TOS value -\#WARM_IP_ADR=\#SYS\+\$12; MOV #WARM_IP_ADR,IP -\#TOS2COLD=\#SYS\+\$14; CALL #TOS2COLD COLD with TOS value -INTERPRET=\\+\$08; address used in CORE_ANS.f -\#ABORT=\#ALLOT\+\$08; MOV #ABORT,PC used in CORE_ANS.f -\#QUIT=\#ALLOT\+\$0E; MOV #QUIT,PC used in CORE_ANS.f -\#D\.=\#U\.+\$0A; MOV #D.,PC used in DOUBLE.f -\#Read_File=\&READ\+\$0C; CALL #Read_File, sequentially load a sector in SD_BUF -\#Write_File=\#WRITE\+4; CALL #Write_File, sequentially write SD_BUF in a sector +\#UART_RXON=\#KEY+8; CALL #UART_RXON +\#UART_RXOFF=\#ACCEPT+\$26; CALL #UART_RXOFF +\#BACKGRND=\#ACCEPT+\$1C; MOV #BACKGRND,PC +\#NEXT_ADR=\#\[THEN\]; FORTH CODE NEXT instruction (MOV @IP+,PC) +\#LIT=\#\[THEN\]+2; asm CODE run time of LITERAL +\#XSQUOTE=\#\[THEN\]+\$16; asm CODE run time of QUOTE +\#SETIB=\#\[THEN\]+\$2A; FORTH CODE Set Input Buffer with org & len values, reset >IN pointer +\#REFILL=\#\[THEN\]+\$3A; FORTH CODE accept one line from input and leave org len of input buffer +\#CIB_ORG=\#\[THEN\]+\$46; [CIB_ORG] = TIB_ORG by default; may be redirected to SDIB_ORG +\#QFBRAN=\#\[THEN\]+\$52; FORTH CODE compiled by IF UNTIL +\#BRAN=\#\[THEN\]+\$58; FORTH CODE compiled by ELSE REPEAT AGAIN +\#XDODOES=\#\[THEN\]+\$5C; to restore rDODOES: MOV #XDODOES,rDODOES +\#XDOCON=\#\[THEN\]+\$6A; to restore rDOCON: MOV #XDOCON,rDOCON +\#XDOVAR=\&\$1836; to restore rDOVAR: MOV &INIT_DOVAR,rDOVAR +\#XDOCOL=\&\$1830; to restore rDOCOL: MOV &INIT_DOCOL,rDOCOL +\#MUSMOD=\#\<\#+8; asm CODE 32/16 unsigned division, used by ?NUMBER, UM/MOD +\#MDIV1DIV2=\#\<\#+\$1A; asm CODE input for 48/16 unsigned division with DVDhi=0, see DOUBLE M*/ +\#MDIV1=\#\<\#+\$22; asm CODE input for 48/16 unsigned division, see DOUBLE M*/ +\#RET_ADR=\#\<\#+\$4C; asm CODE used by MARKER +\#D\.=\#U\.+\$0A; MOV #D.,PC used in DOUBLE.f +\#BL_WORD=\#WORD+2; +\#INTERPRET=\#\\+8; MOV #INTERPRET,PC used in CORE_ANS.f +\#EXECUTE=\#\\+\$28; MOV #EXECUTE,PC used in CORE_ANS.f +\#ABORT=\#ALLOT+8; MOV #ABORT,PC used in CORE_ANS.f +\#QUIT=\#ALLOT+\$0E; MOV #QUIT,PC used in CORE_ANS.f +\#Read_File=\&READ+\$0C; CALL #Read_File, sequentially load a sector in SD_BUF +\#Write_File=\#WRITE+\$4; CALL #Write_File, sequentially write SD_BUF in a sector diff --git a/inc/MSP_EXP430FR2355.asm b/inc/MSP_EXP430FR2355.asm index 034bd7d..8e42204 100644 --- a/inc/MSP_EXP430FR2355.asm +++ b/inc/MSP_EXP430FR2355.asm @@ -251,7 +251,7 @@ LED2 .equ 40h ; P6.6 LED2 green ; MOV #0100h,&CSCTL4 ; ACLOCK select REFOCLK, MCLK & SMCLK select DCOCLKDIV (default value) .ENDIF BIC.B #-1,&CSCTL1 ; clear DCORSEL (Set 1MHZ DCORSEL), DCOFTRIM=0, ENable MODulation to reduce EMI - .IF FREQUENCY = 1 ; nothing else to do + .IF FREQUENCY = 1 ; nothing else to do .ELSEIF FREQUENCY = 2 BIS.B #2,&CSCTL1 ; Set 2MHZ DCORSEL .ELSEIF FREQUENCY = 4 diff --git a/inc/MSP_EXP430FR2355.pat b/inc/MSP_EXP430FR2355.pat index e5166e6..a5cd41f 100644 --- a/inc/MSP_EXP430FR2355.pat +++ b/inc/MSP_EXP430FR2355.pat @@ -1,5 +1,6 @@ @set-syntax{C;\;}! tell GEMA to replace default Comment separator '!' by ';' + ; ======================== ; MSP_EXP430FR2355.pat ; ======================== @@ -14,12 +15,7 @@ ; ====================================================================== ; MSP430FR2355 Config ; ====================================================================== -@reset-syntax{}; enable good interpreting of next line -@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} -@reset-syntax{}; enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} -@reset-syntax{}; enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FR2xxx.pat;}}} + @reset-syntax{}; enable good interpreting of next line @define{@read{@mergepath{@inpath{};MSP430FR2355.pat;}}} @@ -284,10 +280,16 @@ INT_IN_IFG=\$21C; P1IFG INT_IN_VEC=\$FFD4; P1VEC ;local variables +OLD_STOP_APP=\{UARTI2CS\}; +OLD_HARD_APP=\{UARTI2CS\}\+2; +OLD_BACKGRND_APP=\{UARTI2CS\}\+4; +OLD_TERM_VEC=\{UARTI2CS\}+6; <-- TERM_VEC +OLD_INT_IN_VEC=\{UARTI2CS\}+8; <-- INT_IN_VEC UARTI2CS_ADR=\{UARTI2CS\}\+10; <-- I2C_Slave_Addr<<1 TIMER_CONF=\{UARTI2CS\}\+12; <-- TIM_CTL configuration COLLISION_DLY=\{UARTI2CS\}\+14; <-- 20 us resolution delay after I2C collision DUPLEX_MODE=\{UARTI2CS\}\+15; <-- flag = 4 --> NOECHO, <> 4 --> ECHO, -1 = I2C link lost + ; ============================================ ; RC5toLCD APPLICATION ; ============================================ diff --git a/inc/MSP_EXP430FR2433.pat b/inc/MSP_EXP430FR2433.pat index 1c8ecbb..fef7bb1 100644 --- a/inc/MSP_EXP430FR2433.pat +++ b/inc/MSP_EXP430FR2433.pat @@ -1,5 +1,6 @@ @set-syntax{C;\;}! replace ! by semicolon + ; MSP_EXP430FR2433.pat ; \.f=\.4th for MSP_EXP430FR2433; to change file type @@ -9,17 +10,13 @@ ; ======================== \\*\n= \s\\*\n=\n + ; ====================================================================== ; MSP430FR2433 Config ; ====================================================================== + @reset-syntax{}; to enable good interpreting of next line @define{@read{@mergepath{@inpath{};MSP430FR2433.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} -@reset-syntax{}; enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FR2xxx.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} ; ====================================================================== ; INIT MSP-EXP430FR2433 board @@ -228,10 +225,16 @@ INT_IN_IFG=\$21C; P1IFG INT_IN_VEC=\$FFDC; P1VEC ;local variables +OLD_STOP_APP=\{UARTI2CS\}; +OLD_HARD_APP=\{UARTI2CS\}\+2; +OLD_BACKGRND_APP=\{UARTI2CS\}\+4; +OLD_TERM_VEC=\{UARTI2CS\}+6; <-- TERM_VEC +OLD_INT_IN_VEC=\{UARTI2CS\}+8; <-- INT_IN_VEC UARTI2CS_ADR=\{UARTI2CS\}\+10; <-- I2C_Slave_Addr<<1 TIMER_CONF=\{UARTI2CS\}\+12; <-- TIM_CTL configuration COLLISION_DLY=\{UARTI2CS\}\+14; <-- 20 us resolution delay after I2C collision DUPLEX_MODE=\{UARTI2CS\}\+15; <-- flag = 4 --> NOECHO, <> 4 --> ECHO, -1 = I2C link lost + ; -------------------------------------------- ;I2C_Soft_Multi_Master diff --git a/inc/MSP_EXP430FR4133.pat b/inc/MSP_EXP430FR4133.pat index 2f7317d..9cc536d 100644 --- a/inc/MSP_EXP430FR4133.pat +++ b/inc/MSP_EXP430FR4133.pat @@ -1,5 +1,6 @@ @set-syntax{C;\;}! replace ! by semicolon + ; MSP_EXP430FR4133.pat ; \.f=\.4th for MSP_EXP430FR4133; to change file type @@ -11,14 +12,9 @@ ; ====================================================================== ; MSP430FR4133 Config ; ====================================================================== + @reset-syntax{}; to enable good interpreting of next line @define{@read{@mergepath{@inpath{};MSP430FR4133.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} -@reset-syntax{}; enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FR2xxx.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} ; ====================================================================== ; MSP_EXP430FR4133 board @@ -299,10 +295,16 @@ INT_IN_IFG=\$21C; P1IFG INT_IN_VEC=\$FFE6; P1VEC ;local variables +OLD_STOP_APP=\{UARTI2CS\}; +OLD_HARD_APP=\{UARTI2CS\}\+2; +OLD_BACKGRND_APP=\{UARTI2CS\}\+4; +OLD_TERM_VEC=\{UARTI2CS\}+6; <-- TERM_VEC +OLD_INT_IN_VEC=\{UARTI2CS\}+8; <-- INT_IN_VEC UARTI2CS_ADR=\{UARTI2CS\}\+10; <-- I2C_Slave_Addr<<1 TIMER_CONF=\{UARTI2CS\}\+12; <-- TIM_CTL configuration COLLISION_DLY=\{UARTI2CS\}\+14; <-- 20 us resolution delay after I2C collision DUPLEX_MODE=\{UARTI2CS\}\+15; <-- flag = 4 --> NOECHO, <> 4 --> ECHO, -1 = I2C link lost + ; -------------------------------------------- ; ============================================ diff --git a/inc/MSP_EXP430FR5739.asm b/inc/MSP_EXP430FR5739.asm index 475ea35..eda940a 100644 --- a/inc/MSP_EXP430FR5739.asm +++ b/inc/MSP_EXP430FR5739.asm @@ -285,15 +285,7 @@ LED2 .equ 2 ; PJ.1 LED2 blue MOV.B #CSKEY,&CSCTL0_H ; Unlock CS registers - .IF FREQUENCY = 0.25 -; MOV #DCOFSEL1+DCOFSEL0,&CSCTL1 ; Set 8MHZ DCO setting (default value) - MOV #DIVA_0 + DIVS_32 + DIVM_32,&CSCTL3 - - .ELSEIF FREQUENCY = 0.5 -; MOV #DCOFSEL1+DCOFSEL0,&CSCTL1 ; Set 8MHZ DCO setting (default value) - MOV #DIVA_0 + DIVS_16 + DIVM_16,&CSCTL3 - - .ELSEIF FREQUENCY = 1 + .IF FREQUENCY = 1 ; MOV #DCOFSEL1+DCOFSEL0,&CSCTL1 ; Set 8MHZ DCO setting (default value) MOV #DIVA_0 + DIVS_8 + DIVM_8,&CSCTL3 @@ -331,7 +323,7 @@ LED2 .equ 2 ; PJ.1 LED2 blue MOV #DIVA_0 + DIVS_0 + DIVM_0,&CSCTL3 ; set all dividers as 0 .ELSEIF - .error "bad frequency setting, only 0.25,0.5,1,2,4,8,12,16,20,24 MHz" + .error "bad frequency setting, only 1,2,4,8,12,16,20,24 MHz" .ENDIF .IFDEF LF_XTAL diff --git a/inc/MSP_EXP430FR5739.pat b/inc/MSP_EXP430FR5739.pat index b6e9000..1ddfc3c 100644 --- a/inc/MSP_EXP430FR5739.pat +++ b/inc/MSP_EXP430FR5739.pat @@ -1,5 +1,6 @@ @set-syntax{C;\;}! replace ! by semicolon + ; MSP_EXP430FR5739.pat ; \.f=\.4th for MSP_EXP430FR5739; to change file type @@ -12,14 +13,9 @@ ; ====================================================================== ; MSP430FR5739 Config ; ====================================================================== + @reset-syntax{}; to enable good interpreting of next line @define{@read{@mergepath{@inpath{};MSP430FR5739.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} -@reset-syntax{}; enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FR57xx.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} ; ; ====================================================================== ; MSP_EXP430FR5739 board @@ -285,10 +281,16 @@ INT_IN_IFG=\$21C; P1IFG INT_IN_VEC=\$FFDE; P1VEC ;local variables -UARTI2CS_ADR=\{UARTI2CS\}\+10; <-- I2C_Slave_Addr<<1 -TIMER_CONF=\{UARTI2CS\}\+12; <-- TIM_CTL configuration -COLLISION_DLY=\{UARTI2CS\}\+14; <-- 20 us resolution delay after I2C collision -DUPLEX_MODE=\{UARTI2CS\}\+15; <-- flag = 4 --> NOECHO, <> 4 --> ECHO, -1 = I2C link lost +OLD_STOP_APP=\{UARTI2CS\}; +OLD_HARD_APP=\{UARTI2CS\}\+\$2; +OLD_BACKGRND_APP=\{UARTI2CS\}\+\$4; +OLD_TERM_VEC=\{UARTI2CS\}+\$6; <-- TERM_VEC +OLD_INT_IN_VEC=\{UARTI2CS\}+\$8; <-- INT_IN_VEC +UARTI2CS_ADR=\{UARTI2CS\}\+\$0A; <-- I2C_Slave_Addr<<1 +TIMER_CONF=\{UARTI2CS\}\+\$0C; <-- TIM_CTL configuration +COLLISION_DLY=\{UARTI2CS\}\+\$0E; <-- 20 us resolution delay after I2C collision +DUPLEX_MODE=\{UARTI2CS\}\+\$0F; <-- flag = 4 --> NOECHO, <> 4 --> ECHO, -1 = I2C link lost + ; ============================================ ; RC5toLCD APPLICATION ; ============================================ diff --git a/inc/MSP_EXP430FR5969.asm b/inc/MSP_EXP430FR5969.asm index 98f39b3..61aa387 100644 --- a/inc/MSP_EXP430FR5969.asm +++ b/inc/MSP_EXP430FR5969.asm @@ -296,15 +296,7 @@ LED1 .equ 40h ; P4.6 LED1 red ; DCOCLK: Internal digitally controlled oscillator (DCO). MOV.B #CSKEY,&CSCTL0_H ; Unlock CS registers - .IF FREQUENCY = 0.25 -; MOV #DCOFSEL1+DCOFSEL0,&CSCTL1 ; Set 8MHZ DCO setting (default value) - MOV #DIVA_0 + DIVS_32 + DIVM_32,&CSCTL3 - - .ELSEIF FREQUENCY = 0.5 - MOV #0,&CSCTL1 ; Set 1MHZ DCO setting - MOV #DIVA_2 + DIVS_2 + DIVM_2,&CSCTL3 ; set all dividers as 2 - - .ELSEIF FREQUENCY = 1 + .IF FREQUENCY = 1 MOV #0,&CSCTL1 ; Set 1MHZ DCO setting MOV #DIVA_0 + DIVS_0 + DIVM_0,&CSCTL3 ; set all dividers as 0 @@ -329,7 +321,7 @@ LED1 .equ 40h ; P4.6 LED1 red MOV #DIVA_0 + DIVS_0 + DIVM_0,&CSCTL3 ; set all dividers as 0 .ELSEIF - .error "bad frequency setting, only 0.5,1,2,4,8,12,16 MHz" + .error "bad frequency setting, only 1,2,4,8,12,16 MHz" .ENDIF .IFDEF LF_XTAL diff --git a/inc/MSP_EXP430FR5969.pat b/inc/MSP_EXP430FR5969.pat index e834ed0..3eae178 100644 --- a/inc/MSP_EXP430FR5969.pat +++ b/inc/MSP_EXP430FR5969.pat @@ -1,24 +1,22 @@ @set-syntax{C;\;}! replace ! by semicolon + ; MSP_EXP430FR5969.pat ; \.f=\.4th for MSP_EXP430FR5969; to change file type + ; ======================== ; remove comments ; ======================== \\*\n= \s\\*\n=\n + ; ====================================================================== ; MSP430FR5969 Config ; ====================================================================== + @reset-syntax{}; to enable good interpreting of next line @define{@read{@mergepath{@inpath{};MSP430FR5969.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} -@reset-syntax{}; enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FR5xxx.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} ; ====================================================================== ; MSP_EXP430FR5969 board @@ -337,10 +335,16 @@ INT_IN_IFG=\$23C; P3IFG INT_IN_VEC=\$FFD2; P3VEC ;local variables +OLD_STOP_APP=\{UARTI2CS\}; +OLD_HARD_APP=\{UARTI2CS\}\+2; +OLD_BACKGRND_APP=\{UARTI2CS\}\+4; +OLD_TERM_VEC=\{UARTI2CS\}+6; <-- TERM_VEC +OLD_INT_IN_VEC=\{UARTI2CS\}+8; <-- INT_IN_VEC UARTI2CS_ADR=\{UARTI2CS\}\+10; <-- I2C_Slave_Addr<<1 TIMER_CONF=\{UARTI2CS\}\+12; <-- TIM_CTL configuration COLLISION_DLY=\{UARTI2CS\}\+14; <-- 20 us resolution delay after I2C collision DUPLEX_MODE=\{UARTI2CS\}\+15; <-- flag = 4 --> NOECHO, <> 4 --> ECHO, -1 = I2C link lost + ; ============================================ ; RC5toLCD APPLICATION ; ============================================ diff --git a/inc/MSP_EXP430FR5972.asm b/inc/MSP_EXP430FR5972.asm index c5e7f4e..417c476 100644 --- a/inc/MSP_EXP430FR5972.asm +++ b/inc/MSP_EXP430FR5972.asm @@ -349,15 +349,7 @@ LED2 .equ 80h ; P9.7 LED2 green ; DCOCLK: Internal digitally controlled oscillator (DCO). MOV.B #CSKEY,&CSCTL0_H ; Unlock CS registers - .IF FREQUENCY = 0.25 -; MOV #DCOFSEL1+DCOFSEL0,&CSCTL1 ; Set 8MHZ DCO setting (default value) - MOV #DIVA_0 + DIVS_32 + DIVM_32,&CSCTL3 - - .ELSEIF FREQUENCY = 0.5 - MOV #0,&CSCTL1 ; Set 1MHZ DCO setting - MOV #DIVA_2 + DIVS_2 + DIVM_2,&CSCTL3 ; set all dividers as 2 - - .ELSEIF FREQUENCY = 1 + .IF FREQUENCY = 1 MOV #0,&CSCTL1 ; Set 1MHZ DCO setting MOV #DIVA_0 + DIVS_0 + DIVM_0,&CSCTL3 ; set all dividers as 0 @@ -382,7 +374,7 @@ LED2 .equ 80h ; P9.7 LED2 green MOV #DIVA_0 + DIVS_0 + DIVM_0,&CSCTL3 ; set all dividers as 0 .ELSEIF - .error "bad frequency setting, only 0.5,1,2,4,8,12,16 MHz" + .error "bad frequency setting, only 1,2,4,8,12,16 MHz" .ENDIF .IFDEF LF_XTAL diff --git a/inc/MSP_EXP430FR5972.pat b/inc/MSP_EXP430FR5972.pat index 968aa60..68130fe 100644 --- a/inc/MSP_EXP430FR5972.pat +++ b/inc/MSP_EXP430FR5972.pat @@ -1,5 +1,6 @@ @set-syntax{C;\;}! replace ! by semicolon + ; virtual MSP_EXP430FR5972.pat from MSP_EXP430FR6989.pat ; \.f=\.4th for MSP_EXP430FR5972; to change file type @@ -9,17 +10,13 @@ ;======================== \\*\n= \s\\*\n=\n + ; ====================================================================== ; MSP430FR6989 Config ; ====================================================================== + @reset-syntax{}; to enable good interpreting of next line @define{@read{@mergepath{@inpath{};MSP430FR5972.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} -@reset-syntax{}; enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FR5xxx.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} ; ====================================================================== ; MSP_EXP430FR5972 board diff --git a/inc/MSP_EXP430FR5994.asm b/inc/MSP_EXP430FR5994.asm index 1760de3..f1c8124 100644 --- a/inc/MSP_EXP430FR5994.asm +++ b/inc/MSP_EXP430FR5994.asm @@ -258,15 +258,7 @@ SD_CDIN .equ P7IN ; DCOCLK: Internal digitally controlled oscillator (DCO). MOV.B #CSKEY,&CSCTL0_H ; Unlock CS registers - .IF FREQUENCY = 0.25 -; MOV #DCOFSEL1+DCOFSEL0,&CSCTL1 ; Set 8MHZ DCO setting (default value) - MOV #DIVA_0 + DIVS_32 + DIVM_32,&CSCTL3 - - .ELSEIF FREQUENCY = 0.5 - MOV #0,&CSCTL1 ; Set 1MHZ DCO setting - MOV #DIVA_2 + DIVS_2 + DIVM_2,&CSCTL3 ; set all dividers as 2 - - .ELSEIF FREQUENCY = 1 + .IF FREQUENCY = 1 MOV #0,&CSCTL1 ; Set 1MHZ DCO setting MOV #DIVA_0 + DIVS_0 + DIVM_0,&CSCTL3 ; set all dividers as 0 @@ -291,7 +283,7 @@ SD_CDIN .equ P7IN MOV #DIVA_0 + DIVS_0 + DIVM_0,&CSCTL3 ; set all dividers as 0 .ELSEIF - .error "bad frequency setting, only 0.5,1,2,4,8,12,16 MHz" + .error "bad frequency setting, only 1,2,4,8,12,16 MHz" .ENDIF .IFDEF LF_XTAL diff --git a/inc/MSP_EXP430FR5994.pat b/inc/MSP_EXP430FR5994.pat index b415b21..dac8f3d 100644 --- a/inc/MSP_EXP430FR5994.pat +++ b/inc/MSP_EXP430FR5994.pat @@ -1,5 +1,6 @@ @set-syntax{C;\;}! replace ! by semicolon + ; MSP_EXP430FR5994.pat \.f=\.4th for MSP_EXP430FR5994; to change file type @@ -9,17 +10,13 @@ ; ======================== \\*\n= \s\\*\n=\n + ; ====================================================================== ; MSP430FR5994 Config ; ====================================================================== + @reset-syntax{}; to enable good interpreting of next line @define{@read{@mergepath{@inpath{};MSP430FR5994.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FR5xxx.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} ; ====================================================================== ; MSP_EXP430FR5994 board @@ -335,10 +332,16 @@ INT_IN_IFG=\$21C; P1IFG INT_IN_VEC=\$FFDE; P1VEC ;local variables +OLD_STOP_APP=\{UARTI2CS\}; +OLD_HARD_APP=\{UARTI2CS\}\+2; +OLD_BACKGRND_APP=\{UARTI2CS\}\+4; +OLD_TERM_VEC=\{UARTI2CS\}+6; <-- TERM_VEC +OLD_INT_IN_VEC=\{UARTI2CS\}+8; <-- INT_IN_VEC UARTI2CS_ADR=\{UARTI2CS\}\+10; <-- I2C_Slave_Addr<<1 TIMER_CONF=\{UARTI2CS\}\+12; <-- TIM_CTL configuration COLLISION_DLY=\{UARTI2CS\}\+14; <-- 20 us resolution delay after I2C collision DUPLEX_MODE=\{UARTI2CS\}\+15; <-- flag = 4 --> NOECHO, <> 4 --> ECHO, -1 = I2C link lost + ; ============================================ ; RC5toLCD APPLICATION ; ============================================ diff --git a/inc/MSP_EXP430FR6989.asm b/inc/MSP_EXP430FR6989.asm index 53cf5d1..42e4c44 100644 --- a/inc/MSP_EXP430FR6989.asm +++ b/inc/MSP_EXP430FR6989.asm @@ -391,15 +391,7 @@ LED2 .equ 80h ; P9.7 LED2 green ; DCOCLK: Internal digitally controlled oscillator (DCO). MOV.B #CSKEY,&CSCTL0_H ; Unlock CS registers - .IF FREQUENCY = 0.25 -; MOV #DCOFSEL1+DCOFSEL0,&CSCTL1 ; Set 8MHZ DCO setting (default value) - MOV #DIVA_0 + DIVS_32 + DIVM_32,&CSCTL3 - - .ELSEIF FREQUENCY = 0.5 - MOV #0,&CSCTL1 ; Set 1MHZ DCO setting - MOV #DIVA_2 + DIVS_2 + DIVM_2,&CSCTL3 ; set all dividers as 2 - - .ELSEIF FREQUENCY = 1 + .IF FREQUENCY = 1 MOV #0,&CSCTL1 ; Set 1MHZ DCO setting MOV #DIVA_0 + DIVS_0 + DIVM_0,&CSCTL3 ; set all dividers as 0 @@ -424,7 +416,7 @@ LED2 .equ 80h ; P9.7 LED2 green MOV #DIVA_0 + DIVS_0 + DIVM_0,&CSCTL3 ; set all dividers as 0 .ELSEIF - .error "bad frequency setting, only 0.5,1,2,4,8,12,16 MHz" + .error "bad frequency setting, only 1,2,4,8,12,16 MHz" .ENDIF .IFDEF LF_XTAL diff --git a/inc/MSP_EXP430FR6989.pat b/inc/MSP_EXP430FR6989.pat index 8f41baf..d5f73d6 100644 --- a/inc/MSP_EXP430FR6989.pat +++ b/inc/MSP_EXP430FR6989.pat @@ -1,24 +1,22 @@ @set-syntax{C;\;}! replace ! by semicolon + ; MSP_EXP430FR6989.pat ; \.f=\.4th for MSP_EXP430FR6989; to change file type + ; ======================== ; remove comments ; ======================== \\*\n= \s\\*\n=\n + ; ====================================================================== ; MSP430FR6989 Config ; ====================================================================== + @reset-syntax{}; to enable good interpreting of next line @define{@read{@mergepath{@inpath{};MSP430FR6989.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FRxxxx.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};MSP430FR5xxx.pat;}}} -@reset-syntax{}; to enable good interpreting of next line -@define{@read{@mergepath{@inpath{};FastForthREGtoTI.pat;}}} ; ====================================================================== ; MSP_EXP430FR6989 board @@ -259,10 +257,16 @@ INT_IN_IFG=\$23C; P3IFG INT_IN_VEC=\$FFCE; P3VEC ;local variables +OLD_STOP_APP=\{UARTI2CS\}; +OLD_HARD_APP=\{UARTI2CS\}\+2; +OLD_BACKGRND_APP=\{UARTI2CS\}\+4; +OLD_TERM_VEC=\{UARTI2CS\}+6; <-- TERM_VEC +OLD_INT_IN_VEC=\{UARTI2CS\}+8; <-- INT_IN_VEC UARTI2CS_ADR=\{UARTI2CS\}\+10; <-- I2C_Slave_Addr<<1 TIMER_CONF=\{UARTI2CS\}\+12; <-- TIM_CTL configuration COLLISION_DLY=\{UARTI2CS\}\+14; <-- 20 us resolution delay after I2C collision DUPLEX_MODE=\{UARTI2CS\}\+15; <-- flag = 4 --> NOECHO, <> 4 --> ECHO, -1 = I2C link lost + ; ============================================ ; RC5toLCD APPLICATION ; ============================================ diff --git a/inc/TERMINALBAUDRATE.inc b/inc/TERMINALBAUDRATE.inc index 95e8eb1..a7b89f0 100644 --- a/inc/TERMINALBAUDRATE.inc +++ b/inc/TERMINALBAUDRATE.inc @@ -1,6 +1,6 @@ ; TERM alias eUSCI_Ax : select baudrate versus frequency - .IF FREQUENCY = 0.25 + .IF FREQUENCY = 250 .SWITCH TERMINALBAUDRATE .CASE 9600 ; Configure UART_TERM @ 38400 bauds / 1MHz @@ -36,10 +36,12 @@ TERMMCTLW_INI .equ 0AA00h ; TERMBRW=UCBR0, TERMMCTLW= (UCBRS0<<8)|(UCBRF0<<4)|UCOS16 TERMBRW_INI .equ 4 TERMMCTLW_INI .equ 04900h + .ELSECASE .error "UART_TERM / 250 kHz : baudrate not implemented" .ENDCASE - .ELSEIF FREQUENCY = 0.5 + + .ELSEIF FREQUENCY = 500 .SWITCH TERMINALBAUDRATE .CASE 9600 ; Configure UART_TERM @ 19200 bauds / 1MHz @@ -106,7 +108,6 @@ TERMMCTLW_INI .equ 04900h .ELSECASE .error "UART_TERM / 500 kHz : baudrate not implemented" .ENDCASE - .ELSEIF FREQUENCY = 1 .SWITCH TERMINALBAUDRATE .CASE 9600 @@ -716,7 +717,7 @@ TERMBRW_INI .equ 39 TERMMCTLW_INI .equ 0011h .CASE 31250 ; MIDI interface -; Configure UART_TERM @ 31250 bauds / 8MHz +; Configure UART_TERM @ 31250 bauds / 12MHz ; N=12000000/31250=384 ==> UCOS16=1, UCBR0=int(N/16)=24, UCBRF0=int(frac(N/16)*16)=0, UCBRS0= fn(frac(N))=fn(0)=0 ; TERMBRW=UCBR0, TERMMCTLW= (UCBRS0<<8)|(UCBRF0<<4)|UCOS16 TERMBRW_INI .equ 24 @@ -996,15 +997,15 @@ TERMMCTLW_INI .equ 04900h TERMBRW_INI .equ 4 TERMMCTLW_INI .equ 0 -; .CASE 5000000 ; PL203HXD baudrate -; ; Configure UART_TERM @ 5000000 bauds / 16MHz -; ; N = 16000000/5000000 = 3.2... ==> {UCOS16=0, UCBR0=int(N)=0, UCBRF0=dont_care=0, UCBRS0=fn(frac(N))=fn(0.2)=0x11 -; ; TERMBRW=UCBR0, TERMMCTLW= (UCBRS0<<8)|(UCBRF0<<4)|UCOS16 -; TERMBRW_INI .equ 3 -; TERMMCTLW_INI .equ 02100h -; + .CASE 5000000 ; PL203HXD baudrate +; Configure UART_TERM @ 5000000 bauds / 16MHz +; N = 16000000/5000000 = 3.2... ==> {UCOS16=0, UCBR0=int(N)=0, UCBRF0=dont_care=0, UCBRS0=fn(frac(N))=fn(0.2)=0x11 +; TERMBRW=UCBR0, TERMMCTLW= (UCBRS0<<8)|(UCBRF0<<4)|UCOS16 +TERMBRW_INI .equ 3 +TERMMCTLW_INI .equ 02100h +; ; .CASE 6000000 ; PL2303TA baudrate -; ; Configure UART_TERM @ 6000000 bauds / 24MHz +; ; Configure UART_TERM @ 6000000 bauds / 16MHz ; ; N = 16000000/6000000 = 2.6666.. ==> {UCOS16=0, UCBR0=int(N)=2, UCBRF0=dont_care=0 UCBRS0=fn(frac(N))=fn(0.6666)=0xB6 ; TERMBRW_INI .equ 2 ; TERMMCTLW_INI .equ 0B600h @@ -1150,11 +1151,11 @@ TERMMCTLW_INI .equ 0 TERMBRW_INI .equ 4 TERMMCTLW_INI .equ 0 -; .CASE 6000000 ; PL2303TA baudrate -; ; Configure UART_TERM @ 6000000 bauds / 20MHz -; ; N = 20000000/6000000 = 3.3333333 ==> {UCOS16=0, UCBR0=int(N)=3, UCBRF0=dont_care=0 UCBRS0=fn(frac(N))=fn(0.33333)=0x49 -; TERMBRW_INI .equ 3 -; TERMMCTLW_INI .equ 04900h + .CASE 6000000 ; PL2303TA baudrate +; Configure UART_TERM @ 6000000 bauds / 20MHz +; N = 20000000/6000000 = 3.3333333 ==> {UCOS16=0, UCBR0=int(N)=3, UCBRF0=dont_care=0 UCBRS0=fn(frac(N))=fn(0.33333)=0x49 +TERMBRW_INI .equ 3 +TERMMCTLW_INI .equ 04900h .ELSECASE .error "UART_TERM / 20 MHz : baudrate not implemented" @@ -1303,6 +1304,14 @@ TERMMCTLW_INI .equ 0EE00h TERMBRW_INI .equ 4 TERMMCTLW_INI .equ 0 +; .CASE 7500000 ; PL2303TA baudrate +; ; Configure UART_TERM @ 7500000 bauds / 24MHz +; ; N = 24000000/7500000 = 3.2 ==> {UCOS16=0, UCBR0=int(N)=3, UCBRF0=dont_care=0 UCBRS0=fn(frac(N))=fn(0.2)=0x11 +; ; TERMBRW=UCBR0, TERMMCTLW= (UCBRS0<<8)|(UCBRF0<<4)|UCOS16 +; TERMBRW_INI .equ 3 +; TERMMCTLW_INI .equ 02100h +; ; + .ELSECASE .error "UART_TERM / 24 MHz : baudrate not implemented" .ENDCASE ; UART_TERM / 24MHz baudrates diff --git a/inc/TargetInit.asm b/inc/TargetInit.asm index 86a68b6..8b565ea 100644 --- a/inc/TargetInit.asm +++ b/inc/TargetInit.asm @@ -28,57 +28,9 @@ .IFDEF CHIPSTICK_FR2433 .include "CHIPSTICK_FR2433.asm" .ENDIF - .save - .listing off -; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ; add here your target.asm item: +; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv +; .IFDEF YOUR_TARGET1 +; .include "YOUR_TARGET1.asm" +; .ENDIF ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - .restore - .IFDEF MY_MSP430FR5734 - .include "MY_MSP430FR5734.asm" - .ENDIF - .IFDEF MY_MSP430FR5738 - .include "MY_MSP430FR5738.asm" - .ENDIF - .IFDEF MY_MSP430FR5738_1 - .include "MY_MSP430FR5738.asm" - .ENDIF - .IFDEF MY_MSP430FR5738_2 - .include "MY_MSP430FR5738.asm" - .ENDIF - .IFDEF MY_MSP430FR5948 - .include "MY_MSP430FR5948.asm" - .ENDIF - .IFDEF MY_MSP430FR5948_1 - .include "MY_MSP430FR5948_1.asm" - .ENDIF - .IFDEF JMJ_BOX_2021_03_02 - .include "JMJ_BOX_2021_03_02.asm" - .ENDIF - .IFDEF JMJ_BOX_2021_05_04 - .include "JMJ_BOX_2021_05_04.asm" - .ENDIF - .IFDEF JMJ_BOX - .include "MY_MSP430FR5738.asm" - .ENDIF - .IFDEF JMJ_BOX_2018_10_29 - .include "MY_MSP430FR5738.asm" - .ENDIF - .IFDEF JMJ_BOX_2018_08 - .include "MY_MSP430FR5738.asm" - .ENDIF - .IFDEF JMJ_BOX_GUILLAUME - .include "MY_MSP430FR5738.asm" - .ENDIF - .IFDEF JMJ_BOX_FAVRE - .include "MY_MSP430FR5738.asm" - .ENDIF - .IFDEF PA8_PA_MSP430 - .include "MY_MSP430FR5738.asm" - .ENDIF - .IFDEF PA_PA_MSP430 - .include "MY_MSP430FR5738.asm" - .ENDIF - .IFDEF PA_Core_MSP430 - .include "MY_MSP430FR5948_1.asm" - .ENDIF diff --git a/inc/ThingsInFirst.inc b/inc/ThingsInFirst.inc index 81bb6b6..88b6fae 100644 --- a/inc/ThingsInFirst.inc +++ b/inc/ThingsInFirst.inc @@ -495,11 +495,6 @@ USE_MOVE .IFNDEF DOUBLE_INPUT DOUBLE_INPUT .ENDIF - .IFDEF BOOTLOADER - .IFNDEF CONDCOMP -CONDCOMP ; mandatory for Bootstrap - .ENDIF - .ENDIF .ENDIF .IFDEF EXTENDED_ASM .IFNDEF DOUBLE_INPUT @@ -540,8 +535,6 @@ DOUBLE_NUMBERS ; to process double numbers ;----------------------------------------------------------------------- ; DEVICE I/O, MEMORY, SFR, vectors and minimum FORTH I/O declarations ;----------------------------------------------------------------------- -FADDON .set 0 - .IFDEF MSP_EXP430FR5739 LF_XTAL .IFNDEF UART_TERMINAL @@ -657,6 +650,8 @@ UCA1_SD ; --------------------------- ; compute value of FORTHADDON ; --------------------------- +FADDON .set 0 + ; .IFDEF FLOORED_DIVISION ;FADDON .SET FADDON | BIT15 ; FLOORED_DIVISION ; .ENDIF @@ -688,19 +683,22 @@ FADDON .SET FADDON | BIT8 ; Q15.16 INPUT FADDON .SET FADDON | BIT7 ; DOUBLE INPUT .ENDIF ; --------------------------- - .IFDEF EXTENDED_ASM ; Assembler 20 bits + .IFDEF LARGE_DATA ; Assembler 20 bits FADDON .SET FADDON | BIT6 .ENDIF -; .IFDEF MSP430ASSEMBLER -FADDON .SET FADDON | BIT5 ; Assembler 16 bits -; .ENDIF - .IFDEF EXTENDED_MEM - .IFNDEF EXTENDED_ASM -FADDON .SET FADDON | BIT4 ; Assembler 16 bits with Address access beyond $FFFF + .IFDEF LARGE_CODE + .IFNDEF LARGE_DATA +FADDON .SET FADDON | BIT5 ; Assembler 16 bits with Address access beyond $FFFF .ENDIF .ENDIF - .IFDEF HMPY ; see device.inc -FADDON .SET FADDON | BIT3 ; hardware MPY + .IFDEF HMPY ; +FADDON .SET FADDON | BIT4 ; hardware MPY + .ENDIF + .IFDEF SD_CARD_LOADER +FADDON .SET FADDON | BIT3 + .ENDIF + .IFDEF SD_CARD_READ_WRITE +FADDON .SET FADDON | BIT2 .ENDIF ; --------------------------- ; BIT2 to BIT0 are free @@ -781,39 +779,38 @@ HOLD_BASE .equ HOLDS_ORG+HOLD_LEN ; ---------------------------------------------------- ; FORTH interpreter ; ---------------------------------------------------- -HP .equ HOLD_BASE ; HOLD ptr -STATE .equ HOLD_BASE+2 ; Interpreter state -BASEADR .equ HOLD_BASE+4 ; BASE -CAPS .equ HOLD_BASE+6 ; CAPS -SOURCE .equ HOLD_BASE+8 ; len, org of input stream -SOURCE_LEN .equ HOLD_BASE+8 ; -SOURCE_ORG .equ HOLD_BASE+10 ; -TOIN .equ HOLD_BASE+12 ; CurrentInputBuffer pointer +HP .equ HOLD_BASE ; HOLD ptr, init by <# +STATE .equ HOLD_BASE+2 ; Interpreter state init by INIT_FORTH +BASEADR .equ HOLD_BASE+4 ; BASE init by INIT_FORTH +SOURCE .equ HOLD_BASE+6 ; len, org of input stream init by REFILL +SOURCE_LEN .equ HOLD_BASE+6 ; init by REFILL +SOURCE_ORG .equ HOLD_BASE+8 ; init by REFILL +TOIN .equ HOLD_BASE+10 ; CurrentInputBuffer ptr init by REFILL ; ---------------------------------------------------- ; FORTH environment ; ---------------------------------------------------- -DP .equ HOLD_BASE+14 ; dictionnary pointer -LASTVOC .equ HOLD_BASE+16 ; -CURRENT .equ HOLD_BASE+18 ; -CONTEXT .equ HOLD_BASE+20 ; 8 words of depth ending -NULL_WORD .equ HOLD_BASE+36 ; with a null word in addition +DP .equ HOLD_BASE+12 ; dictionnary pointer init by INIT_FORTH and RST_RET +LASTVOC .equ HOLD_BASE+14 ; init by INIT_FORTH and RST_RET +CURRENT .equ HOLD_BASE+16 ; init by INIT_FORTH and RST_RET +CONTEXT .equ HOLD_BASE+18 ; 8 words of depth ending init by INIT_FORTH and RST_RET +NULL_WORD .equ HOLD_BASE+34 ; + null word init by INIT_FORTH and RST_RET ; ---------------------------------------------------- ; FORTH compiler ; ---------------------------------------------------- ; RAM_ORG + $1D8 : can be shared with APPLICATION needs ; ---------------------------------------------------- -LAST_NFA .equ HOLD_BASE+38 ; used by REVEAL, IMMEDIATE -LAST_THREAD .equ HOLD_BASE+40 ; " REVEAL -LAST_CFA .equ HOLD_BASE+42 ; " DOES>, RECURSE -LAST_PSP .equ HOLD_BASE+44 ; " REVEAL -ASMBW1 .equ HOLD_BASE+46 ; -ASMBW2 .equ HOLD_BASE+48 ; -ASMBW3 .equ HOLD_BASE+50 ; -ASMFW1 .equ HOLD_BASE+52 ; -ASMFW2 .equ HOLD_BASE+54 ; -ASMFW3 .equ HOLD_BASE+56 ; +LAST_NFA .equ HOLD_BASE+36 ; used by REVEAL, IMMEDIATE +LAST_THREAD .equ HOLD_BASE+38 ; " REVEAL +LAST_CFA .equ HOLD_BASE+40 ; " DOES>, RECURSE +LAST_PSP .equ HOLD_BASE+42 ; " REVEAL +ASMBW1 .equ HOLD_BASE+44 ; +ASMBW2 .equ HOLD_BASE+46 ; +ASMBW3 .equ HOLD_BASE+48 ; +ASMFW1 .equ HOLD_BASE+50 ; +ASMFW2 .equ HOLD_BASE+52 ; +ASMFW3 .equ HOLD_BASE+54 ; ; ---------------------------------------------------- -; RAM_ORG + $1EC : free RAM area +; RAM_ORG + $1EA : free RAM area ; ---------------------------------------------------- .IFDEF SD_CARD_LOADER @@ -836,7 +833,7 @@ SD_BUF_END .equ SD_BUF+200h ; 512bytes .IF RAM_LEN < 2048 ; if RAM < 2K (FR57xx) the variables below are in INFO space (FRAM) SD_ORG .equ INFO_ORG+5Ah ; .ELSE ; if RAM >= 2k the variables below are in RAM -SD_ORG .equ SD_BUF_END+2 ; 1 word guard +SD_ORG .equ SD_BUF_END+2 ; 1 word guard (for CRC16bits !) .ENDIF .org SD_ORG @@ -912,12 +909,14 @@ HDLH_CurClust .equ 16 ; Current ClusterHi HDLL_CurSize .equ 18 ; written size / not yet read size (Long) HDLH_CurSize .equ 20 ; written size / not yet read size (Long) HDLW_BUFofst .equ 22 ; SD_BUF offset ; used by LOAD" -HDLW_PrevLEN .equ 24 ; previous LEN -HDLW_PrevORG .equ 26 ; previous ORG +HDLW_PrevLEN .equ 24 ; interpret_buffer_LEN of previous handle +HDLW_PrevORG .equ 26 ; interpret_buffer_ORG of previous handle +HDLW_PrevTOIN .equ 28 ; interpret_buffer_PTR of previous handle +HDLW_PrevQYEMIT .equ 30 ; echo state of previous handle .IF RAM_LEN < 2048 ; due to the lack of RAM, only 4 handles and PAD replaces SDIB HandleMax .equ 4 ; and not 8 to respect INFO size (FRAM) -HandleLenght .equ 28 +HandleLenght .equ 32 HandlesLen .equ handleMax*HandleLenght HandleEnd .equ FirstHandle+handleMax*HandleLenght SD_END .equ HandleEnd @@ -926,7 +925,7 @@ SDIB_I2CCNT .equ PAD_ORG-2 SDIB_ORG .equ PAD_ORG .ELSE ; RAM_Size >= 2k all is in RAM HandleMax .equ 8 -HandleLenght .equ 28 +HandleLenght .equ 32 HandlesLen .equ handleMax*HandleLenght HandleEnd .equ FirstHandle+handleMax*HandleLenght SDIB_I2CADR .equ SDIB_ORG-4 @@ -1028,7 +1027,11 @@ mNEXTADR .MACRO ;------------------------------------------------------------------------------- ; FRAM INFO: KERNEL INIT CONSTANTS and VARIABLES ; ---------------------------------------------- + .IF FREQUENCY > 24 +FREQ_KHZ .word FREQUENCY ; used to stabilize MCLK before start, see MSP430FRxxxx.asm + .ELSE FREQ_KHZ .word FREQUENCY*1000 ; used to stabilize MCLK before start, see MSP430FRxxxx.asm + .ENDIF .IFNDEF UART_TERMINAL I2CSLAVEADR .word I2C_TERM_ADR ; on MSP430FR2xxx devices with BSL I2C, Slave address is FFA0h I2CSLAVEADR1 .word 0 @@ -1048,11 +1051,13 @@ DEEP_ORG ; MOV #DEEP_ORG,X see "PUC 7" in for DEEP_TERM_VEC .word TERMINAL_INT ; MOV @X+,&TERM_VEC ; TERMINAL_INT --> FRAM TERM_VEC .IFNDEF SD_CARD_LOADER DEEP_STOP .word INIT_STOP ; MOV @X+,&STOP_APP ; INIT_STOP --> FRAM STOP_APP +DEEP_ABORT .word ABORT_TERM ; MOV @X+,&ABORT_APP ; INIT_ABORT --> FRAM ABORT_APP DEEP_SOFT .word INIT_SOFT ; MOV @X+,&SOFT_APP ; INIT_SOFT_TERM --> FRAM SOFT_APP DEEP_HARD .word INIT_TERM ; MOV @X+,&HARD_APP ; INIT_TERM --> FRAM HARD_APP DEEP_SLEEP .word INIT_BACKGRND ; MOV @X+,&BACKGRND_APP ; INIT_BACKGRND --> FRAM BACKGRND_APP .ELSE DEEP_STOP .word INIT_STOP ; MOV @X+,&STOP_APP ; INIT_STOP --> FRAM STOP_APP +DEEP_ABORT .word ABORT_TERM ; MOV @X+,&ABORT_APP ; INIT_ABORT --> FRAM ABORT_APP DEEP_SOFT .word INIT_SOFT_SD ; MOV @X+,&SOFT_APP ; INIT_SOFT_SD --> FRAM SOFT_APP DEEP_HARD .word INIT_HARD_SD ; MOV @X+,&HARD_APP ; INIT_HARD_SD --> FRAM HARD_APP DEEP_SLEEP .word INIT_BACKGRND ; MOV @X+,&BACKGRND_APP ; INIT_BACKGRND --> FRAM BACKGRND_APP @@ -1061,6 +1066,7 @@ DEEP_DP .word ROMDICT ; MOV @X+,&RST_DP ; DEEP_DP DEEP_LASTVOC .word lastvoclink ; MOV @X+,&RST_LASTVOC ; DEEP_LASTVOC --> FRAM RST_LASTVOC DEEP_CURRENT .word BODYFORTH ; MOV @X+,&CURRENT ; DEEP_CONTEXT --> FRAM RST_CURRENT DEEP_CONTEXT .word BODYFORTH ; MOV @X+,&CONTEXT ; DEEP_CONTEXT --> FRAM RST_CONTEXT + .word 0 ; to do FORTH ONLY ; --------------------------------------; PUC_ABORT_ORG ; MOV #PUC_ABORT_ORG,X ; --------------------------------------; @@ -1083,22 +1089,23 @@ INIT_DOCOL .word 0 ; MOV @X+,R4 ; useless rDOCOL INIT_DODOES .word xDODOES ; MOV @X+,rDODOES ; INIT_DODOES --> rDODOES (R5) INIT_DOCON .word xDOCON ; MOV @X+,rDOCON ; INIT_DOCON --> rDOCON (R6) INIT_DOVAR .word RFROM ; MOV @X+,rDOVAR ; INIT_DOVAR --> rDOVAR (R7) -INIT_CAPS .word 32 ; MOV @X+,&CAPS ; INIT_CAPS --> RAM CAPS INIT_BASE .word 10 ; MOV @X+,&BASE ; INIT_BASE --> RAM BASE INIT_LEAVE .word LSTACK ; MOV @X+,&LEAVEPTR ; INIT_LEAVE --> RAM LEAVEPTR ; --------------------------------------; ; FRAM RST values initialised by -1 SYS ; from DEEP_ORG+2 ; --------------------------------------; RST_ORG ; make room for RST values of: -RST_LEN .equ 16 ; 16 bytes +RST_LEN .equ 20 ; 10 words, 20 bytes (with only one trailing 0) ; --------------------------------------; .IFNDEF SD_CARD_LOADER STOP_APP .word INIT_STOP ; STOP_APP +ABORT_APP .word ABORT_TERM ; ABORT_APP SOFT_APP .word INIT_SOFT ; SOFT_APP HARD_APP .word INIT_TERM ; HARD_APP BACKGRND_APP .word INIT_BACKGRND ; BACKGRND_APP .ELSE STOP_APP .word INIT_STOP ; STOP_APP +ABORT_APP .word ABORT_TERM ; ABORT_APP SOFT_APP .word INIT_SOFT_SD ; SOFT_APP HARD_APP .word INIT_HARD_SD ; HARD_APP BACKGRND_APP .word INIT_BACKGRND ; BACKGRND_APP @@ -1117,7 +1124,7 @@ RST_CONTEXT .word BODYFORTH ; CONTEXT space (8 CELLS) ; --------------------------------------; .word 0 ; NULL_WORD, always 0 ; --------------------------------------; - + .word 0 ; --------------------------; -; INFO_ORG + $5A : free use ; +; INFO_ORG + $60 : free use ; ; --------------------------; -- 2.11.0