Statement: Exchange the contents of memory locations 2000H and 2001H. Example: Initially, (2000H) = 34H (2001H) = 20H After exchanging, (2000H) = 20H (2001H) = 34H Program 1 using direct addressing instructions: LDA 2000H ; Get the contents of location 2000H into accumulator MOV B, A ; Move the contents of accumulator into register B LDA 2001H ; Get the contents of location 2001H into accumulator STA 2000H ; Store the contents of accumulator into location 2000H MOV A, B ; Move the contents of register B into accumulator STA 2001H ; Store the contents of accumulator into location 2001H HLT ...
Comments
Post a Comment