[llvm-dev] TI 59 backend

via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 14 08:53:08 PDT 2018


Hello,

I am a new comer to llvm framework. I read quite many tutorials but I am still not able to determine whether llvm can be used for my project: implementing a backend for the famous Texas Instruments 59 Calculator (sold from 1977 to 1982).

This is not a CPU but it uses a kind of bytecode that is interpreted (see examples in http://ti59compiler.wixsite.com/ti59/t-compiler). It has no stack, no frame, only floating point registers. The memory is split between program (up to 960 steps) and registers (up to 100). A register consumes 8 program steps, reducing the program size accordingly.

The most tricky part is the following: a simple instruction like MOV R1,N may require more or less bytes to be coded. For instance:

   MOV R1,1   will require 3 bytes: (key) 1, STO, 01.
   MOV R2,345 will require 5 bytes: (key) 3, (key) 4, (key) 5, STO, 02.

How to cope with such an instruction? Can llvm be used to generate the right bytecode?

Any idea is welcome ! Thanks for your support.

Best regards
Philippe


More information about the llvm-dev mailing list