Author Topic: Can I replace binary with hex?  (Read 16493 times)

Offline macaswell

  • Jr. Member
  • *
  • Posts: 16
Can I replace binary with hex?
« 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?

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Can I replace binary with hex?
« Reply #1 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


Offline macaswell

  • Jr. Member
  • *
  • Posts: 16
Re: Can I replace binary with hex?
« Reply #2 on: November 17, 2010, 12:32:29 AM »
I know about the 2h thing, that's green on black text.

Thanks for the key