Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
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 TI-BASIC 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. TI-Basic => TI-BASIC
United-TI Archives -> TI-Basic
 
    » Goto page 1, 2  Next
» View previous topic :: View next topic  
Author Message
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 20 Jan 2011 05:53:19 pm    Post subject:

Okay, so I am guessing that if you are looking here you are a BASIC programmer looking for those rare but amazing hex opcodes, right? Well, I have good news! I once was a BASIC programmer looking for those rare but amazing hex opcodes. What do I do now? I program in hex. So... That means I can pretty much come up with any opcode I need. The problem is, some of them tend to get long and the longer they are, the more likely you are to make a mistake. However, as long as you are careful... Well, let's just say I've made codes a few thousand bytes long that had no errors. So, if you are in that boat and you want in on this boat, feel free to post something that you think would be really cool. For the moment, here is a mini video I put together for how to make these programs:
If you have questions, feel free to ask.
[attachment=3365:AsmPrgm.gif]
Here is a list of codes covered (I will update it as I need to) in this topic:

Code:

Page 1 -The opcode in the video
Page 1 -ExecCode
Page 1 -RepeatyKeys
Page 1 -SuperFastKeys
Page 1 -FastRepeatKeys
Page 1 -ListToVars1
Page 1 -ListToVars2
Page 1 -ClearGraph
Page 1 -ClearHome
Page 1 -InvertGraph
Page 1 -DispChar
Page 1 -DispCharList
Page 1 -GetName
Page 1 -CopyProg
Page 1 -Real To String



The opcode in the video:

Code:

;Use only values from 0 to 63. Higher values may crash.
EFD74A
EFEF4A
210000
53
EF5F4D
C9

ExecCode:

Code:

