Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

LPC2138 assembly Carry Flag Keil uvision3 karm2.32a

2005-09-24 by yvesr123

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) ;
}

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.