Ideal
Model tiny
P186
CodeSeg
Org 100h

Start:      push 0                  ;DS = 0
            pop ds
            mov bx,0417h            ;BX = keylight address
            mov cx,0002h            ;Delay is 150 msec
            mov dx,49F0h
            mov si,15               ;Cycle 15 times

B_Loop:     mov [byte bx],32        ;Num Lock light
            call Delay              ;Update and delay
            mov [byte bx],64        ;Caps Lock light
            call Delay              ;Update and delay
            mov [byte bx],16        ;Scroll Lock light
            call Delay              ;Update and delay

            dec si                  ;Loop back
            jnz B_Loop

            mov [byte bx],0         ;Turn lights off
            ret                     ;Return

Delay:      mov ah,01h              ;Update BIOS
            int 16h
            mov ah,86h              ;Delay
            int 15h
            ret                     ;Return

End Start
