Implement aslax7/shlax7/asrax7/shrax7
This commit is contained in:
18
libsrc/runtime/shrax7.s
Normal file
18
libsrc/runtime/shrax7.s
Normal file
@@ -0,0 +1,18 @@
|
||||
;
|
||||
; Miloslaw Smyk, 2024
|
||||
;
|
||||
; CC65 runtime: Scale the primary register by 128, unsigned
|
||||
;
|
||||
|
||||
.export shrax7
|
||||
|
||||
shrax7: ; HXXXXXXL hAAAAAAl
|
||||
asl ; AAAAAAA0, h->C
|
||||
txa
|
||||
rol ; XXXXXXLh, H->C
|
||||
ldx #$00 ; 00000000 XXXXXXLh
|
||||
bcc :+
|
||||
inx ; 0000000H XXXXXXLh if C
|
||||
: rts
|
||||
|
||||
; 12 cycles max, 9 bytes
|
||||
Reference in New Issue
Block a user