Monday, May 31, 2010

Both V9T9 disk image tools are complete. The dump tool has been verified with known-good images, and the image composer has been verified with the TI Disk Manager cartridge. Now I need to make a EA3 and ES5 conversion tools. At that point, I really have no excuse but to do some useful work. I've been taking a huge detour from working on a replacement OS for the TI. Still, these are useful tools.

More helpful notes for later: Apparently, loading files using Editor/Assembler is case-sensitive.

Load a file using a name like "DSK1.PROGRAM"

Well, that was really easy... The first draft of the EA5 converter is done and works. I'm cheating a little bit here, since I'm assuming that the entry point is at the start of the .text section. I should be searching for the location of the "_start" label, but this should work for now.

EA5 images are assumed to load at 0xA000, so modify the makefile accordingly.

Sunday, May 30, 2010

I've got a V9T9 image reader almost done. I need this in order to test the image writer I'll be writing later.

Saturday, May 22, 2010

I've completed the last of the GAS changes, so now its back to GCC to make sure its output is TI compliant.

OK, now GCC is complete too. GCC and GAS work well together, all the test programs I've compiled behave as expected. I'm still disappointed that I couldn't modify GAS to be smater about what is a label to allow instructions to be in column one. I'm sure I'll get back to that at some point.

I suppose the next thing to do is try to see how the floppy works in MESS, make a disk image composer, then a ELF to EA3 and EA5 converter. Sounds simple, no?

To start with, MESS prefers V9T9 disk images, this also seems to be the most common format seen in the wild. Seems a good place to start.

Also a good thing to know is that the "flop1" option configures the disk image to use.

sdlmess0130/src/mess/tools/imgtool/modules/ti99.c

Thursday, May 20, 2010

I made some more changes to GAS to allow TI-style labels without colons. I happen to like colons, since it makes them easier to recognize. So GAS now supports both styles, but for now, statements cannot start in column one. This is kind of hacky, and I don't like it, but this can be changed later.

Tuesday, May 18, 2010

Finished more GAS changes today. I've got missing arguments to generate an error, it works nicely now. I also made changes to treat everything after valid arguments as a comment.

Monday, May 17, 2010

I've spent the day looking at the TI tagged object file. The details are in the Editor/Assembler manual. It's a simple, but horrendously wordy format. There are smaller forms, namely the compressed object and memory image formats, but I have no details on those.

I was interested in getting an idea of how to make disk-based programs using the GNU tools, but it looks like I'll have a challenge ahead of me here. If nothing else, I need to get a copy of the E/A cartride, although Extended Basic should work too.

So back to GAS then...

Todo list for GAS changes:
PSEG and friends in addition to ".text" [DONE]
BES directive
$ as current address [DONE]
Labels without ":"
Error if arguments are missing
Treat all after last argument as comment
Allow "*" comment symbol [DONE]

Sunday, May 16, 2010

I've just verified the toolchain with a "hello world" test. The resulting image works fine, and looks good. I still haven't fixed up the assembler for TI conventions yet, that's coming up next.

I've really got to get a website up and running so I can publish this stuff.

Saturday, May 15, 2010

I'm pretty happy with GCC for now. It could probably be made more efficient and have a few more optimization, but all my tests show that it works well. I've just finished cleaning out most of the debug and test code, and the code tree is mostly ready for release. I still need to exercice GCC with a more ambitious project, make a C library, and make the output conform to mostly TI assemly format.

So now I need to go back to GAS and make some more changes there. Namely, the TI format stuff, as well as more error checking for missing or extra arguments. I've occasionally forgot to add a count in shift instructions, and GAS did not catch it.

Here's a more correct build process for everything. GCC now automatically calls GAS, which is nice. I'm not happy about the seperate BFD make step for GAS, but I'll see what I can do there.

GAS:
$ ./configure --prefix /home/eric/dev/tios/toolchain --target tms9900
$ cd bfd
$ make all
$ cd ..
$ make all
$ make install

GCC:
$ ./configure --prefix /home/eric/dev/tios/toolchain --target=tms9900 --enable-languages=c
$ make all-gcc
$ make install

Thursday, May 6, 2010

I've added new instructions to do byte-to-word conversiion, this will hopefully end the FAKE_Rn register usages which pop up from time-to-time. This will also act as an optimization step, since there was a lot of copies to and from temporary registers during the course of subreg conversions. Unfortunately, these instructions conflict with the extendqihi instructions.

So, an example:

int* reg = (int*)0x8c00;
void a(int c) {*reg = (char)c;}

with extendqihi2:
mov r3, r1
swpb r1
movb r1, r2
sra r2, 8
mov r2, @reg
b *r11

without extendqihi2:
mov r3, r1
sla r1, 8
sra r1, 8
mov r1, @reg
b *r11

I think I can get better code by not using the "extend" instructions. If nothing else, it should make the .md file shorter.

Monday, May 3, 2010

I think I've got a compiler which is functional enough to do some work. The next step is to make sure the installation works and is useful. I'm realizing it's been a really long time since I last did a full GCC build, so I'm recording the steps I used for later:

GAS:
$ ./configure --target tms9900

GCC:
$ ./configure --program-prefix=tms9900 --prefix /home/eric/dev/tios/toolchain/bin --target=tms9900 --enable-languages=c
$ make all-gcc
$ make install