; Getting Keyboard Presses

 ; and Putting Characters to

 ; the Monitor - For Lab3

 

 PutC  = bfd3  ;assign labels to the custom

 GetC  = bfd0  ; instruction address locations

 

       org c200

 

 Main: lds #c1ff  ; initialize the stack

 

       cli        ; enable interrupts

 

       ldaa #0d   ; load A with ASCII for <cr>

 

       psha       ; push the contents of A onto the stack

 

       ldaa #0a   ; ASCII for line feed <lf>

 

       psha       ; on the stack

 

       jsr PutC   ; send the carriage return out to monitor

       jsr PutC   ; send the line feed out to monitor

 

 Wait: jsr GetC   ; use GetC to detect a key press

       bcc Wait

       pula      ; when a key is pressed load the ASCII vale into A

       psha       ; put it back on the stack

       jsr PutC   ; dump the ASCII character for the key to the Monitor

       cmpa #3d   ; check to see if the key press was an equal sign

       bne Wait   ; if not an "=", go wait for another key press

       swi        ; return to monitor control when "=" is pressed.