Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
to use vedio and text memory without libraary funtions we have 0xA and 0xB address to use. but what is tthe address for keyboard to read the characters from keyboards.


//for vedio mode
char far * pt = 0xA0000000;
pt=1;

What I have tried:

i know that keyboard has some address between '0x0' to '0xf' but what?? i try to search on google it says 0x417 is address of toogle keys like capslock.
Posted
Updated 1-May-16 0:41am
Comments
Daniel Pfeffer 1-May-16 4:48am    
Are you using a 16-bit emulator (DOSbox or something similar)? If you are trying to do this in Windows or Linux, this can't be done by user programs.
Kornfeld Eliyahu Peter 1-May-16 5:13am    
What hardware are you talking about?

1 solution

Your addresses are for the BIOS data area and the video memory. The BIOS data area has been used in the early days of PCs during system boot.

But with actual operating systems these data are no longer available. The page Memory Map (x86) - OSDev Wiki[^] contains a good description of these memory areas.

While it is possible to access these data when using DOS, it is better to use the DOS interrupts (INT 21h, e.g. function 01 to read a character from stdin) or the BIOS interrupts (e.g. INT 09h for keyboard).

When not using DOS and you don't want to use libraries you must use API functions of the operating system because modern OS does not allow direct hardware access. With Windows for example use the ReadConsoleInput function (Windows)[^].
 
Share this answer
 
Comments
Kornfeld Eliyahu Peter 1-May-16 6:50am    
BDA - http://staff.ustc.edu.cn/~xyfeng/research/cos/resources/BIOS/Resources/biosdata.htm
I would also add, that it is not assured, that modern PCs support this BIOS layout of memory (uefi, or even USB keyboards), so it should be used with care...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900