memory not aligned?

Posted on 2004-11-07
Last Modified: 2008-02-26
Dear all,

Here is my code:

#define _alignedMem$ 16
__declspec(naked) void sseFunc(
 ... params ...

__m128 _alignedMem;
  push   ebp
  mov   ebp, esp
  and   esp, -16  ; aligned to 16-byte boundary
  sub   esp, __LOCAL_SIZE; should be 16 (there is only one variable, i.e.  _alignedMem)


__asm movqda mmx1, DWORD PTR[ebp+_alignedMem$ ] ; <-- error here! Not aligned?

What is wrong with the code and why?
THank you.

Question by:hengck23
    LVL 11

    Accepted Solution

    I think you are "aligning" ESP but not EBP that you are using for access...
    LVL 61

    Expert Comment

    No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

    I will leave the following recommendation for this question in the Cleanup topic area:
        Accept: dimitry {http:#12518031}

    Any objections should be posted here in the next 4 days. After that time, the question will be closed.

    EE Cleanup Volunteer

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    how can implement buble sort using only 2 registers 4 397
    Assemlby_ARM 3 502
    Convert MP3/Wav to bin format ? 4 864
    port mapped I/o query 10 109
    After several days of searching and hunting for limited documentation, I wanted to share this guide to hopefully save someone the hassle of trying to figure this out on their own. I have tested this on Xendesktop 7.1 and PS 4.5 running simultaneous…
    Great sound, comfort and fit, excellent build quality, versatility, compatibility. These are just some of the many reasons for choosing a headset from Sennheiser.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now