ARM VERSION 1.2 Guía de usuario Pagina 82

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 133
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 81
By default, the stack pointer sp is initialized to 0x08000000 for ARMulator. If you are using a development board,
you must set $top_of_memory. For example, for most (unexpanded) ARM Integrator boards, set
$top_of_memory to 0x40000.
6.4.2 Sample code
The C code fragment in Example 6-1 shows the use of semihosting SWIs to output text. See the main.c source
code for the definitions of demo_malloc(), demo_printf(), demo_float_print(), and demo_sprintf().
The code selected by the #ifdef EMBEDDED is used in Loading the ROM image at address 0 and other examples.
Example 6-1 extract from main.c
int main(void)
{
printf("C Library Example\n");
#ifdef EMBEDDED
/* ensure no C library functions that uses semihosting SWIs are linked */
#pragma import(__use_no_semihosting_swi)
#endif
demo_printf();
demo_sprintf();
demo_float_print();
demo_malloc();
return 0;
}
Writing Code for ROM
Copyright ?1999 2001 ARM Limited 6-7
Vista de pagina 81
1 2 ... 77 78 79 80 81 82 83 84 85 86 87 ... 132 133

Comentarios a estos manuales

Sin comentarios