![Samsung S3C2501X Скачать руководство пользователя страница 151](http://html.mh-extra.com/html/samsung/s3c2501x/s3c2501x_user-manual_340828151.webp)
INSTRUCTION SET
S3C2501X
3-60
Division and Remainder
A number of divide routines for specific applications are provided in source form as part of the ANSI C library
provided with the ARM Cross development toolkit, available from your supplier. A short general purpose divide
routine follows.
; Enter with numbers in Ra and Rb.
MOV
Rcnt,#1
; Bit to control the division.
Div1
CMP
Rb,#0x80000000
; Move Rb until greater than Ra.
CMPCC
Rb,Ra
MOVCC
Rb,Rb,ASL#1
MOVCC
Rcnt,Rcnt,ASL#1
BCC
Div1
MOV
Rc,#0
Div2
CMP
Ra,Rb
; Test for possible subtraction.
SUBCS
Ra,Ra,Rb
; Subtract if ok,
ADDCS
Rc,Rc,Rcnt
; Put relevant bit into result
MOVS
Rcnt,Rcnt,LSR#1
; Shift control bit
MOVNE
Rb,Rb,LSR#1
; Halve unless finished.
BNE
Div2
; Divide result in Rc, remainder in Ra.
Overflow Detection in the ARM9TDMI
1. Overflow in unsigned multiply with a 32-bit result
UMULL
Rd,Rt,Rm,Rn
; 3 to 6 cycles
TEQ
Rt,#0
; +1 cycle and a register
BNE
overflow
2. Overflow in signed multiply with a 32-bit result
SMULL
Rd,Rt,Rm,Rn
; 3 to 6 cycles
TEQ
Rt,Rd ASR#31
; +1 cycle and a register
BNE
overflow
3. Overflow in unsigned multiply accumulate with a 32 bit result
UMLAL
Rd,Rt,Rm,Rn
; 4 to 7 cycles
TEQ
Rt,#0
; +1 cycle and a register
BNE
overflow
4. Overflow in signed multiply accumulate with a 32 bit result
SMLAL
Rd,Rt,Rm,Rn
; 4 to 7 cycles
TEQ
Rt,Rd, ASR#31
; +1 cycle and a register
BNE
overflow
Содержание S3C2501X
Страница 1: ...S3C2501X 32 BIT RISC MICROPROCESSOR USER S MANUAL Revision 1 查询S3C2501X供应商 捷多邦 专业PCB打样工厂 24小时加急出货 ...
Страница 18: ......
Страница 275: ...MEMORY CONTROLLER S3C2501X 5 60 NOTES ...
Страница 289: ...I2C CONTROLLER S3C2501X 6 14 NOTES ...
Страница 373: ...GDMA CONTROLLER S3C2501X 9 24 NOTES ...
Страница 435: ...I O PORTS S3C2501X 12 12 NOTES ...
Страница 463: ...ELECTRICAL DATA S3C2501X 15 6 NOTES ...