If a BRA instruction is located at $01CD, what is the maximum backward destination address
Calculating the Destination Address
In the relative mode, a relative address follows the opcode in memory. It is added to the current program counter to determine the destination address. The relative address is a signed 8-bit number that indicates the number of bytes to branch forward or backward in memory to the destination address. It is a displacement from the current position in memory. Since it is a signed 8-bit number, it must be sign-extended to 16 bits before being added to the contents of the 16-bit program counter.
DA = PC + rr
DA = Destination Address
PC = Address in the Program Counter
rr = Sign-Extended Relative Address
DA = $01 + 2 -> $03
rr = $CD -> $CD
------------------------------
DA ------> $92
Get Answers For Free
Most questions answered within 1 hours.