From b105c92a426596ee2977872f0bc8be2a79730d6b Mon Sep 17 00:00:00 2001 From: EgonOlsen Date: Mon, 29 Jul 2024 13:45:30 +0200 Subject: [PATCH] Fixed some flaws in the python backend --- dist/basicv2.jar | Bin 1432188 -> 1432212 bytes .../cbmnative/python/generators/AndPy.java | 2 +- .../cbmnative/python/generators/MovbPy.java | 6 +-- src/main/resources/subroutines.py | 35 +++++++++++------- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/dist/basicv2.jar b/dist/basicv2.jar index 4b850f116cd3364e5e794d6200197804dd3cfddd..24f23e6f9a898eceab50267258dd6679e8cf2255 100644 GIT binary patch delta 14713 zcmZ9S2Rzl^|HrvD*Y+V>MUovESy4v0$fm3~*;0}j*=1%l>``PCk_e$m z$p73ve!jPVkH?MI^Zh>W^FI50KG$ZY>Fp|0tf3AGDK!xhB@t2Fr39=H=GLWP`7n9n zFnLUvJV}^5X_!1&m^^uyJVli}WwkzK#HB4W_TQ5ZptO@x4u}{~(&97>o=NVxeu1PT zBlpw?L_$er#CJMKig%9z4R4Fb^6}ubl0$h6Y^`x$?WbFKCgY^945qVPN*exUY1LHy z{`sdd%<#sbyA^Wes$NrK}ev}>c;JY7{b#wHJvSVg+Z`G@s z^E`A{NQTO_JhGzFWqLVwBudBm?>cKzJmV)sZFtQie4&f-XE#+ z6)YklMQhm;bIfbZ>ALHgf(vWO0cTao^2?fzC`M-b$coAp^(dzhm&EMvquDYgl{hoh zS3NgYr8!2qc#icNg=bKi@MW_Dag9Xy4hAtI$X@Wmo>I6b%aD@Im@XD}qmCRHv4Z`c z!VFdvu`Hm^jFJ;5${|>=olD7rYkABmVi(VHCV~t@m41{w6eC?7F+qNOv8VK^1J%rx zFM>T&8OIefW7?vaU!G`A;mrHWTX3?_IN9LDN0&{t86755%U@k|osTgyiP35EU;MV- zZEU^kZ}{D*T(gW(2!0xPTZ%I#|CG@wt1{O7!8%u2)nsW|o$OEjUAc$S<#KT{898cv4A-7U0|U$YiJ z)LwCK)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`Vk>)V$4>*)IorTuGDyo0jNE8MZ&tVS?l2FCi1`-4uwTLw3o5>9& z0NiU4Day{Z4aEbV)xu>V21_8t#}4YS1a`n*2Mb%G-bA};2n4`W4V{M8L8p{(gScT@ zS_c;wD!6KHC~Q5VK-tQ%seW@1n1O9QbaRhq6SeUW1VLddbn{ezKpuO(z^27J0RkK7 z$ons{zVkyfa*9&y-ezvS7I-3VNZVBDEr=qe`_oO8{FJbb z)arP^`23%?`BSxNA@Lk`g2fA19h0X2GQEHf54UWp`4=z@Oy{PGd5O>ijhAp3^>qCY zDPVB}fWH+kr!z1KlLB_MB1V+6?+IXRlCTR%et-=Cdq{+`d2$1ZlDZuSSYIK07&ymY zA*Pfr>jZF{mX#mmzk*w)^I!}@tP3kJ>_A}SwIPQv8sK&tT%@=0Y%zE<)(+RCUj8k@ z0s`CNVSv&YC9=lwwwS2}hQE4>m3(EK1(*&*5AzxrbikcivMETb?+7G%rgM zJ2l|zgg2I1f&UU_aIF&-vJ!#fu1-W9`}-y+>4KA5tP5@->ENNV3r^>tE<_G92a3C3 zD2L-w#@~&oVpM@`H=>6<1-D~eFudk&xHprB2Tqb8^uV=W9sX8G5*9ts9a|A9a(dup z`Dih?-3tr)OA>rFB*6=;dSR=3fS6wB^lt-dE!oJ*Og5E;T3E@Ke2$h4t2i$fTA&A$ zfJGl%KzZShX|UK0n$ZUb<)8Qe11o)qJjM~o^dpKGKH$-h9K$4ovVP<+Mg{!phiQ61 zasWAq2?b{cpeh6z1IPhPH5eX1l;NP|ehojgRKV;tjK2*ezDCqBk>JB?*s*(oz#FIv zf%6-9g4GTN3vUp1Q1b?U7hi(;H^^bivRXFKUCXu&Xb&PHaNFZI2urO1m4nb1JNQj{ z{Q?R@$Psu_yEud>!Q nCo private void indexedTargetWithConstant(List nCode, Operand source, Operand target) { String from = getOpName(source); String to = getOpName(target); - nCode.add("_memory[int(" + to + ")]=int(" + from + ") and 255"); + nCode.add("_memory[int(" + to + ")]=int(" + from + ") & 255"); } private void indexedSource(List nCode, Operand source, Operand target) { String from = getOpName(source); String to = getOpName(target); - nCode.add(to + "=_memory[int(" + from + ") and 65535];"); + nCode.add(to + "=_memory[int(" + from + ") & 65535];"); } private void indexedTarget(List nCode, Operand source, Operand target) { @@ -101,6 +101,6 @@ private void fillMemory(List nCode, Operand target, String from) { if (isNumber(to)) { to = "_memory[" + to + "]"; } - nCode.add(to + "=int(" + from + ") and 255;"); + nCode.add(to + "=int(" + from + ") & 255;"); } } diff --git a/src/main/resources/subroutines.py b/src/main/resources/subroutines.py index 9c44dadc..da825619 100644 --- a/src/main/resources/subroutines.py +++ b/src/main/resources/subroutines.py @@ -164,10 +164,10 @@ def RETURN(): while True: val = _forstack.pop() if val == 1: - forstack.pop() - forstack.pop() - forstack.pop() - forstack.pop() + _forstack.pop() + _forstack.pop() + _forstack.pop() + _forstack.pop() if val==0: break val = _forstack.pop() @@ -613,7 +613,10 @@ def OPEN(): fileHandle = _files.get(key) if fileHandle != None: throw("File already open error!") - fileHandle = open(fileName, mode, encoding="ascii") + if mode=="r": + fileHandle = open(fileName, mode+"b") + else: + fileHandle = open(fileName, mode, encoding="ascii") _files[key]=fileHandle def CLOSE(): @@ -636,15 +639,17 @@ def readChar(fileHandle): global status status = 0 char = fileHandle.read(1) - if char=="": + if not char: status = 64 return "" - # determine, if we reached the end...whichm, or course, doesn't work ... because ... python ... - #chs = fileHandle.read(1) - #if chs=="": - # status = 64 - #fileHandle.seek(-1, 1) + # determine, if we reached the end... + chs = fileHandle.read(1) + #print(":",chs,":") + if not chs: + status = 64 + fileHandle.seek(-1, 1) # convert... + char = char.decode("ascii") if ord(char)==10: char = chr(13) return char @@ -680,8 +685,11 @@ def INTOUTCHANNEL(): def INPUTNUMBERCHANNEL(): global X_REG - out("[INPUT# not supported for PY, call ignored]") + global A_REG + INPUTSTRCHANNEL() X_REG=0 + if A_REG!="": + X_REG=float(A_REG) def openFile(number): key = "file"+str(int(number)) @@ -694,12 +702,13 @@ def INPUTSTRCHANNEL(): global A_REG global C_REG global _files + global status fileHandle = openFile(C_REG) A_REG="" stops = "\n\r:," while True: char = readChar(fileHandle) - if char=="" or char in stops: + if char=="" or char in stops or status==64: return A_REG+=char