DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

REV 데이터 시트보기 (PDF) - STMicroelectronics

부품명
상세내역
제조사
REV Datasheet PDF : 4 Pages
1 2 3 4
ST10F280-AB
2.2 - MAC.9 - CoCMP Instruction Inverted Operands
The ST10 Family Programming Manual describes the CoCMP instruction as: subtracts a 40-bit signed
operand from th 40-bit accumulator content (acc - op2\op1), and updates the N, Z and C flags in the MSW
register, leaving the accumulator unchanged. On the device the reverse operation (op2\op1 - acc) has
been implemented in the Mac Unit. Therefore, the N and C flags are set according to the reverse
operation (Z flag is not affected).
Workaround:
Change interpretation of the N and C flags in the MSW register.
Example:
MOV
MOV
MOV
CoLOAD
CoCMP
R12, #07h
R13, #06h
R14, #0
R14, R12
R14, R13
; Accumulator = 70000h
; Compares 70000h to 60000h
Here the content of MSW is 0500h, i.e. C = 1, Z = 0 and N = 1.
To test if the Accumulator was greater than or equal the compared value, the "normal" test, according to
the description in the ST10 Programming Manual, would be:
JNB
MSW.10, Greater ; If C flag cleared, then greater than or equal
With the implementation, this test does not provide the expected result.
To obtain the correct comparison, use instead:
JB
MSW.10, Greater ; C flag set: 60000h < 70000h (60000h-70000h implemented)
; i.e. the accumulator is greater than or equal compared value
2.3 - MAC.10 - E Flag Evaluation for CoSHR and CoASHR Instructions when Saturation Mode is Enabled
The Logical and the Arithmetic Right Shift instructions (CoSHR/CoASHR) are specififed not to be affected
by the saturation mode (MS bit of the MCW register): the shift operation is always made on the 40 bits of
the accumulator. The result shifted in the accumulator is never saturated. Only when the saturation mode
is enabled, the evaluation of the E Flag (in the MSW register) is erroneous.
Comment to the example:
In the example below (Table 1), the E Flag is kept cleared however MAE is used: bit 0 of MAE has been
shifted into bit 15 of MAH. The MAE part has been used and it contents significant bits but the E Flag has
not been set.
The content of the flags is given after the execution of the instruction.
Table 1 : MAC.10 Example
MS Bit is Set, Saturation Mode is Enabled
Status of Flags After Instruction Execution
Code
Accumulator Value
(Hexa.)
SL
E
SV
C
Z
N
Remark
MOV R5, #5555h -- ---- ----
-
-
-
-
-
--
CoLOAD R5, R5
00 5555 5555 0
0
0
0
0
0 Right
NOP
00 5555 5555 0
0
0
0
0
0 Right
MOV MSW, #007Fh 7F 5555 5555 0
0
0
0
0
0 Right
NOP
7F 5555 5555 0
0
0
0
0
0 Right
CoSHR #1
3F AAAA AAAA 0
0*
0
0
0
0 *E is wrong
Workaround:
If the MAE flag is used, the saturation mode must be disabled before running Logical and/or Arihmetic
Right Shift instructions and re-enable just after.
2/4

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]