You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

86 lines
3.6 KiB

; metadata.lib 2/17/2012 dwg - review for release 1.5.1.0
; metadata.lib 2/11/2012 dwg - review for release 1.5
; metadata.lib 2/ 3/2012 dwg - macro to manipulate drive metadata
;
;--------------------------------------------------------------------------
; update$meta buffer | x$u$meta hl -> buffer
; init$meta buffer | x$i$meta hl -> buffer
; get$meta drive,buffer | x$g$meta hl -> buffer, c = drivenum
; put$meta drive,buffer | x$p$meta hl -> buffer, c = drivenum
; prot$meta drive | x$pr$meta c = drivenum
; unprot$meta drive | x$un$meta c = drivenum
;--------------------------------------------------------------------------
; these must be kept in sync with prefix.asm and loader.asm
;
meta$sig5a equ 0 ; 1st signature byte
meta$siga5 equ 1 ; 2nd signature byte
meta$prot equ 128-8-1-16-7 ; write protect boolean
meta$updates equ 128-8-1-16-6 ; update counter
meta$rmj equ 128-8-1-16-4 ; Major Version
meta$rmn equ 128-8-1-16-3 ; Minor Version
meta$rup equ 128-8-1-16-2 ; Update Number
meta$rtp equ 128-8-1-16-1 ; Patch Number
meta$label equ 128-8-1-16 ; Drive Label (space padded)
meta$term equ 128-8-1 ; Dollar Sign String Term
meta$info$loc equ 128-8 ; pointer to info poked by ldr
meta$cpm$loc equ 128-6 ; location of CP/M
meta$dat$end equ 128-4 ; End of image load
meta$cpm$ent equ 128-2 ; Entryr point after relocation
;
meta$label$len equ meta$term-meta$label
;----------------------------------------------------------------------
extrn x$u$meta ; Update Metadata
extrn x$i$meta ; Initialize Metadata
extrn x$g$meta ; Get Metadata
extrn x$p$meta ; Put Metadata
extrn x$pr$meta ; Protect Metadata
extrn x$un$meta ; Unprotect Metadata
;----------------------------------------------------
; Read the metadata into the specified buffer from the specified drive
; (set up the entry registers then transfer to the library routine)
get$meta macro drive,buffer
mvi c,drive
lxi h,buffer
call x$g$meta
endm
;-----------------------------------
; Write the metadata from the specified buffer to the specified drive
; (set up the entry registers then transfer to the library routine)
put$meta macro drive,buffer
mov c,drive ; load 1st positional parameter into reg
lxi h,buffer ; load 2nd positional parameter into reg
call x$p$meta ; call actual routine in metadata.asm
endm
;-----------------------------------
; Update fields in the buffer with current data
; (set up the entry registers then transfer to the library routine)
update$meta macro buffer
lxi h,buffer ; load the parameter into reg as required
call x$u$meta ; call actual routine in metadata.asm
endm
;-----------------------------------
; Initialize the buffer with all required fields for first time use
; (set up the entry registers then transfer to the library routine)
init$meta macro buffer
lxi h,buffer ; load the parameter into reg as required
call x$i$meta ; call the actual routine in metadata.asm
endm
;-----------------------------------
; Write Protect the Metadata by setting the protect boolean
; (set up the entry registers then transfer to the library routine)
prot$meta macro drive
mvi c,drive ; load the parameter into reg as required
call x$pr$meta ; call the actual routine in metadata.asm
endm
;-----------------------------------
; Unprotect the Metadata by clearing the protect boolean
; (set up the entry registers then transfer to the library routine)
unprot$meta macro drive
mvi c,drive ; load the parameter into reg as required
call x$un$meta ; call the actual routine in metadata.asm
endm
;-----------------------------------
; eof - metadata.lib