Author Topic: opcode question  (Read 8717 times)

Offline MajorDill

  • Jr. Member
  • *
  • Posts: 5
opcode question
« on: April 24, 2010, 04:08:45 PM »
When I code :   ADD    BX,10h
and compile, I get :    81 C3 10 00   (as viewed in debug)

What do I need to code to get:    83 C3 10

Thank-you

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: opcode question
« Reply #1 on: April 24, 2010, 05:24:19 PM »
If you really care what the opcodes are:

Code: [Select]
db 83h, 0C3h, 10h

Or, if you semi-care:

Code: [Select]
add bx, byte 10h

Or, if you just want it short:

Code: [Select]
add bx, 10h

... just like you've got, and give Nasm the "-O" switch - there is little point to using anything but "-Ox".

Best,
Frank


Offline MajorDill

  • Jr. Member
  • *
  • Posts: 5
Re: opcode question
« Reply #2 on: April 26, 2010, 01:56:50 PM »
byte worked great!
thanks