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
mrmprog


Newbie


Joined: 04 Feb 2011
Posts: 44

Posted: 05 Feb 2011 03:44:45 pm    Post subject:

Does anyone have a hexcode that can be entered on-calc that would detect the programs on the calculator?

Last edited by Guest on 05 Feb 2011 03:45:44 pm; edited 1 time in total
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 05 Feb 2011 03:54:15 pm    Post subject:

How do you mean? Like do you mean return a list of all the programs on the calc?
Back to top
mrmprog


Newbie


Joined: 04 Feb 2011
Posts: 44

Posted: 05 Feb 2011 03:58:17 pm    Post subject:

Exactly. The thing is, a string would have to have some type of separator so you would know when one starts and one ends.
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 05 Feb 2011 04:25:18 pm    Post subject:

Ah, okay. I'll see what I can whip up then Very Happy
...
30 minutes later
...
Okay, so here is what I have come up with so far:


Code:
EFD74AEFEF4A424B
210500
227884
03
C5EF444AC1
300A
21FA00228E842E011805
0B78B120EA

EF524BD7
EFC94F
118E84210000
1AC64012
23131AB720FA
EF2743

EB
4E234623
118E84
EB
EDB0
C9


The way it works is you pass a number in Ans and it outputs the corresponding program name with a prefix byte. The prefix byte will tell if it is a regular program or protected program and is also the same syntax for CopyProg. So, to get the name of the first program:

