2019-06-04 01:15:07 +10:00
|
|
|
# Assembling z80 source from the shell
|
|
|
|
|
|
|
|
In its current state, Collapse OS has all you need to assemble z80 source
|
|
|
|
from within the shell. What you need is:
|
|
|
|
|
|
|
|
* A mounted filesystem with `zasm` on it.
|
|
|
|
* A block device to read from (can be a file from mounted CFS)
|
2019-06-06 09:51:19 +10:00
|
|
|
* A block device to write to (can also be a file).
|
2019-06-04 01:15:07 +10:00
|
|
|
|
|
|
|
The emulated shell is already set up with all you need. If you want to run that
|
|
|
|
on a real machine, you'll have to make sure to provide these requirements.
|
|
|
|
|
|
|
|
The emulated shell has a `hello.asm` file in its mounted filesystem that is
|
|
|
|
ready to compile. It has two file handles 0 and 1, mapped to blk IDs 1 and 2.
|
2019-06-06 09:51:19 +10:00
|
|
|
We will open our source file in handle 0 and our dest file in handle 1. Then,
|
|
|
|
with the power of the `pgm` module, we'll autoload our newly compiled file and
|
|
|
|
execute it!
|
2019-06-04 01:15:07 +10:00
|
|
|
|
|
|
|
Collapse OS
|
2019-06-06 09:51:19 +10:00
|
|
|
> fnew 1 dest ; create destination file
|
|
|
|
> fopn 0 hello.asm ; open source file in handle 0
|
|
|
|
> fopn 1 dest ; open dest binary in handle 1
|
2019-06-15 04:24:51 +10:00
|
|
|
> zasm 1 2 ; assemble source file into binary file
|
2019-06-06 09:51:19 +10:00
|
|
|
> dest ; call newly compiled file
|
2019-06-04 01:15:07 +10:00
|
|
|
Assembled from the shell
|
|
|
|
> ; Awesome!
|