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 6835401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:13:40+00:00 2026-05-26T23:13:40+00:00

I am not very good in inline assembly, but planning to use it for

  • 0

I am not very good in inline assembly, but planning to use it for optimization purpose in an Embedded project. As I don’t know much of the information about it, I am in need of some help.

I am having Win CE 6.0, with ARM9, using MS Visual Studio 2005 (using MFC).

Basically, I want to make memory access faster, and do some bitwise operations.

It would be really helpful for me if I can get any online link, or some examples of using registers, variable names, pointers (some memory transfer and bitwise operations related stuff) etc for my particular environment.

EDIT after ctacke’s answer:

It would be really helpful for me if there is any link or small examples to work out with .s files, specifically writing and exporting functions from .s, and steps involving in combining them with my MFC application. Any small example would do it.

Thank You.

Kind Regards,
Aftab

  • 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. Editorial Team
    Editorial Team
    2026-05-26T23:13:41+00:00Added an answer on May 26, 2026 at 11:13 pm

    The ARM compilers that ship with Visual Studio (all versions) do not support inline ASM – only the x86 compilers support inline ASM. To use ASM for ARM (or SH or MIPS as well) you have to create a separate code file (typically a .s file), export functions from your ASM and call those.

    EDIT

    Here’s a simple example (taken from here):

    AREA asm_func, CODE, READONLY
    ; Export my_asm function location so that C compiler can find it and link
    EXPORT my_asm
    
    my_asm
    ;
    ; ARM Assembly language function to set LED1 bit to a value passed from C   
    ; LED1 gets value (passed from C compiler in R0)
    ; LED1 is on GPIO port 1 bit 18
    ; See Chapter 9 in the LPC1768 User Manual
    ; for all of the GPIO register info and addresses
    ; Pinnames.h has the mbed modules pin port and bit connections
    ;
    
    ; Load GPIO Port 1 base address in register R1 
    LDR     R1, =0x2009C020 ; 0x2009C020 = GPIO port 1 base address
    
    ; Move bit mask in register R2 for bit 18 only
    MOV.W   R2, #0x040000   ; 0x040000 = 1<<18 all "0"s with a "1" in bit 18
    
    ; value passed from C compiler code is in R0 - compare to a "0" 
    CMP     R0, #0          ; value == 0 ?
    
    ; (If-Then-Else) on next two instructions using equal cond from the zero flag
    ITE EQ
    
    ; STORE if EQ - clear led 1 port bit using GPIO FIOCLR register and mask
    STREQ   R2, [R1,#0x1C]  ; if==0, clear LED1 bit
    
    ; STORE if NE - set led 1 port bit using GPIO FIOSET register and mask
    STRNE   R2, [R1,#0x18]  ; if==1, set LED1 bit
    
    ; Return to C using link register (Branch indirect using LR - a return)
    BX      LR
    END
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not very good with Regex but I am learning. I would like
I'm not very good at regex but maybe there's a simple way to achieve
Hi I have some experience with programming but I'm not very good with pointers.
So I'm not very good with C but I'm designing a GLUT application that
I am not very good at regular expression but want to do some thing
I am not very good at sql , generally I use php to do
Not very good at debugging yet but I'm getting a few errors. A few
I'm not very good at code so please use laymans terms in answering!! I
I'm not very good with regular expressions but in Textmate, I'm trying to clear
I'm still not very good with data structures, but I have this homework assignment

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.