Page 1 of 1

Color print routines

Posted: Tue Dec 09, 2003 10:36 am
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?

Re:Color print routines

Posted: Tue Dec 09, 2003 10:50 am
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

Re:Color print routines

Posted: Tue Dec 09, 2003 11:01 am
by KieranFoot
At the moment i'm using bios print routines and so have not yet touched on any others!!!

Re:Color print routines

Posted: Tue Dec 09, 2003 1:29 pm
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

Re:Color print routines

Posted: Tue Dec 09, 2003 2:04 pm
by df
why still trying to use real mode??

Re:Color print routines

Posted: Fri Dec 12, 2003 6:03 am
by KieranFoot
Why not ?

Re:Color print routines

Posted: Fri Dec 12, 2003 7:12 am
by Tim
Because it's a lot harder to program for than protected mode.

Re:Color print routines

Posted: Fri Dec 12, 2003 7:16 am
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!!!

Re:Color print routines

Posted: Fri Dec 12, 2003 8:23 am
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.

Re:Color print routines

Posted: Mon Dec 15, 2003 9:31 am
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.

Re:Color print routines

Posted: Mon Dec 15, 2003 11:50 am
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.