Specifications
174 www.xilinx.com Embedded System Tools Guide (EDK 6.2i)
1-800-255-7778 UG111 (v1.4) January 30, 2004
Chapter 11: GNU Compiler Tools
R
-xl-mode-xmdstub
Xilinx Microprocessor Debugger (XMD) allows three different modes of debugging an 
user program for MicroBlaze. The three debugging options are 
x Simulator mode (Does not require a board)
x XMDStub mode (Requires the XMDStub to be a part of the bitstream)
x MDM mode (Hardware debugging enabled. Bitstream does not contain the 
XMDStub)
For more information about the XMD tool, refer to the , “Xilinx Microprocessor Debugger 
(XMD)” chapter in the guide.
For programs compiled with the “XMDStub” mode, the address locations 0x0 to 0x3ff are 
reserved for the XMDStub. Hence the user program can start only at 0x400. 
The usage of -xl-mode-xmdstub has two effects:
x The start address of the user program is set to 0x400. Users can change this address by 
overriding the _TEXT_START_ADDR in the linker script or through linker options. 
For more details about linker options, refer to the, “Linker Options” section.
x crt1.o is used as the intialization file. The crt1.o file returns the control back to the 
XMDStub when the user program execution is complete. 
Note: -xl-mode-xmdstub should be used for designs when XMDStub is part of the bitstream. This 
mode should not be used when the system is compied for No Debug or when “Hardware Debugging” 
is turned ON. For more details on debugging with xmd, please refer to 
, “Xilinx Microprocessor 
Debugger (XMD)” chapter.
-xl-mode-xilkernel
The Embedded Development Kit provides a microkernel (XMK). Any application which 
needs to be executed on top of this kernel should be compiled with the -xl-mode-xilkernel. 
Refer to the EST Libraries Guide for more information regarding the various option 
provided by the Xilinx MicroKernel.
Caution! mb-gcc will signal fatal error, if more than one mode of execution is supplied on the 
command line. 
MicroBlaze Assembler
The mb-as assembler for Xilinx’s MicroBlaze soft processor supports the same set of 
options supported by the standard GNU compiler tools. It also supports the same set of 
assembler directives supported by the standard gnu assembler.
The mb-as assembler supports all the opcodes in the MicroBlaze machine instruction set, 
with the exception of the imm instruction. The mb-as assembler generates imm instructions 
when large immediate values are used. The assembly language programmer is never 
required to write code with imm instructions. For more information on the MicroBlaze 
instruction set, refer to the MicroBlaze Reference Guide.
The mb-as assembler requires all Type B MicroBlaze instructions ( instructions with an 
immediate operand) to be specified as a constant or a label. If the instruction requires a PC-
relative operand, then the mb-as assembler will compute it, and will include an imm 
instruction if necessary. For example, the Branch Immediate if Equal (beqi) instruction 
requires a PC-relative operand. The assembly programmer should use this instruction as 
follows:
beqi r3, mytargetlabel










