Category: Embedded Development

Plain – Modules

All code in Plain Assembly is within a module. A module is in effect a process, a stand-alone Plain application that is downloaded to the VM and executed. A module is used by a different module with a use statement use system module mymodule     system.println(“Hello World”) end This example re-use the module “system” in “mymodule”.…

Read the full article

Plain – Getting Started

I need to start on the assembler soon so this is a good time to summarize the assembly syntax and rules. Plain-Assembly is an assembly language on the same level as a 3rd generation language. It is called an assembler because we maintain one statement one instruction. I deliberately avoid the word compiler because there…

Read the full article

VM – FOR Instruction

One of my challenges is that our new Object Descriptor have a dynamic size if you take into account the extensions. To deal with this I decided that if E=1 (Extension) we use the Offset as an offset into the dynamic part of the instruction, meaning that every instruction will have a static and one…

Read the full article

VM – Registers

All CPU’s, even VM’s have a set of global variables referred to as “Registers”. These are the internal data used to execute instructions. Our VM is no exception, but the registers we need differ from instruction to instruction due to their high level nature. “Registers” in this context is variables in our VM struct. The…

Read the full article

VM – Updated Object Descriptor

It’s been a few versions of the Object Descriptor and I am not sure this is the last one. I needed to optimize that math table to be more static so I added an entry that will not allow extensions on P1 and P2 since they never will be needed.

Plain – Alternative Syntax

I have a friend that constantly complain that Plain syntax don’t look like C, so here it is – the C’ifed alternative version… Use System; Module Servo32 {             Enum Byte ChannelMode             {                         DigitalIn,                         DigitalOut,                         AnalogueIn,                         AnalogueOut,                         PWMOut,                         Servo,             };            …

Read the full article

Updated Servo Example

Use System Module Servo32             Enum Byte ChannelMode                         DigitalIn                         DigitalOut                         AnalogueIn                         AnalogueOut                         PWMOut                         Servo             End             Object Channel                         ChannelMode mode                               uint32 frequency                         uint32 duty                         uint32 servoPosition                         real32 analogueValue                         bit digitalValue…

Read the full article

Plain – Transactions

With a working draft of the VM I need to move on Plain Assembly syntax. By addressing syntax I challenge the VM as well and it will drive a few changes. I expect the number of instructions to increase as I cover topics. One such topic is how to maintain data integrity during multi-threaded transactions?…

Read the full article

VM – Updated Instructions

Assign Assign an expression to a variable. Execute a pre-parsed expression tree and store the resulting value in a variable. Expression can either be written as an algebraic math expression or a list of simple operations separated with ; Call Call a function. Call creates a return entry on the stack and will continue with…

Read the full article