मराठी
महाराष्ट्र राज्य शिक्षण मंडळएचएससी विज्ञान (संगणक विज्ञान) इयत्ता १२ वी

Write an Assembly Language Program to exchange the digits of a number the digits of a number stored in C200H and add it to the original number Store the result at C201H. - Computer Science 2

Advertisements
Advertisements

प्रश्न

Write an Assembly Language Program to exchange the digits of a number the digits of a number stored in C200H and add it to the original number Store the result at C201H.

कोड लेखन
Advertisements

उत्तर

Label       Mnemonics and Operand          Comments

      LXI H, C200H     ; Set HL with C200H
      MOV A, M         ; Copy memory content to accumulator

      RRC              ; Rotate right (1st time)
      RRC              ; Rotate right (2nd time)
      RRC              ; Rotate right (3rd time)
      RRC              ; Rotate right (4th time) → Exchange nibbles

      ADD M            ; Add original memory content with accumulator
      STA C201H        ; Store result at C201H
      HLT              ; Stop execution
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2022-2023 (March) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×