278
APPENDIX
MB89620 series
l
DIVU A
This instruction divides the 16 bits of T by the 8 bits of AL, treating the data as unsigned. The
instruction stores the result in AL and the remainder in TL, both as 8 bit data. AH and TH are
both set to “zero”. The arithmetic operation does not use the value of AH prior to instruction
execution. The result is not assured for data that produces a result that exceeds 8 bits. As there
is no indication that the result exceeded 8 bits, check the data before performing. Since the
flags remain unchanged, use care when branching is required based on the result of the
division.
Figure B.2d shows an outline of the instruction operation.
Figure B.2d DIVU A
l
XCHW A, PC
This instruction exchanges the contents of A and PC, and as a result branches to the address
corresponding to contents of A before execution. The contents of A after execution assume the
address next to the address where the operation code of the “XCHW A,PC” is stored. The
instruction can be used to specify a table in the main routine which is used in a subroutine.
Figure B.2e shows an outline of the instruction operation.
Figure B.2e XCHW A,PC
The content of A after executing this instruction is the address of the next instruction (not the
address containing the operation code of this instruction). Accordingly, the value “1235
H
” stored
in A in the example shown in Figure B.2e is the address of the next operation code after “XCHW
A,PC”. Therefore, the value of A is “1235
H
”, not “1234
H
”.
Figure B.2f shows an assembly language example.
Figure B.2f Example Using XCHW A,PC
0002
H
T
1862
H
T
5678
H
A
0034
H
A
(Before execution)
(After execution)
5678
H
PC
1234
H
PC
5678
H
A
1235
H
A
(Before execution)
(After execution)
(Main routine)
(Subroutine)
MOVW A,#PUTSUB
PUTSUB XCHW A,EP
XCHW
A,PC
PUSHW A
DB
'PUT OUT DATA',EOL
PTS1
MOV A,@EP
MOVW A,1234
H
INCW EP
MOV IO,A
CMP A,#EOL
BNE PTS1
POPW A
XCHW A,EP
JMP @A
Table data
output here.
…
…
Содержание F2MC-8L MB89620 Series
Страница 8: ......
Страница 10: ...MB89620 series ...
Страница 11: ...vi MB89620 series ...
Страница 17: ...xii MB89620 series ...
Страница 18: ...xvi MB89620 series ...
Страница 30: ...MB89620 series CHAPTER 1 OVERVIEW 9 Memo ...
Страница 34: ...MB89620 series CHAPTER 1 OVERVIEW 13 Memo ...
Страница 42: ...MB89620 series CHAPTER 1 OVERVIEW 21 Memo ...
Страница 49: ...28 CHAPTER 1 OVERVIEW MB89620 series ...
Страница 62: ...MB89620 series CHAPTER 3 CPU 41 Memo ...
Страница 78: ...MB89620 series CHAPTER 3 CPU 57 Memo ...
Страница 82: ...MB89620 series CHAPTER 3 CPU 61 Memo ...
Страница 86: ...MB89620 series CHAPTER 3 CPU 65 Memo ...
Страница 90: ...MB89620 series CHAPTER 3 CPU 69 Memo ...
Страница 96: ...MB89620 series CHAPTER 3 CPU 75 Memo ...
Страница 122: ...MB89620 series CHAPTER 4 I O PORTS 101 Memo ...
Страница 144: ...MB89620 series CHAPTER 5 TIMEBASE TIMER 123 Memo ...
Страница 149: ...128 CHAPTER 5 TIMEBASE TIMER MB89620 series ...
Страница 157: ...136 CHAPTER 6 WATCHDOG TIMER MB89620 series ...
Страница 174: ...MB89620 series CHAPTER 7 8 BIT PWM TIMER 153 Memo ...
Страница 177: ...156 CHAPTER 7 8 BIT PWM TIMER MB89620 series ...
Страница 202: ...MB89620 series CHAPTER 9 16 BIT TIMER COUNTER 181 Memo ...
Страница 217: ...196 CHAPTER 9 16 BIT TIMER COUNTER MB89620 series ...
Страница 220: ...MB89620 series CHAPTER 10 8 BIT SERIAL I O SERIAL I O 1 AND SERIAL I O 2 199 Memo ...
Страница 228: ...MB89620 series CHAPTER 10 8 BIT SERIAL I O SERIAL I O 1 AND SERIAL I O 2 207 Memo ...
Страница 245: ...224 CHAPTER 10 8 BIT SERIAL I O SERIAL I O 1 AND SERIAL I O 2 MB89620 series ...
Страница 266: ...MB89620 series CHAPTER 13 A D CONVERTER 245 13 Memo ...
Страница 283: ...262 CHAPTER 13 A D CONVERTER MB89620 series ...
Страница 289: ...268 CHAPTER 14 CLOCK MONITOR FUNCTION MB89620 series ...
Страница 306: ...MB89620 series APPENDIX 285 APPEND Memo ...
Страница 319: ...298 APPENDIX MB89620 series Memo ...
Страница 321: ...2 ...
Страница 354: ......