A89: Re: 'Exec' Function... How to Use?
[Prev][Next][Index][Thread]
A89: Re: 'Exec' Function... How to Use?
> I think I see potential in the 'Exec' function. The TI manual says
>that the function accepts M68000 op codes in a stringified form. My first
>guess was to type a mini ASM prog right into the string and run it.. I
don't
>think that will work though (maybe I did something wrong).. OK, so I know
>ASM is really shorthand for a bunch of binary, so I got a program and
>compiled it without trashing the .bin file. I tried copying the hexadecimal
>and converting it to binary, then running 'Exec "0110101011101101..."'
>which just gave some stupid error. If anyone can shed light on the
operation
>of this function, please do. If this helps I tried typing in a random
binary
>number the first time I used it, and in retrospect I noticed that it was
the
>memory address of the 'address error' message. Sure enough a big message
>'ADDRESS ERROR' stuck on my screen and darnit! I had to reset my calc!
Although I've never used Exec(), I know that its usage is for running a
string of hex. If you know anything about the ASM support on the 83/86
then you're set because this works the same way. Basically, two bytes of
the string is one byte of executable code. So you're not limited to
10101010101 (0's and 1's). You're supposed to use all 16 digits (0-F)
and each set of two is a byte of executable code. I think the reason TI has
a hex protocol like this is so you can type in your own machine code using
16 digits. Without a hex (or similar) system like this, you'd have to type
in each byte as a whole byte. Because of the limitation of the TI font, a
straight byte-for-byte ASM program would be hard to read because it would
use all 0-255 chars in the font. With hex, you need only 16 different
chars. The downside is that your prog is twice as big to represent in hex
as it was otherwise. TI's protocol grabs each set of 2 hex characters and
converts it into a single byte and then copies it to the asm exec section.
Then, after all bytes are converted, the calc jumps to that asm exec section
for execution.
-Justin Karneges [Infiniti]