Advertisement Remove all ads

Write an Assembly Language Program to Multiply a Number Stored At Location 1050 with a Nunber at Location 1051. Result is 2-byte. Store Result at Locations 1052 and 1053. - Computer Science 2

Advertisement Remove all ads
Advertisement Remove all ads
Advertisement Remove all ads

Write an Assembly Language Program to multiply a number stored at location 1050 with a nunber at location 1051. Result is 2-byte. Store result at locations 1052 and 1053.

Advertisement Remove all ads

Solution

Label Mnemonics Comments
  SUB A clear the accumulator
  MOV D, A clear the D register
  LXI H, 1050H load immediately 1050 to HL pair
  MOV B, M move memory to B reg.
  INX H increment HL pair
  MOV C, M move memory to C reg
BACK: ADD B add B with accumulator
  JNC NEXT jump if not carry to NEXT
  INR D increment D reg.
NEXT : DCR C Decrement C reg.
  JNZ BACK jump if not zero to BACK
  INX H increment HL pair
  MOV M, A move accumulator to memory
  INX H increment HL pair
  MOV M, D move D reg. to memory
  RST 1.0 Restart
Concept: Instruction Set and Programming of 8085
  Is there an error in this question or solution?
Advertisement Remove all ads
Share
Notifications

View all notifications


      Forgot password?
View in app×