Solved

Echoing characters using font bitmaps in nasm

Posted on 2003-11-21
4
596 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Part Two of the two-part Q&A series with MalwareTech.
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

636 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