| 数据搜索系统,热门电子元器件搜索 |
|
ST20-C1 数据表(PDF) 39 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
ST20-C1 数据表(HTML) 39 Page - STMicroelectronics |
|
39 / 205 page ![]() 39/205 4 Using ST20-C1 instructions ® ldc 0; ldl Xlo; ldl Ylo; addc; stl Zlo; ldl Xhi; ldl Yhi; addc; stl Zhi The subscripts ‘lo’ and ‘hi’, used here and in subsequent text, specify the least and most significant word respectively of the double word variable with which they are associated. Subtraction of two double length values, Y from X giving Z, without overflow signalling is compiled as ldc 0; ldl Xlo; ldl Ylo; subc; stl Zlo; ldl Xhi; ldl Yhi; subc; stl Zhi Overflow signalling for signed arithmetic may be added by performing an extra addc or subc to produce a final w ord which contains only a sign (0 for positive or -1 for negative) unless an overflow has occurred. For example, the following code could be used to perform double length signed addition with overflow signalling: clear carry, overflow and underflow status bits ld Xlo; ld Ylo; addc; st Zlo; ld Xhi; ld Yhi; addc; st Zhi; ldc 0; dup; addc; dup; adc #7ffffff; - overflows if and only if carry word > 0 rev; adc #8000001; - underflows if and only if carry word < -1 Multiple length multiplication The umac instruction multiplies two single word unsigned operands in Areg and Breg, and adds the single word carry operand in Creg to form a double length unsigned result. The more significant (carr y) word of the result is left in Breg, the less significant in Areg. No overflow can be signalled by this instruction. Multiplication of a single length unsigned value X by a double length unsigned value Y (leaving the ‘carry’ in Areg) can be performed by: ldc 0; ldl X; ldl Ylo; umac; stl Zlo; ldl X; ldl Yhi; umac; stl Zhi Double length unsigned multiplication is more complex. The product of two unsigned double length words X and Y can be expressed as: X* Y= (Xhi*2 32 +X lo)*(Yhi*2 32 +Y lo) =(Xhi*Yhi)*2 64 +(X hi*Ylo +Xlo*Yhi)*2 32 +(X lo*Ylo) This can be coded as follows: ldc 0; ldl Xlo; ldl Ylo; umac; stl Z0 ldl Xlo; ldl Yhi; umac; rev; stl Z2 |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |