From e5e2494a7f84703f1fb2520136981a24dcd9f33e Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Wed, 10 Aug 2016 11:52:51 -0700 Subject: [PATCH 1/3] Fix address shift for digital pin writing --- SANDBOX.PO | Bin 143360 -> 143360 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/SANDBOX.PO b/SANDBOX.PO index 49fedfe8fc5ed7f9deb4b3964256b43705fb183b..a119ab61620697600cc7305cfbaa6557cb00e13c 100644 GIT binary patch delta 1681 zcmchXO-{l<7>4@?bO8$t3pXZ1Kmvi-RwNnlLAd?jKsLm8yF8TB;G*pz*Z9y zIe|xT;RB>2ULD;ayZ4E$9r35C@qXctBn5A+;iL3_J z81pPv#{)S$KuH>*k@jt5S{5j)8l|v|C^$26x&snL1P;?Qh=*=O#ZWXxC6s-sLgp&* zT41iyr7UGuZTx>ti;^Jh1^X^ZSfk6`hl}OyzP7f4HsIV delta 307 zcmZp8z|ru4V}mLSqxfbumLO*H9A*XxcnqPK7#Lh5^b8I40(=}HA}madoD9AEU=9ZZ zRN3bB?1e0h_RWes+ZA~jZ(U^#@bptNUiOGlVLLk$(@)093LNY#j6g7*k&)>S2O~2J zD;qlp=VU>SAN8)m!3vIkkqX|fkqROH3a$~JA$m%@PLUz53JUK2{w_|DK!$>?f>MZw zV~9FXt&fj_o4=2Dup&&Ak87B#4^RzQm7%SNV~~r2k*%+*i-NJOt7CAaf;~)Sq Date: Mon, 21 Nov 2016 16:41:17 -0800 Subject: [PATCH 2/3] Sanbox broken with w->[x] = ??. plasm broken with w->2 = ?? --- src/toolsrc/parse.c | 20 +++++++++++++------- src/toolsrc/sb.pla | 2 -- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/toolsrc/parse.c b/src/toolsrc/parse.c index 0790bfd..a04986a 100755 --- a/src/toolsrc/parse.c +++ b/src/toolsrc/parse.c @@ -638,13 +638,19 @@ int parse_value(int rvalue) ref_type = (scantoken == PTRB_TOKEN) ? BPTR_TYPE : WPTR_TYPE; if (!parse_const(&ref_offset)) scan_rewind(tokenstr); + if (ref_offset != 0) + { + emit_const(ref_offset); + emit_op(ADD_TOKEN); + ref_offset = 0; + } break; case DOT_TOKEN: case COLON_TOKEN: /* * Structure member offset */ - ref_type = (ref_type & (VAR_TYPE | CONST_TYPE)) + ref_type = (ref_type & (VAR_TYPE | CONST_TYPE)) ? ((scantoken == DOT_TOKEN) ? BYTE_TYPE : WORD_TYPE) : ((scantoken == DOT_TOKEN) ? BPTR_TYPE : WPTR_TYPE); if (parse_const(&const_offset)) @@ -990,7 +996,7 @@ int parse_stmnt(void) return (0); } } - else if (scantoken == EOL_TOKEN) + else if (scantoken == EOL_TOKEN) { next_line(); } @@ -1087,7 +1093,7 @@ int parse_stmnt(void) } if (type & LOCAL_TYPE) (elem_type & BYTE_TYPE) ? emit_slb(addr + elem_offset) : emit_slw(addr + elem_offset); - else + else (elem_type & BYTE_TYPE) ? emit_sab(addr, elem_offset, type) : emit_saw(addr, elem_offset, type); break; } @@ -1116,7 +1122,7 @@ int parse_stmnt(void) } } break; - } + } } else if (type & FUNC_TYPE) { @@ -1189,7 +1195,7 @@ int parse_var(int type) long constval; int consttype, constsize, arraysize, idlen = 0; long size = 1; - + if (scan() == OPEN_BRACKET_TOKEN) { size = 0; @@ -1303,7 +1309,7 @@ int parse_struc(void) return (0); } scan(); - } + } } if (type & WORD_TYPE) size *= 2; @@ -1323,7 +1329,7 @@ int parse_vars(int type) long value; int idlen, size; char *idstr; - + switch (scantoken) { case SYSFLAGS_TOKEN: diff --git a/src/toolsrc/sb.pla b/src/toolsrc/sb.pla index 553fbab..360e10b 100644 --- a/src/toolsrc/sb.pla +++ b/src/toolsrc/sb.pla @@ -3290,8 +3290,6 @@ def parse_value(rvalue) emit_op($02) ref_offset = 0 fin - if ref_type & BPTR_TYPE; emit_lb - elsif ref_type & WPTR_TYPE; emit_lw; fin fin while parse_expr if token <> COMMA_TKN From a5215e330905e8ecc026dcddcb5afb24b54f4efa Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Mon, 21 Nov 2016 16:50:23 -0800 Subject: [PATCH 3/3] Fix pointer to array in sandbox --- SANDBOX.PO | Bin 143360 -> 143360 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/SANDBOX.PO b/SANDBOX.PO index a119ab61620697600cc7305cfbaa6557cb00e13c..be7c9a5c3a616b28b0fa2724c7fe92f0e6ab132a 100644 GIT binary patch delta 427 zcmYk1J1j$C6vw~+)pDgGtq9knw2Dh3afQSn6%iz)1Ig#Dtw?hbF`yptHkg=5e1pfv zWKegwgTcTgW{ETruR$aXgo$uEG5yc$e}3mI-^$Ck^3l2_t(d(uvq^WUov{bziU-D? zWhn_T@=}tx;gDlE9)QK#GW`1L+H}ZnL)D+IaAMkhxKp5-Z|!&j(nYKjtx!c-7d8^h zByX(tP@H$60gCwPMyAA7)7Om)BtCzIt^S&LQ89~pAxUH^3BZYK(G)--Wg`JpP_`RD z(4qFZ{8py19^KBr8#I0`QiABG?r0FDG%JEwBk_bVL$VV>Imu-RRXH;Ap7XPMvh?|r z8J}p=T0ee<#tOU}^#}cQZ%zaqG&>%F#~G*Cn5Gq5Jv{2`(KC2uqoym|SsN!FM^Hz^ z_XtkOU`*nh-i}TYiu7(8?FrZx)pMwn2E)Rgi!8A^hezc^|Ko-kpKa9GOstUht;}OE d^?#S|i_dwK5F>v9_X0P_-YSr6rfm@)(O-}4i!lHI delta 362 zcmYL^J4nM|6ovm&BTYez5s`wg_<(8^S|6(*!AS(8q_&l&6~U;Z7$4B6wX04F{!Wh0 zYQT&Nii3+=5WCdJ(8Y>U$6D{^^l|Pv=U#5MAZ82V`GL?FWa0#Sm)j-A-k6Nex_bLm z*!6`# bsbW}I^1H_W743%SE%cHlY~$6z4yqS_