Num Lock , Caps Lock or Scroll Lock

I just want to make a phun app, so, I am wondering , How may I turn off the Num Lock , Caps Lock and (or) Scroll Lock in assembly ? I'm useing tasm to compile . (if that should make any difference ).

Thanks. Ivar.


Comments

  • : I just want to make a phun app, so, I am wondering , How may I turn off the Num Lock , Caps Lock and (or) Scroll Lock in assembly ? I'm useing tasm to compile . (if that should make any difference ).

    : Thanks. Ivar.


    at 0040h:0017h is the byte that holds the status of this (and other) keys.


    with 0 the list significant bit, and 7 the most significant bit,

    bit 4 set : scroll-lock is on

    bit 5 set : num-lock is active

    bit 6 set : caps-lock is active


    check the following examples:


    turn on scroll-lock:


    mov bx,40h

    mov ds,bx

    or byte ptr [17h],10h ; (00010000 binary)




    turn off num lock:


    mov bx,40h

    mov ds,bx

    and byte ptr [17h],0DFh ; (11011111 binary)


    if caps-lock is on, turn it off, if it is off, turn it on:


    mov bx,40h

    mov ds,bx

    xor byte ptr [17h],40h ; (01000000 binary)


    hope I helped


    /Andreas




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories