Author Topic: ASMPrgm command hex codes?  (Read 12741 times)

0 Members and 1 Guest are viewing this topic.

Offline spud2451

  • LV2 Member (Next: 40)
  • **
  • Posts: 39
  • Rating: +3/-3
  • Life is simple, but we make it complicated ~conf.
    • View Profile
    • Red Rock Creative [Free Custom Websites]
ASMPrgm command hex codes?
« on: April 02, 2012, 11:59:37 am »
so I was looking for a way to assembly code into my shell Fittle and i came to the command "ASMPrgm".
I started to use it then realized it need hex codes to work so I looked for the hex codes.
Unfortunately I couldn't find all the ones I needed on the TI-Basic Developer.
Can some one give me the hex codes for grouping/ungrouping programs, displaying sprites, getting a program list, running a user defined program, getting stats on a program or the system.

if no one can get those codes then could someone make an ASM program that could those things for me

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: ASMPrgm command hex codes?
« Reply #1 on: April 02, 2012, 12:18:03 pm »
There's a topic with many of the codes here.

Not sure if it has exactly what you're looking for, but it might...
Vy'o'us pleorsdti thl'e gjaemue

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: ASMPrgm command hex codes?
« Reply #2 on: April 02, 2012, 12:22:23 pm »
AsmPrgm allows you to enter machine code (in hex form) via the BASIC editor. It can't be used to include machine code in a BASIC program--you can only use it to enter an assembly program. That being the case, it would make much more sense just to use ASM programs rather than enter them in manually. At that point, you're just using external ASM programs to do what BASIC cannot, and that's the purpose of the likes of Celtic and xLib.
If you don't want to use hybrid BASIC, then someone, I guess, could write the subroutine programs. (Or someone could point you to ones that already exist. They probably do, but I don't know about them.)
"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 Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: ASMPrgm command hex codes?
« Reply #3 on: April 02, 2012, 12:22:26 pm »
You seem to be asking "can someone code the shell part of my shell ?" :P
Also, your questions aren't specific enough: "running a user defined program" is different if the prog is archived or not; displaying a sprite is easy but it depends of where the sprite is stored.

Something you could do is learn ASM to get the hex codes yourself (you won't even need hex codes then :P) or learn Axe, that could do the job too. Else, I don't think there are hex codes that would fit your needs and not create any bugs (like running an archived prog like an unarchived prog, or run an ASM prog like a basic prog would crash I guess).
« Last Edit: April 02, 2012, 12:26:00 pm by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: ASMPrgm command hex codes?
« Reply #4 on: April 02, 2012, 12:27:03 pm »
You may want to talk with xeda. She once supplied me with two mini programs that allowed me to make a complete shell in basic.
Edit: the two programs allowed me to copy variables to each other, including programs, and list the programs on the calc.
« Last Edit: April 02, 2012, 12:28:05 pm by mrmprog »

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: ASMPrgm command hex codes?
« Reply #5 on: April 02, 2012, 12:32:02 pm »
Also, you might want to read this.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: ASMPrgm command hex codes?
« Reply #6 on: April 02, 2012, 01:00:35 pm »
Woo, I'm here! Can't believe I missed a hex codes topic >.>
Now as for this:
Can some one give me the hex codes for grouping/ungrouping programs, displaying sprites, getting a program list, running a user defined program, getting stats on a program or the system.
Celtic 3 can do that pretty easily. It has commands that can allow you to do all of that, and if you need help, I can help with that, too :) (I still love to use Celtic 3 because it makes life easier XD)

Offline spud2451

  • LV2 Member (Next: 40)
  • **
  • Posts: 39
  • Rating: +3/-3
  • Life is simple, but we make it complicated ~conf.
    • View Profile
    • Red Rock Creative [Free Custom Websites]
Re: ASMPrgm command hex codes?
« Reply #7 on: April 02, 2012, 01:19:51 pm »
I would do that but I don't want to use any external libs. that's the big mistake I made in my last version of Fittle. It was a mistake because most people get that support from doors cs.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: ASMPrgm command hex codes?
« Reply #8 on: April 02, 2012, 01:58:11 pm »
Oh, I see, good point >.> Well the code could be created (though it would be long), so maybe if I get enough time I can create it and post the program :) The ones I have made and released the mrmprog mentioned are:
CopyProg: this one is on TICalc and is 143 bytes
GetName
CopyProg2.00 This is a combination of GetName, CopyProg, and a few other useful routines making it CopyProg on steroids. The cost is that it is about 600 bytes.

So what you can do is find a program, the name is stored to a string, so use CopyProg to copy it to a tempvar (like prgmTEMPVAR) and then execute prgmTEMPVAR. If you want an example of a shell that I started:
LSDOS

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: ASMPrgm command hex codes?
« Reply #9 on: April 02, 2012, 06:50:12 pm »
Now, I hate to kind of be a jerk like this, but the routines you asked for are actually each major undertakings themselves. These aren't really things you just whip up. But, you are in luck because I have already written one of the more difficult ones.

