@Gordon, you opened Pandora's box, so I decided to "let's see what inside".
My background is assembler long time ago, but not ARM.
first step playing around with given example.
It works, good news. So have a look at minor changes.
Add 7 instead of 2 is simple by altering first command to movs r2, #7 .
Double given parameter simply add this adds r0,r0,r0
BTW, interesting to work with 3 parameters.
switch to external assembler.
The internal assembler, even if limited is a good starting point.
By searching for a "full blown" assembler I found http://flatassembler.net/
At this point I learned something about THUMBS and ARM commands.
To get same results as in Gordons example this needs to be done.
As you can see, first line switches to thumb mode.
One of the main futures of an assembler is last line. You don't have to count the number of word ´s to get the adress of GPIO adress.
Ok, there is another difference, use dw instead of .word
after compilation we get a bin file.
Right now I read this with Hex Editor and type it in manually. Don't forget to switch the bytes ;-)
What about using 2 parameters for a function like this adder(2,3)
var adder = E.asm("long(long,long)",
"bx lr");
adder(2,3);
And I get an error no caller for argument 438
tried with all given datatypes, to see whats given by
int, bool and Pin return an error.
Where are the parameters, and how could I interpret those ?
Big question, as far as I can see, r0 is used in the example for input and return value
If somebody has more examples, please share it
Whats now, hmmm
During development of Display driver for ILI9341 Gordon mentioned something like "we could speed it up by using SPI.send with repeat option".
Would it be possible to have something like a list of "interesting entrypoints". There is something like spi_sender_software in jswrap_spi_i2c.c
This could be an additional file created during compilation of new version, and could be used similiar to boardinfo. A new processor for Web IDE could replace adresses and ....
Hey Gordon, its you who opened Pandora's box ;-))
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@Gordon, you opened Pandora's box, so I decided to "let's see what inside".
My background is assembler long time ago, but not ARM.
It works, good news. So have a look at minor changes.
Add 7 instead of 2 is simple by altering first command to movs r2, #7 .
Double given parameter simply add this adds r0,r0,r0
BTW, interesting to work with 3 parameters.
switch to external assembler.
The internal assembler, even if limited is a good starting point.
By searching for a "full blown" assembler I found http://flatassembler.net/
At this point I learned something about THUMBS and ARM commands.
To get same results as in Gordons example this needs to be done.
As you can see, first line switches to thumb mode.
One of the main futures of an assembler is last line. You don't have to count the number of word ´s to get the adress of GPIO adress.
Ok, there is another difference, use dw instead of .word
Right now I read this with Hex Editor and type it in manually. Don't forget to switch the bytes ;-)
What about using 2 parameters for a function like this adder(2,3)
And I get an error no caller for argument 438
int, bool and Pin return an error.
Big question, as far as I can see, r0 is used in the example for input and return value
If somebody has more examples, please share it
During development of Display driver for ILI9341 Gordon mentioned something like "we could speed it up by using SPI.send with repeat option".
Would it be possible to have something like a list of "interesting entrypoints". There is something like spi_sender_software in jswrap_spi_i2c.c
This could be an additional file created during compilation of new version, and could be used similiar to boardinfo. A new processor for Web IDE could replace adresses and ....
Hey Gordon, its you who opened Pandora's box ;-))
Juergen