Solved

Echoing characters using font bitmaps in nasm

Posted on 2003-11-21
4
588 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
Comment Utility
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:
Bing CISM / CISSP earned 250 total points
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Sub menu 5 303
what font is this? 10 264
Font install problem 9 36
how do you get these � Marks in your text? 9 57
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now