;******************
;*  ZEITANZEIGE   *
;*  1987 by M.A.  *
;******************
;
.z80
aseg
org 100h
;
;
spalte   equ 80d ; Position d. Anzeige
reihe    equ 00d
scb_time equ 0fbf6h ; Uhrzeit im SCB
;
vektor equ 0fea7h ; Interruptvektor
neuint equ 0f500h ; Start der neuen I-R
;
;
.phase neuint
;
; -- Verbiegen des Vektors --
;
di              ; einschalten
ld hl,(vektor)
ld (oldint),hl
ld hl,routine
ld (vektor),hl
ei
ret
;
_OFF:
;
di               ; auschalten
ld hl,(oldint)
ld (vektor),hl
ei
ret
;
; -- Neue Routine --
;
routine:
di
push af  ; Register retten
push bc
push de
push hl
push ix
;
ld hl,count ; (nicht zu oft...)
inc (hl)
jp nz,exit
;
in a,(0f1h) ; Memory Map retten
ld h,a
in a,(0f2h)
ld l,a
push hl
;
ld a,81h ; Screen Environment
out (0f1h),a
ld a,82h
out (0f2h),a
;
call display ; Anzeige aufrufen
;
pop hl ; restore Memory Map
ld a,l
out (0f2h),a
ld a,h
out (0f1h),a
;
exit:
pop ix
pop hl ; restore Register
pop de
pop bc
pop af
;
jp 1e40h ; Standard-ISR
;
;
;
; -- Displayroutine --
;
display:
;
ld hl,time
ld de,scb_time
ld b,3
;
tloop:     ; SCB-Zeit umwandeln
ld a,(de)  ; und abspeichern
rra
rra
rra
rra
and 0fh
add a,30h
ld (hl),a
inc hl
ld a,(de)
and 0fh
add a,30h
ld (hl),a
inc hl
ld a,':'
ld(hl),a
inc hl
inc de
djnz tloop
;
;
;
ld b,08h ; 8 Zeichen
ld e,spalte ; Startpositionen
ld d,reihe
ld ix,time
;
loop:
;
push bc     ; Zeichenadresse im
push de     ; Matrix-Ram berechnen
push de
ld a,(ix+0)
ld l,a
ld h,0
add hl,hl
add hl,hl
add hl,hl
ld de,0b800h
add hl,de
inc ix
;
pop de
push hl
;
ld a,d ; calc & copy
ld d,0 ; frei nach M. Uphoff
rlca   ; PCI 6/87...
rla
rla
rla
ld l,a
ld a,d
adc a,0b6h
ld h,a
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
ex de,hl
add hl,hl
add hl,hl
add hl,de
add hl,hl
ex de,hl
pop hl
ld bc,8
ldir
;
pop de
pop bc
inc e
djnz loop ; 8 Zeichen
ret
;
;
oldint:
ds 2      ; alter IR-Vektor
count:
ds 1      ; Z{hler
time:
ds 9      ; ASCII-Uhrzeit
;
prgend:
;
end

