hello world in 2051

Nov 09, 2005 0 Replies

formatting link
it does not look like there is a C compiler found here at all


formatting link



how to program that 2051 so that I have the same of result



formatting link
when I apply the realterm.



and suppose to store "hello world" in a register or P.X , I need help


  1. idenify itself "I am here" like hello world in
    formatting link


  • * helloworld.c * First C program for 2051 experiment * * Copyright (C) 2005

  • compiled with Dunfield Micro-C for 8051 Release 3.2 */

#include c:\mc\8051io.h /* include i/o header file */ #include c:\mc\8051reg.h



printf, sprintf, concat int main() { unsigned char temp; BAUD = 0x30; // 9600b SCCR1 = 0x00; // 8-bit mode SCCR2 = 0x0C; // enable Tx/Rx, no interrupts



printf("Hello, world!\n");



temp = 0; while(1) { if(temp%2) PORTA = PORTA | 0x10; // turn on Port A, pin 4 else PORTA = PORTA & ~(0x10); // turn off Port A, pin 4 temp++; } return 0; }


no sure if this will work since I have not compile micro-c compiler


TIA


Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required