If you look at the “hello-world.slq”, you can probably figure most of it out but in case you can’t here goes.
The commands below take arguments; an argument can be a label name (without the “:”), a number, a number/label prefixed with “.offset” (which will give you the offset within the program of the number/label) or can be a a label surrounded by “[” and “]”; which will dereference the value at the label.
All the commands below here are meta commands and are implemented on top of subleq. This lot all need a label called “Z” which points to an .int register initialised to zero.
These commands are built on top of the preceding ones and also require a label called “sp” which points to an .int register initialised to zero.
This command is used for native calling, it requires all the registers we’ve talked about before plus one called “bar”. This label must be preloaded with the real memory address of the program – this lets you calculate real memory addresses of sublet values so you can create a call stack.
You will probably also need an int label called “dlsym”. Whilst you don’t actually need this register, if you want to be able to do anything useful you’ll need it.
When using the debugger: sublet-dbg.py, it will set the value of dlsym to the real address of the dlsym function and bar to the real address of the sublet program code.
This is pretty self explanatory; its got help (just type “h”). basically you can set breakpoints (bp 15c), continue (c), step (c) (individual subleq micro instructions) and print values (p).
You’ll also notice that the next instruction to be executed will be highlighted in green, breakpoint addresses will get a blue cross in the middle, and changed values will go red.