?? hello.c
字號:
/*------------------------------------------------------------------------------
HELLO.C: adapted for XC161/XC164 Board
Copyright 1995-2002 Keil Software, Inc.
------------------------------------------------------------------------------*/
#include <stdio.h> /* standard I/O .h-file */
#include <XC161.h> /* special function register XC161 */
#include <math.h>
/****************/
/* main program */
/****************/
void main (void) { /* execution starts here */
/* initialize the serial interface */
#ifndef Monitor /* do not initialize if you use Monitor-166 */
P3 |= 0x0400; /* SET PORT 3.10 OUTPUT LATCH (TXD) */
DP3 |= 0x0400; /* SET PORT 3.10 DIRECTION CONTROL (TXD OUTPUT) */
DP3 &= 0xF7FF; /* RESET PORT 3.11 DIRECTION CONTROL (RXD INPUT) */
ASC0_TIC = 0x80; /* SET TRANSMIT INTERRUPT FLAG */
ASC0_RIC = 0x00; /* DELETE RECEIVE INTERRUPT FLAG */
ASC0_BG = 0x40; /* SET BAUDRATE TO 9600 BAUD @ 20MHz */
ASC0_CON = 0x8011; /* SET SERIAL MODE */
ALTSEL0P3 |= 0x0C00; /* Configure port pins for serial interface 0 */
#endif
printf ("Hello World\n"); /* the 'printf' function call */
while (1) { /* An embedded program does not stop and */
; /* ... */ /* never returns. We've used an endless */
} /* loop. You may wish to put in your own */
} /* code were we've printed the dots (...). */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -