flat assembler
Message board for the users of flat assembler.

Index > OS Construction > LED's

Author
Thread Post new topic Reply to topic
Redragon



Joined: 27 Nov 2004
Posts: 101
Location: U.S.
Redragon 13 Mar 2005, 17:50
I was wondering how you would activate the LED on the keyboard for "CAPS LOCK"... (peferably in fasm) thanks!
Post 13 Mar 2005, 17:50
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 13 Mar 2005, 22:45
i have been doing it through keyboard ports (somewhere around 60h i think). Check ralf brown. You also have to check PPI port before setting LEDs or there will be only about 50% success in setting. Sorry, i don't have the code anymore
Post 13 Mar 2005, 22:45
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Redragon



Joined: 27 Nov 2004
Posts: 101
Location: U.S.
Redragon 14 Mar 2005, 00:16
heres the code ive come up with so far, but it dosent work..if anyone can tell me why, it would be greatly appreciated

Code:
caps:
        cmp   al,0x3A    ;if user presses "caps"
        in    al,64h        
        and   al,02h

        mov   al,0001b  ;caps byte code
        out   60h,al
       

    
[/code]
Post 14 Mar 2005, 00:16
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8353
Location: Kraków, Poland
Tomasz Grysztar 14 Mar 2005, 00:25
This piece of code is from my "kelvar" example (you can get it from the Examples section of this website):
Code:
set_keyboard_LEDs:
; bl = keyboard LEDs status
        mov     ah,0ADh
        call    write_8042
        mov     ah,0EDh
        call    write_keyboard
        mov     ah,bl
        and     ah,111b
        call    write_keyboard
        mov     ah,0AEh
        call    write_8042
        ret
      write_8042:
        in      al,64h
        test    al,10b
        jnz     write_8042
        mov     al,ah
        out     64h,al
        ret
      write_keyboard:
        mov     al,ah
        out     60h,al
        in      al,60h
        cmp     al,0FAh
        jne     write_keyboard
        ret    

Check Ralf Brown's Port list for the details on command codes it uses.
Post 14 Mar 2005, 00:25
View user's profile Send private message Visit poster's website Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach 15 Mar 2005, 14:35
Post 15 Mar 2005, 14:35
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.