| | |
Setting string colors in NASM
Thread Solved |
•
•
Join Date: Oct 2009
Posts: 24
Reputation:
Solved Threads: 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::
the code::
Any help would be great, thanks.
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::
Assembly Syntax (Toggle Plain Text)
%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::
Assembly Syntax (Toggle Plain Text)
[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.
Last edited by Goalatio; 24 Days Ago at 8:43 pm.
It's passion that drives me.
![]() |
Similar Threads
- String Colors (Java)
- Encrypt/Decrypt a string (C++)
- Problem inputting and printing string to and from array (Assembly)
- Applying colors to raster images (Graphics and Multimedia)
- string assignment problem (C++)
- Sending a string/byte to the usb port (C#)
- setting a string to a char (Java)
- setting a string as a variable name (Python)
- Can't get more than 16 colors (Windows 95 / 98 / Me)
Other Threads in the Assembly Forum
- Previous Thread: Help in using LDR and ADC in 8051
- Next Thread: Need help with a mips program
| Thread Tools | Search this Thread |





