Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.lang.asm > #6764 > unrolled thread
| Started by | "Kerr Mudd-John" <admin@127.0.0.1> |
|---|---|
| First post | 2016-12-03 19:50 +0000 |
| Last post | 2016-12-07 19:52 -0500 |
| Articles | 14 — 7 participants |
Back to article view | Back to alt.lang.asm
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: MS-DOS utility to distinguish between standard & enhanced keyboard? "Kerr Mudd-John" <admin@127.0.0.1> - 2016-12-03 19:50 +0000
Re: MS-DOS utility to distinguish between standard & enhanced Bogus@Embarq.com (Steve) - 2016-12-04 15:02 +0000
Re: MS-DOS utility to distinguish between standard & enhanced Donald G. Davis <dgdavis@blackhole.nyx.net> - 2016-12-05 19:19 +0000
Re: MS-DOS utility to distinguish between standard & enhanced Bogus@Embarq.com (Steve) - 2016-12-06 15:59 +0000
Re: MS-DOS utility to distinguish between standard & enhanced Donald G. Davis <dgdavis@blackhole.nyx.net> - 2016-12-08 20:38 +0000
Re: MS-DOS utility to distinguish between standard & enhanced "Kerr Mudd-John" <admin@127.0.0.1> - 2016-12-07 07:18 +0000
Re: MS-DOS utility to distinguish between standard & enhanced "Kerr Mudd-John" <admin@127.0.0.1> - 2016-12-07 07:19 +0000
Re: MS-DOS utility to distinguish between standard & enhanced Frank Kotler <fbkotler@myfairpoint.net> - 2016-12-07 09:24 -0500
Re: MS-DOS utility to distinguish between standard & enhanced "Kerr Mudd-John" <admin@127.0.0.1> - 2016-12-08 11:58 +0000
Re: MS-DOS utility to distinguish between standard & enhanced Frank Kotler <fbkotler@myfairpoint.net> - 2016-12-08 11:49 -0500
Re: MS-DOS utility to distinguish between standard & enhanced Melzzzzz <mel@zzzzz.com> - 2016-12-08 20:37 +0100
Re: MS-DOS utility to distinguish between standard & enhanced JJ <jj4public@vfemail.net> - 2016-12-09 06:22 +0700
Re: MS-DOS utility to distinguish between standard & enhanced Donald G. Davis <dgdavis@blackhole.nyx.net> - 2016-12-10 04:53 +0000
Re: MS-DOS utility to distinguish between standard & enhanced Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2016-12-07 19:52 -0500
| From | "Kerr Mudd-John" <admin@127.0.0.1> |
|---|---|
| Date | 2016-12-03 19:50 +0000 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced keyboard? |
| Message-ID | <op.yrwup300msr2db@dell3100.dlink.com> |
On Sun, 27 Nov 2016 05:20:37 -0000, Donald G. Davis
<dgdavis@blackhole.nyx.net> wrote:
> I'd like to learn whether someone knows of a MS-DOS utility that can
> tell whether a "standard" (older) keyboard or a 101-key keyboard is
> attached to the computer, and report accordingly, preferably with a
> suitable exit code for input to a batch file.
>
> --Donald Davis
I've found an old Delphi forum post:
function status:word;
inline(
$B8/$00/$12/ {MOV AX,1200h}
$CD/$16 {INT 16h }
);
{$ifdef msdos}
const seg0040=$40;
{$endif}
begin
tmp:=mem[Seg0040:$17];
extended_kbd:=false;
if lo(status)=tmp then begin
mem[Seg0040:$17]:=tmp xor 7;
tmp2:=status;
extended_kbd:=(tmp2<>$1200) and (lo(tmp2)=tmp xor 7);
mem[Seg0040:$17]:=tmp;
End;
end.
It's mostly asm. Toggles a shift key then uses an extended keyboard call
to see if it's changed.
Should be easily rewritten in asm or ascii asm for use in batch.
(xposted to asm & batch groups)
--
Bah, and indeed, Humbug
[toc] | [next] | [standalone]
| From | Bogus@Embarq.com (Steve) |
|---|---|
| Date | 2016-12-04 15:02 +0000 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced |
| Message-ID | <c1.2b8.3tWrhz$063@NOVOSAD3.EMBARQ.COM> |
| In reply to | #6764 |
Hi, "Kerr Mudd-John" <admin@127.0.0.1> writes: <Snip> >It's mostly asm. Toggles a shift key then uses an extended keyboard call >to see if it's changed. >Should be easily rewritten in asm or ascii asm for use in batch. That seems more of a test to see if the BIOS supports extended keyboard functions. The memory byte at 40H:96H should indicate a 101 keyboard is attached if bit 4 is set. Regards, Steve N.
[toc] | [prev] | [next] | [standalone]
| From | Donald G. Davis <dgdavis@blackhole.nyx.net> |
|---|---|
| Date | 2016-12-05 19:19 +0000 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced |
| Message-ID | <1480965449.536956@nyx2.nyx.net> |
| In reply to | #6765 |
Bogus@Embarq.com (Steve) writes:
>Hi,
>"Kerr Mudd-John" <admin@127.0.0.1> writes:
><Snip>
>>It's mostly asm. Toggles a shift key then uses an extended keyboard call
>>to see if it's changed.
>>Should be easily rewritten in asm or ascii asm for use in batch.
> That seems more of a test to see if the BIOS supports extended keyboard
>functions. The memory byte at 40H:96H should indicate a 101 keyboard is
>attached if bit 4 is set.
>Regards,
>Steve N.
Thank you for your responses. I tried the BIOS 40H:96H approach
several years ago, with the following MASM code:
----------------
;KEYBID5.ASM
;Tests bit 4 of keyboard status byte (set=enhanced kb attached;
; clear=nonenhanced)
CSEG SEGMENT
ASSUME CS:CSEG,DS:CSEG
ORG 0100H
START:
MOV AX,40H ;Get BIOS parameters
MOV DS,AX
MOV AL,DS:BYTE PTR[96H] ;Get keyboard status byte 1
TEST AL,00010000B ;Bit 4 set?
JNZ ENH ;If so, keyboard tested as enhanced
XOR AL,AL ;If not, it didn't; return exit code 0
JMP SHORT EXIT
ENH: MOV AL,1 ;If it did, return exit code 1
EXIT: MOV AH,4CH ;Terminate with exit code
INT 21H
CSEG ENDS
END START
------------------
I haven't been able to find any mistakes in the above code, but
unfortunately, it always returns 1 for every keyboard I've tried, 101-
key or otherwise.
This BIOS keyboard-identification approach may not work for my
laptop in any case. I find that, unlike the display, which shows only on
the external monitor when one is attached, both the external and internal
keyboards can be used at the same time. I have no idea how the BIOS
keyboard-status byte, which appears to represent only one keyboard ID,
would handle this.
--Donald Davis
[toc] | [prev] | [next] | [standalone]
| From | Bogus@Embarq.com (Steve) |
|---|---|
| Date | 2016-12-06 15:59 +0000 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced |
| Message-ID | <c1.2b8.3tY5t1$064@NOVOSAD3.EMBARQ.COM> |
| In reply to | #6766 |
Hi, Donald G. Davis <dgdavis@blackhole.nyx.net> writes: <Snip> > I haven't been able to find any mistakes in the above code, but >unfortunately, it always returns 1 for every keyboard I've tried, 101- >key or otherwise. > > This BIOS keyboard-identification approach may not work for my >laptop in any case. I find that, unlike the display, which shows only on >the external monitor when one is attached, both the external and internal >keyboards can be used at the same time. I have no idea how the BIOS >keyboard-status byte, which appears to represent only one keyboard ID, >would handle this. > --Donald Davis My mistake. I tried looking at the byte in DEBUG on my desktop, with a 101 keyboard, and an HP 200LX palmtop, with a non-standard keyboard, and got good results. Bit set on the desktop and not set on the palmtop. However I just tried that on two laptops and saw the bit set on both even though they don't have enough keys. They do have F11 and F12 function keys though, which the 200LX does not. An HP Omnibook and an IBM ThinkPad. So maybe having extra function keys is what that bit indicates. Did you test on a keyboard without the extra function keys? Regards, Steve N.
[toc] | [prev] | [next] | [standalone]
| From | Donald G. Davis <dgdavis@blackhole.nyx.net> |
|---|---|
| Date | 2016-12-08 20:38 +0000 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced |
| Message-ID | <1481229389.32977@nyx2.nyx.net> |
| In reply to | #6767 |
Bogus@Embarq.com (Steve) writes: >Hi, >Donald G. Davis <dgdavis@blackhole.nyx.net> writes: ><Snip> >> I haven't been able to find any mistakes in the above code, but >>unfortunately, it always returns 1 for every keyboard I've tried, 101- >>key or otherwise. >> >> This BIOS keyboard-identification approach may not work for my >>laptop in any case. I find that, unlike the display, which shows only on >>the external monitor when one is attached, both the external and internal >>keyboards can be used at the same time. I have no idea how the BIOS >>keyboard-status byte, which appears to represent only one keyboard ID, >>would handle this. >> --Donald Davis > My mistake. I tried looking at the byte in DEBUG on my desktop, >with a 101 keyboard, and an HP 200LX palmtop, with a non-standard >keyboard, and got good results. Bit set on the desktop and not set on >the palmtop. However I just tried that on two laptops and saw the bit >set on both even though they don't have enough keys. They do have >F11 and F12 function keys though, which the 200LX does not. An HP >Omnibook and an IBM ThinkPad. So maybe having extra function >keys is what that bit indicates. > Did you test on a keyboard without the extra function keys? >Regards, >Steve N. Yes. I'm typing this on an NCR keyboard that lacks enhanced F11 or F12. (It has keys *labeled* F11 through F30, but those send keycodes corresponding to Shift and Ctrl versions of the regular F1 through F10, not the extended versions.) Yet it sets the 101-key BIOS bit. --Donald Davis
[toc] | [prev] | [next] | [standalone]
| From | "Kerr Mudd-John" <admin@127.0.0.1> |
|---|---|
| Date | 2016-12-07 07:18 +0000 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced |
| Message-ID | <op.yr3akirqmsr2db@dell3100.dlink.com> |
| In reply to | #6765 |
On Sun, 04 Dec 2016 15:02:27 -0000, Steve <Bogus@embarq.com> wrote:
> Hi,
>
> "Kerr Mudd-John" <admin@127.0.0.1> writes:
>
> <Snip>
>> It's mostly asm. Toggles a shift key then uses an extended keyboard call
>> to see if it's changed.
>> Should be easily rewritten in asm or ascii asm for use in batch.
>
> That seems more of a test to see if the BIOS supports extended
> keyboard
> functions. The memory byte at 40H:96H should indicate a 101 keyboard is
> attached if bit 4 is set.
>
Cheers
so something like (untested)
org 0x100
mov ax,0x0040
push ds
pop ds
mov bx,0x0096
mov al,[bx]
and al,0x00010000 ; bit 4
mov ah,0x4C
int 0x21
; zero rc if not enhanced kbd
--
Bah, and indeed, Humbug
[toc] | [prev] | [next] | [standalone]
| From | "Kerr Mudd-John" <admin@127.0.0.1> |
|---|---|
| Date | 2016-12-07 07:19 +0000 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced |
| Message-ID | <op.yr3amrs1msr2db@dell3100.dlink.com> |
| In reply to | #6769 |
On Wed, 07 Dec 2016 07:18:08 -0000, Kerr Mudd-John <admin@127.0.0.1> wrote: [] > > > so something like (untested) > > org 0x100 > [] Shoulda read ahead. -- Bah, and indeed, Humbug
[toc] | [prev] | [next] | [standalone]
| From | Frank Kotler <fbkotler@myfairpoint.net> |
|---|---|
| Date | 2016-12-07 09:24 -0500 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced |
| Message-ID | <o2961r$ao$1@dont-email.me> |
| In reply to | #6769 |
Kerr Mudd-John wrote: ... > so something like (untested) > > org 0x100 > > mov ax,0x0040 > push ds > pop ds Wot??? Best, Frank
[toc] | [prev] | [next] | [standalone]
| From | "Kerr Mudd-John" <admin@127.0.0.1> |
|---|---|
| Date | 2016-12-08 11:58 +0000 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced |
| Message-ID | <op.yr5h72vrmsr2db@dell3100.dlink.com> |
| In reply to | #6771 |
On Wed, 07 Dec 2016 14:24:34 -0000, Frank Kotler <fbkotler@myfairpoint.net> wrote: > Kerr Mudd-John wrote: > ... >> so something like (untested) >> org 0x100 >> mov ax,0x0040 >> push ds >> pop ds > > Wot??? > > Best, > Frank I told you it was untested!!! -- Bah, and indeed, Humbug
[toc] | [prev] | [next] | [standalone]
| From | Frank Kotler <fbkotler@myfairpoint.net> |
|---|---|
| Date | 2016-12-08 11:49 -0500 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced |
| Message-ID | <o2c2u9$4m0$1@dont-email.me> |
| In reply to | #6774 |
Kerr Mudd-John wrote: > On Wed, 07 Dec 2016 14:24:34 -0000, Frank Kotler > <fbkotler@myfairpoint.net> wrote: > >> Kerr Mudd-John wrote: >> ... >>> so something like (untested) >>> org 0x100 >>> mov ax,0x0040 >>> push ds >>> pop ds >> >> Wot??? >> >> Best, >> Frank > > I told you it was untested!!! I didn't test it either. Nasm warns on the line Rod spotted and I missed, if I try to even assemble it. What are the chances of finding an XT keyboard these days anyway? Best, Frank
[toc] | [prev] | [next] | [standalone]
| From | Melzzzzz <mel@zzzzz.com> |
|---|---|
| Date | 2016-12-08 20:37 +0100 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced |
| Message-ID | <20161208203714.293ece52@maxa-pc> |
| In reply to | #6775 |
On Thu, 08 Dec 2016 11:49:50 -0500 Frank Kotler <fbkotler@myfairpoint.net> wrote: > Kerr Mudd-John wrote: > > On Wed, 07 Dec 2016 14:24:34 -0000, Frank Kotler > > <fbkotler@myfairpoint.net> wrote: > > > >> Kerr Mudd-John wrote: > >> ... > >>> so something like (untested) > >>> org 0x100 > >>> mov ax,0x0040 > >>> push ds > >>> pop ds > >> > >> Wot??? > >> > >> Best, > >> Frank > > > > I told you it was untested!!! > > I didn't test it either. Nasm warns on the line Rod spotted and I > missed, if I try to even assemble it. What are the chances of finding > an XT keyboard these days anyway? > > Best, > Frank > There are no ps/2 keyboards any more. Everything goes USB ;) -- press any key to continue or any other to quit
[toc] | [prev] | [next] | [standalone]
| From | JJ <jj4public@vfemail.net> |
|---|---|
| Date | 2016-12-09 06:22 +0700 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced |
| Message-ID | <14jn8ds6sqeyx$.xaqywycwi0fc.dlg@40tude.net> |
| In reply to | #6776 |
On Thu, 8 Dec 2016 20:37:14 +0100, Melzzzzz wrote: > On Thu, 08 Dec 2016 11:49:50 -0500 > Frank Kotler <fbkotler@myfairpoint.net> wrote: > >> Kerr Mudd-John wrote: >>> On Wed, 07 Dec 2016 14:24:34 -0000, Frank Kotler >>> <fbkotler@myfairpoint.net> wrote: >>> >>>> Kerr Mudd-John wrote: >>>> ... >>>>> so something like (untested) >>>>> org 0x100 >>>>> mov ax,0x0040 >>>>> push ds >>>>> pop ds >>>> >>>> Wot??? >>>> >>>> Best, >>>> Frank >>> >>> I told you it was untested!!! >> >> I didn't test it either. Nasm warns on the line Rod spotted and I >> missed, if I try to even assemble it. What are the chances of finding >> an XT keyboard these days anyway? >> >> Best, >> Frank >> > > There are no ps/2 keyboards any more. Everything goes USB ;) Not really. There are still a lot of Chinese/Taiwan PS/2 keyboards being made. And unless motherboard manufacturers stop including PS/2 ports in their products, PS/2 devices won't go away. Even though there may still be PS/2 adapter via USB devices, they're used for special PS/2 devices which aren't keyboards or mice, or at least, common ones.
[toc] | [prev] | [next] | [standalone]
| From | Donald G. Davis <dgdavis@blackhole.nyx.net> |
|---|---|
| Date | 2016-12-10 04:53 +0000 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced |
| Message-ID | <1481345498.991436@nyx2.nyx.net> |
| In reply to | #6778 |
JJ <jj4public@vfemail.net> writes: >On Thu, 8 Dec 2016 20:37:14 +0100, Melzzzzz wrote: >> On Thu, 08 Dec 2016 11:49:50 -0500 >> Frank Kotler <fbkotler@myfairpoint.net> wrote: >> >>> Kerr Mudd-John wrote: >>>> On Wed, 07 Dec 2016 14:24:34 -0000, Frank Kotler >>>> <fbkotler@myfairpoint.net> wrote: >>>> >>>>> Kerr Mudd-John wrote: >>>>> ... >>>>>> so something like (untested) >>>>>> org 0x100 >>>>>> mov ax,0x0040 >>>>>> push ds >>>>>> pop ds >>>>> >>>>> Wot??? >>>>> >>>>> Best, >>>>> Frank >>>> >>>> I told you it was untested!!! >>> >>> I didn't test it either. Nasm warns on the line Rod spotted and I >>> missed, if I try to even assemble it. What are the chances of finding >>> an XT keyboard these days anyway? >>> >>> Best, >>> Frank >>> >> >> There are no ps/2 keyboards any more. Everything goes USB ;) >Not really. There are still a lot of Chinese/Taiwan PS/2 keyboards being >made. And unless motherboard manufacturers stop including PS/2 ports in >their products, PS/2 devices won't go away. Even though there may still be >PS/2 adapter via USB devices, they're used for special PS/2 devices which >aren't keyboards or mice, or at least, common ones. I have an adapter with PS/2 keyboard and mouse sockets, that plugs into a USB port--the PS/2 devices work normally on my laptop. --Donald Davis
[toc] | [prev] | [next] | [standalone]
| From | Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> |
|---|---|
| Date | 2016-12-07 19:52 -0500 |
| Subject | Re: MS-DOS utility to distinguish between standard & enhanced |
| Message-ID | <20161207195247.08f299a9@_> |
| In reply to | #6769 |
On Wed, 07 Dec 2016 07:18:08 -0000 "Kerr Mudd-John" <admin@127.0.0.1> wrote: > On Sun, 04 Dec 2016 15:02:27 -0000, Steve <Bogus@embarq.com> wrote: > > "Kerr Mudd-John" <admin@127.0.0.1> writes: > >> It's mostly asm. Toggles a shift key then uses an extended > >> keyboard call to see if it's changed. > >> Should be easily rewritten in asm or ascii asm for use in batch. > > > > That seems more of a test to see if the BIOS supports extended > > keyboard > > functions. The memory byte at 40H:96H should indicate a 101 > > keyboard is attached if bit 4 is set. > > > > org 0x100 > > mov ax,0x0040 > push ds > pop ds > mov bx,0x0096 > mov al,[bx] > and al,0x00010000 ; bit 4 Wot? (I'm following Frank's lead on "push ax".) Don't mix hex and binary. For hex, you'll want 0x10 for bit 4. For binary, you'll want 00010000b for bit 4. Rod Pemberton
[toc] | [prev] | [standalone]
Back to top | Article view | alt.lang.asm
csiph-web