Jump to content

Photo

What's wrong with this A/L code?


6 replies to this topic

#1 wyerd OFFLINE  

wyerd

    Moonsweeper

  • 414 posts
  • Location:Lake George, NY

Posted Mon Dec 4, 2017 9:07 AM

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!



#2 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 3,989 posts
  • Location:Denmark

Posted Mon Dec 4, 2017 9:45 AM

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, Mon Dec 4, 2017 9:47 AM.


#3 adamantyr OFFLINE  

adamantyr

    Stargunner

  • 1,190 posts

Posted Mon Dec 4, 2017 11:10 AM

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.



#4 senior_falcon OFFLINE  

senior_falcon

    Dragonstomper

  • 960 posts
  • Location:Lansing, NY, USA

Posted Mon Dec 4, 2017 11:53 AM

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.



#5 wyerd OFFLINE  

wyerd

    Moonsweeper

  • Topic Starter
  • 414 posts
  • Location:Lake George, NY

Posted Mon Dec 4, 2017 12:41 PM

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 .



#6 adamantyr OFFLINE  

adamantyr

    Stargunner

  • 1,190 posts

Posted Mon Dec 4, 2017 12:51 PM

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.



#7 ralphb ONLINE  

ralphb

    Dragonstomper

  • 533 posts
  • Location:Germany

Posted Yesterday, 3:33 AM

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.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users