1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 07:29:33 +00:00
cc65/libsrc/runtime/shrax7.s

19 lines
475 B
ArmAsm
Raw Permalink Normal View History

2024-01-28 20:33:12 +00:00
;
; 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