943,548 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Marked Solved
  • Views: 893
  • Assembly RSS
Dec 15th, 2008
0

bios level video instructions

Expand Post »
Sooooo I'm writing a program that involves a lot of writing to the screen and I want to do it at bios level. Mostly because the DOS calls can't do what I want to do, and also because I'm afraid to go all out and write directly to the vram. Anyways, I ran into trouble basically right away. The first thing I'm trying to do is mimic the 09h function of int 21h, to write a string to the screen from the memory. However, I want the string to terminate when it finds 00h 00h in the string instead of at a dollar sign. Similarly, when it finds 00h 01h, it will change the attribute byte to 00000111b (default gray on black), 00h 02h will change it to 00001010b, 00h 03h will change it to 00001011b, 00h 04h to 10110000b, etc. These will represent different text entry modes and the like.

So anyways I got it working on a single line, if I call the function to output "hello!!!",00h,02h," rawr!",00h,00h, it will output "hello!!! rawr!". But when it reaches a carriage return and line feed (0ah,0dh), it just prints two characters and continues along on the same line (I expected it to, but I was hoping it would just move the cursor by itself). Well I decided that when the procedure came across a carriage return, it would use the 03h function to get the cursor position, change dl to 00h and then call the 02h function to move the cursor to the beginning of the same line that it was on. So if I try to call the function to output "hello!!!",00h,02h,0ah,"rawr!",00h,00h, it will output "rawr!!!!". The big problem is the line feed though. I can't figure out how to make it work...

I figured I would just scroll the screen up one line using function 06h, then get the cursor position with 03h, increase dh by one and then call function 02h to move it down to the next line. But it's not working... It would scroll the window by one and then move the cursor down two lines... does scrolling the window move the cursor as well? Also, I realized that since I set the video mode at the beginning of the application (to 02h, which is 80x25 I think... I just wanted to KNOW how many rows and columns there were no matter what, since the prompt window was in a square shape instead of a rectangle and I didn't know why) the text starts at the top of the window. If I scrolled down on every line feed, there would only ever be one single line of text at the top of the window... How would I know when the cursor is outside of the buffer, and scroll it down?
Similar Threads
Reputation Points: 5
Solved Threads: 1
Unverified User
carson myers is offline Offline
33 posts
since Sep 2007
Dec 15th, 2008
-1

Re: bios level video instructions

nevermind, solved without help, bitches!
Reputation Points: 5
Solved Threads: 1
Unverified User
carson myers is offline Offline
33 posts
since Sep 2007
Dec 15th, 2008
0

Re: bios level video instructions

what was the solution
Moderator
Featured Poster
Reputation Points: 1764
Solved Threads: 574
Moderator
jbennet is offline Offline
16,485 posts
since Apr 2005
Dec 15th, 2008
0

Re: bios level video instructions

I was just confused as to the use of the functions and my code was a bit buggy.

after I called ah,03h int 10h, I needed to check that dh was not equal to 24d. If it was, equal to it, I had to scroll the screen down by one line, and NOT move the cursor (the cursor stays in the same place at line 24, the text in the window moves up behind it). If it wasn't equal to 24d, then I could move the cursor down one line.
Reputation Points: 5
Solved Threads: 1
Unverified User
carson myers is offline Offline
33 posts
since Sep 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: moving from memory to register
Next Thread in Assembly Forum Timeline: procedure size? Need halp





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC