what failsafe did you end up adding, it made it work now without any issues.
I added ld iy, flags. No idea why that fixed it. The hex for it is now FD21F089FDCB33CEC9
#include "ti83plus.inc"
.db $BB, $6D
ld iy, flags
set 1, (iy+33h)
ret
is there a way to decompile compiled asm programs?
Yes, but only to the text based assembly instructions like I have been posting. Unless you understand them, you won't gain much from decompiling. There are probably tools to do it but I'll cover the manual way since it is good enough for most situations.
First you need to get the code you want to disassemble into hex. Writing an Axe program to do that is pretty trivial.
Once you have it in hex, you just need the opcode table. I use
this one. Then you look up the hex in the table.
To cover the hex I gave you earlier:
FD21F089 translates into ld, iy, 0x89F0. If you check in ti83plus.inc, you will see that the value of 'flags' is 0x89F0. The first byte of that instruction 'FD' is a prefix that tells you to go to the IY section. The second is '21' which is ld iy, nn which loads the next two bytes into iy. The next two are F089. Since the z80 is little endian, the byte order is reversed which gives 0x89F0 as the value for the instruction.
FDCB33CE translates to set 1, (iy + 0x33). (0x33 and 33h are different ways of writing the same thing) It again uses the IY section and then another to go to the IY bits. Its 3rd byte is actually the offset so the 4th one is the instruction set 1, (iy + n)
C9 is a single byte and translates to ret.
Following those steps will let you translate any assembly program to readable instructions and let you go the other way and convert instructions to hex.
what does mov9ToOP1 do?
i tried googling it but cant find anything, that and the .db i cant find
I've been reading the manuals both for Z80 and Ti-83+ system routines, and the system routines manual uses it to but neither explain what it do.
(i've never used C before either which definitely doesn't help here, i only know python and Basic, so some of these might be common things i just never learned about. if they are what other things can i look up to get more info bc every search with ti-83 and z80 dont give me anything)
Here is a good tutorial on the basics of asm. Learning assembly when you are only familiar with high level languages like Basic and Python will be a huge jump.
Here is the best documentation on the OS. It assumes you are very familiar with assembly and is generally lacking in specifics but is still the best resource out there. It answers your question on
this page.
Unless you are trying to exploit something specific in the OS (like offscript) you are probably better off using Axe to do anything fancy. Since you can inline assembly in Axe, it is still generally better to write your program in Axe and only inline asm when needed.