Next: , Previous: , Up: TC-Y   [Contents][Index]

4.20.5 TC-Y FAQ

How to compile and test?

To generate a binary from an ARM assembly file:

(print_int(42); print("\n"))

File 4.96: print-int-arm.tig

$ tc --target-arm -S print-int-arm.tig >print-int-arm.s

Example 4.154: tc --target-arm -S print-int-arm.tig >print-int-arm.s

$ arm-linux-gnueabihf-gcc-7 -march=armv7-a -oprint-int print-int-arm.s

Example 4.155: arm-linux-gnueabihf-gcc-7 -march=armv7-a -oprint-int print-int-arm.s

To run your code, use QEMU:

$ qemu-arm -L /usr/arm-linux-gnueabihf ./print-int

Example 4.156: qemu-arm -L /usr/arm-linux-gnueabihf ./print-int

QEMU (Quick Emulator) is a machine emulator and virtualizer. It can emulate a full system, including processor and peripherals. We are using it to emulate an ARM processor.