Asmusr Posted April 5, 2023 Share Posted April 5, 2023 (edited) Thanks for looking into this. I think I would prefer option 2 or 3, but I'm not sure what the difference is. If 3 would mean that only macro calls had to be changed, that would be my preferred. Another thing with requs is that tmp0: requ 0 doesn't work with a colon after the label. And a question: is it possible to have separate name spaces within the same IDEA project, e.g. if I would like to be able to have identical labels for different game levels (assembled separately)? Edited April 7, 2023 by Asmusr 1 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted April 7, 2023 Share Posted April 7, 2023 Me again. How can you calculate the MSB and LSB of a label greater than >8000? I thought you could always use /256 and %256, but the second example below gives the wrong answer. I need this in order to generate low endian data. 0526 test1: 0527 equ >2090 0528 EA88 2090 byte test1/256,test1%256 0529 EA8A 2090 data test1 0530 test2: 0531 equ >a020 0532 EA8C A1E0 byte test2/256,test2%256 0533 EA8E A020 data test2 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted April 7, 2023 Share Posted April 7, 2023 (edited) 2 hours ago, Asmusr said: How can you calculate the MSB and LSB of a label greater than >8000? To answer my own question, it looks like this is working: byte (test2&>ff00)/256,test2&>00ff Edited April 7, 2023 by Asmusr Quote Link to comment Share on other sites More sharing options...
ralphb Posted April 7, 2023 Author Share Posted April 7, 2023 (edited) 5 hours ago, Asmusr said: To answer my own question, it looks like this is working: byte (test2&>ff00)/256,test2&>00ff Are you sure about that? I implemented signed multiplication and division, so that still shouldn't work. But I guess we need unsigned operations as well, and while I'm at it, shift operations as well. I hadn't added shift operators yet because >> conflicts with the hex prefix >. But I'll figure something out. EDIT: OK, that sentence made no sense before. Edited April 7, 2023 by ralphb Quote Link to comment Share on other sites More sharing options...
ralphb Posted April 7, 2023 Author Share Posted April 7, 2023 On 4/5/2023 at 6:59 PM, Asmusr said: Another thing with requs is that tmp0: requ 0 doesn't work with a colon after the label. And a question: is it possible to have separate name spaces within the same IDEA project, e.g. if I would like to be able to have identical labels for different game levels (assembled separately)? That's odd -- I'm getting a different value if the colon is present. I'll have to check this. I'll have to do some research if a Namespace-like feature is possible, as IDEA treats all files as one project. The duplicate label, unused label, etc. checks can be implemented per file, but I'm not sure about more basic things like code completion, go-to-definition and so on. I'll check this, too. 3 Quote Link to comment Share on other sites More sharing options...
ralphb Posted April 9, 2023 Author Share Posted April 9, 2023 I've pushed new versions of xas99 and xga99 with support for unsigned division // and %% and logical shift operators >> and <<. I also fixed the REQU bug. I'm still working on the IDEA macro issue, which might take some time. But in the meantime, I could create a plugin that favors labels over register aliases, if you prefer. 7 Quote Link to comment Share on other sites More sharing options...
GDMike Posted April 9, 2023 Share Posted April 9, 2023 (edited) You are always all over the fixes. Ty Edited April 9, 2023 by GDMike 1 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted April 10, 2023 Share Posted April 10, 2023 20 hours ago, ralphb said: I'm still working on the IDEA macro issue, which might take some time. But in the meantime, I could create a plugin that favors labels over register aliases, if you prefer. Thank you, but it's not that urgent. Quote Link to comment Share on other sites More sharing options...
ralphb Posted April 15, 2023 Author Share Posted April 15, 2023 (edited) I've just pushed a new IDEA plugin, which you can download here. Macro call arguments are now parsed correctly, which wasn't actually that difficult after I learned how it's done. The only downside of this change is that now even more code runs when editing a line. Let me know If IDEA becomes too sluggish. In addition to macro calls, I also fixed a bug that caused preprocessor commands without arguments to be shown as erroneous. Edited April 15, 2023 by ralphb 3 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted April 15, 2023 Share Posted April 15, 2023 2 hours ago, ralphb said: I've just pushed a new IDEA plugin, which you can download here. Macro call arguments are now parsed correctly, which wasn't actually that difficult after I learned how it's done. The only downside of this change is that now even more code runs when editing a line. Let me know If IDEA becomes too sluggish. In addition to macro calls, I also fixed a bug that caused preprocessor commands without arguments to be shown as erroneous. Very nice. The only thing now is that in .ifeq start_at_level,3 the comma is marked as an error. The CPU and memory usage in IDEA is a bit concerning. I don't know if it got worse with the last update, but the source code for Trap Door is using a lot of resources. You can try for yourself: https://github.com/Rasmus-M/trapdoor. This is probably difficult to do anything about, and so far my machine has been able to cope with it. Quote Link to comment Share on other sites More sharing options...
ralphb Posted April 16, 2023 Author Share Posted April 16, 2023 I've pushed a new plugin version that fixes the non-macro parsing. Later I'll have a look at your project, but I guess IDEA just really is a resource hog. When debugging my plugin, the sheer amount of code that is running outside the plugin is staggering. 2 Quote Link to comment Share on other sites More sharing options...
Sergioz82 Posted June 24, 2023 Share Posted June 24, 2023 (edited) Hi, I have a problem with xas99.py in Linux Mint. When I run the script I get the errors below, but if I compile the same code on Windows it works fine. I also get this problem on another Windows PC, but in happens when I run the script in "Portable Python-3.10.5 x64" through PyScripter-Launcher.exe. Basically Run command in the launcher gives me the same error, but if I select the option "run external" it works fine. $ xas99.py -b -R banked.asm -L bit.lst Any idea of what it could be? If I comment COPY "BITMAP.asm" I get normal errors of missing references in BITMAP.asm but the errors below are gone. Python versions on Mint (v21.1) are 3.10.6 and 3.11.4 XDT99 version is 3.6.0 EDIT: I copied the Python folder in portable python 3.10.5 on Linux Mint, then modified build.sh to execute the command "wine /Python/python.exe /usr/local/sbin/xas99.py ..." and it works. Quote media/sergio/Chiavetta/Emulatori/FatuoASM$ . build.sh : xas99, version 3.6.0 > BITMAP.asm <1> 0059 - COPY "BITMAP.asm" ***** Error: Syntax error > VDPUTILS.asm <1> 0008 - INITBM MOV R11,R12 ***** Error: Duplicate symbol: INITBM > VDPUTILS.asm <1> 0027 - INITST MOV R11,R12 ***** Error: Duplicate symbol: INITST > VDPUTILS.asm <1> 0030 - L1 CLR R1 ... > VDPUTILS.asm <2> 0107 - JNE VMBW1 ***** Error: Out of range: VMBW1 +/- -0x82 > SETS.asm <2> **** - ***** Warning: Unused constants: l1c:6, l1p:263 > LEVELS.asm <2> **** - ***** Warning: Unused constants: strtl1:11, ragno:56, ppstrel:58, panel:64, panelp:90, panelc:124 > SPRPATT.asm <2> **** - ***** Warning: Unused constants: fr2dx:72, fr1sx:89, fr2sx:105, fr1up:123, fr2up:139, fr1dw:157, fr2dw:173, bat1:191, bat2:207, spd1dx:224, spd2dx:240, spd1sx:256, spd2sx:272 58 Errors found. Edited June 24, 2023 by Sergioz82 Quote Link to comment Share on other sites More sharing options...
ralphb Posted June 25, 2023 Author Share Posted June 25, 2023 13 hours ago, Sergioz82 said: I have a problem with xas99.py in Linux Mint. When I run the script I get the errors below, but if I compile the same code on Windows it works fine. This is quite strange. Could you please try something? In file xas99.py, please comment out lines 859, 861 and 862 (should be try/except/raise) and try again on Linux. What error do you get now? Quote Link to comment Share on other sites More sharing options...
Sergioz82 Posted June 25, 2023 Share Posted June 25, 2023 47 minutes ago, ralphb said: This is quite strange. Could you please try something? In file xas99.py, please comment out lines 859, 861 and 862 (should be try/except/raise) and try again on Linux. What error do you get now? Now I get this, also using python 3.10.5 Both symbols are defined Quote . build.sh : xas99, version 3.6.0 > banked.asm <2> 0055 - CLR @BNKW0 ***** Error: Unknown symbol: BNKW0 > banked.asm <2> 0056 - B @INIT ***** Error: Unknown symbol: INIT 2 Errors found. Quote Link to comment Share on other sites More sharing options...
ralphb Posted June 25, 2023 Author Share Posted June 25, 2023 Would it be possible for you to share the code in question? Either post a link, or mail to r@ti99.pro. Quote Link to comment Share on other sites More sharing options...
Sergioz82 Posted June 26, 2023 Share Posted June 26, 2023 17 hours ago, ralphb said: Would it be possible for you to share the code in question? Either post a link, or mail to r@ti99.pro. Ok, I'll send it in a email Quote Link to comment Share on other sites More sharing options...
ralphb Posted June 27, 2023 Author Share Posted June 27, 2023 You COPY'ed file BITMAP.asm contains an invalid Unicode char in the word "più": UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf9 in position 5103: invalid start byte (not shown without removing one except clause, though) You probably used a different encoding. So, either use the UTF-8 encoding or don't use non-ASCII chars. I don't know why the behavior is different for earlier Python versions, but my guess is that they removed some ambiguity about the encoding for text mode open(). 1 Quote Link to comment Share on other sites More sharing options...
Sergioz82 Posted June 28, 2023 Share Posted June 28, 2023 17 hours ago, ralphb said: You COPY'ed file BITMAP.asm contains an invalid Unicode char in the word "più": UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf9 in position 5103: invalid start byte (not shown without removing one except clause, though) You probably used a different encoding. So, either use the UTF-8 encoding or don't use non-ASCII chars. I don't know why the behavior is different for earlier Python versions, but my guess is that they removed some ambiguity about the encoding for text mode open(). Oh ok. I'm using Emacs and I'm not very used to it, I saw there's an option to change the text encoding, I'll try to set it to UTF-8. Besides, sometimes I code on Crimson Editor on Windows 10, probably I also messed up something by moving the files back and forth. I'll try UTF-8, if iy won't work I'll delete the word, it's not important. Thanks for the support! 1 Quote Link to comment Share on other sites More sharing options...
JasonACT Posted October 13, 2023 Share Posted October 13, 2023 (edited) This is a great software package, so thank you for making it available. I have a couple of things to report, none are enough to make me want to use anything else though... Even though I'm useless with Python myself. The disassembler creates DATA statements for "TB" (0x1F) but my usage has a negative offset (" TB -11") so maybe that's the cause (I really can't tell - Python???). Thierry's TI DISK DSR has 4 instructions that don't assemble (no big deal, I just comment them out and stick in 3 DATA statements from the original bytes)... A4D94 MOVB @>004D(9),@>004D(9) near A5B38: MOV @>0050(9),@>004A(9) copy sector # near A5D5A: MOVB @>0050(9),@>0050(9) test result SZCB @>0042(9),@>0042(9) clear current token Anyway, enough from me... Thanks again for making this time saving software package available! Edited October 13, 2023 by JasonACT Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted October 13, 2023 Share Posted October 13, 2023 1 hour ago, JasonACT said: Thierry's TI DISK DSR has 4 instructions that don't assemble (no big deal, I just comment them out and stick in 3 DATA statements from the original bytes)... A4D94 MOVB @>004D(9),@>004D(9) near A5B38: MOV @>0050(9),@>004A(9) copy sector # near A5D5A: MOVB @>0050(9),@>0050(9) test result SZCB @>0042(9),@>0042(9) clear current token Those statements have only one space between the instruction and comments. There must be at least two spaces for xas99 to recognize the comments. Otherwise, xas99 tries to include the comments as part of the instruction, which will obviously fail. The reason for this is that xas99 allows single spacing of operands and operand expressions—something not allowed by the TI assembler. ...lee 3 1 Quote Link to comment Share on other sites More sharing options...
dasch Posted October 13, 2023 Share Posted October 13, 2023 @ralphb Let me add my voice to the praise of xdt99. xas99 has been enormously helpful in reconstituting the Munch Man source from the PDF. I must admit that I was initially caught out by the two-space-comment-field initially, though since I had to add a whole bunch of '@'s, my preservation of the original formatting had to give way at times. Barring that, I appreciate the strict mode. Plus, the superlative documentation turned out to be a highlight of the project. Thank you! -- David 1 Quote Link to comment Share on other sites More sharing options...
JasonACT Posted October 13, 2023 Share Posted October 13, 2023 10 hours ago, Lee Stewart said: Those statements have only one space between the instruction and comments. There must be at least two spaces for xas99 to recognize the comments. Otherwise, xas99 tries to include the comments as part of the instruction, which will obviously fail. The reason for this is that xas99 allows single spacing of operands and operand expressions—something not allowed by the TI assembler. ...lee Thanks Lee, that has allowed me to clean up the code nicely. I stuck a semi-colon in instead, to remind me. On the disassembler side, I think the opcbitmask array should end with 8 instead of 12 to pick up negatives in "format 12" instructions (SBO, SBZ & TB). Quote Link to comment Share on other sites More sharing options...
ralphb Posted October 16, 2023 Author Share Posted October 16, 2023 On 10/14/2023 at 12:44 AM, JasonACT said: Thanks Lee, that has allowed me to clean up the code nicely. I stuck a semi-colon in instead, to remind me. On the disassembler side, I think the opcbitmask array should end with 8 instead of 12 to pick up negatives in "format 12" instructions (SBO, SBZ & TB). For legacy sources that won't assemble as-is, you can use the strict syntax option -s to restore the original E/A syntax. Regarding the disassembler, negative numbers are displayed as positive two's-complement, so -1 is displayed as >FF or >FFFF, depending on the size of the field. For TB, -11 and >1F are not equal (-11 would display as >F5), though, so there might be a bug if those are actual numbers. Note that the value field of SBO, SBZ, TB is 8 bit wide, so opcbitmask[12] == 8 should be correct, or did I misunderstand you? 1 Quote Link to comment Share on other sites More sharing options...
JasonACT Posted October 17, 2023 Share Posted October 17, 2023 12 hours ago, ralphb said: Note that the value field of SBO, SBZ, TB is 8 bit wide, so opcbitmask[12] == 8 should be correct, or did I misunderstand you? Not sure if you misunderstood. It's 12 in GitHub... (#special formats: 16, 12, 12, I think it should be 16, 12, 8 - at least, that worked for my disassemly.) 1 Quote Link to comment Share on other sites More sharing options...
ralphb Posted October 17, 2023 Author Share Posted October 17, 2023 9 hours ago, JasonACT said: Not sure if you misunderstood. It's 12 in GitHub... (#special formats: 16, 12, 12, I think it should be 16, 12, 8 - at least, that worked for my disassemly.) Oops, you're right, of course, I simply cannot count! I'll make a fix that changes the value to 8. Thanks for pointing it out. 1 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.