2000-06-23 22:06:37 +00:00
|
|
|
;
|
|
|
|
; Christian Groessler, June 2000
|
|
|
|
;
|
|
|
|
; mul40
|
|
|
|
; multiplies A by 40 and returns result in AX
|
|
|
|
; uses tmp4
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.importzp tmp4
|
2014-01-03 22:40:22 +00:00
|
|
|
.export mul40,loc_tmp
|
2000-06-23 22:06:37 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc mul40
|
2000-06-23 22:06:37 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
ldx #0
|
|
|
|
stx tmp4
|
|
|
|
sta loc_tmp
|
|
|
|
asl a
|
|
|
|
rol tmp4
|
|
|
|
asl a
|
|
|
|
rol tmp4 ; val * 4
|
|
|
|
adc loc_tmp
|
|
|
|
bcc L1
|
|
|
|
inc tmp4 ; val * 5
|
|
|
|
L1: asl a
|
|
|
|
rol tmp4 ; val * 10
|
|
|
|
asl a
|
|
|
|
rol tmp4
|
|
|
|
asl a
|
|
|
|
rol tmp4 ; val * 40
|
|
|
|
ldx tmp4
|
|
|
|
rts
|
2000-06-23 22:06:37 +00:00
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.bss
|
|
|
|
loc_tmp:.res 1
|