Solved

Echoing characters using font bitmaps in nasm

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
port mapped I/o query 10 228
Button not working - launching a webpage from a button in C# 7 401
CRM 2011 Custom Code 4 68
How to change fonts in windows live mail 3 18
Building a cohesive image for your brand is vital to making an impression on consumers. When the economy is tough, brands do better than unbranded  products. This can have a huge impact on your long-term profits, as the economy goes up and down.
Adults who share images on social media aren’t the only ones who need to worry about their privacy. Our culture’s tendency to share every move and celebration affects the privacy of our children, too.
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 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