For some time now, Espruino supports inline assembler.
To get some experience, I created a replacement for STM32F1 Flash Memory module.
Idea was to have a binary file on SD which is loaded at runtime which would replace Gordons module.
First a new module had to be created which supports loading binarys, please see attached ASM-module.
Commands are:
var asm = require("ASM") //loads module
asm.setup(listON) // if true creates a list of loaded assembler functions, used to safe some memory)
asm.listBinaries() // if setup with true, list all loaded functions
asm.loadArray(varName,format,arr) //creates a function named by varName, using format to describe in/out values and is given by binary in arr
asm.loadSD(varName,format,fileName) //loads a binary file given by fileName, from SD-card, creates a function named by varName, using format to describe in/out values
asm.loadLibrary(lib) // loads a library of functions.
Next post will give a description about lib object for the Flash assembler module.
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.
For some time now, Espruino supports inline assembler.
To get some experience, I created a replacement for STM32F1 Flash Memory module.
Idea was to have a binary file on SD which is loaded at runtime which would replace Gordons module.
First a new module had to be created which supports loading binarys, please see attached ASM-module.
Commands are:
var asm = require("ASM") //loads module
asm.setup(listON) // if true creates a list of loaded assembler functions, used to safe some memory)
asm.listBinaries() // if setup with true, list all loaded functions
asm.loadArray(varName,format,arr) //creates a function named by varName, using format to describe in/out values and is given by binary in arr
asm.loadSD(varName,format,fileName) //loads a binary file given by fileName, from SD-card, creates a function named by varName, using format to describe in/out values
asm.loadLibrary(lib) // loads a library of functions.
Next post will give a description about lib object for the Flash assembler module.
1 Attachment