Last active
December 21, 2015 21:49
-
-
Save BlockoS/6371269 to your computer and use it in GitHub Desktop.
HuC6280 left shift (8bit input, 16bit output)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;---------------------------------------------------------------------- | |
; name : asl.w | |
; | |
; description : Left shift 8 bit value, 16 bit result | |
; | |
; in : A number of bits to shift [0-f] | |
; X value | |
; | |
; out: A low nibble | |
; Y high nibble | |
asl.w: | |
cly | |
asl A | |
sax | |
jmp [asl.w.tbl, X] | |
asl.w5: lsr A | |
say | |
ror A | |
say | |
asl.w6: lsr A | |
say | |
ror A | |
say | |
asl.w7: lsr A | |
say | |
ror A | |
rts | |
asl.w4: lsr a | |
ror a | |
ror a | |
ror a | |
tay | |
ror a | |
and #$f0 | |
say | |
and #$0f | |
rts | |
asl.w3: asl A | |
say | |
rol A | |
say | |
asl.w2: asl A | |
say | |
rol A | |
say | |
asl.w1: asl A | |
say | |
rol A | |
say | |
asl.w0: rts | |
asl.wf: lsr A | |
cla | |
ror A | |
say | |
rts | |
asl.we: and #%000000011 | |
lsr A | |
ror A | |
ror A | |
say | |
rts | |
asl.wd: asl A | |
asl.wc: asl A | |
asl.wb: asl A | |
asl.wa: asl A | |
asl.w9: asl A | |
asl.w8: say | |
rts | |
asl.w.tbl: .dw asl.w0, asl.w1, asl.w2, asl.w3, asl.w4, asl.w5, asl.w6, asl.w7 | |
.dw asl.w8, asl.w9, asl.wa, asl.wb, asl.wc, asl.wd, asl.we, asl.wf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment