19
Explanation: To execute the BSET instruction, the CPU begins by reading port 4. Since P47
and P46 are input pins, the CPU reads the level of these pins directly, not the value in the port
data register. It reads P47 as Low (0) and P46 as High (1).
Since P45 to P40 are output pins, for these pins the CPU reads the value in PDR4. The CPU
therefore reads the value of port 4 as H'40, although the actual value in PDR4 is H'80.
Next the CPU sets bit 0 of the read data to 1, changing the value to H'41.
Finally, the CPU writes this value (H'41) back to PDR4 to complete the BSET instruction.
As a result, bit 0 in PDR4 is set to 0, switching pin P40 to High output. However, bits 7 and 6 in
PDR4 change their values.
Summary of Contents for H8/300L Series
Page 1: ...H8 300L Series Programming Manual ...
Page 6: ...iv ...
Page 8: ...2 ...
Page 11: ......
Page 14: ......
Page 46: ......
Page 48: ......
Page 60: ......
Page 83: ......
Page 116: ......
Page 150: ...144 ...
Page 151: ......
Page 156: ...150 ...