Author Topic: Question.  (Read 18447 times)

nobody

  • Guest
Question.
« on: November 13, 2004, 11:29:29 AM »
This code will not be built, because the NASM doesn't recognize the symbols 'f7h' as a valid hexadecimal.

Is there something that I'm missing (I hope)???

mov   dx,03c4h
   mov   al,4
   out   dx,al
   inc   dx
   in   al,dx
   and   al,f7h     ;turn off chain 4
   or   al,04h   ;turn off odd/even

NASM is just fine, until it hits the

and al, f7h

it gives the error 'f7h' symbol undefined.

What gives?? Anybody have a clue, because this is a simple immediate value?

Harried and hopeless,

Jeff

P.S. Thanks in advance.

nobody

  • Guest
Re: Question.
« Reply #1 on: November 13, 2004, 11:52:53 AM »
Nevermind guys, i figured it out

whenever you have a hex value, it must be pre-pended by a 0. ZERO

cool enough


Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Question.
« Reply #2 on: November 14, 2004, 07:21:47 AM »
Right. More generally, a number must begin with a decimal digit. An identifier may *not* begin with a decimal digit. Otherwise Nasm wouldn't know which you intend, without some "artificial clairvoyance"...

In a "keyequ.inc" file, I once foolishly used "F1", "F2", etc. as equates for the function keys. Nasm distinguished it fine, but F1, F2 look so much like hex numbers that I confused hell out of myself! Ideally, we want to make it clear to both Nasm and a human reader, what's a number and what's not... amongst other things...

Best,
Frank