/* 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. // NOTE - I used to allow both Pascal (* .. *) and { Delphi-style comments } but I've removed them // Too many old sources had stuff like (* % 256) in them. ; Standard assembler-style comments, of course... ; As well as assembling, Zeus can also emulate various Z80 machines. ; This next line tells Zeus to emulate a ZX Spectrum 48K model with the extended ULA video modes. ; zeusemulate "48K","ULA+" ; 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 "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 "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 "zt1.szx" will also have been created in the directory the source file is in, 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... If you click on the "Assemble the Emulate" button this file will be assembled and if it assembles correctly then Zeus will show it running in the built-in ZX Spectrum emulator. Incidentally, the prefix 'zeus' on the print statements is there so you can use print yourself as a label... */