Author Topic: Port code not working  (Read 1474 times)

Magnum

  • Member
  • *****
  • Posts: 2241
Port code not working
« on: February 16, 2013, 04:40:19 AM »
It would be interesting if this could work under XP.

Code: [Select]
;     Blink.asm- the keyboard LED's
;     Works thru Win 98
;       
        cseg segment
        assume cs:cseg
        org 100h                ;  COM format
Start:
        sub ax,ax               ;  set DS to 0000
        mov ds,ax
        mov cx,0fh              ;  number of times to cycle

Blink:
        mov bx,0417h            ;  Pointing to 0000:0417
        mov byte ptr [bx],16d   ;  Turn only Scroll Lock ON
        call Delay
        mov byte ptr [bx],64d   ;  Turn only Caps Lock ON
        call Delay
        mov byte ptr [bx],32d   ;  Turn only Num Lock ON
        call Delay

        loop Blink              ;  Loop 15 times then
        mov ax,4C00h            ;  exit to DOS.
        int 21h                 ;
Delay:
        mov ah,01h              ;  update the BIOS and
        int 16h                 ;  turn the LED's on.

        push cx
        mov cx,0A000h
   lo1:
        in al,4Fh               ;  Port 4Fh is used for
        loop lo1                ;  a do-nothing delay.
        pop cx
        ret

        cseg ends
        end  Start

Take care,
                   Andy

Ubuntu-mate-16.04-desktop-amd64

http://www.goodnewsnetwork.org