git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1207
4a8a32a2-be11-0410-ad9d-
d568d2c75423
The simulator can be used to run this program:
s51 -Sout=serial.txt hi.ihx (run, stop, quit)
The simulator can be used to run this program:
s51 -Sout=serial.txt hi.ihx (run, stop, quit)
+ Notice that unless we use the --stack-after-data option,
+ the SSEG listed in the map is not accurate, look at the
+ .asm file and search for "sp," to see where it is really
+ initialized to.
+
6-28-01 Written by Karl Bongers(karl@turbobit.com)
|------------------------------------------------------------------------*/
#include <8052.h>
6-28-01 Written by Karl Bongers(karl@turbobit.com)
|------------------------------------------------------------------------*/
#include <8052.h>
sfr at 0xd8 WDCON; // special function register declaration
sbit LED_SYS = 0xb5; // P3.5 is led, example use of sbit keyword
sfr at 0xd8 WDCON; // special function register declaration
sbit LED_SYS = 0xb5; // P3.5 is led, example use of sbit keyword
-code char my_message[] = {"GNU rocks"}; // placed in code space
+code char my_message[] = {"GNU rocks\n"}; // placed in code space
void timer0_irq_proc(void) interrupt 1 using 2;
void timer0_irq_proc(void) interrupt 1 using 2;
}
TR0 = 0; /* Stop Timer 0 counting */
}
TR0 = 0; /* Stop Timer 0 counting */
- TH0 = (~(5000)) << 8;
- TL0 = (~(5000)) & 8;
+ TH0 = (~(5000)) >> 8;
+ TL0 = (~(5000)) & 0xff;
TR0 = 1; /* Start counting again */
}
TR0 = 1; /* Start counting again */
}
|------------------------------------------------------------------------*/
void tx_char(char c)
{
|------------------------------------------------------------------------*/
void tx_char(char c)
{
}
/*------------------------------------------------------------------------
}
/*------------------------------------------------------------------------
TMOD = 0x21; /* timer control mode, byte operation */
TCON = 0; /* timer control register, byte operation */
TMOD = 0x21; /* timer control mode, byte operation */
TCON = 0; /* timer control register, byte operation */
- TH0 = (~(5000)) << 8; /* the initial time is not important */
- TL0 = (~(5000)) & 8;
-
TH1 = 0xFA; /* serial reload value, 9,600 baud at 11.0952Mhz */
TR1 = 1; /* start serial timer */
TH1 = 0xFA; /* serial reload value, 9,600 baud at 11.0952Mhz */
TR1 = 1; /* start serial timer */
- tx_str("Hi\n");
- tx_str("There\n");
|------------------------------------------------------------------------*/
void tx_char(char c)
{
|------------------------------------------------------------------------*/
void tx_char(char c)
{
}
/*------------------------------------------------------------------------
}
/*------------------------------------------------------------------------