diff --git a/Porting-Guide.md b/Porting-Guide.md index 8f4a245..066fc33 100644 --- a/Porting-Guide.md +++ b/Porting-Guide.md @@ -28,9 +28,12 @@ If your system has no concept of terminal I/O (a games console or embedded syste ## Porting to 16-bit microprocessor systems +One of the objectives of PLASMA was to ease the programmer burden for routine use of 16-bit quantities on the 8-bit 6502. This is similar to the motivation behind Woz's initial inclusion of the [SWEET16](https://en.wikipedia.org/wiki/SWEET16) virtual machine in the original Apple ][ ROM. As such, 16-bit WORDs are a primitive data type in PLASMA. In fact, WORDs and BYTEs are the *only* primitive data types, and WORDs serve a double purpose by being the addressing primitive for all pointer types. + +Due to these features of the language, PLASMA will be a natural fit for CPUs that can perform 16-bit internal operations and can address byte locations in memory (odd -or- even address) using 16-bit addresses. Of course, the PLVM must be reimplemented for the CPU, but would theoretically result in a more streamlined VM since some VM opcodes would be much more trivially performed by the 16-bit CPU compared to a 6502. If only PLASMA language portability is necessary (no PLVM byte code portability), then it may even be practical to compile PLASMA directly to the 16-bit CPU's native code so it can be executed without an interpreter. However, at this point one mush ask what benefits PLASMA offers to the 16-bit platform, alongside the likely existing high-level language compilers for C/C++. + There is a somewhat raw implementation of the PLASMA bytecode interpreter (no "cmd") for the homebrew 16-bit OPC6 CPU discussed here: http://anycpu.org/forum/viewtopic.php?f=3&t=426 This implementation doesn't have the latest VM opcode changes, so you must use a version of the PLASMA compiler from the same time as the thread posts. (It would be possible to implement "cmd", but this requires a fuller OPC6 environment with terminal I/O and random access files, which the basic OPC6 emulator lacks.) ## Potential for incorporating ports in mainline PLASMA project -