From d99a9070450157dd8fc3e5d6ad5172af4cc0be59 Mon Sep 17 00:00:00 2001 From: Ian C Date: Wed, 6 Apr 2016 23:37:07 +0100 Subject: Added ZX81 output driver --- doc/casm.html | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 147 insertions(+), 21 deletions(-) (limited to 'doc') diff --git a/doc/casm.html b/doc/casm.html index 9553a15..100abdc 100644 --- a/doc/casm.html +++ b/doc/casm.html @@ -163,9 +163,7 @@ banks of RAM can be added by using the bank or org directives. Banks are numbered from zero upwards.

-

Source Code

- -

Layout

+

Source Code Layout

The source files follow this basic format: @@ -229,7 +227,7 @@ to put the other quote type inside the string. -

Recognised directives

+

Recognised directives

The following directives are also recognised with an optional period (.) in front of them, and are case insensitive. Directives can also be used to @@ -412,7 +410,7 @@ word
-

Expressions

+

Expressions

In any of the directives above, where a value is defined, an expression can be entered.

@@ -604,7 +602,7 @@ Bitwise XOR. -

Character Sets

+

Character Sets

The assembler has built-in support for a few different character sets. These can be set by using the options `charset` or `codepage`, i.e.

@@ -635,23 +633,85 @@ spectrum The character codes as used on the Sinclair ZX Spectrum. + +cbm + + +PETSCII as used on the Commodore Business Machine's range from the +PET to the C128. See +https://en.wikipedia.org/wiki/PETSCII more details. + + zx81 -The character codes as used on the Sinclair ZX-81. Lower case +The character codes as used on the Sinclair ZX81. Lower case letters are encoded as normal upper case letters and upper case -letter will be encoded as inverse upper case letters. +letter will be encoded as inverse upper case letters. In addition the following +characters that have no corresponding ZX81 character are mapped as: + + + + + + + + + + + + + + + + + + + + + + + +
+# + +The British Pound sign.
-cbm +' -PETSCII as used on the Commodore Business Machine's range from the -PET to the C128. See -https://en.wikipedia.org/wiki/PETSCII more details. +Inverse double quotes. +
+\ + +Inverse slash. +
+! + +Inverse question mark.
+| + +Inverse space. +
+~ + +Inverse minus sign. +
+{ } + +Inverse round brackets. +
+` + +The newline character. Note that the newline is actually a HALT opcode used to +terminate the line. +
+ +

e.g.

@@ -678,7 +738,7 @@ https://en.wikipedia.org/wiki/PETSCII more details. -

Macros

+

Macros

Macros can be defined in one of two ways; either parameterless or with named @@ -743,13 +803,14 @@ be replaced by using the following option, e.g.

-Note that this is enforced when the macro is *used*, not when it is *defined*. +Note that this is enforced when the macro is used not when it is +defined. Also the character must not be quoted, as that will be parsed as a string holding the character code of the character.

-

Output Format

+

Output Format

By default the assembled code is written to a file called output as raw binary. The generated output can be controlled with the following options. @@ -801,10 +862,10 @@ A Spectrum emulator TAP file. -p-file +zx81 -A ZX-81 emulator P file. +A ZX81 emulator P file. @@ -850,6 +911,71 @@ another TAP file containing a BASIC loader, for example.

ZX81 .P Output Format

+

+Generates a P-file for an emulator. A ZX81 .P file is simply a dump of memory +from the system variables onwards. +

+ +

This format does not support memory blocks (the .P file is not a container +format) and so will only output anything in the first bank used, and using the +output-file for the filename. +

+ +

The output file will be created as a BASIC program, containing a REM +statement holding the machine code, and a command to execute the code. As +such the output will fail if the code in Bank 0 does not start at address 16514. +Your code must also support being executed from this address. +

+ +

Another important thing to note is about the display file. In the ZX81 +memory map the DFILE can move around depending on the size of the program. +The output driver will create a display file for you. The easiest way to +reference this is to read the DFILE system variable when your program starts. +

+ +

Alternatively you can just as easily set up your own display file once +your program starts if you have special requirements, e.g. a display file for +pseudo hi-res. +

+ + +

ZX81 .P Output Format options

+ +

The ZX81 output driver supports the following settings that can be set via +an option command. +

+ + + + + + + + + + + + + + + + +
OptionDescription
+option zx81-margin, <pal|ntsc> + +Sets the MARGIN system variable appropriately either for the PAL or NTSC +TV system. Defaults to PAL. +
+option zx81-autorun, <on|off> + +Whether the ZX81 should auto run the machine code. Defaults to on. +
+option zx81-collapse-dfile, <on|off> + +Whether the display file should be generated collapsed (e.g. for 1K mode). +Defaults to off. +
+

C64 T64 Tape Output Format

@@ -876,7 +1002,7 @@ to start the machine code, e.g.

Any remaining blocks will be stored as-is without any basic loader.

-

Listing

+

Listing

By default no output listing is generated. This can be controlled by the @@ -1088,14 +1214,14 @@ equivalent:

For the hidden OUT instruction using the flag register, $00 or $ff depending -on where you're reading, the following are all equivalent, where _value_ can -be any value at all: +on where you're reading, the following are all equivalent, where value +can be any value at all:

         out (c)
         out (c),f
-        out (c),
+        out (c),value
 
-- cgit v1.2.3