Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding new commands to ZX BASIC
#2
To add commands to the compiler, you'd have to rewrite the compiler such that it knew what to do with new commands. So far that's been down to Boriel only.

To add new features, however - we do that all the time. You can write functions and subroutines and publish them for others to use. Ideally, add them to the Library in the wiki. <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Library">http://www.boriel.com/wiki/en/index.php ... IC:Library</a><!-- m -->

By that logic, I (and others!) have been adding new commands to the language all the time. 64 character printing commands ( print64("hello world") ), double size printing or faster maths options. You just write it to a file, #include it and away you go with new commands available. If you don't like it, you can tweak it for your programs - but sharing useful subroutines and functions is a way of extending the language for everyone else as well.

Most of the stuff you list is a trivial bit of assembly, really - and you can copy them right out of your SE basic code I suspect. The library routines there will be good pointers for how to get

SUB put (source as uInteger, destination as uinteger)

variables like those from the popping stack or from using the IX pointer into assembly code.

Code for Play is definitely more reasonable for Boriel to include - but write it up as a sub first and submit it. Other stuff that's got in began life there.
(Though automated 128K memory support would be far more useful, I think!)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)