Title: some sort of linker-like thingy
Description: not really anything like a linker
Gmakermaniac!!! - September 20, 2005 12:55 AM (GMT)
I couldn't find a single program to convert a Z80 binary file (just flat binary) to a TI-86 program file (contains a program variable that you load onto the calculator) so I needed to make one myself. The file format includes a bunch of odd things you'd expect a file format to have (including a checksum) and it just can't be done by hand. Anyway, I'm half-way through writing a program that converts from binary, to a program variable. it's interface is much like that of GCC and I'm amazed I have gotten the parameter handeling code working as good as I have (because I absolutely HATE handeling strings :D). should be done tomorrow (late tomorrow) or the next day if I'm not interrupted by homework or something. ^_^
ps: the reason that it adgitated me that I couldn't find such a program is because there are like.... 4 of them for TI-83/83+ <_<
C-Man - September 20, 2005 08:14 AM (GMT)
so what compiler do you use ?
Gmakermaniac!!! - September 20, 2005 10:54 AM (GMT)
At the moment, some assembler called TASM (not borland's Turbo Assembeler). It's some dos program that allows you to compile ASM programs for just about every processor under the sun (including Z80.... duh :)). This is just about all that the n00bs in the TI forums use but hopefully I can do it in GCC soon too :)
C-Man - September 20, 2005 11:27 AM (GMT)
hey did you try TiGcc ?
EDIT :
DOH nevermind it's fro 89/92 only :/
Gmakermaniac!!! - September 20, 2005 08:12 PM (GMT)
yeah :\ oh well. I just need to port the .inc files to C. all they are are a bunch of addresses and stuff of OS functions, stuff, etc.
myork - September 21, 2005 11:59 AM (GMT)
Does it support the same ABI (Application BINARY Interface) as C.
If it does not then you will have to write wrappers for each function and add the asm to convert.
Things to check:
1) Where is the return value placed?
2) How are parameters passes in?
3) Who tides up the stack frame on completion?
KTC probably has a ref for the C ABI.
Make sure you use the C calling convention. The C++ ABI is completely different and vastly more comlex (for effeciency some parameters are passed in registers) etc. So if you are using g++ make sure your functions are prefixed with extern "C"
Gmakermaniac!!! - September 22, 2005 01:02 AM (GMT)
What I was thinking of doing is writing my own version of the call routine (so I can call the OS functions however they are set up), and then basing functions on top of that which do the actual things. like.... they take arguments the way a C function does, set up the registers, then call the assembly function using the call function (which would kindof have to be written in C-compatible assembly, or inline assembly B)
..... now I'll get torn to shreds by you l33t people :lol:
C-Man - September 22, 2005 11:45 AM (GMT)
Gmakermaniac!!! - September 26, 2005 11:51 PM (GMT)
heh. well, it's late... and will be later. it's pulling along though