This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Creating Assembly only project in Code Composer Studio

Other Parts Discussed in Thread: TM4C129ENCPDT

I am trying to create a project with assembly code only (absolutely no C code) in code composer studio (Version: 5.5.0.00077) and I am having difficulty in doing it.

In New CCS Project there is an option to create “Empty Assembly-only project”, if I use this option,

In Advanced settings, there is an option for Compiler version,

Since the start up code is also assembly, why do I need to have compiler option for assembly only project?

Why does it create a code template in C if the project option is Assembly-only project?

I referred to few threads on this topic but could not get any answer for above questions.

https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/135041

On Sep 18, 2011 6:02 PM , it says “This was a known issue with earlier v5 builds (SDSCM00040000) but it should be fixed in the latest v5.1 builds.”

I hope my version Version: 5.5.0.00077 has fix for this??

 

My error and problem is same as in below thread:

https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/235407

I did not find solution but on Dec 27, 2012 6:26 PM, it says “Most users begin with C programs, and the out of box templates and examples are set up to work better with C projects rather than assembly only projects

I have come across many C code examples and projects but I am looking for assembly code projects:

 

Are there any example codes for assembly only? Or

How to create a project for Assembly language only?

Regards

Srinivasa

  • Srinivasa Wunnimani said:

    In New CCS Project there is an option to create “Empty Assembly-only project”, if I use this option,

    In Advanced settings, there is an option for Compiler version,

    Since the start up code is also assembly, why do I need to have compiler option for assembly only project?

    I am not sure what exactly you are referring to but a Compiler toolset is required to build assembly only programs as well, hence the need for a Compiler version. The Compiler shell in turn invokes the assembler to build assembly only programs.

    Srinivasa Wunnimani said:
    Why does it create a code template in C if the project option is Assembly-only project?

    Please show exactly what code template in C is being created.

    Srinivasa Wunnimani said:
    My error and problem is same as in below thread:

    Did the solution provided in the other thread not help in your case?

    Srinivasa Wunnimani said:
    Are there any example codes for assembly only?

    Which target processor are you working with? There are assembly code examples for MSP430 included with MSPWare, but there aren't really any examples for other processor families.

  • Question 1:

    TI: I am not sure what exactly you are referring to but a Compiler toolset is required to build assembly only programs as well, hence the need for a Compiler version. The Compiler shell in turn invokes the assembler to build assembly only programs.

    Srinivas: My understanding was that compiler will be required only If I use high level language programming (to convert high level to assembly language).  In our case we are trying to create a project in assembly so we can avoid compiler and we can directly invoke assembler to generate object file.  In fact in the CCSV5 installation folder “C:\ti\ccsv5\tools\compiler\arm_5.1.11\bin” we have an assembler armasm.exe.  I was able to generate an object file at command line using the command “armasm.exe hello.asm hello.o” but I had a problem of downloading and running it.

    Compiler toolset contains compiler, assembler, and linker build together.  I just thought we can avoid compiler by invoking the assembler directly, anyway this is not of big concern; we can go ahead having compiler option.

    Question 2:

    TI: Please show exactly what code template in C is being created.

    Srinivas: Please find the c file attached (file name : Copy_of_tm4c129encpdt_startup_ccs.c).

    TI: Did the solution provided in the other thread not help in your case?

    Srinivas: I just added a new file “hello.asm” and build it.  Now there are no errors and object file is being generated.  I am not sure what did I miss in the earlier case.  Sorry for that.

    I have few other questions on the new object file generated:

    The new object file generated is 22,372 bytes but the code I have written is barely 3 lines of assembly.

    Does the new object file generated includes any startup code?  I am seeing SP and PC are not loaded with proper values so it is not working as expected.

    If you can provide me some example projects (as discussed below in Question 3), it might answer my questions.

    Question 3:

    TI: Which target processor are you working with? There are assembly code examples for MSP430 included with MSPWare, but there aren't really any examples for other processor families.

    I am working on TIVA tm4c129encpdt processor.  If there are any examples for this, let me know.

    Regards

    Srinivasa

    Copy_of_tm4c129encpdt_startup_ccs.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    //*****************************************************************************
    //
    // Startup code for use with TI's Code Composer Studio.
    //
    // Copyright (c) 2011-2013 Texas Instruments Incorporated. All rights reserved.
    // Software License Agreement
    //
    // Software License Agreement
    //
    // Texas Instruments (TI) is supplying this software for use solely and
    // exclusively on TI's microcontroller products. The software is owned by
    // TI and/or its suppliers, and is protected under applicable copyright
    // laws. You may not combine this software with "viral" open-source
    // software in order to form a larger program.
    //
    // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
    // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
    // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
    // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
    // DAMAGES, FOR ANY REASON WHATSOEVER.
    //
    //*****************************************************************************
    #include <stdint.h>
    //*****************************************************************************
    //
    // Forward declaration of the default fault handlers.
    //
    //*****************************************************************************
    void ResetISR(void);
    static void NmiSR(void);
    static void FaultISR(void);
    static void IntDefaultHandler(void);
    //*****************************************************************************
    //
    // External declaration for the reset handler that is to be called when the
    // processor is started
    //
    //*****************************************************************************
    extern void _c_int00(void);
    //*****************************************************************************
    //
    // Linker variable that marks the top of the stack.
    //
    //*****************************************************************************
    extern uint32_t __STACK_TOP;
    //*****************************************************************************
    //
    // External declarations for the interrupt handlers used by the application.
    //
    //*****************************************************************************
    // To be added by user
    //*****************************************************************************
    //
    // The vector table. Note that the proper constructs must be placed on this to
    // ensure that it ends up at physical address 0x0000.0000 or at the start of
    // the program if located at a start address other than 0.
    //
    //*****************************************************************************
    #pragma DATA_SECTION(g_pfnVectors, ".intvecs")
    void (* const g_pfnVectors[])(void) =
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Srinivasa Wunnimani said:
    In fact in the CCSV5 installation folder “C:\ti\ccsv5\tools\compiler\arm_5.1.11\bin” we have an assembler armasm.exe.  I was able to generate an object file at command line using the command “armasm.exe hello.asm hello.o” but I had a problem of downloading and running it.

    Yes, you can invoke armasm directly on command line, however the recommended method is to invoke the shell armcl, which in turn will invoke the assembler under the hood when the source file passed to it is an assembly source file.

    Srinivasa Wunnimani said:
    Please find the c file attached (file name : Copy_of_tm4c129encpdt_startup_ccs.c).

    Yes, I see that this file gets added to the project. This should ideally not be the case for an assembly only project. As you have seen, the startup file sets up the stack and vector table etc, and we add this file to new Tiva CCS projects as a way to ease the project creation/build process for the user so they have a template to start with. If you wish to have a pure assembly program with no C source files then you can exclude this file from the build and you would need to take care of all the startup requirements in the assembly code. 

    Srinivasa Wunnimani said:
    I am working on TIVA tm4c129encpdt processor.  If there are any examples for this, let me know.

    I am not aware of any assembly-only examples for this processor.

  • Do you have any assembly code example projects for Tiva E or Stellaries processor series?
  • Are there any project examples with combination of assembly code and C language for this processor family?

  • I had a C source code with name main.c and added an assembly file main.asm
    Any intentional syntax error introduced in main.asm was not reported and I was under the impression that I am missing something.
    I have changed the name of main.asm to Srini.asm and now it is working fine and now I have project with C and assembly code.
    Thanks.
  • The reference software provided by TI for this processor family is TivaWare: http://www.ti.com/tool/sw-tm4c. This includes libraries and examples written in C. 

    I am not aware of any examples with combination of assembly and C code for this family.