LMM programming
richaj45
Posts: 179
Hello:
Has any one written pasm programs in the large memory model directly?
That is a large assemble program using the interpreted instructions for am LMM engine.
If so, which tool is used to assemble the source code?
Thank you,
rich
Has any one written pasm programs in the large memory model directly?
That is a large assemble program using the interpreted instructions for am LMM engine.
If so, which tool is used to assemble the source code?
Thank you,
rich
Comments
That is what PropBASIC uses to compile the LMM code that it generates.
Bean
Don't forget, it is not just a case of writing LMM code. You need an LMM kernel to run the resulting instructions and something to start that kernel with. propgcc of course has all that. You can probably do it with Catalina as well.
Heater is correct - with LMM the code has to be written to match the kernel that will execute it. But you don't need a special LMM assembler - BST, Homespun or even the Parallax Spin compiler can do it (but note that the latter is limited to 32k of code, the former are not).
Ross.
So were can i find the source code for one of these LMM engines that was mentioned?
cheers,
rich
With Catalina, just download any version (the latest version is here), install it and look in the folder target for the file Catalina_LMM.spin - this is the Spin/PASM source code for the Catalina LMM kernel, and it will be automatically included in any C program. While you could load and start it manually, a simple way to run your own hand-written LMM PASM program with Catalina is to call it from C function. For instance, here is a working example:
Save the following C program as example.c:
This program simply calls a function (called find) with the parameter 0 (for the kernel) and prints the result (which will be the cog on which the kernel is found).
The function find was hand written to follow the Catalina conventions and is shown below (save it as find.e):
You would compile this with the command: The conventions that such hand written PASM programs must follow (e.g. how to accept and pass parameters, what PASM instructions cannot be used in LMM programs, and how to invoke various "primitives" implemented in the LMM kernel) are described in the Catalina Reference Manual.
Ross.
Ross.
I am going to start looking at the code you all have pointed me to.
cheers,
rich