1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-28 01:29:44 +00:00

Fixed problem where Variable used inside ASM is optimized to a constant.

Now variables used inside ASM are made volatile before the early const pass.
Closes #618
This commit is contained in:
jespergravgaard 2021-01-17 12:59:41 +01:00
parent 3bed5e1aee
commit 6366d1a9fa
91 changed files with 7857 additions and 6301 deletions

View File

@ -48,14 +48,14 @@
<directory>src/test/kc/examples</directory>
<outputDirectory>examples</outputDirectory>
<includes>
<include>*/*.c</include>
<include>*/*.h</include>
<include>*/*.asm</include>
<include>*/*.ld</include>
<include>*/*.png</include>
<include>*/*.sid</include>
<include>*/*.bin</include>
<include>*/*.prg</include>
<include>**/*.c</include>
<include>**/*.h</include>
<include>**/*.asm</include>
<include>**/*.ld</include>
<include>**/*.png</include>
<include>**/*.sid</include>
<include>**/*.bin</include>
<include>**/*.prg</include>
</includes>
</fileSet>
<fileSet>

View File

@ -251,6 +251,7 @@ public class Compiler {
}
new Pass1AddressOfHandling(program).execute();
new Pass1AsmUsesHandling(program).execute();
new Pass1FixLValuesLoHi(program).execute();
new Pass1AssertNoLValueIntermediate(program).execute();
new PassNAddTypeConversionAssignment(program, true).execute();
@ -282,7 +283,6 @@ public class Compiler {
new PassNAddTypeConversionAssignment(program, true).execute();
new Pass1EarlyConstantIdentification(program).execute();
new Pass1AsmUsesHandling(program).execute();
new PassNAssertConstantModification(program).execute();
new PassNAssertTypeDeref(program).check();

View File

@ -32,14 +32,14 @@
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
void memoryRemap(unsigned char remapBlocks, unsigned int lowerPageOffset, unsigned int upperPageOffset) {
char * aVal = 0xfc;
char * xVal = 0xfd;
char * yVal = 0xfe;
char * zVal = 0xff;
*aVal = <lowerPageOffset;
*xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf);
*yVal = <upperPageOffset;
*zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf);
// lower blocks offset page low
char aVal = <lowerPageOffset;
// lower blocks to map + lower blocks offset high nibble
char xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf);
// upper blocks offset page
char yVal = <upperPageOffset;
// upper blocks to map + upper blocks offset page high nibble
char zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf);
asm {
lda aVal // lower blocks offset page low
ldx xVal // lower blocks to map + lower blocks offset high nibble
@ -90,18 +90,18 @@ void memoryRemapBlock(unsigned char blockPage, unsigned int memoryPage) {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
void memoryRemap256M(unsigned char remapBlocks, unsigned long lowerPageOffset, unsigned long upperPageOffset) {
char * lMb = 0xfa;
char * uMb = 0xfb;
char * aVal = 0xfc;
char * xVal = 0xfd;
char * yVal = 0xfe;
char * zVal = 0xff;
*lMb = >((unsigned int)(lowerPageOffset>>4));
*uMb = >((unsigned int)(upperPageOffset>>4));
*aVal = < <lowerPageOffset;
*xVal = (remapBlocks << 4) | (> <lowerPageOffset & 0xf);
*yVal = < <upperPageOffset;
*zVal = (remapBlocks & 0xf0) | (> <upperPageOffset & 0xf);
// lower blocks offset megabytes
char lMb = >((unsigned int)(lowerPageOffset>>4));
// upper blocks offset megabytes
char uMb = >((unsigned int)(upperPageOffset>>4));
// lower blocks offset page low
char aVal = < <lowerPageOffset;
// lower blocks to map + lower blocks offset high nibble
char xVal = (remapBlocks << 4) | (> <lowerPageOffset & 0xf);
// upper blocks offset page
char yVal = < <upperPageOffset;
// upper blocks to map + upper blocks offset page high nibble
char zVal = (remapBlocks & 0xf0) | (> <upperPageOffset & 0xf);
asm {
lda lMb // lower blocks offset megabytes
ldx #$0f // lower signal for MB offset

View File

@ -1451,11 +1451,6 @@ public class TestPrograms {
compileAndCompare("parse-negated-struct-ref.c");
}
@Test
public void testLongPointer1() throws IOException, URISyntaxException {
compileAndCompare("long-pointer-1.c");
}
@Test
public void testLongPointer0() throws IOException, URISyntaxException {
compileAndCompare("long-pointer-0.c");
@ -1566,6 +1561,11 @@ public class TestPrograms {
assertError("cast-error.c", "Type mismatch");
}
@Test
public void testInlineAsmUses1() throws IOException, URISyntaxException {
compileAndCompare("inline-asm-uses-1.c");
}
@Test
public void testInlineAsmMaVar() throws IOException, URISyntaxException {
compileAndCompare("inline-asm-ma-var.c");

View File

@ -67,7 +67,7 @@ void move16Left(uint8_t *p) {
*(p + 3) = t;
}
void rotateLeft(__ma uint8_t *p, __ma uint8_t r) {
void rotateLeft(uint8_t * const p, uint8_t r) {
kickasm(
clobbers "AX",
uses p,

View File

@ -6,18 +6,18 @@
#include <print.h>
// The rotated point - updated by calling rotate_matrix()
signed char* xr = $f0;
signed char* yr = $f1;
signed char* zr = $f2;
signed char xr;
signed char yr;
signed char zr;
// The rotated point with perspective
signed char* pp = $f3;
signed char* xp = $f4;
signed char* yp = $f5;
signed char pp;
signed char xp;
signed char yp;
// Pointers used to multiply perspective (d/z0-z) onto x- & y-coordinates. Points into mulf_sqr1 / mulf_sqr2
unsigned int* psp1 = $f6;
unsigned int* psp2 = $f8;
unsigned int psp1;
unsigned int psp2;
char* SCREEN = $400;
@ -25,8 +25,8 @@ void main() {
asm { sei }
sprites_init();
//mulf_init();
*psp1 = (unsigned int)mulf_sqr1;
*psp2 = (unsigned int)mulf_sqr2;
psp1 = (unsigned int)mulf_sqr1;
psp2 = (unsigned int)mulf_sqr2;
debug_print_init();
@ -65,15 +65,15 @@ void anim() {
for(char i: 0..7) {
(VICII->BORDER_COLOR)++;
rotate_matrix(xs[i], ys[i], zs[i]);
xrs[i] = *xr;
yrs[i] = *yr;
zrs[i] = *zr;
pps[i] = *pp;
xps[i] = *xp;
yps[i] = *yp;
xrs[i] = xr;
yrs[i] = yr;
zrs[i] = zr;
pps[i] = pp;
xps[i] = xp;
yps[i] = yp;
char i2 = i*2;
SPRITES_XPOS[i2] = $80+(char)((*xp));
SPRITES_YPOS[i2] = $80+(char)((*yp));
SPRITES_XPOS[i2] = $80+(char)(xp);
SPRITES_YPOS[i2] = $80+(char)(yp);
}
VICII->BORDER_COLOR = LIGHT_GREY;
debug_print();
@ -295,9 +295,9 @@ void store_matrix() {
// The passed points must be in the interval [-$3f;$3f].
// Implemented in assembler to utilize seriously fast multiplication
void rotate_matrix(signed char x, signed char y, signed char z) {
*xr = x;
*yr = y;
*zr = z;
xr = x;
yr = y;
zr = z;
asm {
ldx zr //z
// C*z

View File

@ -6,19 +6,19 @@
#include <print.h>
// The rotated point - updated by calling rotate()
signed char* xr = $f0;
signed char* yr = $f1;
signed char* zr = $f2;
signed char xr;
signed char yr;
signed char zr;
// Pointers used to multiply perspective (d/z0-z) onto x- & y-coordinates. Points into mulf_sqr1 / mulf_sqr2.
unsigned int* psp1 = $f3;
unsigned int* psp2 = $f5;
unsigned int psp1;
unsigned int psp2;
void main() {
asm { sei }
mulf_init();
*psp1 = (unsigned int)mulf_sqr1;
*psp2 = (unsigned int)mulf_sqr2;
psp1 = (unsigned int)mulf_sqr1;
psp2 = (unsigned int)mulf_sqr2;
print_cls();
do_perspective($39, -$47, $36);
/*
@ -45,9 +45,9 @@ void do_perspective(signed char x, signed char y, signed char z) {
print_schar(z);
print_str(") -> (");
perspective(x, y, z);
print_uchar((byte)*xr);
print_uchar((char)xr);
print_str(",");
print_uchar((byte)*yr);
print_uchar((char)yr);
print_str(")");
print_ln();
}
@ -56,9 +56,9 @@ void do_perspective(signed char x, signed char y, signed char z) {
// Apply perspective to a 3d-point. Result is returned in (*xr,*yr)
// Implemented in assembler to utilize seriously fast multiplication
void perspective(signed char x, signed char y, signed char z) {
*xr = x;
*yr = y;
*zr = z;
xr = x;
yr = y;
zr = z;
asm {
// Update index in perspective lookup

View File

@ -47,26 +47,20 @@ void init_screen() {
}
// Pointers to a, b and c=a*b
signed char* ap = $fd;
signed char* bp = $fe;
signed char* cp = $ff;
signed char fmul8(signed char a, signed char b) {
*ap = a;
*bp = b;
signed char fmul8(signed char aa, signed char bb) {
signed char cc;
asm {
lda ap
lda aa
sta A1+1
eor #$ff
sta A2+1
ldx bp
ldx bb
sec
A1: lda mulf_sqr1,x
A2: sbc mulf_sqr2,x
sta cp
sta cc
}
return *cp;
return cc;
}
// mulf_sqr tables will contain f(x)=int(x*x) and g(x) = f(1-x).

View File

@ -47,18 +47,16 @@ void main() {
char loadFileToMemory( char device, char* filename, char* address) {
setnam(filename);
setlfs(device);
return load(address, false);
return load(address, 0);
}
// Basic ERROR function
// ERROR. Show error.
void error(char err) {
char* const errCode = 0xff;
*errCode = err;
asm {
// Basic SHOWERR function
// Input: X = Error Code
ldx errCode
ldx err
jsr $a437
}
}
@ -66,57 +64,50 @@ void error(char err) {
// Kernal SETNAM function
// SETNAM. Set file name parameters.
void setnam(char* filename) {
char* const filename_len = 0xfd;
char** const filename_ptr = 0xfe;
*filename_len = (char)strlen(filename);
*filename_ptr = filename;
char filename_len = (char)strlen(filename);
asm {
// Kernal SETNAM function
// SETNAM. Set file name parameters.
// Input: A = File name length; X/Y = Pointer to file name.
lda filename_len
ldx filename_ptr
ldy filename_ptr+1
ldx filename
ldy filename+1
jsr $ffbd
}
}
// SETLFS. Set file parameters.
void setlfs(char device) {
char* const deviceNum = 0xff;
*deviceNum = device;
asm {
// SETLFS. Set file parameters.
// Input: A = Logical number; X = Device number; Y = Secondary address.
ldx deviceNum
ldx device
lda #1
ldy #0
jsr $ffba
}
}
//LOAD. Load or verify file. (Must call SETLFS and SETNAM beforehands.)
// LOAD. Load or verify file. (Must call SETLFS and SETNAM beforehands.)
// - verify: 0 = Load, 1-255 = Verify
//
// Returns a status, 0xff: Success other: Kernal Error Code
char load(char* address, bool verify) {
char* loadOrVerify = 0xfd;
char** loadAddress = 0xfe;
char* status = 0xfd;
*loadOrVerify = (char)verify;
*loadAddress = address;
char load(char* address, char verify) {
char status;
asm {
//LOAD. Load or verify file. (Must call SETLFS and SETNAM beforehands.)
// Input: A: 0 = Load, 1-255 = Verify; X/Y = Load address (if secondary address = 0).
// Output: Carry: 0 = No errors, 1 = Error; A = KERNAL error code (if Carry = 1); X/Y = Address of last byte loaded/verified (if Carry = 0).
ldx loadAddress
ldy loadAddress+1
lda loadOrVerify
ldx address
ldy address+1
lda verify
jsr $ffd5
bcs error
lda #$ff
error:
sta status
}
return *status;
return status;
}

View File

@ -1,4 +1,4 @@
byte* SCREEN = $0400;
byte* const SCREEN = $0400;
void main() {
byte a = 'a';

View File

@ -0,0 +1,25 @@
// Demonstrates inline ASM using a variable (res)
void main() {
char * const SCREEN = 0x1009;
char x = fgetc(7);
*SCREEN = x;
}
char * const CHKIN = 0x1000;
char * const GETIN = 0x1003;
char * const CLRCHN = 0x1006;
char fgetc(byte channel)
{
char ret;
asm {
ldx channel
jsr CHKIN
jsr GETIN
sta ret
jsr CLRCHN
}
return ret;
}

View File

@ -1,5 +1,5 @@
// Tests that inline kickasm supports the clobbering directive
byte* SCREEN = $0400;
byte* const SCREEN = $0400;
void main() {
for(byte k : 0..10) {
for(byte l: 0..10) {

View File

@ -1,7 +1,7 @@
// Tests creating a long (32bit) pointer on zeropage for 45GS02 flat memory access
void main() {
unsigned long long_ptr = 0x12345678;
char long_ptr_zp = <&long_ptr;
__zp unsigned long long_ptr = 0x12345678;
const char long_ptr_zp = (char)&long_ptr;
asm {
nop
lda (long_ptr_zp),y

View File

@ -1,10 +0,0 @@
// Tests creating a long (32bit) pointer on zeropage for 45GS02 flat memory access
void main() {
unsigned long long_ptr = 0x12345678;
__zp char long_ptr_zp = (char)&long_ptr;
asm {
nop
lda (long_ptr_zp),y
sta $ff
}
}

View File

@ -780,7 +780,7 @@ move16Left::@return: scope:[move16Left] from move16Left
[373] return
to:@return
void rotateLeft(volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
void rotateLeft(nomodify volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
rotateLeft: scope:[rotateLeft] from leftRotate::@1 leftRotate::@10 leftRotate::@11
kickasm( uses rotateLeft::p uses rotateLeft::r) {{ ldx #r
!s:

View File

@ -13,13 +13,6 @@ Setting inferred volatile on symbol affected by address-of cputc::$4 = call conv
Setting inferred volatile on symbol affected by address-of print32::dp = (byte*)&print32::l
Setting inferred volatile on symbol affected by address-of leftRotate::p = (byte*)&leftRotate::a
Setting inferred volatile on symbol affected by address-of md5::$10 = call memcpy md5::$9 &md5::bits_len 4
Added struct type cast to parameter value list call printf_uchar print32::dp[0] (struct printf_format_number){ 2, 0, 0, 1, 0, HEXADECIMAL }
Added struct type cast to parameter value list call printf_uchar print32::dp[1] (struct printf_format_number){ 2, 0, 0, 1, 0, HEXADECIMAL }
Added struct type cast to parameter value list call printf_uchar print32::dp[2] (struct printf_format_number){ 2, 0, 0, 1, 0, HEXADECIMAL }
Added struct type cast to parameter value list call printf_uchar print32::dp[3] (struct printf_format_number){ 2, 0, 0, 1, 0, HEXADECIMAL }
Added struct type cast to parameter value list call printf_uchar md5::i (struct printf_format_number){ 2, 0, 0, 0, 0, HEXADECIMAL }
Added struct type cast to parameter value list call printf_uchar md5::g (struct printf_format_number){ 2, 0, 0, 0, 0, HEXADECIMAL }
Added struct type cast to parameter value list call printf_uchar md5::r[md5::i] (struct printf_format_number){ 2, 0, 0, 0, 0, HEXADECIMAL }
Setting inferred volatile on symbol affected by address-of: rotateLeft::p in kickasm( uses rotateLeft::p uses rotateLeft::r) {{ ldx #r
!s:
asl p+3
@ -46,6 +39,13 @@ Setting inferred volatile on symbol affected by address-of: rotateLeft::r in kic
dex
bne !s-
}}
Added struct type cast to parameter value list call printf_uchar print32::dp[0] (struct printf_format_number){ 2, 0, 0, 1, 0, HEXADECIMAL }
Added struct type cast to parameter value list call printf_uchar print32::dp[1] (struct printf_format_number){ 2, 0, 0, 1, 0, HEXADECIMAL }
Added struct type cast to parameter value list call printf_uchar print32::dp[2] (struct printf_format_number){ 2, 0, 0, 1, 0, HEXADECIMAL }
Added struct type cast to parameter value list call printf_uchar print32::dp[3] (struct printf_format_number){ 2, 0, 0, 1, 0, HEXADECIMAL }
Added struct type cast to parameter value list call printf_uchar md5::i (struct printf_format_number){ 2, 0, 0, 0, 0, HEXADECIMAL }
Added struct type cast to parameter value list call printf_uchar md5::g (struct printf_format_number){ 2, 0, 0, 0, 0, HEXADECIMAL }
Added struct type cast to parameter value list call printf_uchar md5::r[md5::i] (struct printf_format_number){ 2, 0, 0, 0, 0, HEXADECIMAL }
Inlined call cputc::$4 = call convertToScreenCode &cputc::c
Inlined call call BREAK
Inlined call call BREAK
@ -1224,7 +1224,7 @@ move16Left::@return: scope:[move16Left] from move16Left
return
to:@return
void rotateLeft(volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
void rotateLeft(nomodify volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
rotateLeft: scope:[rotateLeft] from leftRotate::@1 leftRotate::@12 leftRotate::@15
kickasm( uses rotateLeft::p uses rotateLeft::r) {{ ldx #r
!s:
@ -4370,8 +4370,8 @@ const byte* rawmap[$100] = kickasm {{ .var ht = Hashtable().put(0,64, 1,0, 2,32
.byte mask | ht.get(idx)
}
}}
void rotateLeft(volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
volatile byte* rotateLeft::p loadstore
void rotateLeft(nomodify volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
nomodify volatile byte* rotateLeft::p loadstore
volatile byte rotateLeft::r loadstore
void setcursor()
byte*~ setcursor::$0
@ -7184,7 +7184,7 @@ move16Left::@return: scope:[move16Left] from move16Left
[373] return
to:@return
void rotateLeft(volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
void rotateLeft(nomodify volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
rotateLeft: scope:[rotateLeft] from leftRotate::@1 leftRotate::@10 leftRotate::@11
kickasm( uses rotateLeft::p uses rotateLeft::r) {{ ldx #r
!s:
@ -7764,8 +7764,8 @@ byte* putchar::loc
byte* putchar::loc#0 1.000000000001E12
byte putchar::newChar
byte putchar::newChar#0 1.5000000000015E12
void rotateLeft(volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
volatile byte* rotateLeft::p loadstore 5000.5
void rotateLeft(nomodify volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
nomodify volatile byte* rotateLeft::p loadstore 5000.5
volatile byte rotateLeft::r loadstore 10001.0
void setcursor()
byte setcursor::c
@ -12487,8 +12487,8 @@ const byte* rawmap[$100] = kickasm {{ .var ht = Hashtable().put(0,64, 1,0, 2,32
.byte mask | ht.get(idx)
}
}}
void rotateLeft(volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
volatile byte* rotateLeft::p loadstore zp[2]:213 5000.5
void rotateLeft(nomodify volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
nomodify volatile byte* rotateLeft::p loadstore zp[2]:213 5000.5
volatile byte rotateLeft::r loadstore zp[1]:215 10001.0
void setcursor()
byte setcursor::c

View File

@ -327,8 +327,8 @@ const byte* rawmap[$100] = kickasm {{ .var ht = Hashtable().put(0,64, 1,0, 2,32
.byte mask | ht.get(idx)
}
}}
void rotateLeft(volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
volatile byte* rotateLeft::p loadstore zp[2]:213 5000.5
void rotateLeft(nomodify volatile byte* rotateLeft::p , volatile byte rotateLeft::r)
nomodify volatile byte* rotateLeft::p loadstore zp[2]:213 5000.5
volatile byte rotateLeft::r loadstore zp[1]:215 10001.0
void setcursor()
byte setcursor::c

View File

@ -12,7 +12,7 @@
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
:BasicUpstart(__start)
.const GREEN = 5
.const LIGHT_BLUE = $e
.const LIGHT_GREY = $f
@ -25,40 +25,63 @@
.label SPRITES_COLOR = $d027
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The rotated point - updated by calling rotate_matrix()
.label xr = $f0
.label yr = $f1
.label zr = $f2
// The rotated point with perspective
.label pp = $f3
.label xp = $f4
.label yp = $f5
// Pointers used to multiply perspective (d/z0-z) onto x- & y-coordinates. Points into mulf_sqr1 / mulf_sqr2
.label psp1 = $f6
.label psp2 = $f8
.label SCREEN = $400
.label COSH = SINH+$40
.label COSQ = SINQ+$40
.label print_screen = $400
// The rotated point - updated by calling rotate_matrix()
.label xr = 5
.label yr = 6
.label zr = 7
// The rotated point with perspective
.label pp = 8
.label xp = 9
.label yp = $a
// Pointers used to multiply perspective (d/z0-z) onto x- & y-coordinates. Points into mulf_sqr1 / mulf_sqr2
.label psp1 = $b
.label psp2 = $d
.label sx = 2
.label sy = 3
.segment Code
__start: {
// xr
lda #0
sta.z xr
// yr
sta.z yr
// zr
sta.z zr
// pp
sta.z pp
// xp
sta.z xp
// yp
sta.z yp
// psp1
sta.z psp1
sta.z psp1+1
// psp2
sta.z psp2
sta.z psp2+1
jsr main
rts
}
main: {
// asm
sei
// sprites_init()
jsr sprites_init
// *psp1 = (unsigned int)mulf_sqr1
// psp1 = (unsigned int)mulf_sqr1
//mulf_init();
lda #<mulf_sqr1
sta psp1
sta.z psp1
lda #>mulf_sqr1
sta psp1+1
// *psp2 = (unsigned int)mulf_sqr2
sta.z psp1+1
// psp2 = (unsigned int)mulf_sqr2
lda #<mulf_sqr2
sta psp2
sta.z psp2
lda #>mulf_sqr2
sta psp2+1
sta.z psp2+1
// debug_print_init()
jsr debug_print_init
// anim()
@ -93,15 +116,15 @@ debug_print_init: {
.label COLS = $d800
.label at_line = SCREEN+$10*$28
.label at_cols = COLS+$10*$28
.label __41 = 5
.label __44 = 7
.label __47 = 9
.label __50 = $b
.label __53 = $d
.label __56 = $f
.label __59 = $11
.label __62 = $13
.label __65 = $15
.label __41 = $f
.label __44 = $11
.label __47 = $13
.label __50 = $15
.label __53 = $17
.label __56 = $19
.label __59 = $1b
.label __62 = $1d
.label __65 = $1f
.label c = 2
.label i = 3
// print_cls()
@ -458,40 +481,40 @@ anim: {
lda zs,y
sta.z rotate_matrix.z
jsr rotate_matrix
// xrs[i] = *xr
lda xr
// xrs[i] = xr
lda.z xr
ldy.z i
sta xrs,y
// yrs[i] = *yr
lda yr
// yrs[i] = yr
lda.z yr
sta yrs,y
// zrs[i] = *zr
lda zr
// zrs[i] = zr
lda.z zr
sta zrs,y
// pps[i] = *pp
lda pp
// pps[i] = pp
lda.z pp
sta pps,y
// xps[i] = *xp
lda xp
// xps[i] = xp
lda.z xp
sta xps,y
// yps[i] = *yp
lda yp
// yps[i] = yp
lda.z yp
sta yps,y
// i2 = i*2
tya
asl
tax
// $80+(char)((*xp))
lda #$80
// $80+(char)(xp)
lda.z xp
clc
adc xp
// SPRITES_XPOS[i2] = $80+(char)((*xp))
adc #$80
// SPRITES_XPOS[i2] = $80+(char)(xp)
sta SPRITES_XPOS,x
// $80+(char)((*yp))
lda #$80
// $80+(char)(yp)
lda.z yp
clc
adc yp
// SPRITES_YPOS[i2] = $80+(char)((*yp))
adc #$80
// SPRITES_YPOS[i2] = $80+(char)(yp)
sta SPRITES_YPOS,x
// for(char i: 0..7)
inc.z i
@ -524,10 +547,10 @@ print_cls: {
rts
}
// Print a string at a specific screen position
// print_str_at(byte* zp(5) str, byte* zp(7) at)
// print_str_at(byte* zp($f) str, byte* zp($11) at)
print_str_at: {
.label at = 7
.label str = 5
.label at = $11
.label str = $f
__b1:
// while(*str)
ldy #0
@ -553,10 +576,10 @@ print_str_at: {
jmp __b1
}
// Print a signed char as hex at a specific screen position
// print_schar_at(signed byte zp($18) b, byte* zp(5) at)
// print_schar_at(signed byte zp($22) b, byte* zp($f) at)
print_schar_at: {
.label b = $18
.label at = 5
.label b = $22
.label at = $f
// if(b<0)
lda.z b
bmi __b1
@ -590,15 +613,15 @@ print_schar_at: {
// calculate_matrix(signed byte register(X) sx, signed byte zp(3) sy)
calculate_matrix: {
.label sy = 3
.label t1 = $17
.label t2 = $18
.label t3 = $19
.label t4 = $1a
.label t5 = $1b
.label t6 = $1c
.label t7 = $1d
.label t8 = $1e
.label t9 = $1f
.label t1 = $21
.label t2 = $22
.label t3 = $23
.label t4 = $24
.label t5 = $25
.label t6 = $26
.label t7 = $27
.label t8 = $28
.label t9 = $29
// t1 = sy-sz
lda.z sy
sta.z t1
@ -825,18 +848,18 @@ store_matrix: {
// The rotation matrix is prepared by calling prepare_matrix()
// The passed points must be in the interval [-$3f;$3f].
// Implemented in assembler to utilize seriously fast multiplication
// rotate_matrix(signed byte register(X) x, signed byte zp($18) y, signed byte zp($19) z)
// rotate_matrix(signed byte register(X) x, signed byte zp($22) y, signed byte zp($23) z)
rotate_matrix: {
.label y = $18
.label z = $19
// *xr = x
stx xr
// *yr = y
.label y = $22
.label z = $23
// xr = x
stx.z xr
// yr = y
lda.z y
sta yr
// *zr = z
sta.z yr
// zr = z
lda.z z
sta zr
sta.z zr
// asm
tax
C1:
@ -952,8 +975,8 @@ debug_print: {
.const print_schar_pos12_row = 6
.const print_schar_pos12_col = $25
.label at_line = SCREEN+$13*$28
.label c = $19
.label i = $17
.label c = $23
.label i = $21
// print_schar_pos(sx, 0, 37)
lda.z sx
// print_schar_at(sb, print_screen+row*40+col)
@ -1158,7 +1181,7 @@ memset: {
.const num = $3e8
.label str = print_screen
.label end = str+num
.label dst = 7
.label dst = $11
lda #<str
sta.z dst
lda #>str
@ -1186,9 +1209,9 @@ memset: {
jmp __b1
}
// Print a single char
// print_char_at(byte register(X) ch, byte* zp(5) at)
// print_char_at(byte register(X) ch, byte* zp($f) at)
print_char_at: {
.label at = 5
.label at = $f
// *(at) = ch
txa
ldy #0
@ -1197,10 +1220,10 @@ print_char_at: {
rts
}
// Print a char as HEX at a specific position
// print_uchar_at(byte zp($18) b, byte* zp(5) at)
// print_uchar_at(byte zp($22) b, byte* zp($f) at)
print_uchar_at: {
.label b = $18
.label at = 5
.label b = $22
.label at = $f
// b>>4
lda.z b
lsr

View File

@ -1,304 +1,328 @@
void __start()
__start: scope:[__start] from
[0] phi()
to:__start::__init1
__start::__init1: scope:[__start] from __start
[1] xr = 0
[2] yr = 0
[3] zr = 0
[4] pp = 0
[5] xp = 0
[6] yp = 0
[7] psp1 = 0
[8] psp2 = 0
to:__start::@1
__start::@1: scope:[__start] from __start::__init1
[9] phi()
[10] call main
to:__start::@return
__start::@return: scope:[__start] from __start::@1
[11] return
to:@return
void main()
main: scope:[main] from
main: scope:[main] from __start::@1
asm { sei }
[1] call sprites_init
[13] call sprites_init
to:main::@1
main::@1: scope:[main] from main
[2] *psp1 = (word)mulf_sqr1
[3] *psp2 = (word)mulf_sqr2
[4] call debug_print_init
[14] psp1 = (word)mulf_sqr1
[15] psp2 = (word)mulf_sqr2
[16] call debug_print_init
to:main::@2
main::@2: scope:[main] from main::@1
[5] phi()
[6] call anim
[17] phi()
[18] call anim
to:main::@return
main::@return: scope:[main] from main::@2
[7] return
[19] return
to:@return
void sprites_init()
sprites_init: scope:[sprites_init] from main
[8] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = $ff
[20] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) = $ff
to:sprites_init::@1
sprites_init::@1: scope:[sprites_init] from sprites_init sprites_init::@1
[9] sprites_init::i#2 = phi( sprites_init/0, sprites_init::@1/sprites_init::i#1 )
[10] sprites_init::sprites_ptr#0[sprites_init::i#2] = (byte)SPRITE/$40
[11] SPRITES_COLOR[sprites_init::i#2] = GREEN
[12] sprites_init::i#1 = ++ sprites_init::i#2
[13] if(sprites_init::i#1!=8) goto sprites_init::@1
[21] sprites_init::i#2 = phi( sprites_init/0, sprites_init::@1/sprites_init::i#1 )
[22] sprites_init::sprites_ptr#0[sprites_init::i#2] = (byte)SPRITE/$40
[23] SPRITES_COLOR[sprites_init::i#2] = GREEN
[24] sprites_init::i#1 = ++ sprites_init::i#2
[25] if(sprites_init::i#1!=8) goto sprites_init::@1
to:sprites_init::@return
sprites_init::@return: scope:[sprites_init] from sprites_init::@1
[14] return
[26] return
to:@return
void debug_print_init()
debug_print_init: scope:[debug_print_init] from main::@1
[15] phi()
[16] call print_cls
[27] phi()
[28] call print_cls
to:debug_print_init::@4
debug_print_init::@4: scope:[debug_print_init] from debug_print_init
[17] phi()
[18] call print_str_at
to:debug_print_init::@5
debug_print_init::@5: scope:[debug_print_init] from debug_print_init::@4
[19] phi()
[20] call print_str_at
to:debug_print_init::@6
debug_print_init::@6: scope:[debug_print_init] from debug_print_init::@5
[21] phi()
[22] call print_str_at
to:debug_print_init::@7
debug_print_init::@7: scope:[debug_print_init] from debug_print_init::@6
[23] phi()
[24] call print_str_at
to:debug_print_init::@8
debug_print_init::@8: scope:[debug_print_init] from debug_print_init::@7
[25] phi()
[26] call print_str_at
to:debug_print_init::@9
debug_print_init::@9: scope:[debug_print_init] from debug_print_init::@8
[27] phi()
[28] call print_str_at
to:debug_print_init::@10
debug_print_init::@10: scope:[debug_print_init] from debug_print_init::@9
[29] phi()
[30] call print_str_at
to:debug_print_init::@11
debug_print_init::@11: scope:[debug_print_init] from debug_print_init::@10
to:debug_print_init::@5
debug_print_init::@5: scope:[debug_print_init] from debug_print_init::@4
[31] phi()
[32] call print_str_at
to:debug_print_init::@12
debug_print_init::@12: scope:[debug_print_init] from debug_print_init::@11
to:debug_print_init::@6
debug_print_init::@6: scope:[debug_print_init] from debug_print_init::@5
[33] phi()
[34] call print_str_at
to:debug_print_init::@13
debug_print_init::@13: scope:[debug_print_init] from debug_print_init::@12
to:debug_print_init::@7
debug_print_init::@7: scope:[debug_print_init] from debug_print_init::@6
[35] phi()
[36] call print_str_at
to:debug_print_init::@14
debug_print_init::@14: scope:[debug_print_init] from debug_print_init::@13
to:debug_print_init::@8
debug_print_init::@8: scope:[debug_print_init] from debug_print_init::@7
[37] phi()
[38] call print_str_at
to:debug_print_init::@15
debug_print_init::@15: scope:[debug_print_init] from debug_print_init::@14
to:debug_print_init::@9
debug_print_init::@9: scope:[debug_print_init] from debug_print_init::@8
[39] phi()
[40] call print_str_at
to:debug_print_init::@10
debug_print_init::@10: scope:[debug_print_init] from debug_print_init::@9
[41] phi()
[42] call print_str_at
to:debug_print_init::@11
debug_print_init::@11: scope:[debug_print_init] from debug_print_init::@10
[43] phi()
[44] call print_str_at
to:debug_print_init::@12
debug_print_init::@12: scope:[debug_print_init] from debug_print_init::@11
[45] phi()
[46] call print_str_at
to:debug_print_init::@13
debug_print_init::@13: scope:[debug_print_init] from debug_print_init::@12
[47] phi()
[48] call print_str_at
to:debug_print_init::@14
debug_print_init::@14: scope:[debug_print_init] from debug_print_init::@13
[49] phi()
[50] call print_str_at
to:debug_print_init::@15
debug_print_init::@15: scope:[debug_print_init] from debug_print_init::@14
[51] phi()
[52] call print_str_at
to:debug_print_init::@1
debug_print_init::@1: scope:[debug_print_init] from debug_print_init::@15 debug_print_init::@3
[41] debug_print_init::i#2 = phi( debug_print_init::@15/0, debug_print_init::@3/debug_print_init::i#1 )
[41] debug_print_init::c#2 = phi( debug_print_init::@15/4, debug_print_init::@3/debug_print_init::c#1 )
[42] print_schar_at::at#0 = debug_print_init::at_line#0 + debug_print_init::c#2
[43] print_schar_at::b#1 = xs[debug_print_init::i#2]
[44] call print_schar_at
[53] debug_print_init::i#2 = phi( debug_print_init::@15/0, debug_print_init::@3/debug_print_init::i#1 )
[53] debug_print_init::c#2 = phi( debug_print_init::@15/4, debug_print_init::@3/debug_print_init::c#1 )
[54] print_schar_at::at#0 = debug_print_init::at_line#0 + debug_print_init::c#2
[55] print_schar_at::b#1 = xs[debug_print_init::i#2]
[56] call print_schar_at
to:debug_print_init::@16
debug_print_init::@16: scope:[debug_print_init] from debug_print_init::@1
[45] print_schar_at::at#1 = debug_print_init::at_line#0+$28*1 + debug_print_init::c#2
[46] print_schar_at::b#2 = ys[debug_print_init::i#2]
[47] call print_schar_at
[57] print_schar_at::at#1 = debug_print_init::at_line#0+$28*1 + debug_print_init::c#2
[58] print_schar_at::b#2 = ys[debug_print_init::i#2]
[59] call print_schar_at
to:debug_print_init::@17
debug_print_init::@17: scope:[debug_print_init] from debug_print_init::@16
[48] print_schar_at::at#2 = debug_print_init::at_line#0+$28*2 + debug_print_init::c#2
[49] print_schar_at::b#3 = zs[debug_print_init::i#2]
[50] call print_schar_at
[60] print_schar_at::at#2 = debug_print_init::at_line#0+$28*2 + debug_print_init::c#2
[61] print_schar_at::b#3 = zs[debug_print_init::i#2]
[62] call print_schar_at
to:debug_print_init::@2
debug_print_init::@2: scope:[debug_print_init] from debug_print_init::@17 debug_print_init::@2
[51] debug_print_init::j#2 = phi( debug_print_init::@17/0, debug_print_init::@2/debug_print_init::j#1 )
[52] debug_print_init::col#0 = 8 + debug_print_init::i#2
[53] debug_print_init::$41 = debug_print_init::at_cols#0 + debug_print_init::c#2
[54] debug_print_init::$41[debug_print_init::j#2] = debug_print_init::col#0
[55] debug_print_init::$44 = debug_print_init::at_cols#0+$28*1 + debug_print_init::c#2
[56] debug_print_init::$44[debug_print_init::j#2] = debug_print_init::col#0
[57] debug_print_init::$47 = debug_print_init::at_cols#0+$28*2 + debug_print_init::c#2
[58] debug_print_init::$47[debug_print_init::j#2] = debug_print_init::col#0
[59] debug_print_init::$50 = debug_print_init::at_cols#0+$28*3 + debug_print_init::c#2
[60] debug_print_init::$50[debug_print_init::j#2] = debug_print_init::col#0
[61] debug_print_init::$53 = debug_print_init::at_cols#0+$28*4 + debug_print_init::c#2
[62] debug_print_init::$53[debug_print_init::j#2] = debug_print_init::col#0
[63] debug_print_init::$56 = debug_print_init::at_cols#0+$28*5 + debug_print_init::c#2
[64] debug_print_init::$56[debug_print_init::j#2] = debug_print_init::col#0
[65] debug_print_init::$59 = debug_print_init::at_cols#0+$28*6 + debug_print_init::c#2
[66] debug_print_init::$59[debug_print_init::j#2] = debug_print_init::col#0
[67] debug_print_init::$62 = debug_print_init::at_cols#0+(word)$28*7 + debug_print_init::c#2
[68] debug_print_init::$62[debug_print_init::j#2] = debug_print_init::col#0
[69] debug_print_init::$65 = debug_print_init::at_cols#0+(word)$28*8 + debug_print_init::c#2
[70] debug_print_init::$65[debug_print_init::j#2] = debug_print_init::col#0
[71] debug_print_init::j#1 = ++ debug_print_init::j#2
[72] if(debug_print_init::j#1!=4) goto debug_print_init::@2
[63] debug_print_init::j#2 = phi( debug_print_init::@17/0, debug_print_init::@2/debug_print_init::j#1 )
[64] debug_print_init::col#0 = 8 + debug_print_init::i#2
[65] debug_print_init::$41 = debug_print_init::at_cols#0 + debug_print_init::c#2
[66] debug_print_init::$41[debug_print_init::j#2] = debug_print_init::col#0
[67] debug_print_init::$44 = debug_print_init::at_cols#0+$28*1 + debug_print_init::c#2
[68] debug_print_init::$44[debug_print_init::j#2] = debug_print_init::col#0
[69] debug_print_init::$47 = debug_print_init::at_cols#0+$28*2 + debug_print_init::c#2
[70] debug_print_init::$47[debug_print_init::j#2] = debug_print_init::col#0
[71] debug_print_init::$50 = debug_print_init::at_cols#0+$28*3 + debug_print_init::c#2
[72] debug_print_init::$50[debug_print_init::j#2] = debug_print_init::col#0
[73] debug_print_init::$53 = debug_print_init::at_cols#0+$28*4 + debug_print_init::c#2
[74] debug_print_init::$53[debug_print_init::j#2] = debug_print_init::col#0
[75] debug_print_init::$56 = debug_print_init::at_cols#0+$28*5 + debug_print_init::c#2
[76] debug_print_init::$56[debug_print_init::j#2] = debug_print_init::col#0
[77] debug_print_init::$59 = debug_print_init::at_cols#0+$28*6 + debug_print_init::c#2
[78] debug_print_init::$59[debug_print_init::j#2] = debug_print_init::col#0
[79] debug_print_init::$62 = debug_print_init::at_cols#0+(word)$28*7 + debug_print_init::c#2
[80] debug_print_init::$62[debug_print_init::j#2] = debug_print_init::col#0
[81] debug_print_init::$65 = debug_print_init::at_cols#0+(word)$28*8 + debug_print_init::c#2
[82] debug_print_init::$65[debug_print_init::j#2] = debug_print_init::col#0
[83] debug_print_init::j#1 = ++ debug_print_init::j#2
[84] if(debug_print_init::j#1!=4) goto debug_print_init::@2
to:debug_print_init::@3
debug_print_init::@3: scope:[debug_print_init] from debug_print_init::@2
[73] debug_print_init::c#1 = debug_print_init::c#2 + 4
[74] debug_print_init::i#1 = ++ debug_print_init::i#2
[75] if(debug_print_init::i#1!=8) goto debug_print_init::@1
[85] debug_print_init::c#1 = debug_print_init::c#2 + 4
[86] debug_print_init::i#1 = ++ debug_print_init::i#2
[87] if(debug_print_init::i#1!=8) goto debug_print_init::@1
to:debug_print_init::@return
debug_print_init::@return: scope:[debug_print_init] from debug_print_init::@3
[76] return
[88] return
to:@return
void anim()
anim: scope:[anim] from main::@2
[77] phi()
[89] phi()
to:anim::@1
anim::@1: scope:[anim] from anim anim::@10
[78] sy#11 = phi( anim/0, anim::@10/sy#2 )
[78] sx#11 = phi( anim/0, anim::@10/sx#2 )
[90] sy#11 = phi( anim/0, anim::@10/sy#2 )
[90] sx#11 = phi( anim/0, anim::@10/sx#2 )
to:anim::@2
anim::@2: scope:[anim] from anim::@1 anim::@2
[79] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$ff) goto anim::@2
[91] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$ff) goto anim::@2
to:anim::@3
anim::@3: scope:[anim] from anim::@2 anim::@3
[80] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fe) goto anim::@3
[92] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fe) goto anim::@3
to:anim::@4
anim::@4: scope:[anim] from anim::@3 anim::@4
[81] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fd) goto anim::@4
[93] if(*((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER)!=$fd) goto anim::@4
to:anim::@5
anim::@5: scope:[anim] from anim::@4
[82] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = ++ *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[83] calculate_matrix::sx#0 = sx#11
[84] calculate_matrix::sy#0 = sy#11
[85] call calculate_matrix
[94] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = ++ *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[95] calculate_matrix::sx#0 = sx#11
[96] calculate_matrix::sy#0 = sy#11
[97] call calculate_matrix
to:anim::@8
anim::@8: scope:[anim] from anim::@5
[86] phi()
[87] call store_matrix
[98] phi()
[99] call store_matrix
to:anim::@6
anim::@6: scope:[anim] from anim::@8 anim::@9
[88] anim::i#2 = phi( anim::@9/anim::i#1, anim::@8/0 )
[89] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = ++ *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[90] rotate_matrix::x#0 = xs[anim::i#2]
[91] rotate_matrix::y#0 = ys[anim::i#2]
[92] rotate_matrix::z#0 = zs[anim::i#2]
[93] call rotate_matrix
[100] anim::i#2 = phi( anim::@9/anim::i#1, anim::@8/0 )
[101] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = ++ *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[102] rotate_matrix::x#0 = xs[anim::i#2]
[103] rotate_matrix::y#0 = ys[anim::i#2]
[104] rotate_matrix::z#0 = zs[anim::i#2]
[105] call rotate_matrix
to:anim::@9
anim::@9: scope:[anim] from anim::@6
[94] xrs[anim::i#2] = *xr
[95] yrs[anim::i#2] = *yr
[96] zrs[anim::i#2] = *zr
[97] pps[anim::i#2] = *pp
[98] xps[anim::i#2] = *xp
[99] yps[anim::i#2] = *yp
[100] anim::i2#0 = anim::i#2 << 1
[101] anim::$9 = $80 + (byte)*xp
[102] SPRITES_XPOS[anim::i2#0] = anim::$9
[103] anim::$10 = $80 + (byte)*yp
[104] SPRITES_YPOS[anim::i2#0] = anim::$10
[105] anim::i#1 = ++ anim::i#2
[106] if(anim::i#1!=8) goto anim::@6
[106] xrs[anim::i#2] = xr
[107] yrs[anim::i#2] = yr
[108] zrs[anim::i#2] = zr
[109] pps[anim::i#2] = pp
[110] xps[anim::i#2] = xp
[111] yps[anim::i#2] = yp
[112] anim::i2#0 = anim::i#2 << 1
[113] anim::$13 = (byte)xp
[114] anim::$9 = $80 + anim::$13
[115] SPRITES_XPOS[anim::i2#0] = anim::$9
[116] anim::$14 = (byte)yp
[117] anim::$10 = $80 + anim::$14
[118] SPRITES_YPOS[anim::i2#0] = anim::$10
[119] anim::i#1 = ++ anim::i#2
[120] if(anim::i#1!=8) goto anim::@6
to:anim::@7
anim::@7: scope:[anim] from anim::@9
[107] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = LIGHT_GREY
[108] call debug_print
[121] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = LIGHT_GREY
[122] call debug_print
to:anim::@10
anim::@10: scope:[anim] from anim::@7
[109] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = LIGHT_BLUE
[110] sx#2 = sx#11 + 2
[111] sy#2 = sy#11 - 3
[123] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = LIGHT_BLUE
[124] sx#2 = sx#11 + 2
[125] sy#2 = sy#11 - 3
to:anim::@1
void print_cls()
print_cls: scope:[print_cls] from debug_print_init
[112] phi()
[113] call memset
[126] phi()
[127] call memset
to:print_cls::@return
print_cls::@return: scope:[print_cls] from print_cls
[114] return
[128] return
to:@return
void print_str_at(byte* print_str_at::str , byte* print_str_at::at)
print_str_at: scope:[print_str_at] from debug_print_init::@10 debug_print_init::@11 debug_print_init::@12 debug_print_init::@13 debug_print_init::@14 debug_print_init::@15 debug_print_init::@4 debug_print_init::@5 debug_print_init::@6 debug_print_init::@7 debug_print_init::@8 debug_print_init::@9
[115] print_str_at::at#15 = phi( debug_print_init::@10/SCREEN+(word)$28*$13, debug_print_init::@11/SCREEN+(word)$28*$14, debug_print_init::@12/SCREEN+(word)$28*$15, debug_print_init::@13/SCREEN+(word)$28*$16, debug_print_init::@14/SCREEN+(word)$28*$17, debug_print_init::@15/SCREEN+(word)$28*$18, debug_print_init::@4/SCREEN+$22, debug_print_init::@5/SCREEN+$28*1+$22, debug_print_init::@6/SCREEN+$28*2+$22, debug_print_init::@7/SCREEN+(word)$28*$10, debug_print_init::@8/SCREEN+(word)$28*$11, debug_print_init::@9/SCREEN+(word)$28*$12 )
[115] print_str_at::str#15 = phi( debug_print_init::@10/debug_print_init::str6, debug_print_init::@11/debug_print_init::str7, debug_print_init::@12/debug_print_init::str8, debug_print_init::@13/debug_print_init::str9, debug_print_init::@14/debug_print_init::str10, debug_print_init::@15/debug_print_init::str11, debug_print_init::@4/debug_print_init::str, debug_print_init::@5/debug_print_init::str1, debug_print_init::@6/debug_print_init::str2, debug_print_init::@7/debug_print_init::str3, debug_print_init::@8/debug_print_init::str4, debug_print_init::@9/debug_print_init::str5 )
[129] print_str_at::at#15 = phi( debug_print_init::@10/SCREEN+(word)$28*$13, debug_print_init::@11/SCREEN+(word)$28*$14, debug_print_init::@12/SCREEN+(word)$28*$15, debug_print_init::@13/SCREEN+(word)$28*$16, debug_print_init::@14/SCREEN+(word)$28*$17, debug_print_init::@15/SCREEN+(word)$28*$18, debug_print_init::@4/SCREEN+$22, debug_print_init::@5/SCREEN+$28*1+$22, debug_print_init::@6/SCREEN+$28*2+$22, debug_print_init::@7/SCREEN+(word)$28*$10, debug_print_init::@8/SCREEN+(word)$28*$11, debug_print_init::@9/SCREEN+(word)$28*$12 )
[129] print_str_at::str#15 = phi( debug_print_init::@10/debug_print_init::str6, debug_print_init::@11/debug_print_init::str7, debug_print_init::@12/debug_print_init::str8, debug_print_init::@13/debug_print_init::str9, debug_print_init::@14/debug_print_init::str10, debug_print_init::@15/debug_print_init::str11, debug_print_init::@4/debug_print_init::str, debug_print_init::@5/debug_print_init::str1, debug_print_init::@6/debug_print_init::str2, debug_print_init::@7/debug_print_init::str3, debug_print_init::@8/debug_print_init::str4, debug_print_init::@9/debug_print_init::str5 )
to:print_str_at::@1
print_str_at::@1: scope:[print_str_at] from print_str_at print_str_at::@2
[116] print_str_at::at#13 = phi( print_str_at/print_str_at::at#15, print_str_at::@2/print_str_at::at#0 )
[116] print_str_at::str#13 = phi( print_str_at/print_str_at::str#15, print_str_at::@2/print_str_at::str#0 )
[117] if(0!=*print_str_at::str#13) goto print_str_at::@2
[130] print_str_at::at#13 = phi( print_str_at/print_str_at::at#15, print_str_at::@2/print_str_at::at#0 )
[130] print_str_at::str#13 = phi( print_str_at/print_str_at::str#15, print_str_at::@2/print_str_at::str#0 )
[131] if(0!=*print_str_at::str#13) goto print_str_at::@2
to:print_str_at::@return
print_str_at::@return: scope:[print_str_at] from print_str_at::@1
[118] return
[132] return
to:@return
print_str_at::@2: scope:[print_str_at] from print_str_at::@1
[119] *print_str_at::at#13 = *print_str_at::str#13
[120] print_str_at::at#0 = ++ print_str_at::at#13
[121] print_str_at::str#0 = ++ print_str_at::str#13
[133] *print_str_at::at#13 = *print_str_at::str#13
[134] print_str_at::at#0 = ++ print_str_at::at#13
[135] print_str_at::str#0 = ++ print_str_at::str#13
to:print_str_at::@1
void print_schar_at(signed byte print_schar_at::b , byte* print_schar_at::at)
print_schar_at: scope:[print_schar_at] from debug_print::@1 debug_print::@12 debug_print::@13 debug_print::@14 debug_print::@15 debug_print::@16 debug_print::print_schar_pos1 debug_print::print_schar_pos10 debug_print::print_schar_pos11 debug_print::print_schar_pos12 debug_print::print_schar_pos2 debug_print::print_schar_pos3 debug_print::print_schar_pos4 debug_print::print_schar_pos5 debug_print::print_schar_pos6 debug_print::print_schar_pos7 debug_print::print_schar_pos8 debug_print::print_schar_pos9 debug_print_init::@1 debug_print_init::@16 debug_print_init::@17
[122] print_schar_at::at#21 = phi( debug_print::@1/print_schar_at::at#15, debug_print::@12/print_schar_at::at#16, debug_print::@13/print_schar_at::at#17, debug_print::@14/print_schar_at::at#18, debug_print::@15/print_schar_at::at#19, debug_print::@16/print_schar_at::at#20, debug_print::print_schar_pos1/print_screen#0+debug_print::print_schar_pos1_col#0, debug_print::print_schar_pos10/print_screen#0+debug_print::print_schar_pos10_row#0*$28+debug_print::print_schar_pos10_col#0, debug_print::print_schar_pos11/print_screen#0+debug_print::print_schar_pos11_row#0*$28+debug_print::print_schar_pos11_col#0, debug_print::print_schar_pos12/print_screen#0+debug_print::print_schar_pos12_row#0*$28+debug_print::print_schar_pos12_col#0, debug_print::print_schar_pos2/print_screen#0+debug_print::print_schar_pos2_row#0*$28+debug_print::print_schar_pos2_col#0, debug_print::print_schar_pos3/print_screen#0+debug_print::print_schar_pos3_row#0*$28+debug_print::print_schar_pos3_col#0, debug_print::print_schar_pos4/print_screen#0+debug_print::print_schar_pos4_row#0*$28+debug_print::print_schar_pos4_col#0, debug_print::print_schar_pos5/print_screen#0+debug_print::print_schar_pos5_row#0*$28+debug_print::print_schar_pos5_col#0, debug_print::print_schar_pos6/print_screen#0+debug_print::print_schar_pos6_row#0*$28+debug_print::print_schar_pos6_col#0, debug_print::print_schar_pos7/print_screen#0+debug_print::print_schar_pos7_row#0*$28+debug_print::print_schar_pos7_col#0, debug_print::print_schar_pos8/print_screen#0+debug_print::print_schar_pos8_row#0*$28+debug_print::print_schar_pos8_col#0, debug_print::print_schar_pos9/print_screen#0+debug_print::print_schar_pos9_row#0*$28+debug_print::print_schar_pos9_col#0, debug_print_init::@1/print_schar_at::at#0, debug_print_init::@16/print_schar_at::at#1, debug_print_init::@17/print_schar_at::at#2 )
[122] print_schar_at::b#22 = phi( debug_print::@1/print_schar_at::b#16, debug_print::@12/print_schar_at::b#17, debug_print::@13/print_schar_at::b#18, debug_print::@14/print_schar_at::b#19, debug_print::@15/print_schar_at::b#20, debug_print::@16/print_schar_at::b#21, debug_print::print_schar_pos1/print_schar_at::b#4, debug_print::print_schar_pos10/print_schar_at::b#13, debug_print::print_schar_pos11/print_schar_at::b#14, debug_print::print_schar_pos12/print_schar_at::b#15, debug_print::print_schar_pos2/print_schar_at::b#5, debug_print::print_schar_pos3/sz, debug_print::print_schar_pos4/print_schar_at::b#7, debug_print::print_schar_pos5/print_schar_at::b#8, debug_print::print_schar_pos6/print_schar_at::b#9, debug_print::print_schar_pos7/print_schar_at::b#10, debug_print::print_schar_pos8/print_schar_at::b#11, debug_print::print_schar_pos9/print_schar_at::b#12, debug_print_init::@1/print_schar_at::b#1, debug_print_init::@16/print_schar_at::b#2, debug_print_init::@17/print_schar_at::b#3 )
[123] if(print_schar_at::b#22<0) goto print_schar_at::@1
[136] print_schar_at::at#21 = phi( debug_print::@1/print_schar_at::at#15, debug_print::@12/print_schar_at::at#16, debug_print::@13/print_schar_at::at#17, debug_print::@14/print_schar_at::at#18, debug_print::@15/print_schar_at::at#19, debug_print::@16/print_schar_at::at#20, debug_print::print_schar_pos1/print_screen#0+debug_print::print_schar_pos1_col#0, debug_print::print_schar_pos10/print_screen#0+debug_print::print_schar_pos10_row#0*$28+debug_print::print_schar_pos10_col#0, debug_print::print_schar_pos11/print_screen#0+debug_print::print_schar_pos11_row#0*$28+debug_print::print_schar_pos11_col#0, debug_print::print_schar_pos12/print_screen#0+debug_print::print_schar_pos12_row#0*$28+debug_print::print_schar_pos12_col#0, debug_print::print_schar_pos2/print_screen#0+debug_print::print_schar_pos2_row#0*$28+debug_print::print_schar_pos2_col#0, debug_print::print_schar_pos3/print_screen#0+debug_print::print_schar_pos3_row#0*$28+debug_print::print_schar_pos3_col#0, debug_print::print_schar_pos4/print_screen#0+debug_print::print_schar_pos4_row#0*$28+debug_print::print_schar_pos4_col#0, debug_print::print_schar_pos5/print_screen#0+debug_print::print_schar_pos5_row#0*$28+debug_print::print_schar_pos5_col#0, debug_print::print_schar_pos6/print_screen#0+debug_print::print_schar_pos6_row#0*$28+debug_print::print_schar_pos6_col#0, debug_print::print_schar_pos7/print_screen#0+debug_print::print_schar_pos7_row#0*$28+debug_print::print_schar_pos7_col#0, debug_print::print_schar_pos8/print_screen#0+debug_print::print_schar_pos8_row#0*$28+debug_print::print_schar_pos8_col#0, debug_print::print_schar_pos9/print_screen#0+debug_print::print_schar_pos9_row#0*$28+debug_print::print_schar_pos9_col#0, debug_print_init::@1/print_schar_at::at#0, debug_print_init::@16/print_schar_at::at#1, debug_print_init::@17/print_schar_at::at#2 )
[136] print_schar_at::b#22 = phi( debug_print::@1/print_schar_at::b#16, debug_print::@12/print_schar_at::b#17, debug_print::@13/print_schar_at::b#18, debug_print::@14/print_schar_at::b#19, debug_print::@15/print_schar_at::b#20, debug_print::@16/print_schar_at::b#21, debug_print::print_schar_pos1/print_schar_at::b#4, debug_print::print_schar_pos10/print_schar_at::b#13, debug_print::print_schar_pos11/print_schar_at::b#14, debug_print::print_schar_pos12/print_schar_at::b#15, debug_print::print_schar_pos2/print_schar_at::b#5, debug_print::print_schar_pos3/sz, debug_print::print_schar_pos4/print_schar_at::b#7, debug_print::print_schar_pos5/print_schar_at::b#8, debug_print::print_schar_pos6/print_schar_at::b#9, debug_print::print_schar_pos7/print_schar_at::b#10, debug_print::print_schar_pos8/print_schar_at::b#11, debug_print::print_schar_pos9/print_schar_at::b#12, debug_print_init::@1/print_schar_at::b#1, debug_print_init::@16/print_schar_at::b#2, debug_print_init::@17/print_schar_at::b#3 )
[137] if(print_schar_at::b#22<0) goto print_schar_at::@1
to:print_schar_at::@3
print_schar_at::@3: scope:[print_schar_at] from print_schar_at
[124] print_char_at::at#1 = print_schar_at::at#21
[125] call print_char_at
[138] print_char_at::at#1 = print_schar_at::at#21
[139] call print_char_at
to:print_schar_at::@2
print_schar_at::@2: scope:[print_schar_at] from print_schar_at::@3 print_schar_at::@4
[126] print_schar_at::b#24 = phi( print_schar_at::@4/print_schar_at::b#0, print_schar_at::@3/print_schar_at::b#22 )
[127] print_uchar_at::at#0 = print_schar_at::at#21 + 1
[128] print_uchar_at::b#0 = (byte)print_schar_at::b#24
[129] call print_uchar_at
[140] print_schar_at::b#24 = phi( print_schar_at::@4/print_schar_at::b#0, print_schar_at::@3/print_schar_at::b#22 )
[141] print_uchar_at::at#0 = print_schar_at::at#21 + 1
[142] print_uchar_at::b#0 = (byte)print_schar_at::b#24
[143] call print_uchar_at
to:print_schar_at::@return
print_schar_at::@return: scope:[print_schar_at] from print_schar_at::@2
[130] return
[144] return
to:@return
print_schar_at::@1: scope:[print_schar_at] from print_schar_at
[131] print_char_at::at#0 = print_schar_at::at#21
[132] call print_char_at
[145] print_char_at::at#0 = print_schar_at::at#21
[146] call print_char_at
to:print_schar_at::@4
print_schar_at::@4: scope:[print_schar_at] from print_schar_at::@1
[133] print_schar_at::b#0 = - print_schar_at::b#22
[147] print_schar_at::b#0 = - print_schar_at::b#22
to:print_schar_at::@2
void calculate_matrix(signed byte calculate_matrix::sx , signed byte calculate_matrix::sy , signed byte calculate_matrix::sz)
calculate_matrix: scope:[calculate_matrix] from anim::@5
[134] calculate_matrix::t1#0 = calculate_matrix::sy#0
[135] calculate_matrix::t2#0 = calculate_matrix::sy#0
[136] calculate_matrix::t3#0 = calculate_matrix::sx#0
[137] calculate_matrix::t4#0 = calculate_matrix::sx#0
[138] calculate_matrix::t5#0 = calculate_matrix::sx#0 + calculate_matrix::t2#0
[139] calculate_matrix::t6#0 = calculate_matrix::sx#0 - calculate_matrix::t1#0
[140] calculate_matrix::t7#0 = calculate_matrix::sx#0 + calculate_matrix::t1#0
[141] calculate_matrix::t8#0 = calculate_matrix::t2#0 - calculate_matrix::sx#0
[142] calculate_matrix::t9#0 = calculate_matrix::sy#0 - calculate_matrix::sx#0
[143] calculate_matrix::t10#0 = calculate_matrix::sy#0 + calculate_matrix::sx#0
[144] calculate_matrix::$10 = COSH[calculate_matrix::t1#0] + COSH[calculate_matrix::t2#0]
[145] *rotation_matrix = calculate_matrix::$10
[146] calculate_matrix::$11 = SINH[calculate_matrix::t1#0] - SINH[calculate_matrix::t2#0]
[147] *(rotation_matrix+1) = calculate_matrix::$11
[148] calculate_matrix::$12 = SINH[calculate_matrix::sy#0] + SINH[calculate_matrix::sy#0]
[149] *(rotation_matrix+2) = calculate_matrix::$12
[150] calculate_matrix::$13 = SINH[calculate_matrix::t3#0] - SINH[calculate_matrix::t4#0]
[151] calculate_matrix::$14 = calculate_matrix::$13 + COSQ[calculate_matrix::t6#0]
[152] calculate_matrix::$15 = calculate_matrix::$14 - COSQ[calculate_matrix::t5#0]
[153] calculate_matrix::$16 = calculate_matrix::$15 + COSQ[calculate_matrix::t8#0]
[154] calculate_matrix::$17 = calculate_matrix::$16 - COSQ[calculate_matrix::t7#0]
[155] *(rotation_matrix+3) = calculate_matrix::$17
[156] calculate_matrix::$18 = COSH[calculate_matrix::t3#0] + COSH[calculate_matrix::t4#0]
[157] calculate_matrix::$19 = calculate_matrix::$18 + SINQ[calculate_matrix::t5#0]
[158] calculate_matrix::$20 = calculate_matrix::$19 - SINQ[calculate_matrix::t6#0]
[159] calculate_matrix::$21 = calculate_matrix::$20 - SINQ[calculate_matrix::t7#0]
[160] calculate_matrix::$22 = calculate_matrix::$21 - SINQ[calculate_matrix::t8#0]
[161] *(rotation_matrix+4) = calculate_matrix::$22
[162] calculate_matrix::$23 = SINH[calculate_matrix::t9#0] - SINH[calculate_matrix::t10#0]
[163] *(rotation_matrix+5) = calculate_matrix::$23
[164] calculate_matrix::$24 = COSH[calculate_matrix::t4#0] - COSH[calculate_matrix::t3#0]
[165] calculate_matrix::$25 = calculate_matrix::$24 + SINQ[calculate_matrix::t6#0]
[166] calculate_matrix::$26 = calculate_matrix::$25 - SINQ[calculate_matrix::t5#0]
[167] calculate_matrix::$27 = calculate_matrix::$26 - SINQ[calculate_matrix::t8#0]
[168] calculate_matrix::$28 = calculate_matrix::$27 - SINQ[calculate_matrix::t7#0]
[169] *(rotation_matrix+6) = calculate_matrix::$28
[170] calculate_matrix::$29 = SINH[calculate_matrix::t3#0] + SINH[calculate_matrix::t4#0]
[171] calculate_matrix::$30 = calculate_matrix::$29 + COSQ[calculate_matrix::t6#0]
[172] calculate_matrix::$31 = calculate_matrix::$30 - COSQ[calculate_matrix::t5#0]
[173] calculate_matrix::$32 = calculate_matrix::$31 + COSQ[calculate_matrix::t7#0]
[174] calculate_matrix::$33 = calculate_matrix::$32 - COSQ[calculate_matrix::t8#0]
[175] *(rotation_matrix+7) = calculate_matrix::$33
[176] calculate_matrix::$34 = COSH[calculate_matrix::t9#0] + COSH[calculate_matrix::t10#0]
[177] *(rotation_matrix+8) = calculate_matrix::$34
[148] calculate_matrix::t1#0 = calculate_matrix::sy#0
[149] calculate_matrix::t2#0 = calculate_matrix::sy#0
[150] calculate_matrix::t3#0 = calculate_matrix::sx#0
[151] calculate_matrix::t4#0 = calculate_matrix::sx#0
[152] calculate_matrix::t5#0 = calculate_matrix::sx#0 + calculate_matrix::t2#0
[153] calculate_matrix::t6#0 = calculate_matrix::sx#0 - calculate_matrix::t1#0
[154] calculate_matrix::t7#0 = calculate_matrix::sx#0 + calculate_matrix::t1#0
[155] calculate_matrix::t8#0 = calculate_matrix::t2#0 - calculate_matrix::sx#0
[156] calculate_matrix::t9#0 = calculate_matrix::sy#0 - calculate_matrix::sx#0
[157] calculate_matrix::t10#0 = calculate_matrix::sy#0 + calculate_matrix::sx#0
[158] calculate_matrix::$10 = COSH[calculate_matrix::t1#0] + COSH[calculate_matrix::t2#0]
[159] *rotation_matrix = calculate_matrix::$10
[160] calculate_matrix::$11 = SINH[calculate_matrix::t1#0] - SINH[calculate_matrix::t2#0]
[161] *(rotation_matrix+1) = calculate_matrix::$11
[162] calculate_matrix::$12 = SINH[calculate_matrix::sy#0] + SINH[calculate_matrix::sy#0]
[163] *(rotation_matrix+2) = calculate_matrix::$12
[164] calculate_matrix::$13 = SINH[calculate_matrix::t3#0] - SINH[calculate_matrix::t4#0]
[165] calculate_matrix::$14 = calculate_matrix::$13 + COSQ[calculate_matrix::t6#0]
[166] calculate_matrix::$15 = calculate_matrix::$14 - COSQ[calculate_matrix::t5#0]
[167] calculate_matrix::$16 = calculate_matrix::$15 + COSQ[calculate_matrix::t8#0]
[168] calculate_matrix::$17 = calculate_matrix::$16 - COSQ[calculate_matrix::t7#0]
[169] *(rotation_matrix+3) = calculate_matrix::$17
[170] calculate_matrix::$18 = COSH[calculate_matrix::t3#0] + COSH[calculate_matrix::t4#0]
[171] calculate_matrix::$19 = calculate_matrix::$18 + SINQ[calculate_matrix::t5#0]
[172] calculate_matrix::$20 = calculate_matrix::$19 - SINQ[calculate_matrix::t6#0]
[173] calculate_matrix::$21 = calculate_matrix::$20 - SINQ[calculate_matrix::t7#0]
[174] calculate_matrix::$22 = calculate_matrix::$21 - SINQ[calculate_matrix::t8#0]
[175] *(rotation_matrix+4) = calculate_matrix::$22
[176] calculate_matrix::$23 = SINH[calculate_matrix::t9#0] - SINH[calculate_matrix::t10#0]
[177] *(rotation_matrix+5) = calculate_matrix::$23
[178] calculate_matrix::$24 = COSH[calculate_matrix::t4#0] - COSH[calculate_matrix::t3#0]
[179] calculate_matrix::$25 = calculate_matrix::$24 + SINQ[calculate_matrix::t6#0]
[180] calculate_matrix::$26 = calculate_matrix::$25 - SINQ[calculate_matrix::t5#0]
[181] calculate_matrix::$27 = calculate_matrix::$26 - SINQ[calculate_matrix::t8#0]
[182] calculate_matrix::$28 = calculate_matrix::$27 - SINQ[calculate_matrix::t7#0]
[183] *(rotation_matrix+6) = calculate_matrix::$28
[184] calculate_matrix::$29 = SINH[calculate_matrix::t3#0] + SINH[calculate_matrix::t4#0]
[185] calculate_matrix::$30 = calculate_matrix::$29 + COSQ[calculate_matrix::t6#0]
[186] calculate_matrix::$31 = calculate_matrix::$30 - COSQ[calculate_matrix::t5#0]
[187] calculate_matrix::$32 = calculate_matrix::$31 + COSQ[calculate_matrix::t7#0]
[188] calculate_matrix::$33 = calculate_matrix::$32 - COSQ[calculate_matrix::t8#0]
[189] *(rotation_matrix+7) = calculate_matrix::$33
[190] calculate_matrix::$34 = COSH[calculate_matrix::t9#0] + COSH[calculate_matrix::t10#0]
[191] *(rotation_matrix+8) = calculate_matrix::$34
to:calculate_matrix::@return
calculate_matrix::@return: scope:[calculate_matrix] from calculate_matrix
[178] return
[192] return
to:@return
void store_matrix()
@ -306,182 +330,182 @@ store_matrix: scope:[store_matrix] from anim::@8
asm { ldarotation_matrix+0 starotate_matrix.A1+1 eor#$ff starotate_matrix.A2+1 ldarotation_matrix+1 starotate_matrix.B1+1 eor#$ff starotate_matrix.B2+1 ldarotation_matrix+2 starotate_matrix.C1+1 eor#$ff starotate_matrix.C2+1 ldarotation_matrix+3 starotate_matrix.D1+1 eor#$ff starotate_matrix.D2+1 ldarotation_matrix+4 starotate_matrix.E1+1 eor#$ff starotate_matrix.E2+1 ldarotation_matrix+5 starotate_matrix.F1+1 eor#$ff starotate_matrix.F2+1 ldarotation_matrix+6 starotate_matrix.G1+1 eor#$ff starotate_matrix.G2+1 ldarotation_matrix+7 starotate_matrix.H1+1 eor#$ff starotate_matrix.H2+1 ldarotation_matrix+8 starotate_matrix.I1+1 eor#$ff starotate_matrix.I2+1 }
to:store_matrix::@return
store_matrix::@return: scope:[store_matrix] from store_matrix
[180] return
[194] return
to:@return
void rotate_matrix(signed byte rotate_matrix::x , signed byte rotate_matrix::y , signed byte rotate_matrix::z)
rotate_matrix: scope:[rotate_matrix] from anim::@6
[181] *xr = rotate_matrix::x#0
[182] *yr = rotate_matrix::y#0
[183] *zr = rotate_matrix::z#0
[195] xr = rotate_matrix::x#0
[196] yr = rotate_matrix::y#0
[197] zr = rotate_matrix::z#0
asm { ldxzr C1: ldamulf_sqr1,x sec C2: sbcmulf_sqr2,x staC3+1 F1: ldamulf_sqr1,x sec F2: sbcmulf_sqr2,x staF3+1 I1: ldamulf_sqr1,x sec I2: sbcmulf_sqr2,x staI3+1 ldxxr ldyyr I3: lda#0 clc G1: adcmulf_sqr1,x sec G2: sbcmulf_sqr2,x clc H1: adcmulf_sqr1,y sec H2: sbcmulf_sqr2,y stazr staPP+1 PP: ldaPERSP_Z stapp stapsp1 eor#$ff stapsp2 C3: lda#0 clc A1: adcmulf_sqr1,x sec A2: sbcmulf_sqr2,x clc B1: adcmulf_sqr1,y sec B2: sbcmulf_sqr2,y staxr staXX+1 clc F3: lda#0 clc D1: adcmulf_sqr1,x sec D2: sbcmulf_sqr2,x clc E1: adcmulf_sqr1,y sec E2: sbcmulf_sqr2,y stayr tay lda(psp1),y sec sbc(psp2),y stayp XX: ldy#0 lda(psp1),y sec sbc(psp2),y staxp }
to:rotate_matrix::@return
rotate_matrix::@return: scope:[rotate_matrix] from rotate_matrix
[185] return
[199] return
to:@return
void debug_print()
debug_print: scope:[debug_print] from anim::@7
[186] debug_print::print_schar_pos1_sb#0 = sx#11
[200] debug_print::print_schar_pos1_sb#0 = sx#11
to:debug_print::print_schar_pos1
debug_print::print_schar_pos1: scope:[debug_print] from debug_print
[187] print_schar_at::b#4 = debug_print::print_schar_pos1_sb#0
[188] call print_schar_at
[201] print_schar_at::b#4 = debug_print::print_schar_pos1_sb#0
[202] call print_schar_at
to:debug_print::@2
debug_print::@2: scope:[debug_print] from debug_print::print_schar_pos1
[189] debug_print::print_schar_pos2_sb#0 = sy#11
[203] debug_print::print_schar_pos2_sb#0 = sy#11
to:debug_print::print_schar_pos2
debug_print::print_schar_pos2: scope:[debug_print] from debug_print::@2
[190] print_schar_at::b#5 = debug_print::print_schar_pos2_sb#0
[191] call print_schar_at
[204] print_schar_at::b#5 = debug_print::print_schar_pos2_sb#0
[205] call print_schar_at
to:debug_print::print_schar_pos3
debug_print::print_schar_pos3: scope:[debug_print] from debug_print::print_schar_pos2
[192] phi()
[193] call print_schar_at
[206] phi()
[207] call print_schar_at
to:debug_print::@3
debug_print::@3: scope:[debug_print] from debug_print::print_schar_pos3
[194] debug_print::print_schar_pos4_sb#0 = *rotation_matrix
[208] debug_print::print_schar_pos4_sb#0 = *rotation_matrix
to:debug_print::print_schar_pos4
debug_print::print_schar_pos4: scope:[debug_print] from debug_print::@3
[195] print_schar_at::b#7 = debug_print::print_schar_pos4_sb#0
[196] call print_schar_at
[209] print_schar_at::b#7 = debug_print::print_schar_pos4_sb#0
[210] call print_schar_at
to:debug_print::@4
debug_print::@4: scope:[debug_print] from debug_print::print_schar_pos4
[197] debug_print::print_schar_pos5_sb#0 = *(rotation_matrix+1)
[211] debug_print::print_schar_pos5_sb#0 = *(rotation_matrix+1)
to:debug_print::print_schar_pos5
debug_print::print_schar_pos5: scope:[debug_print] from debug_print::@4
[198] print_schar_at::b#8 = debug_print::print_schar_pos5_sb#0
[199] call print_schar_at
[212] print_schar_at::b#8 = debug_print::print_schar_pos5_sb#0
[213] call print_schar_at
to:debug_print::@5
debug_print::@5: scope:[debug_print] from debug_print::print_schar_pos5
[200] debug_print::print_schar_pos6_sb#0 = *(rotation_matrix+2)
[214] debug_print::print_schar_pos6_sb#0 = *(rotation_matrix+2)
to:debug_print::print_schar_pos6
debug_print::print_schar_pos6: scope:[debug_print] from debug_print::@5
[201] print_schar_at::b#9 = debug_print::print_schar_pos6_sb#0
[202] call print_schar_at
[215] print_schar_at::b#9 = debug_print::print_schar_pos6_sb#0
[216] call print_schar_at
to:debug_print::@6
debug_print::@6: scope:[debug_print] from debug_print::print_schar_pos6
[203] debug_print::print_schar_pos7_sb#0 = *(rotation_matrix+3)
[217] debug_print::print_schar_pos7_sb#0 = *(rotation_matrix+3)
to:debug_print::print_schar_pos7
debug_print::print_schar_pos7: scope:[debug_print] from debug_print::@6
[204] print_schar_at::b#10 = debug_print::print_schar_pos7_sb#0
[205] call print_schar_at
[218] print_schar_at::b#10 = debug_print::print_schar_pos7_sb#0
[219] call print_schar_at
to:debug_print::@7
debug_print::@7: scope:[debug_print] from debug_print::print_schar_pos7
[206] debug_print::print_schar_pos8_sb#0 = *(rotation_matrix+4)
[220] debug_print::print_schar_pos8_sb#0 = *(rotation_matrix+4)
to:debug_print::print_schar_pos8
debug_print::print_schar_pos8: scope:[debug_print] from debug_print::@7
[207] print_schar_at::b#11 = debug_print::print_schar_pos8_sb#0
[208] call print_schar_at
[221] print_schar_at::b#11 = debug_print::print_schar_pos8_sb#0
[222] call print_schar_at
to:debug_print::@8
debug_print::@8: scope:[debug_print] from debug_print::print_schar_pos8
[209] debug_print::print_schar_pos9_sb#0 = *(rotation_matrix+5)
[223] debug_print::print_schar_pos9_sb#0 = *(rotation_matrix+5)
to:debug_print::print_schar_pos9
debug_print::print_schar_pos9: scope:[debug_print] from debug_print::@8
[210] print_schar_at::b#12 = debug_print::print_schar_pos9_sb#0
[211] call print_schar_at
[224] print_schar_at::b#12 = debug_print::print_schar_pos9_sb#0
[225] call print_schar_at
to:debug_print::@9
debug_print::@9: scope:[debug_print] from debug_print::print_schar_pos9
[212] debug_print::print_schar_pos10_sb#0 = *(rotation_matrix+6)
[226] debug_print::print_schar_pos10_sb#0 = *(rotation_matrix+6)
to:debug_print::print_schar_pos10
debug_print::print_schar_pos10: scope:[debug_print] from debug_print::@9
[213] print_schar_at::b#13 = debug_print::print_schar_pos10_sb#0
[214] call print_schar_at
[227] print_schar_at::b#13 = debug_print::print_schar_pos10_sb#0
[228] call print_schar_at
to:debug_print::@10
debug_print::@10: scope:[debug_print] from debug_print::print_schar_pos10
[215] debug_print::print_schar_pos11_sb#0 = *(rotation_matrix+7)
[229] debug_print::print_schar_pos11_sb#0 = *(rotation_matrix+7)
to:debug_print::print_schar_pos11
debug_print::print_schar_pos11: scope:[debug_print] from debug_print::@10
[216] print_schar_at::b#14 = debug_print::print_schar_pos11_sb#0
[217] call print_schar_at
[230] print_schar_at::b#14 = debug_print::print_schar_pos11_sb#0
[231] call print_schar_at
to:debug_print::@11
debug_print::@11: scope:[debug_print] from debug_print::print_schar_pos11
[218] debug_print::print_schar_pos12_sb#0 = *(rotation_matrix+8)
[232] debug_print::print_schar_pos12_sb#0 = *(rotation_matrix+8)
to:debug_print::print_schar_pos12
debug_print::print_schar_pos12: scope:[debug_print] from debug_print::@11
[219] print_schar_at::b#15 = debug_print::print_schar_pos12_sb#0
[220] call print_schar_at
[233] print_schar_at::b#15 = debug_print::print_schar_pos12_sb#0
[234] call print_schar_at
to:debug_print::@1
debug_print::@1: scope:[debug_print] from debug_print::@17 debug_print::print_schar_pos12
[221] debug_print::i#2 = phi( debug_print::print_schar_pos12/0, debug_print::@17/debug_print::i#1 )
[221] debug_print::c#2 = phi( debug_print::print_schar_pos12/4, debug_print::@17/debug_print::c#1 )
[222] print_schar_at::at#15 = debug_print::at_line#0 + debug_print::c#2
[223] print_schar_at::b#16 = xrs[debug_print::i#2]
[224] call print_schar_at
[235] debug_print::i#2 = phi( debug_print::print_schar_pos12/0, debug_print::@17/debug_print::i#1 )
[235] debug_print::c#2 = phi( debug_print::print_schar_pos12/4, debug_print::@17/debug_print::c#1 )
[236] print_schar_at::at#15 = debug_print::at_line#0 + debug_print::c#2
[237] print_schar_at::b#16 = xrs[debug_print::i#2]
[238] call print_schar_at
to:debug_print::@12
debug_print::@12: scope:[debug_print] from debug_print::@1
[225] print_schar_at::at#16 = debug_print::at_line#0+$28*1 + debug_print::c#2
[226] print_schar_at::b#17 = yrs[debug_print::i#2]
[227] call print_schar_at
[239] print_schar_at::at#16 = debug_print::at_line#0+$28*1 + debug_print::c#2
[240] print_schar_at::b#17 = yrs[debug_print::i#2]
[241] call print_schar_at
to:debug_print::@13
debug_print::@13: scope:[debug_print] from debug_print::@12
[228] print_schar_at::at#17 = debug_print::at_line#0+$28*2 + debug_print::c#2
[229] print_schar_at::b#18 = zrs[debug_print::i#2]
[230] call print_schar_at
[242] print_schar_at::at#17 = debug_print::at_line#0+$28*2 + debug_print::c#2
[243] print_schar_at::b#18 = zrs[debug_print::i#2]
[244] call print_schar_at
to:debug_print::@14
debug_print::@14: scope:[debug_print] from debug_print::@13
[231] print_schar_at::at#18 = debug_print::at_line#0+$28*3 + debug_print::c#2
[232] print_schar_at::b#19 = pps[debug_print::i#2]
[233] call print_schar_at
[245] print_schar_at::at#18 = debug_print::at_line#0+$28*3 + debug_print::c#2
[246] print_schar_at::b#19 = pps[debug_print::i#2]
[247] call print_schar_at
to:debug_print::@15
debug_print::@15: scope:[debug_print] from debug_print::@14
[234] print_schar_at::at#19 = debug_print::at_line#0+$28*4 + debug_print::c#2
[235] print_schar_at::b#20 = xps[debug_print::i#2]
[236] call print_schar_at
[248] print_schar_at::at#19 = debug_print::at_line#0+$28*4 + debug_print::c#2
[249] print_schar_at::b#20 = xps[debug_print::i#2]
[250] call print_schar_at
to:debug_print::@16
debug_print::@16: scope:[debug_print] from debug_print::@15
[237] print_schar_at::at#20 = debug_print::at_line#0+$28*5 + debug_print::c#2
[238] print_schar_at::b#21 = yps[debug_print::i#2]
[239] call print_schar_at
[251] print_schar_at::at#20 = debug_print::at_line#0+$28*5 + debug_print::c#2
[252] print_schar_at::b#21 = yps[debug_print::i#2]
[253] call print_schar_at
to:debug_print::@17
debug_print::@17: scope:[debug_print] from debug_print::@16
[240] debug_print::c#1 = debug_print::c#2 + 4
[241] debug_print::i#1 = ++ debug_print::i#2
[242] if(debug_print::i#1!=8) goto debug_print::@1
[254] debug_print::c#1 = debug_print::c#2 + 4
[255] debug_print::i#1 = ++ debug_print::i#2
[256] if(debug_print::i#1!=8) goto debug_print::@1
to:debug_print::@return
debug_print::@return: scope:[debug_print] from debug_print::@17
[243] return
[257] return
to:@return
void* memset(void* memset::str , byte memset::c , word memset::num)
memset: scope:[memset] from print_cls
[244] phi()
[258] phi()
to:memset::@1
memset::@1: scope:[memset] from memset memset::@2
[245] memset::dst#2 = phi( memset/(byte*)memset::str#0, memset::@2/memset::dst#1 )
[246] if(memset::dst#2!=memset::end#0) goto memset::@2
[259] memset::dst#2 = phi( memset/(byte*)memset::str#0, memset::@2/memset::dst#1 )
[260] if(memset::dst#2!=memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[247] return
[261] return
to:@return
memset::@2: scope:[memset] from memset::@1
[248] *memset::dst#2 = memset::c#0
[249] memset::dst#1 = ++ memset::dst#2
[262] *memset::dst#2 = memset::c#0
[263] memset::dst#1 = ++ memset::dst#2
to:memset::@1
void print_char_at(byte print_char_at::ch , byte* print_char_at::at)
print_char_at: scope:[print_char_at] from print_schar_at::@1 print_schar_at::@3 print_uchar_at print_uchar_at::@1
[250] print_char_at::at#4 = phi( print_schar_at::@1/print_char_at::at#0, print_schar_at::@3/print_char_at::at#1, print_uchar_at/print_char_at::at#2, print_uchar_at::@1/print_char_at::at#3 )
[250] print_char_at::ch#4 = phi( print_schar_at::@1/'-', print_schar_at::@3/' ', print_uchar_at/print_char_at::ch#2, print_uchar_at::@1/print_char_at::ch#3 )
[251] *print_char_at::at#4 = print_char_at::ch#4
[264] print_char_at::at#4 = phi( print_schar_at::@1/print_char_at::at#0, print_schar_at::@3/print_char_at::at#1, print_uchar_at/print_char_at::at#2, print_uchar_at::@1/print_char_at::at#3 )
[264] print_char_at::ch#4 = phi( print_schar_at::@1/'-', print_schar_at::@3/' ', print_uchar_at/print_char_at::ch#2, print_uchar_at::@1/print_char_at::ch#3 )
[265] *print_char_at::at#4 = print_char_at::ch#4
to:print_char_at::@return
print_char_at::@return: scope:[print_char_at] from print_char_at
[252] return
[266] return
to:@return
void print_uchar_at(byte print_uchar_at::b , byte* print_uchar_at::at)
print_uchar_at: scope:[print_uchar_at] from print_schar_at::@2
[253] print_uchar_at::$0 = print_uchar_at::b#0 >> 4
[254] print_char_at::ch#2 = print_hextab[print_uchar_at::$0]
[255] print_char_at::at#2 = print_uchar_at::at#0
[256] call print_char_at
[267] print_uchar_at::$0 = print_uchar_at::b#0 >> 4
[268] print_char_at::ch#2 = print_hextab[print_uchar_at::$0]
[269] print_char_at::at#2 = print_uchar_at::at#0
[270] call print_char_at
to:print_uchar_at::@1
print_uchar_at::@1: scope:[print_uchar_at] from print_uchar_at
[257] print_uchar_at::$2 = print_uchar_at::b#0 & $f
[258] print_char_at::at#3 = print_uchar_at::at#0 + 1
[259] print_char_at::ch#3 = print_hextab[print_uchar_at::$2]
[260] call print_char_at
[271] print_uchar_at::$2 = print_uchar_at::b#0 & $f
[272] print_char_at::at#3 = print_uchar_at::at#0 + 1
[273] print_char_at::ch#3 = print_hextab[print_uchar_at::$2]
[274] call print_char_at
to:print_uchar_at::@return
print_uchar_at::@return: scope:[print_uchar_at] from print_uchar_at::@1
[261] return
[275] return
to:@return

File diff suppressed because one or more lines are too long

View File

@ -53,103 +53,106 @@ const nomodify byte* SPRITES_COLOR = (byte*) 53287
const nomodify byte* SPRITES_XPOS = (byte*) 53248
const nomodify byte* SPRITES_YPOS = (byte*) 53249
const nomodify struct MOS6569_VICII* VICII = (struct MOS6569_VICII*) 53248
void __start()
void anim()
byte~ anim::$10 reg byte a 2002.0
byte~ anim::$9 reg byte a 2002.0
byte~ anim::$10 reg byte a 20002.0
byte~ anim::$13 reg byte a 20002.0
byte~ anim::$14 reg byte a 20002.0
byte~ anim::$9 reg byte a 20002.0
byte anim::i
byte anim::i#1 i zp[1]:4 1501.5
byte anim::i#2 i zp[1]:4 706.5882352941177
byte anim::i#1 i zp[1]:4 15001.5
byte anim::i#2 i zp[1]:4 6316.421052631579
byte anim::i2
byte anim::i2#0 reg byte x 750.75
byte anim::i2#0 reg byte x 5000.5
void calculate_matrix(signed byte calculate_matrix::sx , signed byte calculate_matrix::sy , signed byte calculate_matrix::sz)
signed byte~ calculate_matrix::$10 reg byte a 2002.0
signed byte~ calculate_matrix::$11 reg byte a 2002.0
signed byte~ calculate_matrix::$12 reg byte a 2002.0
signed byte~ calculate_matrix::$13 reg byte a 2002.0
signed byte~ calculate_matrix::$14 reg byte a 2002.0
signed byte~ calculate_matrix::$15 reg byte a 2002.0
signed byte~ calculate_matrix::$16 reg byte a 2002.0
signed byte~ calculate_matrix::$17 reg byte a 2002.0
signed byte~ calculate_matrix::$18 reg byte a 2002.0
signed byte~ calculate_matrix::$19 reg byte a 2002.0
signed byte~ calculate_matrix::$20 reg byte a 2002.0
signed byte~ calculate_matrix::$21 reg byte a 2002.0
signed byte~ calculate_matrix::$22 reg byte a 2002.0
signed byte~ calculate_matrix::$23 reg byte a 2002.0
signed byte~ calculate_matrix::$24 reg byte a 2002.0
signed byte~ calculate_matrix::$25 reg byte a 2002.0
signed byte~ calculate_matrix::$26 reg byte a 2002.0
signed byte~ calculate_matrix::$27 reg byte a 2002.0
signed byte~ calculate_matrix::$28 reg byte a 2002.0
signed byte~ calculate_matrix::$29 reg byte a 2002.0
signed byte~ calculate_matrix::$30 reg byte a 2002.0
signed byte~ calculate_matrix::$31 reg byte a 2002.0
signed byte~ calculate_matrix::$32 reg byte a 2002.0
signed byte~ calculate_matrix::$33 reg byte a 2002.0
signed byte~ calculate_matrix::$34 reg byte a 2002.0
signed byte~ calculate_matrix::$10 reg byte a 20002.0
signed byte~ calculate_matrix::$11 reg byte a 20002.0
signed byte~ calculate_matrix::$12 reg byte a 20002.0
signed byte~ calculate_matrix::$13 reg byte a 20002.0
signed byte~ calculate_matrix::$14 reg byte a 20002.0
signed byte~ calculate_matrix::$15 reg byte a 20002.0
signed byte~ calculate_matrix::$16 reg byte a 20002.0
signed byte~ calculate_matrix::$17 reg byte a 20002.0
signed byte~ calculate_matrix::$18 reg byte a 20002.0
signed byte~ calculate_matrix::$19 reg byte a 20002.0
signed byte~ calculate_matrix::$20 reg byte a 20002.0
signed byte~ calculate_matrix::$21 reg byte a 20002.0
signed byte~ calculate_matrix::$22 reg byte a 20002.0
signed byte~ calculate_matrix::$23 reg byte a 20002.0
signed byte~ calculate_matrix::$24 reg byte a 20002.0
signed byte~ calculate_matrix::$25 reg byte a 20002.0
signed byte~ calculate_matrix::$26 reg byte a 20002.0
signed byte~ calculate_matrix::$27 reg byte a 20002.0
signed byte~ calculate_matrix::$28 reg byte a 20002.0
signed byte~ calculate_matrix::$29 reg byte a 20002.0
signed byte~ calculate_matrix::$30 reg byte a 20002.0
signed byte~ calculate_matrix::$31 reg byte a 20002.0
signed byte~ calculate_matrix::$32 reg byte a 20002.0
signed byte~ calculate_matrix::$33 reg byte a 20002.0
signed byte~ calculate_matrix::$34 reg byte a 20002.0
signed byte calculate_matrix::sx
signed byte calculate_matrix::sx#0 reg byte x 737.1818181818182
signed byte calculate_matrix::sx#0 reg byte x 7364.454545454545
signed byte calculate_matrix::sy
signed byte calculate_matrix::sy#0 sy zp[1]:3 407.1333333333334
signed byte calculate_matrix::sy#0 sy zp[1]:3 4067.133333333334
signed byte calculate_matrix::sz
signed byte calculate_matrix::t1
signed byte calculate_matrix::t1#0 t1 zp[1]:23 417.08333333333337
signed byte calculate_matrix::t1#0 t1 zp[1]:33 4167.083333333333
signed byte calculate_matrix::t10
signed byte calculate_matrix::t10#0 reg byte x 91.0
signed byte calculate_matrix::t10#0 reg byte x 909.1818181818182
signed byte calculate_matrix::t2
signed byte calculate_matrix::t2#0 t2 zp[1]:24 455.0
signed byte calculate_matrix::t2#0 t2 zp[1]:34 4545.909090909091
signed byte calculate_matrix::t3
signed byte calculate_matrix::t3#0 t3 zp[1]:25 147.2058823529412
signed byte calculate_matrix::t3#0 t3 zp[1]:35 1470.7352941176468
signed byte calculate_matrix::t4
signed byte calculate_matrix::t4#0 t4 zp[1]:26 151.66666666666666
signed byte calculate_matrix::t4#0 t4 zp[1]:36 1515.3030303030303
signed byte calculate_matrix::t5
signed byte calculate_matrix::t5#0 t5 zp[1]:27 147.2058823529412
signed byte calculate_matrix::t5#0 t5 zp[1]:37 1470.7352941176468
signed byte calculate_matrix::t6
signed byte calculate_matrix::t6#0 t6 zp[1]:28 156.40625
signed byte calculate_matrix::t6#0 t6 zp[1]:38 1562.65625
signed byte calculate_matrix::t7
signed byte calculate_matrix::t7#0 t7 zp[1]:29 151.66666666666666
signed byte calculate_matrix::t7#0 t7 zp[1]:39 1515.3030303030303
signed byte calculate_matrix::t8
signed byte calculate_matrix::t8#0 t8 zp[1]:30 151.66666666666666
signed byte calculate_matrix::t8#0 t8 zp[1]:40 1515.3030303030303
signed byte calculate_matrix::t9
signed byte calculate_matrix::t9#0 t9 zp[1]:31 88.32352941176471
signed byte calculate_matrix::t9#0 t9 zp[1]:41 882.4411764705882
void debug_print()
byte* debug_print::at_line
const byte* debug_print::at_line#0 at_line = SCREEN+(word)$13*$28
byte debug_print::c
byte debug_print::c#1 c zp[1]:25 66667.33333333333
byte debug_print::c#2 c zp[1]:25 42105.68421052631
byte debug_print::c#1 c zp[1]:35 666667.3333333334
byte debug_print::c#2 c zp[1]:35 421053.05263157893
byte debug_print::i
byte debug_print::i#1 i zp[1]:23 150001.5
byte debug_print::i#2 i zp[1]:23 40000.4
byte debug_print::i#1 i zp[1]:33 1500001.5
byte debug_print::i#2 i zp[1]:33 400000.39999999997
byte debug_print::print_schar_pos10_col
const byte debug_print::print_schar_pos10_col#0 print_schar_pos10_col = $1d
byte debug_print::print_schar_pos10_row
const byte debug_print::print_schar_pos10_row#0 print_schar_pos10_row = 6
signed byte debug_print::print_schar_pos10_sb
signed byte debug_print::print_schar_pos10_sb#0 reg byte a 2002.0
signed byte debug_print::print_schar_pos10_sb#0 reg byte a 20002.0
byte debug_print::print_schar_pos11_col
const byte debug_print::print_schar_pos11_col#0 print_schar_pos11_col = $21
byte debug_print::print_schar_pos11_row
const byte debug_print::print_schar_pos11_row#0 print_schar_pos11_row = 6
signed byte debug_print::print_schar_pos11_sb
signed byte debug_print::print_schar_pos11_sb#0 reg byte a 2002.0
signed byte debug_print::print_schar_pos11_sb#0 reg byte a 20002.0
byte debug_print::print_schar_pos12_col
const byte debug_print::print_schar_pos12_col#0 print_schar_pos12_col = $25
byte debug_print::print_schar_pos12_row
const byte debug_print::print_schar_pos12_row#0 print_schar_pos12_row = 6
signed byte debug_print::print_schar_pos12_sb
signed byte debug_print::print_schar_pos12_sb#0 reg byte a 2002.0
signed byte debug_print::print_schar_pos12_sb#0 reg byte a 20002.0
byte debug_print::print_schar_pos1_col
const byte debug_print::print_schar_pos1_col#0 print_schar_pos1_col = $25
byte debug_print::print_schar_pos1_row
signed byte debug_print::print_schar_pos1_sb
signed byte debug_print::print_schar_pos1_sb#0 reg byte a 2002.0
signed byte debug_print::print_schar_pos1_sb#0 reg byte a 20002.0
byte debug_print::print_schar_pos2_col
const byte debug_print::print_schar_pos2_col#0 print_schar_pos2_col = $25
byte debug_print::print_schar_pos2_row
const byte debug_print::print_schar_pos2_row#0 print_schar_pos2_row = 1
signed byte debug_print::print_schar_pos2_sb
signed byte debug_print::print_schar_pos2_sb#0 reg byte a 2002.0
signed byte debug_print::print_schar_pos2_sb#0 reg byte a 20002.0
byte debug_print::print_schar_pos3_col
const byte debug_print::print_schar_pos3_col#0 print_schar_pos3_col = $25
byte debug_print::print_schar_pos3_row
@ -160,63 +163,63 @@ const byte debug_print::print_schar_pos4_col#0 print_schar_pos4_col = $1d
byte debug_print::print_schar_pos4_row
const byte debug_print::print_schar_pos4_row#0 print_schar_pos4_row = 4
signed byte debug_print::print_schar_pos4_sb
signed byte debug_print::print_schar_pos4_sb#0 reg byte a 2002.0
signed byte debug_print::print_schar_pos4_sb#0 reg byte a 20002.0
byte debug_print::print_schar_pos5_col
const byte debug_print::print_schar_pos5_col#0 print_schar_pos5_col = $21
byte debug_print::print_schar_pos5_row
const byte debug_print::print_schar_pos5_row#0 print_schar_pos5_row = 4
signed byte debug_print::print_schar_pos5_sb
signed byte debug_print::print_schar_pos5_sb#0 reg byte a 2002.0
signed byte debug_print::print_schar_pos5_sb#0 reg byte a 20002.0
byte debug_print::print_schar_pos6_col
const byte debug_print::print_schar_pos6_col#0 print_schar_pos6_col = $25
byte debug_print::print_schar_pos6_row
const byte debug_print::print_schar_pos6_row#0 print_schar_pos6_row = 4
signed byte debug_print::print_schar_pos6_sb
signed byte debug_print::print_schar_pos6_sb#0 reg byte a 2002.0
signed byte debug_print::print_schar_pos6_sb#0 reg byte a 20002.0
byte debug_print::print_schar_pos7_col
const byte debug_print::print_schar_pos7_col#0 print_schar_pos7_col = $1d
byte debug_print::print_schar_pos7_row
const byte debug_print::print_schar_pos7_row#0 print_schar_pos7_row = 5
signed byte debug_print::print_schar_pos7_sb
signed byte debug_print::print_schar_pos7_sb#0 reg byte a 2002.0
signed byte debug_print::print_schar_pos7_sb#0 reg byte a 20002.0
byte debug_print::print_schar_pos8_col
const byte debug_print::print_schar_pos8_col#0 print_schar_pos8_col = $21
byte debug_print::print_schar_pos8_row
const byte debug_print::print_schar_pos8_row#0 print_schar_pos8_row = 5
signed byte debug_print::print_schar_pos8_sb
signed byte debug_print::print_schar_pos8_sb#0 reg byte a 2002.0
signed byte debug_print::print_schar_pos8_sb#0 reg byte a 20002.0
byte debug_print::print_schar_pos9_col
const byte debug_print::print_schar_pos9_col#0 print_schar_pos9_col = $25
byte debug_print::print_schar_pos9_row
const byte debug_print::print_schar_pos9_row#0 print_schar_pos9_row = 5
signed byte debug_print::print_schar_pos9_sb
signed byte debug_print::print_schar_pos9_sb#0 reg byte a 2002.0
signed byte debug_print::print_schar_pos9_sb#0 reg byte a 20002.0
void debug_print_init()
byte*~ debug_print_init::$41 zp[2]:5 2002.0
byte*~ debug_print_init::$44 zp[2]:7 2002.0
byte*~ debug_print_init::$47 zp[2]:9 2002.0
byte*~ debug_print_init::$50 zp[2]:11 2002.0
byte*~ debug_print_init::$53 zp[2]:13 2002.0
byte*~ debug_print_init::$56 zp[2]:15 2002.0
byte*~ debug_print_init::$59 zp[2]:17 2002.0
byte*~ debug_print_init::$62 zp[2]:19 2002.0
byte*~ debug_print_init::$65 zp[2]:21 2002.0
byte*~ debug_print_init::$41 zp[2]:15 20002.0
byte*~ debug_print_init::$44 zp[2]:17 20002.0
byte*~ debug_print_init::$47 zp[2]:19 20002.0
byte*~ debug_print_init::$50 zp[2]:21 20002.0
byte*~ debug_print_init::$53 zp[2]:23 20002.0
byte*~ debug_print_init::$56 zp[2]:25 20002.0
byte*~ debug_print_init::$59 zp[2]:27 20002.0
byte*~ debug_print_init::$62 zp[2]:29 20002.0
byte*~ debug_print_init::$65 zp[2]:31 20002.0
const byte* debug_print_init::COLS = (byte*) 55296
byte* debug_print_init::at_cols
const byte* debug_print_init::at_cols#0 at_cols = debug_print_init::COLS+(word)$10*$28
byte* debug_print_init::at_line
const byte* debug_print_init::at_line#0 at_line = SCREEN+(word)$10*$28
byte debug_print_init::c
byte debug_print_init::c#1 c zp[1]:2 67.33333333333333
byte debug_print_init::c#2 c zp[1]:2 297.3125
byte debug_print_init::c#1 c zp[1]:2 667.3333333333334
byte debug_print_init::c#2 c zp[1]:2 2969.1875
byte debug_print_init::col
byte debug_print_init::col#0 reg byte x 556.111111111111
byte debug_print_init::col#0 reg byte x 5556.111111111112
byte debug_print_init::i
byte debug_print_init::i#1 i zp[1]:3 151.5
byte debug_print_init::i#2 i zp[1]:3 45.63636363636364
byte debug_print_init::i#1 i zp[1]:3 1501.5
byte debug_print_init::i#2 i zp[1]:3 454.7272727272727
byte debug_print_init::j
byte debug_print_init::j#1 reg byte y 1501.5
byte debug_print_init::j#2 reg byte y 550.5500000000001
byte debug_print_init::j#1 reg byte y 15001.5
byte debug_print_init::j#2 reg byte y 5500.550000000001
const byte* debug_print_init::str[3] = "sx"
const byte* debug_print_init::str1[3] = "sy"
const byte* debug_print_init::str10[3] = "xp"
@ -234,8 +237,8 @@ void* memset(void* memset::str , byte memset::c , word memset::num)
byte memset::c
const byte memset::c#0 c = ' '
byte* memset::dst
byte* memset::dst#1 dst zp[2]:7 20002.0
byte* memset::dst#2 dst zp[2]:7 13334.666666666666
byte* memset::dst#1 dst zp[2]:17 200002.0
byte* memset::dst#2 dst zp[2]:17 133334.66666666666
byte* memset::end
const byte* memset::end#0 end = (byte*)memset::str#0+memset::num#0
word memset::num
@ -255,111 +258,111 @@ const byte* mulf_sqr2[$200] = kickasm {{ .for(var i=0;i<$200;i++) {
.if(i>351) { .byte round(((i-511)*(i-511))/256) }
}
}}
const signed byte* pp = (signed byte*) 243
volatile signed byte pp loadstore zp[1]:8 185.24074074074073
const signed byte* pps[8] = { fill( 8, 0) }
void print_char_at(byte print_char_at::ch , byte* print_char_at::at)
byte* print_char_at::at
byte* print_char_at::at#0 at zp[2]:5 2000002.0
byte* print_char_at::at#1 at zp[2]:5 2000002.0
byte* print_char_at::at#2 at zp[2]:5 2.0000002E7
byte* print_char_at::at#3 at zp[2]:5 1.0000001E7
byte* print_char_at::at#4 at zp[2]:5 1.22000005E8
byte* print_char_at::at#0 at zp[2]:15 2.0000002E7
byte* print_char_at::at#1 at zp[2]:15 2.0000002E7
byte* print_char_at::at#2 at zp[2]:15 2.00000002E8
byte* print_char_at::at#3 at zp[2]:15 1.00000001E8
byte* print_char_at::at#4 at zp[2]:15 1.220000005E9
byte print_char_at::ch
byte print_char_at::ch#2 reg byte x 1.0000001E7
byte print_char_at::ch#3 reg byte x 2.0000002E7
byte print_char_at::ch#4 reg byte x 1.20000003E8
byte print_char_at::ch#2 reg byte x 1.00000001E8
byte print_char_at::ch#3 reg byte x 2.00000002E8
byte print_char_at::ch#4 reg byte x 1.200000003E9
void print_cls()
const to_nomodify byte* print_hextab[] = "0123456789abcdef"z
void print_schar_at(signed byte print_schar_at::b , byte* print_schar_at::at)
byte* print_schar_at::at
byte* print_schar_at::at#0 at zp[2]:5 101.0
byte* print_schar_at::at#1 at zp[2]:5 101.0
byte* print_schar_at::at#15 at zp[2]:5 100001.0
byte* print_schar_at::at#16 at zp[2]:5 100001.0
byte* print_schar_at::at#17 at zp[2]:5 100001.0
byte* print_schar_at::at#18 at zp[2]:5 100001.0
byte* print_schar_at::at#19 at zp[2]:5 100001.0
byte* print_schar_at::at#2 at zp[2]:5 101.0
byte* print_schar_at::at#20 at zp[2]:5 100001.0
byte* print_schar_at::at#21 at zp[2]:5 450039.0
byte* print_schar_at::at#0 at zp[2]:15 1001.0
byte* print_schar_at::at#1 at zp[2]:15 1001.0
byte* print_schar_at::at#15 at zp[2]:15 1000001.0
byte* print_schar_at::at#16 at zp[2]:15 1000001.0
byte* print_schar_at::at#17 at zp[2]:15 1000001.0
byte* print_schar_at::at#18 at zp[2]:15 1000001.0
byte* print_schar_at::at#19 at zp[2]:15 1000001.0
byte* print_schar_at::at#2 at zp[2]:15 1001.0
byte* print_schar_at::at#20 at zp[2]:15 1000001.0
byte* print_schar_at::at#21 at zp[2]:15 4500376.5
signed byte print_schar_at::b
signed byte print_schar_at::b#0 b zp[1]:24 2000002.0
signed byte print_schar_at::b#1 b zp[1]:24 202.0
signed byte print_schar_at::b#10 b zp[1]:24 2002.0
signed byte print_schar_at::b#11 b zp[1]:24 2002.0
signed byte print_schar_at::b#12 b zp[1]:24 2002.0
signed byte print_schar_at::b#13 b zp[1]:24 2002.0
signed byte print_schar_at::b#14 b zp[1]:24 2002.0
signed byte print_schar_at::b#15 b zp[1]:24 2002.0
signed byte print_schar_at::b#16 b zp[1]:24 200002.0
signed byte print_schar_at::b#17 b zp[1]:24 200002.0
signed byte print_schar_at::b#18 b zp[1]:24 200002.0
signed byte print_schar_at::b#19 b zp[1]:24 200002.0
signed byte print_schar_at::b#2 b zp[1]:24 202.0
signed byte print_schar_at::b#20 b zp[1]:24 200002.0
signed byte print_schar_at::b#21 b zp[1]:24 200002.0
signed byte print_schar_at::b#22 b zp[1]:24 601887.1666666666
signed byte print_schar_at::b#24 b zp[1]:24 1000001.0
signed byte print_schar_at::b#3 b zp[1]:24 202.0
signed byte print_schar_at::b#4 b zp[1]:24 2002.0
signed byte print_schar_at::b#5 b zp[1]:24 2002.0
signed byte print_schar_at::b#7 b zp[1]:24 2002.0
signed byte print_schar_at::b#8 b zp[1]:24 2002.0
signed byte print_schar_at::b#9 b zp[1]:24 2002.0
signed byte print_schar_at::b#0 b zp[1]:34 2.0000002E7
signed byte print_schar_at::b#1 b zp[1]:34 2002.0
signed byte print_schar_at::b#10 b zp[1]:34 20002.0
signed byte print_schar_at::b#11 b zp[1]:34 20002.0
signed byte print_schar_at::b#12 b zp[1]:34 20002.0
signed byte print_schar_at::b#13 b zp[1]:34 20002.0
signed byte print_schar_at::b#14 b zp[1]:34 20002.0
signed byte print_schar_at::b#15 b zp[1]:34 20002.0
signed byte print_schar_at::b#16 b zp[1]:34 2000002.0
signed byte print_schar_at::b#17 b zp[1]:34 2000002.0
signed byte print_schar_at::b#18 b zp[1]:34 2000002.0
signed byte print_schar_at::b#19 b zp[1]:34 2000002.0
signed byte print_schar_at::b#2 b zp[1]:34 2002.0
signed byte print_schar_at::b#20 b zp[1]:34 2000002.0
signed byte print_schar_at::b#21 b zp[1]:34 2000002.0
signed byte print_schar_at::b#22 b zp[1]:34 6018837.166666667
signed byte print_schar_at::b#24 b zp[1]:34 1.0000001E7
signed byte print_schar_at::b#3 b zp[1]:34 2002.0
signed byte print_schar_at::b#4 b zp[1]:34 20002.0
signed byte print_schar_at::b#5 b zp[1]:34 20002.0
signed byte print_schar_at::b#7 b zp[1]:34 20002.0
signed byte print_schar_at::b#8 b zp[1]:34 20002.0
signed byte print_schar_at::b#9 b zp[1]:34 20002.0
byte* print_screen
const byte* print_screen#0 print_screen = (byte*) 1024
void print_str_at(byte* print_str_at::str , byte* print_str_at::at)
byte* print_str_at::at
byte* print_str_at::at#0 at zp[2]:7 1001.0
byte* print_str_at::at#13 at zp[2]:7 1034.6666666666667
byte* print_str_at::at#15 at zp[2]:7 101.0
byte* print_str_at::at#0 at zp[2]:17 10001.0
byte* print_str_at::at#13 at zp[2]:17 10334.666666666666
byte* print_str_at::at#15 at zp[2]:17 1001.0
byte* print_str_at::str
byte* print_str_at::str#0 str zp[2]:5 2002.0
byte* print_str_at::str#13 str zp[2]:5 1026.25
byte* print_str_at::str#15 str zp[2]:5 101.0
byte* print_str_at::str#0 str zp[2]:15 20002.0
byte* print_str_at::str#13 str zp[2]:15 10251.25
byte* print_str_at::str#15 str zp[2]:15 1001.0
void print_uchar_at(byte print_uchar_at::b , byte* print_uchar_at::at)
byte~ print_uchar_at::$0 reg byte a 2.0000002E7
byte~ print_uchar_at::$2 reg byte y 1.0000001E7
byte~ print_uchar_at::$0 reg byte a 2.00000002E8
byte~ print_uchar_at::$2 reg byte y 1.00000001E8
byte* print_uchar_at::at
byte* print_uchar_at::at#0 at zp[2]:5 3000000.428571428
byte* print_uchar_at::at#0 at zp[2]:15 3.000000042857143E7
byte print_uchar_at::b
byte print_uchar_at::b#0 b zp[1]:24 4200000.6
const word* psp1 = (word*) 246
const word* psp2 = (word*) 248
byte print_uchar_at::b#0 b zp[1]:34 4.2000000599999994E7
volatile word psp1 loadstore zp[2]:11 0.28260869565217395
volatile word psp2 loadstore zp[2]:13 0.28888888888888886
void rotate_matrix(signed byte rotate_matrix::x , signed byte rotate_matrix::y , signed byte rotate_matrix::z)
signed byte rotate_matrix::x
signed byte rotate_matrix::x#0 reg byte x 3667.333333333333
signed byte rotate_matrix::x#0 reg byte x 36667.33333333333
signed byte rotate_matrix::y
signed byte rotate_matrix::y#0 y zp[1]:24 3667.333333333333
signed byte rotate_matrix::y#0 y zp[1]:34 36667.33333333333
signed byte rotate_matrix::z
signed byte rotate_matrix::z#0 z zp[1]:25 3667.333333333333
signed byte rotate_matrix::z#0 z zp[1]:35 36667.33333333333
const signed byte* rotation_matrix[9] = { fill( 9, 0) }
void sprites_init()
const byte* sprites_init::SCREEN = (byte*) 1024
byte sprites_init::i
byte sprites_init::i#1 reg byte x 151.5
byte sprites_init::i#2 reg byte x 134.66666666666666
byte sprites_init::i#1 reg byte x 1501.5
byte sprites_init::i#2 reg byte x 1334.6666666666667
byte* sprites_init::sprites_ptr
const byte* sprites_init::sprites_ptr#0 sprites_ptr = sprites_init::SCREEN+$3f8
void store_matrix()
signed byte sx
signed byte sx#11 sx zp[1]:2 14.488888888888889
signed byte sx#2 sx zp[1]:2 101.0
signed byte sx#11 sx zp[1]:2 141.34782608695653
signed byte sx#2 sx zp[1]:2 1001.0
signed byte sy
signed byte sy#11 sy zp[1]:3 14.32967032967033
signed byte sy#2 sy zp[1]:3 202.0
signed byte sy#11 sy zp[1]:3 139.8279569892473
signed byte sy#2 sy zp[1]:3 2002.0
const signed byte sz = 0
const signed byte* xp = (signed byte*) 244
volatile signed byte xp loadstore zp[1]:9 188.7358490566038
const signed byte* xps[8] = { fill( 8, 0) }
const signed byte* xr = (signed byte*) 240
volatile signed byte xr loadstore zp[1]:5 18334.0
const signed byte* xrs[8] = { fill( 8, 0) }
const signed byte* xs[8] = { -$34, -$34, -$34, 0, 0, $34, $34, $34 }
const signed byte* yp = (signed byte*) 245
volatile signed byte yp loadstore zp[1]:10 192.3653846153846
const signed byte* yps[8] = { fill( 8, 0) }
const signed byte* yr = (signed byte*) 241
volatile signed byte yr loadstore zp[1]:6 18334.0
const signed byte* yrs[8] = { fill( 8, 0) }
const signed byte* ys[8] = { -$34, 0, $34, -$34, $34, -$34, 0, $34 }
const signed byte* zr = (signed byte*) 242
volatile signed byte zr loadstore zp[1]:7 18334.0
const signed byte* zrs[8] = { fill( 8, 0) }
const signed byte* zs[8] = { $34, $34, $34, $34, $34, $34, $34, $34 }
@ -369,30 +372,40 @@ zp[1]:2 [ sx#11 sx#2 debug_print_init::c#2 debug_print_init::c#1 ]
zp[1]:3 [ sy#11 sy#2 calculate_matrix::sy#0 debug_print_init::i#2 debug_print_init::i#1 ]
zp[1]:4 [ anim::i#2 anim::i#1 ]
reg byte x [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ]
zp[1]:5 [ xr ]
zp[1]:6 [ yr ]
zp[1]:7 [ zr ]
zp[1]:8 [ pp ]
zp[1]:9 [ xp ]
zp[1]:10 [ yp ]
zp[2]:11 [ psp1 ]
zp[2]:13 [ psp2 ]
reg byte x [ debug_print_init::col#0 ]
zp[2]:5 [ debug_print_init::$41 print_schar_at::at#21 print_schar_at::at#15 print_schar_at::at#16 print_schar_at::at#17 print_schar_at::at#18 print_schar_at::at#19 print_schar_at::at#20 print_schar_at::at#0 print_schar_at::at#1 print_schar_at::at#2 print_char_at::at#4 print_char_at::at#0 print_char_at::at#1 print_char_at::at#2 print_char_at::at#3 print_uchar_at::at#0 print_str_at::str#13 print_str_at::str#15 print_str_at::str#0 ]
zp[2]:7 [ debug_print_init::$44 memset::dst#2 memset::dst#1 print_str_at::at#13 print_str_at::at#15 print_str_at::at#0 ]
zp[2]:9 [ debug_print_init::$47 ]
zp[2]:11 [ debug_print_init::$50 ]
zp[2]:13 [ debug_print_init::$53 ]
zp[2]:15 [ debug_print_init::$56 ]
zp[2]:17 [ debug_print_init::$59 ]
zp[2]:19 [ debug_print_init::$62 ]
zp[2]:21 [ debug_print_init::$65 ]
zp[2]:15 [ debug_print_init::$41 print_schar_at::at#21 print_schar_at::at#15 print_schar_at::at#16 print_schar_at::at#17 print_schar_at::at#18 print_schar_at::at#19 print_schar_at::at#20 print_schar_at::at#0 print_schar_at::at#1 print_schar_at::at#2 print_char_at::at#4 print_char_at::at#0 print_char_at::at#1 print_char_at::at#2 print_char_at::at#3 print_uchar_at::at#0 print_str_at::str#13 print_str_at::str#15 print_str_at::str#0 ]
zp[2]:17 [ debug_print_init::$44 memset::dst#2 memset::dst#1 print_str_at::at#13 print_str_at::at#15 print_str_at::at#0 ]
zp[2]:19 [ debug_print_init::$47 ]
zp[2]:21 [ debug_print_init::$50 ]
zp[2]:23 [ debug_print_init::$53 ]
zp[2]:25 [ debug_print_init::$56 ]
zp[2]:27 [ debug_print_init::$59 ]
zp[2]:29 [ debug_print_init::$62 ]
zp[2]:31 [ debug_print_init::$65 ]
reg byte x [ calculate_matrix::sx#0 ]
reg byte x [ rotate_matrix::x#0 ]
reg byte x [ anim::i2#0 ]
reg byte a [ anim::$13 ]
reg byte a [ anim::$9 ]
reg byte a [ anim::$14 ]
reg byte a [ anim::$10 ]
zp[1]:23 [ calculate_matrix::t1#0 debug_print::i#2 debug_print::i#1 ]
zp[1]:24 [ calculate_matrix::t2#0 rotate_matrix::y#0 print_schar_at::b#24 print_schar_at::b#0 print_schar_at::b#22 print_schar_at::b#16 print_schar_at::b#17 print_schar_at::b#18 print_schar_at::b#19 print_schar_at::b#20 print_schar_at::b#21 print_schar_at::b#4 print_schar_at::b#13 print_schar_at::b#14 print_schar_at::b#15 print_schar_at::b#5 print_schar_at::b#7 print_schar_at::b#8 print_schar_at::b#9 print_schar_at::b#10 print_schar_at::b#11 print_schar_at::b#12 print_schar_at::b#1 print_schar_at::b#2 print_schar_at::b#3 print_uchar_at::b#0 ]
zp[1]:25 [ calculate_matrix::t3#0 rotate_matrix::z#0 debug_print::c#2 debug_print::c#1 ]
zp[1]:26 [ calculate_matrix::t4#0 ]
zp[1]:27 [ calculate_matrix::t5#0 ]
zp[1]:28 [ calculate_matrix::t6#0 ]
zp[1]:29 [ calculate_matrix::t7#0 ]
zp[1]:30 [ calculate_matrix::t8#0 ]
zp[1]:31 [ calculate_matrix::t9#0 ]
zp[1]:33 [ calculate_matrix::t1#0 debug_print::i#2 debug_print::i#1 ]
zp[1]:34 [ calculate_matrix::t2#0 rotate_matrix::y#0 print_schar_at::b#24 print_schar_at::b#0 print_schar_at::b#22 print_schar_at::b#16 print_schar_at::b#17 print_schar_at::b#18 print_schar_at::b#19 print_schar_at::b#20 print_schar_at::b#21 print_schar_at::b#4 print_schar_at::b#13 print_schar_at::b#14 print_schar_at::b#15 print_schar_at::b#5 print_schar_at::b#7 print_schar_at::b#8 print_schar_at::b#9 print_schar_at::b#10 print_schar_at::b#11 print_schar_at::b#12 print_schar_at::b#1 print_schar_at::b#2 print_schar_at::b#3 print_uchar_at::b#0 ]
zp[1]:35 [ calculate_matrix::t3#0 rotate_matrix::z#0 debug_print::c#2 debug_print::c#1 ]
zp[1]:36 [ calculate_matrix::t4#0 ]
zp[1]:37 [ calculate_matrix::t5#0 ]
zp[1]:38 [ calculate_matrix::t6#0 ]
zp[1]:39 [ calculate_matrix::t7#0 ]
zp[1]:40 [ calculate_matrix::t8#0 ]
zp[1]:41 [ calculate_matrix::t9#0 ]
reg byte x [ calculate_matrix::t10#0 ]
reg byte a [ calculate_matrix::$10 ]
reg byte a [ calculate_matrix::$11 ]

View File

@ -12,33 +12,50 @@
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
// The rotated point - updated by calling rotate()
.label xr = $f0
.label yr = $f1
.label zr = $f2
// Pointers used to multiply perspective (d/z0-z) onto x- & y-coordinates. Points into mulf_sqr1 / mulf_sqr2.
.label psp1 = $f3
.label psp2 = $f5
:BasicUpstart(__start)
.label print_screen = $400
// The rotated point - updated by calling rotate()
.label xr = 8
.label yr = 9
.label zr = $a
// Pointers used to multiply perspective (d/z0-z) onto x- & y-coordinates. Points into mulf_sqr1 / mulf_sqr2.
.label psp1 = $b
.label psp2 = $d
.label print_char_cursor = 6
.label print_line_cursor = 4
.segment Code
__start: {
// xr
lda #0
sta.z xr
// yr
sta.z yr
// zr
sta.z zr
// psp1
sta.z psp1
sta.z psp1+1
// psp2
sta.z psp2
sta.z psp2+1
jsr main
rts
}
main: {
// asm
sei
// mulf_init()
jsr mulf_init
// *psp1 = (unsigned int)mulf_sqr1
// psp1 = (unsigned int)mulf_sqr1
lda #<mulf_sqr1
sta psp1
sta.z psp1
lda #>mulf_sqr1
sta psp1+1
// *psp2 = (unsigned int)mulf_sqr2
sta.z psp1+1
// psp2 = (unsigned int)mulf_sqr2
lda #<mulf_sqr2
sta psp2
sta.z psp2
lda #>mulf_sqr2
sta psp2+1
sta.z psp2+1
// print_cls()
jsr print_cls
// do_perspective($39, -$47, $36)
@ -48,7 +65,7 @@ main: {
}
// Initialize the mulf_sqr multiplication tables with f(x)=int(x*x) and g(x) = f(1-x)
mulf_init: {
.label val = 8
.label val = $f
.label sqr = 4
.label add = 2
lda #<1
@ -163,18 +180,18 @@ do_perspective: {
jsr print_str
// perspective(x, y, z)
jsr perspective
ldx xr
// print_uchar((byte)*xr)
jsr print_uchar
// print_schar(xr)
ldx.z xr
jsr print_schar
// print_str(",")
lda #<str1
sta.z print_str.str
lda #>str1
sta.z print_str.str+1
jsr print_str
ldx yr
// print_uchar((byte)*yr)
jsr print_uchar
// print_schar(yr)
ldx.z yr
jsr print_schar
// print_str(")")
lda #<str5
sta.z print_str.str
@ -282,15 +299,15 @@ print_schar: {
// Apply perspective to a 3d-point. Result is returned in (*xr,*yr)
// Implemented in assembler to utilize seriously fast multiplication
perspective: {
// *xr = x
// xr = x
lda #do_perspective.x
sta xr
// *yr = y
sta.z xr
// yr = y
lda #do_perspective.y
sta yr
// *zr = z
sta.z yr
// zr = z
lda #do_perspective.z
sta zr
sta.z zr
// asm
sta PP+1
PP:
@ -313,29 +330,6 @@ perspective: {
// }
rts
}
// Print a char as HEX
// print_uchar(byte register(X) b)
print_uchar: {
// b>>4
txa
lsr
lsr
lsr
lsr
// print_char(print_hextab[b>>4])
tay
lda print_hextab,y
// Table of hexadecimal digits
jsr print_char
// b&$f
lda #$f
axs #0
// print_char(print_hextab[b&$f])
lda print_hextab,x
jsr print_char
// }
rts
}
// Print a newline
print_ln: {
lda #<print_screen
@ -377,6 +371,29 @@ print_char: {
// }
rts
}
// Print a char as HEX
// print_uchar(byte register(X) b)
print_uchar: {
// b>>4
txa
lsr
lsr
lsr
lsr
// print_char(print_hextab[b>>4])
tay
lda print_hextab,y
// Table of hexadecimal digits
jsr print_char
// b&$f
lda #$f
axs #0
// print_char(print_hextab[b&$f])
lda print_hextab,x
jsr print_char
// }
rts
}
.segment Data
print_hextab: .text "0123456789abcdef"
// Multiplication tables for seriously fast multiplication.

View File

@ -1,226 +1,243 @@
void __start()
__start: scope:[__start] from
[0] phi()
to:__start::__init1
__start::__init1: scope:[__start] from __start
[1] xr = 0
[2] yr = 0
[3] zr = 0
[4] psp1 = 0
[5] psp2 = 0
to:__start::@1
__start::@1: scope:[__start] from __start::__init1
[6] phi()
[7] call main
to:__start::@return
__start::@return: scope:[__start] from __start::@1
[8] return
to:@return
void main()
main: scope:[main] from
main: scope:[main] from __start::@1
asm { sei }
[1] call mulf_init
[10] call mulf_init
to:main::@1
main::@1: scope:[main] from main
[2] *psp1 = (word)mulf_sqr1
[3] *psp2 = (word)mulf_sqr2
[4] call print_cls
[11] psp1 = (word)mulf_sqr1
[12] psp2 = (word)mulf_sqr2
[13] call print_cls
to:main::@2
main::@2: scope:[main] from main::@1
[5] phi()
[6] call do_perspective
[14] phi()
[15] call do_perspective
to:main::@return
main::@return: scope:[main] from main::@2
[7] return
[16] return
to:@return
void mulf_init()
mulf_init: scope:[mulf_init] from main
[8] phi()
[17] phi()
to:mulf_init::@1
mulf_init::@1: scope:[mulf_init] from mulf_init mulf_init::@1
[9] mulf_init::add#2 = phi( mulf_init/1, mulf_init::@1/mulf_init::add#1 )
[9] mulf_init::i#2 = phi( mulf_init/0, mulf_init::@1/mulf_init::i#1 )
[9] mulf_init::sqr#2 = phi( mulf_init/0, mulf_init::@1/mulf_init::sqr#1 )
[10] mulf_init::val#0 = > mulf_init::sqr#2
[11] mulf_sqr1[mulf_init::i#2] = mulf_init::val#0
[12] (mulf_sqr1+$100)[mulf_init::i#2] = mulf_init::val#0
[13] mulf_init::$2 = - mulf_init::i#2
[14] mulf_sqr1[mulf_init::$2] = mulf_init::val#0
[15] (mulf_sqr1+$100)[mulf_init::$2] = mulf_init::val#0
[16] (mulf_sqr2+1)[mulf_init::i#2] = mulf_init::val#0
[17] (mulf_sqr2+$100+1)[mulf_init::i#2] = mulf_init::val#0
[18] mulf_init::$6 = 1 - mulf_init::i#2
[19] mulf_sqr2[mulf_init::$6] = mulf_init::val#0
[20] (mulf_sqr2+$100)[mulf_init::$6] = mulf_init::val#0
[21] mulf_init::sqr#1 = mulf_init::sqr#2 + mulf_init::add#2
[22] mulf_init::add#1 = mulf_init::add#2 + 2
[23] mulf_init::i#1 = ++ mulf_init::i#2
[24] if(mulf_init::i#1!=$81) goto mulf_init::@1
[18] mulf_init::add#2 = phi( mulf_init/1, mulf_init::@1/mulf_init::add#1 )
[18] mulf_init::i#2 = phi( mulf_init/0, mulf_init::@1/mulf_init::i#1 )
[18] mulf_init::sqr#2 = phi( mulf_init/0, mulf_init::@1/mulf_init::sqr#1 )
[19] mulf_init::val#0 = > mulf_init::sqr#2
[20] mulf_sqr1[mulf_init::i#2] = mulf_init::val#0
[21] (mulf_sqr1+$100)[mulf_init::i#2] = mulf_init::val#0
[22] mulf_init::$2 = - mulf_init::i#2
[23] mulf_sqr1[mulf_init::$2] = mulf_init::val#0
[24] (mulf_sqr1+$100)[mulf_init::$2] = mulf_init::val#0
[25] (mulf_sqr2+1)[mulf_init::i#2] = mulf_init::val#0
[26] (mulf_sqr2+$100+1)[mulf_init::i#2] = mulf_init::val#0
[27] mulf_init::$6 = 1 - mulf_init::i#2
[28] mulf_sqr2[mulf_init::$6] = mulf_init::val#0
[29] (mulf_sqr2+$100)[mulf_init::$6] = mulf_init::val#0
[30] mulf_init::sqr#1 = mulf_init::sqr#2 + mulf_init::add#2
[31] mulf_init::add#1 = mulf_init::add#2 + 2
[32] mulf_init::i#1 = ++ mulf_init::i#2
[33] if(mulf_init::i#1!=$81) goto mulf_init::@1
to:mulf_init::@return
mulf_init::@return: scope:[mulf_init] from mulf_init::@1
[25] return
[34] return
to:@return
void print_cls()
print_cls: scope:[print_cls] from main::@1
[26] phi()
[27] call memset
[35] phi()
[36] call memset
to:print_cls::@return
print_cls::@return: scope:[print_cls] from print_cls
[28] return
[37] return
to:@return
void do_perspective(signed byte do_perspective::x , signed byte do_perspective::y , signed byte do_perspective::z)
do_perspective: scope:[do_perspective] from main::@2
[29] phi()
[30] call print_str
[38] phi()
[39] call print_str
to:do_perspective::@1
do_perspective::@1: scope:[do_perspective] from do_perspective
[31] phi()
[32] call print_schar
[40] phi()
[41] call print_schar
to:do_perspective::@2
do_perspective::@2: scope:[do_perspective] from do_perspective::@1
[33] phi()
[34] call print_str
[42] phi()
[43] call print_str
to:do_perspective::@3
do_perspective::@3: scope:[do_perspective] from do_perspective::@2
[35] phi()
[36] call print_schar
[44] phi()
[45] call print_schar
to:do_perspective::@4
do_perspective::@4: scope:[do_perspective] from do_perspective::@3
[37] phi()
[38] call print_str
[46] phi()
[47] call print_str
to:do_perspective::@5
do_perspective::@5: scope:[do_perspective] from do_perspective::@4
[39] phi()
[40] call print_schar
[48] phi()
[49] call print_schar
to:do_perspective::@6
do_perspective::@6: scope:[do_perspective] from do_perspective::@5
[41] phi()
[42] call print_str
[50] phi()
[51] call print_str
to:do_perspective::@7
do_perspective::@7: scope:[do_perspective] from do_perspective::@6
[43] phi()
[44] call perspective
[52] phi()
[53] call perspective
to:do_perspective::@8
do_perspective::@8: scope:[do_perspective] from do_perspective::@7
[45] print_uchar::b#6 = (byte)*xr
[46] call print_uchar
[54] print_schar::b#4 = xr
[55] call print_schar
to:do_perspective::@9
do_perspective::@9: scope:[do_perspective] from do_perspective::@8
[47] phi()
[48] call print_str
[56] phi()
[57] call print_str
to:do_perspective::@10
do_perspective::@10: scope:[do_perspective] from do_perspective::@9
[49] print_uchar::b#5 = (byte)*yr
[50] call print_uchar
[58] print_schar::b#5 = yr
[59] call print_schar
to:do_perspective::@11
do_perspective::@11: scope:[do_perspective] from do_perspective::@10
[51] phi()
[52] call print_str
[60] phi()
[61] call print_str
to:do_perspective::@12
do_perspective::@12: scope:[do_perspective] from do_perspective::@11
[53] phi()
[54] call print_ln
[62] phi()
[63] call print_ln
to:do_perspective::@return
do_perspective::@return: scope:[do_perspective] from do_perspective::@12
[55] return
[64] return
to:@return
void* memset(void* memset::str , byte memset::c , word memset::num)
memset: scope:[memset] from print_cls
[56] phi()
[65] phi()
to:memset::@1
memset::@1: scope:[memset] from memset memset::@2
[57] memset::dst#2 = phi( memset/(byte*)memset::str#0, memset::@2/memset::dst#1 )
[58] if(memset::dst#2!=memset::end#0) goto memset::@2
[66] memset::dst#2 = phi( memset/(byte*)memset::str#0, memset::@2/memset::dst#1 )
[67] if(memset::dst#2!=memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[59] return
[68] return
to:@return
memset::@2: scope:[memset] from memset::@1
[60] *memset::dst#2 = memset::c#0
[61] memset::dst#1 = ++ memset::dst#2
[69] *memset::dst#2 = memset::c#0
[70] memset::dst#1 = ++ memset::dst#2
to:memset::@1
void print_str(byte* print_str::str)
print_str: scope:[print_str] from do_perspective do_perspective::@11 do_perspective::@2 do_perspective::@4 do_perspective::@6 do_perspective::@9
[62] print_char_cursor#77 = phi( do_perspective/print_screen#0, do_perspective::@11/print_char_cursor#11, do_perspective::@2/print_char_cursor#11, do_perspective::@4/print_char_cursor#11, do_perspective::@6/print_char_cursor#11, do_perspective::@9/print_char_cursor#11 )
[62] print_str::str#10 = phi( do_perspective/do_perspective::str, do_perspective::@11/do_perspective::str5, do_perspective::@2/do_perspective::str1, do_perspective::@4/do_perspective::str1, do_perspective::@6/do_perspective::str3, do_perspective::@9/do_perspective::str1 )
[71] print_char_cursor#77 = phi( do_perspective/print_screen#0, do_perspective::@11/print_char_cursor#11, do_perspective::@2/print_char_cursor#11, do_perspective::@4/print_char_cursor#11, do_perspective::@6/print_char_cursor#11, do_perspective::@9/print_char_cursor#11 )
[71] print_str::str#10 = phi( do_perspective/do_perspective::str, do_perspective::@11/do_perspective::str5, do_perspective::@2/do_perspective::str1, do_perspective::@4/do_perspective::str1, do_perspective::@6/do_perspective::str3, do_perspective::@9/do_perspective::str1 )
to:print_str::@1
print_str::@1: scope:[print_str] from print_str print_str::@3
[63] print_char_cursor#1 = phi( print_str/print_char_cursor#77, print_str::@3/print_char_cursor#11 )
[63] print_str::str#7 = phi( print_str/print_str::str#10, print_str::@3/print_str::str#0 )
[64] if(0!=*print_str::str#7) goto print_str::@2
[72] print_char_cursor#1 = phi( print_str/print_char_cursor#77, print_str::@3/print_char_cursor#11 )
[72] print_str::str#7 = phi( print_str/print_str::str#10, print_str::@3/print_str::str#0 )
[73] if(0!=*print_str::str#7) goto print_str::@2
to:print_str::@return
print_str::@return: scope:[print_str] from print_str::@1
[65] return
[74] return
to:@return
print_str::@2: scope:[print_str] from print_str::@1
[66] print_char::ch#0 = *print_str::str#7
[67] call print_char
[75] print_char::ch#0 = *print_str::str#7
[76] call print_char
to:print_str::@3
print_str::@3: scope:[print_str] from print_str::@2
[68] print_str::str#0 = ++ print_str::str#7
[77] print_str::str#0 = ++ print_str::str#7
to:print_str::@1
void print_schar(signed byte print_schar::b)
print_schar: scope:[print_schar] from do_perspective::@1 do_perspective::@3 do_perspective::@5
[69] print_schar::b#4 = phi( do_perspective::@1/do_perspective::x#0, do_perspective::@3/do_perspective::y#0, do_perspective::@5/do_perspective::z#0 )
[70] if(print_schar::b#4<0) goto print_schar::@1
print_schar: scope:[print_schar] from do_perspective::@1 do_perspective::@10 do_perspective::@3 do_perspective::@5 do_perspective::@8
[78] print_schar::b#10 = phi( do_perspective::@1/do_perspective::x#0, do_perspective::@10/print_schar::b#5, do_perspective::@3/do_perspective::y#0, do_perspective::@5/do_perspective::z#0, do_perspective::@8/print_schar::b#4 )
[79] if(print_schar::b#10<0) goto print_schar::@1
to:print_schar::@3
print_schar::@3: scope:[print_schar] from print_schar
[71] phi()
[72] call print_char
[80] phi()
[81] call print_char
to:print_schar::@2
print_schar::@2: scope:[print_schar] from print_schar::@3 print_schar::@4
[73] print_schar::b#6 = phi( print_schar::@4/print_schar::b#0, print_schar::@3/print_schar::b#4 )
[74] print_uchar::b#0 = (byte)print_schar::b#6
[75] call print_uchar
[82] print_schar::b#8 = phi( print_schar::@4/print_schar::b#0, print_schar::@3/print_schar::b#10 )
[83] print_uchar::b#0 = (byte)print_schar::b#8
[84] call print_uchar
to:print_schar::@return
print_schar::@return: scope:[print_schar] from print_schar::@2
[76] return
[85] return
to:@return
print_schar::@1: scope:[print_schar] from print_schar
[77] phi()
[78] call print_char
[86] phi()
[87] call print_char
to:print_schar::@4
print_schar::@4: scope:[print_schar] from print_schar::@1
[79] print_schar::b#0 = - print_schar::b#4
[88] print_schar::b#0 = - print_schar::b#10
to:print_schar::@2
void perspective(signed byte perspective::x , signed byte perspective::y , signed byte perspective::z)
perspective: scope:[perspective] from do_perspective::@7
[80] *xr = do_perspective::x#0
[81] *yr = do_perspective::y#0
[82] *zr = do_perspective::z#0
[89] xr = do_perspective::x#0
[90] yr = do_perspective::y#0
[91] zr = do_perspective::z#0
asm { ldazr staPP+1 PP: ldaPERSP_Z stapsp1 eor#$ff stapsp2 clc ldyyr lda(psp1),y sbc(psp2),y adc#$80 stayr clc ldyxr lda(psp1),y sbc(psp2),y adc#$80 staxr }
to:perspective::@return
perspective::@return: scope:[perspective] from perspective
[84] return
to:@return
void print_uchar(byte print_uchar::b)
print_uchar: scope:[print_uchar] from do_perspective::@10 do_perspective::@8 print_schar::@2
[85] print_char_cursor#72 = phi( do_perspective::@10/print_char_cursor#1, do_perspective::@8/print_char_cursor#1, print_schar::@2/print_char_cursor#11 )
[85] print_uchar::b#3 = phi( do_perspective::@10/print_uchar::b#5, do_perspective::@8/print_uchar::b#6, print_schar::@2/print_uchar::b#0 )
[86] print_uchar::$0 = print_uchar::b#3 >> 4
[87] print_char::ch#3 = print_hextab[print_uchar::$0]
[88] call print_char
to:print_uchar::@1
print_uchar::@1: scope:[print_uchar] from print_uchar
[89] print_uchar::$2 = print_uchar::b#3 & $f
[90] print_char::ch#4 = print_hextab[print_uchar::$2]
[91] call print_char
to:print_uchar::@return
print_uchar::@return: scope:[print_uchar] from print_uchar::@1
[92] return
[93] return
to:@return
void print_ln()
print_ln: scope:[print_ln] from do_perspective::@12
[93] phi()
[94] phi()
to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
[94] print_line_cursor#12 = phi( print_ln/print_screen#0, print_ln::@1/print_line_cursor#0 )
[95] print_line_cursor#0 = print_line_cursor#12 + $28
[96] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1
[95] print_line_cursor#12 = phi( print_ln/print_screen#0, print_ln::@1/print_line_cursor#0 )
[96] print_line_cursor#0 = print_line_cursor#12 + $28
[97] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1
to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@1
[97] return
[98] return
to:@return
void print_char(byte print_char::ch)
print_char: scope:[print_char] from print_schar::@1 print_schar::@3 print_str::@2 print_uchar print_uchar::@1
[98] print_char_cursor#45 = phi( print_schar::@1/print_char_cursor#1, print_schar::@3/print_char_cursor#1, print_str::@2/print_char_cursor#1, print_uchar/print_char_cursor#72, print_uchar::@1/print_char_cursor#11 )
[98] print_char::ch#5 = phi( print_schar::@1/'-', print_schar::@3/' ', print_str::@2/print_char::ch#0, print_uchar/print_char::ch#3, print_uchar::@1/print_char::ch#4 )
[99] *print_char_cursor#45 = print_char::ch#5
[100] print_char_cursor#11 = ++ print_char_cursor#45
[99] print_char_cursor#45 = phi( print_schar::@1/print_char_cursor#1, print_schar::@3/print_char_cursor#1, print_str::@2/print_char_cursor#1, print_uchar/print_char_cursor#11, print_uchar::@1/print_char_cursor#11 )
[99] print_char::ch#5 = phi( print_schar::@1/'-', print_schar::@3/' ', print_str::@2/print_char::ch#0, print_uchar/print_char::ch#3, print_uchar::@1/print_char::ch#4 )
[100] *print_char_cursor#45 = print_char::ch#5
[101] print_char_cursor#11 = ++ print_char_cursor#45
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[101] return
[102] return
to:@return
void print_uchar(byte print_uchar::b)
print_uchar: scope:[print_uchar] from print_schar::@2
[103] print_uchar::$0 = print_uchar::b#0 >> 4
[104] print_char::ch#3 = print_hextab[print_uchar::$0]
[105] call print_char
to:print_uchar::@1
print_uchar::@1: scope:[print_uchar] from print_uchar
[106] print_uchar::$2 = print_uchar::b#0 & $f
[107] print_char::ch#4 = print_hextab[print_uchar::$2]
[108] call print_char
to:print_uchar::@return
print_uchar::@return: scope:[print_uchar] from print_uchar::@1
[109] return
to:@return

File diff suppressed because one or more lines are too long

View File

@ -14,6 +14,7 @@ const byte RADIX::BINARY = 2
const byte RADIX::DECIMAL = $a
const byte RADIX::HEXADECIMAL = $10
const byte RADIX::OCTAL = 8
void __start()
void do_perspective(signed byte do_perspective::x , signed byte do_perspective::y , signed byte do_perspective::z)
const byte* do_perspective::str[2] = "("
const byte* do_perspective::str1[2] = ","
@ -30,8 +31,8 @@ void* memset(void* memset::str , byte memset::c , word memset::num)
byte memset::c
const byte memset::c#0 c = ' '
byte* memset::dst
byte* memset::dst#1 dst zp[2]:4 2002.0
byte* memset::dst#2 dst zp[2]:4 1334.6666666666667
byte* memset::dst#1 dst zp[2]:4 20002.0
byte* memset::dst#2 dst zp[2]:4 13334.666666666666
byte* memset::end
const byte* memset::end#0 end = (byte*)memset::str#0+memset::num#0
word memset::num
@ -40,19 +41,19 @@ void* memset::return
void* memset::str
const void* memset::str#0 str = (void*)print_screen#0
void mulf_init()
byte~ mulf_init::$2 reg byte x 151.5
byte~ mulf_init::$6 reg byte x 151.5
byte~ mulf_init::$2 reg byte x 1501.5
byte~ mulf_init::$6 reg byte x 1501.5
signed word mulf_init::add
signed word mulf_init::add#1 add zp[2]:2 67.33333333333333
signed word mulf_init::add#2 add zp[2]:2 23.307692307692307
signed word mulf_init::add#1 add zp[2]:2 667.3333333333334
signed word mulf_init::add#2 add zp[2]:2 231.0
byte mulf_init::i
byte mulf_init::i#1 reg byte y 151.5
byte mulf_init::i#2 reg byte y 57.714285714285715
byte mulf_init::i#1 reg byte y 1501.5
byte mulf_init::i#2 reg byte y 572.0
signed word mulf_init::sqr
signed word mulf_init::sqr#1 sqr zp[2]:4 50.5
signed word mulf_init::sqr#2 sqr zp[2]:4 25.25
signed word mulf_init::sqr#1 sqr zp[2]:4 500.5
signed word mulf_init::sqr#2 sqr zp[2]:4 250.25
byte mulf_init::val
byte mulf_init::val#0 val zp[1]:8 90.89999999999999
byte mulf_init::val#0 val zp[1]:15 900.9000000000001
const byte* mulf_sqr1[$200] = { fill( $200, 0) }
const byte* mulf_sqr2[$200] = { fill( $200, 0) }
void perspective(signed byte perspective::x , signed byte perspective::y , signed byte perspective::z)
@ -61,57 +62,60 @@ signed byte perspective::y
signed byte perspective::z
void print_char(byte print_char::ch)
byte print_char::ch
byte print_char::ch#0 reg byte a 2002.0
byte print_char::ch#3 reg byte a 2002.0
byte print_char::ch#4 reg byte a 2002.0
byte print_char::ch#5 reg byte a 13004.0
byte print_char::ch#0 reg byte a 20002.0
byte print_char::ch#3 reg byte a 20002.0
byte print_char::ch#4 reg byte a 20002.0
byte print_char::ch#5 reg byte a 130004.0
byte* print_char_cursor
byte* print_char_cursor#1 print_char_cursor zp[2]:6 128.0
byte* print_char_cursor#11 print_char_cursor zp[2]:6 467.65384615384613
byte* print_char_cursor#45 print_char_cursor zp[2]:6 11603.5
byte* print_char_cursor#72 print_char_cursor zp[2]:6 374.6666666666667
byte* print_char_cursor#77 print_char_cursor zp[2]:6 156.0
byte* print_char_cursor#1 print_char_cursor zp[2]:6 1269.4615384615383
byte* print_char_cursor#11 print_char_cursor zp[2]:6 4661.035714285714
byte* print_char_cursor#45 print_char_cursor zp[2]:6 116003.5
byte* print_char_cursor#77 print_char_cursor zp[2]:6 1506.0
void print_cls()
const to_nomodify byte* print_hextab[] = "0123456789abcdef"z
byte* print_line_cursor
byte* print_line_cursor#0 print_line_cursor zp[2]:4 1501.5
byte* print_line_cursor#12 print_line_cursor zp[2]:4 2002.0
byte* print_line_cursor#0 print_line_cursor zp[2]:4 15001.5
byte* print_line_cursor#12 print_line_cursor zp[2]:4 20002.0
void print_ln()
void print_schar(signed byte print_schar::b)
signed byte print_schar::b
signed byte print_schar::b#0 reg byte x 202.0
signed byte print_schar::b#4 reg byte x 50.5
signed byte print_schar::b#6 reg byte x 202.0
signed byte print_schar::b#0 reg byte x 2002.0
signed byte print_schar::b#10 reg byte x 534.1666666666667
signed byte print_schar::b#4 reg byte x 202.0
signed byte print_schar::b#5 reg byte x 202.0
signed byte print_schar::b#8 reg byte x 2002.0
byte* print_screen
const byte* print_screen#0 print_screen = (byte*) 1024
void print_str(byte* print_str::str)
byte* print_str::str
byte* print_str::str#0 str zp[2]:2 2002.0
byte* print_str::str#10 str zp[2]:2 101.0
byte* print_str::str#7 str zp[2]:2 1026.25
byte* print_str::str#0 str zp[2]:2 20002.0
byte* print_str::str#10 str zp[2]:2 1001.0
byte* print_str::str#7 str zp[2]:2 10251.25
void print_uchar(byte print_uchar::b)
byte~ print_uchar::$0 reg byte a 2002.0
byte~ print_uchar::$2 reg byte x 2002.0
byte~ print_uchar::$0 reg byte a 20002.0
byte~ print_uchar::$2 reg byte x 20002.0
byte print_uchar::b
byte print_uchar::b#0 reg byte x 202.0
byte print_uchar::b#3 reg byte x 531.25
byte print_uchar::b#5 reg byte x 22.0
byte print_uchar::b#6 reg byte x 22.0
const word* psp1 = (word*) 243
const word* psp2 = (word*) 245
const signed byte* xr = (signed byte*) 240
const signed byte* yr = (signed byte*) 241
const signed byte* zr = (signed byte*) 242
byte print_uchar::b#0 reg byte x 5250.75
volatile word psp1 loadstore zp[2]:11 0.5909090909090909
volatile word psp2 loadstore zp[2]:13 0.6190476190476191
volatile signed byte xr loadstore zp[1]:8 184.0
volatile signed byte yr loadstore zp[1]:9 122.66666666666667
volatile signed byte zr loadstore zp[1]:10 1003.0
reg byte y [ mulf_init::i#2 mulf_init::i#1 ]
zp[2]:2 [ print_str::str#7 print_str::str#10 print_str::str#0 mulf_init::add#2 mulf_init::add#1 ]
reg byte x [ print_schar::b#6 print_schar::b#0 print_schar::b#4 ]
reg byte x [ print_uchar::b#3 print_uchar::b#5 print_uchar::b#6 print_uchar::b#0 ]
reg byte x [ print_schar::b#8 print_schar::b#0 print_schar::b#10 print_schar::b#5 print_schar::b#4 ]
zp[2]:4 [ print_line_cursor#12 print_line_cursor#0 memset::dst#2 memset::dst#1 mulf_init::sqr#2 mulf_init::sqr#1 ]
reg byte a [ print_char::ch#5 print_char::ch#0 print_char::ch#3 print_char::ch#4 ]
zp[2]:6 [ print_char_cursor#45 print_char_cursor#72 print_char_cursor#1 print_char_cursor#77 print_char_cursor#11 ]
zp[1]:8 [ mulf_init::val#0 ]
zp[2]:6 [ print_char_cursor#45 print_char_cursor#1 print_char_cursor#77 print_char_cursor#11 ]
zp[1]:8 [ xr ]
zp[1]:9 [ yr ]
zp[1]:10 [ zr ]
zp[2]:11 [ psp1 ]
zp[2]:13 [ psp2 ]
zp[1]:15 [ mulf_init::val#0 ]
reg byte x [ mulf_init::$2 ]
reg byte x [ mulf_init::$6 ]
reg byte x [ print_uchar::b#0 ]
reg byte a [ print_uchar::$0 ]
reg byte x [ print_uchar::$2 ]

View File

@ -13,10 +13,6 @@
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
// Pointers to a, b and c=a*b
.label ap = $fd
.label bp = $fe
.label cp = $ff
.label print_screen = $400
.segment Code
main: {
@ -99,9 +95,11 @@ main: {
!:
// fmul8(vals[i], vals[j])
ldy.z i
ldx vals,y
lda vals,y
sta.z fmul8.aa
ldy.z j
lda vals,y
sta.z fmul8.bb
jsr fmul8
// r = fmul8(vals[i], vals[j])
// print_schar_at(r, at)
@ -203,25 +201,27 @@ print_schar_at: {
sta.z b
jmp __b2
}
// fmul8(signed byte register(X) a, signed byte register(A) b)
// fmul8(signed byte zp($10) aa, signed byte zp($11) bb)
fmul8: {
// *ap = a
stx ap
// *bp = b
sta bp
.label aa = $10
.label bb = $11
.label cc = $12
// cc
lda #0
sta.z cc
// asm
txa
lda aa
sta A1+1
eor #$ff
sta A2+1
ldx bp
ldx bb
sec
A1:
lda mulf_sqr1,x
A2:
sbc mulf_sqr2,x
sta cp
// return *cp;
sta cc
// return cc;
// }
rts
}

View File

@ -31,10 +31,10 @@ main::@3: scope:[main] from main::@6 main::@8
[15] main::j#2 = phi( main::@8/main::j#1, main::@6/0 )
[15] main::at#6 = phi( main::@8/main::at#3, main::@6/main::at#12 )
[16] main::at#3 = main::at#6 + 4
[17] fmul8::a#0 = vals[main::i#2]
[18] fmul8::b#0 = vals[main::j#2]
[17] fmul8::aa = vals[main::i#2]
[18] fmul8::bb = vals[main::j#2]
[19] call fmul8
[20] fmul8::return#0 = fmul8::return#1
[20] fmul8::return#0 = fmul8::return#2
to:main::@7
main::@7: scope:[main] from main::@3
[21] main::r#0 = fmul8::return#0
@ -107,14 +107,14 @@ print_schar_at::@4: scope:[print_schar_at] from print_schar_at::@1
[56] print_schar_at::b#0 = - print_schar_at::b#4
to:print_schar_at::@2
signed byte fmul8(signed byte fmul8::a , signed byte fmul8::b)
signed byte fmul8(volatile signed byte fmul8::aa , volatile signed byte fmul8::bb)
fmul8: scope:[fmul8] from main::@3
[57] *ap = fmul8::a#0
[58] *bp = fmul8::b#0
asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp }
[60] fmul8::return#1 = *cp
[57] fmul8::cc = 0
asm { ldaaa staA1+1 eor#$ff staA2+1 ldxbb sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacc }
[59] fmul8::return#1 = fmul8::cc
to:fmul8::@return
fmul8::@return: scope:[fmul8] from fmul8
[60] fmul8::return#2 = fmul8::return#1
[61] return
to:@return

View File

@ -1,5 +1,8 @@
Resolved forward reference mulf_sqr1 to mulf_sqr1
Resolved forward reference mulf_sqr2 to mulf_sqr2
Setting inferred volatile on symbol affected by address-of: fmul8::aa in asm { ldaaa staA1+1 eor#$ff staA2+1 ldxbb sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacc }
Setting inferred volatile on symbol affected by address-of: fmul8::bb in asm { ldaaa staA1+1 eor#$ff staA2+1 ldxbb sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacc }
Setting inferred volatile on symbol affected by address-of: fmul8::cc in asm { ldaaa staA1+1 eor#$ff staA2+1 ldxbb sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacc }
Inlined call call __init
CONTROL FLOW GRAPH SSA
@ -195,8 +198,8 @@ main::@4: scope:[main] from main::@10 main::@8
main::i#3 = phi( main::@10/main::i#5, main::@8/main::i#6 )
main::at#6 = phi( main::@10/main::at#8, main::@8/main::at#9 )
main::at#3 = main::at#6 + 4
fmul8::a#0 = vals[main::i#3]
fmul8::b#0 = vals[main::j#2]
fmul8::aa = vals[main::i#3]
fmul8::bb = vals[main::j#2]
call fmul8
fmul8::return#0 = fmul8::return#2
to:main::@9
@ -269,14 +272,11 @@ init_screen::@return: scope:[init_screen] from init_screen::@3
return
to:@return
signed byte fmul8(signed byte fmul8::a , signed byte fmul8::b)
signed byte fmul8(volatile signed byte fmul8::aa , volatile signed byte fmul8::bb)
fmul8: scope:[fmul8] from main::@4
fmul8::b#1 = phi( main::@4/fmul8::b#0 )
fmul8::a#1 = phi( main::@4/fmul8::a#0 )
*ap = fmul8::a#1
*bp = fmul8::b#1
asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp }
fmul8::return#1 = *cp
fmul8::cc = 0
asm { ldaaa staA1+1 eor#$ff staA2+1 ldxbb sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacc }
fmul8::return#1 = fmul8::cc
to:fmul8::@return
fmul8::@return: scope:[fmul8] from fmul8
fmul8::return#4 = phi( fmul8/fmul8::return#1 )
@ -309,16 +309,10 @@ const byte RADIX::DECIMAL = $a
const byte RADIX::HEXADECIMAL = $10
const byte RADIX::OCTAL = 8
void __start()
const signed byte* ap = (signed byte*)$fd
const signed byte* bp = (signed byte*)$fe
const signed byte* cp = (signed byte*)$ff
signed byte fmul8(signed byte fmul8::a , signed byte fmul8::b)
signed byte fmul8::a
signed byte fmul8::a#0
signed byte fmul8::a#1
signed byte fmul8::b
signed byte fmul8::b#0
signed byte fmul8::b#1
signed byte fmul8(volatile signed byte fmul8::aa , volatile signed byte fmul8::bb)
volatile signed byte fmul8::aa loadstore
volatile signed byte fmul8::bb loadstore
volatile signed byte fmul8::cc loadstore
signed byte fmul8::return
signed byte fmul8::return#0
signed byte fmul8::return#1
@ -527,9 +521,6 @@ Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast memset::dst#0 = (byte*)memset::str#2
Inlining cast memset::num#0 = (unumber)$3e8
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (signed byte*) 253
Simplifying constant pointer cast (signed byte*) 254
Simplifying constant pointer cast (signed byte*) 255
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 1
@ -570,6 +561,7 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in print_uchar_at::$2 = print_uchar_at::b#2 & $f
Inversing boolean not [2] memset::$1 = memset::num#1 <= 0 from [1] memset::$0 = memset::num#1 > 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#4 fmul8::return#2
Alias memset::return#0 = memset::str#1 memset::return#3 memset::return#1
Alias memset::str#2 = memset::str#3
Alias memset::num#1 = memset::num#2
@ -599,11 +591,12 @@ Alias main::i#3 = main::i#7 main::i#5 main::i#4
Alias main::at_line#4 = main::at_line#8 main::at_line#9 main::at_line#6
Alias main::r#0 = main::$5
Alias init_screen::COLS#2 = init_screen::COLS#4
Alias fmul8::return#1 = fmul8::return#4 fmul8::return#2
Alias print_screen#0 = print_screen#7 print_screen#5 print_screen#3 print_screen#1
Successful SSA optimization Pass2AliasElimination
Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#4 fmul8::return#2
Alias print_schar_at::at#3 = print_schar_at::at#5
Successful SSA optimization Pass2AliasElimination
Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#4 fmul8::return#2
Identical Phi Values memset::num#1 memset::num#0
Identical Phi Values memset::str#2 memset::str#0
Identical Phi Values memset::c#3 memset::c#0
@ -619,8 +612,7 @@ Identical Phi Values main::i#3 main::i#2
Identical Phi Values main::at_line#4 main::at#2
Identical Phi Values print_screen#4 print_screen#6
Identical Phi Values init_screen::COLS#2 init_screen::COLS#0
Identical Phi Values fmul8::a#1 fmul8::a#0
Identical Phi Values fmul8::b#1 fmul8::b#0
Identical Phi Values fmul8::return#4 fmul8::return#1
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values memset::return#0 memset::str#0
Successful SSA optimization Pass2IdenticalPhiElimination
@ -693,12 +685,14 @@ Finalized unsigned number type (byte) 9
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) $19
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#2
Constant right-side identified [0] memset::end#0 = memset::$4 + memset::num#0
Constant right-side identified [33] main::at#0 = main::at_line#0 + 4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant memset::end#0 = memset::$4+memset::num#0
Constant main::at#0 = main::at_line#0+4
Successful SSA optimization Pass2ConstantIdentification
Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#2
Inlining constant with var siblings memset::dst#0
Inlining constant with var siblings print_char_at::ch#0
Inlining constant with var siblings print_char_at::ch#1
@ -723,6 +717,8 @@ Constant inlined main::at_line#0 = (byte*) 1024
Constant inlined main::at#0 = (byte*) 1024+4
Constant inlined init_screen::COLS#0 = (byte*) 55296
Successful SSA optimization Pass2ConstantInlining
Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#2
Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#2
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) $a
@ -730,6 +726,8 @@ Finalized unsigned number type (byte) $10
Finalized unsigned number type (word) $200
Finalized unsigned number type (word) $200
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#2
Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#2
Added new block during phi lifting main::@11(between main::@7 and main::@1)
Added new block during phi lifting main::@12(between main::@5 and main::@3)
Added new block during phi lifting main::@13(between main::@10 and main::@4)
@ -846,10 +844,10 @@ main::@3: scope:[main] from main::@6 main::@8
[15] main::j#2 = phi( main::@8/main::j#1, main::@6/0 )
[15] main::at#6 = phi( main::@8/main::at#3, main::@6/main::at#12 )
[16] main::at#3 = main::at#6 + 4
[17] fmul8::a#0 = vals[main::i#2]
[18] fmul8::b#0 = vals[main::j#2]
[17] fmul8::aa = vals[main::i#2]
[18] fmul8::bb = vals[main::j#2]
[19] call fmul8
[20] fmul8::return#0 = fmul8::return#1
[20] fmul8::return#0 = fmul8::return#2
to:main::@7
main::@7: scope:[main] from main::@3
[21] main::r#0 = fmul8::return#0
@ -922,14 +920,14 @@ print_schar_at::@4: scope:[print_schar_at] from print_schar_at::@1
[56] print_schar_at::b#0 = - print_schar_at::b#4
to:print_schar_at::@2
signed byte fmul8(signed byte fmul8::a , signed byte fmul8::b)
signed byte fmul8(volatile signed byte fmul8::aa , volatile signed byte fmul8::bb)
fmul8: scope:[fmul8] from main::@3
[57] *ap = fmul8::a#0
[58] *bp = fmul8::b#0
asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp }
[60] fmul8::return#1 = *cp
[57] fmul8::cc = 0
asm { ldaaa staA1+1 eor#$ff staA2+1 ldxbb sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacc }
[59] fmul8::return#1 = fmul8::cc
to:fmul8::@return
fmul8::@return: scope:[fmul8] from fmul8
[60] fmul8::return#2 = fmul8::return#1
[61] return
to:@return
@ -987,14 +985,14 @@ memset::@2: scope:[memset] from memset::@1
VARIABLE REGISTER WEIGHTS
signed byte fmul8(signed byte fmul8::a , signed byte fmul8::b)
signed byte fmul8::a
signed byte fmul8::a#0 551.0
signed byte fmul8::b
signed byte fmul8::b#0 551.0
signed byte fmul8(volatile signed byte fmul8::aa , volatile signed byte fmul8::bb)
volatile signed byte fmul8::aa loadstore 33.666666666666664
volatile signed byte fmul8::bb loadstore 50.5
volatile signed byte fmul8::cc loadstore 1001.0
signed byte fmul8::return
signed byte fmul8::return#0 202.0
signed byte fmul8::return#1 367.33333333333337
signed byte fmul8::return#1 2002.0
signed byte fmul8::return#2 367.33333333333337
void init_screen()
byte* init_screen::COLS
byte* init_screen::COLS#1 67.33333333333333
@ -1084,13 +1082,15 @@ Initial phi equivalence classes
[ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ]
[ print_char_at::at#4 print_char_at::at#0 print_char_at::at#1 print_char_at::at#2 print_char_at::at#3 ]
[ memset::dst#2 memset::dst#1 ]
Added variable fmul8::a#0 to live range equivalence class [ fmul8::a#0 ]
Added variable fmul8::b#0 to live range equivalence class [ fmul8::b#0 ]
Added variable fmul8::aa to live range equivalence class [ fmul8::aa ]
Added variable fmul8::bb to live range equivalence class [ fmul8::bb ]
Added variable fmul8::return#0 to live range equivalence class [ fmul8::return#0 ]
Added variable main::r#0 to live range equivalence class [ main::r#0 ]
Added variable print_uchar_at::at#0 to live range equivalence class [ print_uchar_at::at#0 ]
Added variable print_uchar_at::b#0 to live range equivalence class [ print_uchar_at::b#0 ]
Added variable fmul8::cc to live range equivalence class [ fmul8::cc ]
Added variable fmul8::return#1 to live range equivalence class [ fmul8::return#1 ]
Added variable fmul8::return#2 to live range equivalence class [ fmul8::return#2 ]
Added variable print_uchar_at::$0 to live range equivalence class [ print_uchar_at::$0 ]
Added variable print_uchar_at::$2 to live range equivalence class [ print_uchar_at::$2 ]
Complete equivalence classes
@ -1108,13 +1108,15 @@ Complete equivalence classes
[ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ]
[ print_char_at::at#4 print_char_at::at#0 print_char_at::at#1 print_char_at::at#2 print_char_at::at#3 ]
[ memset::dst#2 memset::dst#1 ]
[ fmul8::a#0 ]
[ fmul8::b#0 ]
[ fmul8::aa ]
[ fmul8::bb ]
[ fmul8::return#0 ]
[ main::r#0 ]
[ print_uchar_at::at#0 ]
[ print_uchar_at::b#0 ]
[ fmul8::cc ]
[ fmul8::return#1 ]
[ fmul8::return#2 ]
[ print_uchar_at::$0 ]
[ print_uchar_at::$2 ]
Allocated zp[1]:2 [ main::k#2 main::k#1 ]
@ -1131,15 +1133,17 @@ Allocated zp[1]:17 [ print_schar_at::b#6 print_schar_at::b#0 print_schar_at::b#4
Allocated zp[1]:18 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ]
Allocated zp[2]:19 [ print_char_at::at#4 print_char_at::at#0 print_char_at::at#1 print_char_at::at#2 print_char_at::at#3 ]
Allocated zp[2]:21 [ memset::dst#2 memset::dst#1 ]
Allocated zp[1]:23 [ fmul8::a#0 ]
Allocated zp[1]:24 [ fmul8::b#0 ]
Allocated zp[1]:23 [ fmul8::aa ]
Allocated zp[1]:24 [ fmul8::bb ]
Allocated zp[1]:25 [ fmul8::return#0 ]
Allocated zp[1]:26 [ main::r#0 ]
Allocated zp[2]:27 [ print_uchar_at::at#0 ]
Allocated zp[1]:29 [ print_uchar_at::b#0 ]
Allocated zp[1]:30 [ fmul8::return#1 ]
Allocated zp[1]:31 [ print_uchar_at::$0 ]
Allocated zp[1]:32 [ print_uchar_at::$2 ]
Allocated zp[1]:30 [ fmul8::cc ]
Allocated zp[1]:31 [ fmul8::return#1 ]
Allocated zp[1]:32 [ fmul8::return#2 ]
Allocated zp[1]:33 [ print_uchar_at::$0 ]
Allocated zp[1]:34 [ print_uchar_at::$2 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] print_schar_at::at#0 = main::at#4 [ main::k#2 main::at#4 print_schar_at::b#1 print_schar_at::at#0 ] ( [ main::k#2 main::at#4 print_schar_at::b#1 print_schar_at::at#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::k#2 main::k#1 ]
@ -1149,8 +1153,10 @@ Statement [10] main::at#2 = main::at_line#2 + $28 [ main::i#2 main::at#2 ] ( [
Removing always clobbered register reg byte a as potential for zp[1]:7 [ main::i#2 main::i#1 ]
Statement [12] print_schar_at::at#1 = main::at#2 [ main::i#2 main::at#2 print_schar_at::b#2 print_schar_at::at#1 ] ( [ main::i#2 main::at#2 print_schar_at::b#2 print_schar_at::at#1 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } } ) always clobbers reg byte a
Statement [14] main::at#12 = main::at#2 [ main::i#2 main::at#2 main::at#12 ] ( [ main::i#2 main::at#2 main::at#12 ] { } ) always clobbers reg byte a
Statement [16] main::at#3 = main::at#6 + 4 [ main::i#2 main::at#2 main::j#2 main::at#3 ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 ] { { fmul8::return#0 = fmul8::return#1 } } ) always clobbers reg byte a
Statement [16] main::at#3 = main::at#6 + 4 [ main::i#2 main::at#2 main::j#2 main::at#3 ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 ] { { fmul8::return#0 = fmul8::return#2 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:10 [ main::j#2 main::j#1 ]
Statement [17] fmul8::aa = vals[main::i#2] [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::aa ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::aa ] { { fmul8::return#0 = fmul8::return#2 } } ) always clobbers reg byte a
Statement [18] fmul8::bb = vals[main::j#2] [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::aa fmul8::bb ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::aa fmul8::bb ] { { fmul8::return#0 = fmul8::return#2 } } ) always clobbers reg byte a
Statement [23] print_schar_at::at#2 = main::at#3 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#3 print_schar_at::at#2 ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#3 print_schar_at::at#2 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } } ) always clobbers reg byte a
Statement [33] ((byte*) 55296)[init_screen::l#2] = init_screen::WHITE [ init_screen::l#2 ] ( init_screen:1 [ init_screen::l#2 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:11 [ init_screen::l#2 init_screen::l#1 ]
@ -1165,7 +1171,8 @@ Statement [47] print_char_at::at#1 = print_schar_at::at#3 [ print_schar_at::b#4
Statement [50] print_uchar_at::at#0 = print_schar_at::at#3 + 1 [ print_schar_at::b#6 print_uchar_at::at#0 ] ( print_schar_at:5 [ main::k#2 main::at#4 print_schar_at::b#6 print_uchar_at::at#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } } print_schar_at:13 [ main::i#2 main::at#2 print_schar_at::b#6 print_uchar_at::at#0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } } print_schar_at:24 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#6 print_uchar_at::at#0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } } ) always clobbers reg byte a
Statement [54] print_char_at::at#0 = print_schar_at::at#3 [ print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#0 ] ( print_schar_at:5 [ main::k#2 main::at#4 print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#0 main::at#4 } } print_schar_at:13 [ main::i#2 main::at#2 print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#1 main::at#2 } } print_schar_at:24 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#2 main::at#3 } } ) always clobbers reg byte a
Statement [56] print_schar_at::b#0 = - print_schar_at::b#4 [ print_schar_at::at#3 print_schar_at::b#0 ] ( print_schar_at:5 [ main::k#2 main::at#4 print_schar_at::at#3 print_schar_at::b#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } } print_schar_at:13 [ main::i#2 main::at#2 print_schar_at::at#3 print_schar_at::b#0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } } print_schar_at:24 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::at#3 print_schar_at::b#0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } } ) always clobbers reg byte a
Statement asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp } always clobbers reg byte a reg byte x
Statement [57] fmul8::cc = 0 [ fmul8::aa fmul8::bb fmul8::cc ] ( fmul8:19 [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::aa fmul8::bb fmul8::cc ] { { fmul8::return#0 = fmul8::return#2 } } ) always clobbers reg byte a
Statement asm { ldaaa staA1+1 eor#$ff staA2+1 ldxbb sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacc } always clobbers reg byte a reg byte x
Removing always clobbered register reg byte x as potential for zp[1]:7 [ main::i#2 main::i#1 ]
Removing always clobbered register reg byte x as potential for zp[1]:10 [ main::j#2 main::j#1 ]
Statement [66] *print_char_at::at#4 = print_char_at::ch#4 [ ] ( print_schar_at:5::print_char_at:48 [ main::k#2 main::at#4 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_char_at::at#1 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#0 main::at#4 } } print_schar_at:13::print_char_at:48 [ main::i#2 main::at#2 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_char_at::at#1 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#1 main::at#2 } } print_schar_at:24::print_char_at:48 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_char_at::at#1 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#2 main::at#3 } } print_schar_at:5::print_char_at:55 [ main::k#2 main::at#4 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#0 main::at#4 } } print_schar_at:13::print_char_at:55 [ main::i#2 main::at#2 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#1 main::at#2 } } print_schar_at:24::print_char_at:55 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#2 main::at#3 } } print_schar_at:5::print_uchar_at:52::print_char_at:71 [ main::k#2 main::at#4 print_uchar_at::at#0 print_uchar_at::b#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:13::print_uchar_at:52::print_char_at:71 [ main::i#2 main::at#2 print_uchar_at::at#0 print_uchar_at::b#0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:24::print_uchar_at:52::print_char_at:71 [ main::i#2 main::at#2 main::j#2 main::at#3 print_uchar_at::at#0 print_uchar_at::b#0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:5::print_uchar_at:52::print_char_at:75 [ main::k#2 main::at#4 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:13::print_uchar_at:52::print_char_at:75 [ main::i#2 main::at#2 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:24::print_uchar_at:52::print_char_at:75 [ main::i#2 main::at#2 main::j#2 main::at#3 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } ) always clobbers reg byte y
@ -1180,7 +1187,7 @@ Statement [70] print_char_at::at#2 = print_uchar_at::at#0 [ print_uchar_at::at#0
Removing always clobbered register reg byte a as potential for zp[1]:18 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ]
Statement [72] print_uchar_at::$2 = print_uchar_at::b#0 & $f [ print_uchar_at::at#0 print_uchar_at::$2 ] ( print_schar_at:5::print_uchar_at:52 [ main::k#2 main::at#4 print_uchar_at::at#0 print_uchar_at::$2 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:13::print_uchar_at:52 [ main::i#2 main::at#2 print_uchar_at::at#0 print_uchar_at::$2 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:24::print_uchar_at:52 [ main::i#2 main::at#2 main::j#2 main::at#3 print_uchar_at::at#0 print_uchar_at::$2 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } ) always clobbers reg byte a
Statement [73] print_char_at::at#3 = print_uchar_at::at#0 + 1 [ print_char_at::at#3 print_uchar_at::$2 ] ( print_schar_at:5::print_uchar_at:52 [ main::k#2 main::at#4 print_char_at::at#3 print_uchar_at::$2 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:13::print_uchar_at:52 [ main::i#2 main::at#2 print_char_at::at#3 print_uchar_at::$2 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:24::print_uchar_at:52 [ main::i#2 main::at#2 main::j#2 main::at#3 print_char_at::at#3 print_uchar_at::$2 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:32 [ print_uchar_at::$2 ]
Removing always clobbered register reg byte a as potential for zp[1]:34 [ print_uchar_at::$2 ]
Statement [79] if(memset::dst#2!=memset::end#0) goto memset::@2 [ memset::dst#2 ] ( init_screen:1::print_cls:31::memset:63 [ memset::dst#2 ] { } ) always clobbers reg byte a
Statement [81] *memset::dst#2 = memset::c#0 [ memset::dst#2 ] ( init_screen:1::print_cls:31::memset:63 [ memset::dst#2 ] { } ) always clobbers reg byte a reg byte y
Statement [4] print_schar_at::at#0 = main::at#4 [ main::k#2 main::at#4 print_schar_at::b#1 print_schar_at::at#0 ] ( [ main::k#2 main::at#4 print_schar_at::b#1 print_schar_at::at#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } } ) always clobbers reg byte a
@ -1189,10 +1196,9 @@ Statement [10] main::at#2 = main::at_line#2 + $28 [ main::i#2 main::at#2 ] ( [
Statement [11] print_schar_at::b#2 = vals[main::i#2] [ main::i#2 main::at#2 print_schar_at::b#2 ] ( [ main::i#2 main::at#2 print_schar_at::b#2 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } } ) always clobbers reg byte y
Statement [12] print_schar_at::at#1 = main::at#2 [ main::i#2 main::at#2 print_schar_at::b#2 print_schar_at::at#1 ] ( [ main::i#2 main::at#2 print_schar_at::b#2 print_schar_at::at#1 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } } ) always clobbers reg byte a
Statement [14] main::at#12 = main::at#2 [ main::i#2 main::at#2 main::at#12 ] ( [ main::i#2 main::at#2 main::at#12 ] { } ) always clobbers reg byte a
Statement [16] main::at#3 = main::at#6 + 4 [ main::i#2 main::at#2 main::j#2 main::at#3 ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 ] { { fmul8::return#0 = fmul8::return#1 } } ) always clobbers reg byte a
Statement [17] fmul8::a#0 = vals[main::i#2] [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::a#0 ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::a#0 ] { { fmul8::return#0 = fmul8::return#1 } } ) always clobbers reg byte y
Statement [18] fmul8::b#0 = vals[main::j#2] [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::a#0 fmul8::b#0 ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::a#0 fmul8::b#0 ] { { fmul8::return#0 = fmul8::return#1 } } ) always clobbers reg byte y
Removing always clobbered register reg byte y as potential for zp[1]:23 [ fmul8::a#0 ]
Statement [16] main::at#3 = main::at#6 + 4 [ main::i#2 main::at#2 main::j#2 main::at#3 ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 ] { { fmul8::return#0 = fmul8::return#2 } } ) always clobbers reg byte a
Statement [17] fmul8::aa = vals[main::i#2] [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::aa ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::aa ] { { fmul8::return#0 = fmul8::return#2 } } ) always clobbers reg byte a reg byte y
Statement [18] fmul8::bb = vals[main::j#2] [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::aa fmul8::bb ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::aa fmul8::bb ] { { fmul8::return#0 = fmul8::return#2 } } ) always clobbers reg byte a reg byte y
Statement [23] print_schar_at::at#2 = main::at#3 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#3 print_schar_at::at#2 ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#3 print_schar_at::at#2 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } } ) always clobbers reg byte a
Statement [26] if(main::j#1!=9) goto main::@3 [ main::i#2 main::at#2 main::at#3 main::j#1 ] ( [ main::i#2 main::at#2 main::at#3 main::j#1 ] { } ) always clobbers reg byte a
Statement [28] if(main::i#1!=9) goto main::@2 [ main::at#2 main::i#1 ] ( [ main::at#2 main::i#1 ] { } ) always clobbers reg byte a
@ -1206,37 +1212,8 @@ Statement [47] print_char_at::at#1 = print_schar_at::at#3 [ print_schar_at::b#4
Statement [50] print_uchar_at::at#0 = print_schar_at::at#3 + 1 [ print_schar_at::b#6 print_uchar_at::at#0 ] ( print_schar_at:5 [ main::k#2 main::at#4 print_schar_at::b#6 print_uchar_at::at#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } } print_schar_at:13 [ main::i#2 main::at#2 print_schar_at::b#6 print_uchar_at::at#0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } } print_schar_at:24 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#6 print_uchar_at::at#0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } } ) always clobbers reg byte a
Statement [54] print_char_at::at#0 = print_schar_at::at#3 [ print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#0 ] ( print_schar_at:5 [ main::k#2 main::at#4 print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#0 main::at#4 } } print_schar_at:13 [ main::i#2 main::at#2 print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#1 main::at#2 } } print_schar_at:24 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#2 main::at#3 } } ) always clobbers reg byte a
Statement [56] print_schar_at::b#0 = - print_schar_at::b#4 [ print_schar_at::at#3 print_schar_at::b#0 ] ( print_schar_at:5 [ main::k#2 main::at#4 print_schar_at::at#3 print_schar_at::b#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } } print_schar_at:13 [ main::i#2 main::at#2 print_schar_at::at#3 print_schar_at::b#0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } } print_schar_at:24 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::at#3 print_schar_at::b#0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } } ) always clobbers reg byte a
Statement asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp } always clobbers reg byte a reg byte x
Statement [66] *print_char_at::at#4 = print_char_at::ch#4 [ ] ( print_schar_at:5::print_char_at:48 [ main::k#2 main::at#4 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_char_at::at#1 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#0 main::at#4 } } print_schar_at:13::print_char_at:48 [ main::i#2 main::at#2 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_char_at::at#1 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#1 main::at#2 } } print_schar_at:24::print_char_at:48 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_char_at::at#1 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#2 main::at#3 } } print_schar_at:5::print_char_at:55 [ main::k#2 main::at#4 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#0 main::at#4 } } print_schar_at:13::print_char_at:55 [ main::i#2 main::at#2 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#1 main::at#2 } } print_schar_at:24::print_char_at:55 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#2 main::at#3 } } print_schar_at:5::print_uchar_at:52::print_char_at:71 [ main::k#2 main::at#4 print_uchar_at::at#0 print_uchar_at::b#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:13::print_uchar_at:52::print_char_at:71 [ main::i#2 main::at#2 print_uchar_at::at#0 print_uchar_at::b#0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:24::print_uchar_at:52::print_char_at:71 [ main::i#2 main::at#2 main::j#2 main::at#3 print_uchar_at::at#0 print_uchar_at::b#0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:5::print_uchar_at:52::print_char_at:75 [ main::k#2 main::at#4 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:13::print_uchar_at:52::print_char_at:75 [ main::i#2 main::at#2 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:24::print_uchar_at:52::print_char_at:75 [ main::i#2 main::at#2 main::j#2 main::at#3 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } ) always clobbers reg byte a reg byte y
Statement [68] print_uchar_at::$0 = print_uchar_at::b#0 >> 4 [ print_uchar_at::at#0 print_uchar_at::b#0 print_uchar_at::$0 ] ( print_schar_at:5::print_uchar_at:52 [ main::k#2 main::at#4 print_uchar_at::at#0 print_uchar_at::b#0 print_uchar_at::$0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:13::print_uchar_at:52 [ main::i#2 main::at#2 print_uchar_at::at#0 print_uchar_at::b#0 print_uchar_at::$0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:24::print_uchar_at:52 [ main::i#2 main::at#2 main::j#2 main::at#3 print_uchar_at::at#0 print_uchar_at::b#0 print_uchar_at::$0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } ) always clobbers reg byte a
Statement [70] print_char_at::at#2 = print_uchar_at::at#0 [ print_uchar_at::at#0 print_uchar_at::b#0 print_char_at::ch#2 print_char_at::at#2 ] ( print_schar_at:5::print_uchar_at:52 [ main::k#2 main::at#4 print_uchar_at::at#0 print_uchar_at::b#0 print_char_at::ch#2 print_char_at::at#2 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:13::print_uchar_at:52 [ main::i#2 main::at#2 print_uchar_at::at#0 print_uchar_at::b#0 print_char_at::ch#2 print_char_at::at#2 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:24::print_uchar_at:52 [ main::i#2 main::at#2 main::j#2 main::at#3 print_uchar_at::at#0 print_uchar_at::b#0 print_char_at::ch#2 print_char_at::at#2 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } ) always clobbers reg byte a
Statement [72] print_uchar_at::$2 = print_uchar_at::b#0 & $f [ print_uchar_at::at#0 print_uchar_at::$2 ] ( print_schar_at:5::print_uchar_at:52 [ main::k#2 main::at#4 print_uchar_at::at#0 print_uchar_at::$2 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:13::print_uchar_at:52 [ main::i#2 main::at#2 print_uchar_at::at#0 print_uchar_at::$2 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:24::print_uchar_at:52 [ main::i#2 main::at#2 main::j#2 main::at#3 print_uchar_at::at#0 print_uchar_at::$2 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } ) always clobbers reg byte a
Statement [73] print_char_at::at#3 = print_uchar_at::at#0 + 1 [ print_char_at::at#3 print_uchar_at::$2 ] ( print_schar_at:5::print_uchar_at:52 [ main::k#2 main::at#4 print_char_at::at#3 print_uchar_at::$2 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:13::print_uchar_at:52 [ main::i#2 main::at#2 print_char_at::at#3 print_uchar_at::$2 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:24::print_uchar_at:52 [ main::i#2 main::at#2 main::j#2 main::at#3 print_char_at::at#3 print_uchar_at::$2 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } ) always clobbers reg byte a
Statement [79] if(memset::dst#2!=memset::end#0) goto memset::@2 [ memset::dst#2 ] ( init_screen:1::print_cls:31::memset:63 [ memset::dst#2 ] { } ) always clobbers reg byte a
Statement [81] *memset::dst#2 = memset::c#0 [ memset::dst#2 ] ( init_screen:1::print_cls:31::memset:63 [ memset::dst#2 ] { } ) always clobbers reg byte a reg byte y
Statement [4] print_schar_at::at#0 = main::at#4 [ main::k#2 main::at#4 print_schar_at::b#1 print_schar_at::at#0 ] ( [ main::k#2 main::at#4 print_schar_at::b#1 print_schar_at::at#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } } ) always clobbers reg byte a
Statement [6] main::at#1 = main::at#4 + 4 [ main::k#2 main::at#1 ] ( [ main::k#2 main::at#1 ] { } ) always clobbers reg byte a
Statement [10] main::at#2 = main::at_line#2 + $28 [ main::i#2 main::at#2 ] ( [ main::i#2 main::at#2 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } } ) always clobbers reg byte a
Statement [11] print_schar_at::b#2 = vals[main::i#2] [ main::i#2 main::at#2 print_schar_at::b#2 ] ( [ main::i#2 main::at#2 print_schar_at::b#2 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } } ) always clobbers reg byte y
Statement [12] print_schar_at::at#1 = main::at#2 [ main::i#2 main::at#2 print_schar_at::b#2 print_schar_at::at#1 ] ( [ main::i#2 main::at#2 print_schar_at::b#2 print_schar_at::at#1 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } } ) always clobbers reg byte a
Statement [14] main::at#12 = main::at#2 [ main::i#2 main::at#2 main::at#12 ] ( [ main::i#2 main::at#2 main::at#12 ] { } ) always clobbers reg byte a
Statement [16] main::at#3 = main::at#6 + 4 [ main::i#2 main::at#2 main::j#2 main::at#3 ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 ] { { fmul8::return#0 = fmul8::return#1 } } ) always clobbers reg byte a
Statement [17] fmul8::a#0 = vals[main::i#2] [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::a#0 ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::a#0 ] { { fmul8::return#0 = fmul8::return#1 } } ) always clobbers reg byte y
Statement [18] fmul8::b#0 = vals[main::j#2] [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::a#0 fmul8::b#0 ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::a#0 fmul8::b#0 ] { { fmul8::return#0 = fmul8::return#1 } } ) always clobbers reg byte y
Statement [23] print_schar_at::at#2 = main::at#3 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#3 print_schar_at::at#2 ] ( [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#3 print_schar_at::at#2 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } } ) always clobbers reg byte a
Statement [26] if(main::j#1!=9) goto main::@3 [ main::i#2 main::at#2 main::at#3 main::j#1 ] ( [ main::i#2 main::at#2 main::at#3 main::j#1 ] { } ) always clobbers reg byte a
Statement [28] if(main::i#1!=9) goto main::@2 [ main::at#2 main::i#1 ] ( [ main::at#2 main::i#1 ] { } ) always clobbers reg byte a
Statement [33] ((byte*) 55296)[init_screen::l#2] = init_screen::WHITE [ init_screen::l#2 ] ( init_screen:1 [ init_screen::l#2 ] { } ) always clobbers reg byte a
Statement [37] *init_screen::COLS#3 = init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( init_screen:1 [ init_screen::COLS#3 init_screen::m#2 ] { } ) always clobbers reg byte a reg byte y
Statement [38] init_screen::COLS#3[1] = init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( init_screen:1 [ init_screen::COLS#3 init_screen::m#2 ] { } ) always clobbers reg byte a reg byte y
Statement [39] init_screen::COLS#3[2] = init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( init_screen:1 [ init_screen::COLS#3 init_screen::m#2 ] { } ) always clobbers reg byte a reg byte y
Statement [40] init_screen::COLS#3[3] = init_screen::WHITE [ init_screen::COLS#3 init_screen::m#2 ] ( init_screen:1 [ init_screen::COLS#3 init_screen::m#2 ] { } ) always clobbers reg byte a reg byte y
Statement [41] init_screen::COLS#1 = init_screen::COLS#3 + $28 [ init_screen::m#2 init_screen::COLS#1 ] ( init_screen:1 [ init_screen::m#2 init_screen::COLS#1 ] { } ) always clobbers reg byte a
Statement [47] print_char_at::at#1 = print_schar_at::at#3 [ print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#1 ] ( print_schar_at:5 [ main::k#2 main::at#4 print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#1 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_char_at::at#1 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#0 main::at#4 } } print_schar_at:13 [ main::i#2 main::at#2 print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#1 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_char_at::at#1 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#1 main::at#2 } } print_schar_at:24 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#1 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_char_at::at#1 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#2 main::at#3 } } ) always clobbers reg byte a
Statement [50] print_uchar_at::at#0 = print_schar_at::at#3 + 1 [ print_schar_at::b#6 print_uchar_at::at#0 ] ( print_schar_at:5 [ main::k#2 main::at#4 print_schar_at::b#6 print_uchar_at::at#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } } print_schar_at:13 [ main::i#2 main::at#2 print_schar_at::b#6 print_uchar_at::at#0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } } print_schar_at:24 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#6 print_uchar_at::at#0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } } ) always clobbers reg byte a
Statement [54] print_char_at::at#0 = print_schar_at::at#3 [ print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#0 ] ( print_schar_at:5 [ main::k#2 main::at#4 print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#0 main::at#4 } } print_schar_at:13 [ main::i#2 main::at#2 print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#1 main::at#2 } } print_schar_at:24 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#4 print_schar_at::at#3 print_char_at::at#0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#2 main::at#3 } } ) always clobbers reg byte a
Statement [56] print_schar_at::b#0 = - print_schar_at::b#4 [ print_schar_at::at#3 print_schar_at::b#0 ] ( print_schar_at:5 [ main::k#2 main::at#4 print_schar_at::at#3 print_schar_at::b#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } } print_schar_at:13 [ main::i#2 main::at#2 print_schar_at::at#3 print_schar_at::b#0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } } print_schar_at:24 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::at#3 print_schar_at::b#0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } } ) always clobbers reg byte a
Statement asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp } always clobbers reg byte a reg byte x
Statement [57] fmul8::cc = 0 [ fmul8::aa fmul8::bb fmul8::cc ] ( fmul8:19 [ main::i#2 main::at#2 main::j#2 main::at#3 fmul8::aa fmul8::bb fmul8::cc ] { { fmul8::return#0 = fmul8::return#2 } } ) always clobbers reg byte a
Statement asm { ldaaa staA1+1 eor#$ff staA2+1 ldxbb sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacc } always clobbers reg byte a reg byte x
Statement [66] *print_char_at::at#4 = print_char_at::ch#4 [ ] ( print_schar_at:5::print_char_at:48 [ main::k#2 main::at#4 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_char_at::at#1 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#0 main::at#4 } } print_schar_at:13::print_char_at:48 [ main::i#2 main::at#2 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_char_at::at#1 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#1 main::at#2 } } print_schar_at:24::print_char_at:48 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_char_at::at#1 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#2 main::at#3 } } print_schar_at:5::print_char_at:55 [ main::k#2 main::at#4 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#0 main::at#4 } } print_schar_at:13::print_char_at:55 [ main::i#2 main::at#2 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#1 main::at#2 } } print_schar_at:24::print_char_at:55 [ main::i#2 main::at#2 main::j#2 main::at#3 print_schar_at::b#4 print_schar_at::at#3 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_char_at::at#0 = print_char_at::at#4 print_schar_at::at#3 print_schar_at::at#2 main::at#3 } } print_schar_at:5::print_uchar_at:52::print_char_at:71 [ main::k#2 main::at#4 print_uchar_at::at#0 print_uchar_at::b#0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:13::print_uchar_at:52::print_char_at:71 [ main::i#2 main::at#2 print_uchar_at::at#0 print_uchar_at::b#0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:24::print_uchar_at:52::print_char_at:71 [ main::i#2 main::at#2 main::j#2 main::at#3 print_uchar_at::at#0 print_uchar_at::b#0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:5::print_uchar_at:52::print_char_at:75 [ main::k#2 main::at#4 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:13::print_uchar_at:52::print_char_at:75 [ main::i#2 main::at#2 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } print_schar_at:24::print_uchar_at:52::print_char_at:75 [ main::i#2 main::at#2 main::j#2 main::at#3 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#3 = print_char_at::ch#4 } { print_char_at::at#3 = print_char_at::at#4 } } ) always clobbers reg byte a reg byte y
Statement [68] print_uchar_at::$0 = print_uchar_at::b#0 >> 4 [ print_uchar_at::at#0 print_uchar_at::b#0 print_uchar_at::$0 ] ( print_schar_at:5::print_uchar_at:52 [ main::k#2 main::at#4 print_uchar_at::at#0 print_uchar_at::b#0 print_uchar_at::$0 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:13::print_uchar_at:52 [ main::i#2 main::at#2 print_uchar_at::at#0 print_uchar_at::b#0 print_uchar_at::$0 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:24::print_uchar_at:52 [ main::i#2 main::at#2 main::j#2 main::at#3 print_uchar_at::at#0 print_uchar_at::b#0 print_uchar_at::$0 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } ) always clobbers reg byte a
Statement [70] print_char_at::at#2 = print_uchar_at::at#0 [ print_uchar_at::at#0 print_uchar_at::b#0 print_char_at::ch#2 print_char_at::at#2 ] ( print_schar_at:5::print_uchar_at:52 [ main::k#2 main::at#4 print_uchar_at::at#0 print_uchar_at::b#0 print_char_at::ch#2 print_char_at::at#2 ] { { print_schar_at::b#1 = print_schar_at::b#4 } { print_schar_at::at#0 = print_schar_at::at#3 main::at#4 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:13::print_uchar_at:52 [ main::i#2 main::at#2 print_uchar_at::at#0 print_uchar_at::b#0 print_char_at::ch#2 print_char_at::at#2 ] { { print_schar_at::b#2 = print_schar_at::b#4 } { print_schar_at::at#1 = print_schar_at::at#3 main::at#2 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } print_schar_at:24::print_uchar_at:52 [ main::i#2 main::at#2 main::j#2 main::at#3 print_uchar_at::at#0 print_uchar_at::b#0 print_char_at::ch#2 print_char_at::at#2 ] { { print_schar_at::b#3 = print_schar_at::b#4 main::r#0 } { print_schar_at::at#2 = print_schar_at::at#3 main::at#3 } { print_char_at::ch#2 = print_char_at::ch#4 } { print_char_at::at#2 = print_char_at::at#4 print_uchar_at::at#0 } } ) always clobbers reg byte a
@ -1258,49 +1235,56 @@ Potential registers zp[1]:17 [ print_schar_at::b#6 print_schar_at::b#0 print_sch
Potential registers zp[1]:18 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ] : zp[1]:18 , reg byte x , reg byte y ,
Potential registers zp[2]:19 [ print_char_at::at#4 print_char_at::at#0 print_char_at::at#1 print_char_at::at#2 print_char_at::at#3 ] : zp[2]:19 ,
Potential registers zp[2]:21 [ memset::dst#2 memset::dst#1 ] : zp[2]:21 ,
Potential registers zp[1]:23 [ fmul8::a#0 ] : zp[1]:23 , reg byte a , reg byte x ,
Potential registers zp[1]:24 [ fmul8::b#0 ] : zp[1]:24 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:23 [ fmul8::aa ] : zp[1]:23 ,
Potential registers zp[1]:24 [ fmul8::bb ] : zp[1]:24 ,
Potential registers zp[1]:25 [ fmul8::return#0 ] : zp[1]:25 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:26 [ main::r#0 ] : zp[1]:26 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[2]:27 [ print_uchar_at::at#0 ] : zp[2]:27 ,
Potential registers zp[1]:29 [ print_uchar_at::b#0 ] : zp[1]:29 , reg byte x ,
Potential registers zp[1]:30 [ fmul8::return#1 ] : zp[1]:30 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:31 [ print_uchar_at::$0 ] : zp[1]:31 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:32 [ print_uchar_at::$2 ] : zp[1]:32 , reg byte x , reg byte y ,
Potential registers zp[1]:30 [ fmul8::cc ] : zp[1]:30 ,
Potential registers zp[1]:31 [ fmul8::return#1 ] : zp[1]:31 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:32 [ fmul8::return#2 ] : zp[1]:32 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:33 [ print_uchar_at::$0 ] : zp[1]:33 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:34 [ print_uchar_at::$2 ] : zp[1]:34 , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [print_char_at] 156,012: zp[2]:19 [ print_char_at::at#4 print_char_at::at#0 print_char_at::at#1 print_char_at::at#2 print_char_at::at#3 ] 150,006: zp[1]:18 [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ]
Uplift Scope [print_uchar_at] 20,002: zp[1]:31 [ print_uchar_at::$0 ] 10,001: zp[1]:32 [ print_uchar_at::$2 ] 4,200.6: zp[1]:29 [ print_uchar_at::b#0 ] 3,000.43: zp[2]:27 [ print_uchar_at::at#0 ]
Uplift Scope [print_uchar_at] 20,002: zp[1]:33 [ print_uchar_at::$0 ] 10,001: zp[1]:34 [ print_uchar_at::$2 ] 4,200.6: zp[1]:29 [ print_uchar_at::b#0 ] 3,000.43: zp[2]:27 [ print_uchar_at::at#0 ]
Uplift Scope [memset] 33,336.67: zp[2]:21 [ memset::dst#2 memset::dst#1 ]
Uplift Scope [print_schar_at] 3,647: zp[1]:17 [ print_schar_at::b#6 print_schar_at::b#0 print_schar_at::b#4 print_schar_at::b#1 print_schar_at::b#2 print_schar_at::b#3 ] 636.75: zp[2]:15 [ print_schar_at::at#3 print_schar_at::at#0 print_schar_at::at#1 print_schar_at::at#2 ]
Uplift Scope [fmul8] 551: zp[1]:23 [ fmul8::a#0 ] 551: zp[1]:24 [ fmul8::b#0 ] 367.33: zp[1]:30 [ fmul8::return#1 ] 202: zp[1]:25 [ fmul8::return#0 ]
Uplift Scope [fmul8] 2,002: zp[1]:31 [ fmul8::return#1 ] 1,001: zp[1]:30 [ fmul8::cc ] 367.33: zp[1]:32 [ fmul8::return#2 ] 202: zp[1]:25 [ fmul8::return#0 ] 50.5: zp[1]:24 [ fmul8::bb ] 33.67: zp[1]:23 [ fmul8::aa ]
Uplift Scope [main] 262.55: zp[2]:8 [ main::at#6 main::at#3 main::at#12 ] 202: zp[1]:26 [ main::r#0 ] 181.8: zp[1]:10 [ main::j#2 main::j#1 ] 24.32: zp[2]:5 [ main::at_line#2 main::at#2 ] 23.94: zp[1]:7 [ main::i#2 main::i#1 ] 23.1: zp[1]:2 [ main::k#2 main::k#1 ] 15.58: zp[2]:3 [ main::at#4 main::at#1 ]
Uplift Scope [init_screen] 303: zp[1]:11 [ init_screen::l#2 init_screen::l#1 ] 188.53: zp[2]:12 [ init_screen::COLS#3 init_screen::COLS#1 ] 185.17: zp[1]:14 [ init_screen::m#2 init_screen::m#1 ]
Uplift Scope [RADIX]
Uplift Scope [print_cls]
Uplift Scope []
Uplifting [print_char_at] best 14212 combination zp[2]:19 [ print_char_at::at#4 print_char_at::at#0 print_char_at::at#1 print_char_at::at#2 print_char_at::at#3 ] reg byte x [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ]
Uplifting [print_uchar_at] best 14204 combination reg byte a [ print_uchar_at::$0 ] reg byte y [ print_uchar_at::$2 ] zp[1]:29 [ print_uchar_at::b#0 ] zp[2]:27 [ print_uchar_at::at#0 ]
Uplifting [memset] best 14204 combination zp[2]:21 [ memset::dst#2 memset::dst#1 ]
Uplifting [print_schar_at] best 14204 combination zp[1]:17 [ print_schar_at::b#6 print_schar_at::b#0 print_schar_at::b#4 print_schar_at::b#1 print_schar_at::b#2 print_schar_at::b#3 ] zp[2]:15 [ print_schar_at::at#3 print_schar_at::at#0 print_schar_at::at#1 print_schar_at::at#2 ]
Uplifting [fmul8] best 12695 combination reg byte x [ fmul8::a#0 ] reg byte a [ fmul8::b#0 ] reg byte a [ fmul8::return#1 ] reg byte a [ fmul8::return#0 ]
Limited combination testing to 100 combinations of 192 possible.
Uplifting [main] best 12095 combination zp[2]:8 [ main::at#6 main::at#3 main::at#12 ] reg byte a [ main::r#0 ] zp[1]:10 [ main::j#2 main::j#1 ] zp[2]:5 [ main::at_line#2 main::at#2 ] zp[1]:7 [ main::i#2 main::i#1 ] zp[1]:2 [ main::k#2 main::k#1 ] zp[2]:3 [ main::at#4 main::at#1 ]
Uplifting [init_screen] best 11885 combination reg byte x [ init_screen::l#2 init_screen::l#1 ] zp[2]:12 [ init_screen::COLS#3 init_screen::COLS#1 ] reg byte x [ init_screen::m#2 init_screen::m#1 ]
Uplifting [RADIX] best 11885 combination
Uplifting [print_cls] best 11885 combination
Uplifting [] best 11885 combination
Uplifting [print_char_at] best 14208 combination zp[2]:19 [ print_char_at::at#4 print_char_at::at#0 print_char_at::at#1 print_char_at::at#2 print_char_at::at#3 ] reg byte x [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ]
Uplifting [print_uchar_at] best 14200 combination reg byte a [ print_uchar_at::$0 ] reg byte y [ print_uchar_at::$2 ] zp[1]:29 [ print_uchar_at::b#0 ] zp[2]:27 [ print_uchar_at::at#0 ]
Uplifting [memset] best 14200 combination zp[2]:21 [ memset::dst#2 memset::dst#1 ]
Uplifting [print_schar_at] best 14200 combination zp[1]:17 [ print_schar_at::b#6 print_schar_at::b#0 print_schar_at::b#4 print_schar_at::b#1 print_schar_at::b#2 print_schar_at::b#3 ] zp[2]:15 [ print_schar_at::at#3 print_schar_at::at#0 print_schar_at::at#1 print_schar_at::at#2 ]
Uplifting [fmul8] best 13291 combination reg byte a [ fmul8::return#1 ] zp[1]:30 [ fmul8::cc ] reg byte a [ fmul8::return#2 ] reg byte a [ fmul8::return#0 ] zp[1]:24 [ fmul8::bb ] zp[1]:23 [ fmul8::aa ]
Uplifting [main] best 12691 combination zp[2]:8 [ main::at#6 main::at#3 main::at#12 ] reg byte a [ main::r#0 ] zp[1]:10 [ main::j#2 main::j#1 ] zp[2]:5 [ main::at_line#2 main::at#2 ] zp[1]:7 [ main::i#2 main::i#1 ] zp[1]:2 [ main::k#2 main::k#1 ] zp[2]:3 [ main::at#4 main::at#1 ]
Uplifting [init_screen] best 12481 combination reg byte x [ init_screen::l#2 init_screen::l#1 ] zp[2]:12 [ init_screen::COLS#3 init_screen::COLS#1 ] reg byte x [ init_screen::m#2 init_screen::m#1 ]
Uplifting [RADIX] best 12481 combination
Uplifting [print_cls] best 12481 combination
Uplifting [] best 12481 combination
Attempting to uplift remaining variables inzp[1]:29 [ print_uchar_at::b#0 ]
Uplifting [print_uchar_at] best 11885 combination zp[1]:29 [ print_uchar_at::b#0 ]
Uplifting [print_uchar_at] best 12481 combination zp[1]:29 [ print_uchar_at::b#0 ]
Attempting to uplift remaining variables inzp[1]:17 [ print_schar_at::b#6 print_schar_at::b#0 print_schar_at::b#4 print_schar_at::b#1 print_schar_at::b#2 print_schar_at::b#3 ]
Uplifting [print_schar_at] best 11885 combination zp[1]:17 [ print_schar_at::b#6 print_schar_at::b#0 print_schar_at::b#4 print_schar_at::b#1 print_schar_at::b#2 print_schar_at::b#3 ]
Uplifting [print_schar_at] best 12481 combination zp[1]:17 [ print_schar_at::b#6 print_schar_at::b#0 print_schar_at::b#4 print_schar_at::b#1 print_schar_at::b#2 print_schar_at::b#3 ]
Attempting to uplift remaining variables inzp[1]:30 [ fmul8::cc ]
Uplifting [fmul8] best 12481 combination zp[1]:30 [ fmul8::cc ]
Attempting to uplift remaining variables inzp[1]:10 [ main::j#2 main::j#1 ]
Uplifting [main] best 11885 combination zp[1]:10 [ main::j#2 main::j#1 ]
Uplifting [main] best 12481 combination zp[1]:10 [ main::j#2 main::j#1 ]
Attempting to uplift remaining variables inzp[1]:24 [ fmul8::bb ]
Uplifting [fmul8] best 12481 combination zp[1]:24 [ fmul8::bb ]
Attempting to uplift remaining variables inzp[1]:23 [ fmul8::aa ]
Uplifting [fmul8] best 12481 combination zp[1]:23 [ fmul8::aa ]
Attempting to uplift remaining variables inzp[1]:7 [ main::i#2 main::i#1 ]
Uplifting [main] best 11885 combination zp[1]:7 [ main::i#2 main::i#1 ]
Uplifting [main] best 12481 combination zp[1]:7 [ main::i#2 main::i#1 ]
Attempting to uplift remaining variables inzp[1]:2 [ main::k#2 main::k#1 ]
Uplifting [main] best 11885 combination zp[1]:2 [ main::k#2 main::k#1 ]
Uplifting [main] best 12481 combination zp[1]:2 [ main::k#2 main::k#1 ]
Coalescing zero page register [ zp[2]:15 [ print_schar_at::at#3 print_schar_at::at#0 print_schar_at::at#1 print_schar_at::at#2 ] ] with [ zp[2]:19 [ print_char_at::at#4 print_char_at::at#0 print_char_at::at#1 print_char_at::at#2 print_char_at::at#3 ] ] - score: 2
Coalescing zero page register [ zp[2]:15 [ print_schar_at::at#3 print_schar_at::at#0 print_schar_at::at#1 print_schar_at::at#2 print_char_at::at#4 print_char_at::at#0 print_char_at::at#1 print_char_at::at#2 print_char_at::at#3 ] ] with [ zp[2]:27 [ print_uchar_at::at#0 ] ] - score: 1
Coalescing zero page register [ zp[1]:17 [ print_schar_at::b#6 print_schar_at::b#0 print_schar_at::b#4 print_schar_at::b#1 print_schar_at::b#2 print_schar_at::b#3 ] ] with [ zp[1]:29 [ print_uchar_at::b#0 ] ] - score: 1
@ -1308,6 +1292,9 @@ Coalescing zero page register [ zp[2]:15 [ print_schar_at::at#3 print_schar_at::
Allocated (was zp[2]:15) zp[2]:11 [ print_schar_at::at#3 print_schar_at::at#0 print_schar_at::at#1 print_schar_at::at#2 print_char_at::at#4 print_char_at::at#0 print_char_at::at#1 print_char_at::at#2 print_char_at::at#3 print_uchar_at::at#0 init_screen::COLS#3 init_screen::COLS#1 ]
Allocated (was zp[1]:17) zp[1]:13 [ print_schar_at::b#6 print_schar_at::b#0 print_schar_at::b#4 print_schar_at::b#1 print_schar_at::b#2 print_schar_at::b#3 print_uchar_at::b#0 ]
Allocated (was zp[2]:21) zp[2]:14 [ memset::dst#2 memset::dst#1 ]
Allocated (was zp[1]:23) zp[1]:16 [ fmul8::aa ]
Allocated (was zp[1]:24) zp[1]:17 [ fmul8::bb ]
Allocated (was zp[1]:30) zp[1]:18 [ fmul8::cc ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -1328,10 +1315,6 @@ ASSEMBLER BEFORE OPTIMIZATION
.segment Basic
:BasicUpstart(main)
// Global Constants & labels
// Pointers to a, b and c=a*b
.label ap = $fd
.label bp = $fe
.label cp = $ff
.label print_screen = $400
.segment Code
// main
@ -1468,15 +1451,17 @@ main: {
bcc !+
inc.z at_2+1
!:
// [17] fmul8::a#0 = vals[main::i#2] -- vbsxx=pbsc1_derefidx_vbuz1
// [17] fmul8::aa = vals[main::i#2] -- vbsz1=pbsc1_derefidx_vbuz2
ldy.z i
ldx vals,y
// [18] fmul8::b#0 = vals[main::j#2] -- vbsaa=pbsc1_derefidx_vbuz1
lda vals,y
sta.z fmul8.aa
// [18] fmul8::bb = vals[main::j#2] -- vbsz1=pbsc1_derefidx_vbuz2
ldy.z j
lda vals,y
sta.z fmul8.bb
// [19] call fmul8
jsr fmul8
// [20] fmul8::return#0 = fmul8::return#1
// [20] fmul8::return#0 = fmul8::return#2
jmp __b7
// main::@7
__b7:
@ -1659,29 +1644,32 @@ print_schar_at: {
jmp __b2_from___b4
}
// fmul8
// fmul8(signed byte register(X) a, signed byte register(A) b)
// fmul8(signed byte zp($10) aa, signed byte zp($11) bb)
fmul8: {
// [57] *ap = fmul8::a#0 -- _deref_pbsc1=vbsxx
stx ap
// [58] *bp = fmul8::b#0 -- _deref_pbsc1=vbsaa
sta bp
// asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp }
lda ap
.label aa = $10
.label bb = $11
.label cc = $12
// [57] fmul8::cc = 0 -- vbsz1=vbsc1
lda #0
sta.z cc
// asm { ldaaa staA1+1 eor#$ff staA2+1 ldxbb sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacc }
lda aa
sta A1+1
eor #$ff
sta A2+1
ldx bp
ldx bb
sec
A1:
lda mulf_sqr1,x
A2:
sbc mulf_sqr2,x
sta cp
// [60] fmul8::return#1 = *cp -- vbsaa=_deref_pbsc1
lda cp
sta cc
// [59] fmul8::return#1 = fmul8::cc -- vbsaa=vbsz1
lda.z cc
jmp __breturn
// fmul8::@return
__breturn:
// [60] fmul8::return#2 = fmul8::return#1
// [61] return
rts
}
@ -1860,8 +1848,7 @@ Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #WHITE
Removing instruction lda #WHITE
Removing instruction lda #WHITE
Replacing instruction lda ap with TXA
Removing instruction lda cp
Removing instruction lda.z cc
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label __b1_from___b5 with __b1
Replacing label __b3_from___b8 with __b3
@ -1925,17 +1912,14 @@ const byte RADIX::BINARY = 2
const byte RADIX::DECIMAL = $a
const byte RADIX::HEXADECIMAL = $10
const byte RADIX::OCTAL = 8
const signed byte* ap = (signed byte*) 253
const signed byte* bp = (signed byte*) 254
const signed byte* cp = (signed byte*) 255
signed byte fmul8(signed byte fmul8::a , signed byte fmul8::b)
signed byte fmul8::a
signed byte fmul8::a#0 reg byte x 551.0
signed byte fmul8::b
signed byte fmul8::b#0 reg byte a 551.0
signed byte fmul8(volatile signed byte fmul8::aa , volatile signed byte fmul8::bb)
volatile signed byte fmul8::aa loadstore zp[1]:16 33.666666666666664
volatile signed byte fmul8::bb loadstore zp[1]:17 50.5
volatile signed byte fmul8::cc loadstore zp[1]:18 1001.0
signed byte fmul8::return
signed byte fmul8::return#0 reg byte a 202.0
signed byte fmul8::return#1 reg byte a 367.33333333333337
signed byte fmul8::return#1 reg byte a 2002.0
signed byte fmul8::return#2 reg byte a 367.33333333333337
void init_screen()
byte* init_screen::COLS
byte* init_screen::COLS#1 COLS zp[2]:11 67.33333333333333
@ -2042,17 +2026,19 @@ zp[2]:11 [ print_schar_at::at#3 print_schar_at::at#0 print_schar_at::at#1 print_
zp[1]:13 [ print_schar_at::b#6 print_schar_at::b#0 print_schar_at::b#4 print_schar_at::b#1 print_schar_at::b#2 print_schar_at::b#3 print_uchar_at::b#0 ]
reg byte x [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ]
zp[2]:14 [ memset::dst#2 memset::dst#1 ]
reg byte x [ fmul8::a#0 ]
reg byte a [ fmul8::b#0 ]
zp[1]:16 [ fmul8::aa ]
zp[1]:17 [ fmul8::bb ]
reg byte a [ fmul8::return#0 ]
reg byte a [ main::r#0 ]
zp[1]:18 [ fmul8::cc ]
reg byte a [ fmul8::return#1 ]
reg byte a [ fmul8::return#2 ]
reg byte a [ print_uchar_at::$0 ]
reg byte y [ print_uchar_at::$2 ]
FINAL ASSEMBLER
Score: 10149
Score: 10748
// File Comments
// Seriously fast multiply 8-bit version (8bit*8bit=8bit)
@ -2072,10 +2058,6 @@ Score: 10149
.segment Basic
:BasicUpstart(main)
// Global Constants & labels
// Pointers to a, b and c=a*b
.label ap = $fd
.label bp = $fe
.label cp = $ff
.label print_screen = $400
.segment Code
// main
@ -2201,15 +2183,17 @@ main: {
inc.z at_2+1
!:
// fmul8(vals[i], vals[j])
// [17] fmul8::a#0 = vals[main::i#2] -- vbsxx=pbsc1_derefidx_vbuz1
// [17] fmul8::aa = vals[main::i#2] -- vbsz1=pbsc1_derefidx_vbuz2
ldy.z i
ldx vals,y
// [18] fmul8::b#0 = vals[main::j#2] -- vbsaa=pbsc1_derefidx_vbuz1
lda vals,y
sta.z fmul8.aa
// [18] fmul8::bb = vals[main::j#2] -- vbsz1=pbsc1_derefidx_vbuz2
ldy.z j
lda vals,y
sta.z fmul8.bb
// [19] call fmul8
jsr fmul8
// [20] fmul8::return#0 = fmul8::return#1
// [20] fmul8::return#0 = fmul8::return#2
// main::@7
// r = fmul8(vals[i], vals[j])
// [21] main::r#0 = fmul8::return#0
@ -2378,31 +2362,33 @@ print_schar_at: {
jmp __b2
}
// fmul8
// fmul8(signed byte register(X) a, signed byte register(A) b)
// fmul8(signed byte zp($10) aa, signed byte zp($11) bb)
fmul8: {
// *ap = a
// [57] *ap = fmul8::a#0 -- _deref_pbsc1=vbsxx
stx ap
// *bp = b
// [58] *bp = fmul8::b#0 -- _deref_pbsc1=vbsaa
sta bp
.label aa = $10
.label bb = $11
.label cc = $12
// cc
// [57] fmul8::cc = 0 -- vbsz1=vbsc1
lda #0
sta.z cc
// asm
// asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp }
txa
// asm { ldaaa staA1+1 eor#$ff staA2+1 ldxbb sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacc }
lda aa
sta A1+1
eor #$ff
sta A2+1
ldx bp
ldx bb
sec
A1:
lda mulf_sqr1,x
A2:
sbc mulf_sqr2,x
sta cp
// return *cp;
// [60] fmul8::return#1 = *cp -- vbsaa=_deref_pbsc1
sta cc
// return cc;
// [59] fmul8::return#1 = fmul8::cc -- vbsaa=vbsz1
// fmul8::@return
// }
// [60] fmul8::return#2 = fmul8::return#1
// [61] return
rts
}

View File

@ -2,17 +2,14 @@ const byte RADIX::BINARY = 2
const byte RADIX::DECIMAL = $a
const byte RADIX::HEXADECIMAL = $10
const byte RADIX::OCTAL = 8
const signed byte* ap = (signed byte*) 253
const signed byte* bp = (signed byte*) 254
const signed byte* cp = (signed byte*) 255
signed byte fmul8(signed byte fmul8::a , signed byte fmul8::b)
signed byte fmul8::a
signed byte fmul8::a#0 reg byte x 551.0
signed byte fmul8::b
signed byte fmul8::b#0 reg byte a 551.0
signed byte fmul8(volatile signed byte fmul8::aa , volatile signed byte fmul8::bb)
volatile signed byte fmul8::aa loadstore zp[1]:16 33.666666666666664
volatile signed byte fmul8::bb loadstore zp[1]:17 50.5
volatile signed byte fmul8::cc loadstore zp[1]:18 1001.0
signed byte fmul8::return
signed byte fmul8::return#0 reg byte a 202.0
signed byte fmul8::return#1 reg byte a 367.33333333333337
signed byte fmul8::return#1 reg byte a 2002.0
signed byte fmul8::return#2 reg byte a 367.33333333333337
void init_screen()
byte* init_screen::COLS
byte* init_screen::COLS#1 COLS zp[2]:11 67.33333333333333
@ -119,10 +116,12 @@ zp[2]:11 [ print_schar_at::at#3 print_schar_at::at#0 print_schar_at::at#1 print_
zp[1]:13 [ print_schar_at::b#6 print_schar_at::b#0 print_schar_at::b#4 print_schar_at::b#1 print_schar_at::b#2 print_schar_at::b#3 print_uchar_at::b#0 ]
reg byte x [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ]
zp[2]:14 [ memset::dst#2 memset::dst#1 ]
reg byte x [ fmul8::a#0 ]
reg byte a [ fmul8::b#0 ]
zp[1]:16 [ fmul8::aa ]
zp[1]:17 [ fmul8::bb ]
reg byte a [ fmul8::return#0 ]
reg byte a [ main::r#0 ]
zp[1]:18 [ fmul8::cc ]
reg byte a [ fmul8::return#1 ]
reg byte a [ fmul8::return#2 ]
reg byte a [ print_uchar_at::$0 ]
reg byte y [ print_uchar_at::$2 ]

View File

@ -33,7 +33,6 @@ main: {
.const toSpritePtr1_return = LOAD_SPRITE/$40
// loadFileToMemory(8, "SPRITE", LOAD_SPRITE)
jsr loadFileToMemory
// loadFileToMemory(8, "SPRITE", LOAD_SPRITE)
// status = loadFileToMemory(8, "SPRITE", LOAD_SPRITE)
tax
// if(status!=0xff)
@ -43,7 +42,7 @@ main: {
lda #2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// error(status)
txa
stx.z error.err
jsr error
__b1:
// VICII->SPRITES_ENABLE = %00000001
@ -74,92 +73,97 @@ main: {
// - 0xff: Success
// - other: Kernal Error Code (https://commodore.ca/manuals/pdfs/commodore_error_messages.pdf)
loadFileToMemory: {
.label device = 8
.const device = 8
// setnam(filename)
lda #<main.filename
sta.z setnam.filename
lda #>main.filename
sta.z setnam.filename+1
jsr setnam
// setlfs(device)
lda #device
sta.z setlfs.device
jsr setlfs
// load(address, false)
// load(address, 0)
lda #<LOAD_SPRITE
sta.z load.address
lda #>LOAD_SPRITE
sta.z load.address+1
lda #0
sta.z load.verify
jsr load
// }
rts
}
// Basic ERROR function
// ERROR. Show error.
// error(byte register(A) err)
// error(byte zp(6) err)
error: {
.label errCode = $ff
// *errCode = err
sta errCode
.label err = 6
// asm
tax
ldx err
jsr $a437
// }
rts
}
// Kernal SETNAM function
// SETNAM. Set file name parameters.
// setnam(byte* zp(7) filename)
setnam: {
.label filename_len = $fd
.label filename_ptr = $fe
.label filename = 7
.label filename_len = $d
.label __0 = 4
// strlen(filename)
lda.z filename
sta.z strlen.str
lda.z filename+1
sta.z strlen.str+1
jsr strlen
// strlen(filename)
// *filename_len = (char)strlen(filename)
// filename_len = (char)strlen(filename)
lda.z __0
sta filename_len
// *filename_ptr = filename
lda #<main.filename
sta filename_ptr
lda #>main.filename
sta filename_ptr+1
sta.z filename_len
// asm
lda filename_len
ldx filename_ptr
ldy filename_ptr+1
ldx filename
ldy filename+1
jsr $ffbd
// }
rts
}
// SETLFS. Set file parameters.
// setlfs(byte zp(9) device)
setlfs: {
.label deviceNum = $ff
// *deviceNum = device
lda #loadFileToMemory.device
sta deviceNum
.label device = 9
// asm
tax
ldx device
lda #1
ldy #0
jsr $ffba
// }
rts
}
//LOAD. Load or verify file. (Must call SETLFS and SETNAM beforehands.)
// LOAD. Load or verify file. (Must call SETLFS and SETNAM beforehands.)
// - verify: 0 = Load, 1-255 = Verify
//
// Returns a status, 0xff: Success other: Kernal Error Code
// load(byte* zp($a) address, byte zp($c) verify)
load: {
.label loadOrVerify = $fd
.label loadAddress = $fe
.label status = $fd
// *loadOrVerify = (char)verify
.label address = $a
.label verify = $c
.label status = $e
// status
lda #0
sta loadOrVerify
// *loadAddress = address
lda #<LOAD_SPRITE
sta loadAddress
lda #>LOAD_SPRITE
sta loadAddress+1
sta.z status
// asm
ldx loadAddress
tay
lda loadOrVerify
ldx address
ldy address+1
lda verify
jsr $ffd5
bcs error
lda #$ff
error:
sta status
// return *status;
// return status;
// }
rts
}
@ -172,10 +176,6 @@ strlen: {
lda #<0
sta.z len
sta.z len+1
lda #<main.filename
sta.z str
lda #>main.filename
sta.z str+1
__b1:
// while(*str)
ldy #0

View File

@ -11,7 +11,7 @@ main::@4: scope:[main] from main
to:main::@2
main::@2: scope:[main] from main::@4
[5] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = 2
[6] error::err#0 = main::status#0
[6] error::err = main::status#0
[7] call error
to:main::@1
main::@1: scope:[main] from main::@2 main::@4
@ -32,83 +32,81 @@ main::@return: scope:[main] from main::@3
byte loadFileToMemory(byte loadFileToMemory::device , byte* loadFileToMemory::filename , byte* loadFileToMemory::address)
loadFileToMemory: scope:[loadFileToMemory] from main
[15] phi()
[15] setnam::filename = main::filename
[16] call setnam
to:loadFileToMemory::@1
loadFileToMemory::@1: scope:[loadFileToMemory] from loadFileToMemory
[17] phi()
[17] setlfs::device = loadFileToMemory::device#0
[18] call setlfs
to:loadFileToMemory::@2
loadFileToMemory::@2: scope:[loadFileToMemory] from loadFileToMemory::@1
[19] phi()
[20] call load
[21] load::return#0 = load::return#1
[19] load::address = LOAD_SPRITE
[20] load::verify = 0
[21] call load
[22] load::return#0 = load::return#2
to:loadFileToMemory::@3
loadFileToMemory::@3: scope:[loadFileToMemory] from loadFileToMemory::@2
[22] loadFileToMemory::return#1 = load::return#0
[23] loadFileToMemory::return#1 = load::return#0
to:loadFileToMemory::@return
loadFileToMemory::@return: scope:[loadFileToMemory] from loadFileToMemory::@3
[23] return
[24] return
to:@return
void error(byte error::err)
void error(volatile byte error::err)
error: scope:[error] from main::@2
[24] *error::errCode = error::err#0
asm { ldxerrCode jsr$a437 }
asm { ldxerr jsr$a437 }
to:error::@return
error::@return: scope:[error] from error
[26] return
to:@return
void setnam(byte* setnam::filename)
void setnam(volatile byte* setnam::filename)
setnam: scope:[setnam] from loadFileToMemory
[27] phi()
[27] strlen::str#1 = setnam::filename
[28] call strlen
[29] strlen::return#2 = strlen::len#2
to:setnam::@1
setnam::@1: scope:[setnam] from setnam
[30] setnam::$0 = strlen::return#2
[31] *setnam::filename_len = (byte)setnam::$0
[32] *setnam::filename_ptr = main::filename
asm { ldafilename_len ldxfilename_ptr ldyfilename_ptr+1 jsr$ffbd }
[31] setnam::filename_len = (byte)setnam::$0
asm { ldafilename_len ldxfilename ldyfilename+1 jsr$ffbd }
to:setnam::@return
setnam::@return: scope:[setnam] from setnam::@1
[34] return
[33] return
to:@return
void setlfs(byte setlfs::device)
void setlfs(volatile byte setlfs::device)
setlfs: scope:[setlfs] from loadFileToMemory::@1
[35] *setlfs::deviceNum = loadFileToMemory::device#0
asm { ldxdeviceNum lda#1 ldy#0 jsr$ffba }
asm { ldxdevice lda#1 ldy#0 jsr$ffba }
to:setlfs::@return
setlfs::@return: scope:[setlfs] from setlfs
[37] return
[35] return
to:@return
byte load(byte* load::address , bool load::verify)
byte load(volatile byte* load::address , volatile byte load::verify)
load: scope:[load] from loadFileToMemory::@2
[38] *load::loadOrVerify = 0
[39] *load::loadAddress = LOAD_SPRITE
asm { ldxloadAddress ldyloadAddress+1 ldaloadOrVerify jsr$ffd5 bcserror lda#$ff error: stastatus }
[41] load::return#1 = *load::status
[36] load::status = 0
asm { ldxaddress ldyaddress+1 ldaverify jsr$ffd5 bcserror lda#$ff error: stastatus }
[38] load::return#1 = load::status
to:load::@return
load::@return: scope:[load] from load
[42] return
[39] load::return#2 = load::return#1
[40] return
to:@return
word strlen(byte* strlen::str)
strlen: scope:[strlen] from setnam
[43] phi()
[41] phi()
to:strlen::@1
strlen::@1: scope:[strlen] from strlen strlen::@2
[44] strlen::len#2 = phi( strlen/0, strlen::@2/strlen::len#1 )
[44] strlen::str#2 = phi( strlen/main::filename, strlen::@2/strlen::str#0 )
[45] if(0!=*strlen::str#2) goto strlen::@2
[42] strlen::len#2 = phi( strlen/0, strlen::@2/strlen::len#1 )
[42] strlen::str#2 = phi( strlen/strlen::str#1, strlen::@2/strlen::str#0 )
[43] if(0!=*strlen::str#2) goto strlen::@2
to:strlen::@return
strlen::@return: scope:[strlen] from strlen::@1
[46] return
[44] return
to:@return
strlen::@2: scope:[strlen] from strlen::@1
[47] strlen::len#1 = ++ strlen::len#2
[48] strlen::str#0 = ++ strlen::str#2
[45] strlen::len#1 = ++ strlen::len#2
[46] strlen::str#0 = ++ strlen::str#2
to:strlen::@1

File diff suppressed because it is too large Load Diff

View File

@ -14,19 +14,16 @@ const nomodify byte* SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS
const nomodify byte* SPRITES_XPOS = (byte*) 53248
const nomodify byte* SPRITES_YPOS = (byte*) 53249
const nomodify struct MOS6569_VICII* VICII = (struct MOS6569_VICII*) 53248
void error(byte error::err)
byte error::err
byte error::err#0 reg byte a 13.0
const nomodify byte* error::errCode = (byte*) 255
byte load(byte* load::address , bool load::verify)
byte* load::address
const byte** load::loadAddress = (byte**) 254
const byte* load::loadOrVerify = (byte*) 253
void error(volatile byte error::err)
volatile byte error::err loadstore zp[1]:6 2.0
byte load(volatile byte* load::address , volatile byte load::verify)
volatile byte* load::address loadstore zp[2]:10 3.6666666666666665
byte load::return
byte load::return#0 reg byte a 22.0
byte load::return#1 reg byte a 37.33333333333333
const byte* load::status = (byte*) 253
bool load::verify
byte load::return#1 reg byte a 202.0
byte load::return#2 reg byte a 37.33333333333333
volatile byte load::status loadstore zp[1]:14 101.0
volatile byte load::verify loadstore zp[1]:12 5.5
byte loadFileToMemory(byte loadFileToMemory::device , byte* loadFileToMemory::filename , byte* loadFileToMemory::address)
byte* loadFileToMemory::address
byte loadFileToMemory::device
@ -42,14 +39,12 @@ byte main::status#0 reg byte x 2.0
byte main::toSpritePtr1_return
const byte main::toSpritePtr1_return#0 toSpritePtr1_return = (byte)(word)LOAD_SPRITE/$40
byte* main::toSpritePtr1_sprite
void setlfs(byte setlfs::device)
byte setlfs::device
const nomodify byte* setlfs::deviceNum = (byte*) 255
void setnam(byte* setnam::filename)
void setlfs(volatile byte setlfs::device)
volatile byte setlfs::device loadstore zp[1]:9 11.0
void setnam(volatile byte* setnam::filename)
word~ setnam::$0 zp[2]:4 101.0
byte* setnam::filename
const nomodify byte* setnam::filename_len = (byte*) 253
const nomodify byte** setnam::filename_ptr = (byte**) 254
volatile byte* setnam::filename loadstore zp[2]:7 18.666666666666664
volatile byte setnam::filename_len loadstore zp[1]:13 101.0
word strlen(byte* strlen::str)
word strlen::len
word strlen::len#1 len zp[2]:4 10001.0
@ -58,13 +53,21 @@ word strlen::return
word strlen::return#2 return zp[2]:4 202.0
byte* strlen::str
byte* strlen::str#0 str zp[2]:2 20002.0
byte* strlen::str#2 str zp[2]:2 10001.0
byte* strlen::str#1 str zp[2]:2 551.0
byte* strlen::str#2 str zp[2]:2 10334.666666666666
zp[2]:2 [ strlen::str#2 strlen::str#0 ]
zp[2]:2 [ strlen::str#2 strlen::str#1 strlen::str#0 ]
zp[2]:4 [ strlen::len#2 strlen::len#1 strlen::return#2 setnam::$0 ]
reg byte a [ loadFileToMemory::return#0 ]
reg byte x [ main::status#0 ]
reg byte a [ error::err#0 ]
zp[1]:6 [ error::err ]
zp[2]:7 [ setnam::filename ]
zp[1]:9 [ setlfs::device ]
zp[2]:10 [ load::address ]
zp[1]:12 [ load::verify ]
reg byte a [ load::return#0 ]
reg byte a [ loadFileToMemory::return#1 ]
zp[1]:13 [ setnam::filename_len ]
zp[1]:14 [ load::status ]
reg byte a [ load::return#1 ]
reg byte a [ load::return#2 ]

View File

@ -2,14 +2,14 @@ Fixing struct type size struct printf_buffer_number to 12
Fixing struct type size struct printf_buffer_number to 12
Fixing struct type SIZE_OF struct printf_buffer_number to 12
Fixing struct type SIZE_OF struct printf_buffer_number to 12
Setting inferred volatile on symbol affected by address-of: queen::column in asm { ldacolumn pha ldar pha }
Setting inferred volatile on symbol affected by address-of: queen::r in asm { ldacolumn pha ldar pha }
Converting variable modified inside __stackcall procedure queen() to load/store count
Added struct type cast to parameter value list call printf_uint 8 (struct printf_format_number){ 0, 0, 0, 0, 0, DECIMAL }
Added struct type cast to parameter value list call printf_ulong count (struct printf_format_number){ 0, 0, 0, 0, 0, DECIMAL }
Added struct type cast to parameter value list call printf_ulong count (struct printf_format_number){ 0, 0, 0, 0, 0, DECIMAL }
Added struct type cast to parameter value list call printf_uchar print::i (struct printf_format_number){ 0, 0, 0, 0, 0, HEXADECIMAL }
Added struct type cast to parameter value list call printf_uchar print::i1 (struct printf_format_number){ 0, 0, 0, 0, 0, HEXADECIMAL }
Setting inferred volatile on symbol affected by address-of: queen::column in asm { ldacolumn pha ldar pha }
Setting inferred volatile on symbol affected by address-of: queen::r in asm { ldacolumn pha ldar pha }
Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx
Inlined call call __init
Eliminating unused variable with no statement main::$1

View File

@ -268,18 +268,19 @@ memoryRemapBlock: {
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
// memoryRemap(byte register(Z) remapBlocks, word zp(2) lowerPageOffset, word zp(4) upperPageOffset)
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
.label __1 = 6
.label __6 = 7
.label aVal = 6
.label xVal = 8
.label __1 = 7
.label yVal = 9
.label zVal = $b
.label __6 = $a
.label lowerPageOffset = 2
.label upperPageOffset = 4
// <lowerPageOffset
lda.z lowerPageOffset
// *aVal = <lowerPageOffset
sta aVal
// aVal = <lowerPageOffset
// lower blocks offset page low
sta.z aVal
// remapBlocks << 4
tza
asl
@ -293,12 +294,14 @@ memoryRemap: {
and #$f
// (remapBlocks << 4) | (>lowerPageOffset & 0xf)
ora.z __1
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
sta xVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// <upperPageOffset
lda.z upperPageOffset
// *yVal = <upperPageOffset
sta yVal
// yVal = <upperPageOffset
// upper blocks offset page
sta.z yVal
// remapBlocks & 0xf0
tza
and #$f0
@ -309,8 +312,9 @@ memoryRemap: {
and #$f
// (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
ora.z __6
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
sta zVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
lda aVal
ldx xVal

View File

@ -83,19 +83,19 @@ memoryRemap: scope:[memoryRemap] from irq::@3 main main::@6 memoryRemapBlock
[40] memoryRemap::remapBlocks#4 = phi( irq::@3/0, main/0, main::@6/0, memoryRemapBlock/memoryRemapBlock::blockBits#0 )
[40] memoryRemap::lowerPageOffset#4 = phi( irq::@3/0, main/0, main::@6/0, memoryRemapBlock/memoryRemapBlock::pageOffset#0 )
[41] memoryRemap::$0 = < memoryRemap::lowerPageOffset#4
[42] *memoryRemap::aVal = memoryRemap::$0
[42] memoryRemap::aVal = memoryRemap::$0
[43] memoryRemap::$1 = memoryRemap::remapBlocks#4 << 4
[44] memoryRemap::$2 = > memoryRemap::lowerPageOffset#4
[45] memoryRemap::$3 = memoryRemap::$2 & $f
[46] memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3
[47] *memoryRemap::xVal = memoryRemap::$4
[47] memoryRemap::xVal = memoryRemap::$4
[48] memoryRemap::$5 = < memoryRemap::upperPageOffset#4
[49] *memoryRemap::yVal = memoryRemap::$5
[49] memoryRemap::yVal = memoryRemap::$5
[50] memoryRemap::$6 = memoryRemap::remapBlocks#4 & $f0
[51] memoryRemap::$7 = > memoryRemap::upperPageOffset#4
[52] memoryRemap::$8 = memoryRemap::$7 & $f
[53] memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
[54] *memoryRemap::zVal = memoryRemap::$9
[54] memoryRemap::zVal = memoryRemap::$9
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap

View File

@ -44,6 +44,16 @@ Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memcpy_dma_command4
Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >&memset_dma_command
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memset_dma_command
Setting inferred volatile on symbol affected by address-of: memoryRemap::aVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::xVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::yVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::zVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::lMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::uMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::aVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::xVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::yVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::zVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx
Inlined call call __init
Eliminating unused variable with no statement memcpy_dma_command
@ -57,19 +67,19 @@ memoryRemap: scope:[memoryRemap] from irq::@3 main main::@6 memoryRemapBlock
memoryRemap::remapBlocks#4 = phi( irq::@3/memoryRemap::remapBlocks#3, main/memoryRemap::remapBlocks#1, main::@6/memoryRemap::remapBlocks#2, memoryRemapBlock/memoryRemap::remapBlocks#0 )
memoryRemap::lowerPageOffset#4 = phi( irq::@3/memoryRemap::lowerPageOffset#3, main/memoryRemap::lowerPageOffset#1, main::@6/memoryRemap::lowerPageOffset#2, memoryRemapBlock/memoryRemap::lowerPageOffset#0 )
memoryRemap::$0 = < memoryRemap::lowerPageOffset#4
*memoryRemap::aVal = memoryRemap::$0
memoryRemap::aVal = memoryRemap::$0
memoryRemap::$1 = memoryRemap::remapBlocks#4 << 4
memoryRemap::$2 = > memoryRemap::lowerPageOffset#4
memoryRemap::$3 = memoryRemap::$2 & $f
memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3
*memoryRemap::xVal = memoryRemap::$4
memoryRemap::xVal = memoryRemap::$4
memoryRemap::$5 = < memoryRemap::upperPageOffset#4
*memoryRemap::yVal = memoryRemap::$5
memoryRemap::yVal = memoryRemap::$5
memoryRemap::$6 = memoryRemap::remapBlocks#4 & $f0
memoryRemap::$7 = > memoryRemap::upperPageOffset#4
memoryRemap::$8 = memoryRemap::$7 & $f
memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
*memoryRemap::zVal = memoryRemap::$9
memoryRemap::zVal = memoryRemap::$9
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -322,7 +332,7 @@ number~ memoryRemap::$6
byte~ memoryRemap::$7
number~ memoryRemap::$8
number~ memoryRemap::$9
const byte* memoryRemap::aVal = (byte*)$fc
volatile byte memoryRemap::aVal loadstore
word memoryRemap::lowerPageOffset
word memoryRemap::lowerPageOffset#0
word memoryRemap::lowerPageOffset#1
@ -341,9 +351,9 @@ word memoryRemap::upperPageOffset#1
word memoryRemap::upperPageOffset#2
word memoryRemap::upperPageOffset#3
word memoryRemap::upperPageOffset#4
const byte* memoryRemap::xVal = (byte*)$fd
const byte* memoryRemap::yVal = (byte*)$fe
const byte* memoryRemap::zVal = (byte*)$ff
volatile byte memoryRemap::xVal loadstore
volatile byte memoryRemap::yVal loadstore
volatile byte memoryRemap::zVal loadstore
void memoryRemapBlock(byte memoryRemapBlock::blockPage , word memoryRemapBlock::memoryPage)
word~ memoryRemapBlock::$0
number~ memoryRemapBlock::$1
@ -433,10 +443,6 @@ Inlining cast memoryRemap::remapBlocks#3 = (unumber)0
Inlining cast memoryRemap::lowerPageOffset#3 = (unumber)0
Inlining cast memoryRemap::upperPageOffset#3 = (unumber)0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 252
Simplifying constant pointer cast (byte*) 253
Simplifying constant pointer cast (byte*) 254
Simplifying constant pointer cast (byte*) 255
Simplifying constant pointer cast (byte*) 0
Simplifying constant pointer cast (byte*) 1
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
@ -525,6 +531,10 @@ Inferred type updated to byte in memoryRemap::$8 = memoryRemap::$7 & $f
Inferred type updated to byte in memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
Inferred type updated to byte in memoryRemapBlock::$1 = memoryRemapBlock::blockPage#2 / $20
Inferred type updated to byte in memoryRemapBlock::$2 = 1 << memoryRemapBlock::block#0
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Alias memoryRemapBlock::pageOffset#0 = memoryRemapBlock::$0
Alias memoryRemapBlock::block#0 = memoryRemapBlock::$1
Alias memoryRemapBlock::blockBits#0 = memoryRemapBlock::$2
@ -532,6 +542,10 @@ Alias memcpy_dma4::num#0 = main::$1
Alias main::i#2 = main::i#3
Alias main::mem_destroy_i#3 = main::mem_destroy_i#4
Successful SSA optimization Pass2AliasElimination
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Identical Phi Values memcpy_dma4::num#1 memcpy_dma4::num#0
Identical Phi Values memcpy_dma4::src_bank#1 memcpy_dma4::src_bank#0
Identical Phi Values memcpy_dma4::src#1 memcpy_dma4::src#0
@ -582,6 +596,10 @@ Removing unused procedure block __start::@1
Removing unused procedure block __start::@2
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Rewriting division to use shift [19] memoryRemapBlock::block#0 = memoryRemapBlock::blockPage#2 / $20
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings memoryRemap::remapBlocks#1
@ -615,6 +633,10 @@ Constant inlined memoryRemap::lowerPageOffset#2 = 0
Constant inlined memoryRemap::lowerPageOffset#1 = 0
Constant inlined main::i#0 = 0
Successful SSA optimization Pass2ConstantInlining
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Identical Phi Values memoryRemapBlock::memoryPage#2 $100
Identical Phi Values memoryRemapBlock::blockPage#2 $40
Successful SSA optimization Pass2IdenticalPhiElimination
@ -632,6 +654,10 @@ Inlining constant with var siblings memoryRemap::upperPageOffset#0
Constant inlined memoryRemap::lowerPageOffset#0 = memoryRemapBlock::pageOffset#0
Constant inlined memoryRemap::upperPageOffset#0 = memoryRemapBlock::pageOffset#0
Successful SSA optimization Pass2ConstantInlining
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Constant right-side identified [17] memoryRemapBlock::blockBits#0 = 1 << memoryRemapBlock::block#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant memoryRemapBlock::blockBits#0 = 1<<memoryRemapBlock::block#0
@ -641,10 +667,26 @@ Successful SSA optimization Pass2ConstantIdentification
Inlining constant with var siblings memoryRemap::remapBlocks#0
Constant inlined memoryRemap::remapBlocks#0 = memoryRemapBlock::blockBits#0
Successful SSA optimization Pass2ConstantInlining
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 8
Finalized unsigned number type (word) $4000
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Added new block during phi lifting main::@8(between main::@2 and main::@1)
Adding NOP phi() at start of main::@5
Adding NOP phi() at start of memoryRemapBlock
@ -749,19 +791,19 @@ memoryRemap: scope:[memoryRemap] from irq::@3 main main::@6 memoryRemapBlock
[40] memoryRemap::remapBlocks#4 = phi( irq::@3/0, main/0, main::@6/0, memoryRemapBlock/memoryRemapBlock::blockBits#0 )
[40] memoryRemap::lowerPageOffset#4 = phi( irq::@3/0, main/0, main::@6/0, memoryRemapBlock/memoryRemapBlock::pageOffset#0 )
[41] memoryRemap::$0 = < memoryRemap::lowerPageOffset#4
[42] *memoryRemap::aVal = memoryRemap::$0
[42] memoryRemap::aVal = memoryRemap::$0
[43] memoryRemap::$1 = memoryRemap::remapBlocks#4 << 4
[44] memoryRemap::$2 = > memoryRemap::lowerPageOffset#4
[45] memoryRemap::$3 = memoryRemap::$2 & $f
[46] memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3
[47] *memoryRemap::xVal = memoryRemap::$4
[47] memoryRemap::xVal = memoryRemap::$4
[48] memoryRemap::$5 = < memoryRemap::upperPageOffset#4
[49] *memoryRemap::yVal = memoryRemap::$5
[49] memoryRemap::yVal = memoryRemap::$5
[50] memoryRemap::$6 = memoryRemap::remapBlocks#4 & $f0
[51] memoryRemap::$7 = > memoryRemap::upperPageOffset#4
[52] memoryRemap::$8 = memoryRemap::$7 & $f
[53] memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
[54] *memoryRemap::zVal = memoryRemap::$9
[54] memoryRemap::zVal = memoryRemap::$9
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -819,12 +861,16 @@ byte~ memoryRemap::$6 67.33333333333333
byte~ memoryRemap::$7 202.0
byte~ memoryRemap::$8 202.0
byte~ memoryRemap::$9 202.0
volatile byte memoryRemap::aVal loadstore 7.769230769230769
word memoryRemap::lowerPageOffset
word memoryRemap::lowerPageOffset#4 50.5
byte memoryRemap::remapBlocks
byte memoryRemap::remapBlocks#4 20.2
word memoryRemap::upperPageOffset
word memoryRemap::upperPageOffset#4 18.363636363636363
volatile byte memoryRemap::xVal loadstore 12.625
volatile byte memoryRemap::yVal loadstore 16.833333333333332
volatile byte memoryRemap::zVal loadstore 101.0
void memoryRemapBlock(byte memoryRemapBlock::blockPage , word memoryRemapBlock::memoryPage)
byte memoryRemapBlock::block
byte memoryRemapBlock::blockBits
@ -840,15 +886,19 @@ Initial phi equivalence classes
[ memoryRemap::upperPageOffset#4 ]
Added variable irq::raster#0 to live range equivalence class [ irq::raster#0 ]
Added variable memoryRemap::$0 to live range equivalence class [ memoryRemap::$0 ]
Added variable memoryRemap::aVal to live range equivalence class [ memoryRemap::aVal ]
Added variable memoryRemap::$1 to live range equivalence class [ memoryRemap::$1 ]
Added variable memoryRemap::$2 to live range equivalence class [ memoryRemap::$2 ]
Added variable memoryRemap::$3 to live range equivalence class [ memoryRemap::$3 ]
Added variable memoryRemap::$4 to live range equivalence class [ memoryRemap::$4 ]
Added variable memoryRemap::xVal to live range equivalence class [ memoryRemap::xVal ]
Added variable memoryRemap::$5 to live range equivalence class [ memoryRemap::$5 ]
Added variable memoryRemap::yVal to live range equivalence class [ memoryRemap::yVal ]
Added variable memoryRemap::$6 to live range equivalence class [ memoryRemap::$6 ]
Added variable memoryRemap::$7 to live range equivalence class [ memoryRemap::$7 ]
Added variable memoryRemap::$8 to live range equivalence class [ memoryRemap::$8 ]
Added variable memoryRemap::$9 to live range equivalence class [ memoryRemap::$9 ]
Added variable memoryRemap::zVal to live range equivalence class [ memoryRemap::zVal ]
Added variable memcpy_dma4::dmaMode#0 to live range equivalence class [ memcpy_dma4::dmaMode#0 ]
Added variable memcpy_dma_command4 to live range equivalence class [ memcpy_dma_command4 ]
Complete equivalence classes
@ -859,15 +909,19 @@ Complete equivalence classes
[ memoryRemap::upperPageOffset#4 ]
[ irq::raster#0 ]
[ memoryRemap::$0 ]
[ memoryRemap::aVal ]
[ memoryRemap::$1 ]
[ memoryRemap::$2 ]
[ memoryRemap::$3 ]
[ memoryRemap::$4 ]
[ memoryRemap::xVal ]
[ memoryRemap::$5 ]
[ memoryRemap::yVal ]
[ memoryRemap::$6 ]
[ memoryRemap::$7 ]
[ memoryRemap::$8 ]
[ memoryRemap::$9 ]
[ memoryRemap::zVal ]
[ memcpy_dma4::dmaMode#0 ]
[ memcpy_dma_command4 ]
Allocated zp[1]:2 [ main::mem_destroy_i#2 main::mem_destroy_i#1 ]
@ -877,16 +931,20 @@ Allocated zp[1]:6 [ memoryRemap::remapBlocks#4 ]
Allocated zp[2]:7 [ memoryRemap::upperPageOffset#4 ]
Allocated zp[1]:9 [ irq::raster#0 ]
Allocated zp[1]:10 [ memoryRemap::$0 ]
Allocated zp[1]:11 [ memoryRemap::$1 ]
Allocated zp[1]:12 [ memoryRemap::$2 ]
Allocated zp[1]:13 [ memoryRemap::$3 ]
Allocated zp[1]:14 [ memoryRemap::$4 ]
Allocated zp[1]:15 [ memoryRemap::$5 ]
Allocated zp[1]:16 [ memoryRemap::$6 ]
Allocated zp[1]:17 [ memoryRemap::$7 ]
Allocated zp[1]:18 [ memoryRemap::$8 ]
Allocated zp[1]:19 [ memoryRemap::$9 ]
Allocated zp[1]:20 [ memcpy_dma4::dmaMode#0 ]
Allocated zp[1]:11 [ memoryRemap::aVal ]
Allocated zp[1]:12 [ memoryRemap::$1 ]
Allocated zp[1]:13 [ memoryRemap::$2 ]
Allocated zp[1]:14 [ memoryRemap::$3 ]
Allocated zp[1]:15 [ memoryRemap::$4 ]
Allocated zp[1]:16 [ memoryRemap::xVal ]
Allocated zp[1]:17 [ memoryRemap::$5 ]
Allocated zp[1]:18 [ memoryRemap::yVal ]
Allocated zp[1]:19 [ memoryRemap::$6 ]
Allocated zp[1]:20 [ memoryRemap::$7 ]
Allocated zp[1]:21 [ memoryRemap::$8 ]
Allocated zp[1]:22 [ memoryRemap::$9 ]
Allocated zp[1]:23 [ memoryRemap::zVal ]
Allocated zp[1]:24 [ memcpy_dma4::dmaMode#0 ]
Allocated mem[12] [ memcpy_dma_command4 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) = IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a
@ -909,16 +967,16 @@ Statement [28] *HARDWARE_IRQ = &irq [ ] ( [ ] { } ) always clobbers reg byte a
Statement [35] DEFAULT_SCREEN[main::i#2] = MUSIC[main::i#2] [ main::mem_destroy_i#1 main::i#2 ] ( [ main::mem_destroy_i#1 main::i#2 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::mem_destroy_i#2 main::mem_destroy_i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::i#2 main::i#1 ]
Statement [43] memoryRemap::$1 = memoryRemap::remapBlocks#4 << 4 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 ] ( memoryRemap:4 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 ] { } memoryRemap:23 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 ] { } ) always clobbers reg byte a
Statement [43] memoryRemap::$1 = memoryRemap::remapBlocks#4 << 4 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 ] ( memoryRemap:4 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 ] { } memoryRemap:23 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:6 [ memoryRemap::remapBlocks#4 ]
Statement [45] memoryRemap::$3 = memoryRemap::$2 & $f [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 memoryRemap::$3 ] ( memoryRemap:4 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 memoryRemap::$3 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 memoryRemap::$3 ] { } memoryRemap:23 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 memoryRemap::$3 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 memoryRemap::$3 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 memoryRemap::$3 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:11 [ memoryRemap::$1 ]
Statement [50] memoryRemap::$6 = memoryRemap::remapBlocks#4 & $f0 [ memoryRemap::upperPageOffset#4 memoryRemap::$6 ] ( memoryRemap:4 [ memoryRemap::upperPageOffset#4 memoryRemap::$6 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::upperPageOffset#4 memoryRemap::$6 ] { } memoryRemap:23 [ memoryRemap::upperPageOffset#4 memoryRemap::$6 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::upperPageOffset#4 memoryRemap::$6 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::upperPageOffset#4 memoryRemap::$6 ] { } ) always clobbers reg byte a
Statement [52] memoryRemap::$8 = memoryRemap::$7 & $f [ memoryRemap::$6 memoryRemap::$8 ] ( memoryRemap:4 [ memoryRemap::$6 memoryRemap::$8 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::$6 memoryRemap::$8 ] { } memoryRemap:23 [ memoryRemap::$6 memoryRemap::$8 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::$6 memoryRemap::$8 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::$6 memoryRemap::$8 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:16 [ memoryRemap::$6 ]
Statement [45] memoryRemap::$3 = memoryRemap::$2 & $f [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 memoryRemap::$3 ] ( memoryRemap:4 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 memoryRemap::$3 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 memoryRemap::$3 ] { } memoryRemap:23 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 memoryRemap::$3 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 memoryRemap::$3 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 memoryRemap::$3 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:12 [ memoryRemap::$1 ]
Statement [50] memoryRemap::$6 = memoryRemap::remapBlocks#4 & $f0 [ memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 ] ( memoryRemap:4 [ memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 ] { } memoryRemap:23 [ memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 ] { } ) always clobbers reg byte a
Statement [52] memoryRemap::$8 = memoryRemap::$7 & $f [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 memoryRemap::$8 ] ( memoryRemap:4 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 memoryRemap::$8 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 memoryRemap::$8 ] { } memoryRemap:23 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 memoryRemap::$8 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 memoryRemap::$8 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 memoryRemap::$8 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:19 [ memoryRemap::$6 ]
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [58] *((word*)&memcpy_dma_command4+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memcpy_dma4::num#0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:18 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:20 [ memcpy_dma4::dmaMode#0 ]
Removing always clobbered register reg byte a as potential for zp[1]:24 [ memcpy_dma4::dmaMode#0 ]
Statement [59] *((byte*)&memcpy_dma_command4+OFFSET_STRUCT_DMA_LIST_F018B_SRC_BANK) = memcpy_dma4::src_bank#0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:18 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [60] *((byte**)&memcpy_dma_command4+OFFSET_STRUCT_DMA_LIST_F018B_SRC) = (byte*)memcpy_dma4::src#0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:18 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [61] *((byte*)&memcpy_dma_command4+OFFSET_STRUCT_DMA_LIST_F018B_DEST_BANK) = memcpy_dma4::dest_bank#0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:18 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
@ -946,10 +1004,10 @@ Statement [26] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1) = *((byte*)V
Statement [27] *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) = IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a
Statement [28] *HARDWARE_IRQ = &irq [ ] ( [ ] { } ) always clobbers reg byte a
Statement [35] DEFAULT_SCREEN[main::i#2] = MUSIC[main::i#2] [ main::mem_destroy_i#1 main::i#2 ] ( [ main::mem_destroy_i#1 main::i#2 ] { } ) always clobbers reg byte a
Statement [43] memoryRemap::$1 = memoryRemap::remapBlocks#4 << 4 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 ] ( memoryRemap:4 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 ] { } memoryRemap:23 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 ] { } ) always clobbers reg byte a
Statement [45] memoryRemap::$3 = memoryRemap::$2 & $f [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 memoryRemap::$3 ] ( memoryRemap:4 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 memoryRemap::$3 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 memoryRemap::$3 ] { } memoryRemap:23 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 memoryRemap::$3 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 memoryRemap::$3 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::$1 memoryRemap::$3 ] { } ) always clobbers reg byte a
Statement [50] memoryRemap::$6 = memoryRemap::remapBlocks#4 & $f0 [ memoryRemap::upperPageOffset#4 memoryRemap::$6 ] ( memoryRemap:4 [ memoryRemap::upperPageOffset#4 memoryRemap::$6 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::upperPageOffset#4 memoryRemap::$6 ] { } memoryRemap:23 [ memoryRemap::upperPageOffset#4 memoryRemap::$6 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::upperPageOffset#4 memoryRemap::$6 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::upperPageOffset#4 memoryRemap::$6 ] { } ) always clobbers reg byte a
Statement [52] memoryRemap::$8 = memoryRemap::$7 & $f [ memoryRemap::$6 memoryRemap::$8 ] ( memoryRemap:4 [ memoryRemap::$6 memoryRemap::$8 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::$6 memoryRemap::$8 ] { } memoryRemap:23 [ memoryRemap::$6 memoryRemap::$8 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::$6 memoryRemap::$8 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::$6 memoryRemap::$8 ] { } ) always clobbers reg byte a
Statement [43] memoryRemap::$1 = memoryRemap::remapBlocks#4 << 4 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 ] ( memoryRemap:4 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 ] { } memoryRemap:23 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::lowerPageOffset#4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 ] { } ) always clobbers reg byte a
Statement [45] memoryRemap::$3 = memoryRemap::$2 & $f [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 memoryRemap::$3 ] ( memoryRemap:4 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 memoryRemap::$3 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 memoryRemap::$3 ] { } memoryRemap:23 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 memoryRemap::$3 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 memoryRemap::$3 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::remapBlocks#4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::$1 memoryRemap::$3 ] { } ) always clobbers reg byte a
Statement [50] memoryRemap::$6 = memoryRemap::remapBlocks#4 & $f0 [ memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 ] ( memoryRemap:4 [ memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 ] { } memoryRemap:23 [ memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::upperPageOffset#4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 ] { } ) always clobbers reg byte a
Statement [52] memoryRemap::$8 = memoryRemap::$7 & $f [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 memoryRemap::$8 ] ( memoryRemap:4 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 memoryRemap::$8 ] { } memoryRemap:10 [ memcpy_dma_command4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 memoryRemap::$8 ] { } memoryRemap:23 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 memoryRemap::$8 ] { } memoryRemapBlock:2::memoryRemap:38 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 memoryRemap::$8 ] { } memoryRemapBlock:20::memoryRemap:38 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::$6 memoryRemap::$8 ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [58] *((word*)&memcpy_dma_command4+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memcpy_dma4::num#0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:18 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [59] *((byte*)&memcpy_dma_command4+OFFSET_STRUCT_DMA_LIST_F018B_SRC_BANK) = memcpy_dma4::src_bank#0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:18 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
@ -968,23 +1026,27 @@ Potential registers zp[1]:6 [ memoryRemap::remapBlocks#4 ] : zp[1]:6 , reg byte
Potential registers zp[2]:7 [ memoryRemap::upperPageOffset#4 ] : zp[2]:7 ,
Potential registers zp[1]:9 [ irq::raster#0 ] : zp[1]:9 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:10 [ memoryRemap::$0 ] : zp[1]:10 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:11 [ memoryRemap::$1 ] : zp[1]:11 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:12 [ memoryRemap::$2 ] : zp[1]:12 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:13 [ memoryRemap::$3 ] : zp[1]:13 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:14 [ memoryRemap::$4 ] : zp[1]:14 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:15 [ memoryRemap::$5 ] : zp[1]:15 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:16 [ memoryRemap::$6 ] : zp[1]:16 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:17 [ memoryRemap::$7 ] : zp[1]:17 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:18 [ memoryRemap::$8 ] : zp[1]:18 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:19 [ memoryRemap::$9 ] : zp[1]:19 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:20 [ memcpy_dma4::dmaMode#0 ] : zp[1]:20 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:11 [ memoryRemap::aVal ] : zp[1]:11 ,
Potential registers zp[1]:12 [ memoryRemap::$1 ] : zp[1]:12 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:13 [ memoryRemap::$2 ] : zp[1]:13 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:14 [ memoryRemap::$3 ] : zp[1]:14 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:15 [ memoryRemap::$4 ] : zp[1]:15 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:16 [ memoryRemap::xVal ] : zp[1]:16 ,
Potential registers zp[1]:17 [ memoryRemap::$5 ] : zp[1]:17 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:18 [ memoryRemap::yVal ] : zp[1]:18 ,
Potential registers zp[1]:19 [ memoryRemap::$6 ] : zp[1]:19 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:20 [ memoryRemap::$7 ] : zp[1]:20 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:21 [ memoryRemap::$8 ] : zp[1]:21 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:22 [ memoryRemap::$9 ] : zp[1]:22 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:23 [ memoryRemap::zVal ] : zp[1]:23 ,
Potential registers zp[1]:24 [ memcpy_dma4::dmaMode#0 ] : zp[1]:24 , reg byte x , reg byte y , reg byte z ,
Potential registers mem[12] [ memcpy_dma_command4 ] : mem[12] ,
REGISTER UPLIFT SCOPES
Uplift Scope [memoryRemap] 202: zp[1]:10 [ memoryRemap::$0 ] 202: zp[1]:12 [ memoryRemap::$2 ] 202: zp[1]:13 [ memoryRemap::$3 ] 202: zp[1]:14 [ memoryRemap::$4 ] 202: zp[1]:15 [ memoryRemap::$5 ] 202: zp[1]:17 [ memoryRemap::$7 ] 202: zp[1]:18 [ memoryRemap::$8 ] 202: zp[1]:19 [ memoryRemap::$9 ] 67.33: zp[1]:11 [ memoryRemap::$1 ] 67.33: zp[1]:16 [ memoryRemap::$6 ] 50.5: zp[2]:4 [ memoryRemap::lowerPageOffset#4 ] 20.2: zp[1]:6 [ memoryRemap::remapBlocks#4 ] 18.36: zp[2]:7 [ memoryRemap::upperPageOffset#4 ]
Uplift Scope [memoryRemap] 202: zp[1]:10 [ memoryRemap::$0 ] 202: zp[1]:13 [ memoryRemap::$2 ] 202: zp[1]:14 [ memoryRemap::$3 ] 202: zp[1]:15 [ memoryRemap::$4 ] 202: zp[1]:17 [ memoryRemap::$5 ] 202: zp[1]:20 [ memoryRemap::$7 ] 202: zp[1]:21 [ memoryRemap::$8 ] 202: zp[1]:22 [ memoryRemap::$9 ] 101: zp[1]:23 [ memoryRemap::zVal ] 67.33: zp[1]:12 [ memoryRemap::$1 ] 67.33: zp[1]:19 [ memoryRemap::$6 ] 50.5: zp[2]:4 [ memoryRemap::lowerPageOffset#4 ] 20.2: zp[1]:6 [ memoryRemap::remapBlocks#4 ] 18.36: zp[2]:7 [ memoryRemap::upperPageOffset#4 ] 16.83: zp[1]:18 [ memoryRemap::yVal ] 12.62: zp[1]:16 [ memoryRemap::xVal ] 7.77: zp[1]:11 [ memoryRemap::aVal ]
Uplift Scope [main] 370.33: zp[1]:3 [ main::i#2 main::i#1 ] 89.4: zp[1]:2 [ main::mem_destroy_i#2 main::mem_destroy_i#1 ]
Uplift Scope [irq] 6.5: zp[1]:9 [ irq::raster#0 ]
Uplift Scope [memcpy_dma4] 2: zp[1]:20 [ memcpy_dma4::dmaMode#0 ]
Uplift Scope [memcpy_dma4] 2: zp[1]:24 [ memcpy_dma4::dmaMode#0 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [MOS6569_VICII]
Uplift Scope [MOS6581_SID]
@ -996,41 +1058,53 @@ Uplift Scope [DMA_LIST_F018A]
Uplift Scope [DMA_LIST_F018B]
Uplift Scope [] 0: mem[12] [ memcpy_dma_command4 ]
Uplifting [memoryRemap] best 4842 combination reg byte a [ memoryRemap::$0 ] reg byte a [ memoryRemap::$2 ] reg byte a [ memoryRemap::$3 ] zp[1]:14 [ memoryRemap::$4 ] zp[1]:15 [ memoryRemap::$5 ] zp[1]:17 [ memoryRemap::$7 ] zp[1]:18 [ memoryRemap::$8 ] zp[1]:19 [ memoryRemap::$9 ] zp[1]:11 [ memoryRemap::$1 ] zp[1]:16 [ memoryRemap::$6 ] zp[2]:4 [ memoryRemap::lowerPageOffset#4 ] zp[1]:6 [ memoryRemap::remapBlocks#4 ] zp[2]:7 [ memoryRemap::upperPageOffset#4 ]
Uplifting [memoryRemap] best 4838 combination reg byte a [ memoryRemap::$0 ] reg byte a [ memoryRemap::$2 ] reg byte a [ memoryRemap::$3 ] zp[1]:15 [ memoryRemap::$4 ] zp[1]:17 [ memoryRemap::$5 ] zp[1]:20 [ memoryRemap::$7 ] zp[1]:21 [ memoryRemap::$8 ] zp[1]:22 [ memoryRemap::$9 ] zp[1]:23 [ memoryRemap::zVal ] zp[1]:12 [ memoryRemap::$1 ] zp[1]:19 [ memoryRemap::$6 ] zp[2]:4 [ memoryRemap::lowerPageOffset#4 ] zp[1]:6 [ memoryRemap::remapBlocks#4 ] zp[2]:7 [ memoryRemap::upperPageOffset#4 ] zp[1]:18 [ memoryRemap::yVal ] zp[1]:16 [ memoryRemap::xVal ] zp[1]:11 [ memoryRemap::aVal ]
Limited combination testing to 100 combinations of 25000000 possible.
Uplifting [main] best 3552 combination reg byte y [ main::i#2 main::i#1 ] reg byte x [ main::mem_destroy_i#2 main::mem_destroy_i#1 ]
Uplifting [irq] best 3519 combination reg byte a [ irq::raster#0 ]
Uplifting [memcpy_dma4] best 3513 combination reg byte x [ memcpy_dma4::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 3513 combination
Uplifting [MOS6569_VICII] best 3513 combination
Uplifting [MOS6581_SID] best 3513 combination
Uplifting [MOS4569_VICIII] best 3513 combination
Uplifting [MEGA65_VICIV] best 3513 combination
Uplifting [memoryRemapBlock] best 3513 combination
Uplifting [F018_DMAGIC] best 3513 combination
Uplifting [DMA_LIST_F018A] best 3513 combination
Uplifting [DMA_LIST_F018B] best 3513 combination
Uplifting [] best 3513 combination mem[12] [ memcpy_dma_command4 ]
Attempting to uplift remaining variables inzp[1]:14 [ memoryRemap::$4 ]
Uplifting [memoryRemap] best 3507 combination reg byte a [ memoryRemap::$4 ]
Attempting to uplift remaining variables inzp[1]:15 [ memoryRemap::$5 ]
Uplifting [memoryRemap] best 3501 combination reg byte a [ memoryRemap::$5 ]
Attempting to uplift remaining variables inzp[1]:17 [ memoryRemap::$7 ]
Uplifting [memoryRemap] best 3495 combination reg byte a [ memoryRemap::$7 ]
Attempting to uplift remaining variables inzp[1]:18 [ memoryRemap::$8 ]
Uplifting [memoryRemap] best 3489 combination reg byte a [ memoryRemap::$8 ]
Attempting to uplift remaining variables inzp[1]:19 [ memoryRemap::$9 ]
Uplifting [memoryRemap] best 3483 combination reg byte a [ memoryRemap::$9 ]
Attempting to uplift remaining variables inzp[1]:11 [ memoryRemap::$1 ]
Uplifting [memoryRemap] best 3483 combination zp[1]:11 [ memoryRemap::$1 ]
Attempting to uplift remaining variables inzp[1]:16 [ memoryRemap::$6 ]
Uplifting [memoryRemap] best 3483 combination zp[1]:16 [ memoryRemap::$6 ]
Uplifting [main] best 3548 combination reg byte y [ main::i#2 main::i#1 ] reg byte x [ main::mem_destroy_i#2 main::mem_destroy_i#1 ]
Uplifting [irq] best 3515 combination reg byte a [ irq::raster#0 ]
Uplifting [memcpy_dma4] best 3509 combination reg byte x [ memcpy_dma4::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 3509 combination
Uplifting [MOS6569_VICII] best 3509 combination
Uplifting [MOS6581_SID] best 3509 combination
Uplifting [MOS4569_VICIII] best 3509 combination
Uplifting [MEGA65_VICIV] best 3509 combination
Uplifting [memoryRemapBlock] best 3509 combination
Uplifting [F018_DMAGIC] best 3509 combination
Uplifting [DMA_LIST_F018A] best 3509 combination
Uplifting [DMA_LIST_F018B] best 3509 combination
Uplifting [] best 3509 combination mem[12] [ memcpy_dma_command4 ]
Attempting to uplift remaining variables inzp[1]:15 [ memoryRemap::$4 ]
Uplifting [memoryRemap] best 3503 combination reg byte a [ memoryRemap::$4 ]
Attempting to uplift remaining variables inzp[1]:17 [ memoryRemap::$5 ]
Uplifting [memoryRemap] best 3497 combination reg byte a [ memoryRemap::$5 ]
Attempting to uplift remaining variables inzp[1]:20 [ memoryRemap::$7 ]
Uplifting [memoryRemap] best 3491 combination reg byte a [ memoryRemap::$7 ]
Attempting to uplift remaining variables inzp[1]:21 [ memoryRemap::$8 ]
Uplifting [memoryRemap] best 3485 combination reg byte a [ memoryRemap::$8 ]
Attempting to uplift remaining variables inzp[1]:22 [ memoryRemap::$9 ]
Uplifting [memoryRemap] best 3479 combination reg byte a [ memoryRemap::$9 ]
Attempting to uplift remaining variables inzp[1]:23 [ memoryRemap::zVal ]
Uplifting [memoryRemap] best 3479 combination zp[1]:23 [ memoryRemap::zVal ]
Attempting to uplift remaining variables inzp[1]:12 [ memoryRemap::$1 ]
Uplifting [memoryRemap] best 3479 combination zp[1]:12 [ memoryRemap::$1 ]
Attempting to uplift remaining variables inzp[1]:19 [ memoryRemap::$6 ]
Uplifting [memoryRemap] best 3479 combination zp[1]:19 [ memoryRemap::$6 ]
Attempting to uplift remaining variables inzp[1]:6 [ memoryRemap::remapBlocks#4 ]
Uplifting [memoryRemap] best 3467 combination reg byte z [ memoryRemap::remapBlocks#4 ]
Uplifting [memoryRemap] best 3463 combination reg byte z [ memoryRemap::remapBlocks#4 ]
Attempting to uplift remaining variables inzp[1]:18 [ memoryRemap::yVal ]
Uplifting [memoryRemap] best 3463 combination zp[1]:18 [ memoryRemap::yVal ]
Attempting to uplift remaining variables inzp[1]:16 [ memoryRemap::xVal ]
Uplifting [memoryRemap] best 3463 combination zp[1]:16 [ memoryRemap::xVal ]
Attempting to uplift remaining variables inzp[1]:11 [ memoryRemap::aVal ]
Uplifting [memoryRemap] best 3463 combination zp[1]:11 [ memoryRemap::aVal ]
Allocated (was zp[2]:4) zp[2]:2 [ memoryRemap::lowerPageOffset#4 ]
Allocated (was zp[2]:7) zp[2]:4 [ memoryRemap::upperPageOffset#4 ]
Allocated (was zp[1]:11) zp[1]:6 [ memoryRemap::$1 ]
Allocated (was zp[1]:16) zp[1]:7 [ memoryRemap::$6 ]
Allocated (was zp[1]:11) zp[1]:6 [ memoryRemap::aVal ]
Allocated (was zp[1]:12) zp[1]:7 [ memoryRemap::$1 ]
Allocated (was zp[1]:16) zp[1]:8 [ memoryRemap::xVal ]
Allocated (was zp[1]:18) zp[1]:9 [ memoryRemap::yVal ]
Allocated (was zp[1]:19) zp[1]:10 [ memoryRemap::$6 ]
Allocated (was zp[1]:23) zp[1]:11 [ memoryRemap::zVal ]
Interrupt procedure irq clobbers AXYZcnzvidePSB
ASSEMBLER BEFORE OPTIMIZATION
@ -1395,18 +1469,19 @@ memoryRemapBlock: {
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
// memoryRemap(byte register(Z) remapBlocks, word zp(2) lowerPageOffset, word zp(4) upperPageOffset)
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
.label __1 = 6
.label __6 = 7
.label aVal = 6
.label xVal = 8
.label __1 = 7
.label yVal = 9
.label zVal = $b
.label __6 = $a
.label lowerPageOffset = 2
.label upperPageOffset = 4
// [41] memoryRemap::$0 = < memoryRemap::lowerPageOffset#4 -- vbuaa=_lo_vwuz1
lda.z lowerPageOffset
// [42] *memoryRemap::aVal = memoryRemap::$0 -- _deref_pbuc1=vbuaa
sta aVal
// [42] memoryRemap::aVal = memoryRemap::$0 -- vbuz1=vbuaa
// lower blocks offset page low
sta.z aVal
// [43] memoryRemap::$1 = memoryRemap::remapBlocks#4 << 4 -- vbuz1=vbuzz_rol_4
tza
asl
@ -1420,12 +1495,14 @@ memoryRemap: {
and #$f
// [46] memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3 -- vbuaa=vbuz1_bor_vbuaa
ora.z __1
// [47] *memoryRemap::xVal = memoryRemap::$4 -- _deref_pbuc1=vbuaa
sta xVal
// [47] memoryRemap::xVal = memoryRemap::$4 -- vbuz1=vbuaa
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// [48] memoryRemap::$5 = < memoryRemap::upperPageOffset#4 -- vbuaa=_lo_vwuz1
lda.z upperPageOffset
// [49] *memoryRemap::yVal = memoryRemap::$5 -- _deref_pbuc1=vbuaa
sta yVal
// [49] memoryRemap::yVal = memoryRemap::$5 -- vbuz1=vbuaa
// upper blocks offset page
sta.z yVal
// [50] memoryRemap::$6 = memoryRemap::remapBlocks#4 & $f0 -- vbuz1=vbuzz_band_vbuc1
tza
and #$f0
@ -1436,8 +1513,9 @@ memoryRemap: {
and #$f
// [53] memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8 -- vbuaa=vbuz1_bor_vbuaa
ora.z __6
// [54] *memoryRemap::zVal = memoryRemap::$9 -- _deref_pbuc1=vbuaa
sta zVal
// [54] memoryRemap::zVal = memoryRemap::$9 -- vbuz1=vbuaa
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal
ldx xVal
@ -1654,25 +1732,25 @@ const byte memcpy_dma4::src_bank#0 src_bank = 0
struct DMA_LIST_F018B memcpy_dma_command4 loadstore mem[12] = { command: DMA_COMMAND_COPY, count: 0, src: (byte*) 0, src_bank: 0, dest: (byte*) 0, dest_bank: 0, sub_command: 0, modulo: 0 }
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
byte~ memoryRemap::$0 reg byte a 202.0
byte~ memoryRemap::$1 zp[1]:6 67.33333333333333
byte~ memoryRemap::$1 zp[1]:7 67.33333333333333
byte~ memoryRemap::$2 reg byte a 202.0
byte~ memoryRemap::$3 reg byte a 202.0
byte~ memoryRemap::$4 reg byte a 202.0
byte~ memoryRemap::$5 reg byte a 202.0
byte~ memoryRemap::$6 zp[1]:7 67.33333333333333
byte~ memoryRemap::$6 zp[1]:10 67.33333333333333
byte~ memoryRemap::$7 reg byte a 202.0
byte~ memoryRemap::$8 reg byte a 202.0
byte~ memoryRemap::$9 reg byte a 202.0
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:6 7.769230769230769
word memoryRemap::lowerPageOffset
word memoryRemap::lowerPageOffset#4 lowerPageOffset zp[2]:2 50.5
byte memoryRemap::remapBlocks
byte memoryRemap::remapBlocks#4 reg byte z 20.2
word memoryRemap::upperPageOffset
word memoryRemap::upperPageOffset#4 upperPageOffset zp[2]:4 18.363636363636363
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:8 12.625
volatile byte memoryRemap::yVal loadstore zp[1]:9 16.833333333333332
volatile byte memoryRemap::zVal loadstore zp[1]:11 101.0
void memoryRemapBlock(byte memoryRemapBlock::blockPage , word memoryRemapBlock::memoryPage)
byte memoryRemapBlock::block
const byte memoryRemapBlock::block#0 block = $40>>5
@ -1694,21 +1772,25 @@ reg byte z [ memoryRemap::remapBlocks#4 ]
zp[2]:4 [ memoryRemap::upperPageOffset#4 ]
reg byte a [ irq::raster#0 ]
reg byte a [ memoryRemap::$0 ]
zp[1]:6 [ memoryRemap::$1 ]
zp[1]:6 [ memoryRemap::aVal ]
zp[1]:7 [ memoryRemap::$1 ]
reg byte a [ memoryRemap::$2 ]
reg byte a [ memoryRemap::$3 ]
reg byte a [ memoryRemap::$4 ]
zp[1]:8 [ memoryRemap::xVal ]
reg byte a [ memoryRemap::$5 ]
zp[1]:7 [ memoryRemap::$6 ]
zp[1]:9 [ memoryRemap::yVal ]
zp[1]:10 [ memoryRemap::$6 ]
reg byte a [ memoryRemap::$7 ]
reg byte a [ memoryRemap::$8 ]
reg byte a [ memoryRemap::$9 ]
zp[1]:11 [ memoryRemap::zVal ]
reg byte x [ memcpy_dma4::dmaMode#0 ]
mem[12] [ memcpy_dma_command4 ]
FINAL ASSEMBLER
Score: 3054
Score: 3050
// File Comments
// SID music located in another bank being played in a raster IRQ using memory mapping on the MEGA65
@ -2065,20 +2147,21 @@ memoryRemapBlock: {
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
// memoryRemap(byte register(Z) remapBlocks, word zp(2) lowerPageOffset, word zp(4) upperPageOffset)
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
.label __1 = 6
.label __6 = 7
.label aVal = 6
.label xVal = 8
.label __1 = 7
.label yVal = 9
.label zVal = $b
.label __6 = $a
.label lowerPageOffset = 2
.label upperPageOffset = 4
// <lowerPageOffset
// [41] memoryRemap::$0 = < memoryRemap::lowerPageOffset#4 -- vbuaa=_lo_vwuz1
lda.z lowerPageOffset
// *aVal = <lowerPageOffset
// [42] *memoryRemap::aVal = memoryRemap::$0 -- _deref_pbuc1=vbuaa
sta aVal
// aVal = <lowerPageOffset
// [42] memoryRemap::aVal = memoryRemap::$0 -- vbuz1=vbuaa
// lower blocks offset page low
sta.z aVal
// remapBlocks << 4
// [43] memoryRemap::$1 = memoryRemap::remapBlocks#4 << 4 -- vbuz1=vbuzz_rol_4
tza
@ -2096,15 +2179,17 @@ memoryRemap: {
// (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [46] memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3 -- vbuaa=vbuz1_bor_vbuaa
ora.z __1
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [47] *memoryRemap::xVal = memoryRemap::$4 -- _deref_pbuc1=vbuaa
sta xVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [47] memoryRemap::xVal = memoryRemap::$4 -- vbuz1=vbuaa
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// <upperPageOffset
// [48] memoryRemap::$5 = < memoryRemap::upperPageOffset#4 -- vbuaa=_lo_vwuz1
lda.z upperPageOffset
// *yVal = <upperPageOffset
// [49] *memoryRemap::yVal = memoryRemap::$5 -- _deref_pbuc1=vbuaa
sta yVal
// yVal = <upperPageOffset
// [49] memoryRemap::yVal = memoryRemap::$5 -- vbuz1=vbuaa
// upper blocks offset page
sta.z yVal
// remapBlocks & 0xf0
// [50] memoryRemap::$6 = memoryRemap::remapBlocks#4 & $f0 -- vbuz1=vbuzz_band_vbuc1
tza
@ -2119,9 +2204,10 @@ memoryRemap: {
// (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [53] memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8 -- vbuaa=vbuz1_bor_vbuaa
ora.z __6
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [54] *memoryRemap::zVal = memoryRemap::$9 -- _deref_pbuc1=vbuaa
sta zVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [54] memoryRemap::zVal = memoryRemap::$9 -- vbuz1=vbuaa
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal

View File

@ -61,25 +61,25 @@ const byte memcpy_dma4::src_bank#0 src_bank = 0
struct DMA_LIST_F018B memcpy_dma_command4 loadstore mem[12] = { command: DMA_COMMAND_COPY, count: 0, src: (byte*) 0, src_bank: 0, dest: (byte*) 0, dest_bank: 0, sub_command: 0, modulo: 0 }
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
byte~ memoryRemap::$0 reg byte a 202.0
byte~ memoryRemap::$1 zp[1]:6 67.33333333333333
byte~ memoryRemap::$1 zp[1]:7 67.33333333333333
byte~ memoryRemap::$2 reg byte a 202.0
byte~ memoryRemap::$3 reg byte a 202.0
byte~ memoryRemap::$4 reg byte a 202.0
byte~ memoryRemap::$5 reg byte a 202.0
byte~ memoryRemap::$6 zp[1]:7 67.33333333333333
byte~ memoryRemap::$6 zp[1]:10 67.33333333333333
byte~ memoryRemap::$7 reg byte a 202.0
byte~ memoryRemap::$8 reg byte a 202.0
byte~ memoryRemap::$9 reg byte a 202.0
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:6 7.769230769230769
word memoryRemap::lowerPageOffset
word memoryRemap::lowerPageOffset#4 lowerPageOffset zp[2]:2 50.5
byte memoryRemap::remapBlocks
byte memoryRemap::remapBlocks#4 reg byte z 20.2
word memoryRemap::upperPageOffset
word memoryRemap::upperPageOffset#4 upperPageOffset zp[2]:4 18.363636363636363
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:8 12.625
volatile byte memoryRemap::yVal loadstore zp[1]:9 16.833333333333332
volatile byte memoryRemap::zVal loadstore zp[1]:11 101.0
void memoryRemapBlock(byte memoryRemapBlock::blockPage , word memoryRemapBlock::memoryPage)
byte memoryRemapBlock::block
const byte memoryRemapBlock::block#0 block = $40>>5
@ -101,14 +101,18 @@ reg byte z [ memoryRemap::remapBlocks#4 ]
zp[2]:4 [ memoryRemap::upperPageOffset#4 ]
reg byte a [ irq::raster#0 ]
reg byte a [ memoryRemap::$0 ]
zp[1]:6 [ memoryRemap::$1 ]
zp[1]:6 [ memoryRemap::aVal ]
zp[1]:7 [ memoryRemap::$1 ]
reg byte a [ memoryRemap::$2 ]
reg byte a [ memoryRemap::$3 ]
reg byte a [ memoryRemap::$4 ]
zp[1]:8 [ memoryRemap::xVal ]
reg byte a [ memoryRemap::$5 ]
zp[1]:7 [ memoryRemap::$6 ]
zp[1]:9 [ memoryRemap::yVal ]
zp[1]:10 [ memoryRemap::$6 ]
reg byte a [ memoryRemap::$7 ]
reg byte a [ memoryRemap::$8 ]
reg byte a [ memoryRemap::$9 ]
zp[1]:11 [ memoryRemap::zVal ]
reg byte x [ memcpy_dma4::dmaMode#0 ]
mem[12] [ memcpy_dma_command4 ]

View File

@ -79,19 +79,23 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// aVal = <lowerPageOffset
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
sta xVal
// *yVal = <upperPageOffset
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
lda aVal
ldx xVal

View File

@ -18,10 +18,10 @@ main::@return: scope:[main] from main::@1
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[9] *memoryRemap::aVal = 0
[10] *memoryRemap::xVal = 0
[11] *memoryRemap::yVal = 0
[12] *memoryRemap::zVal = 0
[9] memoryRemap::aVal = 0
[10] memoryRemap::xVal = 0
[11] memoryRemap::yVal = 0
[12] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap

View File

@ -5,6 +5,16 @@ Fixing struct type SIZE_OF struct F018_DMAGIC to 17
Fixing struct type SIZE_OF struct F018_DMAGIC to 17
Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >&DMA_SCREEN_UP
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&DMA_SCREEN_UP
Setting inferred volatile on symbol affected by address-of: memoryRemap::aVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::xVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::yVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::zVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::lMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::uMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::aVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::xVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::yVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::zVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -15,19 +25,19 @@ memoryRemap: scope:[memoryRemap] from main
memoryRemap::remapBlocks#1 = phi( main/memoryRemap::remapBlocks#0 )
memoryRemap::lowerPageOffset#1 = phi( main/memoryRemap::lowerPageOffset#0 )
memoryRemap::$0 = < memoryRemap::lowerPageOffset#1
*memoryRemap::aVal = memoryRemap::$0
memoryRemap::aVal = memoryRemap::$0
memoryRemap::$1 = memoryRemap::remapBlocks#1 << 4
memoryRemap::$2 = > memoryRemap::lowerPageOffset#1
memoryRemap::$3 = memoryRemap::$2 & $f
memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3
*memoryRemap::xVal = memoryRemap::$4
memoryRemap::xVal = memoryRemap::$4
memoryRemap::$5 = < memoryRemap::upperPageOffset#1
*memoryRemap::yVal = memoryRemap::$5
memoryRemap::yVal = memoryRemap::$5
memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
memoryRemap::$7 = > memoryRemap::upperPageOffset#1
memoryRemap::$8 = memoryRemap::$7 & $f
memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
*memoryRemap::zVal = memoryRemap::$9
memoryRemap::zVal = memoryRemap::$9
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -86,7 +96,7 @@ number~ memoryRemap::$6
byte~ memoryRemap::$7
number~ memoryRemap::$8
number~ memoryRemap::$9
const byte* memoryRemap::aVal = (byte*)$fc
volatile byte memoryRemap::aVal loadstore
word memoryRemap::lowerPageOffset
word memoryRemap::lowerPageOffset#0
word memoryRemap::lowerPageOffset#1
@ -96,9 +106,9 @@ byte memoryRemap::remapBlocks#1
word memoryRemap::upperPageOffset
word memoryRemap::upperPageOffset#0
word memoryRemap::upperPageOffset#1
const byte* memoryRemap::xVal = (byte*)$fd
const byte* memoryRemap::yVal = (byte*)$fe
const byte* memoryRemap::zVal = (byte*)$ff
volatile byte memoryRemap::xVal loadstore
volatile byte memoryRemap::yVal loadstore
volatile byte memoryRemap::zVal loadstore
Adding number conversion cast (unumber) $50 in
Adding number conversion cast (unumber) 4 in memoryRemap::$1 = memoryRemap::remapBlocks#1 << 4
@ -126,10 +136,6 @@ Inlining cast *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB) = (unumber)0
Inlining cast *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = (unumber)0
Inlining cast *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B) = (unumber)0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 252
Simplifying constant pointer cast (byte*) 253
Simplifying constant pointer cast (byte*) 254
Simplifying constant pointer cast (byte*) 255
Simplifying constant pointer cast (struct F018_DMAGIC*) 55040
Simplifying constant pointer cast (byte*) 2048
Simplifying constant integer cast $50
@ -163,6 +169,10 @@ Inferred type updated to byte in memoryRemap::$4 = memoryRemap::$1 | memoryRemap
Inferred type updated to byte in memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
Inferred type updated to byte in memoryRemap::$8 = memoryRemap::$7 & $f
Inferred type updated to byte in memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Identical Phi Values memoryRemap::lowerPageOffset#1 memoryRemap::lowerPageOffset#0
Identical Phi Values memoryRemap::remapBlocks#1 memoryRemap::remapBlocks#0
Identical Phi Values memoryRemap::upperPageOffset#1 memoryRemap::upperPageOffset#0
@ -180,6 +190,10 @@ Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Constant right-side identified [0] memoryRemap::$0 = < memoryRemap::lowerPageOffset#0
Constant right-side identified [2] memoryRemap::$1 = memoryRemap::remapBlocks#0 << 4
Constant right-side identified [3] memoryRemap::$2 = > memoryRemap::lowerPageOffset#0
@ -210,14 +224,16 @@ Eliminating unused constant memoryRemap::upperPageOffset#0
Eliminating unused constant memoryRemap::$1
Eliminating unused constant memoryRemap::$6
Successful SSA optimization PassNEliminateUnusedVars
Alias memoryRemap::$4 = memoryRemap::$3
Alias memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [1] memoryRemap::$4 = memoryRemap::$2 & $f
Constant right-side identified [4] memoryRemap::$9 = memoryRemap::$7 & $f
Alias candidate removed (volatile)memoryRemap::$4 = memoryRemap::$3 memoryRemap::xVal
Alias candidate removed (volatile)memoryRemap::$9 = memoryRemap::$8 memoryRemap::zVal
Constant right-side identified [1] memoryRemap::$3 = memoryRemap::$2 & $f
Constant right-side identified [5] memoryRemap::$8 = memoryRemap::$7 & $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant memoryRemap::$4 = memoryRemap::$2&$f
Constant memoryRemap::$9 = memoryRemap::$7&$f
Constant memoryRemap::$3 = memoryRemap::$2&$f
Constant memoryRemap::$8 = memoryRemap::$7&$f
Successful SSA optimization Pass2ConstantIdentification
Constant memoryRemap::$4 = memoryRemap::$3
Constant memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero memoryRemap::$2&$f in
Simplifying constant evaluating to zero memoryRemap::$7&$f in
@ -227,8 +243,10 @@ Eliminating unused constant memoryRemap::$7
Successful SSA optimization PassNEliminateUnusedVars
Constant inlined memoryRemap::$4 = 0
Constant inlined memoryRemap::$5 = 0
Constant inlined memoryRemap::$8 = 0
Constant inlined memoryRemap::$0 = 0
Constant inlined memoryRemap::$9 = 0
Constant inlined memoryRemap::$3 = 0
Successful SSA optimization Pass2ConstantInlining
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 8
@ -264,10 +282,10 @@ main::@return: scope:[main] from main::@1
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[9] *memoryRemap::aVal = 0
[10] *memoryRemap::xVal = 0
[11] *memoryRemap::yVal = 0
[12] *memoryRemap::zVal = 0
[9] memoryRemap::aVal = 0
[10] memoryRemap::xVal = 0
[11] memoryRemap::yVal = 0
[12] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -279,14 +297,30 @@ VARIABLE REGISTER WEIGHTS
struct DMA_LIST_F018B DMA_SCREEN_UP loadstore = { command: DMA_COMMAND_COPY, count: (word)$18*$50, src: DEFAULT_SCREEN+$50, src_bank: 0, dest: DEFAULT_SCREEN, dest_bank: 0, sub_command: 0, modulo: 0 }
void main()
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
volatile byte memoryRemap::aVal loadstore 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
volatile byte memoryRemap::xVal loadstore 3.6666666666666665
volatile byte memoryRemap::yVal loadstore 5.5
volatile byte memoryRemap::zVal loadstore 11.0
Initial phi equivalence classes
Added variable memoryRemap::aVal to live range equivalence class [ memoryRemap::aVal ]
Added variable memoryRemap::xVal to live range equivalence class [ memoryRemap::xVal ]
Added variable memoryRemap::yVal to live range equivalence class [ memoryRemap::yVal ]
Added variable memoryRemap::zVal to live range equivalence class [ memoryRemap::zVal ]
Added variable DMA_SCREEN_UP to live range equivalence class [ DMA_SCREEN_UP ]
Complete equivalence classes
[ memoryRemap::aVal ]
[ memoryRemap::xVal ]
[ memoryRemap::yVal ]
[ memoryRemap::zVal ]
[ DMA_SCREEN_UP ]
Allocated zp[1]:2 [ memoryRemap::aVal ]
Allocated zp[1]:3 [ memoryRemap::xVal ]
Allocated zp[1]:4 [ memoryRemap::yVal ]
Allocated zp[1]:5 [ memoryRemap::zVal ]
Allocated mem[12] [ DMA_SCREEN_UP ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [2] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B) = 1 [ DMA_SCREEN_UP ] ( [ DMA_SCREEN_UP ] { } ) always clobbers reg byte a
@ -295,37 +329,49 @@ Statement [4] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = 0 [ DMA_SCREEN_
Statement [5] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) = >&DMA_SCREEN_UP [ DMA_SCREEN_UP ] ( [ DMA_SCREEN_UP ] { } ) always clobbers reg byte a
Statement [6] *((byte*)DMA) = <&DMA_SCREEN_UP [ ] ( [ ] { } ) always clobbers reg byte a
Statement [7] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B) = 0 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [9] *memoryRemap::aVal = 0 [ ] ( memoryRemap:1 [ DMA_SCREEN_UP ] { } ) always clobbers reg byte a
Statement [10] *memoryRemap::xVal = 0 [ ] ( memoryRemap:1 [ DMA_SCREEN_UP ] { } ) always clobbers reg byte a
Statement [11] *memoryRemap::yVal = 0 [ ] ( memoryRemap:1 [ DMA_SCREEN_UP ] { } ) always clobbers reg byte a
Statement [12] *memoryRemap::zVal = 0 [ ] ( memoryRemap:1 [ DMA_SCREEN_UP ] { } ) always clobbers reg byte a
Statement [9] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:1 [ DMA_SCREEN_UP memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [10] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:1 [ DMA_SCREEN_UP memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [11] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:1 [ DMA_SCREEN_UP memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [12] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:1 [ DMA_SCREEN_UP memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Potential registers zp[1]:2 [ memoryRemap::aVal ] : zp[1]:2 ,
Potential registers zp[1]:3 [ memoryRemap::xVal ] : zp[1]:3 ,
Potential registers zp[1]:4 [ memoryRemap::yVal ] : zp[1]:4 ,
Potential registers zp[1]:5 [ memoryRemap::zVal ] : zp[1]:5 ,
Potential registers mem[12] [ DMA_SCREEN_UP ] : mem[12] ,
REGISTER UPLIFT SCOPES
Uplift Scope [memoryRemap] 11: zp[1]:5 [ memoryRemap::zVal ] 5.5: zp[1]:4 [ memoryRemap::yVal ] 3.67: zp[1]:3 [ memoryRemap::xVal ] 2.75: zp[1]:2 [ memoryRemap::aVal ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [MOS6569_VICII]
Uplift Scope [MOS6581_SID]
Uplift Scope [MOS4569_VICIII]
Uplift Scope [MEGA65_VICIV]
Uplift Scope [memoryRemap]
Uplift Scope [F018_DMAGIC]
Uplift Scope [DMA_LIST_F018A]
Uplift Scope [DMA_LIST_F018B]
Uplift Scope [main]
Uplift Scope [] 0: mem[12] [ DMA_SCREEN_UP ]
Uplifting [MOS6526_CIA] best 106 combination
Uplifting [MOS6569_VICII] best 106 combination
Uplifting [MOS6581_SID] best 106 combination
Uplifting [MOS4569_VICIII] best 106 combination
Uplifting [MEGA65_VICIV] best 106 combination
Uplifting [memoryRemap] best 106 combination
Uplifting [F018_DMAGIC] best 106 combination
Uplifting [DMA_LIST_F018A] best 106 combination
Uplifting [DMA_LIST_F018B] best 106 combination
Uplifting [main] best 106 combination
Uplifting [] best 106 combination mem[12] [ DMA_SCREEN_UP ]
Uplifting [memoryRemap] best 102 combination zp[1]:5 [ memoryRemap::zVal ] zp[1]:4 [ memoryRemap::yVal ] zp[1]:3 [ memoryRemap::xVal ] zp[1]:2 [ memoryRemap::aVal ]
Uplifting [MOS6526_CIA] best 102 combination
Uplifting [MOS6569_VICII] best 102 combination
Uplifting [MOS6581_SID] best 102 combination
Uplifting [MOS4569_VICIII] best 102 combination
Uplifting [MEGA65_VICIV] best 102 combination
Uplifting [F018_DMAGIC] best 102 combination
Uplifting [DMA_LIST_F018A] best 102 combination
Uplifting [DMA_LIST_F018B] best 102 combination
Uplifting [main] best 102 combination
Uplifting [] best 102 combination mem[12] [ DMA_SCREEN_UP ]
Attempting to uplift remaining variables inzp[1]:5 [ memoryRemap::zVal ]
Uplifting [memoryRemap] best 102 combination zp[1]:5 [ memoryRemap::zVal ]
Attempting to uplift remaining variables inzp[1]:4 [ memoryRemap::yVal ]
Uplifting [memoryRemap] best 102 combination zp[1]:4 [ memoryRemap::yVal ]
Attempting to uplift remaining variables inzp[1]:3 [ memoryRemap::xVal ]
Uplifting [memoryRemap] best 102 combination zp[1]:3 [ memoryRemap::xVal ]
Attempting to uplift remaining variables inzp[1]:2 [ memoryRemap::aVal ]
Uplifting [memoryRemap] best 102 combination zp[1]:2 [ memoryRemap::aVal ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -421,22 +467,26 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// [9] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// [9] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// [10] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta.z aVal
// [10] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
lda #0
sta xVal
// [11] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta.z xVal
// [11] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
lda #0
sta yVal
// [12] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta.z yVal
// [12] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
lda #0
sta zVal
sta.z zVal
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal
ldx xVal
@ -486,19 +536,23 @@ const byte OFFSET_STRUCT_F018_DMAGIC_ADDRMSB = 1
const byte OFFSET_STRUCT_F018_DMAGIC_EN018B = 3
void main()
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:2 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:3 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:4 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:5 11.0
zp[1]:2 [ memoryRemap::aVal ]
zp[1]:3 [ memoryRemap::xVal ]
zp[1]:4 [ memoryRemap::yVal ]
zp[1]:5 [ memoryRemap::zVal ]
mem[12] [ DMA_SCREEN_UP ]
FINAL ASSEMBLER
Score: 89
Score: 85
// File Comments
// MEGA65 DMA test using F018 directly
@ -596,23 +650,27 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
// [9] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// aVal = <lowerPageOffset
// [9] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [10] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta xVal
// *yVal = <upperPageOffset
// [11] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [12] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [10] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// [11] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [12] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal

View File

@ -8,12 +8,16 @@ const byte OFFSET_STRUCT_F018_DMAGIC_ADDRMSB = 1
const byte OFFSET_STRUCT_F018_DMAGIC_EN018B = 3
void main()
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:2 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:3 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:4 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:5 11.0
zp[1]:2 [ memoryRemap::aVal ]
zp[1]:3 [ memoryRemap::xVal ]
zp[1]:4 [ memoryRemap::yVal ]
zp[1]:5 [ memoryRemap::zVal ]
mem[12] [ DMA_SCREEN_UP ]

View File

@ -65,19 +65,23 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// aVal = <lowerPageOffset
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
sta xVal
// *yVal = <upperPageOffset
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
lda aVal
ldx xVal

View File

@ -14,10 +14,10 @@ main::@return: scope:[main] from main::@1
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[5] *memoryRemap::aVal = 0
[6] *memoryRemap::xVal = 0
[7] *memoryRemap::yVal = 0
[8] *memoryRemap::zVal = 0
[5] memoryRemap::aVal = 0
[6] memoryRemap::xVal = 0
[7] memoryRemap::yVal = 0
[8] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap

View File

@ -33,6 +33,16 @@ Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memcpy_dma_command4
Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >&memset_dma_command
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memset_dma_command
Setting inferred volatile on symbol affected by address-of: memoryRemap::aVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::xVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::yVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::zVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::lMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::uMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::aVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::xVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::yVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::zVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx
Eliminating unused variable with no statement memcpy_dma_command4
Eliminating unused variable with no statement memset_dma_command
@ -45,19 +55,19 @@ memoryRemap: scope:[memoryRemap] from main
memoryRemap::remapBlocks#1 = phi( main/memoryRemap::remapBlocks#0 )
memoryRemap::lowerPageOffset#1 = phi( main/memoryRemap::lowerPageOffset#0 )
memoryRemap::$0 = < memoryRemap::lowerPageOffset#1
*memoryRemap::aVal = memoryRemap::$0
memoryRemap::aVal = memoryRemap::$0
memoryRemap::$1 = memoryRemap::remapBlocks#1 << 4
memoryRemap::$2 = > memoryRemap::lowerPageOffset#1
memoryRemap::$3 = memoryRemap::$2 & $f
memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3
*memoryRemap::xVal = memoryRemap::$4
memoryRemap::xVal = memoryRemap::$4
memoryRemap::$5 = < memoryRemap::upperPageOffset#1
*memoryRemap::yVal = memoryRemap::$5
memoryRemap::yVal = memoryRemap::$5
memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
memoryRemap::$7 = > memoryRemap::upperPageOffset#1
memoryRemap::$8 = memoryRemap::$7 & $f
memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
*memoryRemap::zVal = memoryRemap::$9
memoryRemap::zVal = memoryRemap::$9
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -151,7 +161,7 @@ number~ memoryRemap::$6
byte~ memoryRemap::$7
number~ memoryRemap::$8
number~ memoryRemap::$9
const byte* memoryRemap::aVal = (byte*)$fc
volatile byte memoryRemap::aVal loadstore
word memoryRemap::lowerPageOffset
word memoryRemap::lowerPageOffset#0
word memoryRemap::lowerPageOffset#1
@ -161,9 +171,9 @@ byte memoryRemap::remapBlocks#1
word memoryRemap::upperPageOffset
word memoryRemap::upperPageOffset#0
word memoryRemap::upperPageOffset#1
const byte* memoryRemap::xVal = (byte*)$fd
const byte* memoryRemap::yVal = (byte*)$fe
const byte* memoryRemap::zVal = (byte*)$ff
volatile byte memoryRemap::xVal loadstore
volatile byte memoryRemap::yVal loadstore
volatile byte memoryRemap::zVal loadstore
Adding number conversion cast (unumber) 4 in memoryRemap::$1 = memoryRemap::remapBlocks#1 << 4
Adding number conversion cast (unumber) $f in memoryRemap::$3 = memoryRemap::$2 & $f
@ -193,10 +203,6 @@ Inlining cast memoryRemap::lowerPageOffset#0 = (unumber)0
Inlining cast memoryRemap::upperPageOffset#0 = (unumber)0
Inlining cast memcpy_dma::num#0 = (unumber)$18*$50
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 252
Simplifying constant pointer cast (byte*) 253
Simplifying constant pointer cast (byte*) 254
Simplifying constant pointer cast (byte*) 255
Simplifying constant pointer cast (struct F018_DMAGIC*) 55040
Simplifying constant pointer cast (byte*) 2048
Simplifying constant pointer cast (byte*) 0
@ -230,6 +236,10 @@ Inferred type updated to byte in memoryRemap::$4 = memoryRemap::$1 | memoryRemap
Inferred type updated to byte in memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
Inferred type updated to byte in memoryRemap::$8 = memoryRemap::$7 & $f
Inferred type updated to byte in memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Identical Phi Values memoryRemap::lowerPageOffset#1 memoryRemap::lowerPageOffset#0
Identical Phi Values memoryRemap::remapBlocks#1 memoryRemap::remapBlocks#0
Identical Phi Values memoryRemap::upperPageOffset#1 memoryRemap::upperPageOffset#0
@ -258,6 +268,10 @@ Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Constant right-side identified [0] memoryRemap::$0 = < memoryRemap::lowerPageOffset#0
Constant right-side identified [2] memoryRemap::$1 = memoryRemap::remapBlocks#0 << 4
Constant right-side identified [3] memoryRemap::$2 = > memoryRemap::lowerPageOffset#0
@ -288,14 +302,16 @@ Eliminating unused constant memoryRemap::upperPageOffset#0
Eliminating unused constant memoryRemap::$1
Eliminating unused constant memoryRemap::$6
Successful SSA optimization PassNEliminateUnusedVars
Alias memoryRemap::$4 = memoryRemap::$3
Alias memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [1] memoryRemap::$4 = memoryRemap::$2 & $f
Constant right-side identified [4] memoryRemap::$9 = memoryRemap::$7 & $f
Alias candidate removed (volatile)memoryRemap::$4 = memoryRemap::$3 memoryRemap::xVal
Alias candidate removed (volatile)memoryRemap::$9 = memoryRemap::$8 memoryRemap::zVal
Constant right-side identified [1] memoryRemap::$3 = memoryRemap::$2 & $f
Constant right-side identified [5] memoryRemap::$8 = memoryRemap::$7 & $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant memoryRemap::$4 = memoryRemap::$2&$f
Constant memoryRemap::$9 = memoryRemap::$7&$f
Constant memoryRemap::$3 = memoryRemap::$2&$f
Constant memoryRemap::$8 = memoryRemap::$7&$f
Successful SSA optimization Pass2ConstantIdentification
Constant memoryRemap::$4 = memoryRemap::$3
Constant memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero memoryRemap::$2&$f in
Simplifying constant evaluating to zero memoryRemap::$7&$f in
@ -305,8 +321,10 @@ Eliminating unused constant memoryRemap::$7
Successful SSA optimization PassNEliminateUnusedVars
Constant inlined memoryRemap::$4 = 0
Constant inlined memoryRemap::$5 = 0
Constant inlined memoryRemap::$8 = 0
Constant inlined memoryRemap::$0 = 0
Constant inlined memoryRemap::$9 = 0
Constant inlined memoryRemap::$3 = 0
Successful SSA optimization Pass2ConstantInlining
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 8
@ -342,10 +360,10 @@ main::@return: scope:[main] from main::@1
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[5] *memoryRemap::aVal = 0
[6] *memoryRemap::xVal = 0
[7] *memoryRemap::yVal = 0
[8] *memoryRemap::zVal = 0
[5] memoryRemap::aVal = 0
[6] memoryRemap::xVal = 0
[7] memoryRemap::yVal = 0
[8] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -380,26 +398,42 @@ word memcpy_dma::num
void* memcpy_dma::src
struct DMA_LIST_F018B memcpy_dma_command loadstore = { command: DMA_COMMAND_COPY, count: 0, src: (byte*) 0, src_bank: 0, dest: (byte*) 0, dest_bank: 0, sub_command: 0, modulo: 0 }
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
volatile byte memoryRemap::aVal loadstore 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
volatile byte memoryRemap::xVal loadstore 3.6666666666666665
volatile byte memoryRemap::yVal loadstore 5.5
volatile byte memoryRemap::zVal loadstore 11.0
Initial phi equivalence classes
Added variable memoryRemap::aVal to live range equivalence class [ memoryRemap::aVal ]
Added variable memoryRemap::xVal to live range equivalence class [ memoryRemap::xVal ]
Added variable memoryRemap::yVal to live range equivalence class [ memoryRemap::yVal ]
Added variable memoryRemap::zVal to live range equivalence class [ memoryRemap::zVal ]
Added variable memcpy_dma::dmaMode#0 to live range equivalence class [ memcpy_dma::dmaMode#0 ]
Added variable memcpy_dma_command to live range equivalence class [ memcpy_dma_command ]
Complete equivalence classes
[ memoryRemap::aVal ]
[ memoryRemap::xVal ]
[ memoryRemap::yVal ]
[ memoryRemap::zVal ]
[ memcpy_dma::dmaMode#0 ]
[ memcpy_dma_command ]
Allocated zp[1]:2 [ memcpy_dma::dmaMode#0 ]
Allocated zp[1]:2 [ memoryRemap::aVal ]
Allocated zp[1]:3 [ memoryRemap::xVal ]
Allocated zp[1]:4 [ memoryRemap::yVal ]
Allocated zp[1]:5 [ memoryRemap::zVal ]
Allocated zp[1]:6 [ memcpy_dma::dmaMode#0 ]
Allocated mem[12] [ memcpy_dma_command ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *memoryRemap::aVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [6] *memoryRemap::xVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [7] *memoryRemap::yVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [8] *memoryRemap::zVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [5] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:1 [ memcpy_dma_command memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [6] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:1 [ memcpy_dma_command memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [7] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:1 [ memcpy_dma_command memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [8] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:1 [ memcpy_dma_command memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [12] *((word*)&memcpy_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memcpy_dma::num#0 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] ( memcpy_dma:3 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ memcpy_dma::dmaMode#0 ]
Removing always clobbered register reg byte a as potential for zp[1]:6 [ memcpy_dma::dmaMode#0 ]
Statement [13] *((byte**)&memcpy_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_SRC) = (byte*)memcpy_dma::src#0 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] ( memcpy_dma:3 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [14] *((byte**)&memcpy_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_DEST) = (byte*)memcpy_dma::dest#0 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] ( memcpy_dma:3 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [15] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B) = 1 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] ( memcpy_dma:3 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] { } ) always clobbers reg byte a
@ -407,10 +441,10 @@ Statement [16] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB) = 0 [ memcpy_dma::
Statement [17] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = 0 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] ( memcpy_dma:3 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [18] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) = >&memcpy_dma_command [ memcpy_dma::dmaMode#0 memcpy_dma_command ] ( memcpy_dma:3 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [19] *((byte*)DMA) = <&memcpy_dma_command [ memcpy_dma::dmaMode#0 ] ( memcpy_dma:3 [ memcpy_dma::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [5] *memoryRemap::aVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [6] *memoryRemap::xVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [7] *memoryRemap::yVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [8] *memoryRemap::zVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [5] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:1 [ memcpy_dma_command memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [6] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:1 [ memcpy_dma_command memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [7] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:1 [ memcpy_dma_command memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [8] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:1 [ memcpy_dma_command memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [12] *((word*)&memcpy_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memcpy_dma::num#0 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] ( memcpy_dma:3 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [13] *((byte**)&memcpy_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_SRC) = (byte*)memcpy_dma::src#0 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] ( memcpy_dma:3 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] { } ) always clobbers reg byte a
@ -420,35 +454,47 @@ Statement [16] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB) = 0 [ memcpy_dma::
Statement [17] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = 0 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] ( memcpy_dma:3 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [18] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) = >&memcpy_dma_command [ memcpy_dma::dmaMode#0 memcpy_dma_command ] ( memcpy_dma:3 [ memcpy_dma::dmaMode#0 memcpy_dma_command ] { } ) always clobbers reg byte a
Statement [19] *((byte*)DMA) = <&memcpy_dma_command [ memcpy_dma::dmaMode#0 ] ( memcpy_dma:3 [ memcpy_dma::dmaMode#0 ] { } ) always clobbers reg byte a
Potential registers zp[1]:2 [ memcpy_dma::dmaMode#0 ] : zp[1]:2 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:2 [ memoryRemap::aVal ] : zp[1]:2 ,
Potential registers zp[1]:3 [ memoryRemap::xVal ] : zp[1]:3 ,
Potential registers zp[1]:4 [ memoryRemap::yVal ] : zp[1]:4 ,
Potential registers zp[1]:5 [ memoryRemap::zVal ] : zp[1]:5 ,
Potential registers zp[1]:6 [ memcpy_dma::dmaMode#0 ] : zp[1]:6 , reg byte x , reg byte y , reg byte z ,
Potential registers mem[12] [ memcpy_dma_command ] : mem[12] ,
REGISTER UPLIFT SCOPES
Uplift Scope [memcpy_dma] 2.44: zp[1]:2 [ memcpy_dma::dmaMode#0 ]
Uplift Scope [memoryRemap] 11: zp[1]:5 [ memoryRemap::zVal ] 5.5: zp[1]:4 [ memoryRemap::yVal ] 3.67: zp[1]:3 [ memoryRemap::xVal ] 2.75: zp[1]:2 [ memoryRemap::aVal ]
Uplift Scope [memcpy_dma] 2.44: zp[1]:6 [ memcpy_dma::dmaMode#0 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [MOS6569_VICII]
Uplift Scope [MOS6581_SID]
Uplift Scope [MOS4569_VICIII]
Uplift Scope [MEGA65_VICIV]
Uplift Scope [memoryRemap]
Uplift Scope [F018_DMAGIC]
Uplift Scope [DMA_LIST_F018A]
Uplift Scope [DMA_LIST_F018B]
Uplift Scope [main]
Uplift Scope [] 0: mem[12] [ memcpy_dma_command ]
Uplifting [memcpy_dma] best 159 combination reg byte x [ memcpy_dma::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 159 combination
Uplifting [MOS6569_VICII] best 159 combination
Uplifting [MOS6581_SID] best 159 combination
Uplifting [MOS4569_VICIII] best 159 combination
Uplifting [MEGA65_VICIV] best 159 combination
Uplifting [memoryRemap] best 159 combination
Uplifting [F018_DMAGIC] best 159 combination
Uplifting [DMA_LIST_F018A] best 159 combination
Uplifting [DMA_LIST_F018B] best 159 combination
Uplifting [main] best 159 combination
Uplifting [] best 159 combination mem[12] [ memcpy_dma_command ]
Uplifting [memoryRemap] best 161 combination zp[1]:5 [ memoryRemap::zVal ] zp[1]:4 [ memoryRemap::yVal ] zp[1]:3 [ memoryRemap::xVal ] zp[1]:2 [ memoryRemap::aVal ]
Uplifting [memcpy_dma] best 155 combination reg byte x [ memcpy_dma::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 155 combination
Uplifting [MOS6569_VICII] best 155 combination
Uplifting [MOS6581_SID] best 155 combination
Uplifting [MOS4569_VICIII] best 155 combination
Uplifting [MEGA65_VICIV] best 155 combination
Uplifting [F018_DMAGIC] best 155 combination
Uplifting [DMA_LIST_F018A] best 155 combination
Uplifting [DMA_LIST_F018B] best 155 combination
Uplifting [main] best 155 combination
Uplifting [] best 155 combination mem[12] [ memcpy_dma_command ]
Attempting to uplift remaining variables inzp[1]:5 [ memoryRemap::zVal ]
Uplifting [memoryRemap] best 155 combination zp[1]:5 [ memoryRemap::zVal ]
Attempting to uplift remaining variables inzp[1]:4 [ memoryRemap::yVal ]
Uplifting [memoryRemap] best 155 combination zp[1]:4 [ memoryRemap::yVal ]
Attempting to uplift remaining variables inzp[1]:3 [ memoryRemap::xVal ]
Uplifting [memoryRemap] best 155 combination zp[1]:3 [ memoryRemap::xVal ]
Attempting to uplift remaining variables inzp[1]:2 [ memoryRemap::aVal ]
Uplifting [memoryRemap] best 155 combination zp[1]:2 [ memoryRemap::aVal ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -531,22 +577,26 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// [5] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// [5] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// [6] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta.z aVal
// [6] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
lda #0
sta xVal
// [7] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta.z xVal
// [7] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
lda #0
sta yVal
// [8] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta.z yVal
// [8] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
lda #0
sta zVal
sta.z zVal
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal
ldx xVal
@ -668,20 +718,24 @@ void* memcpy_dma::src
const void* memcpy_dma::src#0 src = (void*)DEFAULT_SCREEN+$50
struct DMA_LIST_F018B memcpy_dma_command loadstore mem[12] = { command: DMA_COMMAND_COPY, count: 0, src: (byte*) 0, src_bank: 0, dest: (byte*) 0, dest_bank: 0, sub_command: 0, modulo: 0 }
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:2 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:3 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:4 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:5 11.0
zp[1]:2 [ memoryRemap::aVal ]
zp[1]:3 [ memoryRemap::xVal ]
zp[1]:4 [ memoryRemap::yVal ]
zp[1]:5 [ memoryRemap::zVal ]
reg byte x [ memcpy_dma::dmaMode#0 ]
mem[12] [ memcpy_dma_command ]
FINAL ASSEMBLER
Score: 139
Score: 135
// File Comments
// MEGA65 DMA test using memcpy version
@ -761,23 +815,27 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
// [5] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// aVal = <lowerPageOffset
// [5] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [6] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta xVal
// *yVal = <upperPageOffset
// [7] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [8] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [6] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// [7] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [8] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal

View File

@ -20,13 +20,17 @@ void* memcpy_dma::src
const void* memcpy_dma::src#0 src = (void*)DEFAULT_SCREEN+$50
struct DMA_LIST_F018B memcpy_dma_command loadstore mem[12] = { command: DMA_COMMAND_COPY, count: 0, src: (byte*) 0, src_bank: 0, dest: (byte*) 0, dest_bank: 0, sub_command: 0, modulo: 0 }
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:2 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:3 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:4 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:5 11.0
zp[1]:2 [ memoryRemap::aVal ]
zp[1]:3 [ memoryRemap::xVal ]
zp[1]:4 [ memoryRemap::yVal ]
zp[1]:5 [ memoryRemap::zVal ]
reg byte x [ memcpy_dma::dmaMode#0 ]
mem[12] [ memcpy_dma_command ]

View File

@ -67,19 +67,23 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// aVal = <lowerPageOffset
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
sta xVal
// *yVal = <upperPageOffset
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
lda aVal
ldx xVal

View File

@ -14,10 +14,10 @@ main::@return: scope:[main] from main::@1
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[5] *memoryRemap::aVal = 0
[6] *memoryRemap::xVal = 0
[7] *memoryRemap::yVal = 0
[8] *memoryRemap::zVal = 0
[5] memoryRemap::aVal = 0
[6] memoryRemap::xVal = 0
[7] memoryRemap::yVal = 0
[8] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap

View File

@ -33,6 +33,16 @@ Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memcpy_dma_command4
Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >&memset_dma_command
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memset_dma_command
Setting inferred volatile on symbol affected by address-of: memoryRemap::aVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::xVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::yVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::zVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::lMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::uMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::aVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::xVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::yVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::zVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx
Eliminating unused variable with no statement memcpy_dma_command
Eliminating unused variable with no statement memset_dma_command
@ -45,19 +55,19 @@ memoryRemap: scope:[memoryRemap] from main
memoryRemap::remapBlocks#1 = phi( main/memoryRemap::remapBlocks#0 )
memoryRemap::lowerPageOffset#1 = phi( main/memoryRemap::lowerPageOffset#0 )
memoryRemap::$0 = < memoryRemap::lowerPageOffset#1
*memoryRemap::aVal = memoryRemap::$0
memoryRemap::aVal = memoryRemap::$0
memoryRemap::$1 = memoryRemap::remapBlocks#1 << 4
memoryRemap::$2 = > memoryRemap::lowerPageOffset#1
memoryRemap::$3 = memoryRemap::$2 & $f
memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3
*memoryRemap::xVal = memoryRemap::$4
memoryRemap::xVal = memoryRemap::$4
memoryRemap::$5 = < memoryRemap::upperPageOffset#1
*memoryRemap::yVal = memoryRemap::$5
memoryRemap::yVal = memoryRemap::$5
memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
memoryRemap::$7 = > memoryRemap::upperPageOffset#1
memoryRemap::$8 = memoryRemap::$7 & $f
memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
*memoryRemap::zVal = memoryRemap::$9
memoryRemap::zVal = memoryRemap::$9
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -165,7 +175,7 @@ number~ memoryRemap::$6
byte~ memoryRemap::$7
number~ memoryRemap::$8
number~ memoryRemap::$9
const byte* memoryRemap::aVal = (byte*)$fc
volatile byte memoryRemap::aVal loadstore
word memoryRemap::lowerPageOffset
word memoryRemap::lowerPageOffset#0
word memoryRemap::lowerPageOffset#1
@ -175,9 +185,9 @@ byte memoryRemap::remapBlocks#1
word memoryRemap::upperPageOffset
word memoryRemap::upperPageOffset#0
word memoryRemap::upperPageOffset#1
const byte* memoryRemap::xVal = (byte*)$fd
const byte* memoryRemap::yVal = (byte*)$fe
const byte* memoryRemap::zVal = (byte*)$ff
volatile byte memoryRemap::xVal loadstore
volatile byte memoryRemap::yVal loadstore
volatile byte memoryRemap::zVal loadstore
Adding number conversion cast (unumber) 4 in memoryRemap::$1 = memoryRemap::remapBlocks#1 << 4
Adding number conversion cast (unumber) $f in memoryRemap::$3 = memoryRemap::$2 & $f
@ -211,10 +221,6 @@ Inlining cast memcpy_dma4::dest_bank#0 = (unumber)0
Inlining cast memcpy_dma4::src_bank#0 = (unumber)0
Inlining cast memcpy_dma4::num#0 = (unumber)$18*$50
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 252
Simplifying constant pointer cast (byte*) 253
Simplifying constant pointer cast (byte*) 254
Simplifying constant pointer cast (byte*) 255
Simplifying constant pointer cast (struct F018_DMAGIC*) 55040
Simplifying constant pointer cast (byte*) 2048
Simplifying constant pointer cast (byte*) 0
@ -252,6 +258,10 @@ Inferred type updated to byte in memoryRemap::$4 = memoryRemap::$1 | memoryRemap
Inferred type updated to byte in memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
Inferred type updated to byte in memoryRemap::$8 = memoryRemap::$7 & $f
Inferred type updated to byte in memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Identical Phi Values memoryRemap::lowerPageOffset#1 memoryRemap::lowerPageOffset#0
Identical Phi Values memoryRemap::remapBlocks#1 memoryRemap::remapBlocks#0
Identical Phi Values memoryRemap::upperPageOffset#1 memoryRemap::upperPageOffset#0
@ -284,6 +294,10 @@ Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Constant right-side identified [0] memoryRemap::$0 = < memoryRemap::lowerPageOffset#0
Constant right-side identified [2] memoryRemap::$1 = memoryRemap::remapBlocks#0 << 4
Constant right-side identified [3] memoryRemap::$2 = > memoryRemap::lowerPageOffset#0
@ -314,14 +328,16 @@ Eliminating unused constant memoryRemap::upperPageOffset#0
Eliminating unused constant memoryRemap::$1
Eliminating unused constant memoryRemap::$6
Successful SSA optimization PassNEliminateUnusedVars
Alias memoryRemap::$4 = memoryRemap::$3
Alias memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [1] memoryRemap::$4 = memoryRemap::$2 & $f
Constant right-side identified [4] memoryRemap::$9 = memoryRemap::$7 & $f
Alias candidate removed (volatile)memoryRemap::$4 = memoryRemap::$3 memoryRemap::xVal
Alias candidate removed (volatile)memoryRemap::$9 = memoryRemap::$8 memoryRemap::zVal
Constant right-side identified [1] memoryRemap::$3 = memoryRemap::$2 & $f
Constant right-side identified [5] memoryRemap::$8 = memoryRemap::$7 & $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant memoryRemap::$4 = memoryRemap::$2&$f
Constant memoryRemap::$9 = memoryRemap::$7&$f
Constant memoryRemap::$3 = memoryRemap::$2&$f
Constant memoryRemap::$8 = memoryRemap::$7&$f
Successful SSA optimization Pass2ConstantIdentification
Constant memoryRemap::$4 = memoryRemap::$3
Constant memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero memoryRemap::$2&$f in
Simplifying constant evaluating to zero memoryRemap::$7&$f in
@ -331,8 +347,10 @@ Eliminating unused constant memoryRemap::$7
Successful SSA optimization PassNEliminateUnusedVars
Constant inlined memoryRemap::$4 = 0
Constant inlined memoryRemap::$5 = 0
Constant inlined memoryRemap::$8 = 0
Constant inlined memoryRemap::$0 = 0
Constant inlined memoryRemap::$9 = 0
Constant inlined memoryRemap::$3 = 0
Successful SSA optimization Pass2ConstantInlining
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 8
@ -368,10 +386,10 @@ main::@return: scope:[main] from main::@1
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[5] *memoryRemap::aVal = 0
[6] *memoryRemap::xVal = 0
[7] *memoryRemap::yVal = 0
[8] *memoryRemap::zVal = 0
[5] memoryRemap::aVal = 0
[6] memoryRemap::xVal = 0
[7] memoryRemap::yVal = 0
[8] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -410,26 +428,42 @@ void* memcpy_dma4::src
byte memcpy_dma4::src_bank
struct DMA_LIST_F018B memcpy_dma_command4 loadstore = { command: DMA_COMMAND_COPY, count: 0, src: (byte*) 0, src_bank: 0, dest: (byte*) 0, dest_bank: 0, sub_command: 0, modulo: 0 }
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
volatile byte memoryRemap::aVal loadstore 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
volatile byte memoryRemap::xVal loadstore 3.6666666666666665
volatile byte memoryRemap::yVal loadstore 5.5
volatile byte memoryRemap::zVal loadstore 11.0
Initial phi equivalence classes
Added variable memoryRemap::aVal to live range equivalence class [ memoryRemap::aVal ]
Added variable memoryRemap::xVal to live range equivalence class [ memoryRemap::xVal ]
Added variable memoryRemap::yVal to live range equivalence class [ memoryRemap::yVal ]
Added variable memoryRemap::zVal to live range equivalence class [ memoryRemap::zVal ]
Added variable memcpy_dma4::dmaMode#0 to live range equivalence class [ memcpy_dma4::dmaMode#0 ]
Added variable memcpy_dma_command4 to live range equivalence class [ memcpy_dma_command4 ]
Complete equivalence classes
[ memoryRemap::aVal ]
[ memoryRemap::xVal ]
[ memoryRemap::yVal ]
[ memoryRemap::zVal ]
[ memcpy_dma4::dmaMode#0 ]
[ memcpy_dma_command4 ]
Allocated zp[1]:2 [ memcpy_dma4::dmaMode#0 ]
Allocated zp[1]:2 [ memoryRemap::aVal ]
Allocated zp[1]:3 [ memoryRemap::xVal ]
Allocated zp[1]:4 [ memoryRemap::yVal ]
Allocated zp[1]:5 [ memoryRemap::zVal ]
Allocated zp[1]:6 [ memcpy_dma4::dmaMode#0 ]
Allocated mem[12] [ memcpy_dma_command4 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *memoryRemap::aVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [6] *memoryRemap::xVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [7] *memoryRemap::yVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [8] *memoryRemap::zVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [5] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:1 [ memcpy_dma_command4 memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [6] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:1 [ memcpy_dma_command4 memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [7] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:1 [ memcpy_dma_command4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [8] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:1 [ memcpy_dma_command4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [12] *((word*)&memcpy_dma_command4+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memcpy_dma4::num#0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:3 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ memcpy_dma4::dmaMode#0 ]
Removing always clobbered register reg byte a as potential for zp[1]:6 [ memcpy_dma4::dmaMode#0 ]
Statement [13] *((byte*)&memcpy_dma_command4+OFFSET_STRUCT_DMA_LIST_F018B_SRC_BANK) = memcpy_dma4::src_bank#0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:3 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [14] *((byte**)&memcpy_dma_command4+OFFSET_STRUCT_DMA_LIST_F018B_SRC) = (byte*)memcpy_dma4::src#0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:3 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [15] *((byte*)&memcpy_dma_command4+OFFSET_STRUCT_DMA_LIST_F018B_DEST_BANK) = memcpy_dma4::dest_bank#0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:3 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
@ -439,10 +473,10 @@ Statement [18] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB) = 0 [ memcpy_dma4:
Statement [19] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = 0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:3 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [20] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) = >&memcpy_dma_command4 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:3 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [21] *((byte*)DMA) = <&memcpy_dma_command4 [ memcpy_dma4::dmaMode#0 ] ( memcpy_dma4:3 [ memcpy_dma4::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [5] *memoryRemap::aVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [6] *memoryRemap::xVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [7] *memoryRemap::yVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [8] *memoryRemap::zVal = 0 [ ] ( memoryRemap:1 [ memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [5] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:1 [ memcpy_dma_command4 memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [6] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:1 [ memcpy_dma_command4 memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [7] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:1 [ memcpy_dma_command4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [8] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:1 [ memcpy_dma_command4 memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [12] *((word*)&memcpy_dma_command4+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memcpy_dma4::num#0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:3 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [13] *((byte*)&memcpy_dma_command4+OFFSET_STRUCT_DMA_LIST_F018B_SRC_BANK) = memcpy_dma4::src_bank#0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:3 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
@ -454,35 +488,47 @@ Statement [18] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB) = 0 [ memcpy_dma4:
Statement [19] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = 0 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:3 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [20] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) = >&memcpy_dma_command4 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] ( memcpy_dma4:3 [ memcpy_dma4::dmaMode#0 memcpy_dma_command4 ] { } ) always clobbers reg byte a
Statement [21] *((byte*)DMA) = <&memcpy_dma_command4 [ memcpy_dma4::dmaMode#0 ] ( memcpy_dma4:3 [ memcpy_dma4::dmaMode#0 ] { } ) always clobbers reg byte a
Potential registers zp[1]:2 [ memcpy_dma4::dmaMode#0 ] : zp[1]:2 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:2 [ memoryRemap::aVal ] : zp[1]:2 ,
Potential registers zp[1]:3 [ memoryRemap::xVal ] : zp[1]:3 ,
Potential registers zp[1]:4 [ memoryRemap::yVal ] : zp[1]:4 ,
Potential registers zp[1]:5 [ memoryRemap::zVal ] : zp[1]:5 ,
Potential registers zp[1]:6 [ memcpy_dma4::dmaMode#0 ] : zp[1]:6 , reg byte x , reg byte y , reg byte z ,
Potential registers mem[12] [ memcpy_dma_command4 ] : mem[12] ,
REGISTER UPLIFT SCOPES
Uplift Scope [memcpy_dma4] 2: zp[1]:2 [ memcpy_dma4::dmaMode#0 ]
Uplift Scope [memoryRemap] 11: zp[1]:5 [ memoryRemap::zVal ] 5.5: zp[1]:4 [ memoryRemap::yVal ] 3.67: zp[1]:3 [ memoryRemap::xVal ] 2.75: zp[1]:2 [ memoryRemap::aVal ]
Uplift Scope [memcpy_dma4] 2: zp[1]:6 [ memcpy_dma4::dmaMode#0 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [MOS6569_VICII]
Uplift Scope [MOS6581_SID]
Uplift Scope [MOS4569_VICIII]
Uplift Scope [MEGA65_VICIV]
Uplift Scope [memoryRemap]
Uplift Scope [F018_DMAGIC]
Uplift Scope [DMA_LIST_F018A]
Uplift Scope [DMA_LIST_F018B]
Uplift Scope [main]
Uplift Scope [] 0: mem[12] [ memcpy_dma_command4 ]
Uplifting [memcpy_dma4] best 171 combination reg byte x [ memcpy_dma4::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 171 combination
Uplifting [MOS6569_VICII] best 171 combination
Uplifting [MOS6581_SID] best 171 combination
Uplifting [MOS4569_VICIII] best 171 combination
Uplifting [MEGA65_VICIV] best 171 combination
Uplifting [memoryRemap] best 171 combination
Uplifting [F018_DMAGIC] best 171 combination
Uplifting [DMA_LIST_F018A] best 171 combination
Uplifting [DMA_LIST_F018B] best 171 combination
Uplifting [main] best 171 combination
Uplifting [] best 171 combination mem[12] [ memcpy_dma_command4 ]
Uplifting [memoryRemap] best 173 combination zp[1]:5 [ memoryRemap::zVal ] zp[1]:4 [ memoryRemap::yVal ] zp[1]:3 [ memoryRemap::xVal ] zp[1]:2 [ memoryRemap::aVal ]
Uplifting [memcpy_dma4] best 167 combination reg byte x [ memcpy_dma4::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 167 combination
Uplifting [MOS6569_VICII] best 167 combination
Uplifting [MOS6581_SID] best 167 combination
Uplifting [MOS4569_VICIII] best 167 combination
Uplifting [MEGA65_VICIV] best 167 combination
Uplifting [F018_DMAGIC] best 167 combination
Uplifting [DMA_LIST_F018A] best 167 combination
Uplifting [DMA_LIST_F018B] best 167 combination
Uplifting [main] best 167 combination
Uplifting [] best 167 combination mem[12] [ memcpy_dma_command4 ]
Attempting to uplift remaining variables inzp[1]:5 [ memoryRemap::zVal ]
Uplifting [memoryRemap] best 167 combination zp[1]:5 [ memoryRemap::zVal ]
Attempting to uplift remaining variables inzp[1]:4 [ memoryRemap::yVal ]
Uplifting [memoryRemap] best 167 combination zp[1]:4 [ memoryRemap::yVal ]
Attempting to uplift remaining variables inzp[1]:3 [ memoryRemap::xVal ]
Uplifting [memoryRemap] best 167 combination zp[1]:3 [ memoryRemap::xVal ]
Attempting to uplift remaining variables inzp[1]:2 [ memoryRemap::aVal ]
Uplifting [memoryRemap] best 167 combination zp[1]:2 [ memoryRemap::aVal ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -567,22 +613,26 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// [5] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// [5] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// [6] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta.z aVal
// [6] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
lda #0
sta xVal
// [7] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta.z xVal
// [7] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
lda #0
sta yVal
// [8] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta.z yVal
// [8] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
lda #0
sta zVal
sta.z zVal
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal
ldx xVal
@ -720,20 +770,24 @@ byte memcpy_dma4::src_bank
const byte memcpy_dma4::src_bank#0 src_bank = 0
struct DMA_LIST_F018B memcpy_dma_command4 loadstore mem[12] = { command: DMA_COMMAND_COPY, count: 0, src: (byte*) 0, src_bank: 0, dest: (byte*) 0, dest_bank: 0, sub_command: 0, modulo: 0 }
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:2 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:3 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:4 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:5 11.0
zp[1]:2 [ memoryRemap::aVal ]
zp[1]:3 [ memoryRemap::xVal ]
zp[1]:4 [ memoryRemap::yVal ]
zp[1]:5 [ memoryRemap::zVal ]
reg byte x [ memcpy_dma4::dmaMode#0 ]
mem[12] [ memcpy_dma_command4 ]
FINAL ASSEMBLER
Score: 151
Score: 147
// File Comments
// MEGA65 DMA test using 4MB version
@ -815,23 +869,27 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
// [5] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// aVal = <lowerPageOffset
// [5] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [6] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta xVal
// *yVal = <upperPageOffset
// [7] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [8] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [6] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// [7] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [8] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal

View File

@ -26,13 +26,17 @@ byte memcpy_dma4::src_bank
const byte memcpy_dma4::src_bank#0 src_bank = 0
struct DMA_LIST_F018B memcpy_dma_command4 loadstore mem[12] = { command: DMA_COMMAND_COPY, count: 0, src: (byte*) 0, src_bank: 0, dest: (byte*) 0, dest_bank: 0, sub_command: 0, modulo: 0 }
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:2 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:3 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:4 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:5 11.0
zp[1]:2 [ memoryRemap::aVal ]
zp[1]:3 [ memoryRemap::xVal ]
zp[1]:4 [ memoryRemap::yVal ]
zp[1]:5 [ memoryRemap::zVal ]
reg byte x [ memcpy_dma4::dmaMode#0 ]
mem[12] [ memcpy_dma_command4 ]

View File

@ -76,19 +76,23 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// aVal = <lowerPageOffset
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
sta xVal
// *yVal = <upperPageOffset
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
lda aVal
ldx xVal

View File

@ -14,10 +14,10 @@ main::@return: scope:[main] from main::@1
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[5] *memoryRemap::aVal = 0
[6] *memoryRemap::xVal = 0
[7] *memoryRemap::yVal = 0
[8] *memoryRemap::zVal = 0
[5] memoryRemap::aVal = 0
[6] memoryRemap::xVal = 0
[7] memoryRemap::yVal = 0
[8] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap

View File

@ -33,6 +33,16 @@ Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memcpy_dma_command4
Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >&memset_dma_command
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memset_dma_command
Setting inferred volatile on symbol affected by address-of: memoryRemap::aVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::xVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::yVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::zVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::lMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::uMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::aVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::xVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::yVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::zVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx
Eliminating unused variable with no statement memcpy_dma_command
Eliminating unused variable with no statement memcpy_dma_command4
@ -46,19 +56,19 @@ memoryRemap: scope:[memoryRemap] from main
memoryRemap::remapBlocks#1 = phi( main/memoryRemap::remapBlocks#0 )
memoryRemap::lowerPageOffset#1 = phi( main/memoryRemap::lowerPageOffset#0 )
memoryRemap::$0 = < memoryRemap::lowerPageOffset#1
*memoryRemap::aVal = memoryRemap::$0
memoryRemap::aVal = memoryRemap::$0
memoryRemap::$1 = memoryRemap::remapBlocks#1 << 4
memoryRemap::$2 = > memoryRemap::lowerPageOffset#1
memoryRemap::$3 = memoryRemap::$2 & $f
memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3
*memoryRemap::xVal = memoryRemap::$4
memoryRemap::xVal = memoryRemap::$4
memoryRemap::$5 = < memoryRemap::upperPageOffset#1
*memoryRemap::yVal = memoryRemap::$5
memoryRemap::yVal = memoryRemap::$5
memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
memoryRemap::$7 = > memoryRemap::upperPageOffset#1
memoryRemap::$8 = memoryRemap::$7 & $f
memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
*memoryRemap::zVal = memoryRemap::$9
memoryRemap::zVal = memoryRemap::$9
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -211,7 +221,7 @@ number~ memoryRemap::$6
byte~ memoryRemap::$7
number~ memoryRemap::$8
number~ memoryRemap::$9
const byte* memoryRemap::aVal = (byte*)$fc
volatile byte memoryRemap::aVal loadstore
word memoryRemap::lowerPageOffset
word memoryRemap::lowerPageOffset#0
word memoryRemap::lowerPageOffset#1
@ -221,9 +231,9 @@ byte memoryRemap::remapBlocks#1
word memoryRemap::upperPageOffset
word memoryRemap::upperPageOffset#0
word memoryRemap::upperPageOffset#1
const byte* memoryRemap::xVal = (byte*)$fd
const byte* memoryRemap::yVal = (byte*)$fe
const byte* memoryRemap::zVal = (byte*)$ff
volatile byte memoryRemap::xVal loadstore
volatile byte memoryRemap::yVal loadstore
volatile byte memoryRemap::zVal loadstore
Adding number conversion cast (unumber) 4 in memoryRemap::$1 = memoryRemap::remapBlocks#1 << 4
Adding number conversion cast (unumber) $f in memoryRemap::$3 = memoryRemap::$2 & $f
@ -264,10 +274,6 @@ Inlining cast memcpy_dma256::src_mb#0 = (unumber)0
Inlining cast memcpy_dma256::src_bank#0 = (unumber)0
Inlining cast memcpy_dma256::num#0 = (unumber)$18*$50
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 252
Simplifying constant pointer cast (byte*) 253
Simplifying constant pointer cast (byte*) 254
Simplifying constant pointer cast (byte*) 255
Simplifying constant pointer cast (struct F018_DMAGIC*) 55040
Simplifying constant pointer cast (byte*) 2048
Simplifying constant integer cast 4
@ -313,6 +319,10 @@ Inferred type updated to byte in memoryRemap::$4 = memoryRemap::$1 | memoryRemap
Inferred type updated to byte in memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
Inferred type updated to byte in memoryRemap::$8 = memoryRemap::$7 & $f
Inferred type updated to byte in memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Identical Phi Values memoryRemap::lowerPageOffset#1 memoryRemap::lowerPageOffset#0
Identical Phi Values memoryRemap::remapBlocks#1 memoryRemap::remapBlocks#0
Identical Phi Values memoryRemap::upperPageOffset#1 memoryRemap::upperPageOffset#0
@ -373,6 +383,10 @@ Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Constant right-side identified [0] memoryRemap::$0 = < memoryRemap::lowerPageOffset#0
Constant right-side identified [2] memoryRemap::$1 = memoryRemap::remapBlocks#0 << 4
Constant right-side identified [3] memoryRemap::$2 = > memoryRemap::lowerPageOffset#0
@ -403,14 +417,16 @@ Eliminating unused constant memoryRemap::upperPageOffset#0
Eliminating unused constant memoryRemap::$1
Eliminating unused constant memoryRemap::$6
Successful SSA optimization PassNEliminateUnusedVars
Alias memoryRemap::$4 = memoryRemap::$3
Alias memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [1] memoryRemap::$4 = memoryRemap::$2 & $f
Constant right-side identified [4] memoryRemap::$9 = memoryRemap::$7 & $f
Alias candidate removed (volatile)memoryRemap::$4 = memoryRemap::$3 memoryRemap::xVal
Alias candidate removed (volatile)memoryRemap::$9 = memoryRemap::$8 memoryRemap::zVal
Constant right-side identified [1] memoryRemap::$3 = memoryRemap::$2 & $f
Constant right-side identified [5] memoryRemap::$8 = memoryRemap::$7 & $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant memoryRemap::$4 = memoryRemap::$2&$f
Constant memoryRemap::$9 = memoryRemap::$7&$f
Constant memoryRemap::$3 = memoryRemap::$2&$f
Constant memoryRemap::$8 = memoryRemap::$7&$f
Successful SSA optimization Pass2ConstantIdentification
Constant memoryRemap::$4 = memoryRemap::$3
Constant memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero memoryRemap::$2&$f in
Simplifying constant evaluating to zero memoryRemap::$7&$f in
@ -424,11 +440,13 @@ Constant inlined memcpy_dma256::$1 = >memcpy_dma_command256
Constant inlined memcpy_dma256::$8 = (word*)memcpy_dma256::f018b#0
Constant inlined memoryRemap::$0 = 0
Constant inlined memcpy_dma256::$0 = memcpy_dma_command256+6
Constant inlined memoryRemap::$3 = 0
Constant inlined memoryRemap::$4 = 0
Constant inlined memcpy_dma256::$12 = (byte**)memcpy_dma256::f018b#0
Constant inlined memoryRemap::$5 = 0
Constant inlined memcpy_dma256::$10 = (byte**)memcpy_dma256::f018b#0
Constant inlined memcpy_dma256::$11 = (byte*)memcpy_dma256::f018b#0
Constant inlined memoryRemap::$8 = 0
Constant inlined memoryRemap::$9 = 0
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(memcpy_dma_command256+1)
@ -473,10 +491,10 @@ main::@return: scope:[main] from main::@1
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[5] *memoryRemap::aVal = 0
[6] *memoryRemap::xVal = 0
[7] *memoryRemap::yVal = 0
[8] *memoryRemap::zVal = 0
[5] memoryRemap::aVal = 0
[6] memoryRemap::xVal = 0
[7] memoryRemap::yVal = 0
[8] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -519,23 +537,39 @@ void* memcpy_dma256::src
byte memcpy_dma256::src_bank
byte memcpy_dma256::src_mb
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
volatile byte memoryRemap::aVal loadstore 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
volatile byte memoryRemap::xVal loadstore 3.6666666666666665
volatile byte memoryRemap::yVal loadstore 5.5
volatile byte memoryRemap::zVal loadstore 11.0
Initial phi equivalence classes
Added variable memoryRemap::aVal to live range equivalence class [ memoryRemap::aVal ]
Added variable memoryRemap::xVal to live range equivalence class [ memoryRemap::xVal ]
Added variable memoryRemap::yVal to live range equivalence class [ memoryRemap::yVal ]
Added variable memoryRemap::zVal to live range equivalence class [ memoryRemap::zVal ]
Added variable memcpy_dma256::dmaMode#0 to live range equivalence class [ memcpy_dma256::dmaMode#0 ]
Complete equivalence classes
[ memoryRemap::aVal ]
[ memoryRemap::xVal ]
[ memoryRemap::yVal ]
[ memoryRemap::zVal ]
[ memcpy_dma256::dmaMode#0 ]
Allocated zp[1]:2 [ memcpy_dma256::dmaMode#0 ]
Allocated zp[1]:2 [ memoryRemap::aVal ]
Allocated zp[1]:3 [ memoryRemap::xVal ]
Allocated zp[1]:4 [ memoryRemap::yVal ]
Allocated zp[1]:5 [ memoryRemap::zVal ]
Allocated zp[1]:6 [ memcpy_dma256::dmaMode#0 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *memoryRemap::aVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [6] *memoryRemap::xVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [7] *memoryRemap::yVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [8] *memoryRemap::zVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [5] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:1 [ memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [6] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:1 [ memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [7] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:1 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [8] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:1 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [12] *(memcpy_dma_command256+1) = memcpy_dma256::src_mb#0 [ memcpy_dma256::dmaMode#0 ] ( memcpy_dma256:3 [ memcpy_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ memcpy_dma256::dmaMode#0 ]
Removing always clobbered register reg byte a as potential for zp[1]:6 [ memcpy_dma256::dmaMode#0 ]
Statement [13] *(memcpy_dma_command256+3) = memcpy_dma256::dest_mb#0 [ memcpy_dma256::dmaMode#0 ] ( memcpy_dma256:3 [ memcpy_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [14] *((word*)memcpy_dma256::f018b#0+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memcpy_dma256::num#0 [ memcpy_dma256::dmaMode#0 ] ( memcpy_dma256:3 [ memcpy_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [15] *((byte*)memcpy_dma256::f018b#0+OFFSET_STRUCT_DMA_LIST_F018B_SRC_BANK) = memcpy_dma256::src_bank#0 [ memcpy_dma256::dmaMode#0 ] ( memcpy_dma256:3 [ memcpy_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
@ -547,10 +581,10 @@ Statement [20] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB) = 0 [ memcpy_dma25
Statement [21] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = 0 [ memcpy_dma256::dmaMode#0 ] ( memcpy_dma256:3 [ memcpy_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [22] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) = >memcpy_dma_command256 [ memcpy_dma256::dmaMode#0 ] ( memcpy_dma256:3 [ memcpy_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [23] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ETRIG) = <memcpy_dma_command256 [ memcpy_dma256::dmaMode#0 ] ( memcpy_dma256:3 [ memcpy_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [5] *memoryRemap::aVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [6] *memoryRemap::xVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [7] *memoryRemap::yVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [8] *memoryRemap::zVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [5] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:1 [ memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [6] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:1 [ memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [7] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:1 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [8] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:1 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [12] *(memcpy_dma_command256+1) = memcpy_dma256::src_mb#0 [ memcpy_dma256::dmaMode#0 ] ( memcpy_dma256:3 [ memcpy_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [13] *(memcpy_dma_command256+3) = memcpy_dma256::dest_mb#0 [ memcpy_dma256::dmaMode#0 ] ( memcpy_dma256:3 [ memcpy_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
@ -564,34 +598,46 @@ Statement [20] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB) = 0 [ memcpy_dma25
Statement [21] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = 0 [ memcpy_dma256::dmaMode#0 ] ( memcpy_dma256:3 [ memcpy_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [22] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) = >memcpy_dma_command256 [ memcpy_dma256::dmaMode#0 ] ( memcpy_dma256:3 [ memcpy_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [23] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ETRIG) = <memcpy_dma_command256 [ memcpy_dma256::dmaMode#0 ] ( memcpy_dma256:3 [ memcpy_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Potential registers zp[1]:2 [ memcpy_dma256::dmaMode#0 ] : zp[1]:2 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:2 [ memoryRemap::aVal ] : zp[1]:2 ,
Potential registers zp[1]:3 [ memoryRemap::xVal ] : zp[1]:3 ,
Potential registers zp[1]:4 [ memoryRemap::yVal ] : zp[1]:4 ,
Potential registers zp[1]:5 [ memoryRemap::zVal ] : zp[1]:5 ,
Potential registers zp[1]:6 [ memcpy_dma256::dmaMode#0 ] : zp[1]:6 , reg byte x , reg byte y , reg byte z ,
REGISTER UPLIFT SCOPES
Uplift Scope [memcpy_dma256] 1.69: zp[1]:2 [ memcpy_dma256::dmaMode#0 ]
Uplift Scope [memoryRemap] 11: zp[1]:5 [ memoryRemap::zVal ] 5.5: zp[1]:4 [ memoryRemap::yVal ] 3.67: zp[1]:3 [ memoryRemap::xVal ] 2.75: zp[1]:2 [ memoryRemap::aVal ]
Uplift Scope [memcpy_dma256] 1.69: zp[1]:6 [ memcpy_dma256::dmaMode#0 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [MOS6569_VICII]
Uplift Scope [MOS6581_SID]
Uplift Scope [MOS4569_VICIII]
Uplift Scope [MEGA65_VICIV]
Uplift Scope [memoryRemap]
Uplift Scope [F018_DMAGIC]
Uplift Scope [DMA_LIST_F018A]
Uplift Scope [DMA_LIST_F018B]
Uplift Scope [main]
Uplift Scope []
Uplifting [memcpy_dma256] best 183 combination reg byte x [ memcpy_dma256::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 183 combination
Uplifting [MOS6569_VICII] best 183 combination
Uplifting [MOS6581_SID] best 183 combination
Uplifting [MOS4569_VICIII] best 183 combination
Uplifting [MEGA65_VICIV] best 183 combination
Uplifting [memoryRemap] best 183 combination
Uplifting [F018_DMAGIC] best 183 combination
Uplifting [DMA_LIST_F018A] best 183 combination
Uplifting [DMA_LIST_F018B] best 183 combination
Uplifting [main] best 183 combination
Uplifting [] best 183 combination
Uplifting [memoryRemap] best 185 combination zp[1]:5 [ memoryRemap::zVal ] zp[1]:4 [ memoryRemap::yVal ] zp[1]:3 [ memoryRemap::xVal ] zp[1]:2 [ memoryRemap::aVal ]
Uplifting [memcpy_dma256] best 179 combination reg byte x [ memcpy_dma256::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 179 combination
Uplifting [MOS6569_VICII] best 179 combination
Uplifting [MOS6581_SID] best 179 combination
Uplifting [MOS4569_VICIII] best 179 combination
Uplifting [MEGA65_VICIV] best 179 combination
Uplifting [F018_DMAGIC] best 179 combination
Uplifting [DMA_LIST_F018A] best 179 combination
Uplifting [DMA_LIST_F018B] best 179 combination
Uplifting [main] best 179 combination
Uplifting [] best 179 combination
Attempting to uplift remaining variables inzp[1]:5 [ memoryRemap::zVal ]
Uplifting [memoryRemap] best 179 combination zp[1]:5 [ memoryRemap::zVal ]
Attempting to uplift remaining variables inzp[1]:4 [ memoryRemap::yVal ]
Uplifting [memoryRemap] best 179 combination zp[1]:4 [ memoryRemap::yVal ]
Attempting to uplift remaining variables inzp[1]:3 [ memoryRemap::xVal ]
Uplifting [memoryRemap] best 179 combination zp[1]:3 [ memoryRemap::xVal ]
Attempting to uplift remaining variables inzp[1]:2 [ memoryRemap::aVal ]
Uplifting [memoryRemap] best 179 combination zp[1]:2 [ memoryRemap::aVal ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -685,22 +731,26 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// [5] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// [5] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// [6] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta.z aVal
// [6] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
lda #0
sta xVal
// [7] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta.z xVal
// [7] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
lda #0
sta yVal
// [8] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta.z yVal
// [8] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
lda #0
sta zVal
sta.z zVal
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal
ldx xVal
@ -856,19 +906,23 @@ byte memcpy_dma256::src_mb
const byte memcpy_dma256::src_mb#0 src_mb = 0
const byte* memcpy_dma_command256[] = { DMA_OPTION_SRC_MB, 0, DMA_OPTION_DEST_MB, 0, DMA_OPTION_FORMAT_F018B, DMA_OPTION_END, DMA_COMMAND_COPY, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:2 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:3 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:4 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:5 11.0
zp[1]:2 [ memoryRemap::aVal ]
zp[1]:3 [ memoryRemap::xVal ]
zp[1]:4 [ memoryRemap::yVal ]
zp[1]:5 [ memoryRemap::zVal ]
reg byte x [ memcpy_dma256::dmaMode#0 ]
FINAL ASSEMBLER
Score: 163
Score: 159
// File Comments
// MEGA65 DMA test using 256MB version
@ -959,23 +1013,27 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
// [5] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// aVal = <lowerPageOffset
// [5] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [6] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta xVal
// *yVal = <upperPageOffset
// [7] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [8] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [6] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// [7] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [8] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal

View File

@ -37,12 +37,16 @@ byte memcpy_dma256::src_mb
const byte memcpy_dma256::src_mb#0 src_mb = 0
const byte* memcpy_dma_command256[] = { DMA_OPTION_SRC_MB, 0, DMA_OPTION_DEST_MB, 0, DMA_OPTION_FORMAT_F018B, DMA_OPTION_END, DMA_COMMAND_COPY, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:2 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:3 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:4 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:5 11.0
zp[1]:2 [ memoryRemap::aVal ]
zp[1]:3 [ memoryRemap::xVal ]
zp[1]:4 [ memoryRemap::yVal ]
zp[1]:5 [ memoryRemap::zVal ]
reg byte x [ memcpy_dma256::dmaMode#0 ]

View File

@ -65,19 +65,23 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// aVal = <lowerPageOffset
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
sta xVal
// *yVal = <upperPageOffset
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
lda aVal
ldx xVal

View File

@ -14,10 +14,10 @@ main::@return: scope:[main] from main::@1
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[5] *memoryRemap::aVal = 0
[6] *memoryRemap::xVal = 0
[7] *memoryRemap::yVal = 0
[8] *memoryRemap::zVal = 0
[5] memoryRemap::aVal = 0
[6] memoryRemap::xVal = 0
[7] memoryRemap::yVal = 0
[8] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap

View File

@ -33,6 +33,16 @@ Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memcpy_dma_command4
Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >&memset_dma_command
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memset_dma_command
Setting inferred volatile on symbol affected by address-of: memoryRemap::aVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::xVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::yVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::zVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::lMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::uMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::aVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::xVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::yVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::zVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx
Eliminating unused variable with no statement memcpy_dma_command
Eliminating unused variable with no statement memcpy_dma_command4
@ -45,19 +55,19 @@ memoryRemap: scope:[memoryRemap] from main
memoryRemap::remapBlocks#1 = phi( main/memoryRemap::remapBlocks#0 )
memoryRemap::lowerPageOffset#1 = phi( main/memoryRemap::lowerPageOffset#0 )
memoryRemap::$0 = < memoryRemap::lowerPageOffset#1
*memoryRemap::aVal = memoryRemap::$0
memoryRemap::aVal = memoryRemap::$0
memoryRemap::$1 = memoryRemap::remapBlocks#1 << 4
memoryRemap::$2 = > memoryRemap::lowerPageOffset#1
memoryRemap::$3 = memoryRemap::$2 & $f
memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3
*memoryRemap::xVal = memoryRemap::$4
memoryRemap::xVal = memoryRemap::$4
memoryRemap::$5 = < memoryRemap::upperPageOffset#1
*memoryRemap::yVal = memoryRemap::$5
memoryRemap::yVal = memoryRemap::$5
memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
memoryRemap::$7 = > memoryRemap::upperPageOffset#1
memoryRemap::$8 = memoryRemap::$7 & $f
memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
*memoryRemap::zVal = memoryRemap::$9
memoryRemap::zVal = memoryRemap::$9
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -138,7 +148,7 @@ number~ memoryRemap::$6
byte~ memoryRemap::$7
number~ memoryRemap::$8
number~ memoryRemap::$9
const byte* memoryRemap::aVal = (byte*)$fc
volatile byte memoryRemap::aVal loadstore
word memoryRemap::lowerPageOffset
word memoryRemap::lowerPageOffset#0
word memoryRemap::lowerPageOffset#1
@ -148,9 +158,9 @@ byte memoryRemap::remapBlocks#1
word memoryRemap::upperPageOffset
word memoryRemap::upperPageOffset#0
word memoryRemap::upperPageOffset#1
const byte* memoryRemap::xVal = (byte*)$fd
const byte* memoryRemap::yVal = (byte*)$fe
const byte* memoryRemap::zVal = (byte*)$ff
volatile byte memoryRemap::xVal loadstore
volatile byte memoryRemap::yVal loadstore
volatile byte memoryRemap::zVal loadstore
void memset_dma(void* memset_dma::dest , byte memset_dma::fill , word memset_dma::num)
void* memset_dma::dest
void* memset_dma::dest#0
@ -191,10 +201,6 @@ Inlining cast memoryRemap::lowerPageOffset#0 = (unumber)0
Inlining cast memoryRemap::upperPageOffset#0 = (unumber)0
Inlining cast memset_dma::num#0 = (unumber)$50*$a
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 252
Simplifying constant pointer cast (byte*) 253
Simplifying constant pointer cast (byte*) 254
Simplifying constant pointer cast (byte*) 255
Simplifying constant pointer cast (struct F018_DMAGIC*) 55040
Simplifying constant pointer cast (byte*) 2048
Simplifying constant pointer cast (byte*) 0
@ -226,6 +232,10 @@ Inferred type updated to byte in memoryRemap::$4 = memoryRemap::$1 | memoryRemap
Inferred type updated to byte in memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
Inferred type updated to byte in memoryRemap::$8 = memoryRemap::$7 & $f
Inferred type updated to byte in memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Identical Phi Values memoryRemap::lowerPageOffset#1 memoryRemap::lowerPageOffset#0
Identical Phi Values memoryRemap::remapBlocks#1 memoryRemap::remapBlocks#0
Identical Phi Values memoryRemap::upperPageOffset#1 memoryRemap::upperPageOffset#0
@ -254,6 +264,10 @@ Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Constant right-side identified [0] memoryRemap::$0 = < memoryRemap::lowerPageOffset#0
Constant right-side identified [2] memoryRemap::$1 = memoryRemap::remapBlocks#0 << 4
Constant right-side identified [3] memoryRemap::$2 = > memoryRemap::lowerPageOffset#0
@ -284,14 +298,16 @@ Eliminating unused constant memoryRemap::upperPageOffset#0
Eliminating unused constant memoryRemap::$1
Eliminating unused constant memoryRemap::$6
Successful SSA optimization PassNEliminateUnusedVars
Alias memoryRemap::$4 = memoryRemap::$3
Alias memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [1] memoryRemap::$4 = memoryRemap::$2 & $f
Constant right-side identified [4] memoryRemap::$9 = memoryRemap::$7 & $f
Alias candidate removed (volatile)memoryRemap::$4 = memoryRemap::$3 memoryRemap::xVal
Alias candidate removed (volatile)memoryRemap::$9 = memoryRemap::$8 memoryRemap::zVal
Constant right-side identified [1] memoryRemap::$3 = memoryRemap::$2 & $f
Constant right-side identified [5] memoryRemap::$8 = memoryRemap::$7 & $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant memoryRemap::$4 = memoryRemap::$2&$f
Constant memoryRemap::$9 = memoryRemap::$7&$f
Constant memoryRemap::$3 = memoryRemap::$2&$f
Constant memoryRemap::$8 = memoryRemap::$7&$f
Successful SSA optimization Pass2ConstantIdentification
Constant memoryRemap::$4 = memoryRemap::$3
Constant memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero memoryRemap::$2&$f in
Simplifying constant evaluating to zero memoryRemap::$7&$f in
@ -301,8 +317,10 @@ Eliminating unused constant memoryRemap::$7
Successful SSA optimization PassNEliminateUnusedVars
Constant inlined memoryRemap::$4 = 0
Constant inlined memoryRemap::$5 = 0
Constant inlined memoryRemap::$8 = 0
Constant inlined memoryRemap::$0 = 0
Constant inlined memoryRemap::$9 = 0
Constant inlined memoryRemap::$3 = 0
Successful SSA optimization Pass2ConstantInlining
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 8
@ -338,10 +356,10 @@ main::@return: scope:[main] from main::@1
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[5] *memoryRemap::aVal = 0
[6] *memoryRemap::xVal = 0
[7] *memoryRemap::yVal = 0
[8] *memoryRemap::zVal = 0
[5] memoryRemap::aVal = 0
[6] memoryRemap::xVal = 0
[7] memoryRemap::yVal = 0
[8] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -369,9 +387,13 @@ memset_dma::@return: scope:[memset_dma] from memset_dma
VARIABLE REGISTER WEIGHTS
void main()
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
volatile byte memoryRemap::aVal loadstore 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
volatile byte memoryRemap::xVal loadstore 3.6666666666666665
volatile byte memoryRemap::yVal loadstore 5.5
volatile byte memoryRemap::zVal loadstore 11.0
void memset_dma(void* memset_dma::dest , byte memset_dma::fill , word memset_dma::num)
void* memset_dma::dest
byte memset_dma::dmaMode
@ -381,21 +403,33 @@ word memset_dma::num
struct DMA_LIST_F018B memset_dma_command loadstore = { command: DMA_COMMAND_FILL, count: 0, src: (byte*) 0, src_bank: 0, dest: (byte*) 0, dest_bank: 0, sub_command: 0, modulo: 0 }
Initial phi equivalence classes
Added variable memoryRemap::aVal to live range equivalence class [ memoryRemap::aVal ]
Added variable memoryRemap::xVal to live range equivalence class [ memoryRemap::xVal ]
Added variable memoryRemap::yVal to live range equivalence class [ memoryRemap::yVal ]
Added variable memoryRemap::zVal to live range equivalence class [ memoryRemap::zVal ]
Added variable memset_dma::dmaMode#0 to live range equivalence class [ memset_dma::dmaMode#0 ]
Added variable memset_dma_command to live range equivalence class [ memset_dma_command ]
Complete equivalence classes
[ memoryRemap::aVal ]
[ memoryRemap::xVal ]
[ memoryRemap::yVal ]
[ memoryRemap::zVal ]
[ memset_dma::dmaMode#0 ]
[ memset_dma_command ]
Allocated zp[1]:2 [ memset_dma::dmaMode#0 ]
Allocated zp[1]:2 [ memoryRemap::aVal ]
Allocated zp[1]:3 [ memoryRemap::xVal ]
Allocated zp[1]:4 [ memoryRemap::yVal ]
Allocated zp[1]:5 [ memoryRemap::zVal ]
Allocated zp[1]:6 [ memset_dma::dmaMode#0 ]
Allocated mem[12] [ memset_dma_command ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *memoryRemap::aVal = 0 [ ] ( memoryRemap:1 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [6] *memoryRemap::xVal = 0 [ ] ( memoryRemap:1 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [7] *memoryRemap::yVal = 0 [ ] ( memoryRemap:1 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [8] *memoryRemap::zVal = 0 [ ] ( memoryRemap:1 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [5] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:1 [ memset_dma_command memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [6] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:1 [ memset_dma_command memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [7] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:1 [ memset_dma_command memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [8] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:1 [ memset_dma_command memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [12] *((word*)&memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memset_dma::num#0 [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:3 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ memset_dma::dmaMode#0 ]
Removing always clobbered register reg byte a as potential for zp[1]:6 [ memset_dma::dmaMode#0 ]
Statement [13] *((byte**)&memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_SRC) = (byte*)memset_dma::fill#0 [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:3 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Statement [14] *((byte**)&memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_DEST) = (byte*)memset_dma::dest#0 [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:3 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Statement [15] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B) = 1 [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:3 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
@ -403,10 +437,10 @@ Statement [16] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB) = 0 [ memset_dma::
Statement [17] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = 0 [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:3 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Statement [18] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) = >&memset_dma_command [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:3 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Statement [19] *((byte*)DMA) = <&memset_dma_command [ memset_dma::dmaMode#0 ] ( memset_dma:3 [ memset_dma::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [5] *memoryRemap::aVal = 0 [ ] ( memoryRemap:1 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [6] *memoryRemap::xVal = 0 [ ] ( memoryRemap:1 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [7] *memoryRemap::yVal = 0 [ ] ( memoryRemap:1 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [8] *memoryRemap::zVal = 0 [ ] ( memoryRemap:1 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [5] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:1 [ memset_dma_command memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [6] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:1 [ memset_dma_command memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [7] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:1 [ memset_dma_command memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [8] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:1 [ memset_dma_command memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [12] *((word*)&memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memset_dma::num#0 [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:3 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Statement [13] *((byte**)&memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_SRC) = (byte*)memset_dma::fill#0 [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:3 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
@ -416,35 +450,47 @@ Statement [16] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB) = 0 [ memset_dma::
Statement [17] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = 0 [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:3 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Statement [18] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) = >&memset_dma_command [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:3 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Statement [19] *((byte*)DMA) = <&memset_dma_command [ memset_dma::dmaMode#0 ] ( memset_dma:3 [ memset_dma::dmaMode#0 ] { } ) always clobbers reg byte a
Potential registers zp[1]:2 [ memset_dma::dmaMode#0 ] : zp[1]:2 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:2 [ memoryRemap::aVal ] : zp[1]:2 ,
Potential registers zp[1]:3 [ memoryRemap::xVal ] : zp[1]:3 ,
Potential registers zp[1]:4 [ memoryRemap::yVal ] : zp[1]:4 ,
Potential registers zp[1]:5 [ memoryRemap::zVal ] : zp[1]:5 ,
Potential registers zp[1]:6 [ memset_dma::dmaMode#0 ] : zp[1]:6 , reg byte x , reg byte y , reg byte z ,
Potential registers mem[12] [ memset_dma_command ] : mem[12] ,
REGISTER UPLIFT SCOPES
Uplift Scope [memset_dma] 2.44: zp[1]:2 [ memset_dma::dmaMode#0 ]
Uplift Scope [memoryRemap] 11: zp[1]:5 [ memoryRemap::zVal ] 5.5: zp[1]:4 [ memoryRemap::yVal ] 3.67: zp[1]:3 [ memoryRemap::xVal ] 2.75: zp[1]:2 [ memoryRemap::aVal ]
Uplift Scope [memset_dma] 2.44: zp[1]:6 [ memset_dma::dmaMode#0 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [MOS6569_VICII]
Uplift Scope [MOS6581_SID]
Uplift Scope [MOS4569_VICIII]
Uplift Scope [MEGA65_VICIV]
Uplift Scope [memoryRemap]
Uplift Scope [F018_DMAGIC]
Uplift Scope [DMA_LIST_F018A]
Uplift Scope [DMA_LIST_F018B]
Uplift Scope [main]
Uplift Scope [] 0: mem[12] [ memset_dma_command ]
Uplifting [memset_dma] best 159 combination reg byte x [ memset_dma::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 159 combination
Uplifting [MOS6569_VICII] best 159 combination
Uplifting [MOS6581_SID] best 159 combination
Uplifting [MOS4569_VICIII] best 159 combination
Uplifting [MEGA65_VICIV] best 159 combination
Uplifting [memoryRemap] best 159 combination
Uplifting [F018_DMAGIC] best 159 combination
Uplifting [DMA_LIST_F018A] best 159 combination
Uplifting [DMA_LIST_F018B] best 159 combination
Uplifting [main] best 159 combination
Uplifting [] best 159 combination mem[12] [ memset_dma_command ]
Uplifting [memoryRemap] best 161 combination zp[1]:5 [ memoryRemap::zVal ] zp[1]:4 [ memoryRemap::yVal ] zp[1]:3 [ memoryRemap::xVal ] zp[1]:2 [ memoryRemap::aVal ]
Uplifting [memset_dma] best 155 combination reg byte x [ memset_dma::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 155 combination
Uplifting [MOS6569_VICII] best 155 combination
Uplifting [MOS6581_SID] best 155 combination
Uplifting [MOS4569_VICIII] best 155 combination
Uplifting [MEGA65_VICIV] best 155 combination
Uplifting [F018_DMAGIC] best 155 combination
Uplifting [DMA_LIST_F018A] best 155 combination
Uplifting [DMA_LIST_F018B] best 155 combination
Uplifting [main] best 155 combination
Uplifting [] best 155 combination mem[12] [ memset_dma_command ]
Attempting to uplift remaining variables inzp[1]:5 [ memoryRemap::zVal ]
Uplifting [memoryRemap] best 155 combination zp[1]:5 [ memoryRemap::zVal ]
Attempting to uplift remaining variables inzp[1]:4 [ memoryRemap::yVal ]
Uplifting [memoryRemap] best 155 combination zp[1]:4 [ memoryRemap::yVal ]
Attempting to uplift remaining variables inzp[1]:3 [ memoryRemap::xVal ]
Uplifting [memoryRemap] best 155 combination zp[1]:3 [ memoryRemap::xVal ]
Attempting to uplift remaining variables inzp[1]:2 [ memoryRemap::aVal ]
Uplifting [memoryRemap] best 155 combination zp[1]:2 [ memoryRemap::aVal ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -527,22 +573,26 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// [5] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// [5] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// [6] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta.z aVal
// [6] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
lda #0
sta xVal
// [7] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta.z xVal
// [7] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
lda #0
sta yVal
// [8] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta.z yVal
// [8] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
lda #0
sta zVal
sta.z zVal
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal
ldx xVal
@ -654,13 +704,13 @@ const byte OFFSET_STRUCT_F018_DMAGIC_ADDRMSB = 1
const byte OFFSET_STRUCT_F018_DMAGIC_EN018B = 3
void main()
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:2 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:3 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:4 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:5 11.0
void memset_dma(void* memset_dma::dest , byte memset_dma::fill , word memset_dma::num)
void* memset_dma::dest
const void* memset_dma::dest#0 dest = (void*)DEFAULT_SCREEN
@ -672,12 +722,16 @@ word memset_dma::num
const word memset_dma::num#0 num = (word)$50*$a
struct DMA_LIST_F018B memset_dma_command loadstore mem[12] = { command: DMA_COMMAND_FILL, count: 0, src: (byte*) 0, src_bank: 0, dest: (byte*) 0, dest_bank: 0, sub_command: 0, modulo: 0 }
zp[1]:2 [ memoryRemap::aVal ]
zp[1]:3 [ memoryRemap::xVal ]
zp[1]:4 [ memoryRemap::yVal ]
zp[1]:5 [ memoryRemap::zVal ]
reg byte x [ memset_dma::dmaMode#0 ]
mem[12] [ memset_dma_command ]
FINAL ASSEMBLER
Score: 139
Score: 135
// File Comments
// MEGA65 DMA test using memset
@ -757,23 +811,27 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
// [5] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// aVal = <lowerPageOffset
// [5] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [6] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta xVal
// *yVal = <upperPageOffset
// [7] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [8] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [6] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// [7] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [8] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal

View File

@ -10,13 +10,13 @@ const byte OFFSET_STRUCT_F018_DMAGIC_ADDRMSB = 1
const byte OFFSET_STRUCT_F018_DMAGIC_EN018B = 3
void main()
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:2 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:3 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:4 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:5 11.0
void memset_dma(void* memset_dma::dest , byte memset_dma::fill , word memset_dma::num)
void* memset_dma::dest
const void* memset_dma::dest#0 dest = (void*)DEFAULT_SCREEN
@ -28,5 +28,9 @@ word memset_dma::num
const word memset_dma::num#0 num = (word)$50*$a
struct DMA_LIST_F018B memset_dma_command loadstore mem[12] = { command: DMA_COMMAND_FILL, count: 0, src: (byte*) 0, src_bank: 0, dest: (byte*) 0, dest_bank: 0, sub_command: 0, modulo: 0 }
zp[1]:2 [ memoryRemap::aVal ]
zp[1]:3 [ memoryRemap::xVal ]
zp[1]:4 [ memoryRemap::yVal ]
zp[1]:5 [ memoryRemap::zVal ]
reg byte x [ memset_dma::dmaMode#0 ]
mem[12] [ memset_dma_command ]

View File

@ -73,19 +73,23 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// aVal = <lowerPageOffset
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
sta xVal
// *yVal = <upperPageOffset
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
lda aVal
ldx xVal

View File

@ -14,10 +14,10 @@ main::@return: scope:[main] from main::@1
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[5] *memoryRemap::aVal = 0
[6] *memoryRemap::xVal = 0
[7] *memoryRemap::yVal = 0
[8] *memoryRemap::zVal = 0
[5] memoryRemap::aVal = 0
[6] memoryRemap::xVal = 0
[7] memoryRemap::yVal = 0
[8] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap

View File

@ -33,6 +33,16 @@ Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memcpy_dma_command4
Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >&memset_dma_command
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memset_dma_command
Setting inferred volatile on symbol affected by address-of: memoryRemap::aVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::xVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::yVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::zVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::lMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::uMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::aVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::xVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::yVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::zVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx
Eliminating unused variable with no statement memcpy_dma_command
Eliminating unused variable with no statement memcpy_dma_command4
@ -46,19 +56,19 @@ memoryRemap: scope:[memoryRemap] from main
memoryRemap::remapBlocks#1 = phi( main/memoryRemap::remapBlocks#0 )
memoryRemap::lowerPageOffset#1 = phi( main/memoryRemap::lowerPageOffset#0 )
memoryRemap::$0 = < memoryRemap::lowerPageOffset#1
*memoryRemap::aVal = memoryRemap::$0
memoryRemap::aVal = memoryRemap::$0
memoryRemap::$1 = memoryRemap::remapBlocks#1 << 4
memoryRemap::$2 = > memoryRemap::lowerPageOffset#1
memoryRemap::$3 = memoryRemap::$2 & $f
memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3
*memoryRemap::xVal = memoryRemap::$4
memoryRemap::xVal = memoryRemap::$4
memoryRemap::$5 = < memoryRemap::upperPageOffset#1
*memoryRemap::yVal = memoryRemap::$5
memoryRemap::yVal = memoryRemap::$5
memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
memoryRemap::$7 = > memoryRemap::upperPageOffset#1
memoryRemap::$8 = memoryRemap::$7 & $f
memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
*memoryRemap::zVal = memoryRemap::$9
memoryRemap::zVal = memoryRemap::$9
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -161,7 +171,7 @@ number~ memoryRemap::$6
byte~ memoryRemap::$7
number~ memoryRemap::$8
number~ memoryRemap::$9
const byte* memoryRemap::aVal = (byte*)$fc
volatile byte memoryRemap::aVal loadstore
word memoryRemap::lowerPageOffset
word memoryRemap::lowerPageOffset#0
word memoryRemap::lowerPageOffset#1
@ -171,9 +181,9 @@ byte memoryRemap::remapBlocks#1
word memoryRemap::upperPageOffset
word memoryRemap::upperPageOffset#0
word memoryRemap::upperPageOffset#1
const byte* memoryRemap::xVal = (byte*)$fd
const byte* memoryRemap::yVal = (byte*)$fe
const byte* memoryRemap::zVal = (byte*)$ff
volatile byte memoryRemap::xVal loadstore
volatile byte memoryRemap::yVal loadstore
volatile byte memoryRemap::zVal loadstore
void memset_dma256(byte memset_dma256::dest_mb , byte memset_dma256::dest_bank , void* memset_dma256::dest , byte memset_dma256::fill , word memset_dma256::num)
byte*~ memset_dma256::$0
byte~ memset_dma256::$1
@ -239,10 +249,6 @@ Inlining cast memset_dma256::dest_mb#0 = (unumber)0
Inlining cast memset_dma256::dest_bank#0 = (unumber)0
Inlining cast memset_dma256::num#0 = (unumber)$50*$a
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 252
Simplifying constant pointer cast (byte*) 253
Simplifying constant pointer cast (byte*) 254
Simplifying constant pointer cast (byte*) 255
Simplifying constant pointer cast (struct F018_DMAGIC*) 55040
Simplifying constant pointer cast (byte*) 2048
Simplifying constant integer cast 4
@ -280,6 +286,10 @@ Inferred type updated to byte in memoryRemap::$4 = memoryRemap::$1 | memoryRemap
Inferred type updated to byte in memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
Inferred type updated to byte in memoryRemap::$8 = memoryRemap::$7 & $f
Inferred type updated to byte in memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Identical Phi Values memoryRemap::lowerPageOffset#1 memoryRemap::lowerPageOffset#0
Identical Phi Values memoryRemap::remapBlocks#1 memoryRemap::remapBlocks#0
Identical Phi Values memoryRemap::upperPageOffset#1 memoryRemap::upperPageOffset#0
@ -333,6 +343,10 @@ Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Constant right-side identified [0] memoryRemap::$0 = < memoryRemap::lowerPageOffset#0
Constant right-side identified [2] memoryRemap::$1 = memoryRemap::remapBlocks#0 << 4
Constant right-side identified [3] memoryRemap::$2 = > memoryRemap::lowerPageOffset#0
@ -363,14 +377,16 @@ Eliminating unused constant memoryRemap::upperPageOffset#0
Eliminating unused constant memoryRemap::$1
Eliminating unused constant memoryRemap::$6
Successful SSA optimization PassNEliminateUnusedVars
Alias memoryRemap::$4 = memoryRemap::$3
Alias memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [1] memoryRemap::$4 = memoryRemap::$2 & $f
Constant right-side identified [4] memoryRemap::$9 = memoryRemap::$7 & $f
Alias candidate removed (volatile)memoryRemap::$4 = memoryRemap::$3 memoryRemap::xVal
Alias candidate removed (volatile)memoryRemap::$9 = memoryRemap::$8 memoryRemap::zVal
Constant right-side identified [1] memoryRemap::$3 = memoryRemap::$2 & $f
Constant right-side identified [5] memoryRemap::$8 = memoryRemap::$7 & $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant memoryRemap::$4 = memoryRemap::$2&$f
Constant memoryRemap::$9 = memoryRemap::$7&$f
Constant memoryRemap::$3 = memoryRemap::$2&$f
Constant memoryRemap::$8 = memoryRemap::$7&$f
Successful SSA optimization Pass2ConstantIdentification
Constant memoryRemap::$4 = memoryRemap::$3
Constant memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero memoryRemap::$2&$f in
Simplifying constant evaluating to zero memoryRemap::$7&$f in
@ -378,17 +394,19 @@ Successful SSA optimization PassNSimplifyConstantZero
Eliminating unused constant memoryRemap::$2
Eliminating unused constant memoryRemap::$7
Successful SSA optimization PassNEliminateUnusedVars
Constant inlined memoryRemap::$0 = 0
Constant inlined memset_dma256::$1 = >memset_dma_command256
Constant inlined memset_dma256::$2 = <memset_dma_command256
Constant inlined memset_dma256::$0 = memset_dma_command256+4
Constant inlined memset_dma256::$10 = (byte**)memset_dma256::f018b#0
Constant inlined memoryRemap::$0 = 0
Constant inlined memoryRemap::$3 = 0
Constant inlined memoryRemap::$4 = 0
Constant inlined memoryRemap::$5 = 0
Constant inlined memoryRemap::$8 = 0
Constant inlined memset_dma256::$9 = (byte**)memset_dma256::f018b#0
Constant inlined memoryRemap::$9 = 0
Constant inlined memset_dma256::$7 = (word*)memset_dma256::f018b#0
Constant inlined memset_dma256::$8 = (byte*)memset_dma256::f018b#0
Constant inlined memset_dma256::$10 = (byte**)memset_dma256::f018b#0
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(memset_dma_command256+1)
Consolidated array index constant in *((word*)memset_dma256::f018b#0+OFFSET_STRUCT_DMA_LIST_F018B_COUNT)
@ -430,10 +448,10 @@ main::@return: scope:[main] from main::@1
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[5] *memoryRemap::aVal = 0
[6] *memoryRemap::xVal = 0
[7] *memoryRemap::yVal = 0
[8] *memoryRemap::zVal = 0
[5] memoryRemap::aVal = 0
[6] memoryRemap::xVal = 0
[7] memoryRemap::yVal = 0
[8] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -463,9 +481,13 @@ memset_dma256::@return: scope:[memset_dma256] from memset_dma256
VARIABLE REGISTER WEIGHTS
void main()
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
volatile byte memoryRemap::aVal loadstore 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
volatile byte memoryRemap::xVal loadstore 3.6666666666666665
volatile byte memoryRemap::yVal loadstore 5.5
volatile byte memoryRemap::zVal loadstore 11.0
void memset_dma256(byte memset_dma256::dest_mb , byte memset_dma256::dest_bank , void* memset_dma256::dest , byte memset_dma256::fill , word memset_dma256::num)
void* memset_dma256::dest
byte memset_dma256::dest_bank
@ -477,18 +499,30 @@ byte memset_dma256::fill
word memset_dma256::num
Initial phi equivalence classes
Added variable memoryRemap::aVal to live range equivalence class [ memoryRemap::aVal ]
Added variable memoryRemap::xVal to live range equivalence class [ memoryRemap::xVal ]
Added variable memoryRemap::yVal to live range equivalence class [ memoryRemap::yVal ]
Added variable memoryRemap::zVal to live range equivalence class [ memoryRemap::zVal ]
Added variable memset_dma256::dmaMode#0 to live range equivalence class [ memset_dma256::dmaMode#0 ]
Complete equivalence classes
[ memoryRemap::aVal ]
[ memoryRemap::xVal ]
[ memoryRemap::yVal ]
[ memoryRemap::zVal ]
[ memset_dma256::dmaMode#0 ]
Allocated zp[1]:2 [ memset_dma256::dmaMode#0 ]
Allocated zp[1]:2 [ memoryRemap::aVal ]
Allocated zp[1]:3 [ memoryRemap::xVal ]
Allocated zp[1]:4 [ memoryRemap::yVal ]
Allocated zp[1]:5 [ memoryRemap::zVal ]
Allocated zp[1]:6 [ memset_dma256::dmaMode#0 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *memoryRemap::aVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [6] *memoryRemap::xVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [7] *memoryRemap::yVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [8] *memoryRemap::zVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [5] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:1 [ memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [6] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:1 [ memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [7] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:1 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [8] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:1 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [12] *(memset_dma_command256+1) = memset_dma256::dest_mb#0 [ memset_dma256::dmaMode#0 ] ( memset_dma256:3 [ memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ memset_dma256::dmaMode#0 ]
Removing always clobbered register reg byte a as potential for zp[1]:6 [ memset_dma256::dmaMode#0 ]
Statement [13] *((word*)memset_dma256::f018b#0+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memset_dma256::num#0 [ memset_dma256::dmaMode#0 ] ( memset_dma256:3 [ memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [14] *((byte*)memset_dma256::f018b#0+OFFSET_STRUCT_DMA_LIST_F018B_DEST_BANK) = memset_dma256::dest_bank#0 [ memset_dma256::dmaMode#0 ] ( memset_dma256:3 [ memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [15] *((byte**)memset_dma256::f018b#0+OFFSET_STRUCT_DMA_LIST_F018B_DEST) = (byte*)memset_dma256::dest#0 [ memset_dma256::dmaMode#0 ] ( memset_dma256:3 [ memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
@ -498,10 +532,10 @@ Statement [18] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB) = 0 [ memset_dma25
Statement [19] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = 0 [ memset_dma256::dmaMode#0 ] ( memset_dma256:3 [ memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [20] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) = >memset_dma_command256 [ memset_dma256::dmaMode#0 ] ( memset_dma256:3 [ memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [21] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ETRIG) = <memset_dma_command256 [ memset_dma256::dmaMode#0 ] ( memset_dma256:3 [ memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [5] *memoryRemap::aVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [6] *memoryRemap::xVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [7] *memoryRemap::yVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [8] *memoryRemap::zVal = 0 [ ] ( memoryRemap:1 [ ] { } ) always clobbers reg byte a
Statement [5] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:1 [ memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [6] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:1 [ memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [7] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:1 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [8] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:1 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [12] *(memset_dma_command256+1) = memset_dma256::dest_mb#0 [ memset_dma256::dmaMode#0 ] ( memset_dma256:3 [ memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [13] *((word*)memset_dma256::f018b#0+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memset_dma256::num#0 [ memset_dma256::dmaMode#0 ] ( memset_dma256:3 [ memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
@ -513,34 +547,46 @@ Statement [18] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB) = 0 [ memset_dma25
Statement [19] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = 0 [ memset_dma256::dmaMode#0 ] ( memset_dma256:3 [ memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [20] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) = >memset_dma_command256 [ memset_dma256::dmaMode#0 ] ( memset_dma256:3 [ memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [21] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ETRIG) = <memset_dma_command256 [ memset_dma256::dmaMode#0 ] ( memset_dma256:3 [ memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Potential registers zp[1]:2 [ memset_dma256::dmaMode#0 ] : zp[1]:2 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:2 [ memoryRemap::aVal ] : zp[1]:2 ,
Potential registers zp[1]:3 [ memoryRemap::xVal ] : zp[1]:3 ,
Potential registers zp[1]:4 [ memoryRemap::yVal ] : zp[1]:4 ,
Potential registers zp[1]:5 [ memoryRemap::zVal ] : zp[1]:5 ,
Potential registers zp[1]:6 [ memset_dma256::dmaMode#0 ] : zp[1]:6 , reg byte x , reg byte y , reg byte z ,
REGISTER UPLIFT SCOPES
Uplift Scope [memset_dma256] 2: zp[1]:2 [ memset_dma256::dmaMode#0 ]
Uplift Scope [memoryRemap] 11: zp[1]:5 [ memoryRemap::zVal ] 5.5: zp[1]:4 [ memoryRemap::yVal ] 3.67: zp[1]:3 [ memoryRemap::xVal ] 2.75: zp[1]:2 [ memoryRemap::aVal ]
Uplift Scope [memset_dma256] 2: zp[1]:6 [ memset_dma256::dmaMode#0 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [MOS6569_VICII]
Uplift Scope [MOS6581_SID]
Uplift Scope [MOS4569_VICIII]
Uplift Scope [MEGA65_VICIV]
Uplift Scope [memoryRemap]
Uplift Scope [F018_DMAGIC]
Uplift Scope [DMA_LIST_F018A]
Uplift Scope [DMA_LIST_F018B]
Uplift Scope [main]
Uplift Scope []
Uplifting [memset_dma256] best 171 combination reg byte x [ memset_dma256::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 171 combination
Uplifting [MOS6569_VICII] best 171 combination
Uplifting [MOS6581_SID] best 171 combination
Uplifting [MOS4569_VICIII] best 171 combination
Uplifting [MEGA65_VICIV] best 171 combination
Uplifting [memoryRemap] best 171 combination
Uplifting [F018_DMAGIC] best 171 combination
Uplifting [DMA_LIST_F018A] best 171 combination
Uplifting [DMA_LIST_F018B] best 171 combination
Uplifting [main] best 171 combination
Uplifting [] best 171 combination
Uplifting [memoryRemap] best 173 combination zp[1]:5 [ memoryRemap::zVal ] zp[1]:4 [ memoryRemap::yVal ] zp[1]:3 [ memoryRemap::xVal ] zp[1]:2 [ memoryRemap::aVal ]
Uplifting [memset_dma256] best 167 combination reg byte x [ memset_dma256::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 167 combination
Uplifting [MOS6569_VICII] best 167 combination
Uplifting [MOS6581_SID] best 167 combination
Uplifting [MOS4569_VICIII] best 167 combination
Uplifting [MEGA65_VICIV] best 167 combination
Uplifting [F018_DMAGIC] best 167 combination
Uplifting [DMA_LIST_F018A] best 167 combination
Uplifting [DMA_LIST_F018B] best 167 combination
Uplifting [main] best 167 combination
Uplifting [] best 167 combination
Attempting to uplift remaining variables inzp[1]:5 [ memoryRemap::zVal ]
Uplifting [memoryRemap] best 167 combination zp[1]:5 [ memoryRemap::zVal ]
Attempting to uplift remaining variables inzp[1]:4 [ memoryRemap::yVal ]
Uplifting [memoryRemap] best 167 combination zp[1]:4 [ memoryRemap::yVal ]
Attempting to uplift remaining variables inzp[1]:3 [ memoryRemap::xVal ]
Uplifting [memoryRemap] best 167 combination zp[1]:3 [ memoryRemap::xVal ]
Attempting to uplift remaining variables inzp[1]:2 [ memoryRemap::aVal ]
Uplifting [memoryRemap] best 167 combination zp[1]:2 [ memoryRemap::aVal ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -631,22 +677,26 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// [5] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// [5] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// [6] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta.z aVal
// [6] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
lda #0
sta xVal
// [7] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta.z xVal
// [7] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
lda #0
sta yVal
// [8] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta.z yVal
// [8] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
lda #0
sta zVal
sta.z zVal
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal
ldx xVal
@ -770,13 +820,13 @@ const byte OFFSET_STRUCT_F018_DMAGIC_EN018B = 3
const byte OFFSET_STRUCT_F018_DMAGIC_ETRIG = 5
void main()
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:2 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:3 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:4 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:5 11.0
void memset_dma256(byte memset_dma256::dest_mb , byte memset_dma256::dest_bank , void* memset_dma256::dest , byte memset_dma256::fill , word memset_dma256::num)
void* memset_dma256::dest
const void* memset_dma256::dest#0 dest = (void*)DEFAULT_SCREEN
@ -794,11 +844,15 @@ word memset_dma256::num
const word memset_dma256::num#0 num = (word)$50*$a
const byte* memset_dma_command256[] = { DMA_OPTION_DEST_MB, 0, DMA_OPTION_FORMAT_F018B, DMA_OPTION_END, DMA_COMMAND_FILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
zp[1]:2 [ memoryRemap::aVal ]
zp[1]:3 [ memoryRemap::xVal ]
zp[1]:4 [ memoryRemap::yVal ]
zp[1]:5 [ memoryRemap::zVal ]
reg byte x [ memset_dma256::dmaMode#0 ]
FINAL ASSEMBLER
Score: 151
Score: 147
// File Comments
// MEGA65 DMA test using memset
@ -886,23 +940,27 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
// [5] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = 2
.label xVal = 3
.label yVal = 4
.label zVal = 5
// aVal = <lowerPageOffset
// [5] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [6] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta xVal
// *yVal = <upperPageOffset
// [7] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [8] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [6] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// [7] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [8] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal

View File

@ -15,13 +15,13 @@ const byte OFFSET_STRUCT_F018_DMAGIC_EN018B = 3
const byte OFFSET_STRUCT_F018_DMAGIC_ETRIG = 5
void main()
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:2 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:3 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:4 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:5 11.0
void memset_dma256(byte memset_dma256::dest_mb , byte memset_dma256::dest_bank , void* memset_dma256::dest , byte memset_dma256::fill , word memset_dma256::num)
void* memset_dma256::dest
const void* memset_dma256::dest#0 dest = (void*)DEFAULT_SCREEN
@ -39,4 +39,8 @@ word memset_dma256::num
const word memset_dma256::num#0 num = (word)$50*$a
const byte* memset_dma_command256[] = { DMA_OPTION_DEST_MB, 0, DMA_OPTION_FORMAT_F018B, DMA_OPTION_END, DMA_COMMAND_FILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
zp[1]:2 [ memoryRemap::aVal ]
zp[1]:3 [ memoryRemap::xVal ]
zp[1]:4 [ memoryRemap::yVal ]
zp[1]:5 [ memoryRemap::zVal ]
reg byte x [ memset_dma256::dmaMode#0 ]

View File

@ -313,19 +313,23 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
.label aVal = $e
.label xVal = $f
.label yVal = $10
.label zVal = $11
// aVal = <lowerPageOffset
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
sta xVal
// *yVal = <upperPageOffset
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
lda aVal
ldx xVal

View File

@ -93,10 +93,10 @@ main::@4: scope:[main] from main::@3
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main::@11
[54] *memoryRemap::aVal = 0
[55] *memoryRemap::xVal = 0
[56] *memoryRemap::yVal = 0
[57] *memoryRemap::zVal = 0
[54] memoryRemap::aVal = 0
[55] memoryRemap::xVal = 0
[56] memoryRemap::yVal = 0
[57] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap

View File

@ -33,6 +33,16 @@ Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memcpy_dma_command4
Setting struct to load/store in variable affected by address-of *DMA.ADDRMSB = >&memset_dma_command
Setting struct to load/store in variable affected by address-of *DMA.ADDRLSBTRIG = <&memset_dma_command
Setting inferred volatile on symbol affected by address-of: memoryRemap::aVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::xVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::yVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::zVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::lMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::uMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::aVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::xVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::yVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::zVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx
Inlined call call SEI
Eliminating unused variable with no statement memcpy_dma_command
@ -46,19 +56,19 @@ memoryRemap: scope:[memoryRemap] from main::@13
memoryRemap::remapBlocks#1 = phi( main::@13/memoryRemap::remapBlocks#0 )
memoryRemap::lowerPageOffset#1 = phi( main::@13/memoryRemap::lowerPageOffset#0 )
memoryRemap::$0 = < memoryRemap::lowerPageOffset#1
*memoryRemap::aVal = memoryRemap::$0
memoryRemap::aVal = memoryRemap::$0
memoryRemap::$1 = memoryRemap::remapBlocks#1 << 4
memoryRemap::$2 = > memoryRemap::lowerPageOffset#1
memoryRemap::$3 = memoryRemap::$2 & $f
memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3
*memoryRemap::xVal = memoryRemap::$4
memoryRemap::xVal = memoryRemap::$4
memoryRemap::$5 = < memoryRemap::upperPageOffset#1
*memoryRemap::yVal = memoryRemap::$5
memoryRemap::yVal = memoryRemap::$5
memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
memoryRemap::$7 = > memoryRemap::upperPageOffset#1
memoryRemap::$8 = memoryRemap::$7 & $f
memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
*memoryRemap::zVal = memoryRemap::$9
memoryRemap::zVal = memoryRemap::$9
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -402,7 +412,7 @@ number~ memoryRemap::$6
byte~ memoryRemap::$7
number~ memoryRemap::$8
number~ memoryRemap::$9
const byte* memoryRemap::aVal = (byte*)$fc
volatile byte memoryRemap::aVal loadstore
word memoryRemap::lowerPageOffset
word memoryRemap::lowerPageOffset#0
word memoryRemap::lowerPageOffset#1
@ -412,9 +422,9 @@ byte memoryRemap::remapBlocks#1
word memoryRemap::upperPageOffset
word memoryRemap::upperPageOffset#0
word memoryRemap::upperPageOffset#1
const byte* memoryRemap::xVal = (byte*)$fd
const byte* memoryRemap::yVal = (byte*)$fe
const byte* memoryRemap::zVal = (byte*)$ff
volatile byte memoryRemap::xVal loadstore
volatile byte memoryRemap::yVal loadstore
volatile byte memoryRemap::zVal loadstore
void memset_dma(void* memset_dma::dest , byte memset_dma::fill , word memset_dma::num)
void* memset_dma::dest
void* memset_dma::dest#0
@ -556,10 +566,6 @@ Inlining cast memset_dma256::num#0 = (unumber)$2d*$19*2
Inlining cast memset_dma::fill#1 = (unumber)$55
Inlining cast memset_dma::num#1 = (unumber)$2d*$20*8
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 252
Simplifying constant pointer cast (byte*) 253
Simplifying constant pointer cast (byte*) 254
Simplifying constant pointer cast (byte*) 255
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (struct MEGA65_VICIV*) 53248
Simplifying constant pointer cast (struct F018_DMAGIC*) 55040
@ -664,6 +670,10 @@ Inferred type updated to byte in memoryRemap::$6 = memoryRemap::remapBlocks#1 &
Inferred type updated to byte in memoryRemap::$8 = memoryRemap::$7 & $f
Inferred type updated to byte in memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
Inferred type updated to byte in main::$9 = $2d * SIZEOF_WORD
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Alias main::r#2 = main::r#3
Alias main::erow#5 = main::erow#6
Alias main::i#2 = main::i#3
@ -678,6 +688,10 @@ Alias main::y#2 = main::y#3
Alias main::logo_dest#2 = main::logo_dest#4 main::logo_dest#3
Alias main::col#3 = main::col#5 main::col#4
Successful SSA optimization Pass2AliasElimination
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Identical Phi Values memoryRemap::lowerPageOffset#1 memoryRemap::lowerPageOffset#0
Identical Phi Values memoryRemap::remapBlocks#1 memoryRemap::remapBlocks#0
Identical Phi Values memoryRemap::upperPageOffset#1 memoryRemap::upperPageOffset#0
@ -766,6 +780,10 @@ Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Constant right-side identified [0] memoryRemap::$0 = < memoryRemap::lowerPageOffset#0
Constant right-side identified [2] memoryRemap::$1 = memoryRemap::remapBlocks#0 << 4
Constant right-side identified [3] memoryRemap::$2 = > memoryRemap::lowerPageOffset#0
@ -796,14 +814,16 @@ Eliminating unused constant memoryRemap::upperPageOffset#0
Eliminating unused constant memoryRemap::$1
Eliminating unused constant memoryRemap::$6
Successful SSA optimization PassNEliminateUnusedVars
Alias memoryRemap::$4 = memoryRemap::$3
Alias memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [1] memoryRemap::$4 = memoryRemap::$2 & $f
Constant right-side identified [4] memoryRemap::$9 = memoryRemap::$7 & $f
Alias candidate removed (volatile)memoryRemap::$4 = memoryRemap::$3 memoryRemap::xVal
Alias candidate removed (volatile)memoryRemap::$9 = memoryRemap::$8 memoryRemap::zVal
Constant right-side identified [1] memoryRemap::$3 = memoryRemap::$2 & $f
Constant right-side identified [5] memoryRemap::$8 = memoryRemap::$7 & $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant memoryRemap::$4 = memoryRemap::$2&$f
Constant memoryRemap::$9 = memoryRemap::$7&$f
Constant memoryRemap::$3 = memoryRemap::$2&$f
Constant memoryRemap::$8 = memoryRemap::$7&$f
Successful SSA optimization Pass2ConstantIdentification
Constant memoryRemap::$4 = memoryRemap::$3
Constant memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero memoryRemap::$2&$f in
Simplifying constant evaluating to zero memoryRemap::$7&$f in
@ -848,9 +868,11 @@ Constant inlined memset_dma256::$0 = memset_dma_command256+4
Constant inlined main::erow#0 = SCREEN
Constant inlined main::y#0 = 0
Constant inlined memoryRemap::$0 = 0
Constant inlined memoryRemap::$3 = 0
Constant inlined main::logo_src#0 = LOGO
Constant inlined memoryRemap::$4 = 0
Constant inlined memoryRemap::$5 = 0
Constant inlined memoryRemap::$8 = 0
Constant inlined main::$9 = $2d*SIZEOF_WORD
Constant inlined memoryRemap::$9 = 0
Successful SSA optimization Pass2ConstantInlining
@ -1021,10 +1043,10 @@ main::@4: scope:[main] from main::@3
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main::@11
[54] *memoryRemap::aVal = 0
[55] *memoryRemap::xVal = 0
[56] *memoryRemap::yVal = 0
[57] *memoryRemap::zVal = 0
[54] memoryRemap::aVal = 0
[55] memoryRemap::xVal = 0
[56] memoryRemap::yVal = 0
[57] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -1100,9 +1122,13 @@ byte main::y
byte main::y#1 202.0
byte main::y#2 168.33333333333331
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
volatile byte memoryRemap::aVal loadstore 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
volatile byte memoryRemap::xVal loadstore 3.6666666666666665
volatile byte memoryRemap::yVal loadstore 5.5
volatile byte memoryRemap::zVal loadstore 11.0
void memset_dma(void* memset_dma::dest , byte memset_dma::fill , word memset_dma::num)
void* memset_dma::dest
void* memset_dma::dest#2
@ -1136,6 +1162,10 @@ Initial phi equivalence classes
[ memset_dma::fill#2 ]
[ memset_dma::dest#2 ]
Added variable main::$10 to live range equivalence class [ main::$10 ]
Added variable memoryRemap::aVal to live range equivalence class [ memoryRemap::aVal ]
Added variable memoryRemap::xVal to live range equivalence class [ memoryRemap::xVal ]
Added variable memoryRemap::yVal to live range equivalence class [ memoryRemap::yVal ]
Added variable memoryRemap::zVal to live range equivalence class [ memoryRemap::zVal ]
Added variable memset_dma::dmaMode#0 to live range equivalence class [ memset_dma::dmaMode#0 ]
Added variable memset_dma256::dmaMode#0 to live range equivalence class [ memset_dma256::dmaMode#0 ]
Added variable memset_dma_command to live range equivalence class [ memset_dma_command ]
@ -1152,6 +1182,10 @@ Complete equivalence classes
[ memset_dma::fill#2 ]
[ memset_dma::dest#2 ]
[ main::$10 ]
[ memoryRemap::aVal ]
[ memoryRemap::xVal ]
[ memoryRemap::yVal ]
[ memoryRemap::zVal ]
[ memset_dma::dmaMode#0 ]
[ memset_dma256::dmaMode#0 ]
[ memset_dma_command ]
@ -1167,8 +1201,12 @@ Allocated zp[2]:14 [ memset_dma::num#2 ]
Allocated zp[1]:16 [ memset_dma::fill#2 ]
Allocated zp[2]:17 [ memset_dma::dest#2 ]
Allocated zp[1]:19 [ main::$10 ]
Allocated zp[1]:20 [ memset_dma::dmaMode#0 ]
Allocated zp[1]:21 [ memset_dma256::dmaMode#0 ]
Allocated zp[1]:20 [ memoryRemap::aVal ]
Allocated zp[1]:21 [ memoryRemap::xVal ]
Allocated zp[1]:22 [ memoryRemap::yVal ]
Allocated zp[1]:23 [ memoryRemap::zVal ]
Allocated zp[1]:24 [ memset_dma::dmaMode#0 ]
Allocated zp[1]:25 [ memset_dma256::dmaMode#0 ]
Allocated mem[12] [ memset_dma_command ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((byte*)VICIV+OFFSET_STRUCT_MEGA65_VICIV_SIDBDRWD_LO) = 0 [ memset_dma_command ] ( [ memset_dma_command ] { } ) always clobbers reg byte a
@ -1210,14 +1248,14 @@ Statement [51] main::erow#5[main::$10] = main::c#2 [ main::r#2 main::erow#5 main
Removing always clobbered register reg byte y as potential for zp[1]:2 [ main::r#2 main::r#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:11 [ main::i#2 main::i#1 ]
Statement [52] main::c#1 = main::c#2 + $20 [ main::r#2 main::erow#5 main::i#2 main::c#1 ] ( [ main::r#2 main::erow#5 main::i#2 main::c#1 ] { } ) always clobbers reg byte a
Statement [54] *memoryRemap::aVal = 0 [ ] ( memoryRemap:3 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [55] *memoryRemap::xVal = 0 [ ] ( memoryRemap:3 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [56] *memoryRemap::yVal = 0 [ ] ( memoryRemap:3 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [57] *memoryRemap::zVal = 0 [ ] ( memoryRemap:3 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [54] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:3 [ memset_dma_command memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [55] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:3 [ memset_dma_command memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [56] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:3 [ memset_dma_command memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [57] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:3 [ memset_dma_command memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [62] *((word*)&memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memset_dma::num#2 [ memset_dma::fill#2 memset_dma::dest#2 memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:28 [ memset_dma::fill#2 memset_dma::dest#2 memset_dma::dmaMode#0 memset_dma_command ] { } memset_dma:32 [ memset_dma::fill#2 memset_dma::dest#2 memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:16 [ memset_dma::fill#2 ]
Removing always clobbered register reg byte a as potential for zp[1]:20 [ memset_dma::dmaMode#0 ]
Removing always clobbered register reg byte a as potential for zp[1]:24 [ memset_dma::dmaMode#0 ]
Statement [63] *((byte**)&memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_SRC) = (byte*)memset_dma::fill#2 [ memset_dma::dest#2 memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:28 [ memset_dma::dest#2 memset_dma::dmaMode#0 memset_dma_command ] { } memset_dma:32 [ memset_dma::dest#2 memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Statement [64] *((byte**)&memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_DEST) = (byte*)memset_dma::dest#2 [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:28 [ memset_dma::dmaMode#0 memset_dma_command ] { } memset_dma:32 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Statement [65] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B) = 1 [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:28 [ memset_dma::dmaMode#0 memset_dma_command ] { } memset_dma:32 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
@ -1226,7 +1264,7 @@ Statement [67] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) = 0 [ memset_dma
Statement [68] *((byte*)DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) = >&memset_dma_command [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:28 [ memset_dma::dmaMode#0 memset_dma_command ] { } memset_dma:32 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Statement [69] *((byte*)DMA) = <&memset_dma_command [ memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:28 [ memset_dma::dmaMode#0 memset_dma_command ] { } memset_dma:32 [ memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Statement [73] *(memset_dma_command256+1) = memset_dma256::dest_mb#0 [ memset_dma256::dmaMode#0 ] ( memset_dma256:30 [ memset_dma_command memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:21 [ memset_dma256::dmaMode#0 ]
Removing always clobbered register reg byte a as potential for zp[1]:25 [ memset_dma256::dmaMode#0 ]
Statement [74] *((word*)memset_dma256::f018b#0+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memset_dma256::num#0 [ memset_dma256::dmaMode#0 ] ( memset_dma256:30 [ memset_dma_command memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [75] *((byte*)memset_dma256::f018b#0+OFFSET_STRUCT_DMA_LIST_F018B_DEST_BANK) = memset_dma256::dest_bank#0 [ memset_dma256::dmaMode#0 ] ( memset_dma256:30 [ memset_dma_command memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
Statement [76] *((byte**)memset_dma256::f018b#0+OFFSET_STRUCT_DMA_LIST_F018B_DEST) = (byte*)memset_dma256::dest#0 [ memset_dma256::dmaMode#0 ] ( memset_dma256:30 [ memset_dma_command memset_dma256::dmaMode#0 ] { } ) always clobbers reg byte a
@ -1269,10 +1307,10 @@ Statement [48] main::erow#1 = main::erow#5 + $2d*SIZEOF_WORD [ main::r#2 main::e
Statement [50] main::$10 = main::i#2 << 1 [ main::r#2 main::erow#5 main::i#2 main::c#2 main::$10 ] ( [ main::r#2 main::erow#5 main::i#2 main::c#2 main::$10 ] { } ) always clobbers reg byte a
Statement [51] main::erow#5[main::$10] = main::c#2 [ main::r#2 main::erow#5 main::i#2 main::c#2 ] ( [ main::r#2 main::erow#5 main::i#2 main::c#2 ] { } ) always clobbers reg byte a reg byte y
Statement [52] main::c#1 = main::c#2 + $20 [ main::r#2 main::erow#5 main::i#2 main::c#1 ] ( [ main::r#2 main::erow#5 main::i#2 main::c#1 ] { } ) always clobbers reg byte a
Statement [54] *memoryRemap::aVal = 0 [ ] ( memoryRemap:3 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [55] *memoryRemap::xVal = 0 [ ] ( memoryRemap:3 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [56] *memoryRemap::yVal = 0 [ ] ( memoryRemap:3 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [57] *memoryRemap::zVal = 0 [ ] ( memoryRemap:3 [ memset_dma_command ] { } ) always clobbers reg byte a
Statement [54] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:3 [ memset_dma_command memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [55] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:3 [ memset_dma_command memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [56] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:3 [ memset_dma_command memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [57] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:3 [ memset_dma_command memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [62] *((word*)&memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_COUNT) = memset_dma::num#2 [ memset_dma::fill#2 memset_dma::dest#2 memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:28 [ memset_dma::fill#2 memset_dma::dest#2 memset_dma::dmaMode#0 memset_dma_command ] { } memset_dma:32 [ memset_dma::fill#2 memset_dma::dest#2 memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
Statement [63] *((byte**)&memset_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_SRC) = (byte*)memset_dma::fill#2 [ memset_dma::dest#2 memset_dma::dmaMode#0 memset_dma_command ] ( memset_dma:28 [ memset_dma::dest#2 memset_dma::dmaMode#0 memset_dma_command ] { } memset_dma:32 [ memset_dma::dest#2 memset_dma::dmaMode#0 memset_dma_command ] { } ) always clobbers reg byte a
@ -1304,47 +1342,63 @@ Potential registers zp[2]:14 [ memset_dma::num#2 ] : zp[2]:14 ,
Potential registers zp[1]:16 [ memset_dma::fill#2 ] : zp[1]:16 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[2]:17 [ memset_dma::dest#2 ] : zp[2]:17 ,
Potential registers zp[1]:19 [ main::$10 ] : zp[1]:19 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:20 [ memset_dma::dmaMode#0 ] : zp[1]:20 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:21 [ memset_dma256::dmaMode#0 ] : zp[1]:21 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:20 [ memoryRemap::aVal ] : zp[1]:20 ,
Potential registers zp[1]:21 [ memoryRemap::xVal ] : zp[1]:21 ,
Potential registers zp[1]:22 [ memoryRemap::yVal ] : zp[1]:22 ,
Potential registers zp[1]:23 [ memoryRemap::zVal ] : zp[1]:23 ,
Potential registers zp[1]:24 [ memset_dma::dmaMode#0 ] : zp[1]:24 , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:25 [ memset_dma256::dmaMode#0 ] : zp[1]:25 , reg byte x , reg byte y , reg byte z ,
Potential registers mem[12] [ memset_dma_command ] : mem[12] ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 370.33: zp[1]:10 [ main::y#2 main::y#1 ] 282.8: zp[1]:11 [ main::i#2 main::i#1 ] 202: zp[1]:19 [ main::$10 ] 201.5: zp[2]:12 [ main::c#2 main::c#0 main::c#1 ] 28.57: zp[2]:6 [ main::logo_src#5 main::logo_src#1 ] 27.83: zp[2]:8 [ main::logo_dest#5 main::logo_dest#1 ] 26.12: zp[1]:5 [ main::col#2 main::col#1 ] 25.3: zp[1]:2 [ main::r#2 main::r#1 ] 24.67: zp[2]:3 [ main::erow#5 main::erow#1 ]
Uplift Scope [memset_dma] 5.5: zp[2]:14 [ memset_dma::num#2 ] 2.44: zp[1]:20 [ memset_dma::dmaMode#0 ] 0: zp[1]:16 [ memset_dma::fill#2 ] 0: zp[2]:17 [ memset_dma::dest#2 ]
Uplift Scope [memset_dma256] 2: zp[1]:21 [ memset_dma256::dmaMode#0 ]
Uplift Scope [memoryRemap] 11: zp[1]:23 [ memoryRemap::zVal ] 5.5: zp[1]:22 [ memoryRemap::yVal ] 3.67: zp[1]:21 [ memoryRemap::xVal ] 2.75: zp[1]:20 [ memoryRemap::aVal ]
Uplift Scope [memset_dma] 5.5: zp[2]:14 [ memset_dma::num#2 ] 2.44: zp[1]:24 [ memset_dma::dmaMode#0 ] 0: zp[1]:16 [ memset_dma::fill#2 ] 0: zp[2]:17 [ memset_dma::dest#2 ]
Uplift Scope [memset_dma256] 2: zp[1]:25 [ memset_dma256::dmaMode#0 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [MOS6569_VICII]
Uplift Scope [MOS6581_SID]
Uplift Scope [MOS4569_VICIII]
Uplift Scope [MEGA65_VICIV]
Uplift Scope [memoryRemap]
Uplift Scope [F018_DMAGIC]
Uplift Scope [DMA_LIST_F018A]
Uplift Scope [DMA_LIST_F018B]
Uplift Scope [] 0: mem[12] [ memset_dma_command ]
Uplifting [main] best 10785 combination reg byte y [ main::y#2 main::y#1 ] reg byte z [ main::i#2 main::i#1 ] reg byte a [ main::$10 ] zp[2]:12 [ main::c#2 main::c#0 main::c#1 ] zp[2]:6 [ main::logo_src#5 main::logo_src#1 ] zp[2]:8 [ main::logo_dest#5 main::logo_dest#1 ] reg byte x [ main::col#2 main::col#1 ] zp[1]:2 [ main::r#2 main::r#1 ] zp[2]:3 [ main::erow#5 main::erow#1 ]
Uplifting [main] best 10781 combination reg byte y [ main::y#2 main::y#1 ] reg byte z [ main::i#2 main::i#1 ] reg byte a [ main::$10 ] zp[2]:12 [ main::c#2 main::c#0 main::c#1 ] zp[2]:6 [ main::logo_src#5 main::logo_src#1 ] zp[2]:8 [ main::logo_dest#5 main::logo_dest#1 ] reg byte x [ main::col#2 main::col#1 ] zp[1]:2 [ main::r#2 main::r#1 ] zp[2]:3 [ main::erow#5 main::erow#1 ]
Limited combination testing to 100 combinations of 720 possible.
Uplifting [memset_dma] best 10771 combination zp[2]:14 [ memset_dma::num#2 ] reg byte x [ memset_dma::dmaMode#0 ] reg byte z [ memset_dma::fill#2 ] zp[2]:17 [ memset_dma::dest#2 ]
Uplifting [memset_dma256] best 10765 combination reg byte x [ memset_dma256::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 10765 combination
Uplifting [MOS6569_VICII] best 10765 combination
Uplifting [MOS6581_SID] best 10765 combination
Uplifting [MOS4569_VICIII] best 10765 combination
Uplifting [MEGA65_VICIV] best 10765 combination
Uplifting [memoryRemap] best 10765 combination
Uplifting [F018_DMAGIC] best 10765 combination
Uplifting [DMA_LIST_F018A] best 10765 combination
Uplifting [DMA_LIST_F018B] best 10765 combination
Uplifting [] best 10765 combination mem[12] [ memset_dma_command ]
Uplifting [memoryRemap] best 10781 combination zp[1]:23 [ memoryRemap::zVal ] zp[1]:22 [ memoryRemap::yVal ] zp[1]:21 [ memoryRemap::xVal ] zp[1]:20 [ memoryRemap::aVal ]
Uplifting [memset_dma] best 10767 combination zp[2]:14 [ memset_dma::num#2 ] reg byte x [ memset_dma::dmaMode#0 ] reg byte z [ memset_dma::fill#2 ] zp[2]:17 [ memset_dma::dest#2 ]
Uplifting [memset_dma256] best 10761 combination reg byte x [ memset_dma256::dmaMode#0 ]
Uplifting [MOS6526_CIA] best 10761 combination
Uplifting [MOS6569_VICII] best 10761 combination
Uplifting [MOS6581_SID] best 10761 combination
Uplifting [MOS4569_VICIII] best 10761 combination
Uplifting [MEGA65_VICIV] best 10761 combination
Uplifting [F018_DMAGIC] best 10761 combination
Uplifting [DMA_LIST_F018A] best 10761 combination
Uplifting [DMA_LIST_F018B] best 10761 combination
Uplifting [] best 10761 combination mem[12] [ memset_dma_command ]
Attempting to uplift remaining variables inzp[1]:2 [ main::r#2 main::r#1 ]
Uplifting [main] best 10665 combination reg byte x [ main::r#2 main::r#1 ]
Uplifting [main] best 10661 combination reg byte x [ main::r#2 main::r#1 ]
Attempting to uplift remaining variables inzp[1]:23 [ memoryRemap::zVal ]
Uplifting [memoryRemap] best 10661 combination zp[1]:23 [ memoryRemap::zVal ]
Attempting to uplift remaining variables inzp[1]:22 [ memoryRemap::yVal ]
Uplifting [memoryRemap] best 10661 combination zp[1]:22 [ memoryRemap::yVal ]
Attempting to uplift remaining variables inzp[1]:21 [ memoryRemap::xVal ]
Uplifting [memoryRemap] best 10661 combination zp[1]:21 [ memoryRemap::xVal ]
Attempting to uplift remaining variables inzp[1]:20 [ memoryRemap::aVal ]
Uplifting [memoryRemap] best 10661 combination zp[1]:20 [ memoryRemap::aVal ]
Allocated (was zp[2]:3) zp[2]:2 [ main::erow#5 main::erow#1 ]
Allocated (was zp[2]:6) zp[2]:4 [ main::logo_src#5 main::logo_src#1 ]
Allocated (was zp[2]:8) zp[2]:6 [ main::logo_dest#5 main::logo_dest#1 ]
Allocated (was zp[2]:12) zp[2]:8 [ main::c#2 main::c#0 main::c#1 ]
Allocated (was zp[2]:14) zp[2]:10 [ memset_dma::num#2 ]
Allocated (was zp[2]:17) zp[2]:12 [ memset_dma::dest#2 ]
Allocated (was zp[1]:20) zp[1]:14 [ memoryRemap::aVal ]
Allocated (was zp[1]:21) zp[1]:15 [ memoryRemap::xVal ]
Allocated (was zp[1]:22) zp[1]:16 [ memoryRemap::yVal ]
Allocated (was zp[1]:23) zp[1]:17 [ memoryRemap::zVal ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -1755,22 +1809,26 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// [54] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = $e
.label xVal = $f
.label yVal = $10
.label zVal = $11
// [54] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// [55] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta.z aVal
// [55] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
lda #0
sta xVal
// [56] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta.z xVal
// [56] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
lda #0
sta yVal
// [57] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta.z yVal
// [57] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
lda #0
sta zVal
sta.z zVal
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal
ldx xVal
@ -2059,13 +2117,13 @@ byte main::y
byte main::y#1 reg byte y 202.0
byte main::y#2 reg byte y 168.33333333333331
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:14 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:15 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:16 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:17 11.0
void memset_dma(void* memset_dma::dest , byte memset_dma::fill , word memset_dma::num)
void* memset_dma::dest
void* memset_dma::dest#2 dest zp[2]:12
@ -2104,13 +2162,17 @@ zp[2]:10 [ memset_dma::num#2 ]
reg byte z [ memset_dma::fill#2 ]
zp[2]:12 [ memset_dma::dest#2 ]
reg byte a [ main::$10 ]
zp[1]:14 [ memoryRemap::aVal ]
zp[1]:15 [ memoryRemap::xVal ]
zp[1]:16 [ memoryRemap::yVal ]
zp[1]:17 [ memoryRemap::zVal ]
reg byte x [ memset_dma::dmaMode#0 ]
reg byte x [ memset_dma256::dmaMode#0 ]
mem[12] [ memset_dma_command ]
FINAL ASSEMBLER
Score: 9302
Score: 9298
// File Comments
// DYPP (Different Y Pixel Position) LOGO created using DMA
@ -2528,23 +2590,27 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
// [54] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = $e
.label xVal = $f
.label yVal = $10
.label zVal = $11
// aVal = <lowerPageOffset
// [54] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [55] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta xVal
// *yVal = <upperPageOffset
// [56] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [57] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [55] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// [56] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [57] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal

View File

@ -74,13 +74,13 @@ byte main::y
byte main::y#1 reg byte y 202.0
byte main::y#2 reg byte y 168.33333333333331
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:14 2.75
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:15 3.6666666666666665
volatile byte memoryRemap::yVal loadstore zp[1]:16 5.5
volatile byte memoryRemap::zVal loadstore zp[1]:17 11.0
void memset_dma(void* memset_dma::dest , byte memset_dma::fill , word memset_dma::num)
void* memset_dma::dest
void* memset_dma::dest#2 dest zp[2]:12
@ -119,6 +119,10 @@ zp[2]:10 [ memset_dma::num#2 ]
reg byte z [ memset_dma::fill#2 ]
zp[2]:12 [ memset_dma::dest#2 ]
reg byte a [ main::$10 ]
zp[1]:14 [ memoryRemap::aVal ]
zp[1]:15 [ memoryRemap::xVal ]
zp[1]:16 [ memoryRemap::yVal ]
zp[1]:17 [ memoryRemap::zVal ]
reg byte x [ memset_dma::dmaMode#0 ]
reg byte x [ memset_dma256::dmaMode#0 ]
mem[12] [ memset_dma_command ]

View File

@ -123,19 +123,23 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
.label aVal = $c
.label xVal = $d
.label yVal = $e
.label zVal = $f
// aVal = <lowerPageOffset
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
sta xVal
// *yVal = <upperPageOffset
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
lda aVal
ldx xVal
@ -150,12 +154,12 @@ memoryRemap: {
// gotoxy(byte register(X) y)
gotoxy: {
.const x = 0
.label __5 = $10
.label __6 = $c
.label __7 = $c
.label line_offset = $c
.label __8 = $e
.label __9 = $c
.label __5 = $14
.label __6 = $10
.label __7 = $10
.label line_offset = $10
.label __8 = $12
.label __9 = $10
// if(y>CONIO_HEIGHT)
cpx #$19+1
bcc __b2
@ -363,13 +367,13 @@ cscroll: {
}
// Copy block of memory (forwards)
// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination.
// memcpy(void* zp($14) destination, void* zp(4) source)
// memcpy(void* zp($18) destination, void* zp(4) source)
memcpy: {
.label src_end = $12
.label dst = $14
.label src_end = $16
.label dst = $18
.label src = 4
.label source = 4
.label destination = $14
.label destination = $18
// src_end = (char*)source+num
clc
lda.z source
@ -401,7 +405,7 @@ memcpy: {
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zp(4) str, byte register(Z) c)
memset: {
.label end = $14
.label end = $18
.label dst = 4
.label str = 4
// end = (char*)str + num

View File

@ -59,10 +59,10 @@ main::@return: scope:[main] from main
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from conio_mega65_init::@2
[26] *memoryRemap::aVal = 0
[27] *memoryRemap::xVal = 0
[28] *memoryRemap::yVal = 0
[29] *memoryRemap::zVal = 0
[26] memoryRemap::aVal = 0
[27] memoryRemap::xVal = 0
[28] memoryRemap::yVal = 0
[29] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap

View File

@ -5,6 +5,16 @@ Fixing struct type SIZE_OF struct F018_DMAGIC to 17
Fixing struct type SIZE_OF struct printf_buffer_number to 12
Fixing struct type SIZE_OF struct F018_DMAGIC to 17
Fixing struct type SIZE_OF struct printf_buffer_number to 12
Setting inferred volatile on symbol affected by address-of: memoryRemap::aVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::xVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::yVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::zVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::lMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::uMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::aVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::xVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::yVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::zVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx
Inlined call call SEI
Inlined call call __init
@ -101,19 +111,19 @@ memoryRemap: scope:[memoryRemap] from conio_mega65_init::@3
memoryRemap::remapBlocks#1 = phi( conio_mega65_init::@3/memoryRemap::remapBlocks#0 )
memoryRemap::lowerPageOffset#1 = phi( conio_mega65_init::@3/memoryRemap::lowerPageOffset#0 )
memoryRemap::$0 = < memoryRemap::lowerPageOffset#1
*memoryRemap::aVal = memoryRemap::$0
memoryRemap::aVal = memoryRemap::$0
memoryRemap::$1 = memoryRemap::remapBlocks#1 << 4
memoryRemap::$2 = > memoryRemap::lowerPageOffset#1
memoryRemap::$3 = memoryRemap::$2 & $f
memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3
*memoryRemap::xVal = memoryRemap::$4
memoryRemap::xVal = memoryRemap::$4
memoryRemap::$5 = < memoryRemap::upperPageOffset#1
*memoryRemap::yVal = memoryRemap::$5
memoryRemap::yVal = memoryRemap::$5
memoryRemap::$6 = memoryRemap::remapBlocks#1 & $f0
memoryRemap::$7 = > memoryRemap::upperPageOffset#1
memoryRemap::$8 = memoryRemap::$7 & $f
memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
*memoryRemap::zVal = memoryRemap::$9
memoryRemap::zVal = memoryRemap::$9
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -491,7 +501,7 @@ number~ memoryRemap::$6
byte~ memoryRemap::$7
number~ memoryRemap::$8
number~ memoryRemap::$9
const byte* memoryRemap::aVal = (byte*)$fc
volatile byte memoryRemap::aVal loadstore
word memoryRemap::lowerPageOffset
word memoryRemap::lowerPageOffset#0
word memoryRemap::lowerPageOffset#1
@ -501,9 +511,9 @@ byte memoryRemap::remapBlocks#1
word memoryRemap::upperPageOffset
word memoryRemap::upperPageOffset#0
word memoryRemap::upperPageOffset#1
const byte* memoryRemap::xVal = (byte*)$fd
const byte* memoryRemap::yVal = (byte*)$fe
const byte* memoryRemap::zVal = (byte*)$ff
volatile byte memoryRemap::xVal loadstore
volatile byte memoryRemap::yVal loadstore
volatile byte memoryRemap::zVal loadstore
void* memset(void* memset::str , byte memset::c , word memset::num)
bool~ memset::$0
bool~ memset::$1
@ -614,10 +624,6 @@ Inlining cast *IO_KEY = (unumber)$53
Inlining cast gotoxy::x#2 = (unumber)0
Inlining cast conio_mega65_init::line#1 = (unumber)$19-1
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 252
Simplifying constant pointer cast (byte*) 253
Simplifying constant pointer cast (byte*) 254
Simplifying constant pointer cast (byte*) 255
Simplifying constant pointer cast (byte*) 53295
Simplifying constant pointer cast (byte*) 53296
Simplifying constant pointer cast (byte*) 55296
@ -709,6 +715,10 @@ Inversing boolean not [87] cputc::$2 = conio_cursor_x != $50 from [86] cputc::$1
Inversing boolean not [98] cscroll::$1 = conio_cursor_y != $19 from [97] cscroll::$0 = conio_cursor_y == $19
Inversing boolean not [153] conio_mega65_init::$4 = conio_mega65_init::line#0 < $19 from [152] conio_mega65_init::$3 = conio_mega65_init::line#0 >= $19
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
Alias memcpy::src_end#0 = memcpy::$0
@ -733,11 +743,19 @@ Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#5 cputs::s#4
Alias conio_mega65_init::line#0 = conio_mega65_init::$2
Successful SSA optimization Pass2AliasElimination
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
Alias gotoxy::x#3 = gotoxy::x#5
Alias gotoxy::y#4 = gotoxy::y#5
Successful SSA optimization Pass2AliasElimination
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
Identical Phi Values memcpy::src_end#1 memcpy::src_end#0
@ -820,6 +838,10 @@ Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias candidate removed (volatile)memoryRemap::aVal = memoryRemap::$0
Alias candidate removed (volatile)memoryRemap::xVal = memoryRemap::$4
Alias candidate removed (volatile)memoryRemap::yVal = memoryRemap::$5
Alias candidate removed (volatile)memoryRemap::zVal = memoryRemap::$9
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
Identical Phi Values gotoxy::y#3 gotoxy::y#2
@ -862,20 +884,20 @@ Successful SSA optimization PassNEliminateUnusedVars
Removing PHI-reference to removed block (gotoxy::@4) in block gotoxy::@2
Removing unused block gotoxy::@4
Successful SSA optimization Pass2EliminateUnusedBlocks
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
Alias memoryRemap::$4 = memoryRemap::$3
Alias memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2AliasElimination
Alias candidate removed (volatile)memoryRemap::$4 = memoryRemap::$3 memoryRemap::xVal
Alias candidate removed (volatile)memoryRemap::$9 = memoryRemap::$8 memoryRemap::zVal
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
Identical Phi Values gotoxy::x#4 gotoxy::x#2
Successful SSA optimization Pass2IdenticalPhiElimination
Constant right-side identified [22] memoryRemap::$4 = memoryRemap::$2 & $f
Constant right-side identified [25] memoryRemap::$9 = memoryRemap::$7 & $f
Constant right-side identified [22] memoryRemap::$3 = memoryRemap::$2 & $f
Constant right-side identified [26] memoryRemap::$8 = memoryRemap::$7 & $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant memoryRemap::$4 = memoryRemap::$2&$f
Constant memoryRemap::$9 = memoryRemap::$7&$f
Constant memoryRemap::$3 = memoryRemap::$2&$f
Constant memoryRemap::$8 = memoryRemap::$7&$f
Successful SSA optimization Pass2ConstantIdentification
Constant memoryRemap::$4 = memoryRemap::$3
Constant memoryRemap::$9 = memoryRemap::$8
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero memoryRemap::$2&$f in
Simplifying constant evaluating to zero memoryRemap::$7&$f in
@ -908,29 +930,31 @@ Inlining constant with var siblings memset::c#1
Inlining constant with var siblings gotoxy::y#0
Inlining constant with var siblings cputs::s#1
Inlining constant with var siblings conio_mega65_init::line#1
Constant inlined memset::str#1 = (void*)COLORRAM+(word)$19*$50-$50
Constant inlined memset::str#0 = (void*)DEFAULT_SCREEN+(word)$19*$50-$50
Constant inlined CONIO_SCREEN_COLORS = COLORRAM
Constant inlined cputs::s#1 = main::s
Constant inlined conio_textcolor = LIGHT_BLUE
Constant inlined memcpy::destination#0 = (void*)DEFAULT_SCREEN
Constant inlined memset::num#1 = $50
Constant inlined memcpy::destination#1 = (void*)COLORRAM
Constant inlined memset::num#0 = $50
Constant inlined memcpy::source#0 = (void*)DEFAULT_SCREEN+$50
Constant inlined conio_mega65_init::line#1 = (byte)$19-1
Constant inlined memcpy::source#1 = (void*)COLORRAM+$50
Constant inlined CONIO_SCREEN_TEXT = DEFAULT_SCREEN
Constant inlined CONIO_TEXTCOLOR_DEFAULT = LIGHT_BLUE
Constant inlined memset::str#1 = (void*)COLORRAM+(word)$19*$50-$50
Constant inlined memset::str#0 = (void*)DEFAULT_SCREEN+(word)$19*$50-$50
Constant inlined CONIO_SCREEN_COLORS = COLORRAM
Constant inlined memcpy::source#0 = (void*)DEFAULT_SCREEN+$50
Constant inlined memcpy::num#1 = (word)$19*$50-$50
Constant inlined memcpy::num#0 = (word)$19*$50-$50
Constant inlined memcpy::source#1 = (void*)COLORRAM+$50
Constant inlined memoryRemap::$0 = 0
Constant inlined gotoxy::y#0 = 0
Constant inlined CONIO_SCREEN_TEXT = DEFAULT_SCREEN
Constant inlined memoryRemap::$3 = 0
Constant inlined memoryRemap::$4 = 0
Constant inlined memoryRemap::$5 = 0
Constant inlined memset::c#0 = ' '
Constant inlined memset::c#1 = LIGHT_BLUE
Constant inlined memoryRemap::$8 = 0
Constant inlined memoryRemap::$9 = 0
Constant inlined CONIO_TEXTCOLOR_DEFAULT = LIGHT_BLUE
Successful SSA optimization Pass2ConstantInlining
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -1114,10 +1138,10 @@ main::@return: scope:[main] from main
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from conio_mega65_init::@2
[26] *memoryRemap::aVal = 0
[27] *memoryRemap::xVal = 0
[28] *memoryRemap::yVal = 0
[29] *memoryRemap::zVal = 0
[26] memoryRemap::aVal = 0
[27] memoryRemap::xVal = 0
[28] memoryRemap::yVal = 0
[29] memoryRemap::zVal = 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -1328,9 +1352,13 @@ byte* memcpy::src#4 1.0000001E7
byte* memcpy::src_end
byte* memcpy::src_end#0 1.2625000025E8
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
volatile byte memoryRemap::aVal loadstore 25.25
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
volatile byte memoryRemap::xVal loadstore 33.666666666666664
volatile byte memoryRemap::yVal loadstore 50.5
volatile byte memoryRemap::zVal loadstore 101.0
void* memset(void* memset::str , byte memset::c , word memset::num)
byte memset::c
byte memset::c#4 1.42857143E8
@ -1360,6 +1388,10 @@ Added variable conio_cursor_x to live range equivalence class [ conio_cursor_x ]
Added variable conio_cursor_y to live range equivalence class [ conio_cursor_y ]
Added variable conio_line_text to live range equivalence class [ conio_line_text ]
Added variable conio_line_color to live range equivalence class [ conio_line_color ]
Added variable memoryRemap::aVal to live range equivalence class [ memoryRemap::aVal ]
Added variable memoryRemap::xVal to live range equivalence class [ memoryRemap::xVal ]
Added variable memoryRemap::yVal to live range equivalence class [ memoryRemap::yVal ]
Added variable memoryRemap::zVal to live range equivalence class [ memoryRemap::zVal ]
Added variable gotoxy::$7 to live range equivalence class [ gotoxy::$7 ]
Added variable gotoxy::$8 to live range equivalence class [ gotoxy::$8 ]
Added variable gotoxy::$9 to live range equivalence class [ gotoxy::$9 ]
@ -1385,6 +1417,10 @@ Complete equivalence classes
[ conio_cursor_y ]
[ conio_line_text ]
[ conio_line_color ]
[ memoryRemap::aVal ]
[ memoryRemap::xVal ]
[ memoryRemap::yVal ]
[ memoryRemap::zVal ]
[ gotoxy::$7 ]
[ gotoxy::$8 ]
[ gotoxy::$9 ]
@ -1409,16 +1445,20 @@ Allocated zp[1]:19 [ conio_cursor_x ]
Allocated zp[1]:20 [ conio_cursor_y ]
Allocated zp[2]:21 [ conio_line_text ]
Allocated zp[2]:23 [ conio_line_color ]
Allocated zp[2]:25 [ gotoxy::$7 ]
Allocated zp[2]:27 [ gotoxy::$8 ]
Allocated zp[2]:29 [ gotoxy::$9 ]
Allocated zp[2]:31 [ gotoxy::line_offset#0 ]
Allocated zp[2]:33 [ gotoxy::$5 ]
Allocated zp[2]:35 [ gotoxy::$6 ]
Allocated zp[1]:37 [ cputs::c#1 ]
Allocated zp[1]:38 [ cputc::c#0 ]
Allocated zp[2]:39 [ memcpy::src_end#0 ]
Allocated zp[2]:41 [ memset::end#0 ]
Allocated zp[1]:25 [ memoryRemap::aVal ]
Allocated zp[1]:26 [ memoryRemap::xVal ]
Allocated zp[1]:27 [ memoryRemap::yVal ]
Allocated zp[1]:28 [ memoryRemap::zVal ]
Allocated zp[2]:29 [ gotoxy::$7 ]
Allocated zp[2]:31 [ gotoxy::$8 ]
Allocated zp[2]:33 [ gotoxy::$9 ]
Allocated zp[2]:35 [ gotoxy::line_offset#0 ]
Allocated zp[2]:37 [ gotoxy::$5 ]
Allocated zp[2]:39 [ gotoxy::$6 ]
Allocated zp[1]:41 [ cputs::c#1 ]
Allocated zp[1]:42 [ cputc::c#0 ]
Allocated zp[2]:43 [ memcpy::src_end#0 ]
Allocated zp[2]:45 [ memset::end#0 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [1] conio_cursor_x = 0 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [2] conio_cursor_y = 0 [ ] ( [ ] { } ) always clobbers reg byte a
@ -1427,10 +1467,10 @@ Statement [4] conio_line_color = COLORRAM [ ] ( [ ] { } ) always clobbers reg
Statement [13] *IO_KEY = $47 [ ] ( [ ] { } conio_mega65_init:5 [ ] { } ) always clobbers reg byte a
Statement [14] *IO_KEY = $53 [ ] ( [ ] { } conio_mega65_init:5 [ ] { } ) always clobbers reg byte a
Statement [15] *IO_BANK = *IO_BANK | CRAM2K [ ] ( [ ] { } conio_mega65_init:5 [ ] { } ) always clobbers reg byte a
Statement [26] *memoryRemap::aVal = 0 [ ] ( memoryRemap:12 [ ] { } conio_mega65_init:5::memoryRemap:12 [ ] { } ) always clobbers reg byte a
Statement [27] *memoryRemap::xVal = 0 [ ] ( memoryRemap:12 [ ] { } conio_mega65_init:5::memoryRemap:12 [ ] { } ) always clobbers reg byte a
Statement [28] *memoryRemap::yVal = 0 [ ] ( memoryRemap:12 [ ] { } conio_mega65_init:5::memoryRemap:12 [ ] { } ) always clobbers reg byte a
Statement [29] *memoryRemap::zVal = 0 [ ] ( memoryRemap:12 [ ] { } conio_mega65_init:5::memoryRemap:12 [ ] { } ) always clobbers reg byte a
Statement [26] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:12 [ memoryRemap::aVal ] { } conio_mega65_init:5::memoryRemap:12 [ memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [27] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:12 [ memoryRemap::aVal memoryRemap::xVal ] { } conio_mega65_init:5::memoryRemap:12 [ memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [28] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:12 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } conio_mega65_init:5::memoryRemap:12 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [29] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:12 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } conio_mega65_init:5::memoryRemap:12 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [35] conio_cursor_x = gotoxy::x#2 [ conio_cursor_x gotoxy::y#4 ] ( gotoxy:21 [ conio_cursor_x gotoxy::y#4 ] { { gotoxy::y#2 = conio_mega65_init::line#2 } } conio_mega65_init:5::gotoxy:21 [ conio_cursor_x gotoxy::y#4 ] { { gotoxy::y#2 = conio_mega65_init::line#2 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:3 [ gotoxy::y#4 gotoxy::y#2 ]
@ -1470,10 +1510,10 @@ Statement [4] conio_line_color = COLORRAM [ ] ( [ ] { } ) always clobbers reg
Statement [13] *IO_KEY = $47 [ ] ( [ ] { } conio_mega65_init:5 [ ] { } ) always clobbers reg byte a
Statement [14] *IO_KEY = $53 [ ] ( [ ] { } conio_mega65_init:5 [ ] { } ) always clobbers reg byte a
Statement [15] *IO_BANK = *IO_BANK | CRAM2K [ ] ( [ ] { } conio_mega65_init:5 [ ] { } ) always clobbers reg byte a
Statement [26] *memoryRemap::aVal = 0 [ ] ( memoryRemap:12 [ ] { } conio_mega65_init:5::memoryRemap:12 [ ] { } ) always clobbers reg byte a
Statement [27] *memoryRemap::xVal = 0 [ ] ( memoryRemap:12 [ ] { } conio_mega65_init:5::memoryRemap:12 [ ] { } ) always clobbers reg byte a
Statement [28] *memoryRemap::yVal = 0 [ ] ( memoryRemap:12 [ ] { } conio_mega65_init:5::memoryRemap:12 [ ] { } ) always clobbers reg byte a
Statement [29] *memoryRemap::zVal = 0 [ ] ( memoryRemap:12 [ ] { } conio_mega65_init:5::memoryRemap:12 [ ] { } ) always clobbers reg byte a
Statement [26] memoryRemap::aVal = 0 [ memoryRemap::aVal ] ( memoryRemap:12 [ memoryRemap::aVal ] { } conio_mega65_init:5::memoryRemap:12 [ memoryRemap::aVal ] { } ) always clobbers reg byte a
Statement [27] memoryRemap::xVal = 0 [ memoryRemap::aVal memoryRemap::xVal ] ( memoryRemap:12 [ memoryRemap::aVal memoryRemap::xVal ] { } conio_mega65_init:5::memoryRemap:12 [ memoryRemap::aVal memoryRemap::xVal ] { } ) always clobbers reg byte a
Statement [28] memoryRemap::yVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] ( memoryRemap:12 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } conio_mega65_init:5::memoryRemap:12 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal ] { } ) always clobbers reg byte a
Statement [29] memoryRemap::zVal = 0 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] ( memoryRemap:12 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } conio_mega65_init:5::memoryRemap:12 [ memoryRemap::aVal memoryRemap::xVal memoryRemap::yVal memoryRemap::zVal ] { } ) always clobbers reg byte a
Statement asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom } always clobbers reg byte a reg byte x reg byte y reg byte z
Statement [35] conio_cursor_x = gotoxy::x#2 [ conio_cursor_x gotoxy::y#4 ] ( gotoxy:21 [ conio_cursor_x gotoxy::y#4 ] { { gotoxy::y#2 = conio_mega65_init::line#2 } } conio_mega65_init:5::gotoxy:21 [ conio_cursor_x gotoxy::y#4 ] { { gotoxy::y#2 = conio_mega65_init::line#2 } } ) always clobbers reg byte a
Statement [37] gotoxy::$7 = (word)gotoxy::y#4 [ conio_cursor_x conio_cursor_y gotoxy::$7 ] ( gotoxy:21 [ conio_cursor_x conio_cursor_y gotoxy::$7 ] { { gotoxy::y#2 = conio_mega65_init::line#2 } } conio_mega65_init:5::gotoxy:21 [ conio_cursor_x conio_cursor_y gotoxy::$7 ] { { gotoxy::y#2 = conio_mega65_init::line#2 } } ) always clobbers reg byte a
@ -1517,24 +1557,29 @@ Potential registers zp[1]:19 [ conio_cursor_x ] : zp[1]:19 ,
Potential registers zp[1]:20 [ conio_cursor_y ] : zp[1]:20 ,
Potential registers zp[2]:21 [ conio_line_text ] : zp[2]:21 ,
Potential registers zp[2]:23 [ conio_line_color ] : zp[2]:23 ,
Potential registers zp[2]:25 [ gotoxy::$7 ] : zp[2]:25 ,
Potential registers zp[2]:27 [ gotoxy::$8 ] : zp[2]:27 ,
Potential registers zp[2]:29 [ gotoxy::$9 ] : zp[2]:29 ,
Potential registers zp[2]:31 [ gotoxy::line_offset#0 ] : zp[2]:31 ,
Potential registers zp[2]:33 [ gotoxy::$5 ] : zp[2]:33 ,
Potential registers zp[2]:35 [ gotoxy::$6 ] : zp[2]:35 ,
Potential registers zp[1]:37 [ cputs::c#1 ] : zp[1]:37 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:38 [ cputc::c#0 ] : zp[1]:38 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[2]:39 [ memcpy::src_end#0 ] : zp[2]:39 ,
Potential registers zp[2]:41 [ memset::end#0 ] : zp[2]:41 ,
Potential registers zp[1]:25 [ memoryRemap::aVal ] : zp[1]:25 ,
Potential registers zp[1]:26 [ memoryRemap::xVal ] : zp[1]:26 ,
Potential registers zp[1]:27 [ memoryRemap::yVal ] : zp[1]:27 ,
Potential registers zp[1]:28 [ memoryRemap::zVal ] : zp[1]:28 ,
Potential registers zp[2]:29 [ gotoxy::$7 ] : zp[2]:29 ,
Potential registers zp[2]:31 [ gotoxy::$8 ] : zp[2]:31 ,
Potential registers zp[2]:33 [ gotoxy::$9 ] : zp[2]:33 ,
Potential registers zp[2]:35 [ gotoxy::line_offset#0 ] : zp[2]:35 ,
Potential registers zp[2]:37 [ gotoxy::$5 ] : zp[2]:37 ,
Potential registers zp[2]:39 [ gotoxy::$6 ] : zp[2]:39 ,
Potential registers zp[1]:41 [ cputs::c#1 ] : zp[1]:41 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[1]:42 [ cputc::c#0 ] : zp[1]:42 , reg byte a , reg byte x , reg byte y , reg byte z ,
Potential registers zp[2]:43 [ memcpy::src_end#0 ] : zp[2]:43 ,
Potential registers zp[2]:45 [ memset::end#0 ] : zp[2]:45 ,
REGISTER UPLIFT SCOPES
Uplift Scope [memcpy] 3,012,500,004.25: zp[2]:10 [ memcpy::src#2 memcpy::src#4 memcpy::src#1 ] 2,023,333,337.67: zp[2]:12 [ memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ] 126,250,000.25: zp[2]:39 [ memcpy::src_end#0 ] 0: zp[2]:6 [ memcpy::source#2 ] 0: zp[2]:8 [ memcpy::destination#2 ]
Uplift Scope [memset] 3,356,666,672.33: zp[2]:17 [ memset::dst#2 memset::dst#4 memset::dst#1 ] 168,333,333.67: zp[2]:41 [ memset::end#0 ] 142,857,143: zp[1]:16 [ memset::c#4 ] 0: zp[2]:14 [ memset::str#3 ]
Uplift Scope [memcpy] 3,012,500,004.25: zp[2]:10 [ memcpy::src#2 memcpy::src#4 memcpy::src#1 ] 2,023,333,337.67: zp[2]:12 [ memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ] 126,250,000.25: zp[2]:43 [ memcpy::src_end#0 ] 0: zp[2]:6 [ memcpy::source#2 ] 0: zp[2]:8 [ memcpy::destination#2 ]
Uplift Scope [memset] 3,356,666,672.33: zp[2]:17 [ memset::dst#2 memset::dst#4 memset::dst#1 ] 168,333,333.67: zp[2]:45 [ memset::end#0 ] 142,857,143: zp[1]:16 [ memset::c#4 ] 0: zp[2]:14 [ memset::str#3 ]
Uplift Scope [] 62,747.22: zp[1]:20 [ conio_cursor_y ] 51,397.86: zp[2]:23 [ conio_line_color ] 49,113.51: zp[2]:21 [ conio_line_text ] 4,288.83: zp[1]:19 [ conio_cursor_x ]
Uplift Scope [cputc] 10,501.5: zp[1]:38 [ cputc::c#0 ]
Uplift Scope [cputs] 2,002: zp[2]:4 [ cputs::s#2 cputs::s#0 ] 1,001: zp[1]:37 [ cputs::c#1 ]
Uplift Scope [gotoxy] 202: zp[2]:27 [ gotoxy::$8 ] 202: zp[2]:29 [ gotoxy::$9 ] 202: zp[2]:33 [ gotoxy::$5 ] 202: zp[2]:35 [ gotoxy::$6 ] 151.5: zp[2]:25 [ gotoxy::$7 ] 138.33: zp[1]:3 [ gotoxy::y#4 gotoxy::y#2 ] 101: zp[2]:31 [ gotoxy::line_offset#0 ]
Uplift Scope [cputc] 10,501.5: zp[1]:42 [ cputc::c#0 ]
Uplift Scope [cputs] 2,002: zp[2]:4 [ cputs::s#2 cputs::s#0 ] 1,001: zp[1]:41 [ cputs::c#1 ]
Uplift Scope [gotoxy] 202: zp[2]:31 [ gotoxy::$8 ] 202: zp[2]:33 [ gotoxy::$9 ] 202: zp[2]:37 [ gotoxy::$5 ] 202: zp[2]:39 [ gotoxy::$6 ] 151.5: zp[2]:29 [ gotoxy::$7 ] 138.33: zp[1]:3 [ gotoxy::y#4 gotoxy::y#2 ] 101: zp[2]:35 [ gotoxy::line_offset#0 ]
Uplift Scope [memoryRemap] 101: zp[1]:28 [ memoryRemap::zVal ] 50.5: zp[1]:27 [ memoryRemap::yVal ] 33.67: zp[1]:26 [ memoryRemap::xVal ] 25.25: zp[1]:25 [ memoryRemap::aVal ]
Uplift Scope [conio_mega65_init] 33: zp[1]:2 [ conio_mega65_init::line#2 conio_mega65_init::line#0 ]
Uplift Scope [RADIX]
Uplift Scope [MOS6526_CIA]
@ -1542,7 +1587,6 @@ Uplift Scope [MOS6569_VICII]
Uplift Scope [MOS6581_SID]
Uplift Scope [MOS4569_VICIII]
Uplift Scope [MEGA65_VICIV]
Uplift Scope [memoryRemap]
Uplift Scope [F018_DMAGIC]
Uplift Scope [DMA_LIST_F018A]
Uplift Scope [DMA_LIST_F018B]
@ -1554,53 +1598,65 @@ Uplift Scope [printf_format_string]
Uplift Scope [main]
Uplift Scope [__start]
Uplifting [memcpy] best 10812 combination zp[2]:10 [ memcpy::src#2 memcpy::src#4 memcpy::src#1 ] zp[2]:12 [ memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ] zp[2]:39 [ memcpy::src_end#0 ] zp[2]:6 [ memcpy::source#2 ] zp[2]:8 [ memcpy::destination#2 ]
Uplifting [memset] best 10606 combination zp[2]:17 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:41 [ memset::end#0 ] reg byte z [ memset::c#4 ] zp[2]:14 [ memset::str#3 ]
Uplifting [] best 10606 combination zp[1]:20 [ conio_cursor_y ] zp[2]:23 [ conio_line_color ] zp[2]:21 [ conio_line_text ] zp[1]:19 [ conio_cursor_x ]
Uplifting [cputc] best 10570 combination reg byte a [ cputc::c#0 ]
Uplifting [cputs] best 10480 combination zp[2]:4 [ cputs::s#2 cputs::s#0 ] reg byte a [ cputs::c#1 ]
Uplifting [gotoxy] best 10467 combination zp[2]:27 [ gotoxy::$8 ] zp[2]:29 [ gotoxy::$9 ] zp[2]:33 [ gotoxy::$5 ] zp[2]:35 [ gotoxy::$6 ] zp[2]:25 [ gotoxy::$7 ] reg byte x [ gotoxy::y#4 gotoxy::y#2 ] zp[2]:31 [ gotoxy::line_offset#0 ]
Uplifting [conio_mega65_init] best 10455 combination reg byte x [ conio_mega65_init::line#2 conio_mega65_init::line#0 ]
Uplifting [RADIX] best 10455 combination
Uplifting [MOS6526_CIA] best 10455 combination
Uplifting [MOS6569_VICII] best 10455 combination
Uplifting [MOS6581_SID] best 10455 combination
Uplifting [MOS4569_VICIII] best 10455 combination
Uplifting [MEGA65_VICIV] best 10455 combination
Uplifting [memoryRemap] best 10455 combination
Uplifting [F018_DMAGIC] best 10455 combination
Uplifting [DMA_LIST_F018A] best 10455 combination
Uplifting [DMA_LIST_F018B] best 10455 combination
Uplifting [cputln] best 10455 combination
Uplifting [cscroll] best 10455 combination
Uplifting [printf_format_number] best 10455 combination
Uplifting [printf_buffer_number] best 10455 combination
Uplifting [printf_format_string] best 10455 combination
Uplifting [main] best 10455 combination
Uplifting [__start] best 10455 combination
Uplifting [memcpy] best 10808 combination zp[2]:10 [ memcpy::src#2 memcpy::src#4 memcpy::src#1 ] zp[2]:12 [ memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ] zp[2]:43 [ memcpy::src_end#0 ] zp[2]:6 [ memcpy::source#2 ] zp[2]:8 [ memcpy::destination#2 ]
Uplifting [memset] best 10602 combination zp[2]:17 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:45 [ memset::end#0 ] reg byte z [ memset::c#4 ] zp[2]:14 [ memset::str#3 ]
Uplifting [] best 10602 combination zp[1]:20 [ conio_cursor_y ] zp[2]:23 [ conio_line_color ] zp[2]:21 [ conio_line_text ] zp[1]:19 [ conio_cursor_x ]
Uplifting [cputc] best 10566 combination reg byte a [ cputc::c#0 ]
Uplifting [cputs] best 10476 combination zp[2]:4 [ cputs::s#2 cputs::s#0 ] reg byte a [ cputs::c#1 ]
Uplifting [gotoxy] best 10463 combination zp[2]:31 [ gotoxy::$8 ] zp[2]:33 [ gotoxy::$9 ] zp[2]:37 [ gotoxy::$5 ] zp[2]:39 [ gotoxy::$6 ] zp[2]:29 [ gotoxy::$7 ] reg byte x [ gotoxy::y#4 gotoxy::y#2 ] zp[2]:35 [ gotoxy::line_offset#0 ]
Uplifting [memoryRemap] best 10463 combination zp[1]:28 [ memoryRemap::zVal ] zp[1]:27 [ memoryRemap::yVal ] zp[1]:26 [ memoryRemap::xVal ] zp[1]:25 [ memoryRemap::aVal ]
Uplifting [conio_mega65_init] best 10451 combination reg byte x [ conio_mega65_init::line#2 conio_mega65_init::line#0 ]
Uplifting [RADIX] best 10451 combination
Uplifting [MOS6526_CIA] best 10451 combination
Uplifting [MOS6569_VICII] best 10451 combination
Uplifting [MOS6581_SID] best 10451 combination
Uplifting [MOS4569_VICIII] best 10451 combination
Uplifting [MEGA65_VICIV] best 10451 combination
Uplifting [F018_DMAGIC] best 10451 combination
Uplifting [DMA_LIST_F018A] best 10451 combination
Uplifting [DMA_LIST_F018B] best 10451 combination
Uplifting [cputln] best 10451 combination
Uplifting [cscroll] best 10451 combination
Uplifting [printf_format_number] best 10451 combination
Uplifting [printf_buffer_number] best 10451 combination
Uplifting [printf_format_string] best 10451 combination
Uplifting [main] best 10451 combination
Uplifting [__start] best 10451 combination
Attempting to uplift remaining variables inzp[1]:20 [ conio_cursor_y ]
Uplifting [] best 10455 combination zp[1]:20 [ conio_cursor_y ]
Uplifting [] best 10451 combination zp[1]:20 [ conio_cursor_y ]
Attempting to uplift remaining variables inzp[1]:19 [ conio_cursor_x ]
Uplifting [] best 10455 combination zp[1]:19 [ conio_cursor_x ]
Uplifting [] best 10451 combination zp[1]:19 [ conio_cursor_x ]
Attempting to uplift remaining variables inzp[1]:28 [ memoryRemap::zVal ]
Uplifting [memoryRemap] best 10451 combination zp[1]:28 [ memoryRemap::zVal ]
Attempting to uplift remaining variables inzp[1]:27 [ memoryRemap::yVal ]
Uplifting [memoryRemap] best 10451 combination zp[1]:27 [ memoryRemap::yVal ]
Attempting to uplift remaining variables inzp[1]:26 [ memoryRemap::xVal ]
Uplifting [memoryRemap] best 10451 combination zp[1]:26 [ memoryRemap::xVal ]
Attempting to uplift remaining variables inzp[1]:25 [ memoryRemap::aVal ]
Uplifting [memoryRemap] best 10451 combination zp[1]:25 [ memoryRemap::aVal ]
Coalescing zero page register [ zp[2]:6 [ memcpy::source#2 ] ] with [ zp[2]:10 [ memcpy::src#2 memcpy::src#4 memcpy::src#1 ] ] - score: 1
Coalescing zero page register [ zp[2]:8 [ memcpy::destination#2 ] ] with [ zp[2]:12 [ memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ] ] - score: 1
Coalescing zero page register [ zp[2]:14 [ memset::str#3 ] ] with [ zp[2]:17 [ memset::dst#2 memset::dst#4 memset::dst#1 ] ] - score: 1
Coalescing zero page register [ zp[2]:25 [ gotoxy::$7 ] ] with [ zp[2]:29 [ gotoxy::$9 ] ] - score: 1
Coalescing zero page register [ zp[2]:31 [ gotoxy::line_offset#0 ] ] with [ zp[2]:35 [ gotoxy::$6 ] ] - score: 1
Coalescing zero page register [ zp[2]:25 [ gotoxy::$7 gotoxy::$9 ] ] with [ zp[2]:31 [ gotoxy::line_offset#0 gotoxy::$6 ] ] - score: 1
Coalescing zero page register [ zp[2]:29 [ gotoxy::$7 ] ] with [ zp[2]:33 [ gotoxy::$9 ] ] - score: 1
Coalescing zero page register [ zp[2]:35 [ gotoxy::line_offset#0 ] ] with [ zp[2]:39 [ gotoxy::$6 ] ] - score: 1
Coalescing zero page register [ zp[2]:29 [ gotoxy::$7 gotoxy::$9 ] ] with [ zp[2]:35 [ gotoxy::line_offset#0 gotoxy::$6 ] ] - score: 1
Coalescing zero page register [ zp[2]:14 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ] ] with [ zp[2]:6 [ memcpy::source#2 memcpy::src#2 memcpy::src#4 memcpy::src#1 ] ]
Coalescing zero page register [ zp[2]:41 [ memset::end#0 ] ] with [ zp[2]:8 [ memcpy::destination#2 memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ] ]
Coalescing zero page register [ zp[2]:45 [ memset::end#0 ] ] with [ zp[2]:8 [ memcpy::destination#2 memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ] ]
Allocated (was zp[2]:4) zp[2]:2 [ cputs::s#2 cputs::s#0 ]
Allocated (was zp[2]:14) zp[2]:4 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 memcpy::source#2 memcpy::src#2 memcpy::src#4 memcpy::src#1 ]
Allocated (was zp[1]:19) zp[1]:6 [ conio_cursor_x ]
Allocated (was zp[1]:20) zp[1]:7 [ conio_cursor_y ]
Allocated (was zp[2]:21) zp[2]:8 [ conio_line_text ]
Allocated (was zp[2]:23) zp[2]:10 [ conio_line_color ]
Allocated (was zp[2]:25) zp[2]:12 [ gotoxy::$7 gotoxy::$9 gotoxy::line_offset#0 gotoxy::$6 ]
Allocated (was zp[2]:27) zp[2]:14 [ gotoxy::$8 ]
Allocated (was zp[2]:33) zp[2]:16 [ gotoxy::$5 ]
Allocated (was zp[2]:39) zp[2]:18 [ memcpy::src_end#0 ]
Allocated (was zp[2]:41) zp[2]:20 [ memset::end#0 memcpy::destination#2 memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ]
Allocated (was zp[1]:25) zp[1]:12 [ memoryRemap::aVal ]
Allocated (was zp[1]:26) zp[1]:13 [ memoryRemap::xVal ]
Allocated (was zp[1]:27) zp[1]:14 [ memoryRemap::yVal ]
Allocated (was zp[1]:28) zp[1]:15 [ memoryRemap::zVal ]
Allocated (was zp[2]:29) zp[2]:16 [ gotoxy::$7 gotoxy::$9 gotoxy::line_offset#0 gotoxy::$6 ]
Allocated (was zp[2]:31) zp[2]:18 [ gotoxy::$8 ]
Allocated (was zp[2]:37) zp[2]:20 [ gotoxy::$5 ]
Allocated (was zp[2]:43) zp[2]:22 [ memcpy::src_end#0 ]
Allocated (was zp[2]:45) zp[2]:24 [ memset::end#0 memcpy::destination#2 memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -1787,22 +1843,26 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// [26] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = $c
.label xVal = $d
.label yVal = $e
.label zVal = $f
// [26] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// [27] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta.z aVal
// [27] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
lda #0
sta xVal
// [28] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta.z xVal
// [28] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
lda #0
sta yVal
// [29] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta.z yVal
// [29] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
lda #0
sta zVal
sta.z zVal
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal
ldx xVal
@ -1821,12 +1881,12 @@ memoryRemap: {
// gotoxy(byte register(X) y)
gotoxy: {
.const x = 0
.label __5 = $10
.label __6 = $c
.label __7 = $c
.label line_offset = $c
.label __8 = $e
.label __9 = $c
.label __5 = $14
.label __6 = $10
.label __7 = $10
.label line_offset = $10
.label __8 = $12
.label __9 = $10
// [32] if(gotoxy::y#2<$19+1) goto gotoxy::@3 -- vbuxx_lt_vbuc1_then_la1
cpx #$19+1
bcc __b3_from_gotoxy
@ -2135,13 +2195,13 @@ cscroll: {
// memcpy
// Copy block of memory (forwards)
// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination.
// memcpy(void* zp($14) destination, void* zp(4) source)
// memcpy(void* zp($18) destination, void* zp(4) source)
memcpy: {
.label src_end = $12
.label dst = $14
.label src_end = $16
.label dst = $18
.label src = 4
.label source = 4
.label destination = $14
.label destination = $18
// [84] memcpy::src_end#0 = (byte*)memcpy::source#2 + (word)$19*$50-$50 -- pbuz1=pbuz2_plus_vwuc1
clc
lda.z source
@ -2189,7 +2249,7 @@ memcpy: {
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zp(4) str, byte register(Z) c)
memset: {
.label end = $14
.label end = $18
.label dst = 4
.label str = 4
jmp __b1
@ -2375,13 +2435,13 @@ to_nomodify byte* cputs::s#0 s zp[2]:2 500.5
to_nomodify byte* cputs::s#2 s zp[2]:2 1501.5
void cscroll()
void gotoxy(byte gotoxy::x , byte gotoxy::y)
byte*~ gotoxy::$5 zp[2]:16 202.0
byte*~ gotoxy::$6 zp[2]:12 202.0
word~ gotoxy::$7 zp[2]:12 151.5
word~ gotoxy::$8 zp[2]:14 202.0
word~ gotoxy::$9 zp[2]:12 202.0
byte*~ gotoxy::$5 zp[2]:20 202.0
byte*~ gotoxy::$6 zp[2]:16 202.0
word~ gotoxy::$7 zp[2]:16 151.5
word~ gotoxy::$8 zp[2]:18 202.0
word~ gotoxy::$9 zp[2]:16 202.0
word gotoxy::line_offset
word gotoxy::line_offset#0 line_offset zp[2]:12 101.0
word gotoxy::line_offset#0 line_offset zp[2]:16 101.0
byte gotoxy::x
const byte gotoxy::x#2 x = 0
byte gotoxy::y
@ -2391,11 +2451,11 @@ void main()
const byte* main::s[$d] = "hello world!"
void* memcpy(void* memcpy::destination , void* memcpy::source , word memcpy::num)
void* memcpy::destination
void* memcpy::destination#2 destination zp[2]:20
void* memcpy::destination#2 destination zp[2]:24
byte* memcpy::dst
byte* memcpy::dst#1 dst zp[2]:20 1.000000001E9
byte* memcpy::dst#2 dst zp[2]:20 1.0033333346666667E9
byte* memcpy::dst#4 dst zp[2]:20 2.0000002E7
byte* memcpy::dst#1 dst zp[2]:24 1.000000001E9
byte* memcpy::dst#2 dst zp[2]:24 1.0033333346666667E9
byte* memcpy::dst#4 dst zp[2]:24 2.0000002E7
word memcpy::num
void* memcpy::return
void* memcpy::source
@ -2405,15 +2465,15 @@ byte* memcpy::src#1 src zp[2]:4 2.000000002E9
byte* memcpy::src#2 src zp[2]:4 1.00250000125E9
byte* memcpy::src#4 src zp[2]:4 1.0000001E7
byte* memcpy::src_end
byte* memcpy::src_end#0 src_end zp[2]:18 1.2625000025E8
byte* memcpy::src_end#0 src_end zp[2]:22 1.2625000025E8
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:12 25.25
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:13 33.666666666666664
volatile byte memoryRemap::yVal loadstore zp[1]:14 50.5
volatile byte memoryRemap::zVal loadstore zp[1]:15 101.0
void* memset(void* memset::str , byte memset::c , word memset::num)
byte memset::c
byte memset::c#4 reg byte z 1.42857143E8
@ -2422,7 +2482,7 @@ byte* memset::dst#1 dst zp[2]:4 2.000000002E9
byte* memset::dst#2 dst zp[2]:4 1.3366666683333335E9
byte* memset::dst#4 dst zp[2]:4 2.0000002E7
byte* memset::end
byte* memset::end#0 end zp[2]:20 1.683333336666667E8
byte* memset::end#0 end zp[2]:24 1.683333336666667E8
word memset::num
void* memset::return
void* memset::str
@ -2437,17 +2497,21 @@ zp[1]:6 [ conio_cursor_x ]
zp[1]:7 [ conio_cursor_y ]
zp[2]:8 [ conio_line_text ]
zp[2]:10 [ conio_line_color ]
zp[2]:12 [ gotoxy::$7 gotoxy::$9 gotoxy::line_offset#0 gotoxy::$6 ]
zp[2]:14 [ gotoxy::$8 ]
zp[2]:16 [ gotoxy::$5 ]
zp[1]:12 [ memoryRemap::aVal ]
zp[1]:13 [ memoryRemap::xVal ]
zp[1]:14 [ memoryRemap::yVal ]
zp[1]:15 [ memoryRemap::zVal ]
zp[2]:16 [ gotoxy::$7 gotoxy::$9 gotoxy::line_offset#0 gotoxy::$6 ]
zp[2]:18 [ gotoxy::$8 ]
zp[2]:20 [ gotoxy::$5 ]
reg byte a [ cputs::c#1 ]
reg byte a [ cputc::c#0 ]
zp[2]:18 [ memcpy::src_end#0 ]
zp[2]:20 [ memset::end#0 memcpy::destination#2 memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ]
zp[2]:22 [ memcpy::src_end#0 ]
zp[2]:24 [ memset::end#0 memcpy::destination#2 memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ]
FINAL ASSEMBLER
Score: 8741
Score: 8737
// File Comments
// Hello World for MEGA 65 - using stdio.h and conio.h
@ -2620,23 +2684,27 @@ main: {
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
// [26] *memoryRemap::aVal = 0 -- _deref_pbuc1=vbuc2
.label aVal = $c
.label xVal = $d
.label yVal = $e
.label zVal = $f
// aVal = <lowerPageOffset
// [26] memoryRemap::aVal = 0 -- vbuz1=vbuc1
// lower blocks offset page low
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [27] *memoryRemap::xVal = 0 -- _deref_pbuc1=vbuc2
sta xVal
// *yVal = <upperPageOffset
// [28] *memoryRemap::yVal = 0 -- _deref_pbuc1=vbuc2
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [29] *memoryRemap::zVal = 0 -- _deref_pbuc1=vbuc2
sta zVal
sta.z aVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// [27] memoryRemap::xVal = 0 -- vbuz1=vbuc1
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = <upperPageOffset
// [28] memoryRemap::yVal = 0 -- vbuz1=vbuc1
// upper blocks offset page
sta.z yVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// [29] memoryRemap::zVal = 0 -- vbuz1=vbuc1
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
// asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
lda aVal
@ -2655,12 +2723,12 @@ memoryRemap: {
// gotoxy(byte register(X) y)
gotoxy: {
.const x = 0
.label __5 = $10
.label __6 = $c
.label __7 = $c
.label line_offset = $c
.label __8 = $e
.label __9 = $c
.label __5 = $14
.label __6 = $10
.label __7 = $10
.label line_offset = $10
.label __8 = $12
.label __9 = $10
// if(y>CONIO_HEIGHT)
// [32] if(gotoxy::y#2<$19+1) goto gotoxy::@3 -- vbuxx_lt_vbuc1_then_la1
cpx #$19+1
@ -2959,13 +3027,13 @@ cscroll: {
// memcpy
// Copy block of memory (forwards)
// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination.
// memcpy(void* zp($14) destination, void* zp(4) source)
// memcpy(void* zp($18) destination, void* zp(4) source)
memcpy: {
.label src_end = $12
.label dst = $14
.label src_end = $16
.label dst = $18
.label src = 4
.label source = 4
.label destination = $14
.label destination = $18
// src_end = (char*)source+num
// [84] memcpy::src_end#0 = (byte*)memcpy::source#2 + (word)$19*$50-$50 -- pbuz1=pbuz2_plus_vwuc1
clc
@ -3012,7 +3080,7 @@ memcpy: {
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zp(4) str, byte register(Z) c)
memset: {
.label end = $14
.label end = $18
.label dst = 4
.label str = 4
// memset::@1

View File

@ -30,13 +30,13 @@ to_nomodify byte* cputs::s#0 s zp[2]:2 500.5
to_nomodify byte* cputs::s#2 s zp[2]:2 1501.5
void cscroll()
void gotoxy(byte gotoxy::x , byte gotoxy::y)
byte*~ gotoxy::$5 zp[2]:16 202.0
byte*~ gotoxy::$6 zp[2]:12 202.0
word~ gotoxy::$7 zp[2]:12 151.5
word~ gotoxy::$8 zp[2]:14 202.0
word~ gotoxy::$9 zp[2]:12 202.0
byte*~ gotoxy::$5 zp[2]:20 202.0
byte*~ gotoxy::$6 zp[2]:16 202.0
word~ gotoxy::$7 zp[2]:16 151.5
word~ gotoxy::$8 zp[2]:18 202.0
word~ gotoxy::$9 zp[2]:16 202.0
word gotoxy::line_offset
word gotoxy::line_offset#0 line_offset zp[2]:12 101.0
word gotoxy::line_offset#0 line_offset zp[2]:16 101.0
byte gotoxy::x
const byte gotoxy::x#2 x = 0
byte gotoxy::y
@ -46,11 +46,11 @@ void main()
const byte* main::s[$d] = "hello world!"
void* memcpy(void* memcpy::destination , void* memcpy::source , word memcpy::num)
void* memcpy::destination
void* memcpy::destination#2 destination zp[2]:20
void* memcpy::destination#2 destination zp[2]:24
byte* memcpy::dst
byte* memcpy::dst#1 dst zp[2]:20 1.000000001E9
byte* memcpy::dst#2 dst zp[2]:20 1.0033333346666667E9
byte* memcpy::dst#4 dst zp[2]:20 2.0000002E7
byte* memcpy::dst#1 dst zp[2]:24 1.000000001E9
byte* memcpy::dst#2 dst zp[2]:24 1.0033333346666667E9
byte* memcpy::dst#4 dst zp[2]:24 2.0000002E7
word memcpy::num
void* memcpy::return
void* memcpy::source
@ -60,15 +60,15 @@ byte* memcpy::src#1 src zp[2]:4 2.000000002E9
byte* memcpy::src#2 src zp[2]:4 1.00250000125E9
byte* memcpy::src#4 src zp[2]:4 1.0000001E7
byte* memcpy::src_end
byte* memcpy::src_end#0 src_end zp[2]:18 1.2625000025E8
byte* memcpy::src_end#0 src_end zp[2]:22 1.2625000025E8
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:12 25.25
word memoryRemap::lowerPageOffset
byte memoryRemap::remapBlocks
word memoryRemap::upperPageOffset
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
volatile byte memoryRemap::xVal loadstore zp[1]:13 33.666666666666664
volatile byte memoryRemap::yVal loadstore zp[1]:14 50.5
volatile byte memoryRemap::zVal loadstore zp[1]:15 101.0
void* memset(void* memset::str , byte memset::c , word memset::num)
byte memset::c
byte memset::c#4 reg byte z 1.42857143E8
@ -77,7 +77,7 @@ byte* memset::dst#1 dst zp[2]:4 2.000000002E9
byte* memset::dst#2 dst zp[2]:4 1.3366666683333335E9
byte* memset::dst#4 dst zp[2]:4 2.0000002E7
byte* memset::end
byte* memset::end#0 end zp[2]:20 1.683333336666667E8
byte* memset::end#0 end zp[2]:24 1.683333336666667E8
word memset::num
void* memset::return
void* memset::str
@ -92,10 +92,14 @@ zp[1]:6 [ conio_cursor_x ]
zp[1]:7 [ conio_cursor_y ]
zp[2]:8 [ conio_line_text ]
zp[2]:10 [ conio_line_color ]
zp[2]:12 [ gotoxy::$7 gotoxy::$9 gotoxy::line_offset#0 gotoxy::$6 ]
zp[2]:14 [ gotoxy::$8 ]
zp[2]:16 [ gotoxy::$5 ]
zp[1]:12 [ memoryRemap::aVal ]
zp[1]:13 [ memoryRemap::xVal ]
zp[1]:14 [ memoryRemap::yVal ]
zp[1]:15 [ memoryRemap::zVal ]
zp[2]:16 [ gotoxy::$7 gotoxy::$9 gotoxy::line_offset#0 gotoxy::$6 ]
zp[2]:18 [ gotoxy::$8 ]
zp[2]:20 [ gotoxy::$5 ]
reg byte a [ cputs::c#1 ]
reg byte a [ cputc::c#0 ]
zp[2]:18 [ memcpy::src_end#0 ]
zp[2]:20 [ memset::end#0 memcpy::destination#2 memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ]
zp[2]:22 [ memcpy::src_end#0 ]
zp[2]:24 [ memset::end#0 memcpy::destination#2 memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ]

View File

@ -127,7 +127,7 @@ main: {
// Ie. the memory that will be pointed to is $100 * the passed page address. Only the lower 12bits of the passed value is used.
// memoryRemapBlock(byte register(X) blockPage)
memoryRemapBlock: {
.label pageOffset = $b
.label pageOffset = $11
// pageOffset = memoryPage-blockPage
stx.z $ff
lda #<$100
@ -188,20 +188,21 @@ memoryRemapBlock: {
// - If block 5 ($a000-$bfff) is remapped it will point to upperPageOffset*$100 + $a000.
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
// memoryRemap(byte register(Z) remapBlocks, word zp($b) lowerPageOffset, word zp($e) upperPageOffset)
// memoryRemap(byte register(Z) remapBlocks, word zp($11) lowerPageOffset, word zp($15) upperPageOffset)
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
.label __1 = $d
.label __6 = 6
.label lowerPageOffset = $b
.label upperPageOffset = $e
.label aVal = 6
.label xVal = 7
.label __1 = $14
.label yVal = 8
.label zVal = $a
.label __6 = 9
.label lowerPageOffset = $11
.label upperPageOffset = $15
// <lowerPageOffset
lda.z lowerPageOffset
// *aVal = <lowerPageOffset
sta aVal
// aVal = <lowerPageOffset
// lower blocks offset page low
sta.z aVal
// remapBlocks << 4
tza
asl
@ -215,12 +216,14 @@ memoryRemap: {
and #$f
// (remapBlocks << 4) | (>lowerPageOffset & 0xf)
ora.z __1
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
sta xVal
// xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// <upperPageOffset
lda.z upperPageOffset
// *yVal = <upperPageOffset
sta yVal
// yVal = <upperPageOffset
// upper blocks offset page
sta.z yVal
// remapBlocks & 0xf0
tza
and #$f0
@ -231,8 +234,9 @@ memoryRemap: {
and #$f
// (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
ora.z __6
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
sta zVal
// zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
lda aVal
ldx xVal
@ -270,16 +274,16 @@ memoryRemap: {
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
// memoryRemap256M(byte register(Z) remapBlocks, dword zp(2) lowerPageOffset)
memoryRemap256M: {
.label lMb = $fa
.label uMb = $fb
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
.label __0 = 7
.label __4 = $b
.label __6 = $d
.label __7 = $e
.label lMb = $f
.label __0 = $b
.label uMb = $10
.label aVal = $13
.label __4 = $11
.label xVal = $17
.label __6 = $14
.label __7 = $15
.label yVal = $18
.label zVal = $19
.label lowerPageOffset = 2
// lowerPageOffset>>4
lda.z lowerPageOffset+3
@ -308,11 +312,13 @@ memoryRemap256M: {
ror.z __0
// >((unsigned int)(lowerPageOffset>>4))
lda.z __0+1
// *lMb = >((unsigned int)(lowerPageOffset>>4))
sta lMb
// *uMb = >((unsigned int)(upperPageOffset>>4))
// lMb = >((unsigned int)(lowerPageOffset>>4))
// lower blocks offset megabytes
sta.z lMb
// uMb = >((unsigned int)(upperPageOffset>>4))
// upper blocks offset megabytes
lda #0
sta uMb
sta.z uMb
// <lowerPageOffset
lda.z lowerPageOffset
sta.z __4
@ -320,8 +326,9 @@ memoryRemap256M: {
sta.z __4+1
// < <lowerPageOffset
lda.z __4
// *aVal = < <lowerPageOffset
sta aVal
// aVal = < <lowerPageOffset
// lower blocks offset page low
sta.z aVal
// remapBlocks << 4
tza
asl
@ -339,16 +346,20 @@ memoryRemap256M: {
and #$f
// (remapBlocks << 4) | (> <lowerPageOffset & 0xf)
ora.z __6
// *xVal = (remapBlocks << 4) | (> <lowerPageOffset & 0xf)
sta xVal
// *yVal = < <upperPageOffset
// xVal = (remapBlocks << 4) | (> <lowerPageOffset & 0xf)
// lower blocks to map + lower blocks offset high nibble
sta.z xVal
// yVal = < <upperPageOffset
// upper blocks offset page
lda #0
sta yVal
// (remapBlocks & 0xf0) | (> <upperPageOffset & 0xf)
sta.z yVal
// remapBlocks & 0xf0
tza
and #$f0
// *zVal = (remapBlocks & 0xf0) | (> <upperPageOffset & 0xf)
sta zVal
// (remapBlocks & 0xf0) | (> <upperPageOffset & 0xf)
// zVal = (remapBlocks & 0xf0) | (> <upperPageOffset & 0xf)
// upper blocks to map + upper blocks offset page high nibble
sta.z zVal
// asm
lda lMb
ldx #$f

View File

@ -68,19 +68,19 @@ memoryRemap: scope:[memoryRemap] from main::@8 memoryRemapBlock
[33] memoryRemap::remapBlocks#2 = phi( main::@8/MEMORYBLOCK_4000|MEMORYBLOCK_8000, memoryRemapBlock/memoryRemap::remapBlocks#0 )
[33] memoryRemap::lowerPageOffset#2 = phi( main::@8/$c0, memoryRemapBlock/memoryRemap::lowerPageOffset#0 )
[34] memoryRemap::$0 = < memoryRemap::lowerPageOffset#2
[35] *memoryRemap::aVal = memoryRemap::$0
[35] memoryRemap::aVal = memoryRemap::$0
[36] memoryRemap::$1 = memoryRemap::remapBlocks#2 << 4
[37] memoryRemap::$2 = > memoryRemap::lowerPageOffset#2
[38] memoryRemap::$3 = memoryRemap::$2 & $f
[39] memoryRemap::$4 = memoryRemap::$1 | memoryRemap::$3
[40] *memoryRemap::xVal = memoryRemap::$4
[40] memoryRemap::xVal = memoryRemap::$4
[41] memoryRemap::$5 = < memoryRemap::upperPageOffset#2
[42] *memoryRemap::yVal = memoryRemap::$5
[42] memoryRemap::yVal = memoryRemap::$5
[43] memoryRemap::$6 = memoryRemap::remapBlocks#2 & $f0
[44] memoryRemap::$7 = > memoryRemap::upperPageOffset#2
[45] memoryRemap::$8 = memoryRemap::$7 & $f
[46] memoryRemap::$9 = memoryRemap::$6 | memoryRemap::$8
[47] *memoryRemap::zVal = memoryRemap::$9
[47] memoryRemap::zVal = memoryRemap::$9
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
@ -93,22 +93,23 @@ memoryRemap256M: scope:[memoryRemap256M] from main::@3 main::@6
[50] memoryRemap256M::lowerPageOffset#2 = phi( main::@3/$ff800-$40, main::@6/0 )
[51] memoryRemap256M::$0 = memoryRemap256M::lowerPageOffset#2 >> 4
[52] memoryRemap256M::$1 = > (word)memoryRemap256M::$0
[53] *memoryRemap256M::lMb = memoryRemap256M::$1
[54] *memoryRemap256M::uMb = 0
[53] memoryRemap256M::lMb = memoryRemap256M::$1
[54] memoryRemap256M::uMb = 0
[55] memoryRemap256M::$4 = < memoryRemap256M::lowerPageOffset#2
[56] memoryRemap256M::$5 = < memoryRemap256M::$4
[57] *memoryRemap256M::aVal = memoryRemap256M::$5
[57] memoryRemap256M::aVal = memoryRemap256M::$5
[58] memoryRemap256M::$6 = memoryRemap256M::remapBlocks#2 << 4
[59] memoryRemap256M::$7 = < memoryRemap256M::lowerPageOffset#2
[60] memoryRemap256M::$8 = > memoryRemap256M::$7
[61] memoryRemap256M::$9 = memoryRemap256M::$8 & $f
[62] memoryRemap256M::$10 = memoryRemap256M::$6 | memoryRemap256M::$9
[63] *memoryRemap256M::xVal = memoryRemap256M::$10
[64] *memoryRemap256M::yVal = 0
[65] memoryRemap256M::$17 = memoryRemap256M::remapBlocks#2 & $f0
[66] *memoryRemap256M::zVal = memoryRemap256M::$17
[63] memoryRemap256M::xVal = memoryRemap256M::$10
[64] memoryRemap256M::yVal = 0
[65] memoryRemap256M::$13 = memoryRemap256M::remapBlocks#2 & $f0
[66] memoryRemap256M::$17 = memoryRemap256M::$13
[67] memoryRemap256M::zVal = memoryRemap256M::$17
asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap256M::@return
memoryRemap256M::@return: scope:[memoryRemap256M] from memoryRemap256M
[68] return
[69] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -13,50 +13,51 @@ byte main::i1#1 reg byte x 22.0
byte main::i1#2 reg byte x 13.75
void memoryRemap(byte memoryRemap::remapBlocks , word memoryRemap::lowerPageOffset , word memoryRemap::upperPageOffset)
byte~ memoryRemap::$0 reg byte a 202.0
byte~ memoryRemap::$1 zp[1]:13 67.33333333333333
byte~ memoryRemap::$1 zp[1]:20 67.33333333333333
byte~ memoryRemap::$2 reg byte a 202.0
byte~ memoryRemap::$3 reg byte a 202.0
byte~ memoryRemap::$4 reg byte a 202.0
byte~ memoryRemap::$5 reg byte a 202.0
byte~ memoryRemap::$6 zp[1]:6 67.33333333333333
byte~ memoryRemap::$6 zp[1]:9 67.33333333333333
byte~ memoryRemap::$7 reg byte a 202.0
byte~ memoryRemap::$8 reg byte a 202.0
byte~ memoryRemap::$9 reg byte a 202.0
const byte* memoryRemap::aVal = (byte*) 252
volatile byte memoryRemap::aVal loadstore zp[1]:6 7.769230769230769
word memoryRemap::lowerPageOffset
word memoryRemap::lowerPageOffset#0 lowerPageOffset zp[2]:11 11.0
word memoryRemap::lowerPageOffset#2 lowerPageOffset zp[2]:11 53.25
word memoryRemap::lowerPageOffset#0 lowerPageOffset zp[2]:17 11.0
word memoryRemap::lowerPageOffset#2 lowerPageOffset zp[2]:17 53.25
byte memoryRemap::remapBlocks
byte memoryRemap::remapBlocks#0 reg byte z 7.333333333333333
byte memoryRemap::remapBlocks#2 reg byte z 21.299999999999997
word memoryRemap::upperPageOffset
word memoryRemap::upperPageOffset#0 upperPageOffset zp[2]:14 22.0
word memoryRemap::upperPageOffset#2 upperPageOffset zp[2]:14 19.363636363636363
const byte* memoryRemap::xVal = (byte*) 253
const byte* memoryRemap::yVal = (byte*) 254
const byte* memoryRemap::zVal = (byte*) 255
word memoryRemap::upperPageOffset#0 upperPageOffset zp[2]:21 22.0
word memoryRemap::upperPageOffset#2 upperPageOffset zp[2]:21 19.363636363636363
volatile byte memoryRemap::xVal loadstore zp[1]:7 12.625
volatile byte memoryRemap::yVal loadstore zp[1]:8 16.833333333333332
volatile byte memoryRemap::zVal loadstore zp[1]:10 101.0
void memoryRemap256M(byte memoryRemap256M::remapBlocks , dword memoryRemap256M::lowerPageOffset , dword memoryRemap256M::upperPageOffset)
dword~ memoryRemap256M::$0 zp[4]:7 11.0
dword~ memoryRemap256M::$0 zp[4]:11 11.0
byte~ memoryRemap256M::$1 reg byte a 22.0
byte~ memoryRemap256M::$10 reg byte a 22.0
byte~ memoryRemap256M::$13 reg byte a 22.0
byte~ memoryRemap256M::$17 reg byte a 22.0
word~ memoryRemap256M::$4 zp[2]:11 22.0
word~ memoryRemap256M::$4 zp[2]:17 22.0
byte~ memoryRemap256M::$5 reg byte a 22.0
byte~ memoryRemap256M::$6 zp[1]:13 5.5
word~ memoryRemap256M::$7 zp[2]:14 22.0
byte~ memoryRemap256M::$6 zp[1]:20 5.5
word~ memoryRemap256M::$7 zp[2]:21 22.0
byte~ memoryRemap256M::$8 reg byte a 22.0
byte~ memoryRemap256M::$9 reg byte a 22.0
const byte* memoryRemap256M::aVal = (byte*) 252
const byte* memoryRemap256M::lMb = (byte*) 250
volatile byte memoryRemap256M::aVal loadstore zp[1]:19 1.0
volatile byte memoryRemap256M::lMb loadstore zp[1]:15 0.7333333333333333
dword memoryRemap256M::lowerPageOffset
dword memoryRemap256M::lowerPageOffset#2 lowerPageOffset zp[4]:2 3.666666666666667
byte memoryRemap256M::remapBlocks
byte memoryRemap256M::remapBlocks#2 reg byte z 1.4666666666666666
const byte* memoryRemap256M::uMb = (byte*) 251
volatile byte memoryRemap256M::uMb loadstore zp[1]:16 0.7857142857142857
dword memoryRemap256M::upperPageOffset
const byte* memoryRemap256M::xVal = (byte*) 253
const byte* memoryRemap256M::yVal = (byte*) 254
const byte* memoryRemap256M::zVal = (byte*) 255
volatile byte memoryRemap256M::xVal loadstore zp[1]:23 2.2
volatile byte memoryRemap256M::yVal loadstore zp[1]:24 2.75
volatile byte memoryRemap256M::zVal loadstore zp[1]:25 11.0
void memoryRemapBlock(byte memoryRemapBlock::blockPage , word memoryRemapBlock::memoryPage)
byte memoryRemapBlock::block
byte memoryRemapBlock::block#0 reg byte a 22.0
@ -66,7 +67,7 @@ byte memoryRemapBlock::blockPage
byte memoryRemapBlock::blockPage#2 reg byte x 11.0
word memoryRemapBlock::memoryPage
word memoryRemapBlock::pageOffset
word memoryRemapBlock::pageOffset#0 pageOffset zp[2]:11 6.6000000000000005
word memoryRemapBlock::pageOffset#0 pageOffset zp[2]:17 6.6000000000000005
reg byte x [ main::i#2 main::i#1 ]
reg byte x [ main::i1#2 main::i1#1 ]
@ -78,21 +79,32 @@ reg byte a [ main::$7 ]
reg byte a [ memoryRemapBlock::block#0 ]
reg byte a [ memoryRemapBlock::blockBits#0 ]
reg byte a [ memoryRemap::$0 ]
zp[1]:6 [ memoryRemap::aVal ]
reg byte a [ memoryRemap::$2 ]
reg byte a [ memoryRemap::$3 ]
reg byte a [ memoryRemap::$4 ]
zp[1]:7 [ memoryRemap::xVal ]
reg byte a [ memoryRemap::$5 ]
zp[1]:6 [ memoryRemap::$6 ]
zp[1]:8 [ memoryRemap::yVal ]
zp[1]:9 [ memoryRemap::$6 ]
reg byte a [ memoryRemap::$7 ]
reg byte a [ memoryRemap::$8 ]
reg byte a [ memoryRemap::$9 ]
zp[4]:7 [ memoryRemap256M::$0 ]
zp[1]:10 [ memoryRemap::zVal ]
zp[4]:11 [ memoryRemap256M::$0 ]
reg byte a [ memoryRemap256M::$1 ]
zp[2]:11 [ memoryRemap256M::$4 memoryRemap::lowerPageOffset#2 memoryRemap::lowerPageOffset#0 memoryRemapBlock::pageOffset#0 ]
zp[1]:15 [ memoryRemap256M::lMb ]
zp[1]:16 [ memoryRemap256M::uMb ]
zp[2]:17 [ memoryRemap256M::$4 memoryRemap::lowerPageOffset#2 memoryRemap::lowerPageOffset#0 memoryRemapBlock::pageOffset#0 ]
reg byte a [ memoryRemap256M::$5 ]
zp[1]:13 [ memoryRemap256M::$6 memoryRemap::$1 ]
zp[2]:14 [ memoryRemap256M::$7 memoryRemap::upperPageOffset#2 memoryRemap::upperPageOffset#0 ]
zp[1]:19 [ memoryRemap256M::aVal ]
zp[1]:20 [ memoryRemap256M::$6 memoryRemap::$1 ]
zp[2]:21 [ memoryRemap256M::$7 memoryRemap::upperPageOffset#2 memoryRemap::upperPageOffset#0 ]
reg byte a [ memoryRemap256M::$8 ]
reg byte a [ memoryRemap256M::$9 ]
reg byte a [ memoryRemap256M::$10 ]
zp[1]:23 [ memoryRemap256M::xVal ]
zp[1]:24 [ memoryRemap256M::yVal ]
reg byte a [ memoryRemap256M::$13 ]
reg byte a [ memoryRemap256M::$17 ]
zp[1]:25 [ memoryRemap256M::zVal ]

View File

@ -12,6 +12,16 @@ Resolved forward reference SCROLL_TEXT to SCROLL_TEXT
Fixing struct type size struct F018_DMAGIC to 17
Fixing struct type SIZE_OF struct F018_DMAGIC to 17
Fixing struct type SIZE_OF struct F018_DMAGIC to 17
Setting inferred volatile on symbol affected by address-of: memoryRemap::aVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::xVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::yVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::zVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::lMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::uMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::aVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::xVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::yVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::zVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx
Inlined call call __init

View File

@ -1,6 +1,16 @@
Fixing struct type size struct F018_DMAGIC to 17
Fixing struct type SIZE_OF struct F018_DMAGIC to 17
Fixing struct type SIZE_OF struct F018_DMAGIC to 17
Setting inferred volatile on symbol affected by address-of: memoryRemap::aVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::xVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::yVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap::zVal in asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::lMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::uMb in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::aVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::xVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::yVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Setting inferred volatile on symbol affected by address-of: memoryRemap256M::zVal in asm { ldalMb ldx#$0f ldyuMb ldz#$00 map ldaaVal ldxxVal ldyyVal ldzzVal map eom }
Inlined call vicSelectGfxBank::$0 = call toDd00 vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA

View File

@ -1,9 +1,8 @@
Inlined call call __init
CONTROL FLOW GRAPH SSA
void main()
main: scope:[main] from __start::@1
main: scope:[main] from __start
main::i#0 = 0
to:main::@1
main::@1: scope:[main] from main main::@1
@ -19,20 +18,16 @@ main::@return: scope:[main] from main::@1
void __start()
__start: scope:[__start] from
to:__start::__init1
__start::__init1: scope:[__start] from __start
to:__start::@1
__start::@1: scope:[__start] from __start::__init1
call main
to:__start::@2
__start::@2: scope:[__start] from __start::@1
to:__start::@1
__start::@1: scope:[__start] from __start
to:__start::@return
__start::@return: scope:[__start] from __start::@2
__start::@return: scope:[__start] from __start::@1
return
to:@return
SYMBOL TABLE SSA
const byte* SCREEN = (byte*)$400
const nomodify byte* SCREEN = (byte*)$400
void __start()
void main()
bool~ main::$0
@ -51,9 +46,7 @@ Resolved ranged next value [3] main::i#1 = ++ main::i#2 to ++
Resolved ranged comparison value [5] if(main::i#1!=rangelast(0,3)) goto main::@1 to 4
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::__init1
Removing unused procedure block __start::@1
Removing unused procedure block __start::@2
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Adding number conversion cast (unumber) 4 in [3] if(main::i#1!=4) goto main::@1
@ -173,7 +166,7 @@ Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
FINAL SYMBOL TABLE
const byte* SCREEN = (byte*) 1024
const nomodify byte* SCREEN = (byte*) 1024
void main()
byte main::i
byte main::i#1 reg byte x 16.5

View File

@ -1,4 +1,4 @@
const byte* SCREEN = (byte*) 1024
const nomodify byte* SCREEN = (byte*) 1024
void main()
byte main::i
byte main::i#1 reg byte x 16.5

View File

@ -0,0 +1,43 @@
// Demonstrates inline ASM using a variable (res)
// Commodore 64 PRG executable file
.file [name="inline-asm-uses-1.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.label CHKIN = $1000
.label GETIN = $1003
.label CLRCHN = $1006
.segment Code
main: {
.label SCREEN = $1009
// fgetc(7)
lda #7
sta.z fgetc.channel
jsr fgetc
// x = fgetc(7)
// *SCREEN = x
sta SCREEN
// }
rts
}
// fgetc(byte zp(2) channel)
fgetc: {
.label channel = 2
.label ret = 3
// ret
lda #0
sta.z ret
// asm
ldx channel
jsr CHKIN
jsr GETIN
sta ret
jsr CLRCHN
// return ret;
lda.z ret
// }
rts
}

View File

@ -0,0 +1,25 @@
void main()
main: scope:[main] from
[0] fgetc::channel = 7
[1] call fgetc
[2] fgetc::return#0 = fgetc::return#2
to:main::@1
main::@1: scope:[main] from main
[3] main::x#0 = fgetc::return#0
[4] *main::SCREEN = main::x#0
to:main::@return
main::@return: scope:[main] from main::@1
[5] return
to:@return
byte fgetc(volatile byte fgetc::channel)
fgetc: scope:[fgetc] from main
[6] fgetc::ret = 0
asm { ldxchannel jsrCHKIN jsrGETIN staret jsrCLRCHN }
[8] fgetc::return#1 = fgetc::ret
to:fgetc::@return
fgetc::@return: scope:[fgetc] from fgetc
[9] fgetc::return#2 = fgetc::return#1
[10] return
to:@return

View File

@ -0,0 +1,345 @@
Setting inferred volatile on symbol affected by address-of: fgetc::channel in asm { ldxchannel jsrCHKIN jsrGETIN staret jsrCLRCHN }
Setting inferred volatile on symbol affected by address-of: fgetc::ret in asm { ldxchannel jsrCHKIN jsrGETIN staret jsrCLRCHN }
CONTROL FLOW GRAPH SSA
void main()
main: scope:[main] from __start
fgetc::channel = 7
call fgetc
fgetc::return#0 = fgetc::return#2
to:main::@1
main::@1: scope:[main] from main
fgetc::return#3 = phi( main/fgetc::return#0 )
main::$0 = fgetc::return#3
main::x#0 = main::$0
*main::SCREEN = main::x#0
to:main::@return
main::@return: scope:[main] from main::@1
return
to:@return
byte fgetc(volatile byte fgetc::channel)
fgetc: scope:[fgetc] from main
fgetc::ret = 0
asm { ldxchannel jsrCHKIN jsrGETIN staret jsrCLRCHN }
fgetc::return#1 = fgetc::ret
to:fgetc::@return
fgetc::@return: scope:[fgetc] from fgetc
fgetc::return#4 = phi( fgetc/fgetc::return#1 )
fgetc::return#2 = fgetc::return#4
return
to:@return
void __start()
__start: scope:[__start] from
call main
to:__start::@1
__start::@1: scope:[__start] from __start
to:__start::@return
__start::@return: scope:[__start] from __start::@1
return
to:@return
SYMBOL TABLE SSA
const nomodify byte* CHKIN = (byte*)$1000
const nomodify byte* CLRCHN = (byte*)$1006
const nomodify byte* GETIN = (byte*)$1003
void __start()
byte fgetc(volatile byte fgetc::channel)
volatile byte fgetc::channel loadstore
volatile byte fgetc::ret loadstore
byte fgetc::return
byte fgetc::return#0
byte fgetc::return#1
byte fgetc::return#2
byte fgetc::return#3
byte fgetc::return#4
void main()
byte~ main::$0
const nomodify byte* main::SCREEN = (byte*)$1009
byte main::x
byte main::x#0
Adding number conversion cast (unumber) 7 in fgetc::channel = 7
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast fgetc::channel = (unumber)7
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 4105
Simplifying constant pointer cast (byte*) 4096
Simplifying constant pointer cast (byte*) 4099
Simplifying constant pointer cast (byte*) 4102
Simplifying constant integer cast 7
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 7
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias candidate removed (volatile)fgetc::return#1 = fgetc::ret fgetc::return#4 fgetc::return#2
Alias fgetc::return#0 = fgetc::return#3
Alias main::x#0 = main::$0
Successful SSA optimization Pass2AliasElimination
Alias candidate removed (volatile)fgetc::return#1 = fgetc::ret fgetc::return#4 fgetc::return#2
Identical Phi Values fgetc::return#4 fgetc::return#1
Successful SSA optimization Pass2IdenticalPhiElimination
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Alias candidate removed (volatile)fgetc::return#1 = fgetc::ret fgetc::return#2
Alias candidate removed (volatile)fgetc::return#1 = fgetc::ret fgetc::return#2
Alias candidate removed (volatile)fgetc::return#1 = fgetc::ret fgetc::return#2
CALL GRAPH
Calls in [main] to fgetc:1
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
FINAL CONTROL FLOW GRAPH
void main()
main: scope:[main] from
[0] fgetc::channel = 7
[1] call fgetc
[2] fgetc::return#0 = fgetc::return#2
to:main::@1
main::@1: scope:[main] from main
[3] main::x#0 = fgetc::return#0
[4] *main::SCREEN = main::x#0
to:main::@return
main::@return: scope:[main] from main::@1
[5] return
to:@return
byte fgetc(volatile byte fgetc::channel)
fgetc: scope:[fgetc] from main
[6] fgetc::ret = 0
asm { ldxchannel jsrCHKIN jsrGETIN staret jsrCLRCHN }
[8] fgetc::return#1 = fgetc::ret
to:fgetc::@return
fgetc::@return: scope:[fgetc] from fgetc
[9] fgetc::return#2 = fgetc::return#1
[10] return
to:@return
VARIABLE REGISTER WEIGHTS
byte fgetc(volatile byte fgetc::channel)
volatile byte fgetc::channel loadstore 1.0
volatile byte fgetc::ret loadstore 11.0
byte fgetc::return
byte fgetc::return#0 4.0
byte fgetc::return#1 22.0
byte fgetc::return#2 4.333333333333333
void main()
byte main::x
byte main::x#0 4.0
Initial phi equivalence classes
Added variable fgetc::channel to live range equivalence class [ fgetc::channel ]
Added variable fgetc::return#0 to live range equivalence class [ fgetc::return#0 ]
Added variable main::x#0 to live range equivalence class [ main::x#0 ]
Added variable fgetc::ret to live range equivalence class [ fgetc::ret ]
Added variable fgetc::return#1 to live range equivalence class [ fgetc::return#1 ]
Added variable fgetc::return#2 to live range equivalence class [ fgetc::return#2 ]
Complete equivalence classes
[ fgetc::channel ]
[ fgetc::return#0 ]
[ main::x#0 ]
[ fgetc::ret ]
[ fgetc::return#1 ]
[ fgetc::return#2 ]
Allocated zp[1]:2 [ fgetc::channel ]
Allocated zp[1]:3 [ fgetc::return#0 ]
Allocated zp[1]:4 [ main::x#0 ]
Allocated zp[1]:5 [ fgetc::ret ]
Allocated zp[1]:6 [ fgetc::return#1 ]
Allocated zp[1]:7 [ fgetc::return#2 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] fgetc::channel = 7 [ fgetc::channel ] ( [ fgetc::channel ] { { fgetc::return#0 = fgetc::return#2 } } ) always clobbers reg byte a
Statement [6] fgetc::ret = 0 [ fgetc::channel fgetc::ret ] ( fgetc:1 [ fgetc::channel fgetc::ret ] { { fgetc::return#0 = fgetc::return#2 } } ) always clobbers reg byte a
Statement asm { ldxchannel jsrCHKIN jsrGETIN staret jsrCLRCHN } always clobbers reg byte a reg byte x reg byte y
Potential registers zp[1]:2 [ fgetc::channel ] : zp[1]:2 ,
Potential registers zp[1]:3 [ fgetc::return#0 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:4 [ main::x#0 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:5 [ fgetc::ret ] : zp[1]:5 ,
Potential registers zp[1]:6 [ fgetc::return#1 ] : zp[1]:6 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:7 [ fgetc::return#2 ] : zp[1]:7 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [fgetc] 22: zp[1]:6 [ fgetc::return#1 ] 11: zp[1]:5 [ fgetc::ret ] 4.33: zp[1]:7 [ fgetc::return#2 ] 4: zp[1]:3 [ fgetc::return#0 ] 1: zp[1]:2 [ fgetc::channel ]
Uplift Scope [main] 4: zp[1]:4 [ main::x#0 ]
Uplift Scope []
Uplifting [fgetc] best 76 combination reg byte a [ fgetc::return#1 ] zp[1]:5 [ fgetc::ret ] reg byte a [ fgetc::return#2 ] reg byte a [ fgetc::return#0 ] zp[1]:2 [ fgetc::channel ]
Uplifting [main] best 70 combination reg byte a [ main::x#0 ]
Uplifting [] best 70 combination
Attempting to uplift remaining variables inzp[1]:5 [ fgetc::ret ]
Uplifting [fgetc] best 70 combination zp[1]:5 [ fgetc::ret ]
Attempting to uplift remaining variables inzp[1]:2 [ fgetc::channel ]
Uplifting [fgetc] best 70 combination zp[1]:2 [ fgetc::channel ]
Allocated (was zp[1]:5) zp[1]:3 [ fgetc::ret ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Demonstrates inline ASM using a variable (res)
// Upstart
// Commodore 64 PRG executable file
.file [name="inline-asm-uses-1.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
// Global Constants & labels
.label CHKIN = $1000
.label GETIN = $1003
.label CLRCHN = $1006
.segment Code
// main
main: {
.label SCREEN = $1009
// [0] fgetc::channel = 7 -- vbuz1=vbuc1
lda #7
sta.z fgetc.channel
// [1] call fgetc
jsr fgetc
// [2] fgetc::return#0 = fgetc::return#2
jmp __b1
// main::@1
__b1:
// [3] main::x#0 = fgetc::return#0
// [4] *main::SCREEN = main::x#0 -- _deref_pbuc1=vbuaa
sta SCREEN
jmp __breturn
// main::@return
__breturn:
// [5] return
rts
}
// fgetc
// fgetc(byte zp(2) channel)
fgetc: {
.label channel = 2
.label ret = 3
// [6] fgetc::ret = 0 -- vbuz1=vbuc1
lda #0
sta.z ret
// asm { ldxchannel jsrCHKIN jsrGETIN staret jsrCLRCHN }
ldx channel
jsr CHKIN
jsr GETIN
sta ret
jsr CLRCHN
// [8] fgetc::return#1 = fgetc::ret -- vbuaa=vbuz1
lda.z ret
jmp __breturn
// fgetc::@return
__breturn:
// [9] fgetc::return#2 = fgetc::return#1
// [10] return
rts
}
// File Data
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __b1:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
const nomodify byte* CHKIN = (byte*) 4096
const nomodify byte* CLRCHN = (byte*) 4102
const nomodify byte* GETIN = (byte*) 4099
byte fgetc(volatile byte fgetc::channel)
volatile byte fgetc::channel loadstore zp[1]:2 1.0
volatile byte fgetc::ret loadstore zp[1]:3 11.0
byte fgetc::return
byte fgetc::return#0 reg byte a 4.0
byte fgetc::return#1 reg byte a 22.0
byte fgetc::return#2 reg byte a 4.333333333333333
void main()
const nomodify byte* main::SCREEN = (byte*) 4105
byte main::x
byte main::x#0 reg byte a 4.0
zp[1]:2 [ fgetc::channel ]
reg byte a [ fgetc::return#0 ]
reg byte a [ main::x#0 ]
zp[1]:3 [ fgetc::ret ]
reg byte a [ fgetc::return#1 ]
reg byte a [ fgetc::return#2 ]
FINAL ASSEMBLER
Score: 61
// File Comments
// Demonstrates inline ASM using a variable (res)
// Upstart
// Commodore 64 PRG executable file
.file [name="inline-asm-uses-1.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
// Global Constants & labels
.label CHKIN = $1000
.label GETIN = $1003
.label CLRCHN = $1006
.segment Code
// main
main: {
.label SCREEN = $1009
// fgetc(7)
// [0] fgetc::channel = 7 -- vbuz1=vbuc1
lda #7
sta.z fgetc.channel
// [1] call fgetc
jsr fgetc
// [2] fgetc::return#0 = fgetc::return#2
// main::@1
// x = fgetc(7)
// [3] main::x#0 = fgetc::return#0
// *SCREEN = x
// [4] *main::SCREEN = main::x#0 -- _deref_pbuc1=vbuaa
sta SCREEN
// main::@return
// }
// [5] return
rts
}
// fgetc
// fgetc(byte zp(2) channel)
fgetc: {
.label channel = 2
.label ret = 3
// ret
// [6] fgetc::ret = 0 -- vbuz1=vbuc1
lda #0
sta.z ret
// asm
// asm { ldxchannel jsrCHKIN jsrGETIN staret jsrCLRCHN }
ldx channel
jsr CHKIN
jsr GETIN
sta ret
jsr CLRCHN
// return ret;
// [8] fgetc::return#1 = fgetc::ret -- vbuaa=vbuz1
lda.z ret
// fgetc::@return
// }
// [9] fgetc::return#2 = fgetc::return#1
// [10] return
rts
}
// File Data

View File

@ -0,0 +1,21 @@
const nomodify byte* CHKIN = (byte*) 4096
const nomodify byte* CLRCHN = (byte*) 4102
const nomodify byte* GETIN = (byte*) 4099
byte fgetc(volatile byte fgetc::channel)
volatile byte fgetc::channel loadstore zp[1]:2 1.0
volatile byte fgetc::ret loadstore zp[1]:3 11.0
byte fgetc::return
byte fgetc::return#0 reg byte a 4.0
byte fgetc::return#1 reg byte a 22.0
byte fgetc::return#2 reg byte a 4.333333333333333
void main()
const nomodify byte* main::SCREEN = (byte*) 4105
byte main::x
byte main::x#0 reg byte a 4.0
zp[1]:2 [ fgetc::channel ]
reg byte a [ fgetc::return#0 ]
reg byte a [ main::x#0 ]
zp[1]:3 [ fgetc::ret ]
reg byte a [ fgetc::return#1 ]
reg byte a [ fgetc::return#2 ]

View File

@ -1,9 +1,8 @@
Inlined call call __init
CONTROL FLOW GRAPH SSA
void main()
main: scope:[main] from __start::@1
main: scope:[main] from __start
main::k#0 = 0
to:main::@1
main::@1: scope:[main] from main main::@5
@ -46,20 +45,16 @@ main::@return: scope:[main] from main::@5
void __start()
__start: scope:[__start] from
to:__start::__init1
__start::__init1: scope:[__start] from __start
to:__start::@1
__start::@1: scope:[__start] from __start::__init1
call main
to:__start::@2
__start::@2: scope:[__start] from __start::@1
to:__start::@1
__start::@1: scope:[__start] from __start
to:__start::@return
__start::@return: scope:[__start] from __start::@2
__start::@return: scope:[__start] from __start::@1
return
to:@return
SYMBOL TABLE SSA
const byte* SCREEN = (byte*)$400
const nomodify byte* SCREEN = (byte*)$400
void __start()
void main()
bool~ main::$0
@ -110,9 +105,7 @@ Resolved ranged next value [13] main::k#1 = ++ main::k#6 to ++
Resolved ranged comparison value [15] if(main::k#1!=rangelast(0,$a)) goto main::@1 to $b
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::__init1
Removing unused procedure block __start::@1
Removing unused procedure block __start::@2
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Adding number conversion cast (unumber) $b in [5] if(main::m#1!=$b) goto main::@3
@ -357,7 +350,7 @@ Removing instruction lda #$b
Succesful ASM optimization Pass5UnnecesaryLoadElimination
FINAL SYMBOL TABLE
const byte* SCREEN = (byte*) 1024
const nomodify byte* SCREEN = (byte*) 1024
void main()
byte main::k
byte main::k#1 k zp[1]:2 16.5

View File

@ -1,4 +1,4 @@
const byte* SCREEN = (byte*) 1024
const nomodify byte* SCREEN = (byte*) 1024
void main()
byte main::k
byte main::k#1 k zp[1]:2 16.5

View File

@ -9,7 +9,7 @@
:BasicUpstart(main)
.segment Code
main: {
.const long_ptr_zp = <long_ptr
.const long_ptr_zp = long_ptr
.label long_ptr = 2
// long_ptr = 0x12345678
lda #<$12345678

View File

@ -1,4 +1,4 @@
Setting inferred volatile on symbol affected by address-of main::long_ptr_zp = <&main::long_ptr
Setting inferred volatile on symbol affected by address-of main::long_ptr
CONTROL FLOW GRAPH SSA
@ -25,7 +25,7 @@ SYMBOL TABLE SSA
void __start()
void main()
volatile dword main::long_ptr loadstore
const byte main::long_ptr_zp = <&main::long_ptr
const nomodify byte main::long_ptr_zp = (byte)&main::long_ptr
Removing unused procedure __start
Removing unused procedure block __start
@ -86,7 +86,7 @@ ASSEMBLER BEFORE OPTIMIZATION
.segment Code
// main
main: {
.const long_ptr_zp = <long_ptr
.const long_ptr_zp = long_ptr
.label long_ptr = 2
// [0] main::long_ptr = $12345678 -- vduz1=vduc1
lda #<$12345678
@ -118,7 +118,7 @@ Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
void main()
volatile dword main::long_ptr loadstore zp[4]:2 20.0
const byte main::long_ptr_zp = <&main::long_ptr
const nomodify byte main::long_ptr_zp = (byte)&main::long_ptr
zp[4]:2 [ main::long_ptr ]
@ -141,7 +141,7 @@ Score: 36
.segment Code
// main
main: {
.const long_ptr_zp = <long_ptr
.const long_ptr_zp = long_ptr
.label long_ptr = 2
// long_ptr = 0x12345678
// [0] main::long_ptr = $12345678 -- vduz1=vduc1

View File

@ -1,5 +1,5 @@
void main()
volatile dword main::long_ptr loadstore zp[4]:2 20.0
const byte main::long_ptr_zp = <&main::long_ptr
const nomodify byte main::long_ptr_zp = (byte)&main::long_ptr
zp[4]:2 [ main::long_ptr ]

View File

@ -1,29 +0,0 @@
// Tests creating a long (32bit) pointer on zeropage for 45GS02 flat memory access
// Commodore 64 PRG executable file
.file [name="long-pointer-1.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.segment Code
main: {
.const long_ptr_zp = long_ptr
.label long_ptr = 2
// long_ptr = 0x12345678
lda #<$12345678
sta.z long_ptr
lda #>$12345678
sta.z long_ptr+1
lda #<$12345678>>$10
sta.z long_ptr+2
lda #>$12345678>>$10
sta.z long_ptr+3
// asm
nop
lda (long_ptr_zp),y
sta.z $ff
// }
rts
}

View File

@ -1,9 +0,0 @@
void main()
main: scope:[main] from
[0] main::long_ptr = $12345678
asm { nop lda(long_ptr_zp),y sta$ff }
to:main::@return
main::@return: scope:[main] from main
[2] return
to:@return

View File

@ -1,167 +0,0 @@
Setting inferred volatile on symbol affected by address-of main::long_ptr_zp = (byte)&main::long_ptr
CONTROL FLOW GRAPH SSA
void main()
main: scope:[main] from __start
main::long_ptr = $12345678
asm { nop lda(long_ptr_zp),y sta$ff }
to:main::@return
main::@return: scope:[main] from main
return
to:@return
void __start()
__start: scope:[__start] from
call main
to:__start::@1
__start::@1: scope:[__start] from __start
to:__start::@return
__start::@return: scope:[__start] from __start::@1
return
to:@return
SYMBOL TABLE SSA
void __start()
void main()
volatile dword main::long_ptr loadstore
const byte main::long_ptr_zp = (byte)&main::long_ptr
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
CALL GRAPH
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
FINAL CONTROL FLOW GRAPH
void main()
main: scope:[main] from
[0] main::long_ptr = $12345678
asm { nop lda(long_ptr_zp),y sta$ff }
to:main::@return
main::@return: scope:[main] from main
[2] return
to:@return
VARIABLE REGISTER WEIGHTS
void main()
volatile dword main::long_ptr loadstore 20.0
Initial phi equivalence classes
Added variable main::long_ptr to live range equivalence class [ main::long_ptr ]
Complete equivalence classes
[ main::long_ptr ]
Allocated zp[4]:2 [ main::long_ptr ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] main::long_ptr = $12345678 [ ] ( [ ] { } ) always clobbers reg byte a
Statement asm { nop lda(long_ptr_zp),y sta$ff } always clobbers reg byte a
Potential registers zp[4]:2 [ main::long_ptr ] : zp[4]:2 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp[4]:2 [ main::long_ptr ]
Uplift Scope []
Uplifting [main] best 39 combination zp[4]:2 [ main::long_ptr ]
Uplifting [] best 39 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Tests creating a long (32bit) pointer on zeropage for 45GS02 flat memory access
// Upstart
// Commodore 64 PRG executable file
.file [name="long-pointer-1.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
// Global Constants & labels
.segment Code
// main
main: {
.const long_ptr_zp = long_ptr
.label long_ptr = 2
// [0] main::long_ptr = $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z long_ptr
lda #>$12345678
sta.z long_ptr+1
lda #<$12345678>>$10
sta.z long_ptr+2
lda #>$12345678>>$10
sta.z long_ptr+3
// asm { nop lda(long_ptr_zp),y sta$ff }
nop
lda (long_ptr_zp),y
sta.z $ff
jmp __breturn
// main::@return
__breturn:
// [2] return
rts
}
// File Data
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
void main()
volatile dword main::long_ptr loadstore zp[4]:2 20.0
const byte main::long_ptr_zp = (byte)&main::long_ptr
zp[4]:2 [ main::long_ptr ]
FINAL ASSEMBLER
Score: 36
// File Comments
// Tests creating a long (32bit) pointer on zeropage for 45GS02 flat memory access
// Upstart
// Commodore 64 PRG executable file
.file [name="long-pointer-1.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
// Global Constants & labels
.segment Code
// main
main: {
.const long_ptr_zp = long_ptr
.label long_ptr = 2
// long_ptr = 0x12345678
// [0] main::long_ptr = $12345678 -- vduz1=vduc1
lda #<$12345678
sta.z long_ptr
lda #>$12345678
sta.z long_ptr+1
lda #<$12345678>>$10
sta.z long_ptr+2
lda #>$12345678>>$10
sta.z long_ptr+3
// asm
// asm { nop lda(long_ptr_zp),y sta$ff }
nop
lda (long_ptr_zp),y
sta.z $ff
// main::@return
// }
// [2] return
rts
}
// File Data

View File

@ -1,5 +0,0 @@
void main()
volatile dword main::long_ptr loadstore zp[4]:2 20.0
const byte main::long_ptr_zp = (byte)&main::long_ptr
zp[4]:2 [ main::long_ptr ]