Optimized mul20 & mul40 and extracted to new library.
This commit is contained in:
committed by
Oliver Schmidt
parent
fbf302e6cd
commit
399250a105
@@ -10,7 +10,7 @@
|
||||
|
||||
.export _cputcxy, _cputc
|
||||
.export plot, cputdirect, putchar
|
||||
.import gotoxy, mul20
|
||||
.import gotoxy, _mul20
|
||||
.importzp ptr4
|
||||
.import setcursor
|
||||
|
||||
@@ -75,8 +75,7 @@ putchar:
|
||||
pha ; save char
|
||||
|
||||
lda ROWCRS_5200
|
||||
jsr mul20 ; destroys tmp4
|
||||
clc
|
||||
jsr _mul20 ; destroys tmp4, carry is cleared
|
||||
adc SAVMSC ; add start of screen memory
|
||||
sta ptr4
|
||||
txa
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
;
|
||||
; Christian Groessler, April 2014
|
||||
;
|
||||
; mul20
|
||||
; multiplies A by 20 and returns result in AX
|
||||
; uses tmp4
|
||||
|
||||
.importzp tmp4
|
||||
.export mul20,loc_tmp
|
||||
|
||||
.proc mul20
|
||||
|
||||
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 ; val * 20
|
||||
ldx tmp4
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.bss
|
||||
loc_tmp:.res 1
|
||||
Reference in New Issue
Block a user