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

A 8-bit number stored in memory location BABA H. Write an Assembly Language Program to add each bit of the given 8-bit number and store the resect at memory location. - Computer Science 2

Advertisements
Advertisements

प्रश्न

A 8-bit number stored in memory location BABA H. Write an Assembly Language Program to add each bit of the given 8-bit number and store the resect at memory location.

दीर्घउत्तर
Advertisements

उत्तर

Label Instruction Comments
  LDA BABAH ; Load Acc. with content of memory LOC BABAH
MVI B, 08 ; Move data 08H to Reg. B
MVI C, OOH ; Move data OOH to Reg. C
CYCLE RRC ; Rotate Acc right
  JNC - SKIP ; if no carry, go to SKIP
INR C ; Otherwise Increment Reg. C by 1
SKIP DCR B ; Decrement Reg. B by 1
  JNZ CYCLE ; If B ≠ 0, go to CYCLE
MOV A, C ; Move Reg. C to Acс
STA FAFAH ; Store Acc to FAFA H
HLT ; Stop
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2024-2025 (March) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×