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 0000 ORG $0000 0023 0024 0000 ce 00 38 [ 3 ] ldx #prompt 0025 0003 bd ff ca [ 6 ] jsr outstrg ;prompt user 0026 0006 18 ce 00 2d [ 4 ] ldy #buffer-1 ;initialize pointer to input buffer 0027 000a bd ff cd [ 6 ] inloop jsr inchar 0028 000d 18 08 [ 4 ] iny ;point to next field in input buffer 0029 000f 18 a7 00 [ 5 ] staa 0,y ;store char in input buffer 0030 0012 81 0d [ 2 ] cmpa #cr ;has user typed enter? 0031 0014 26 f4 [ 3 ] bne inloop 0032 0016 86 04 [ 2 ] ldaa #eot 0033 0018 18 a7 00 [ 5 ] staa 0,y ;replace cr with eot char in input buffer 0034 001b bd ff c4 [ 6 ] jsr outcrlf 0035 001e ce 00 3f [ 3 ] ldx #hello 0036 0021 bd ff ca [ 6 ] jsr outstrg ;output message 0037 0024 ce 00 2e [ 3 ] ldx #buffer 0038 0027 bd ff ca [ 6 ] jsr outstrg ;output user's name 0039 002a bd ff c4 [ 6 ] jsr outcrlf 0040 002d 3f [14 ] swi ;quit 0041 0042 002e buffer rmb 10 0043 0038 4e 61 6d 65 3a 20 prompt fcc 'Name: ' 0044 003e 04 fcb eot 0045 003f 48 65 6c 6c 6f 2c hello fcc 'Hello, ' 20 0046 0046 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 002e cr 000d dchek ffa6 eot 0004 hello 003f inchar ffcd inloop 000a input ffac lf 000a out2bsp ffc1 outa ffb8 outcrlf ffc4 outlhlf ffb2 outrhlf ffb5 outstrg ffca prompt 0038 upcase ffa0 wchek ffa3