English

Write an assembly language program to check whether fourth and fifth bits of a hexadecimal number stored in memory location D900H is logical one then store 00H else FFH of memory location D901H.

Advertisements
Advertisements

Question

Write an assembly language program to check whether fourth and fifth bits of a hexadecimal number stored in memory location D900H is logical one then store 00H else FFH of memory location D901H.

Code Writing
Advertisements

Solution

Label    Instructions      Comments 
         LXI H, D900H  ; Load HL to D900H       
         MOV A, M      ; Move M to A           
         ANI 18H       ; AND with 18H          
         SUI 18H       ; Subtract 18H with A    
         JZ Store      ; Jump on zero go to store
         MVI A, FFH    ; SET A To FFH             
Store    STA D901H     ; Store A to D901H        
         HLT           ; Stop                    
shaalaa.com
  Is there an error in this question or solution?
2024-2025 (July) Official Board Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×