Thread: asm.

  1. #1
    Registered User newbie_grg's Avatar
    Join Date
    Jul 2002
    Posts
    77

    asm.

    hi,
    I was just reading when i got struck with this question.
    1.what are embedded systems and how do we program for such systems.
    2. what do we mean exactly by assembly language??can we program assembly language using c++??
    ;-).
    "If knowledge can create problems, it is not through ignorance that we can solve them. "
    -Isaac Asimov(1920-1992)

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Try a search

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    Re: asm.

    1.what are embedded systems and how do we program for such systems.
    Embedded systems are systems (computers) "buildt into" all kinds of stuff: The toaster, washing machine, the car etc... Unlike a PC which is an system where you can perform lots of different tasks on, most embedded systems can only do what they were designed to. You can't, for example, surf the web or write documents using the toaster (cruel world... ).

    2. what do we mean exactly by assembly language??can we program assembly language using c++??
    ;-).
    The assembly language basically consists of processor instructions, telling the processor (the heart of the system) what to do. The instructions are very simple (like "Add X to Y" or "Jump to line 26" (The instructions are listed)) but can together form more complex functions.

    There is an inline assembler in C/C++
    Code:
    asm
    {
       ... //Assembler Code
    }
    (I believe you need an assembler compiler like NASM first though)
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  4. #4
    Registered User newbie_grg's Avatar
    Join Date
    Jul 2002
    Posts
    77

    hey.

    thanx magos.
    I jsut wanted to know about them. Do you have any idea about the good books on Asm language??
    i will appreciate your help on this part too..
    "If knowledge can create problems, it is not through ignorance that we can solve them. "
    -Isaac Asimov(1920-1992)

  5. #5
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Embedded examples

    Several years ago I built a car alarm. (Still in use... runs 24/7 and never "crashes".) It uses a Motorola microcontroller and a handfull of other parts. I programmed it in (its) assembly language. The "cross assembler" runs on a PC. I didn't have a compiler for it. (And, I didn't know C).

    We're working on a USB product (here at work) that uses a Cypress microcontroller. Our embedded systems programmer is writing the embedded code (to run in the device) as well as the driver code (to run on a PC). All of his programming is in C++ with some inline assembly.

    A microcontroller chip has a microprocessor, RAM, ROM, and various other stuff built-in.

    Compilers for embedded systems usually come with special custom libraries to handle the particular features of the microcontroller.

  6. #6
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    Currently I'm working at my company on software for a car radio. The radio has a lot of software in it to do things like band-searching, storing stations, displaying information on the screen, communicating with other devices in the car etc. This is an embedded system. The main difference between an embedded system and a desktop system is that a desktop system is a general purpose system and an embedded system is only able to perform a defined set of tasks.

    >can we program assembly language using c++??

    It is possible to generate assembly language from C++. A lot of C/C++ compilers support the option to generate assembly language first and then assemble it using an assembler. The advantage of this is that it makes it possible to do hand-optimizing of the assembly code. But note that modern compilers are very good themselves at optimizing.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. gcc asm code syntax
    By Uberapa in forum C Programming
    Replies: 4
    Last Post: 06-15-2007, 01:16 AM
  2. Asm + C++
    By JaWiB in forum C++ Programming
    Replies: 17
    Last Post: 06-26-2003, 03:13 PM
  3. Understanding ASM
    By kuphryn in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 07-12-2002, 07:39 PM
  4. asm mov
    By manu in forum C++ Programming
    Replies: 1
    Last Post: 12-15-2001, 12:59 PM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM