[Coco] strange behaviour

Roger Taylor rtaylor at bayou.com
Tue Jun 15 22:59:14 EDT 2004


At 09:14 PM 6/15/2004, you wrote:
>The following assembly routine, to my knowledge, should return the value 
>of POLCAT in the D register. For some reason, it's not returning at all. 
>Can anyone provide some insight?
>
>_getch:
>         ldb     ___ungetched_char
>         beq     read_key
>         clra
>         sta     ___ungetched_char
>         rts
>read_key:
>         pshs    y
>loop:
>         jsr     [0xA000]  ; call POLCAT
>         tfr     a,b
>         clra
>         puls    y,pc


----------

----------

The only place you seem to be setting ___ungetched_char is when you clear 
it with clra/sta, yet you're checking it for a character upon entry into 
the code.

Try this:

>loop:
>         jsr     [0xA000]  ; call POLCAT
|       sta ___ungetched_char ; <<<-------------------
>         tfr     a,b
>         clra
>         puls    y,pc


----------


Roger Taylor






More information about the Coco mailing list