NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: macaswell on November 16, 2010, 08:18:47 PM

Title: Can I replace binary with hex?
Post by: macaswell on November 16, 2010, 08:18:47 PM
Okay, say I have this line of code to define a color:

cli_clr   db  <some binary number for white on black>b

Can I replace the binary number with hex?

cli_clr   db  2h

And have it still compile/execute properly?
Title: Re: Can I replace binary with hex?
Post by: Frank Kotler on November 16, 2010, 08:59:35 PM
Sure. "A number is a number". Binary, octal, decimal, hex are just ways of representing the number. 2h isn't going to give you white-on-black, unless you've done something weird with the palette, though. See Ralf's tables 00014 and 00015 for the "key":

http://www.ctyme.com/intr/rb-0098.htm

Best,
Frank

Title: Re: Can I replace binary with hex?
Post by: macaswell on November 17, 2010, 12:32:29 AM
I know about the 2h thing, that's green on black text.

Thanks for the key