Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Hello

I wanted to know if it was possible to create a program from a mother program? If so how and preferably in Basic (on ti 83 Pce)

To be clear I would like to execute the program "chicken" (for example) and at the end of its execution, an egg program appears and it is executable (it disp "crac" for example)
Not in pure BASIC. I'm sure somebody else could provide some kind of minimal program implemented in some language that compiles/assembles to machine code that can do it.
Thank you for your answer, I have another idea, it is to store the program in the str0 and make a reply to paste it manually but the problem is that we can not store " in the string
Do you have an idea ?
You cannot directly store double quotes in a string, but there are two ways around that. You can use TextLib's command 26 to get a string with the double quotes symbol, and then concatenate that as-needed; or you can create such a string on-calc yourself. The downside to creating the string yourself on-calc is that you can't do it from a program. To get the double quotes and store ( -> ) symbols into a string, type them on the homescreen and then press enter. You'll get a syntax error. Then press Y= and then 2nd+Enter. This will cause what you last typed on the homescreen to appear in Y1. Then you can go back to the homescreen and use the Equ>Str command found in the Catalog to store the contents of Y1 back into a string.
Alternatively, you could also put a prompt like this at the beginning of your program:

Code:
Disp "Please type a double quote:"
Input Str1
/* Str1 now equals " */
Str1 + "HELLO" + Str1 -> Str2
/* Str2 now equals "HELLO" */
thanks, what's the limit for a str on tu 83 Pce ?
9999 maybe I'm not sure
I think 9999 bytes is correct (but, the ClrHome command, for instance, is 2 bytes long)
Thank you for your answer, unfortunately the size of a str is not enough for me stored my program, and it is not very practical to have to reply the str...
Would you have a solution to do it in ASM Automatically?
thank you very much for your time 🙏
Up ?
Would you have a solution to do it in ASM Automatically?
Out of boredom I decided to do this…
Code:
Asm84CEPrgm21A5A8D1CD200302CD0C0502D021060000CD6805021313219FA8D1EDB0C9DE2A435241430545474700
If the program already exists, this snippet will not overwrite it. (Hopefully you have OS 5.3.0.0037 or below so you have access to the Asm84CEPrgm/Asm83CEPrgm token, if not you can see how to downgrade your OS here.) Don't forget to compress/squish this program with AsmComp( before execution or execute it with Cesium.

Here is a slightly commented version of the eZ80:

Code:
.nolist
#include "ti84pce.inc"
.list
   .db    tExtTok,tAsm84CECmp
   .org   UserMem
   
   ld     hl, Name
   call   _Mov9ToOP1       ; move to name to OP1
   call   _ChkFindSym      ; try to find it
   ret    nc               ; return if it exists
   ld     hl, Name-Contents
   call   _CreateProg      ; hl -> bc, de -> location of program
   inc    de
   inc    de               ; bypass size bytes
   ld     hl, Contents
; copy in the data (hl->data location, bc->amount of data, de->copy location)
   ldir
   ret                     ; return
Contents:
   .db    tDisp,tString,"CRAC"
Name:
   .db    ProgObj,"EGG",0  ; playing it safe by not assuming Usermem is nulls

Enjoy.
Thx LogicalJoe
just we can't write lowercase ?
For example to write "Crac"

Thx for your help
Lowercase letters use two-byte tokens that do not have the same values as the ASCII lowercase letters. You will have to use the token values, e.g.

Code:
.db tDisp,tString,"C",t2ByteTok,tLsmallr,t2ByteTok,tLa,t2ByteTok,tLc

You can find a list of token values on tibasicdev, though the actual names of the tokens are really inconsistent and can be found in ti84pce.inc.

There's probably a better way to do this but I'm not sure exactly how.
Sure you can!
Code:
Asm84CEPrgm21A8A8D1CD200302CD0C0502D021090000CD6805021313219FA8D1EDB0C9DE2A43BBC2BBB0BBB20545474700
afk right now so this may or may not be correct, I will check it when I get the chance.
sorry i'm not very comfortable with ASM, how to switch from hexadecimal to ez80 text ?
Or can you please send me the eZ80 texte Smile
  
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
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement