/*

This is a simple demonstration file for the Zeus assembler.
If you want more sustantial files they're available at www.desdes.com

First, note the C-style block comments.

*/

// And C++ style comments.

(* You can also use Pascal-style comments *)

// NOTE - I used to allow { Delphi-style comments } but I've removed them
// I now have a much better idea for these.

; Standard assembler-style comments, of course...

(* /* They all nest as you would expect */ *)

; Enough comments. Let's have some source... Spectrum, of course

ScreenBase	equ $4000		; '$' or '#' for hex

		org $6000		; Somewhere convenient

Start		ld hl,ScreenBase	; Start of it
		ld de,ScreenBase+1	;
		ld bc,$1B00		;

		inc (hl)		; Increment the value

		ldir			; Cover it

		jr Start		;

(*
This next command tells Zeus where to put the code it generates. As a szx file...
It has three parameters, the filename, where the stack should go and where to start
Alter the path to suit your system, of course.
*)
	output_szx "c:\zt1.szx",$0000,Start	; The szx file
(*
The output_szx can appear wherever you like in the file. If there's more than one of
them the last one will be the one used.
*)

(*
If for some reason you want raw binary, include this line
It has three parameters, the filename, start of block and length
*)

;	output_bin "c:\zt1.bin",$0000,$10000	; The binary file

(*
Note that I've commented it out. Normally it wouldn't be, of course.

The output_bin can appear wherever you like in the file. If there's more than one of
them the last one will be the one used.

If both output types appear, both files will be written.
*)

(* 
Zeus can print expressions during assembly. Useful for debugging sometimes...
*)
zeusprint    "Hello! ",42
zeusprinthex "Hello again! ",42

; You may want to drag the divider up to increase the size of the bottom window so
; you can see them...

(*
So, when you press the assemble button and you should see:

Hello! 42 
Hello again! 0000002A 
nErrors = 0 nRedef = 0 nUndef = 0

Appear below. The file "c:\zt1.szx" will also have been created, you can load this
into your favourite Spectrum emulator (I highly reccommend Spectaculator) and it
should run and produce a shockingly horrid display... Ah, the joys of attributes...

Incidentally, the prefix 'zeus' on the print statements is there so you can use
print yourself as a label...
*)

