00001 00006 00007 .include "p24Hxxxx.inc" ; Include processor-specific headers 00008 00009 .global _main ; Make _main visible outside 00010 ; this file so C startup code 00011 ; can call it 00012 00013 .section psv psv ; Place following statements in PSV space 00014 HELLO_MSG: .asciz "asm_echo.s ready!\n" ; Define a null-terminated ASCII string 00015 00016 00017 ;.............................................................................. 00018 ;Code Section in Program Memory 00019 ;.............................................................................. 00020 00021 .text ;Start of Code section 00022 00023 _main: ; _main called after C startup code runs 00024 mov #HELLO_MSG,W0 ; Equivalent to 00025 call _configBasic ; configBasic(HELLO_MSG) in C 00026 00027 while1: ; while (1) { 00028 call _inChar ; W0 = inChar(); 00029 inc W0, W0 ; W0 = W0 + 1; 00030 call _outChar ; outChar(W0); 00031 goto while1 ;} 00032 00033 .end ;End of program code in this file 00034