Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

zasm.md 1.2KB

1234567891011121314151617181920212223242526
  1. # Assembling z80 source from the shell
  2. In its current state, Collapse OS has all you need to assemble z80 source
  3. from within the shell. What you need is:
  4. * A mounted filesystem with `zasm` on it.
  5. * A block device to read from (can be a file from mounted CFS)
  6. * A block device to write to (can also be a file).
  7. The emulated shell is already set up with all you need. If you want to run that
  8. on a real machine, you'll have to make sure to provide these requirements.
  9. The emulated shell has a `hello.asm` file in its mounted filesystem that is
  10. ready to compile. It has two file handles 0 and 1, mapped to blk IDs 1 and 2.
  11. We will open our source file in handle 0 and our dest file in handle 1. Then,
  12. with the power of the `fs` module's autoloader, we'll load our newly compiled
  13. file and execute it!
  14. Collapse OS
  15. > fnew 1 dest ; create destination file
  16. > fopen 0 hello.asm ; open source file in handle 0
  17. > fopen 1 dest ; open dest binary in handle 1
  18. > zasm 1 2 ; assemble source file into binary file
  19. > dest ; call newly compiled file
  20. Assembled from the shell
  21. > ; Awesome!