This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
SuspendedFour


Newbie


Joined: 24 Feb 2011
Posts: 15

Posted: 24 Feb 2011 11:41:44 pm    Post subject:

The solution I'm looking exploring is to create my own shell (I can't use Mirage or anything because they're infamous for ruining(?) school calculators).
In order to pursue this solution, I need to understand how other shells run programs from flash.

Aside this point, is there any way to remove the need for Asm( in a self-contained manner (i.e. something that requires no access to external programs)?
That would be a cleaner solution.
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 25 Feb 2011 12:07:41 am    Post subject:

Unfortunately you would still need to run an app or assembly program manually that installs hooks for this. I will mention that I have a program ideas topic on this site that is about a project called LSDOS. LSDOS happens to be a shell in BASIC that uses 2 assembly programs that lets you do some things similar to what MirageOS could do. It will let you run programs whether they are in RAM or Archive and whether they are assembly or BASIC. It is still a work in progress, but there is a lot it can do.
-You can copy programs to strings, appvars, and other variables even if it is archived. You can do this with other variable types, too.
-You can execute variables like appvars and strings as if they were programs (they need program data, obviously)
-You can view the contents of variables even if they are archived

As a note, there are programs that work only with MirageOS or only with certain shells.

http://www.unitedti.org/forum/index.php?showtopic=9639&pid=143393&st=0&#entry143393
Back to top
SuspendedFour


Newbie


Joined: 24 Feb 2011
Posts: 15

Posted: 25 Feb 2011 12:32:00 am    Post subject:

Oh yeah, that was my backup solution: to create a BASIC program that will detect my assembly programs and run them. But that would require both an extra BASIC program and ASM program in addition to my ASM games, whereas a flash application that runs my ASM games wouldn't clutter the programs menu.

Mirage must have some way to call program code without helper programs because only the Mirage Application itself is required to run programs--do you know how it accomplishes this?
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 25 Feb 2011 01:03:29 am    Post subject:

Well technically apps are programs, but that is beside the point Very Happy. The way it calls the programs is fairly similar to the way LSDOS works. Plus, LSDOS works in a way so that if you wanted to, you could use it to convert all of your programs to archived appvars and have your users run those. This would remove the clutter of a programs menu and the programs wouldn't use up as much RAM.

Are you familiar with assembly per chance?


Last edited by Guest on 25 Feb 2011 01:04:46 am; edited 1 time in total
Back to top
montytyper


Newbie


Joined: 06 Nov 2010
Posts: 13

Posted: 25 Feb 2011 08:48:58 am    Post subject:

You could patch the OS so that running programs checks for ASM programs before invoking the BASIC parser. That might be the easiest thing to do, if you take care to resign the OS afterwards.
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 25 Feb 2011 08:57:05 am    Post subject:

I think he wants others to be able to easily use his programs... But I guess he could send an OS with his programs Very Happy
Back to top
NanoWar


Newbie


Joined: 21 Sep 2008
Posts: 30

Posted: 25 Feb 2011 02:20:49 pm    Post subject:

There is always NoShell (with source code):
http://www.ticalc.org/archives/files/fileinfo/400/40005.html
Back to top
mrmprog


Newbie


Joined: 04 Feb 2011
Posts: 44

Posted: 25 Feb 2011 07:11:03 pm    Post subject:

Or you could use my shell, once it is finished... Very Happy
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 25 Feb 2011 07:22:12 pm    Post subject:

By the way, when you do finish, would you mind sending me a link to the program? I kinda want to give it a spin Very Happy
Back to top
SuspendedFour


Newbie


Joined: 24 Feb 2011
Posts: 15

Posted: 25 Feb 2011 08:55:16 pm    Post subject:

ThunderBolt wrote:


Are you familiar with assembly per chance?


Haha, I have gotten past the level of incompetency for quite a while now, which is why I have this problem in the first place: my games in assembly require the Asm( token.
So if someone would show me some assembly code of how shells call programs from flash memory, that would be great.

Otherwise, I think I'll resort to Noshell, and I thank NanoWar for the excellent suggestion.

Post Script: Oh wait, I just saw that you mentioned Noshell includes source code; I'll wade around that and if I can't figure it out I'll come back for help.
Back to top
SuspendedFour


Newbie


Joined: 24 Feb 2011
Posts: 15

Posted: 26 Feb 2011 03:23:43 pm    Post subject:

Err, I'm having trouble getting a flash application to compile. I think I had everything set up correctly for Brass assembler (I use Latenite), but there's a problem with 32bit compatibility...

So my next step is to try to compile using TASM, but how do I tell it that it's compiling an application?

Edit: The error in Brass was in signing the application
"Error: Could not sign application: Retrieving the COM class factory for component with CLSID {89F8F7D6-C4E0-4B68-99A1-18C894D67A36} failed due to the following error: 80040154."

Edit II: Perhaps I should try to use Zilog Developer Studio, but just about every link in the world of TI programming is broken, and I couldn't find it on the zilog website.


Last edited by Guest on 26 Feb 2011 03:30:19 pm; edited 1 time in total
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 26 Feb 2011 03:43:53 pm    Post subject:

To use TASM to create an app you need to compile the code (using the proper header and .org 4000h) and then you need to change the .obj file to .hex and use Wappsign to sign it. I don't know much about computers or anything, like that, but I made this little batch file:

Code:
@echo off
tasm32 -80 %1
rename *.obj *.hex
pause

You can drag the .asm file over to it and it will compile it using TASM32 and changes any .obj files to .hex for you Very Happy
Back to top
SuspendedFour


Newbie


Joined: 24 Feb 2011
Posts: 15

Posted: 27 Feb 2011 03:39:45 pm    Post subject:

Much appreciated, works a charm.
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 27 Feb 2011 04:08:22 pm    Post subject:

Awesome ^-^ I'm glad I could help!
Back to top
SuspendedFour


Newbie


Joined: 24 Feb 2011
Posts: 15

Posted: 27 Feb 2011 05:38:20 pm    Post subject:

So after fiddling around in the Noshell source code I discovered that it uses a bcall(_ExecutePrgm) to call assembly programs. However, I am getting an INVALID error from the following code (TEST is an existent program that works fine when run with the Asm command). Is the problem perhaps an issue with RAM vs Flash memory?


Code:

_ExecutePrgm .equ $4E7C
   ld hl, name
   bcall(_Mov9toOP1)
   bcall(_ExecutePrgm)
   bjump(_JForceCmdNoChar)
name: .db "TEST", 0
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 28 Feb 2011 02:49:52 am    Post subject:

Yes, you need to have a starting byte of either 05 or 06 to start the name of a program. You should have:
name: .db 5,"TEST", 0

Also, as a pro tip, instead of using bcall(_Mov9ToOP1) you can save speed and 2 bytes by using rst 20h (the hex is E7). I hope that helps!
Back to top
SuspendedFour


Newbie


Joined: 24 Feb 2011
Posts: 15

Posted: 03 Mar 2011 12:17:27 am    Post subject:

Once again, thanks for helping--I got that working.

So I was just ready to deploy the app, but then once I send the application to my calculator I get an error!!
USB Communication failed--bad application signature.

I tried using both Wappsign and Wabbitsign, but neither seem to work. I searched around for this issue and it appears that people have had this problem, but no solution was ever provided.

The application works in the debuggers...

Here's my header

Code:
.db 080h,00Fh                                        ;Field: Program length
.db 00h,00h,00h,00h                                    ;Length=0
.db 080h,012h                                        ;Field: Program type
.db 01h,04h                                        ;Type= Shareware, TI-83Plus
.db 080h,021h                                        ;Field: App ID
.db 01h                                            ;Id = 1
.db 080h,031h                                        ;Field: App Build
.db 01h                                            ;Build = 1
.db 080h,048h                                        ;Field: App Name
.db "PhanApps"                        ;Name
.db 080h, 081h                                        ;Field: Number of pages
.db 001h                                            ;Pages: 1
.db 080h, 090h                                        ;Field: Security data
.db 003h, 026h, 009h, 004h                                ;Start of security data used with signing
.db 013h, 069h, 0DBh, 04Bh
.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                    ;End of security data used with signing
.db 80h,7Fh                                        ;Field: Program Image length
.db 0,0,0,0                                            ;Length=0, N/A
.db 000h, 000h, 000h, 000h                                ;padding
.db 000h, 000h, 000h, 000h                                ;padding
.db 000h, 000h, 000h, 000h                                ;padding
.db 000h, 000h, 000h, 000h                                ;padding
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 03 Mar 2011 03:29:01 am    Post subject:

Do you have the key file in the same directory (folder) as Wappsign?
Back to top
FloppusMaximus


Advanced Member


Joined: 22 Aug 2008
Posts: 472

Posted: 03 Mar 2011 09:09:23 pm    Post subject:

Could you post or send me a copy of the application file that isn't working?

Also, try RabbitSign. It's better. (And if it doesn't solve your problems, I really want to know about it. Smile)
Back to top
SuspendedFour


Newbie


Joined: 24 Feb 2011
Posts: 15

Posted: 03 Mar 2011 10:28:32 pm    Post subject:

>.< RabbitSign doesn't work either. Here are the details of the process so that someone may point out an error:

-I rename my latenite .asm source code to .z80

-TASM compiles .z80 to .hex:
tasm -q -i -80 temp.z80
rename *.obj *.hex

-RabbitSign signs application
rabbitsign temp.hex -o temp.8xk

-When I send temp.8xk to WabbitEmu, the application functions properly.
-When I send temp.8xk to my calculator I get a USB communication error, bad application signature.
-My calculator is an 84+ (is this the problem??)

Attached is the final output of the application.


Last edited by Guest on 03 Mar 2011 10:30:06 pm; edited 1 time in total
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page 1, 2  Next
» View previous topic :: View next topic  
Page 1 of 2 » All times are UTC - 5 Hours

 

Advertisement