Search found 7 matches

by pgavlin
29 Apr 2019, 14:06
Forum: Hardware and software hacking
Topic: Indirect Addressing?
Replies: 8
Views: 691

Re: Indirect Addressing?

A few thoughts: > The other idea I wish to implement is a set of pseudo registers in zero-page RAM. If vAC is register R0, then I see no reason why further 16-bit registers cannot be implemented in RAM - and given names (eg R1-R15) to make working in assembly language easier. This is the approach ta...
by pgavlin
27 Apr 2019, 18:40
Forum: Hardware and software hacking
Topic: Rudimentary vCPU support for the lcc C compiler
Replies: 16
Views: 3471

Re: Rudimentary vCPU support for the lcc C compiler

With several more fixes, we now have a much more interesting "Hello, world!" program. Here is the GT1 emulating a GT1: https://gist.github.com/pgavlin/c97f2fd1c50e0c622a3df291bfdf5f5b I haven't uploaded a video for this one, but the speed is surprisingly respectable. Sure, you can watch the characte...
by pgavlin
23 Apr 2019, 22:17
Forum: Hardware and software hacking
Topic: Rudimentary vCPU support for the lcc C compiler
Replies: 16
Views: 3471

Re: Rudimentary vCPU support for the lcc C compiler

After a bit of afternoon hacking to support looking up values from ROM, we can now compile and run a simple "Hello, world!" program: https://youtu.be/9-zz2MjGwN0 #define Sys_Draw4_30 0x04d4 #define SYS_VDrawBits_134 0x04e1 #define sysfn ((unsigned*)(void*)0x0022u) #define sysargs ((unsigned char*)(v...
by pgavlin
22 Apr 2019, 20:14
Forum: Hardware and software hacking
Topic: Rudimentary vCPU support for the lcc C compiler
Replies: 16
Views: 3471

Re: Rudimentary vCPU support for the lcc C compiler

> Ok I understand. vCPU isn't really designed with C programs in mind, so many things will never be efficient. But efficiency doesn't matter, because this connects the Gigatron to another domain people are familiar with, and that's what makes it great . My feelings exactly :) For a practical example...
by pgavlin
22 Apr 2019, 19:58
Forum: Hardware and software hacking
Topic: Rudimentary vCPU support for the lcc C compiler
Replies: 16
Views: 3471

Re: Rudimentary vCPU support for the lcc C compiler

> My question: are the local C variables that I see in the videos indeed stack variables? That is: using the ALLOC/STLW/LDLW instructions? They are not--most of them are allocated to "registers" in the user vars area of the zero page. As it stands, the compiler does not emit the alloc/stlw/ldlw inst...
by pgavlin
22 Apr 2019, 19:50
Forum: Hardware and software hacking
Topic: Rudimentary vCPU support for the lcc C compiler
Replies: 16
Views: 3471

Re: Rudimentary vCPU support for the lcc C compiler

Here is a non-exhaustive list of things that do not work as of yet: - Multiplication, division, modulus, arbitrary-width left and right shifts, and sign extension all require runtime helpers that I haven't yet written - Comparisons are probably broken with respect to overflow - Floating point suppor...
by pgavlin
22 Apr 2019, 19:42
Forum: Hardware and software hacking
Topic: Rudimentary vCPU support for the lcc C compiler
Replies: 16
Views: 3471

Rudimentary vCPU support for the lcc C compiler

Hi all, I'm happy to report that I have a very rough cut at a vCPU backend for the `lcc` C compiler. I chose this compiler for retargeting because of its simplicity and the clarity of the interface between its front- and back-ends. Though I'm certain that there are many, many sharp edges, I have bee...