Open Ccode-lang opened 3 years ago
sim works fine
[INFO] Generating /home/pi/porth/hello-world.asm
[CMD] nasm -felf64 /home/pi/porth/hello-world.asm
[CMD] ld -o /home/pi/porth/hello-world /home/pi/porth/hello-world.o
/home/pi/porth/hello-world.o: file not recognized: file format not recognized
That's because nasm is used for the x86 CPU architecture, raspberry pi in the other hand uses ARM architecture. And also I think assembly instructions in Porth can be only used for x86, for ARM you need to use different assembly instructions.
There is also pull request for arm support https://github.com/tsoding/porth/pull/63
Basically, you need to use aarch64-linux-gnu-as
assembler instead of nasm
. I believe you might have to modify the main file to do this until that pull request gets looked into.
computer info: OS:raspios Model:model 4 b