Hi Joe,

> In Turbo Pascal's Turbo Vision, extended keyboards are detected once, upon 
> program startup, like this:
> 
>    mov ax, 11ffh
>    int 16h
>    xor bl, bl
>    cmp ax, 11ffh
>    je  @@1
>    mov bl, 10h
> @@1:mov ReadKeyFunc, bl
> 
> and then keyboard functions are called like this:
> 
>    mov ah, ReadKeyFunc
>    (inc ah)
>    int 16h

from which specific Turbo Pascal version is that code snippet? I did not find 
this in the TV source shipped with Borland Pascal 7. Instead, I found this:

procedure GetKeyEvent(var Event: TEvent); assembler;
asm
        MOV     AH,1
        INT     16H
        MOV     AX,0
        MOV     BX,AX
        JE      @@1
        MOV     AH,0
        INT     16H
        XCHG    AX,BX
        MOV     AX,evKeyDown
@@1:    XOR     CX,CX
        MOV     DX,CX
        CALL    StoreEvent
end;

So no use of INT16.11 all. I may have overlooked it?

However, I did a few tests using DEBUG. The sequence

        mov ax,11ffh
        int 16h

seems to return some random value in AX (probably some previously entered key?) 
under the specific BIOS I tested. However, I consider this value to be 
undefined if the zero flag (no key in buffer) is set. So not sure if the 
comparison

        cmp ax,11ffh

is a reliable test. It would only be reliable if a) every BIOS supporting 
INT16.11 does NOT return 11ffh, and every BIOS not supporting INT16.11 DOES 
return 11ffh. I am not sure that this is the case. At least I nowhere found 
this documented. Also, the source of the IBM-PC BIOSv3 [1] does speak against 
it (AH=0 on return).

> Wouldn't the BIOS detect the extended keyboard when you call INT 16H, AH=11H? 
> (Probably not but I though I'd ask. :-) ) Bye,

No, some only seem to detect when the first enhanced key is pressed.

[1]: 
https://github.com/gawlas/IBM-PC-BIOS/blob/e6cae33370fa7cd0568d72b785f682971edcc70c/IBM%20PC/PCBIOSV3.ASM#L1839

Bernd




_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to