Saturday, November 5, 2011

Caps Lock on and Off operation ( Assembly codes)

This is a sample code for hardware operations using C language

void main()
{
asm{
push ds
mov ax,40h
mov ds,ax
mov cl,[17h]
and cl,64
cmp cl,0
jnz l

mov cl,[17h]
or cl,64
mov [17h],cl
jmp end
  }
l:
asm{
mov cl,[17h]
and cl,191
mov [17h],cl
  }
end:
asm pop ds
}

1 comments:

one of the most easy way to learn assembly in C

Post a Comment

You are most welcome for making comments here. I will consider your view and will reply you soon.