Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Firmware Wish List
Page 14 of 14 | |||||
Author | Message | ||||
jwettroth Regular Member Joined: 02/08/2011 Location: United StatesPosts: 71 |
My wish is for a simple way to implement basic drivers for IO devices For example: I'd like to make a MM system with an LCD display. I'd like to be able to link to a routine that wrote to the LCD when "print" commands were interpreted. In some basics, there are hooks built in but this usually uses assembly language techniques and wouuldn't apply so well to MM Basic. An easy way to do this would be to enable the "OPEN" commands for a piece of basic code. The syntax would be something like << OPEN LCD,INITLINE,EXECLINE,EXITLINE FOR OUTPUT AS 1>. INITLINE would be an intialization routine that would be called once to initialize the interface- called on open. EXECLINE would be used for normal calls- PRINT #1,DATA, etc. EXITLINE would be called on close or program exit. The basic program and calling return would detmine how the data payload is to be interpreted. It could be passed as an array perhaps and initialized with OPEN. In concise terms for the wish list, I would call this: Expand the OPEN Files syntax to allow access to a routine in BASIC for Input Output. John Wettroth |
||||
donmck Guru Joined: 09/06/2011 Location: AustraliaPosts: 1313 |
Just wondering if anyone else has comments on this before I add it to the wish list. Cheers Don... https://www.dontronics.com |
||||
CircuitGizmos Guru Joined: 08/09/2011 Location: United StatesPosts: 1425 |
Perhaps I'm not understanding, but if functions are implemented, wouldn't that be a cleaner solution? Micromites and Maximites! - Beginning Maximite |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6097 |
User defined functions would certainly cover the request and more. Even being able to pass values to subroutines would help a lot. Jim VK7JH MMedit MMBasic Help |
||||
marcwolf Senior Member Joined: 08/06/2009 Location: AustraliaPosts: 119 |
Passing variables into Subroutines would still cause some issues as any variable changed within the subroutine would be changed globally. Functions have isolated variables. The only variables that would be changed are Globals and the Passed/Returned values. They are also one of the first steps towards code libraries and object orientation. Would be very hand to have and make it a lot easier for people to make add in libraries for various purposes. Dave Coding Coding Coding.. Keep those keyboards coding.. RAW CODE!!!!! |
||||
James_From_Canb Senior Member Joined: 19/06/2011 Location: AustraliaPosts: 265 |
A couple of months ago someone suggested a stack. If parameters were pushed onto the stack, the subroutine or function could read them into local variables and push a return value onto the stack. I don't have my MMBasic doco here, but I think there are only two variable types - strings and floating point numbers. Each would need an array. It should be reasonably easy to code on MMBasic. I'd have a go at it, but I'm away from my normal computer and Maximite for a while. James My mind is aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention. Hedley Lamarr, Blazing Saddles (1974) |
||||
Page 14 of 14 |
Print this page |