Author Topic: Running ASM programs larger than 8 KB  (Read 7619 times)

0 Members and 2 Guests are viewing this topic.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Running ASM programs larger than 8 KB
« on: January 01, 2011, 08:41:44 pm »
I'm wondering: If an asm program is archived, does the calculator make sure that it doesn't go across two pages unless absolutely necessary?  If that's the case, running larger ASM programs without SMC is theortically possible, as long as they are archived

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Running ASM programs larger than 8 KB
« Reply #1 on: January 01, 2011, 09:11:48 pm »
No guarantee of that at all AFAIK. It can't cross sector boundaries, but there is no guarantee it won't cross page boundaries.
Even for programs that don't, you have to deal with the fact that they could be at any address, and you need to write localized code. (which, on the z80, is somewhat inconvenient. No direct calls or jumps, for instance. It's not impossible, though)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: Running ASM programs larger than 8 KB
« Reply #2 on: January 01, 2011, 09:20:39 pm »
No.  Each archive sector is a separate "box" that can hold up to 64k of variables.  So a single variable can't cross a sector boundary.  But the OS will pack variables as tightly as it can into each box, not worrying about the internal page boundaries.

Also, the archive area is restricted; if you try to execute code there, the calculator will reset, just as if you try to execute code on RAM page zero.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Running ASM programs larger than 8 KB
« Reply #3 on: January 01, 2011, 09:22:34 pm »
No.  Each archive sector is a separate "box" that can hold up to 64k of variables.  So a single variable can't cross a sector boundary.  But the OS will pack variables as tightly as it can into each box, not worrying about the internal page boundaries.

Also, the archive area is restricted; if you try to execute code there, the calculator will reset, just as if you try to execute code on RAM page zero.

Then why are applications able to run?  Do they fall under "not archive?"

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: Running ASM programs larger than 8 KB
« Reply #4 on: January 01, 2011, 09:29:06 pm »
Right.  The OS adjusts the limits whenever you install or delete an application.  On the SE/84+, the "archive area" is defined by ports 22 and 23; on the 83+ BE, pages can be individually enabled or disabled using port 16.  All these ports are protected so that user programs can't (normally) modify them.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Running ASM programs larger than 8 KB
« Reply #5 on: January 01, 2011, 10:09:14 pm »
Could one theoretically unlock flash, write a routine to output to protected ports to a privileged page, and adjust those ports? Will the OS change them outside of receiving/deleting apps?
On a related note, WikiTI's Port $05 page makes it seem like, on a regular TI-83+, the execution protection could be removed. Do you know if this is possible?
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: Running ASM programs larger than 8 KB
« Reply #6 on: January 01, 2011, 10:17:13 pm »
Could one theoretically unlock flash, write a routine to output to protected ports to a privileged page, and adjust those ports?
Yes, theoretically, that should be possible.  The simplest way to adjust the Flash execution limits, though, is to use the BCALL 80CF.
Quote
Will the OS change them outside of receiving/deleting apps?
I don't think so, but I'm not sure.
Quote
On a related note, WikiTI's Port $05 page makes it seem like, on a regular TI-83+, the execution protection could be removed. Do you know if this is possible?
I believe so.
« Last Edit: January 01, 2011, 10:20:03 pm by FloppusMaximus »

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Running ASM programs larger than 8 KB
« Reply #7 on: January 01, 2011, 10:22:35 pm »
That's rather simple :)
What of executing on RAM page 0 on an 83+? Or was that what you answered yes to?
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Running ASM programs larger than 8 KB
« Reply #8 on: January 01, 2011, 11:27:05 pm »
So theoretically, one could pirate applications as ASM programs :angel:

By the way, couldn't one simply change the application header to make an application valid without needing a certificate (therefore making it free)?
« Last Edit: January 01, 2011, 11:30:09 pm by Hot_Dog »

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Running ASM programs larger than 8 KB
« Reply #9 on: January 02, 2011, 05:54:10 pm »
So theoretically, one could pirate applications as ASM programs :angel:

By the way, couldn't one simply change the application header to make an application valid without needing a certificate (therefore making it free)?
I don't think so. I know that there is a patch that makes all apps seem valid when receiving, though.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Running ASM programs larger than 8 KB
« Reply #10 on: January 04, 2011, 01:29:55 am »
The 8 KB limit was added to prevent the conversion of paid APPs to 8xp files, right?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Running ASM programs larger than 8 KB
« Reply #11 on: January 04, 2011, 01:33:20 am »
Supposedly, although who knows with TI :/ Maybe it was an accident, and they don't know how to fix it :P

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Running ASM programs larger than 8 KB
« Reply #12 on: January 04, 2011, 02:02:33 am »
Supposedly, although who knows with TI :/ Maybe it was an accident, and they don't know how to fix it :P

I'm pretty sure it was done intentionally.  A processor that "locks up" to prevent larger sizes is no coincidence from TI, because Zilog would have been sued for something like that.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Running ASM programs larger than 8 KB
« Reply #13 on: January 04, 2011, 02:14:48 am »
Lol i was half joking, but yeah i know what you mean

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Running ASM programs larger than 8 KB
« Reply #14 on: January 04, 2011, 02:19:35 am »
Oops, of course  :-[