;Deletes prgmU, then copies Ans to prgmU
;For example:
;     :Input "Code:"Str1
;     :Str1
;     :Asm(prgmEXECCODE
;This will automatically execute prgmU, whether the code is BASIC or assembly
EFD74A
FE04C0
215500            ;55 is the token for "U"
22EC86227984
21F086
EB4E234623
ED43EE86
EDB0
3E05327884
EFF142
3803EFC64F
3E0521EC86
EF3C4C
C9

RepeatyKeys

Code:

;This lets all keys repeat...
;Super fast...
;Not really practical ;D
;Run the code again to deactivate
180A
83473A4584323F8478C9
2100807EFE83
2006AF77323F84C9
11979DEB018000EDB0
DB06210080EF664FC9

FastRepeat

Code:

;Keys that normally repeat repeat super fast...
1809
83473E0132428478C9
2100807EFE83
2006AF77323F84C9
11979DEB018000EDB0
DB06210080EF664FC9

ListToVars1

Code:

;This uses a list to store to multiple variables. If the input is:
;     :{0,4,3,12,8,24
;     :Asm(prgmL2R
;Then the result will be:
;   :A is 0
;   :B is 4
;   :C is 3
;   :D is 12
;   :E is 8
;   :F is 24
;*Bonus points to anybody who sees the pattern in that sequence
EFD74AFE01C0
1AFE1B38023E1B
EB232347
3E41
C5F5E5F5
EFC541F1
327984
D73003EF0F43
E1010900EDB0
F13CC110E4
C9

ListToVars2

Code:

;Uses Str1 to name the vars, Ans for the list. If you do:
;     :"ADCZQGB→Str1
;     :{0,1,1,2,3,5,8
;     :Asm(prgmL2V2
;Then result will be:
;   :A is 0
;   :D is 1
;   :C is 1
;   :Z is 2
;   :Q is 3
;   :G is 5
;   :B is 8
EFC5413EAA327984
D7300F
3E40061B21EC86
3C772310FB
11EA861313D5
EFD74AFE01C0
1AFE1B38023E1B
EB232347
D11A13D5
C5E5F5
EFC541F1
327984
D73003EF0F43
E1010900EDB0
C110E3
D1C9

ClearGraph

Code:

;This is kind of like a ClrDraw, except the graph is displayed and NOT redrawn
214093
AF
77
114193
010003
EDB0
EF6A48
C9

ClearHome

Code:

;This clears the homescreen without showing it. Useful
;if you need to clear the homescreen when you want to
;stay on the graph screen.
210885
3E20
77
110985
018000
EDB0
C9


Last edited by Guest on 15 Feb 2011 12:07:17 pm; edited 1 time in total
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 22 Jan 2011 02:59:58 pm    Post subject:

Well, it's been a few days, so I'll post an update. Unfortunately, I am having difficulties with Adobe and I cannot see videos or use PDF's, so I am not sure how this PDF turned out, but in it are around 30 or 40 hex codes. I plan to go through my computer to find a bunch of other random codes that I have made. Again, any questions or requests, feel free to ask Very Happy
Back to top
NETWizz
Byte by bit


Bandwidth Hog


Joined: 20 May 2003
Posts: 2369

Posted: 22 Jan 2011 11:00:21 pm    Post subject:

Do you use an assembler like TASM or Zilog Development Studio?
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 22 Jan 2011 11:42:08 pm    Post subject:

No, I'm one of those crazy people that programs in hex. For BatLib (which is an app), my source is a bunch of .dw and .db statements. I started programming four years ago, but I didn't have regular access to a computer until a year ago, so I learned how to program assembly on the calc. It's a lot faster that way, anyway, and there are fewer steps involved. Using mnemonics is a really slow process for me. To give you an idea, if you have ever seen some of those really fast texters, that is the speed I program at sometimes (BASIC or Assembly).
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 27 Jan 2011 09:18:58 am    Post subject:

Okay, this new update includes over 40 opcodes. Again, any requests are welcomed Razz
Back to top
Galandros


Active Member


Joined: 29 Aug 2008
Posts: 565

Posted: 27 Jan 2011 07:02:02 pm    Post subject:

Incredible skills on programming so fast in hex. Almost certainly very unique in the world. Surprised
h
The screenshot telling about the C9 reminded me a funny episode where after I typed some few known opcodes for me (ending with C9, of course) and executing to some friend that knows x86 assembly (it is quite related to z80) in his calculator, and he tried some opcodes and didn't do the C9 even after I warned him. He crashed his calculator and was amazed that he could do assembly in his calc and never knew before.


Last edited by Guest on 27 Jan 2011 07:02:43 pm; edited 1 time in total
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 27 Jan 2011 07:10:03 pm    Post subject:

Crashing always brings a smile because it lets you know just how much control you have ^-^

I made that app, finally... It is currently a little over 7000 bytes... all in hex. Also, i want to learn how to program my computer in assembly... but I am not computer literate at all. I think it is mostly because I cannot seem to understand how the programs themselves work. I want to make the programs that way I know how my computer works. I eventually want to write my own OS so that I can actually use this thing. The other problem is that hex is more readable than mnemonics, for me Sad
Back to top
Galandros


Active Member


Joined: 29 Aug 2008
Posts: 565

Posted: 28 Jan 2011 08:27:41 am    Post subject:

Computer software use fluency just needs lots of practise.
Eventually you are comfortable searching all menus, know lots of tricks looking for what you need and how to solve/bypass problems. But yes a computer is much harder to use than a calculator because it is a lot more complex and does many things. In the calculator I know every possible menus in the calculator while in the computer there are some menus I may not ever visited once in the Windows OS (but probably I won't ever need to use them). Probably I am one rare and useful person that knows almost everything useful about Windows configurations.

Ironic, mnemonics supposedly were created for being more readable to humans. xD
One solution is learn the mnemonics, they have some "logic" behind them. For example, generally, in arithmetic and loading instructions the first argument is where the result is stored, when there is only one argument for some arithmetic instructions it works on the accumulator...
Other solution, maybe better for you, is look in a reference ordered by opcodes and the corresponding mnemonics...
Maybe is still hard and/or not practical. I tried to give some help.


As curiosity, I know some opcodes because of debugging on emulator and really helps a bit know that C9 is ret and other like xor a is A4 if memory is not doing a prank to me.


Last edited by Guest on 28 Jan 2011 08:32:09 am; edited 1 time in total
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 28 Jan 2011 11:50:02 am    Post subject:

xor a is AF... But yeah, I know the mnemonics and I can convert fluently between hex and mnemonics, it is just that the hex is more aesthetically pleasing than all those words. It is just really tedious to program with mnemonics when I can do something like 2140930100037E2F77230B78B120F7C9 and have it working immediately or I can do:


Code:
 ld hl,plotSScreen     ;214093
 ld bc,768             ;010003
  ld a,(hl)            ;7E
  cpl                  ;2F      I think it is cpl... 2F inverts register 'a'
  ld (hl),a            ;77
  inc hl               ;23
  dec bc               ;0B
  ld a,b               ;78
  or c                 ;B1
  jr nz,-9             ;20F7 jumps back to the "ld a,(hl)"
 ret                   ;C9

I am about 90% certain the mnemonics are right... the hex is correct... (it inverts the graph screen, by the way)
Back to top
Galandros


Active Member


Joined: 29 Aug 2008
Posts: 565

Posted: 28 Jan 2011 12:33:01 pm    Post subject:

At one time, I did know AF was xor a. Just not seeing it for a while made me forget.
You are right about the cpl. (comes from ComPLement) I see, you got so used to opcodes that they do perfect sense.
On Omnimaga they coded 2 IRC bots to converter back and forth hex and mnemonics. So after you write your opcodes just let a tool bring back the mnemonics for other programmers. :)

I still don't know how you can deal with all those labels and jumps offsets correction all the time, that can be tedious and a assembler does that work for you. Writing small routines is one thing, but an entire apps with opcodes...

We better get back on topic soon here.
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 31 Jan 2011 11:28:46 am    Post subject:

Okay, so here are a few more (I'm running out of ideas Very Happy)
So this displays a char using Ans:

Code:
EFD74A
EFEF4A
EF0445
C9

So to use this one, Ans is a number from 0 to 255 and it outputs an ASCII char. So if you do this in BASIC, it will display all of the ASCII chars:

Code:
:For(A,0,255
:A
:Asm(prgmCHAR
:End


Now if that gets modified a little, you can use a list as an input and output several chars:

Code:
EFD74A3DC0
EB462323
C5EF7A41E5
EFEF4A
EF0445
E1C1
10F1
C9


So if I did something like this:

Code:
:65+{7,4,11,11,14
:Asm(prgmDISP

It would output display "HELLO" on the screen. The fun part is, if you change that 65 to 97, it will output the lowercase letters :D

Again, any ideas are welcome. Also, if you see any of my programs on TICalc, I almost always include the opcode. If it isn't included, you can e-mail me and I can probably find it lying around on my computer.
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 13 Feb 2011 03:55:10 pm    Post subject:

Okay, I guess it is time to add some complex stuff... You will need to read about these in their topics in "projects" or TICalc... these were requested by mrmprog, by the way:
CopyProg-

Code:
EFD74AFE04C013131AFE712837
3EAA327984D7D878B7C0
EB4E234623C5
7EE61F77
117884
EDB0
AF12
EFF14278C1D8
EBD306
B728050901090009
4E234623
F5E5C5
3E07D306
EFD74AFE04
EB4E234623
7E
FE71F52003237E0D
E61F77
117884EDB0AF12
EFF1423803EFC64F
F1C8
E1E53A7884
EF704E1313
C1E1F1
EF5480
C9

GetName:

Code:
EFD74AB72006
210500E51814
1313EB
E7E5
EFEF4A
EB29113D9E19
5E2356
E1D5E7

EFEF4A424B
3EFF327A84
E1227884
03

C5EF444AC1
300A21FA00228E842E011805
0B78B120EA

EF524BD7
EFC94F
118E84210000
1AC64012
23131AB720FA
EF2743
EB4E234623
118E84
DB06F5C5
EBEDB0

EF3E41
EFF142
78C13008
210000F601F51811
EBD306
B7F528050901090009
5E235623EB
EF9247
F12807
2187843E01B677
F1D306
EF5641
EFC24A
C9

0500
1500
1600
04FF
07FF
08FF
1700
02FF
03FF
0000
0C00
01FF
Back to top
mrmprog


Newbie


Joined: 04 Feb 2011
Posts: 44

Posted: 13 Feb 2011 04:46:10 pm    Post subject:

Wow, that asci char output-er looks neat. I'll have to try it out.
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 13 Feb 2011 04:48:49 pm    Post subject:

It really isn't too useful unless you absolutely cannot use a string to store things like user names (and so you resort to using a list Very Happy). The main usefulness comes from being able to use any char Very Happy Does anybody have any more ideas?
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 15 Feb 2011 12:05:17 pm    Post subject:

Okay, this was a request for a code to convert a real number to a string. Right now it only returns the iPart( of the value. So for example,
-3133.7:Asm(prgmR2S will return "-3133" in Ans as a string.

Code:
EFD74A
217984
11EC86
7EE60F
470448
2D7E07
3005
0C3EB0121C
2C
2CCDD19D052805CDD19D10F4
C5EF524BD7EFC64F
E1E5EF2743
C11313
21EC86
EDB0
C9
3E30ED6F121CC9
Back to top
TI-newb


Member


Joined: 24 Dec 2008
Posts: 158

Posted: 15 Feb 2011 04:16:42 pm    Post subject:

pretty neat =), its like using CelticIII except different lol.
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 15 Feb 2011 04:39:11 pm    Post subject:

Yeah, it isn't quite up to the det(1 command, but it is similar Very Happy
Back to top
mrmprog


Newbie


Joined: 04 Feb 2011
Posts: 44

Posted: 27 Feb 2011 12:18:24 pm    Post subject:

Quick question: If you use a number bigger than 255 with the ascii thing, what will happen. Does it have an error system?
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 27 Feb 2011 12:24:37 pm    Post subject:

It just loops back, so if you use 256 it will read it as 0. However, most case that use number input will cause an error if you use a number above 9999.
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 02 Mar 2011 09:40:18 pm    Post subject:

Here is the next code...
This was a request, also, by mrmprog for searching and replacing strings in a var in RAM. It only works with 2 byte strings, currently, but it can be useful!

Code:

EFD74AFE04C0
1313
21B184EB
EDA0EDA0
3EAA327984D7D878B7C0
1313
21AF84EB
EDA0EDA0
3C327A84D7D878B7C0
EB4E234623
117884
EDB0
AF12
EFF142D878B7C0
EB4E234623

3AAF84
EDB1E0
3AB084
BE20F4
3AB284
772B
3AB184
7723EDA1E018E5

So pretty much the inputs are:
Str1=SearchStr The string to search
Ans=ReplaceStr The string to replace with
Str2=VarName The name of the var to search. This follows the same syntax as CopyProg

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.

So if I wanted to change every instance of Goto 0 to Goto V in prgmRAWRZ

Code:
"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:
"ERAWRZ→Str2
"Pic1→Str1
"Pic7
Asm(prgmREPLACE


The variables have to be in RAM in order to edit them, otherwise the code exits.
For a more advanced use of this code:

Code:
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

That code isn't too practical, but it will give you an idea of what you can do Very Happy


Last edited by Guest on 02 Mar 2011 09:46:03 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 GMT - 5 Hours

 

Advertisement