s3c4510b Samsung Semiconductor, Inc., s3c4510b Datasheet - Page 140

no-image

s3c4510b

Manufacturer Part Number
s3c4510b
Description
16/32-bit Risc Microcontroller
Manufacturer
Samsung Semiconductor, Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
s3c4510b01-QE80
Manufacturer:
BOURNS
Quantity:
400 000
Part Number:
s3c4510b01-QE80
Manufacturer:
SUNMNG
Quantity:
853
Part Number:
s3c4510b01-QE80
Manufacturer:
SAMSUNG
Quantity:
8 000
Part Number:
s3c4510b01-QER0
Manufacturer:
AMCC
Quantity:
156
Part Number:
s3c4510b01-QER0
Manufacturer:
SAMSUMG
Quantity:
20 000
Company:
Part Number:
s3c4510b01-QER0
Quantity:
58
Part Number:
s3c4510b01-QERO
Manufacturer:
Panasonic
Quantity:
12 000
Part Number:
s3c4510b01-QERO
Manufacturer:
SAMSUNG
Quantity:
16 615
INSTRUCTION SET
GENERAL PURPOSE SIGNED DIVIDE
This example shows a general purpose signed divide and remainder routine in both Thumb and ARM code.
Thumb code
;signed_divide
;Get abs value of R0 into R3
;SUB always sets flag so go & report division by 0 if necessary
;Get abs value of R1 by xoring with 0xFFFFFFFF and adding 1 if negative
;Save signs (0 or -1 in R0 & R2) for later use in determining ; sign of quotient & remainder.
;Justification, shift 1 bit at a time until divisor (R0 value) ; is just <= than dividend (R1 value). To do this shift
dividend ; right by 1 and stop as soon as shifted value becomes >.
just_l
0
div_l
0
0
;Now fix up the signs of the quotient (R0) and remainder (R1)
3-98
ASR
EOR
SUB
BEQ
ASR
EOR
SUB
PUSH
LSR
MOV
B
LSL
CMP
BLS
MOV
B
LSR
CMP
BCC
SUB
ADC
CMP
BNE
POP
EOR
EOR
SUB
EOR
SUB
MOV
R2, R0, #31
R0, R2
R3, R0, R2
divide_by_zero
R0, R1, #31
R1, R0
R1, R0
{R0, R2}
R0, R1, #1
R2, R3
%FT0
R2, #1
R2, R0
just_l
R0, #0
%FT0
R2, #1
R1, R2
%FT0
R1, R2
R0, R0
R2, R3
div_l
{R2, R3}
R3, R2
R0, R3
R0, R3
R1, R2
R1, R2
pc, lr
; Signed divide of R1 by R0: returns quotient in R0,
; remainder in R1
; Get 0 or -1 in R2 depending on sign of R0
; EOR with -1 (0xFFFFFFFF) if negative
; and ADD 1 (SUB -1) to get abs value
; Get 0 or -1 in R3 depending on sign of R1
; EOR with -1 (0xFFFFFFFF) if negative
; and ADD 1 (SUB -1) to get abs value
; Set accumulator to 0
; Branch into division loop
; Test subtract
; If successful do a real subtract
; Shift result and add 1 if subtract succeeded
; Terminate when R2 == R3 (ie we have just
; tested subtracting the 'ones' value).
; Get dividend/divisor signs back
; Result sign
; Negate if result sign = -1
; Negate remainder if dividend sign = -1
S3C4510B

Related parts for s3c4510b