Assembler as (1)
Outline
This tool assembles assembly source files output by the C compiler and converts the mnemonics
of the source files into object codes (machine language) of the S1C17. The as.exe allows the user
to invoke the assembler through xgcc.exe, this makes it possible to include preprocessor
directives into assembly source files. The results are output in an object file that can be linked or
added to a library.
Flowchart
Assembly
sources
file.s
Assembler
as
Object files
file.o
ld linker
Assembly sources
including preprocessor instructions
file.s
Specify the –c and
C compiler
–xassembler-with-cpp
xgcc
options
Preprocessor
cpp
Assembler
as
Object files
file.o
ld linker
Start-up Command
as <options> <filename>
<filename> Assembly source file name
Example: as -o test.o -adhl test.sAssemblerasfile.
Major Command-line Options
-o<
filename
>
-a[<
suboption
>]
--gstabs
-mpointer16
Major Preprocessor Pseudo-instructions
#include
#define
#if – #else – #endif
(Can be used when the
Major Assembler Pseudo-instructions
.text
.section .data
.section .rodata
.section .bss
.long < data >
.short < data >
.byte < data >
.ascii < string >
.space < length >
.zero < length >
.align < value >
.global < symbol >
.set < symbol >,< address >
Development Tools
Specify output file name
Output assembly list file
Example:-adhl (high-level assembly listing without
debugging directives)
Add debugging information with relative path to source
files
Specify 16-bit pointer mode
Insertion of file
Definition/macro definition of character string and
numeric value
Conditional assembly
-c -xassembler-with-cpp
option of xgcc is specified.)
Declare .text section
Declare .data section
Declare .rodata section
Declare .bss section
Define 4-byte data
Define 2-byte data
Define 1-byte data
Define ASCII character strings
Define blank area (0x0)
Define blank area (0x0)
Alignment to specify boundary address
Global declaration of symbol
Define symbol with absolute address
Need help?
Do you have a question about the S5U1C17001C and is the answer not in the manual?