;*; Updated on 06-Dec-91 at 9:36 AM by Michele Tonti; edit time: 0:00:10
;*************************** AMUS Program Label ******************************
; Filename: ER.M68 Date: 12/6/91
; Category: UTIL Hash Code: 362-350-257-564 Version:
; Initials: KUNI/AM Name: RENE S HOLLAN
; Company: UDISCO LTD. Telephone #: 5144818107
; Related Files: ERSET.M68,ER.DOC,ER.HLP,SAVERS.CMD,E.DO
; Min. Op. Sys.: Expertise Level:
; Special: All related files in self-extracting archive ER.LIT
; Description: Allows user to reserve free space for ersatz definitions upon
; booting, thereby being able to add definitions later without rebooting.
;
;*****************************************************************************
;*************************************************************************
;* *
;* ER COMMAND PROGRAM - Ver. 1.0 *
;* *
;*************************************************************************
;
; NOTICE
;
;All rights reserved. This software is the property of UDISCO LTD. and
;the material contained herein is the proprietary property and trade
;secrets of UDISCO LTD., embodying substantial creative efforts and
;confidential information, ideas and expressions, no part of which may be
;reproduced or transmitted in any form or by any means, electronic,
;mechanical, or otherwise, including photocopying or input into any
;information storage or retrieval system without the express written
;permission of UDISCO LTD.
;
;Permission to copy and use is granted to AMUS members for non commercial
;purposes only.
;
;
; ER: Replacement for ERSATZ that allows one to restrict
; the displayed list to those disks (and drives) specified.
;
; Calling Syntax: ER [<name>]{/<opt>}
;
; Where: <name> is the name of the disk and drive number or
; name of an existing ersatz table entry,
;
; <opt> is an option flag:
;
; C indicates that the first line of the comment file
; is to be displayed beside each item,
;
; D indicates that the entire comment file is to be
; displayed beneath each item,
;
; O:fspec indicates that output should be written to
; fspec. .LST is default extention. ERSATZ.INI in the
; current PPN is the defaut fspec if just O: is present.
;
; The comment file is COMENT.ERS, in the PPN indicated by
; each applicable ersatz table entry. CPU number ersatz entries do
; not have such optional comment files.
;
; Author: Rene S. Hollan
;
; COPYRIGHT (C) - 1989 - UDISCO LTD.
;
; Edit History
; ------------
;
; [105] 28 April 1990
; Don't try to look for a COMENT.ERS file on devices without PPN's
; (like, for example, VCR0:, eh?) /RSH
;
; [104] 3 January 1990
; Change deleted entry in ersatz table to [ $$$$]. Log program
; only tested first word for zero to end table when reporting ersatz
; name.
;
; Add report of used/total entries at end of list. /RSH
;
; [103] 28 December 1989
; Add /O:fspec option to write list to file.
;
; [102] 22 December 1989
; Check for ersatz entry before device spec.
;
; [101] 21 December 1989
; Add /C and /D options.
;
; [100] 21 December 1989
; Coding starts. /RSH
;
;
SEARCH SYS
SEARCH SYSSYM
EZ.LEN = 20. ; lenngth of ersatz table entry
; Impure area
OFINI
OFDEF ER.NAM, 4 ; potential matching ersatz name
OFDEF ER.DEV, 2 ; Device spec. (RAD50)
OFDEF ER.UNT, 2 ; Unit spec.
OFDEF ER.DDB, D.DDB ; Comment file DDB
OFDEF ER.OUT, D.DDB ; Output file DDB
OFDEF ER.FLG, 1 ; Flag
ERF$DV = 0 ; device present
ERF$CM = 1 ; comment line
ERF$DS = 2 ; full description
ERF$ER = 3 ; single ersatz item
ERF$OF = 4 ; output to a file
OFDEF ER.BUF, 80. ; Output buffer
OFSIZ ER.LEN ; size of ER impure area
NUL = 0. ; NUL equate
TAB = 9. ; TAB equate
SPACE = 32. ; SPACE equate
VMAJOR=1 ; major version
VMINOR=0 ; minor version
VSUB=0 ; sub version
VEDIT=105. ; edit version
ER: PHDR -1,PV$RSM,PH$REU!PH$REE ; program header
GETIMP ER.LEN,A0 ; get impure memory
BYP ; skip blanks
MOVW #-1.,ER.DEV(A0) ; mark default drive
MOVW #-1.,ER.UNT(A0) ; mark default unit
TRM
BEQ 20$ ; nope
CMPB @A2,#'/ ; do options come right away?
BEQ 12$ ; yup!
CALL ERRGET ; get a valid ersatz name
BTST #ERF$ER,ER.FLG(A0) ; is there one?
BNE 12$ ; yup! - get options
LEA A1,ER.DEV(A0) ; A1 -> device name
PACK ; pack RAD50 device name
GTDEC ; get unit number
JMI 90$ ; error
CMP D1,#65535. ; too big?
JGT 90$ ; yup!
MOVW D1,ER.UNT(A0) ; save unit number
12$: CALL PARSE ; parse for options
BTST #ERF$ER,ER.FLG(A0) ; is there an ersatz name?
BNE 32$ ; yup! - display it!
20$: MOV ERSATZ,A1 ; A1 -> ersatz table
MOV A1,D7 ; is there an ersatz table?
JEQ 92$ ; nope
BTST #ERF$OF,ER.FLG(A0) ; is there an output file?
BEQ 22$ ; nope
INIT ER.OUT(A0) ; init the output file
OPENO ER.OUT(A0) ; open the output file
38$: BTST #ERF$ER,ER.FLG(A0) ; is this an ersatz match?
JEQ 30$ ; nope - do next table entry
50$: BTST #ERF$OF,ER.FLG(A0) ; output to a file?
BEQ 55$ ; nope
CLOSE ER.OUT(A0) ; close output file
55$: CALL SCAN ; display usage report
EXIT
40$: LEA A1,20.(A1) ; skip over this table entry
JMP 30$ ; and do next one
90$: TYPECR <ER: invalid unit number>
EXIT
92$: TYPECR <ER: no ersatz table defined>
EXIT
; UNP - unpack conditionally
;
; Entry: A1 -> packed word
; A2 -> unpack buffer
;
; Exit: A1 -> past packed word
; A2 -> past unpacked entry (if not zero)
;
UNP: TSTW @A1 ; is there an entry?
BEQ 10$ ; nope
UNPACK ; unpack entry
BR BACKSP ; back up over spaces
10$: LEA A1,2(A1) ; skip over empty entry
RTN
; BACKSP - backup over spaces in buffer
;
; Entry: A2 -> buffer end
;
; Exit: A2 -> past last non-space in buffer
;
BACKSP: CMPB -1(A2),#32. ; is last byte a space?
BNE 7$ ; nope
DEC A2 ; go back a byte
BR BACKSP
7$: RTN
; TYPCOM - type comment for ersatz device
;
; Entry: A1 -> Ersatz name
; A0 -> impure area
;
; Uses: ER.BUF(A0), ER.DDB(A0)
;
;
TYPCOM: SAVE D1,A1-A3
LEA A2,ER.BUF(A0) ; A2 -> temporary buffer
CALL UNP ; unpack ersatz name
CALL UNP ; ...
LEA A3,10$ ; A3 --> ersatz file name
OUTL @A3,OT$MEM ; add to FSPEC buffer
MOVB #0,(A2) ; terminate string
LEA A2,ER.BUF(A0) ; open comment file
FSPEC ER.DDB(A0) ; ...
TSTW ER.DDB+D.PPN(A0) ; is there a PPN?
JEQ 40$ ; nope - ignore
INC A2 ; bypass colon, if any
CMPB @A2,#': ; ...
BNE 20$ ; ...
INC A2 ; bypass colon
20$: TRM ; at end of line?
BNE 22$ ; nope
LEA A2,90$ ; A2 -> default output file
22$: FSPEC ER.OUT(A0),LST ; get the output file spec
BSET #ERF$OF,ER.FLG(A0) ; set output file flag
BR 5$ ; loop for more
70$: TYPECR <ER: illegal option specified.>
EXIT
10$: RTN
80$: BSET #ERF$DS,ER.FLG(A0) ; set description flag
82$: BSET #ERF$CM,ER.FLG(A0) ; and comment flag
INC A2 ; skip option
BR 5$ ; and parse for more
90$: ASCII /ERSATZ.INI/ ; default output file name
; ERRGET - get matching ersatz entry
;
; Entry: A2 -> possible ersatz name
; A0 -> impure area
;
; Exit: A1 -> matching ersatz table entry, ERF$ER set, if present,
; ERF$ER clear otherwise
; ER.NAM(A0) = potential ersatz name
;
; A2 is advanced past the ersatz name if it was in the table.
;
ERRGET: SAVE D1
PUSH A2
BCLR #ERF$ER,ER.FLG(A0) ; clear ersatz bit
LEA A1,ER.NAM(A0) ; A1 -> ersatz name
PACK ; pack potential ersatz name
PACK ; ...
CALL FIND ; find entry in ersatz table
MOV A1,D1 ; was it found?
BEQ 10$ ; nope
MOV ER.NAM(A0),D1 ; does it match?
CMP D1,EZ.NAM(A1) ; ...
BNE 10$ ; nope
BSET #ERF$ER,ER.FLG(A0) ; set ersatz bit
POP ; through away saved A2
BR 20$
10$: POP A2
20$: REST D1
RTN
; FIND - find matching ersatz table entry
;
; Entry: ER.NAM(A0) = packed name to search for
;
; Exit: A1 -> matching entry, if found, else
; -> " $$$$', if empty entry available, else
; = 0, if no match and no empty entry
;
FIND: SAVE A2,D0-D1
MOV ERSATZ,A2 ; A2 -> base of system ersatz table
MOV #0,A1 ; assume no match or empty entry found
MOV A2,D1 ; is there an ersatz table?
BEQ 90$ ; nope
MOV ER.NAM(A0),D1 ; D1 = name to match
MOV #<[$$$]+33_16.>,D0 ; D0 = empty entry