0

Hey all, I've been trying to get my int 10h to set the color for a STRING, not just a single character.

Here's my code, i'm running windows XP and using NASM16 assembler.

So, what I want it to do is display something like "Hello world", instead of just.. "a", etc.

the macro::

%macro color 3
mov cx,%1 	;CX value = amount of chars to print
mov bl,%2	;BL value = HEXI color attr
mov al,%3	;AL value = character to print
mov ah,9	;Function 9, display char
int 10h		;Call the SCREEN vector

%endmacro

the code::

[org 0100h]
%include "Library.asm"

[section .text]

color 1,6ah,hello     ;Use library to attempt to display string
string eol
exit 0

[section .data]
hello db "Hello, world.", 13, 10, "$"
eol db 13, 10, "$"

Any help would be great, thanks.

Edited by Goalatio: n/a

1
Contributor
1
Reply
3
Views
7 Years
Discussion Span
Last Post by Goalatio
0

Nevermind, I fixed this.

All I had to do was position the cursor ontop of the new colors.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.