callisto
callisto

Reputation: 5083

How to change screen background in assembler

This is for homework:

How do I clear the screen and change foreground and background colors in assembler (NASM on windows)

EDIT: It turns out the answer is something like

mov bh, 71h
int 10h

Upvotes: 2

Views: 886

Answers (2)

Carl Norum
Carl Norum

Reputation: 224874

You'll probably need some operating system services to get that kind of functionality. Since that's a requirement, how would you do it from another language? Once you figure that out, you can just make the same calls from your assembly language program. Something like:

call OSServiceClearScreen

where OSServiceClearScreen is the name of the system call or library function that performs the operation you want. Then just link your assembly program with the right libraries and it should all "just work".

Upvotes: 0

Related Questions