Category: Embedded Development

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

Plain Servo Example

I will use the next days to wrap up a working version of the VM so I can test code footprint and performance. What I expect is actually quite high overall performance. Each instruction will be significantly slower than an ARM instruction -probably in the region of 1:1000, so I am hoping for an instruction…

Read the full article

VM – New Object Descriptor

I drafted this new Object Descriptor. What I do here is heavy bit-fiddling that I in general will not recommend. We will be reading this from Flash that is 2-3 times slower than SRAM, but I think this will be ok since these extensions will not be used often. E=1 means we have extensions. The…

Read the full article

VM – Dropping the stack

Do I actually need a separate stack in the VM? The current draft use 2 memory areas – one for variables and one for the stack. This is influenced by legacy CPU design. But. the reality is that Plain do not allow dynamic memory so the variable area is static size and can be estimated…

Read the full article

VM – Raise

The introduction of the 32 bit Object Descriptor bloat the instruction set, but we currently only have 12 high-level instructions left in the VM – This is Assign, Call, Decode, Encode, End, Exit, For, If, NOP, Raise, While and Switch. Just for the record – this is actual instructions, not keywords supported by the Assembler syntax. I…

Read the full article

VM – New Stack

The previous stack design was to store only data descriptors on the stack – not data itself. The side-effect of this is that everything becomes global data. The alternative to pass a copy also have a side effect if I pass an object + passing an auto-decided combination of data and references is not nice…

Read the full article