You work as a programmer for a moderate-sized hardware/software company. The company is
releasing a 'new' product (pretend it's 1985)... it's a simple microprocessor unit which acts as
a 'bus extender' for the PC's two-way parallel port. The unit must receive and re-transmit bi-
directional byte data - sometimes concurrently. Very little money was put into to processor's
design; it has an ALU, and ONLY two eight bit (byte) registers. Each register acts as both a port
and CPU available register. ROM also exists to hold program code. There is NOT an additional
accumulator. The situation arises where each register has received a byte from it's respective
8-bit bus, and now the ALU must swap these bytes between registers, so they may be sent on
their way.... the engineers who designed the microcode for the ALU included all the typical
arithemetic and logical operations, but they neglected (it was Friday, deadline looming) to
include that SWAP instruction. And, remember, there is no Accunulator. Only the two byte-
addressable registers.
Can you write the code to swap the byte values between the registers, so data can be on it's merry way ?
releasing a 'new' product (pretend it's 1985)... it's a simple microprocessor unit which acts as
a 'bus extender' for the PC's two-way parallel port. The unit must receive and re-transmit bi-
directional byte data - sometimes concurrently. Very little money was put into to processor's
design; it has an ALU, and ONLY two eight bit (byte) registers. Each register acts as both a port
and CPU available register. ROM also exists to hold program code. There is NOT an additional
accumulator. The situation arises where each register has received a byte from it's respective
8-bit bus, and now the ALU must swap these bytes between registers, so they may be sent on
their way.... the engineers who designed the microcode for the ALU included all the typical
arithemetic and logical operations, but they neglected (it was Friday, deadline looming) to
include that SWAP instruction. And, remember, there is no Accunulator. Only the two byte-
addressable registers.
Can you write the code to swap the byte values between the registers, so data can be on it's merry way ?