3 ms·
Yes. From reading cbmbasic.c, I can see a couple of things clearly: 1) This code was generated by the LLVM C-backend (llvm_cbe), which converts LLVM IR to C co
by skissane 6y ago
Yes. From reading cbmbasic.c, I can see a couple of things clearly:
1) This code was generated by the LLVM C-backend (llvm_cbe), which converts LLVM IR to C code
2) The code contains variables for the 6502 registers.
This suggests it was generated by translating 6502 machine code to LLVM IR, and then converting the LLVM IR to C.
- noobermin 6y agoI see. I guessed from the llvm prefixes everywhere it had something to do with llvm ir, I just am merely aware of llvm ir but don't use it personally.
- bdowling 6y agoThe structure of a loop around a big switch statement (based on value at PC) to blocks of code that manipulate the register variables (A, X, Y, PC, etc) and RAM looks exactly like an emulator core. The code also appears to include the Commodore BASIC ROM. (See initialization of llvm_cbe_ROM in cbmbasic.c). So, it looks like an emulator that was written in some other language then converted to C using the LLVM C backend.