ZEUS Assembler for JLO v2.63+ Disk Systems

Author(s): Alvin Albrecht
Publication: ZXir QLive Alive!
Pub Details: ZXir QLive Alive! v5 n3 (Volume 5, Issue 3)
Date: Autumn 1995
Pages: 7-10

If you are a regular m/c programmer like me, then you can appreciate the value of a good assembler. I like Zeus Assembler plenty, but it has one problem – it’s tape based. Having gotten used to the speed and convenience of the JLO disk system, doing anything with Zeus became a chore. So, I took it upon myself to adapt Zeus to the features of the JLO disk system,

LISTing 2 is the result. I should point out that the modifications will work for JLO SAFE V2.63 and higher (those versions with the function dispatcher) and will not work with Zeus Disassembler. The Zeus print utility has been changed to work with the AERCO CPI or JLO CPI and large printer. You can use any of the printer features available from JLO SAFE. To make your new and improved version of Zeus, follow these steps:

1. LOAD Zeus from tape and quit to basic. (*** For those of you with a sense of humor; before quitting to basic, type in “What is the meaning of life ?” at the Zeus prompt EXACTLY – spaces and all but no quotes. Fans of Douglas Adams should get a chuckle. Incidentally, this feature is what makes modification of Zeus Assembler possible. Many thanks to the forward thinking Individual at Crystal Computing for doing this for us).
2. Replace LOAD “” CODE in line 1 with LOAD / “zeus” CODE: LOAD / “zeus2” CODE.
3. Insert a disk to SAVE Zeus and ENTER SAVE / “ZEUS” LINE 1.
4. Re-ENTER Zeus, type in LISTing 2 and assemble it.
5. Quit to BASIC and ENTER SAVE / “zeus” CODE 57344,8180: SAVE / “zeus2” CODE 30000,626.

You are done! Zeus works in the normal way but now occupies addresses 30000-30625 and 57344-65523. A new command summary is printed if you type in ‘C’ and enter. The new commands allow you to LOAD, SAVE, ERASE, CAT, change drives and set printer margin from within Zeus. The CAT command will only list byte files. If you LOAD a file with a LISTing already present in Zeus, the new file will be appended and the whole thing renumbered.

Any talk of improving Zeus would not be complete without mentioning Richard Hurd’s “Zeus to ASCII Converter”. It was originally published on page 6 of the March/April 1988 issue of Time Design Magazine and, for completeness, I have reproduced it in LISTing 1 just to be sure it is not forgotten. It is an excellent little utility that converts Zeus files to ASCII files that can be LOADed into your favourite word processor and written about in ZXir QLive Alive! Enjoy.

Listing 1. Z_2_M/T

INSTRUCTIONS

1. Load Zeus Assembler
2. Enter this little basic listing:

 5 REM HERE TO ENTER CODE
10 LET t=0
20 FOR f=61431 TO 61624
30 IF t=0 THEN PRINT f;: LET t=6
40 INPUT n
50 POKE f,n: PRINT TAB t;n;
60 LET t=t+4: IF t>=29 THEN PRINT: LET t=0
70 NEXT f
80 STOP

3. Run this program and enter the 194 bytes listed below:

61431  33  0   128 17  79  183
61437 35 35 126 254 10 40
61443 41 254 128 48 47 254
61449 0 40 4 18 19 24
61455 238 62 13 18 35 19
61461 126 254 255 32 7 35
61467 126 254 255 40 70 43
61473 62 237 186 32 215 62
61479 255 187 48 59 24 208
61485 35 70 62 32 18 19
61491 16 252 24 199 203 191
61497 14 0 229 33 87 238
61503 185 40 18 245 35 126
61509 254 8 40 6 254 10
61515 40 2 24 244 241 12
61521 35 24 235 126 18 35
61527 126 19 254 8 40 6
61533 254 10 40 2 24 241
61539 225 24 152 235 17 79
61545 183 167 237 82 229 193
61551 201 176 185 112 126 42
61557 114 240 6 64 62 32
61563 119 35 16 252 42 112
61569 240 1 0 0 126 254
61575 13 40 8 254 255 40
61581 31 12 35 24 243 35
61587 229 237 91 114 240 42
61593 112 240 237 176 42 114
61599 240 1 64 0 9 34
61605 114 240 225 34 112 240
61611 24 199 42 114 240 1
61617 48 117 183 237 66 229
61623 193 201

4. Save it with SAVE /”Z_2_M/T” CODE 61015,610
5. Type in the following basic program and save it with SAVE /”Z_2_M/T” LINE 1.

 5 REM  ZEUS SOURCE CODE TO ASC II TEXT CONVERTER
