![Samsung S3C2501X User Manual Download Page 112](http://html.mh-extra.com/html/samsung/s3c2501x/s3c2501x_user-manual_340828112.webp)
S3C2501X
INSTRUCTION SET
3-21
3.6.2 RESERVED BITS
Only twelve bits of the PSR are defined in ARM9TDMI (N, Z, C, V, I, F, T & M[4:0]); the remaining bits are
reserved for use in future versions of the processor. Refer to Figure 2-6 for a full description of the PSR bits.
To ensure the maximum compatibility between ARM9TDMI programs and future processors, the following rules
should be observed:
— The reserved bits should be preserved when changing the value in a PSR.
— Programs should not rely on specific values from the reserved bits when checking the PSR status, since they
may read as one or zero in future processors.
A read-modify-write strategy should therefore be used when altering the control bits of any PSR register; this
involves transferring the appropriate PSR register to a general register using the MRS instruction, changing only
the relevant bits and then transferring the modified value back to the PSR register using the MSR instruction.
Examples
The following sequence performs a mode change:
MRS
R0,CPSR
; Take a copy of the CPSR.
BIC
R0,R0,#0x1F
; Clear the mode bits.
ORR
R0,R0,#new_mode
; Select new mode
MSR
CPSR,R0
; Write back the modified CPSR.
When the aim is simply to change the condition code flags in a PSR, a value can be written directly to the flag
bits without disturbing the control bits. The following instruction sets the N, Z, C and V flags:
MSR
CPSR_flg,#0xF0000000
; Set all the flags regardless of their previous state
; (does not affect any control bits).
No attempt should be made to write an 8 bit immediate value into the whole PSR since such an operation cannot
preserve the reserved bits.
3.6.3 INSTRUCTION CYCLE TIMES
PSR transfers take 1S incremental cycles, where S is defined as sequential (S-cycle).
Summary of Contents for S3C2501X
Page 18: ......
Page 275: ...MEMORY CONTROLLER S3C2501X 5 60 NOTES ...
Page 289: ...I2C CONTROLLER S3C2501X 6 14 NOTES ...
Page 373: ...GDMA CONTROLLER S3C2501X 9 24 NOTES ...
Page 435: ...I O PORTS S3C2501X 12 12 NOTES ...