Solved

Echoing characters using font bitmaps in nasm

Posted on 2003-11-21
4
591 Views
Last Modified: 2013-12-03
Does anybody know how to read characters from a keyboard and echoes them on the screen using nasm assembler? The thing is I have a set of font bitmaps which I have to use to echo whatever character the user enters on the screen but I have no clue how to do that.
Please somebody help me out!And how can I get the ascii value of the character from the scan code  of the key?
Thank you
0
Comment
Question by:debrisca
4 Comments
 
LVL 3

Expert Comment

by:terageek
ID: 9879203
Read characters from the keyboard using DOS interrupts to poll the keyboard.

Convert scan codes into ascii with a lookup table.  Create a table such that lookup_table[scan_code] = ascii value.

If you are echoing text to the screen in a text mode, there are DOS interrupts which will put a character to the screen.  If you are in GFX mode, then you will need to to a blt (block transfer) to copy the bitmap of the appropriate character to the screen.  Again, you can use a lookup table to go from an ascii character to the offset in your font bitmap where the character begins.

Does this help at all?  Do you need any more details?
0
 
LVL 37

Accepted Solution

by:
bbao earned 250 total points
ID: 9893322
read input from keyboard:
you can use interrupt 16h, function 00h to read the keyboard. this gets a key from the keyboard buffer. if there isn't one, it waits until there is. it returns the scan code in AH and the ASCII translation in AL.

xor ah,ah  ; function 00h - get character
int 16h      ; interrupt 16h

scan code table:
http://members.iweb.net.au/~pstorr/pcbook/book3/scancode.htm

hope it helps,
bbao
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Arial Narrow font 4 563
Certain fonts on server show in bad quality 3 174
Recognize Font from Image 15 238
Excel, change font color of the result of a calculation. 2 112
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Adding Computers to AD groups through an SCCM Task Sequence
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question