;Even kijken hoe lang hook &HFD9F duurt (wordt middenin scherm gezet)

        ORG   0
        DB    0
        DB    1
        DS    36H

H38:    PUSH  AF
        PUSH  BC
        PUSH  DE
        PUSH  HL
        EXX
        EX    AF,AF
        PUSH  AF
        PUSH  BC
        PUSH  DE
        PUSH  HL
        IN    A,(99H)

;=============================================Line-interruptroutine
        LD    DE,0180H+15
        LD    C,99H
        OUT   (C),D
        OUT   (C),E
        IN    A,(99H)
        DEC   D
        OUT   (C),D
        OUT   (C),E
        RRA
        JP    NC,LINWEG       ;geen line-interrupt


        LD    A,(0F3DFH+7)
        PUSH  AF
        AND   240
        ADD   A,13
        OUT   (99H),A         ;Verander achtergrondkleur
        LD    A,135
        OUT   (99H),A
        CALL  0FD9FH
        POP   AF
        OUT   (99H),A
        LD    A,135
        OUT   (99H),A

        LD    HL,1
        DEC   (HL)
        JR    NZ,LINWEG
        LD    (HL),3
        LD    A,27H           ;ESC = weg
        CALL  CHLOOK
        JR    NZ,LINWEG
        LD    A,1
        LD    (0),A
LINWEG:
        POP   HL
        POP   DE
        POP   BC
        POP   AF
        EXX
        EX    AF,AF
        POP   HL
        POP   DE
        POP   BC
        POP   AF
        EI
        RET

CHLOOK: PUSH  AF
        AND   0FH
        LD    C,A
        POP   AF
        SRL   A
        SRL   A
        SRL   A
        SRL   A
        INC   A
        LD    B,A
        LD    A,10000000B
CHLOK1: RLCA
        DJNZ  CHLOK1
        LD    B,A
        DI
        IN    A,(0AAH)
        AND   0F0H
        ADD   A,C
        OUT   (0AAH),A
        IN    A,(0A9H)
        AND   B
        RET
;=======================================

START:
        DI
        LD    A,50
        OUT   (99H),A
        LD    A,19 OR 128
        OUT   (99H),A
        LD    A,(0F3DFH)
        OR    16
        LD    (0F3DFH),A
        OUT   (99H),A
        LD    A,128
        OUT   (99H),A
        EI
LL:     LD    A,(0)
        OR    A
        JR    Z,LL
        DI
        LD    A,(0F3DFH)
        AND   0EFH
        LD    (0F3DFH),A
        OUT   (99H),A
        LD    A,128
        OUT   (99H),A
        EI
        RET

 0EFH
        LD    (0F3DFH),A
        OUT   (99H),A
        LD    A,128
        OUT   (