हिंदी

Locate smallest number in a block from 2050H to 2060H and store it in memory location 2061H - Computer Science 2

Advertisements
Advertisements

प्रश्न

Locate smallest number in a block from 2050H to 2060H and store it in memory location 2061H

उत्तर

Mnemonics Comment
Opcode Operand
 MVI C, 0A ; Block length in C Register
   LXI H, 2050 ; Store 2050 in HL pair
MOV A, M ; Copy content of memory to Acc.
    BACK: INX H ; Increment HL pair by 1
               CMP M ; Compare Acc. with memory
               JC : NEXT ; If Cy = 1, then go to NEXT
               MOV A, M ; Copy content of Memory to Acc.
NEXT : DCR C ; Decrement C Reg. by 1
              JNZ : BACK ; If Cy ? 0, then go to Back
              INX H ; Increment HL by 1
              MOV M, A ; Store Acc. content to memory
              RST 1.0 ; Restart
shaalaa.com
Instruction Set and Programming of 8085
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2014-2015 (March)

APPEARS IN

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×