Thanks richard ,
Work well now !
Yves
-----Original Message-----
From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com] On Behalf Of
Richard Duits
Sent: sábado, 24 de Setembro de 2005 15:01
To: lpc2000@yahoogroups.com
Subject: Re: [lpc2000] LPC2138 assembly Carry Flag Keil uvision3 karm2.32a
You can add an S to most instructions (in this case MOVS) to let let the
instruction update the status register.
Richard Duits.
yvesr123 wrote:
> LSL doesn't affect Carry Flag in the simulator.
> I have test LSL and RRX and same problem,
> Carry is not affect.
> someone can very this please ?
>
> unsigned char bitflop(unsigned char Din) __arm
> {
> unsigned char Ans;
>
> // in b7b6b5b4b3b2b1b0
> // out b0b1b2b3b4b5b6b7
> // Switch in Arm Mode
> // R4 = Din
> // R3 = Ans
> // R2 = Cntr
> __asm
> {
> LDAV R4,R1,Din ; Our byte
> MOV R2, #0 ; Cntr = 0
> MOV R4,R4,LSL #24
> loop:
> MOV R4,R4,LSL #1 ; Rotate Left with C 1bit
> MOV R3,R3,RRX ; Rotate Right with C 1bit
>
> ADD R2,R2, #00000001 ; Cntr++
> CMP R2, #00000008
> BLT loop ; Cntr < 8
>
> MOV R3,R3,LSR #24 ; Restore unsigned char
> STAV R3,R1,Ans
> }
>
> return (Ans) ;
> }
>
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
> * Visit your group "lpc2000
> <http://groups.yahoo.com/group/lpc2000>" on the web.
>
> * To unsubscribe from this group, send an email to:
> lpc2000-unsubscribe@yahoogroups.com
> <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>
Yahoo! Groups LinksMessage
RE: [lpc2000] LPC2138 assembly Carry Flag Keil uvision3 karm2.32a
2005-09-24 by Yves Rondeau
Attachments
- No local attachments were found for this message.