Jump to content
IGNORED

xdt99: New TI 99 cross-development tools available


ralphb

Recommended Posts

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 by Asmusr
  • Like 1
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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 by Asmusr
Link to comment
Share on other sites

Posted (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 by ralphb
Link to comment
Share on other sites

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.

  • Like 3
Link to comment
Share on other sites

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.

  • Like 7
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Posted (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 by ralphb
  • Like 3
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 months later...

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 by Sergioz82
Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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.


 

Link to comment
Share on other sites

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().

 

  • Thanks 1
Link to comment
Share on other sites

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!

 

 

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...