From c3e9d4a9f8c95710da5672484df31a2ff2bf7fbf Mon Sep 17 00:00:00 2001 From: meisl Date: Sat, 10 Jul 2021 20:50:07 +0200 Subject: [PATCH] * make resources available in compilerAst/test s; *you may have to re-import the gradle project into IDEA* Note: these resources are NOT going into the production .jar --- compilerAst/build.gradle | 8 ++++---- compilerAst/compilerAst.iml | 1 + compilerAst/res/prog8lib/math.asm | 20 ++++++++++++++++++++ compilerAst/res/prog8lib/math.p8 | 7 +++++++ 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 compilerAst/res/prog8lib/math.asm create mode 100644 compilerAst/res/prog8lib/math.p8 diff --git a/compilerAst/build.gradle b/compilerAst/build.gradle index 78f7d8fd3..4fa87b242 100644 --- a/compilerAst/build.gradle +++ b/compilerAst/build.gradle @@ -45,15 +45,15 @@ sourceSets { main { java { srcDirs = ["${project.projectDir}/src"] - } - resources { - srcDirs = ["${project.projectDir}/res"] - } + } } test { java { srcDirs = ["${project.projectDir}/test"] } + resources { + srcDirs = ["${project.projectDir}/res"] + } } } diff --git a/compilerAst/compilerAst.iml b/compilerAst/compilerAst.iml index 240433064..24edf66c1 100644 --- a/compilerAst/compilerAst.iml +++ b/compilerAst/compilerAst.iml @@ -3,6 +3,7 @@ + diff --git a/compilerAst/res/prog8lib/math.asm b/compilerAst/res/prog8lib/math.asm new file mode 100644 index 000000000..2638821fb --- /dev/null +++ b/compilerAst/res/prog8lib/math.asm @@ -0,0 +1,20 @@ +; just for tests - DISFUNCTIONAL! + + +math_store_reg .byte 0 ; temporary storage + + +multiply_bytes .proc + ; -- multiply 2 bytes A and Y, result as byte in A (signed or unsigned) + sta P8ZP_SCRATCH_B1 ; num1 + sty P8ZP_SCRATCH_REG ; num2 + lda #0 + beq _enterloop +_doAdd clc + adc P8ZP_SCRATCH_B1 +_loop asl P8ZP_SCRATCH_B1 +_enterloop lsr P8ZP_SCRATCH_REG + bcs _doAdd + bne _loop + rts + .pend diff --git a/compilerAst/res/prog8lib/math.p8 b/compilerAst/res/prog8lib/math.p8 new file mode 100644 index 000000000..234079159 --- /dev/null +++ b/compilerAst/res/prog8lib/math.p8 @@ -0,0 +1,7 @@ +; Internal Math library routines - always included by the compiler +; +; Written by Irmen de Jong (irmen@razorvine.net) - license: GNU GPL 3.0 + +math { + %asminclude "library:math.asm" +}