• Zeda's Hex Codes 5 1
Currently:  

Author Topic: Zeda's Hex Codes  (Read 66320 times)

0 Members and 1 Guest are viewing this topic.

Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Re: Zeda's Hex Codes
« Reply #30 on: February 27, 2011, 12:37:57 pm »
Ooh! I have to use this in my next Axe program. :)

EDIT: All of them, of course! :D
« Last Edit: February 27, 2011, 12:46:19 pm by ralphdspam »
ld a, 0
ld a, a

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: Zeda's Hex Codes
« Reply #31 on: February 27, 2011, 12:40:43 pm »
Which one? Or do you mean all of them >_> ? :D if you have any ideas, too, feel free to let me know!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Zeda's Hex Codes
« Reply #32 on: February 27, 2011, 02:15:39 pm »
This might be hard, but how about writing back a string to a label in the program? Something like

Code: (TI-BASIC) [Select]
:Lbl 0
:{1,1,2,3
:Lbl 1
:Ans→L₁
:"{1,3,4,7→Str1
:"0,1
:Asm(SMC

True SMC in BASIC is something we have yet to see :D
« Last Edit: February 27, 2011, 02:17:11 pm by Deep Thought »




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: Zeda's Hex Codes
« Reply #33 on: February 27, 2011, 02:21:57 pm »
You mean like have it overwrite the data following Lbl 0? Hehe, if that is what you mean then you can do something like that with CopyProg because you can store the program as a string and manipulate it and you can use CopyProg to execute the string as a program :D

CopyProg was originally requested as an opcode by mrmprog, so I decided to include it in the list of opcodes :D

However, if you mean edit a line of code following Lbl 0 and to be able to edit it inline like that (while the program is executing), that could be fun... I might need to adjust a few pointers to make it possible, but it can be done, I believe.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Zeda's Hex Codes
« Reply #34 on: February 27, 2011, 03:31:23 pm »
Actually, Iambian wrote a small program called Celtic to do this a few years back.  It kinda evolved since then...

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: Zeda's Hex Codes
« Reply #35 on: February 27, 2011, 03:34:29 pm »
Uh-huh, I remember something about that, I cannot remember... what did he call it again, Gaelic? ;D
I still think an opcode would be nice for those who don't have connectivity stuff to download :)

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: Zeda's Hex Codes
« Reply #36 on: February 28, 2011, 03:33:11 am »
If you really mean Celtic, it's still called Celtic today, but since it stopped being updated, it has since merged with Doors CS 7.

Offline program4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 158
  • Rating: +15/-0
    • View Profile
Re: Zeda's Hex Codes
« Reply #37 on: March 01, 2011, 09:00:08 pm »
I have an idea: how about a program that allows detection of multiple key presses (like the one in BatLib, I think)? I might find that useful in some BASIC programs.

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: Zeda's Hex Codes
« Reply #38 on: March 01, 2011, 09:04:30 pm »
That would be handy, and so would an inline editor.What about a find and replece routine where you could search for str1 in a var and replace it with str2? You can do that with copyprog but an opcode would be faster.

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: Zeda's Hex Codes
« Reply #39 on: March 01, 2011, 11:07:45 pm »
I have an idea: how about a program that allows detection of multiple key presses (like the one in BatLib, I think)? I might find that useful in some BASIC programs.
Hmm, as a quick reference to that, you can check here for two versions of what you might be looking for. returns all of the keys being pressed in the form of a 7 element list. This is command 10 (pretty much) in BatLib.

A better option might be this might be more practical/useful as it doesn't require an input. This is command 43 in BatLib.
That would be handy, and so would an inline editor.What about a find and replece routine where you could search for str1 in a var and replace it with str2? You can do that with copyprog but an opcode would be faster.
A code to change token vars (not programs/appvars or other named vars) is actually not too difficult. I will come up with one shortly and edit this post when I have it finished!

EDIT: Actually, see my next post for the code :D

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Zeda's Hex Codes
« Reply #40 on: March 02, 2011, 07:35:25 am »
Hm, I like opcodes, maybe I'm going to learn programming with them too. too bad that you break when pressing ON :(
I'm not a nerd but I pretend:

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: Zeda's Hex Codes
« Reply #41 on: March 02, 2011, 12:26:05 pm »
It isn't the opcodes that break when you press ON, it breaks when the program finishes and enters BASIC again :D
Anywho, instead of editing my previous post, here is an opcode:
Code: [Select]
EFD74AFE04C0
1313
21B184EB
EDA0EDA0
3EAA327984D7D878B7C0
1313
21AF84EB
EDA0EDA0
3C327A84D7D878B7C0
EB4E234623
117884
EDB0
AF12
EFF142D878B7C0
EB4E234623

3AAF84
EDB1E0
3AB084
BE20F4
3AB284
772B
3AB184
7723EDA1E018E5
The inputs are:
Str1=SearchStr
Ans=ReplaceStr
Str2=VarName

What it does is it takes the first two bytes of the search string and finds those in the variable you are searching. Every time it comes across a match, it replaces it with the first two bytes of the replace string.
*VarName uses the same syntax as CopyProg

So if I wanted to change every instance of Goto 0 to Goto V in prgmRAWRZ
Code: [Select]
"ERAWRZ→Str2
"Goto 0→Str1
"Goto V
Asm(prgmREPLACE
Since tokens like Str1 and Pic1 are two bytes, you can similarly do something like:
Code: [Select]
"ERAWRZ→Str2
"Pic1→Str1
"Pic7
Asm(prgmREPLACE
The variables have to be in RAM in order to edit them, otherwise the code exits.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Zeda's Hex Codes
« Reply #42 on: March 02, 2011, 06:26:03 pm »
A find/replace function? :o These hex codes are getting to be really useful!




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: Zeda's Hex Codes
« Reply #43 on: March 02, 2011, 06:29:28 pm »
It only uses two bytes, though, but I have been meaning to get around to making an actual search/replace function for BatLib, so when I do, I will post the code :D

EDIT:I just thought of an interesting use for this program !
Code: [Select]
1→B
ClrHome
Disp " Goto  1"," Goto  2"," Goto  3    ;Put a space before the numbers :P
Repeat A=105
Output(B,1,"}
Repeat A
getKey→A
End
Output(B,1,"                         ;There is a space there
B+(A=34)-(A=25
If Ans=4 or not(Ans
1+2not(Ans
Ans→B
End
"EB1→Str2
"Goto A→Str1
"Goto "+sub("123",B,1
Asm(prgmB
Goto A
Lbl 1
1
Goto Z
Lbl 2
2
Goto Z
Lbl 3
3
Lbl Z
Pause Ans
You can potentially avoid using the Menu( command to jump to labels if you reallllly don't want to use the built in Menu( command :D

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: Zeda's Hex Codes
« Reply #44 on: March 03, 2011, 02:30:26 pm »
Here is a cool little opcode... it will take a string in Ans as the name of a var to execute as a BASIC program. The input is also the same as CopyProg (or the output of GetName). So for example, if appvar HELLO has BASIC data, you can do:
Code: [Select]
:"UHELLO
:Asm(prgmEXEC
Anyway, the opcode is:
Code: [Select]
EFD74AFE04C0
EB4E234623
117884
EDB0
AF12
FDCB08CE
EF9B4A
FDCB088E
C9