Optimized mul20 & mul40 and extracted to new library.

This commit is contained in:
IrgendwerA8
2019-03-21 15:59:45 +01:00
committed by Oliver Schmidt
parent fbf302e6cd
commit 399250a105
14 changed files with 216 additions and 92 deletions

View File

@@ -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

View File

@@ -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