I am trying to retarget LCC for my hobby cpu. I am just starting out. I took the miss.md file as a starting point and ONLY changed the interface record value for the 'int' type from size 4 to 2 as my cpu is 16bit.
Trying to compile a simple program now throws an error at the first line. I have a couple of questions on this:
Why does changing the type size have this effect? The definitions have entries for int2. My test program only uses small numbers?
It throws an error about a missing opcode.
I've read the part of the book dealing with the backend and think I have a basic understanding. However it seems I immediately hit a brick wall.
Any insight would be appreciated!
Erwin
Thx for taking the time to reply.specific opcode.
The file I refer to is indeed mips.md. The only change I made is to change the int declaration in the interface record from
Int, 4, 4, 0 to 2, 2, 0
I van compile rcc and build the target specific file ok. But when I then use the resulting compiler (e.g. 'Rcc -target=mips test.c'. It starts to compile 'test.c' but errors out at the first statement it encounters with:
Compiler error in._label --bad terminal 2357
I looked through the lcc source to see where that error is thrown and it seems to be the part that selects the opcode. 2357 is not declared in the machine description file (eg no %term xxxxx=2357), so I am wondering how it decides it wants that
Thx,
Erwin
Thank you. That gives me something to go on.
Are the opcode it generates not documented anywhere? I can't find them in the book and it seems an important part of writing the machine spec?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 233:54:37 |
Calls: | 6,624 |
Files: | 12,172 |
Messages: | 5,319,635 |