Grouping/Ungrouping - This one sucked to make, but I actually did do it a long time ago. final version
Usage:
 Str3 = group name (all uppercase of course, 8 letter max) Ex: MYGROUP
 Str4 = list of programs to group with identifiers Ex: +A+B-IMPOSBLE-GROUP2
   Identifiers:
     + = regular program (you can edit it in the editor)
     - = protected program (you can't edit it in the editor)
 I'm not positive if it will work with the wrong identifier, never tried it.

Hex codes - Rather than giving you the hex codes, this program will spit out the hex code for a program name given in Str1. link
Usage:
  Str1 = name of program to unsquish with identifier padded to be exactly 8 characters with spaces (from above) Ex: -GROUP2__
  It will change the first letter of the program to an A and fill it with hex.
  To copy/paste the hex codes, just use RCL to recall the program. Ex: RCL prgmAROUP2

  However, turning already written assembly code back into hex is simply doubling the size.

Displaying Sprites - I'm sure you can find a program on ticalc.org.
Program list - That wouldn't be all that hard to make, but again, ticalc.org can probably help
Running a program - This is a serious undertaking. If you want to run simple unarchived basic programs and homescreen assembly programs, then I suppose you could probably find a 100 byte routine on ticalc.org. But if you want to start running ion, mirage, and dcs programs, then you are going to either need an app, or some serious hacking skills. Without hacking, (since the hacking would be unreliable), you are going to need to include all of the Mirage routines inside this subroutine and put them in the proper place. This really cannot be done without a shell. (zStart has an entry point for running programs, jussayin')
Getting program details - again, ticalc.org.

But honestly, like everyone has been saying, this is something you want to do in at least Axe. And really, axe isn't even designed for this kind of thing, asm is really the language that should be used for shells. If you are going to use BASIC, I would recommend you use the Celtic3 libs because they are included in DCS and requiring DCS isn't really the end of the world.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

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: ASMPrgm command hex codes?
« Reply #10 on: April 02, 2012, 07:53:19 pm »
Actually in Celtic III Eeems had a quite decent shell going up years ago. Sadly he got his calc taken away afterward, which killed the project. It's best to use ASM, though, otherwise it will be hard to compete against things such as Doors CS or even MirageOS.

If you stick with BASIC, you might want to use xLIB rather than Celtic III, though, because Celtic III has plenty of backward compatibility issues with xLIB and it might mislead you into a program that will not work in Doors CS.

By the way WikiTI might have some useful information if you need routines http://wikiti.brandonw.net . I sometimes checked there when I was programming Axe and it's especially useful for ASM coders, especially regarding file and data management.

Also if you are in dire need to rip hexadecimal from an ASM-based 8xp executable, there's an ASM unsquisher here http://omnimaga.org/asmunsquisher/asmunsquisher/

Welcome back too!
« Last Edit: April 02, 2012, 07:56:52 pm by DJ_O »

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: ASMPrgm command hex codes?
« Reply #11 on: April 02, 2012, 09:18:36 pm »
I guess I should have detailed my post more...
CopyProg will copy any variable from memory to a var in RAM. So you can copy Appvars or strings to a program variable and run the program (so you can actually have the user input BASIC code in a string and execute it). It also lets you delete vars.
GetName will return names of variables in alphabetical order. The output string can be used by CopyProg, too. So you can input a list saying "grab the name of the nth variable of this type." So you can make a menu for the user to select from appvars, programs, strings, et cetera, then copy them to another var to run them. Plus, it returns info about the size of the var and archive status.

At this point, those two programs together are a little over 360 bytes. That is tiny for so much functionality.

CopyProg 2.00 Combines the functions of both (using the same inputs) and also gives line reading support and line deleting. and a few other functions. This is over 600 bytes.

If you need other programs, I also have:
-A program that lets you execute a string of hexadecimal
-A program to execute a string as code
-A program to convert a list to a byte string (in case your list is integers 0 to 255) and it does the reverse (string to list). This is great for compression and is fast
-A flag editor so that you can edit internal flags (sometimes useful)
-A program to convert a hex string to pure data
-A program to convert a program to a hex string
-A program to return the number of chars in a string (so "sin(cos(37))" would return 12)
-A program to return the width of a string in the small font

Most of those are all around 100 bytes or less :)

Offline spud2451

  • LV2 Member (Next: 40)
  • **
  • Posts: 39
  • Rating: +3/-3
  • Life is simple, but we make it complicated ~conf.
    • View Profile
    • Red Rock Creative [Free Custom Websites]
Re: ASMPrgm command hex codes?
« Reply #12 on: April 05, 2012, 12:28:53 pm »
Xeda how did you learn the hex codes? I think that I might try to do that depending on how long it would take to learn the basics of it.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: ASMPrgm command hex codes?
« Reply #13 on: April 05, 2012, 12:30:07 pm »
Xeda how did you learn the hex codes? I think that I might try to do that depending on how long it would take to learn the basics of it.
It is the same than learning ASM just that you replace the commands by their hex equivalents (like "ret"==C9 or "xor a"==AF)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline BlakPilar

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 734
  • Rating: +44/-1
    • View Profile
Re: ASMPrgm command hex codes?
« Reply #14 on: April 05, 2012, 12:36:25 pm »
Xeda how did you learn the hex codes? I think that I might try to do that depending on how long it would take to learn the basics of it.
It is the same than learning ASM just that you replace the commands by their hex equivalents (like "ret"==C9 or "xor a"==AF)

And to prevent an upcoming question: http://clrhome.org/table/ ;)