/* echo.asm * CMPE 001, Fall 2004 * ver 1.0 /cb,rph,scp * This is a simple program to introduce the 68HC11 Microkit */ #include .sect .data program: .asciz "Echo v1.01" prompt: .asciz ">" .sect .text /* Your program starts here indicated by the label "main:". * After startup code in v2_18g3.asm is done, we jumps to this * label and continue running (see Motorola Ref. Manual 6-12 for instruction set). */ main: // One time initialization code: // Task 1: Write to the terminal the program we're running and clear the LCD ldx #program // address pointer of signon string in memory jsr OUTSTRING // write a null-terminated string to the serial port ldaa #1 // ACCA <-- 1; this is a command code for the LCD jsr LCD_CMD // clear LCD ldx #prompt // address of prompt jsr OUTSTRING // write prompt out to the serial port jsr OUTCRLF // print out a carriage return echo_loop: /* Get a character and put it in accumulator A (ACCA), then print it to the LCD. * The serial port will output will go to your computer * monitor. Serial port input will come from the keyboard. * There is no local echo; you will not see your own input. */ jsr GETCHAR // getchar returns in ACCA jsr OUTCHAR // write ACCA to screen jsr LCD_CHAR // Write to the LCD as well coma // ACCA <-- not ACCA; invert the accumulator A for the LEDs staa LEDS jmp echo_loop