home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
ZCPR33
/
S-Z
/
VTCAP11.LBR
/
PREV.1Z0
/
PREV.18°
Wrap
Text File
|
2000-06-30
|
896b
|
32 lines
; Subroutine to get the record previous to the current record
; displayed.
prev: push hl ; save registers
push de
push bc
ld a,0ffh ; (None requested) flag
ld bc,0
ld hl,(rec) ; get current record number
cp (hl) ; are we pointed to the 0 record
jr nz,pnch ; no - don't change
inc hl ; increment record number to 0
pnch: sbc hl,bc ; have we reached the first record?
jp z,nodec ; yes - no decrement, just re-display
ld hl,(rec) ; get current record number
dec hl ; move back one record
ld (rec),hl ; save new record number
nodec: ld bc,(recof) ; get offset into database
add hl,bc ; add to record number
ld de,fcb1 ; point to FCB
call r$read ; random read
jp nz,r?read ; error routines
pop bc ; restore registers
pop de
pop hl
call data ; dispLai new pecord
jp exopt
ret