CLS in ASM

Discuss whatever you want here--both QB and non-QB related. Anything from the DEF INT command to the meaning of life!

Moderators: Pete, Mods

Post Reply
Frosty480
Coder
Posts: 17
Joined: Mon Aug 27, 2007 11:59 am
Contact:

CLS in ASM

Post by Frosty480 »

Is there any way of clearing the screen in ASM?

The reason why I ask is because im working on a OS in ASM, and I need to clear the screen when the PC boots....
User avatar
Stoves
Veteran
Posts: 101
Joined: Fri Feb 10, 2006 12:24 am
Location: Nashville, TN

Post by Stoves »

I don't know ASM, but I think I can give a possible method.

Code: Select all

Point to video memory address: 0 offset.
Get each byte of video memory and XOR it with itself.
That will reset all video memory to 0. Hence, blank screen. (Assuming of course that color zero is black.)
Frosty480
Coder
Posts: 17
Joined: Mon Aug 27, 2007 11:59 am
Contact:

Post by Frosty480 »

I already knew that, its just that would take a whole bunch of code, compared maybe to some sorta video interupt?
User avatar
Stoves
Veteran
Posts: 101
Joined: Fri Feb 10, 2006 12:24 am
Location: Nashville, TN

Post by Stoves »

lol sorry.

maybe try this: (from http://www.codeguru.com/forum/archive/i ... 26197.html)
mov ax,3
int 10h

This one set 80x25 text mode. I don't know if you're working i that one and if no, here are some other modes:

0 -> 40x25
1 -> 40x25
2 -> 80x25
3 -> 80x25

It looks as if XP is blocking the interrupt call so that any other mode cannot be set. Blocked or not, this method still clears the screen.
Frosty480
Coder
Posts: 17
Joined: Mon Aug 27, 2007 11:59 am
Contact:

Post by Frosty480 »

Oh, ok, sweet!!! Thanks!!!
Post Reply