Open chlordk opened 1 year ago
As stated in https://github.com/jasonful/lcc/blob/master/ulpcc/doc/README.md , function calls are not supported, because the chip has no stack pointer.
(The examples in ulpcc/examples will compile, but the examples in lcc/tst (the ones for the original C compiler) probably will not.)
function calls are not supported, because the chip has no stack pointer.
Ohh sorry, I missed that one.
I guess one could use a while loop with a switch/case to simulate a function call.
while (not_exit) {
switch (state) {
case main:
if (0 == --count)
state = subf;
... and so on
Hi
I have tried the test examples in
/tst/
and most of them gives all thegetrule: Assertion '0' failed
error. Onlytst/incr.c
andtst/init.c
will compile.I then made a simple example to pin point one kind of error:
The full command line output:
/home/ff/lcc/build/lcc: fatal error in /home/ff/lcc/build/rcc
Another strange thing is that when it does compile, the function
bar()
without argumenta
it does not get called in thefoo.S
file. In line12 move r2,r0
it is supposed to load the output frombar()
intoi
but registerr0
never gets loaded with a value (or I missed it).The foo.S:
I'm running on Ubuntu
VERSION="22.04.2 LTS (Jammy Jellyfish)"
.After reading all the assembler output I kind of learned it but I would prefer to use ulpcc instead. It is a great and promising tool.