Solved

Echoing characters using font bitmaps in nasm

Posted on 2003-11-21
4
595 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Check out this step-by-step guide for asking an anonymous question on Experts Exchange.
An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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