Thread: How can i use the gcc create the assembler code that i want ?

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    17

    How can i use the gcc create the assembler code that i want ?

    How can i use the gcc create the instruction what i want ?

    just create the simple instruction, just like add cal and so on.
    do not rely on the platform.

    or i want to know where i can find help ,what i should learn~~in that manual i was lost~~

    i just wanna make a simple system in a simple machine,it has the require condition.


    cal int/byte/flo mul/sub/add/div A,B
    jmp S
    jpz N (condition)
    cmp
    ret
    call
    ld (load)
    pop
    push

    and some others

    it has a 4m flat memory 32bit

    so how can i do it?

  2. #2
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    Use "gcc -S" to produce assembler code from a C file. Or, just learn one of the asm variants and do it yourself. There's many tutorials online.

  3. #3
    Registered User
    Join Date
    Dec 2011
    Posts
    17
    thank you, all i should do is learn and keep a positive attitude

  4. #4
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    You can't restrict the instruction set GCC uses.

    Unless you want to write your own architecture back end (target) that only has these instructions, and interface it with the mid-end. If you know how to do that, you probably wouldn't be asking this question here, though.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Create EAN code in c#
    By Limpan in forum C# Programming
    Replies: 3
    Last Post: 05-18-2009, 05:37 AM
  2. Can you create, edit and compile C code with a C++ IDE?
    By nerdpirate in forum C Programming
    Replies: 4
    Last Post: 05-31-2008, 01:54 AM
  3. How do i create this code into a function?
    By frodonet in forum C Programming
    Replies: 5
    Last Post: 11-01-2007, 04:39 PM
  4. How to Create .H files and use Assembler functions?
    By luisvalencia in forum C Programming
    Replies: 7
    Last Post: 04-10-2005, 11:47 PM
  5. Any code to create another executable?
    By Nutshell in forum A Brief History of Cprogramming.com
    Replies: 32
    Last Post: 03-31-2002, 08:26 AM

Tags for this Thread