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 » Wed Aug 29, 2007 12:34 pm

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 » Wed Aug 29, 2007 2:41 pm

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 » Wed Aug 29, 2007 2:50 pm

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 » Wed Aug 29, 2007 3:34 pm

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 » Wed Aug 29, 2007 6:37 pm

Oh, ok, sweet!!! Thanks!!!

Post Reply