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, }; …
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, }; …
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…
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?…
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…
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…
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…
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…
I mentioned the possibility to embed expressions into If, Call, Raise, While etc to avoid having a Plain Assembly that split into several instructions. This is a 1st draft where I truncate the Data-Type flag in the Object Descriptor and use the MSB to flag an Extended Object Descriptor. The Extension here contain a Tag…
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…
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…