Code:
:0
:Asm(prgmGETNAME
:Pause Ans


Now to copy the first program to prgmTEMP and then execute it:

Code:
:0
:Asm(prgmGETNAME
:Ans→Str1
:"[TEMP
:Asm(prgmCOPYPROG
:prgmTEMP



I plan to add support for other file types, too. I will make sure it remains backwards compatible, but in the next version, if you use 5:Asm(prgmGETNAME it will return the name of the program. If you use a list, you will get to change the type that it searches for. Hopefully.


Last edited by Guest on 05 Feb 2011 06:40:19 pm; edited 1 time in total
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 06 Feb 2011 03:37:38 pm    Post subject:

I really hate to double post !_! but I think it has been long enough and the update is good enough...

So if you use just a number, it returns the name of a program (or "." if it doesn't exist). With this update, though, if you use a list input instead, you can make it return the names of other variable types. For example, {0,1} returns the 2nd program and {1,1} returns the second appvar. It handles 12 variable types and I made sure the ones most likely to be used were 0 to 9.

Now I want to add some more stuff that returns info about the variable like the size and whether or not it is archived. if I do that, I definitely want to use theta for the size. As to whether or not it is archived or not I have the option of adding a decimal to theta. So if the size is 345 bytes, then:
345.1 says it is archived
345 says it is in RAM

Does that sound good?


Last edited by Guest on 06 Feb 2011 03:38:39 pm; edited 1 time in total
Back to top
mrmprog


Newbie


Joined: 04 Feb 2011
Posts: 44

Posted: 06 Feb 2011 08:49:50 pm    Post subject:

That looks really good. To bad I can't send it to my calc. (linking software is dead)
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 06 Feb 2011 09:41:59 pm    Post subject:

Well the opcode is included if you have to resort to that... but I do have an update again! Now when the program is run, it returns Theta with the size of the variable. And if it is archived, it adds a decimal part to it. So if you get 345.01, the size is 345 bytes and it is archived. If you just get 345, it is in RAM. So you can do:

Code:
:"ARCHIVED
:If not(fPart(θ
:"UN"+Ans
:Pause Ans


Last edited by Guest on 06 Feb 2011 09:43:27 pm; edited 1 time in total
Back to top
mrmprog


Newbie


Joined: 04 Feb 2011
Posts: 44

Posted: 07 Feb 2011 09:24:04 pm    Post subject:

You said V would create a temp program. is that one of the buggy var types? Where can I find more information on these?
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 08 Feb 2011 01:18:06 am    Post subject:

Hehe, Temp programs are very useful. Temp programs automatically get deleted and it is not buggy.
Back to top
mrmprog


Newbie


Joined: 04 Feb 2011
Posts: 44

Posted: 14 Feb 2011 08:52:23 pm    Post subject:

What is the best way to list the programs the way you did it in your example?
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 14 Feb 2011 09:58:12 pm    Post subject:

This is an example to show what happens. It isn't optimised (too much Razz) Also, as a warning, the L1, GDB1, Pic1 will not be returned correctly! I mentioned this in the Readme, but just in case... Anyway, using sub( on these strings may cause your calc crash. Again, the readme details a workaround for these... Pic2, GDB9, et cetera all work, though, just not the first ones.


Code:

-1→B                  ;When you add 1, it will be 0...
Lbl 1
B+1→B                 ;Increments B by 1 and the value is in Ans
{1,Ans                ;'1' is used to search the appvars. If you are just searching programs, this line is not needed
Asm(prgmGETNAME
If Ans=".             ;"." is returned if the var does not exist, so exit
Return                ;exits program
Pause sub(Ans,2,length(Ans)-1             ;Pauses and displays the name of the var (without the type byte)
Goto 1

I hope that helps a little... Here is a version that will go through all of the supported variables:

Code:

0→C
Lbl 0
-1→B
Lbl 1
B+1→B
{C,Ans
Asm(prgmGETNAME
If Ans=".
Then
C+1→C
If Ans=12
Return
Goto 0
End
Ans+sub("* ",1+not(fPart(θ)),1
Pause sub(Ans,2,length(Ans)-1
Goto 1
Back to top
mrmprog


Newbie


Joined: 04 Feb 2011
Posts: 44

Posted: 15 Feb 2011 08:05:40 pm    Post subject:

Where is the part about sub( ?
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 15 Feb 2011 08:37:10 pm    Post subject:

Oh, the sub( is just to take off the first letter. So if it returns "EA0" the sub just removes the E to give the name of the program. It has nothing to do with the prgmGETNAME Smile
Back to top
mrmprog


Newbie


Joined: 04 Feb 2011
Posts: 44

Posted: 15 Feb 2011 08:55:12 pm    Post subject:

OK,I thought you ment that sub( on the name returned by getname would crash.

Last edited by Guest on 15 Feb 2011 08:55:28 pm; edited 1 time in total
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 15 Feb 2011 11:01:45 pm    Post subject:

Oh, well it will on vars like Str1 and Pic1 for example. The reason is that the OS stores the name as AA00, 6000, 5C00, et cetera. The "00" says it is the first, but GetName cuts off any 00s because 00 also ends the name of vars. So Str2 works, but Str1 doesn't. However, if you add something like "0" it will complete the name. So if you add "0" and the length is 2, then it is a normal var and if it is a length of 1 then the name is messed up.
Back to top
mrmprog


Newbie


Joined: 04 Feb 2011
Posts: 44

Posted: 19 Feb 2011 03:45:01 pm    Post subject:

Can getname tell if it is an asm prgm?
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 19 Feb 2011 04:09:40 pm    Post subject:

How do you mean? It can tell if it is locked because it returns "F" as the first token if locked and "E" if it is normal. To tell if it is an assembly program, if you have CopyProg you just copy the program to a string and check the first token by doing sub(Str2,1,1). That is what I did with LSDOS, anyway. As a note, assembly programs that have been compiled on the computer or that have had AsmComp( used on them, they start with a different token. It shows up as "?" but it is not the actual question mark.
Back to top
mrmprog


Newbie


Joined: 04 Feb 2011
Posts: 44

Posted: 19 Feb 2011 04:32:50 pm    Post subject:

So if the first char is a ? it is asm?
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 19 Feb 2011 06:16:58 pm    Post subject:

It isn't the "?" that you normally have access to. TI never gave it a name, so it just appears as a '?'. You will need to actually use CopyProg and the sub( command to get the token.

If it isn't compressed, the first token will be "AsmPrgm"
Back to top
mrmprog


Newbie


Joined: 04 Feb 2011
Posts: 44

Posted: 19 Feb 2011 06:29:10 pm    Post subject:

OK time to get back to work on my shell.
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement