Home > User Support > CoverageMaster winAMS FAQ

CoverageMaster winAMS FAQ

Object File, OMF Conversion

115_01: How to use an assembly symbol as a test variable?

Question:

I am using an assembly symbol as a C program pointer. When I try to choose this assembly symbol from the Unit Test CSV Settings dialog and add it as an input, the symbol is not recognized as a pointer. How can I use an assembly symbol as a C pointer and specify it as an input/output variable?

EXPORT _tmp ; Assembly symbol definition

extern unsigned char *tmp; /* C pointer definition */

/* example */
switch( *tmp )
{
    ...
}

Answer:

The only variables that can be registered in test CSV files are C language variable entity declarations. As a workaround, you can rewrite the variables defined in assembly in C, or you can symbolize the *tmp address by using the defined symbols feature.

<Reference: About the defined symbols feature>
Defined symbols are virtual variable definitions that can be used in CoverageMaster. They can be created from the Unit Test CSV Settings dialog's "Defined Symbols" tab.

Click the "Create" button, then enter the symbol name, select Address as the I/O Type, set the address and variable type and size. In this way a variable with the name given can be specified just as if it were in C code.

In the example below, a defined symbol named TMP indicating the entity of the above source pointer *tmp (when the address is 0x00800064) is created. In other words, it is the same as creating an "unsigned char TMP" variable whose address is mapped to 0x00800064.

By registering this defined symbol in the CSV file, you can enter test data into the entity pointed to by *tmp.



Related Technical Tips Search

Other technical tips in GAIO's web site can be searched for using the links below.

Search key word link: Assembly Variable
Technical Tips Google Search


Information Links