Demo: Access the Propeller ROM

Hi, a small demo
what can I do, to set the code in a window with scrollbars, like other snippets here in the forum ?
what can I do, to set the code in a window with scrollbars, like other snippets here in the forum ?
// propeller-elf-gcc -mlmm -o readLogTable.elf -Wall readLogTable.c
#include <stdio.h>
#include <stdarg.h>
#include <math.h>
/* commented because does not fit in lmm
float FractionalToFloat (unsigned short aNumber)
{
int x;
float eps = 0.5f;
float sum = 0.0f;
for ( x = 0; x < 16; x++)
{
if ( (0x8000 >> x) & aNumber )
{
sum = sum + eps;
}
eps = eps / 2.0f ;
}
return sum;
}
*/
int main()
{
unsigned short * ptr;
// ------ any info about the compiler -----------
printf("sizeof(char) %d\n",sizeof(char));
printf("sizeof(short) %d\n",sizeof(short));
printf("sizeof(int) %d\n",sizeof(int));
printf("sizeof(long) %d\n",sizeof(long));
printf("sizeof(float) %d\n",sizeof(float));
printf("sizeof(double) %d\n",sizeof(double));
printf("sizeof(int *) %d\n",sizeof(int *));
printf("sizeof(long *) %d\n",sizeof(long *));
puts("hit return . . .");
getchar();
// ------ read the log table 0xC000 .. 0xCFFF -------
ptr = ( unsigned short *)(0xc000);
while (ptr <= (unsigned short *)0xCFFF)
{
//printf( "0x%X: 0x%X -> %f\n",ptr,*ptr,FractionalToFloat(*ptr) );
printf( "0x%X: 0x%X \n",ptr,*ptr);
ptr ++;
}
while (1)
putchar(getchar());
return 0;
}
Comments
and
tags.some issues are to complicated for me :nerd:
Thank you, David.
I see.
I am new here in the forum and a must say all users are very friendly and polite.
That is not the rule in other forums.
best regards,
Reinhard