Re: [cc65] need help getting external long from asm

From: Christian Grössler <chris1groessler.org>
Date: 2011-11-23 10:00:23
On 23.11.11 01:56, Egan Ford wrote:
> _timer: LDA     KBDCR           ; cycles 4      got key?
>          BMI     DONE            ; cycles 2      if neg, got key goto DONE
>          CLC                     ; cycles 2      clear carry
>          LDA     #1              ; cycles 2      A = 1
>          ADC     _count          ; cycles 4      LSB += A
>          STA     _count          ; cycles 4
>          LDA     #0              ; cycles 2      A = 0
>          ROL     A               ; cycles 2      A = carry, carry = 0
>          ADC     _count+1        ; cycles 4
>          STA     _count+1        ; cycles 4
>          LDA     #0              ; cycles 2      A = 0
>          ROL     A               ; cycles 2      A = carry, carry = 0
>          ADC     _count+2        ; cycles 4
>          STA     _count+2        ; cycles 4
>          LDA     #0              ; cycles 2      A = 0
>          ROL     A               ; cycles 2      A = carry, carry = 0
>          ADC     _count+3        ; cycles 4
>          STA     _count+3        ; cycles 4
>          CLC                     ; cycles 2      clear carry
>          BCC     _timer          ; cycles 2 + 1  back to checking for key
>                                  ; total = 59
> DONE:   LDA     KBDDATA         ; get key value
>          STA     _key            ; store in _key
>          RTS

A small optimization, you can remove the "ROL A" instructions.

regards,
chris

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed Nov 23 10:17:12 2011

This archive was generated by hypermail 2.1.8 : 2011-11-23 10:17:15 CET