1.

Write The Assembly Language Programming To Find The 2's Complement For A String Of 100 Bytes.?

Answer»

The following would be the code:

  • 2000 CLD : Clears the direction flag
  • 2001 MOV SI, 4000 H : In the SI the STORE ADDRESS is placed
  • 2004 MOV DI, 5000 H : In the DI the destination address is put
  • 2007 MOV CX, 0064 H : In the CX the number of bytes to be 2`s complemented are placed
  • 200A LODSB : The data byte is give to AL and INC SI
  • 200B NEGAL : AL of 2`s complement.
  • 200D STOSB : Current AL value into DI and INC DI
  • 200E LOOPNZ 200A H : The loop is maintained till CX becomes = 0.
  • 2010 HLT : Stop.

The following would be the code:



Discussion

No Comment Found