Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: ZippyDee on May 19, 2011, 03:48:03 pm

Title: How are apps different?
Post by: ZippyDee on May 19, 2011, 03:48:03 pm
If I wanted to write an app instead of just a normal program, what would I have to do differently? More simply: How different is it from writing a program?
Title: Re: How are apps different?
Post by: ben_g on May 19, 2011, 03:52:34 pm
An app has a special header, and i think using 'ret' wouldn't return to the OS, but I'm not sure of that.

O, Almost forgot: an app becomes larger in 'pages', and needs to be signed to transfer to a calc
Title: Re: How are apps different?
Post by: ZippyDee on May 19, 2011, 03:53:45 pm
Well I know it has a special header, but I'm talking more about things like knowing 'ret' doesn't return to the OS (if indeed that is true). That would be an important thing to know.
Title: Re: How are apps different?
Post by: aeTIos on May 19, 2011, 03:59:37 pm
You cant use shell routines in your apps, so you have to write them yourself or copy them from the web.
Title: Re: How are apps different?
Post by: thepenguin77 on May 19, 2011, 05:25:21 pm
When you write an app, you have to do some different things to make it run on the calculator.
1. Your code will be running from the $4000-$7FFF page, which means you need to do .org $4000 instead of .org $9D95
2. You need a header, (which you can get from here (http://education.ti.com/calculators/downloads/US/Software/Download/en/177/6653/appheader.zip))
3. You will have to use bcall(_jForceCMDNoChar) or similar to return as the OS jp's to the app, it doesn't call it
4. Most bcall's that take ptr's for inputs won't work if you give them an address in the $4000-$7FFF area. What this means is that you either need to reimplement bcall(_putS) with bcall(_putC), or copy all your strings to ram before displaying them
5. Obviously, don't change port 06 unless you have copied your routine to ram


6. And most importantly, you must compile your program for hex and then sign it, I would highly suggest that you just use spasm and make the output .8xk rather than .8xp. This will save you a lot of trouble.
Title: Re: How are apps different?
Post by: ZippyDee on May 19, 2011, 05:38:37 pm
Thanks so much for all the information! Sadly, I'm currently on my Mac, and therefore can't run AppHeader.exe. Is there some place I can see a template for app headers and write my own based off of that?
Title: Re: How are apps different?
Post by: thepenguin77 on May 19, 2011, 05:51:01 pm
This is the default one that it gives you. I would assume that if you change "MYAPP" to your app name it should work.

Code: [Select]
include "ti83plus.inc"

 db 080h, 00Fh
 db 000h, 000h, 000h, 000h
 db 080h, 012h
 db 001h, 004h
 db 080h, 021h
 db 001h
 db 080h, 031h
 db 001h
 db 080h, 048h
 db "MYAPP", 000h, 000h, 000h
 db 080h, 081h
 db 001h
 db 080h, 090h
 db 003h, 026h, 009h, 004h
 db 01Bh, 00Bh, 0AEh, 0F0h
 db 002h, 00Dh, 040h, 0A1h, 06Bh, 099h, 0F6h, 059h, 0BCh, 067h
 db 0F5h, 085h, 09Ch, 009h, 06Ch, 00Fh, 0B4h, 003h, 09Bh, 0C9h
 db 003h, 032h, 02Ch, 0E0h, 003h, 020h, 0E3h, 02Ch, 0F4h, 02Dh
 db 073h, 0B4h, 027h, 0C4h, 0A0h, 072h, 054h, 0B9h, 0EAh, 07Ch
 db 03Bh, 0AAh, 016h, 0F6h, 077h, 083h, 07Ah, 0EEh, 01Ah, 0D4h
 db 042h, 04Ch, 06Bh, 08Bh, 013h, 01Fh, 0BBh, 093h, 08Bh, 0FCh
 db 019h, 01Ch, 03Ch, 0ECh, 04Dh, 0E5h, 075h
 db 080h, 07Fh
 db 000h, 000h, 000h, 000h
 db 000h, 000h, 000h, 000h
 db 000h, 000h, 000h, 000h
 db 000h, 000h, 000h, 000h
 db 000h, 000h, 000h, 000h