Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 102449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:57:56+00:00 2026-05-11T00:57:56+00:00

In ARM assembly immediates are encoded by an 8-bit rotated value which means we

  • 0

In ARM assembly immediates are encoded by an 8-bit rotated value which means we can only encode

(0-256)^2n. 

Now my problem is that I want to clear the upper 16-bits of r0 and replace it with the half-word stored r1. But because of the limited range of the immediates I have to do: –

bic r0, r0, #0xff000000 bic r0, r0, #0x00ff0000 add r0, r0, r1, LSL #16 

Is it possible to do replace the 2 bic instructions with a single instruction? 0xffff0000 is unencodable. Perhaps I should be using another logical operation to clear the upper 16-bits?

Thanks

EDIT: Sorry I forgot to say that the top 16-bits of r1 is empty, and I’m using an ARM7TDMI

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:57:57+00:00Added an answer on May 11, 2026 at 12:57 am

    How about:

    orr r0,r1,r0,lsl #16 mov r0,r0,ror #16 

    (This assumes that the top halfword of r1 is empty, like your reference code did.) Depending on the circumstances, you might be able to omit the final mov here by merging it with some later code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm puzzled by this problem when writting an ARM assembly simulator in C. I've
I'm now going to learn ARM Assembly, to develop for my Windows Mobile 5
I would like to do the following operation in ARM assembly with only 24
How can I print out a 2D array in ARM assembly? I'm trying to
I am optimizing an algorithm in ARM assembly and need to figure out in
I just begin to study ARM assembly language, and am not clear about how
I'm using .align 16 \n\t in some inline ARM assembly that is implementing some
I'm currently playing with ARM assembly on Linux as a learning exercise. I'm using
I'm looking for assembler examples for ARM. I'm in need of ARM assembly for
I have a library written in C mixed mixed with some assembly for ARM.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.