10 REM (C) 1987 Richard Hurd
15 REM March/April 1988 Time Designs Mag.
20 LOAD /"Z_2_M/T"CODE
25 CLS : PRINT "Zeus Source file to ASC II text converter."
30 INPUT "Please enter filename containing source code: "; LINE a$
35 LOAD /a$CODE 32768
40 LET length=USR 61431: POKE 46927+length,255
45 INPUT "Destination filename? "; LINE a$
50 SAVE /a$CODE 46927,length

Listing 2. ZEUSCUST

;**************************
; ZEUS CUSTOMIZER
;
; SEP 1989 ALBRECHT
; Revised OCT 1992
;
;*** FOR JLO SAFE V2.63
; DISK AND LARGE
; PRINTERS
;**************************
;
;boot-up message
;
ORG 57393
DEFM /ZEUS Z80 ASSEMBLER/
DEFB 13,127
DEFM / 1983 Crystal/
DEFB 13
DEFM /"C" for mods /
DEFM /list /
DEFB 13,13,0
;
;zeus 2.1 prompt
;
ORG 57520
DEFM /2.1/
;
;reset initial tabs
;
ORG 63578
DEFM / /
DEFB "1
ORG 63545
DEFM / /
DEFB "1
;
;accept zeus commands
;with letters A to ^
;
ORG 58548
DEFB 95
;
;"I" command is now the
;fifth command in the
;command list
;
ORG 57534
DEFB 5
;
;command list
;
ORG 60875
DEFB "A,8,"C,8,"D,8
DEFB "F,8,"I,8,"L,8,"M
DEFB "A,"R,8,"M,8,"N,8
DEFB "O,8,"P,8,"Q,8,"R,8
DEFB "S,8,"T,8,"X,8
DEFB 94,8,12
;
;change address of
;command lookup table
;
ORG 57611
DEFW 60912
;
;command lookup table
;
ORG 60912
DEFB 1,14,0,140,235
DEFB 0
DEFW CONFIGURE
DEFB 2,255,255,0,0,244
DEFB 227
DEFB 3,0,0,255,255,14,0
DEFB 23,228,2,10,0,10,0
DEFB 181,227
DEFB 3,0,0,255,255,14,0
DEFB 188,227,1,8,0
DEFW MARGIN
DEFB 0,162,241,1,0,128
DEFB 74,228,1,0,128,79
DEFB 228,1,0,0,#30,#F1
DEFB 0,#66,237,3,10,0,10
DEFB 0,0,0,203,227
DEFB 1,14,0,93,228,0
DEFB 131,237,0,70,228,0
DEFW DISKCOM
;
;second command table
;holding new commands
;
EXCOM DEFB "C,8,"D,8
DEFB "E,8,"L,8,"S,8,12
;3 bytes left for more
;commands
;
;second command lookup
;table
;
ORG 30000
EXDET DEFB 0
DEFW CAT
DEFB 1,0,0
DEFW DRIVE
DEFB 0
DEFW ERASE
DEFB 0
DEFW LOAD
DEFB 0
DEFW SAVE
;
;interprets commands
;following "^"
;
DISKCOM CALL 10
LD A,(#1FFF)
CP #63
JR C,badversn
INC A
JR Z,badversn
LD A,(8)
LD DE,#FE00
CALL 58612
CALL 58611
SCF
RET Z
LD HL,EXCOM
LD B,0
CALL 58068
RET C
PUSH DE
CALL 58612
LD (64793),DE
LD HL,EXDET
JP 57620
badversn LD A,(8)
CALL #E4E3
DEFB 13
DEFM /*** JLO 2.63+ ONLY/
DEFM / ***/
DEFB 13,0
AND A
RET
;
LOAD CALL 10
CALL filedata
CCF
JP C,exit
LD A,2
LD (#3F1B),A
LD A,#FF
LD (#378D),A
LD DE,(64768)
LD (#372D),DE
LD HL,(64770)
SBC HL,DE
JR C,loadit
LD HL,(64770)
DEC HL
LD (#372D),HL
loadit RST #28
DEFB #01
CCF
JR C,exit
LD A,(8)
EI
LD HL,10
LD (64793),HL
LD (64795),HL
LD L,0
LD (64797),HL
CALL 58315
LD HL,(64768)
LD (64793),HL
JP 58447
;
SAVE CALL 10
CALL filedata
JR NC,oksave
LD A,(8)
CALL #E4E3
DEFM /Overwrite?/
DEFB 13,0
confirm1 CALL #F652
RES 5,A
CP "Y
JR Z,oksave1
CP "N
JR NZ,confirm1
RET
oksave1 CALL 10
oksave LD DE,(64768)
LD (#372D),DE
LD HL,(64770)
SBC HL,DE
JR C,err1
INC HL
INC HL
LD (#372B),HL
LD A,"/
LD (#377A),A
XOR A
LD (#378D),A
RST #28
DEFB #01
CCF
JR exit
err1 SCF
exit RST #18
;
ERASE CALL 10
CALL filedata
CCF
JR C,exit
LD A,(8)
CALL #E4E3
DEFM /Sure?/
DEFB 13,0
confirm2 CALL #F652
RES 5,A
CP "Y
JR Z,okerase
CP "N
JR NZ,confirm2
RET
okerase CALL 10
RST #28
DEFB #02
CCF
RST #18
;
CAT LD A,"-
LD B,27
CALL prchars
CALL #E4E3
DEFB 13
DEFM /ZEUS FILES/
DEFB 13,13
DEFM /DISK NAME: /
DEFB 0
CALL 10
RST #28
DEFB #08
LD HL,#2610
LD B,16
CALL prhl
LD A,(#3780)
PUSH AF
LD A,(8)
CALL #E4E3
DEFB 13
DEFM /drive #/
DEFB 0
POP AF
CALL #F2DF
CALL #E4E3
DEFB 13,13
DEFM /FILENAME /
DEFM /SIZE/
DEFB 13,0
LD A,"-
LD B,27
CALL prchars
LD A,13
CALL #F503
CALL 10
LD HL,#262A
LD B,12
catloop PUSH HL
LD DE,(#2608)
SBC HL,DE
POP HL
JR NC,donecat
LD A,(HL)
CP 3
JR NZ,nextentry
PUSH BC
PUSH HL
LD DE,65526
ADD HL,DE
LD B,10
CALL prhl
LD A,(8)
LD A,"
LD B,4
CALL prchars
CALL 10
POP HL
PUSH HL
INC HL
LD E,(HL)
INC HL
LD D,(HL)
EX DE,HL
LD A,(8)
CALL #E5A3
LD A,13
CALL #F503
CALL 10
POP HL
POP BC
DEC B
nextentry LD DE,20
ADD HL,DE
LD A,B
OR A
JR NZ,catloop
PUSH HL
LD A,(8)
CALL #F652
CALL 10
POP HL
LD B,20
JR catloop
donecat LD HL,(#2604)
PUSH HL
LD A,(8)
CALL #E4E3
DEFB 13
DEFM /CAPACITY: /
DEFB 0
POP HL
CALL #E5A3
CALL #E4E3
DEFM /CYLS/
DEFB 13,0
AND A
RET
prhl LD A,(HL)
PUSH BC
PUSH HL
PUSH AF
LD A,(8)
POP AF
CALL #F503
CALL 10
POP HL
POP BC
INC HL
DJNZ prhl
RET
prchars PUSH BC
PUSH AF
CALL #F503
POP AF
POP BC
DJNZ prchars
RET
;
filedata LD DE,(64793)
LD HL,#3720
LD B,10
namelp LD A,(DE)
OR A
JR Z,spaces
LD (HL),A
INC DE
INC HL
DJNZ namelp
JR type
spaces LD (HL),32
INC HL
DJNZ spaces
type LD (HL),3
RST #28
DEFB #08
LD DE,#3720
LD HL,#2620
RST #28
DEFB #18
RET
;
DRIVE CALL 10
LD A,(64793)
CP 4
CCF
CALL C,#18
LD (#3780),A
RST #28
DEFB #12
OUT (#B7),A
RST #18
;
ORG 63521
LPRINT PUSH AF
CALL 10
POP AF
RST #28
DEFB #11
RST #18
;
;sets printer's left
;margin. Command in form:
; 27,77,margin
;epson command
;
ORG 65280
MARGIN LD A,27
CALL LPRINT
LD A,"M
CALL LPRINT
LD A,(64793)
CALL LPRINT
RET
;
;shows what equipment
;modifications were
;made for
;
CONFIGURE CALL #E4E3
DEFM /CONFIG:/
DEFB 13
DEFM /- AERCO CPI w./
DEFM /LARGE PTR/
DEFB 13
DEFM /- JLO SAFE V2.63/
DEFM /+ DISK/
DEFB 13,13
DEFM /COMMANDS:/
DEFB 13
DEFM / C Config/
DEFB 13
DEFM /MAR x Ptr marg/
DEFM /in/
DEFB 13,32,94
DEFM /C Cats /
DEFM /byte files/
DEFB 13,32,94
DEFM /D x Active/
DEFM / drive/
DEFB 13,32,94
DEFM /E fl Erases/
DEFM / file/
DEFB 13,32,94
DEFM /L fl Loads /
DEFM /file/
DEFB 13,32,94
DEFM /S fl Saves /
DEFM /file/
DEFB 13,13
DEFM /OCTOBER 1992 /
DEFM /ALBRECHT/
DEFB 13,0
AND A
RET