Jump to content
IGNORED

What's wrong with this A/L code?


wyerd

Recommended Posts

I've been reading all the books I can find on Assembly Language, one of them being Computes which is really for the Mini Memory cart. So I'm having a go converting to E/A and failing miserably!

 

For example, there's some code that moves the @ symbol across the screen and repeats, but the code fails to run.

       DEF START
       REF VSBW	  
*
START  LIMI 0
       LWPI >8300
L1     CLR R0
L2     LI R1,>4000
       BLWP @VSBW
       LI R1,>2000
       BLWP @VSBW
       INC R0
       CI R0,31
       JNE L2
       JMP L1
       END

I think it has something to do with R0, maybe...

 

Any ideas on the problem?

 

Thanks!

Link to comment
Share on other sites

L2     LI R1,>4000
       BLWP @VSBW

Writes the @ to the screen. All things being equal, like assuming VDP is set to have the screen at >0000 indicated by R0 etc.

 

       LI R1,>2000
       BLWP @VSBW

Immediately overwrites the @ with a SPACE (clearing it). All in all it's done so quickly that you won't see it.

 

Try and remove the two lines that write the SPACE. Just to see a line of @'s. ;)

Edited by sometimes99er
  • Like 1
Link to comment
Share on other sites

Yeah, that example in the book... I don't think the author ever actually ran it on the TI... You would NEVER see the '@' because it's moving in micro-second time-frames.

 

There has only been one major assembly routine I've written that was so computationally expensive I didn't have to put in a real-time delay, and that was the "line of sight" algorithms in my CRPG. It does a LOT of computations on every square in a 13x13 matrix to determine if they're visible or not.

  • Like 1
Link to comment
Share on other sites

That program runs fine on the E/A. The @ zooms by so fast it is hard to see, but it is there. Sometimes' advice is good for a test. Or you could put in a delay loop after the first VSBW. Something like:

LI R2,2000 (decimal, not hex)

DELAY DEC R2 (dec compares to zero)

JNE DELAY (keep looping until R2 is 0)

 

This tames it nicely.

  • Like 1
Link to comment
Share on other sites

Thanks for the response guys. I appreciate it.

 

It looks like the issue I'm having is with my setup. I'm running the XDT99 tool to create the object code and Classic99 with the XB27 cart. When I enter the E/A 3 filename, it prompts again for the filename. If I hit enter, it prompts for the program name, enter START and the @ sign zooms across the screen. I used TIImage tool to create the disk image and I'm running Windows 10 :-o .

Link to comment
Share on other sites

Ah, I was going to ask how you were executing it! :)

 

Reading over the old Compute! book, I can't believe anyone could write anything in the line-by-line assembler... The fact the assembler itself uses MOST of the 4K RAM, yikes... You pretty much can't write anything substantial without the 32K RAM, at which point you may as well use the Editor/Assembler.

Link to comment
Share on other sites

  • 2 weeks later...

I'm running the XDT99 tool to create the object code and Classic99 with the XB27 cart. I used TIImage tool to create the disk image and I'm running Windows 10 :-o .

 

Just for your information, you can also use xdt99 to create a disk image:

.

xdm99.py -X SSSD work.dsk -a yourfile.obj -f disfix80 -n YOURFILE/O

.

which means to create a SS/SD disk image (-X), add your file (-a) in DIS/FIX 80 format (-f) and given name (-n).

 

But Classic99 doesn't use disks natively, so you can also use

.

xdm99.py -T yourfile.obj -9 --ti-names

.

which creates a so-called TIFILES file (-T) with reduced header (-9 for Classic99 or v9t9 emulators) and TI-compatible name (--ti-names).

 

You could even put both commands into a batch file, so you won't have to type them each time you want to assemble.

  • 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...