Author Topic: Program concatenation  (Read 3470 times)

0 Members and 1 Guest are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Program concatenation
« on: October 19, 2011, 07:38:25 pm »
Another quick little Axe script to make coding easier. Edit the source to suit your needs, compile, and run prgmCONCAT to concatenate (add together) any set of programs.

The point is that you can now program TI-BASIC games in pieces (so you don't have to scroll for three minutes just to get to the end of a 20 KB program). The screenshot below has an example of how you could use it.

THINGS TO EDIT:

Before compiling, you must modify the pieces listed below, or the script will error. It shouldn't crash your calculator in any case, so if it does, accept my apologies, take a cookie, and please report the bug.

Quote from: Axe
"FO"
Zeros(6)
"OBAR"
Zeros(4)

These are the programs to be concatenated. You can have as many entries as you like (greater than zero). Each entry is composed of a string containing the program's name followed by however many null bytes are needed to pad it to eight bytes total. For a one-byte string, that's Zeros(7), for two bytes Zeros(6), and so on. No padding is needed if the program's name is already eight characters. (Zeros() is Buff() in Axe 1.0.5.)

Quote from: Axe
"prgmFOOBAR"Str1

This is the output program's name with prgm in front. No padding needed here. (The Zeros(8) instruction that follows is for a different purpose.)

Quote from: Axe
For(I,0,1)

That 1 should be changed to however many programs there are you want to concatenate (the number of entries in that program list above), minus one.

That should be it. Enjoy!

EDIT: Whoops, I didn't actually attach that screenshot I promised. Here it is!
« Last Edit: October 19, 2011, 09:37:36 pm by Deep Thought »




Offline XVicarious

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +45/-28
  • I F**king Love Twisty Puzzles
    • View Profile
    • XVicarious
Re: Program concatenation
« Reply #1 on: October 19, 2011, 07:59:29 pm »
Wow.  This is nice :D Very helpful.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Program concatenation
« Reply #2 on: October 19, 2011, 09:38:12 pm »
Updated so it doesn't crash when a program is 0 bytes long.