6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Sep 22, 2024 11:23 am

All times are UTC




Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Sat Aug 22, 2020 12:32 pm 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 702
Location: North Tejas
dmsc wrote:
This is smaller and faster, without using any temporary:
Code:
        lda     W_      ; 4
        asl             ; 2
        tax             ; 2
        lda     W_+1    ; 4
        rol             ; 2
        tay             ; 2

        txa             ; 2
        clc             ; 2
        adc     S_      ; 4
        sta     W_      ; 4

        bit     S_      ; 4
        bpl     l2      ; 2  3

        dey             ; 2  -
l2:
        bcc      l3     ; 2  3
        iny             ; 2  -
l3:
        sty     W_+1    ; 4   



I'm sorry, I should not have been so lazy. The intent was not to add to the sum of W and W, but to test how the compiler handled adding a signed byte to a sixteen-bit value already in registers.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: