VOGONS

Common searches


First post, by aadalberg

User metadata
Rank Newbie
Rank
Newbie

hey,

I'm sorry if I posted under wrong subforum.

I downloaded dosbox to emulate my turbo pascal programs.
But the problem is that I still can't get one program to work.

It should light up all 3 LED's on keyboard. But either windows xp or something else blocks it from working

main code itself:
------------------
begin
clrscr;

asm
@start:
in al,64h
and al,02h
jnz @start

mov al,0edh
out 60h,al

@wait:
in al,64h
and al,02h
jnz @wait

mov al,0111b
out 60h,al
end;
---

it compiles with no errors, but executing doesnt give any result.
can someone point out what I'm doing wrong?

thanks in advance:)

--
lunatic calm

Reply 1 of 4, by aadalberg

User metadata
Rank Newbie
Rank
Newbie

putting some comments also

@start:
in al,64h
and al,02h
jnz @start
--this subroutine checks if the keyboard buffer is empty and ready for new command. once ready, we send the "ed" command which is for setting leds

mov al,0edh
out 60h,al
---sending "ed" to keyboard port

@wait:
in al,64h
and al,02h
jnz @wait
---since "ed" is a 2byte command and requires the data being sent after it aswell, we must check if the buffer is ready for data

mov al,0111b
out 60h,al
end;
--here we send data which asks keyboard controller to light up all 3 LEDs

--
lunatic calm

Reply 3 of 4, by aadalberg

User metadata
Rank Newbie
Rank
Newbie

ok I see.

it doesnt work under windows xp also and neither does it work in command prompt window which is kinda emulating of dos too afaik.

does this problem have any workaround at all or only way to get it working is installing pure dos/booting into dos?

thanks

--
lunatic calm

Reply 4 of 4, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

You could add it to DOSBox yourself, however it is unlikely that this will find it's way in the official release.

http://www.codegod.de/WebAppCodeGod/keyboard- … led-AID118.aspx

1+1=10