Yahoo Groups archive

Lpc2000

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

Thread

question on ARM instruction

question on ARM instruction

2004-12-14 by ©@°Ø¦â¤p¿ß

whats the difference in between ASR(arithematic shift right) and LSR
(logical shift right) as they are basically doing the same thing? 
can someone tell me when to use ASR and when to use LSR? thank u!

Re: [lpc2000] question on ARM instruction

2004-12-14 by Richard

ASR replicates the sign bit, LSR always shifts 0 from the left side.

At 02:25 AM 12/14/2004, ©@°Ø¦â¤p¿ß wrote:


>whats the difference in between ASR(arithematic shift right) and LSR
>(logical shift right) as they are basically doing the same thing?
>can someone tell me when to use ASR and when to use LSR? thank u!

// richard (This email is for mailing lists. To reach me directly, please 
use richard at imagecraft.com)

Re: question on ARM instruction

2004-12-14 by Kerem Or

Logical shift always shifts "0" in from left to right. Arithmetic 
shift shifts the sign bit of the register from left to right. That 
means when the register is initially a negative value, every shift 
whifts in "1"s and if it is a positive value then "0"s will be 
shifted in.

Example:

A byte initially contains 11001010 (0xca)

After one ASR this byte will look like 11100101 (0xe5) as 0xca is a 
negative value (sign bit - b7 is set)

But after one LSR this byte becomes 01100101 (0x65).

So the LSR shifts zeros in regardless of the sign bit.

Hope this clarifies everything...

Kerem



--- In lpc2000@yahoogroups.com, ©@°Ø¦â¤p¿ß <sevenstar_uk@h...> wrote:
> 
> whats the difference in between ASR(arithematic shift right) and 
LSR
> (logical shift right) as they are basically doing the same thing? 
> can someone tell me when to use ASR and when to use LSR? thank u!

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.