0

given the following assembly instructions

mov ax,  bx  
add ax,  di 

How can I write a single instruction to have the same effect as those two?

Rndm
  • 6,710
  • 7
  • 39
  • 58
user3316022
  • 1
  • 1
  • 1

1 Answers1

1

There is no guarantee that there is an equivalent 'single instruction' for any two (or more) instructions. In this case, the solution appears to be

mov ax, bx+di

However, that instruction does not exist. But there is the lea command: What's the purpose of the LEA instruction?

and so this ought to work:

lea ax, [bx+di]
Community
  • 1
  • 1
Jongware
  • 22,200
  • 8
  • 54
  • 100