0001 * Modified 3/24/97 for EVBU - Mike Burke 0002 0003 * addresses of BUFFALO subroutines 0004 0005 ffb8 outa equ $ffb8 output the ASCII character in A 0006 ffca outstrg equ $ffca output string at x ; string is terminated by $04 0007 ffc4 outcrlf equ $ffc4 output crlf 0008 ffb2 outlhlf equ $ffb2 output left nibble of a in ASCII 0009 ffb5 outrhlf equ $ffb5 output right nibble of a in ASCII 0010 ffc1 out2bsp equ $ffc1 output 2byte value at x in HEX 0011 ffac input equ $ffac a=input() ; a=0 if no char entered 0012 ffcd inchar equ $ffcd a=input() ; loop till user enters char 0013 ffa0 upcase equ $ffa0 a=upcase(a) 0014 ffa3 wchek equ $FFA3 z=1 if A={space,comma,tab} 0015 ffa6 dchek equ $FFA6 z=1 if A={space,comma,tab,CR} 0016 0017 * ASCII control codes 0018 000d cr equ $0d carriage return 0019 000a lf equ $0a line feed 0020 0004 eot equ $04 end of text 0021 0022 0100 ORG $0100 0023 0024 0100 ce 01 7e [ 3 ] ldx #prompt 0025 0103 bd ff ca [ 6 ] jsr outstrg ;prompt user 0026 0106 18 ce 01 2d [ 4 ] ldy #buffer-1 ;initialize pointer to input buffer 0027 010a bd ff cd [ 6 ] inloop jsr inchar 0028 010d 18 08 [ 4 ] iny ;point to next field in input buffer 0029 010f 18 a7 00 [ 5 ] staa 0,y ;store char in input buffer 0030 0112 81 0d [ 2 ] cmpa #cr ;has user typed enter? 0031 0114 26 f4 [ 3 ] bne inloop 0032 0116 86 04 [ 2 ] ldaa #eot 0033 0118 18 a7 00 [ 5 ] staa 0,y ;replace cr with eot char in input buffer 0034 011b bd ff c4 [ 6 ] jsr outcrlf 0035 011e ce 01 90 [ 3 ] ldx #hello 0036 0121 bd ff ca [ 6 ] jsr outstrg ;output message 0037 0124 ce 01 2e [ 3 ] ldx #buffer 0038 0127 bd ff ca [ 6 ] jsr outstrg ;output user's name 0039 012a bd ff c4 [ 6 ] jsr outcrlf 0040 012d 3f [14 ] swi ;quit 0041 0042 012e buffer rmb 80 0043 017e 45 6e 74 65 72 20 prompt fcc 'Enter your name: ' 79 6f 75 72 20 6e 61 6d 65 3a 20 0044 018f 04 fcb eot 0045 0190 48 65 6c 6c 6f 2c hello fcc 'Hello, ' 20 0046 0197 04 fcb eot 0047 0048 * the following lines simulate keyboard input on the simulator 0049 * 3/24/97 Not required for HC11 EVBU 0050 * ORG $df00 0051 * fcc 'Hans' 0052 * fcb cr,lf 0053 buffer 012e cr 000d dchek ffa6 eot 0004 hello 0190 inchar ffcd inloop 010a input ffac lf 000a out2bsp ffc1 outa ffb8 outcrlf ffc4 outlhlf ffb2 outrhlf ffb5 outstrg ffca prompt 017e upcase ffa0 wchek ffa3