Dual and quad core assembler programming /  O.S.

Posted on 2008-11-15
Last Modified: 2013-12-13
I've been exploring on assembler programming, and read a couple of articles on CPUs, but I can't find a tutorial or reference on quad and dual assembler. My question is:
What's the main difference between a normal processor and a dual or quad, when it comes down to assembler programming?


P.S. I am playing around with this "make your own OS"  tutorials
Question by:d_iego
    LVL 43

    Accepted Solution

    > What's the main difference between a normal processor and a dual or quad, when it comes down to assembler programming?
    Nothing. Assembler has no idea about threads. You are coding single thread.
    After all, C/C++ is the same - You are coding single thread - but if You know the code is to be thread safe, You have to code it that way.
    Same with asm, if You want to make sure that the code is thread safe, You have to use bus/memory locking or atomic instructions.

    Look at this case from CPU side - one core always runs single thread. It's the operating system who creates(on process request) new threads and processes and manages them.

    > P.S. I am playing around with this "make your own OS"  tutorials
    So basically what You need is to create threads scheduler. Initialize every available cpu/core with some OS thread(probably same entry point), which will then run the scheduler to assign userland threads/processes.
    LVL 18

    Assisted Solution

    ravenpl's answer is correct and very informative.  However, I would like to expound on the threading topic.

    As ravenpl said, in Assembly, and to the CPU in general, there is no concept of threads or processes; each core executes a single instruction at a time, and it is up to the software (e.g. the operating system) to divide and group the instructions on each tasks and feed them to each individual core or processor.

    There are some very specific algorithms and techniques to do this, and all of them are fairly complex.  However, some processor manufacturers provide libraries or compilers that aid in making the various decisions required at the lowest levels of execution.

    If you are using an Intel multi-core processor, you may want to look into the Intel TBB (Threading Building  Blocks) library:


    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
    Problem to adjust sheet 1 78
    Windows 10 Black Screen and Reboot Redux 22 102
    countX 22 49
    3D Rendering GPU or CPU? 1 34
    This is about my first experience with programming Arduino.
    If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    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…

    759 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

    14 Experts available now in Live!

    Get 1:1 Help Now