fabrice montupet Posted March 14, 2023 Share Posted March 14, 2023 (edited) Since some time, I have in mind a function that could be implemented into XB256 or TiCodED, if it is considered interesting. TI Basic offers the TRACE function that, in theory, is very useful to detail the behavior of a program when running and to catch possible bugs, unexpected routes.But TRACE has a big default that makes it unusable in most of the time: the listing of the lines in execution destroys the screen content that often makes graphical programs impossible to run correctly.Could be possible to make a sort of TRACE that creates a log file on a disk that contains all the lines executed until the program stops? I think that this log would be rich in information for any XB developer. Has my proposal some sense? Edited March 14, 2023 by fabrice montupet 3 1 Quote Link to comment Share on other sites More sharing options...
Retrospect Posted March 14, 2023 Share Posted March 14, 2023 Yes. A technical guru could possibly write a function for a command to do such a thing. ( not me !! ) ... some tech wizard out there might just know how to do this: LIST "TRACE" ... this would work like LIST "CLIP" for copying to clipboard in Classic99 except that it activates the TRACE command "silently" ... instead of spewing it all up over the screen it copies all the trace stuff into a clipboard, then you go to your notepad file and Ctrl-V or Paste, and it's all there. EDIT: Actually that's bullshit you need it to be "live" as you watch it unfold. Okay yeah I have no idea. 1 Quote Link to comment Share on other sites More sharing options...
1980gamer Posted March 14, 2023 Share Posted March 14, 2023 check this out... 1 1 Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted March 14, 2023 Author Share Posted March 14, 2023 13 minutes ago, 1980gamer said: check this out... Thank you, it's interesting! But the TRACE5 uses a part of the screen to display lines numbers (and this is what I would like a such tool doesn't). That said, it crashes when I load it with ti994w and when programming I only use this emulator. Quote Link to comment Share on other sites More sharing options...
RXB Posted March 14, 2023 Share Posted March 14, 2023 Well I have made a note to add this feature to XB but there is quite a bit of GPL and Assembly Code to be added or modified. Here is the routine to find TRACE flag: *********************************************************** [0594] * NUD / STATEMENT BRANCH TABLE [0595] *********************************************************** [0596] A13B 41,7D NUDTB BR RECX 'RECORD' 0 [0597] A13D 45,E8 BR NBREAK 'BREAK' 0 [0598] A13F 45,FA BR NUNBRK 'UNBREAK' 0 [0599] A141 45,DE BR NTRACE 'TRACE' 0 [0600] A143 45,E3 BR NUNTRC 'UNTRACE' 0 [0601] A145 41,80 BR NREADX 'READ' 0 [0602] A147 41,83 BR PRINTX 'PRINT' 0 [0603] A149 41,7A BR SZRUNX 'RUN' 0 [0604] A14B 41,9B BR LINPUX Reserved for LINPUT 1 [0605] A14D 41,86 BR RESTOX 'RESTORE' 1 [0606] A14F 43,35 BR NRNDMZ 'RANDOMIZE' 1 [0607] A151 41,89 BR INPUTX 'INPUT' 1 [0608] A153 41,8C BR OPENX 'OPEN' 1 [0609] A155 41,8F BR CLOSEX 'CLOSE' 1 [0610] A157 42,3C BR NPI 'PI' 1 [0611] A159 42,4C BR NMAX 'MAX' 1 [0612] A15B 42,59 BR NMIN 'MIN' 2 99/4 GPL-ASSEMBLER (Pass 3) correct PAGE 0011 RXB 2023 [0613] A15D 45,85 BR RPTZ01 'RPT$' 2 [0614] A15F 41,92 BR ACCEPX 'ACCEPT' 2 [0615] A161 41,77 BR EOFX 'EOF' 2 [0616] A163 44,79 BR ASC01 'ASC' 2 [0617] A165 45,1A BR POS01 'POS' 2 [0618] A167 44,B4 BR VAL01 'VAL' 2 [0619] A169 44,8A BR STRZ01 'STR$' 2 [0620] A16B 43,EF BR SEGZ01 'SEG$' 3 [0621] A16D 41,98 BR DELETX 'DELETE' 3 [0622] A16F 41,95 BR DISPLX 'DISPLAY' 3 [0623] A171 44,52 BR LEN01 'LEN' 3 [0624] A173 44,5E BR CHRZ01 'CHR$' 3 [0625] *RXB PATCH CODE FOR BASIC RND REPLACEMENT *********** [0626] A175 42,87 BR NRND 'RND' 3 [0627] * The following are long branches to another GROM [0628] A177 05,80,1C EOFX B EOF [0629] A17A 05,60,1E SZRUNX B SZRUN [0630] A17D 05,80,22 RECX B REC [0631] A180 05,80,0E NREADX B NREAD [0632] A183 05,80,04 PRINTX B PRINT [0633] A186 05,80,0C RESTOX B RESTOR [0634] A189 05,80,06 INPUTX B INPUT [0635] A18C 05,80,08 OPENX B OPEN [0636] A18F 05,80,0A CLOSEX B CLOSE [0637] A192 05,80,1E ACCEPX B ACCEPT [0638] A195 05,80,00 DISPLX B DISPL1 [0639] A198 05,80,02 DELETX B DELET [0640] A19B 05,80,30 LINPUX B LINPUT [0641] *********************************************************** [0642] * FLAGS USED IN EXECUTION MODE: this needs to be checked [0643] * @FLAG BIT RESET SET [0644] * 0 [0645] * 1 Warning PRINT PRINT off [0646] * 2 Warning NEXT STOP [0647] * 3 Not in UDF Executing a UDF [0648] * 4 TRACE mode Normal mode [0649] * 5 [0650] * 6 BREAK allowed BREAK not allowed [0651] * 7 No LST/EDT protect LIST/EDIT protected [0652] *********************************************************** [0653] * ON WARNING {NEXT | STOP | PRINT} [0654] * ON WARNING NEXT - Causes warning messages to be ignored [0655] * and execution to continue as if a [0656] * warning never occurred [0657] * ON WARNING STOP - Causes a warning to be treated as an [0658] * error - i.e. the message is displayed [0659] * and execution is halted [0660] * ON WARNING PRINT - Causes the default warning handling to [0661] * be in effect, i.e. any warning [0662] * messages are printed and execution [0663] * continues [0664] *********************************************************** Here is the code in GPL to use or not use TRACE: *********************************************************** [1292] * TRACE STATEMENT [1293] *********************************************************** [1294] A5DE B6,45,10 NTRACE OR >10,@FLAG Set the trace bit [1295] A5E1 0F,75 XMLCON XML CONT Continue on [1296] *********************************************************** [1297] * UNTRACE STATEMENT [1298] *********************************************************** [1299] A5E3 B2,45,EF NUNTRC AND >EF,@FLAG Reset the trace bit [1300] A5E6 0F,75 XML CONT Continue on [1301] *********************************************************** Finally here is the Assembly in XB ROM to show TRACE being used. 0974 * Loop for each statement in the program 0975 650E EXEC10 EQU $ 0976 650E D020 MOVB @FLAG,R0 Now test for trace mode 6510 8345 0977 6512 0A30 SLA R0,3 Check the trace bit in FLAG 0978 6514 115F JLT TRACL If set->display line number This line uses GPL to display the line number trace is on: 1142 * Trace a line (Call GPL routine) 1143 6672 C820 TRACE MOV @C2,@ERRCOD Load return vector 6674 6000 6676 8322 1144 6678 020B LI R11,EXEC11-2 Set up for return to execute 99/4 ASSEMBLER PARSES PAGE 0025 667A 6514 1145 667C 10F7 JMP CALGPL Call GPL to display line # 1146 * Special code to handle concatenate (&) 1147 667E 0200 CONC LI R0,CONCAT Go to GPL to handle it 6680 0008 1148 6682 10E7 JMP EXIT Exit to GPL interpeter And this line from above code: 1050 65D4 104E TRACL JMP TRACE Thus this happens each time a line is executed and interpreted in a XB program as that program is running with TRACE flag turned on. I can patch this code and the only place I could set up a PAB in XB for this is either RXB USER PAB or make a new one that would suck up some VDP memory. Good news it is doable for me. 1 Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted March 14, 2023 Author Share Posted March 14, 2023 18 minutes ago, RXB said: Good news it is doable for me. Keep it mind that this has for me no interest if this is for RXB. 2 Quote Link to comment Share on other sites More sharing options...
1980gamer Posted March 14, 2023 Share Posted March 14, 2023 This is a great feature, it is just another item to enhance RXB. You could use it even if you do not intend to finish the project in RXB. RXB is a superset of XB. As long as you use vanilla XB commands, you will only gain the speed of RXB's faster code. 1 Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted March 14, 2023 Author Share Posted March 14, 2023 I don't use RXB and I will not intend to. Please, could we end RXB mention in this thread, thank you. 1 Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted March 14, 2023 Share Posted March 14, 2023 The Myarc BASIC for the Geneve has a command called LTRACE that outputs to a device, such as a printer. I don't know that the code would be of any use to review, just mentioning it since the source is available, and might help someone in this venture. 4 1 Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted March 14, 2023 Author Share Posted March 14, 2023 Oh! It's very interesting, thank you 🙂 Quote Link to comment Share on other sites More sharing options...
RXB Posted March 15, 2023 Share Posted March 15, 2023 18 hours ago, fabrice montupet said: Keep it mind that this has for me no interest if this is for RXB. Honestly you are a party of 1 so good luck with that! 1 Quote Link to comment Share on other sites More sharing options...
RXB Posted March 15, 2023 Share Posted March 15, 2023 17 hours ago, fabrice montupet said: I don't use RXB and I will not intend to. Please, could we end RXB mention in this thread, thank you. Now that is just evil! 1 Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted March 15, 2023 Share Posted March 15, 2023 47 minutes ago, RXB said: Now that is just evil! If Fabrice has no interest in RXB, and says so in regards to his question, then no evil is afoot. What could be evil is multiple posts in defiance of the thread owner who has asked that the topic be dropped. This will be the end of the discussion so the topic can return to Fabrice's original request before the next page comes into play. Period. 5 2 Quote Link to comment Share on other sites More sharing options...
Retrospect Posted March 15, 2023 Share Posted March 15, 2023 18 hours ago, InsaneMultitasker said: The Myarc BASIC for the Geneve has a command called LTRACE that outputs to a device, such as a printer. I don't know that the code would be of any use to review, just mentioning it since the source is available, and might help someone in this venture. That's actually pretty cool. In my mind I was thinking of output to clipboard like list "clip" but with list "trace" ... then i realized it was a pretty crap idea. But listing to printer is great way of tracing without messed up screen. 2 Quote Link to comment Share on other sites More sharing options...
Retrospect Posted March 15, 2023 Share Posted March 15, 2023 22 hours ago, RXB said: 0978 6514 115F JLT TRACL If set->display line number @RXB Is there any way a modified XB could display this at position 0 on the screen ? (Basic position 1,1) For example, instead of spilling the TRACE number down the screen in a printed fashion, have it at position 0 and maybe enable a function key to stop/step without breaking? Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted March 15, 2023 Author Share Posted March 15, 2023 Quote Is there any way a modified XB could display this at position 0 on the screen ? (Basic position 1,1) For example, instead of spilling the TRACE number down the screen in a printed fashion, have it at position 0 and maybe enable a function key to stop/step without breaking? In the case of a solution that alter a part of the screen, the good solution is proposed by Harry with TRACE5. 2 Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted March 15, 2023 Author Share Posted March 15, 2023 (edited) I'm trying a way, inspired by Harry in the thread "Recursive example XB" where he proposes to read the address that contains the line number in execution. I'm currently testing with the emulator's debugger as it can create a log file. Edited March 15, 2023 by fabrice montupet 3 Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted March 15, 2023 Author Share Posted March 15, 2023 Apart of this, I succeed to make TRACE5 working with my program. As the ti994w emulator offers the way to manage the speed execution with a great flexibility, it is very easy to read all the lines in execution displayed in only 5 lines without missing one. The routine alters the top left part of the screen and in some cases, it can be a problem if it erases characters that are necessary for the program execution. A fine solution could be to be able to insert a value at the routine call permitting to select the TRACE5 area position among the four corners of the screen. Without replacing a sort of TRACE in a log file, this routine does a great job and can be extremely useful. It joins preciously in my developing tools. Thanks Harry 🙂 2 1 Quote Link to comment Share on other sites More sharing options...
oddemann Posted March 16, 2023 Share Posted March 16, 2023 Trace (#a number) 1=Upper left corner! 2=Upper right corner! 3=Lower right corner! 4=Lower left corner! 5=Middle of the screen! Then Trace post the line numbers at that position. If important info is in that spot, use another number for a stationary post of line numbers, as program is running! Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted March 16, 2023 Share Posted March 16, 2023 I am having a difficult time keeping this thread cleaned up without having to address complaints of "oh, my post was hidden, that's not fair." I am handling this without site mods, who can be far more heavy handed, unless you want them involved. The posts will stand as illustration. Now, enough. 2 Quote Link to comment Share on other sites More sharing options...
Albert Posted March 16, 2023 Share Posted March 16, 2023 23 minutes ago, OLD CS1 said: I am handling this without site mods... 1 Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted March 16, 2023 Author Share Posted March 16, 2023 2 hours ago, OLD CS1 said: I am having a difficult time keeping this thread cleaned up without having to address complaints of "oh, my post was hidden, that's not fair." I am handling this without site mods, who can be far more heavy handed, unless you want them involved. The posts will stand as illustration. Now, enough. Thank you for your moderation and the cleaning, I appreciate. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.