Write an instruction sequence to swap the 16bit value stored

Write an instruction sequence to swap the 16-bit value stored in data memory location at 0x2000~0x2001 with the 16-bit value stored in the data memory at 0x2020~0x2021.

Solution

LDA 2000 ( lode accumulator with contents of memory location 2000H)

MOV B,A (move data of accumulator to B register)

LDA 2001 (load accumulator with contents of memory location 2001H)

STA 2020 ( store the memory location 2020H with the contents of accumulator)

MOV A,B ( move data from B register to accumulator)

STA 2021 (store the memory location 2021H with the contents of accumulator)

HLT ( terminate the execution)

Write an instruction sequence to swap the 16-bit value stored in data memory location at 0x2000~0x2001 with the 16-bit value stored in the data memory at 0x2020

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site