Color print routines

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
KieranFoot

Color print routines

Post by KieranFoot »

Hi can anyone help me with asm colour print routines?

I have one at home but i can't get it to work. It print the character in the right colours but then it starts to move the cursor and beep continousley!!!

Please can someone help?
Therx

Re:Color print routines

Post by Therx »

You just need to change the attribute byte (the second)

eg.
Video Mem Layout

Code: Select all

Byte    0      1       2        3
Data Char  Att.  Char   Att.
The layout of the attribute byte is here

Pete
KieranFoot

Re:Color print routines

Post by KieranFoot »

At the moment i'm using bios print routines and so have not yet touched on any others!!!
Therx

Re:Color print routines

Post by Therx »

In that case I don't know. But honestly writing a 80x25 text mode (default) video driver is as easy as anything else in OS Dev. Using graphics modes are another matter but you won't need them for a while.

Pete
User avatar
df
Member
Member
Posts: 1076
Joined: Fri Oct 22, 2004 11:00 pm
Contact:

Re:Color print routines

Post by df »

why still trying to use real mode??
-- Stu --
KieranFoot

Re:Color print routines

Post by KieranFoot »

Why not ?
Tim

Re:Color print routines

Post by Tim »

Because it's a lot harder to program for than protected mode.
KieranFoot

Re:Color print routines

Post by KieranFoot »

oh :P

O.K. one question!

How to tramsfer contents of al to a location in memory
in other words remaking the poke function of qbasic!!!
Ozguxxx

Re:Color print routines

Post by Ozguxxx »

mov byte [segment:offset], al

Well, I think that is not so hard to implement in asm, I think you might want to revisit some basic assembly, since this question is not related with os programming.
KieranFoot

Re:Color print routines

Post by KieranFoot »

could i write an opcode to say 0001:0001 then jump to it using JMP 0001:0001, if nt how would I jump to a memory location.
Tim

Re:Color print routines

Post by Tim »

There are many ways to JMP to a particular memory address, and JMP FAR xxxx:yyyy is one of them. Read the NASM manual or the Intel manual for more info.

PS: you don't want to do JMP 0001:0001 as that area is occupied by the interrupt vector table.
Post Reply