Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Problem with INT21h/AH=06h in WinXP (Developers)

posted by Laaca Homepage, Czech republic, 11.06.2023, 08:53
(edited by Laaca on 11.06.2023, 16:20)

RayeR complained that under WinXP does not work the keyboard input in Blocek 1.73.
I found that it is true.
For now please try this exacutable.

What is wrong?
I made a change in the non-rezident part of the keyboard handler. Previous versions used the INT 21h/AH=07h for getting the ASCII value from keyboard.

Later I changed to INT 21h/AH=06h/DL=255 because it worked much better for key combinations like CTRL-ALT-arrow.

Do you have some idea in you look at the code below?


(*  {WORKS NICE BUT NOT UNDER WIN XP}
mov bh,255
@again:
   mov ax,0600h
   mov dl,0ffh
   inc bh       {in the first pass changes to 0, then to 1}
   int 21h
jz @nochar      {RBIL says that if the char is not ready, then AL=0 and ZF=1}
   cmp al,0
   jz @again
@nochar:
   mov ah,bh
   mov dos_ascii,ax
*)

{WORKS UNDER WIN XP BUT HAS PROBLEM WITH SOME KEY COMBINATIONS}
mov AX,$0700
   int $21     
   or AL,AL      {here ekvivalent to "cmp al,0"}
   jnz @haveit {AL<>0? We are done, go to end}
   int $21       {AL=0? call INT once again (in AH is stil $07)}
   mov AH,1      {store 1 to AH (marker for extended key)}
   jmp @finished    {done}
@haveit:
   xor AH,AH     {AH=0 (normal, not extended key)}
@finished:
mov dos_ascii,ax

---
DOS-u-akbar!

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 155 users online (0 registered, 155 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum