EMAC PRIMER Instruction Manual page 50

Table of Contents

Advertisement

FF04
Single step and the A register will be loaded with the value of the E register. Examine the A register (it
should be BF)
FF05
Single step and the ADD M instruction will be executed which will add to the A register the data at the
memory address pointed to by HL. The memory address is FF10 and the data at that address is 5C, so
the result of this instruction will be BF + 5C = 11B. Since 11B won't fit in the A register, the carry flag is
set and the A register is 1B. Examine the A register and flag register to verify this.
FF06
Single step and the A register will be copied to the E register.
FF07
Single step and HL will be FF11 which points to the second most significant byte of the three byte number
stored in memory.
FF08
Single step and the D register will be copied to the A register. Examine the A register; it should be F7.
FF09
Single step and the ADC M instruction will be executed which will add to the A register, the carry flag from
the last ADD M instruction and the data at the memory address pointed to by HL. The memory address is
FF11 and the data at that address is A3, so the result of this instruction will be F7 + A3 + carry flag = 19B.
Since 19B won't fit in the A register, the carry flag is set and the A register is 9B. Examine the A register
and flag register to verify this.
FF0A
Single step and the A register will be copied to the D register.
FF0B
Single step and HL will be FF12 which points to the most significant byte of the three byte number stored
in memory.
FF0C
Single step and the A register will be loaded with the value of the C register. Examine the A register (it
should be 01).
FF0D
Single step and the ADC M instruction will be executed which will add to the A register the carry flag from
the last ADC M instruction and the data at the memory address pointed to by HL. The memory address is
FF12 and the data at that address is 0E, so the result of this instruction will be 01 + 0E + carry flag = 10.
Since 10 fits in the A register, the carry flag is zero and the A register is 10. Examine the A register and
flag register to verify this.
FF0E
Single step and the A register will be stored in the C register.
FF0F
This is the end of the program.
The result stored in the C,D and E registers is 109B1B which is the sum of 01F7BF and 0EA35C. Try running the program
with different values in the C,D and E registers with other values stored at memory locations FF10, FF11 and FF12.
50

Advertisement

Table of Contents
loading

Table of Contents