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
/
OSBORNE
/
EXTIME89.LBR
/
EXTIME.ZZ0
/
EXTIME.Z80
Wrap
Text File
|
2000-06-30
|
3KB
|
157 lines
;
;17 June 1985 W. vanRiper
;
;extime.z80 - sets time in SCB for Osborne Executive
;uses R. Conn's SYSLIB vers 2.X or 3.X for display routines
;
extrn bin,print,crlf,cath
;
months equ 0f8f4h
hours equ 0f8f6h
mins equ 0f8f7h
temp ds 1
tempm ds 2
tempd ds 2
mcnt ds 1
;
call getday
;
;
call crlf
call print
db ' hour: ',0
;
call bin ;get first ascii digit
call cath ;convert it to hex
ld (temp),a ;store it in (temp)
call bin ;get second digit in a
call cath
;
ld hl,temp ;memory location for RLD swap
rld ;memory now has packed BCD number
ld a,(hl) ;put it in a
ld hl,hours
ld (hl),a ;set the hours
;
call crlf
call print
db ' minute: ',0
;
call bin ;get first ascii digit
call cath ;convert it to hex
ld (temp),a ;store it in (temp)
call bin ;get second digit in a
call cath
;
ld hl,temp ;memory location for RLD swap
rld ;memory now has packed BCD number
ld a,(hl) ;put it in a
ld hl,mins
ld (hl),a ;set the minutes
call crlf
;
ret
;
;
;
getday call crlf
call print
db 'enter month: ',0
;
call bin ;get first ascii digit
call cath ;convert it to hex
rlca ;multiply by 10
ld b,a ;save 2*a in b temporarily
rlca
rlca
add a,b ;add 8*a and 2*a = 10*a
ld (mcnt),a ;store it in (mcnt)
;
;
call bin ;get second digit in a
call cath
;
ld hl,mcnt ;add it to number in (mcnt)
add a,(hl)
ld (mcnt),a ;store result in (mcnt)
ld l,a ;also store result in (tempm)
ld h,0
ld (tempm),hl
;
;
call crlf
call print
db ' day: ',0
;
call bin ;get first ascii digit
call cath ;convert it to hex
rlca ;multiply by 10
ld b,a ;2*a temporarily in b
rlca
rlca
add a,b
ld (temp),a ;store it in (temp)
;
call bin ;get second digit in a
call cath
ld hl,temp ;add it to number in (temp)
add a,(hl)
ld l,a ;put result in (tempd)
ld h,0
ld (tempd),hl
;
ld hl,0 ;clear out hl
ld de,table ;get start of table
ld a,(mcnt) ;put month count in a
ld b,a ; and then in b
ld a,0 ;clear out a
loop0 ld a,(de) ;get number of days
push de
ld e,a ;put number of days in de
ld d,0
add hl,de ;add to total in hl
pop de ;get back original address
inc de ;move it along
djnz loop0
;
ld de,(tempd) ;get day of month in de
add hl,de ;add to day total from months
ld de,9fdh ;offset to 1985
add hl,de
;
;
ld (months),hl
ret
;
table db 0
db 31
db 28
db 31
db 30
db 31
db 30
db 31
db 31
db 30
db 31
db 30
db 31
;
;
hl
ret
;
table db 0
db 31
db 28
db 31
db 30
db 31
db 30
db 31
db 31
db 30
db 31
db 30
db 31
;