home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpm
/
asmutl
/
m80date.lbr
/
M80DATE.MZC
/
M80DATE.MAC
Wrap
Text File
|
1987-07-18
|
4KB
|
140 lines
TITLE M80DATE: Patch for date and time in M80 v 3.4 listing page heading
;************************************************************************
; *
; Patch for Microsoft M80 assembler. This patch puts the date *
; and time in the page heading line of the assembly listing. *
; *
; This Patch uses CP/M Plus (CP/M 3.0 or higher) functions, *
; and will not work for earlier versions of CP/M. *
; *
; The patch replaces the listing page heading buffer in M80.COM *
; by a buffer in an RSX. The RSX, (with name GETBUF), is *
; attached to the modified M80.COM and is removed from system *
; memory when M80 terminates. The patch is executed once at the *
; start of M80 execution. It does the following: *
; *
; (a) Calls the RSX to get the new buffer address. *
; (b) Sets up the buffer contents. *
; (c) Updates the buffer pointer within M80.COM. *
; (d) Restores the first three bytes of M80.COM (at 0100h) *
; to there original value. *
; (e) Prints a console signon message for modified M80. *
; (f) Jumps to 0100h to begin execution of M80. *
; *
; If this patch is applied to other versions of M80, the *
; following may need to be changed: *
; *
; ENDM80 - memory location of end of your version of M80. *
; *
; LDHLX - address of M80 instruction "LD HL,BUFR", where *
; BUFR is the address of the M80 ID in the original *
; page heading buffer. *
; *
; FIRST3 - Value of first three bytes of your version of *
; M80.COM. *
; *
; You will also want to change the signon message and the *
; M80 version number in the new listing heading. *
; *
; This patch requires a Z80 processor. *
; *
; *
; Hugh R. Coomes *
; 19 Old Mamaroneck Road *
; White Plains, NY 10605 *
; *
; 28 Oct 84 *
; *
;************************************************************************
PAGE
.Z80 ; VERSION 28 OCT 84
ASEG
TPA EQU 0100H
ENDM80 EQU 04C00H ; END OF M80.COM VERSION 3.4.
ORG TPA ; OVERLAY FIRST THREE BYTES OF M80.COM.
;;; JP ENDM80 ; MUST BE PATCHED IN USING SID OR DDT.
;;; ORG ENDM80 ; THIS PATCH RESIDES AT END OF M80.
; IT MUST BE PLACED THERE BY SID OR DDT.
.PHASE ENDM80
LD DE,SO_MSG ; PRINT A SIGNON MESSAGE FOR PATCHED M80.
LD C,PRTSTR
CALL BDOS
LD DE,RSXPB ; MAKE A CALL TO THE RSX GETBUF TO GET
LD C,CALRSX ; A BUFFER IN HIGH MEMORY.
CALL BDOS
OR A ; CHECK FOR VALID COMPLETION
JP NZ,RSXERR ; 0 = OK, 0FFH = RSX DID NOT RETURN BUFFER.
PUSH HL ; THE BUFFER ADDRESS IS IN HL.
LD DE,M80ID ; MOVE M80 ID TO BUFFER.
EX DE,HL
LD BC,M80IDE-M80ID ; LENGTH IF ID.
LDIR
EX DE,HL ; GET NEXT BUFFER POSITION IN HL.
CALL DATE2 ; STORE THE DATE IN FORM DD MMM YY.
LD (HL),' ' ; STORE A COUPLE OF SPACES BETWEEN THE
INC HL ; DATE AND TIME.
LD (HL),' '
INC HL
CALL HHMMSS ; STORE THE TIME IN THE FORM HH:MM:SS.
LD DE,M80PG ; MOVE THE END OF THE PAGE HEADING TO
EX DE,HL ; TO THE BUFFER.
LD BC,M80PGE-M80PG
LDIR
LDHLX EQU 01929H ; M80 HAS A 'LD HL,BUFR' AT THIS ADDRESS
; WHERE BUFR IS THE M80 ID IN THE LISTING
; PAGE HEADING.
POP HL ; GET BACK START OF BUFFER AND PATCH
LD (LDHLX+1),HL ; THE ADDRESS TO OUR BUFFER ADDRESS.
LD HL,FIRST3 ; RESTORE THE FIRST THREE BYTES OF M80
LD DE,TPA ; TO THEIR ORIGINAL VALUE. (THEY WILL HAVE
LD BC,3 ; BEEN CHANGED TO A "JP ENDM80" BY SID OR
LDIR ; DDT.
JP TPA ; ENTER M80.
RSXERR:
LD DE,RSXMSG ; SOMETHING WRONG WITH THE RSX. PRINT
LD C,PRTSTR ; A MESSAGE AND QUIT.
CALL BDOS
JP RESTART
RSXMSG:
DB 13,10,'Fatal error - RSX processing',13,10,'$'
RSXPB: DB 127 ; RSX NUMBER (USING FOWLER CONVENTION).
DB 1 ; NUMBER OF PARAMETERS.
DW RSXNAM ; PARAMETER IS THE RSX NAME.
RSXNAM: DB 'GETBUF '
SO_MSG: DB 10,'M80 v 3.4 with date & time mod. 28 Oct 84',13,10,'$'
M80ID: DB 09 ; TAB CHARACTER.
DB 'M80 3.4 '
M80IDE EQU $
M80PG: DB ' Page'
DB 09 ; TAB CHARACTER.
DB 0 ; M80 EOM.
M80PGE EQU $
FIRST3: DB 021H,00AH,001H ; FIRST THREE BYTES OF M80.
PAGE
INCLUDE DATIME.INC
PAGE
INCLUDE BDOS.INC
.DEPHASE
END