![Samsung S3C80M4/F80M4 Скачать руководство пользователя страница 184](http://html1.mh-extra.com/html/samsung/s3c80m4-f80m4/s3c80m4-f80m4_user-manual_3996174184.webp)
INSTRUCTION SET
S3C80M4/F80M4
6-82
SUB
—
Subtract
SUB
dst,src
Operation:
dst
←
dst – src
The source operand is subtracted from the destination operand and the result is stored in the
destination. The contents of the source are unaffected. Subtraction is performed by adding the
two's complement of the source operand to the destination operand.
Flags: C:
Set if a "borrow" occurred; cleared otherwise.
Z:
Set if the result is "0"; cleared otherwise.
S:
Set if the result is negative; cleared otherwise.
V:
Set if arithmetic overflow occurred, that is, if the operands were of opposite signs and the
sign of the result is of the same as the sign of the source operand; cleared otherwise.
D:
Always set to "1".
H:
Cleared if there is a carry from the most significant bit of the low-order four bits of the result;
set otherwise indicating a "borrow".
Format:
Bytes Cycles Opcode
(Hex)
Addr Mode
dst src
opc
dst | src
2 4 22 r
r
6 23
r
lr
opc src dst
3 6 24 R
R
6 25
R
IR
opc dst src
3 6 26 R
IM
Examples:
Given: R1 = 12H, R2 = 03H, register 01H = 21H, register 02H = 03H, register 03H = 0AH:
SUB R1,R2
→
R1 = 0FH, R2 = 03H
SUB R1,@R2
→
R1 = 08H, R2 = 03H
SUB 01H,02H
→
Register 01H = 1EH, register 02H = 03H
SUB 01H,@02H
→
Register 01H = 17H, register 02H = 03H
SUB 01H,#90H
→
Register 01H = 91H; C, S, and V = "1"
SUB 01H,#65H
→
Register 01H = 0BCH; C and S = "1", V = "0"
In the first example, if working register R1 contains the value 12H and if register R2 contains the
value 03H, the statement "SUB R1,R2" subtracts the source value (03H) from the destination
value (12H) and stores the result (0FH) in destination register R1.
Содержание S3C80M4/F80M4
Страница 1: ...S3C80M4 F80M4 8 BIT CMOS MICROCONTROLLERS USER S MANUAL Revision 1 ...
Страница 44: ...ADDRESS SPACES S3C80M4 F80M4 2 20 NOTES ...
Страница 84: ...CONTROL REGISTERS S3C80M4 F80M4 4 26 NOTES ...
Страница 102: ...INTERRUPT STRUCTURE S3C80M4 F80M4 5 18 NOTES ...
Страница 190: ...INSTRUCTION SET S3C80M4 F80M4 6 88 NOTES ...
Страница 202: ...RESET and POWER DOWN S3C80M4 F80M4 8 6 NOTES ...
Страница 216: ...8 BIT TIMER 0 S3C80M4 F80M4 11 4 NOTES ...
Страница 220: ...8 BIT PULSE WIDTH MODULATION S3C80M4 F80M4 12 4 NOTES ...
Страница 230: ...ELECTRICAL DATA S3C80M4 F80M4 13 10 NOTES ...
Страница 248: ...DEVELOPMENT TOOLS S3C80M4 F80M4 16 8 NOTES ...
Страница 249: ...This datasheet has been downloaded from www DatasheetCatalog com Datasheets for electronic components ...