From b11256030cb809eba9ded4e968bcec797fa30c99 Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Sun, 17 Jan 2021 13:01:07 +0100 Subject: [PATCH] Fixed test data. --- src/test/ref/examples/c64/3d/perspective.asm | 54 +- src/test/ref/examples/c64/3d/perspective.cfg | 72 +- src/test/ref/examples/c64/3d/perspective.log | 744 ++++++++++--------- src/test/ref/examples/c64/3d/perspective.sym | 26 +- 4 files changed, 460 insertions(+), 436 deletions(-) diff --git a/src/test/ref/examples/c64/3d/perspective.asm b/src/test/ref/examples/c64/3d/perspective.asm index 8aecabbd5..0114d35e4 100644 --- a/src/test/ref/examples/c64/3d/perspective.asm +++ b/src/test/ref/examples/c64/3d/perspective.asm @@ -180,18 +180,18 @@ do_perspective: { jsr print_str // perspective(x, y, z) jsr perspective - // print_schar(xr) + // print_uchar((char)xr) ldx.z xr - jsr print_schar + jsr print_uchar // print_str(",") lda #str1 sta.z print_str.str+1 jsr print_str - // print_schar(yr) + // print_uchar((char)yr) ldx.z yr - jsr print_schar + jsr print_uchar // print_str(")") lda #>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 #>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. diff --git a/src/test/ref/examples/c64/3d/perspective.cfg b/src/test/ref/examples/c64/3d/perspective.cfg index 52c4a0580..6954fb47c 100644 --- a/src/test/ref/examples/c64/3d/perspective.cfg +++ b/src/test/ref/examples/c64/3d/perspective.cfg @@ -107,16 +107,16 @@ do_perspective::@7: scope:[do_perspective] from do_perspective::@6 [53] call perspective to:do_perspective::@8 do_perspective::@8: scope:[do_perspective] from do_perspective::@7 - [54] print_schar::b#4 = xr - [55] call print_schar + [54] print_uchar::b#1 = (byte)xr + [55] call print_uchar to:do_perspective::@9 do_perspective::@9: scope:[do_perspective] from do_perspective::@8 [56] phi() [57] call print_str to:do_perspective::@10 do_perspective::@10: scope:[do_perspective] from do_perspective::@9 - [58] print_schar::b#5 = yr - [59] call print_schar + [58] print_uchar::b#2 = (byte)yr + [59] call print_uchar to:do_perspective::@11 do_perspective::@11: scope:[do_perspective] from do_perspective::@10 [60] phi() @@ -168,17 +168,17 @@ print_str::@3: scope:[print_str] from print_str::@2 to:print_str::@1 void print_schar(signed byte print_schar::b) -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 +print_schar: scope:[print_schar] from do_perspective::@1 do_perspective::@3 do_perspective::@5 + [78] 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 ) + [79] if(print_schar::b#4<0) goto print_schar::@1 to:print_schar::@3 print_schar::@3: scope:[print_schar] from print_schar [80] phi() [81] call print_char to:print_schar::@2 print_schar::@2: scope:[print_schar] from print_schar::@3 print_schar::@4 - [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 + [82] print_schar::b#6 = phi( print_schar::@4/print_schar::b#0, print_schar::@3/print_schar::b#4 ) + [83] print_uchar::b#0 = (byte)print_schar::b#6 [84] call print_uchar to:print_schar::@return print_schar::@return: scope:[print_schar] from print_schar::@2 @@ -189,7 +189,7 @@ print_schar::@1: scope:[print_schar] from print_schar [87] call print_char to:print_schar::@4 print_schar::@4: scope:[print_schar] from print_schar::@1 - [88] print_schar::b#0 = - print_schar::b#10 + [88] print_schar::b#0 = - print_schar::b#4 to:print_schar::@2 void perspective(signed byte perspective::x , signed byte perspective::y , signed byte perspective::z) @@ -203,41 +203,43 @@ perspective::@return: scope:[perspective] from perspective [93] 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 + [94] 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 ) + [94] print_uchar::b#3 = phi( do_perspective::@10/print_uchar::b#2, do_perspective::@8/print_uchar::b#1, print_schar::@2/print_uchar::b#0 ) + [95] print_uchar::$0 = print_uchar::b#3 >> 4 + [96] print_char::ch#3 = print_hextab[print_uchar::$0] + [97] call print_char + to:print_uchar::@1 +print_uchar::@1: scope:[print_uchar] from print_uchar + [98] print_uchar::$2 = print_uchar::b#3 & $f + [99] print_char::ch#4 = print_hextab[print_uchar::$2] + [100] call print_char + to:print_uchar::@return +print_uchar::@return: scope:[print_uchar] from print_uchar::@1 + [101] return + to:@return + void print_ln() print_ln: scope:[print_ln] from do_perspective::@12 - [94] phi() + [102] phi() to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln 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> 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 + [110] return to:@return diff --git a/src/test/ref/examples/c64/3d/perspective.log b/src/test/ref/examples/c64/3d/perspective.log index 59b361530..542e75095 100644 --- a/src/test/ref/examples/c64/3d/perspective.log +++ b/src/test/ref/examples/c64/3d/perspective.log @@ -110,40 +110,40 @@ print_ln::@return: scope:[print_ln] from print_ln::@2 to:@return void print_schar(signed byte print_schar::b) -print_schar: scope:[print_schar] from do_perspective::@1 do_perspective::@10 do_perspective::@3 do_perspective::@5 do_perspective::@8 - print_char_cursor#78 = phi( do_perspective::@1/print_char_cursor#18, do_perspective::@10/print_char_cursor#26, do_perspective::@3/print_char_cursor#20, do_perspective::@5/print_char_cursor#22, do_perspective::@8/print_char_cursor#75 ) - print_schar::b#6 = phi( do_perspective::@1/print_schar::b#1, do_perspective::@10/print_schar::b#5, do_perspective::@3/print_schar::b#2, do_perspective::@5/print_schar::b#3, do_perspective::@8/print_schar::b#4 ) - print_schar::$0 = print_schar::b#6 < 0 +print_schar: scope:[print_schar] from do_perspective::@1 do_perspective::@3 do_perspective::@5 + print_char_cursor#78 = phi( do_perspective::@1/print_char_cursor#18, do_perspective::@3/print_char_cursor#20, do_perspective::@5/print_char_cursor#22 ) + print_schar::b#4 = phi( do_perspective::@1/print_schar::b#1, do_perspective::@3/print_schar::b#2, do_perspective::@5/print_schar::b#3 ) + print_schar::$0 = print_schar::b#4 < 0 if(print_schar::$0) goto print_schar::@1 to:print_schar::@3 print_schar::@1: scope:[print_schar] from print_schar - print_schar::b#9 = phi( print_schar/print_schar::b#6 ) + print_schar::b#7 = phi( print_schar/print_schar::b#4 ) print_char_cursor#69 = phi( print_schar/print_char_cursor#78 ) print_char::ch#1 = '-' call print_char to:print_schar::@4 print_schar::@4: scope:[print_schar] from print_schar::@1 - print_schar::b#7 = phi( print_schar::@1/print_schar::b#9 ) + print_schar::b#5 = phi( print_schar::@1/print_schar::b#7 ) print_char_cursor#38 = phi( print_schar::@1/print_char_cursor#12 ) print_char_cursor#4 = print_char_cursor#38 - print_schar::$4 = - print_schar::b#7 + print_schar::$4 = - print_schar::b#5 print_schar::b#0 = print_schar::$4 to:print_schar::@2 print_schar::@3: scope:[print_schar] from print_schar - print_schar::b#11 = phi( print_schar/print_schar::b#6 ) + print_schar::b#9 = phi( print_schar/print_schar::b#4 ) print_char_cursor#70 = phi( print_schar/print_char_cursor#78 ) print_char::ch#2 = ' ' call print_char to:print_schar::@5 print_schar::@5: scope:[print_schar] from print_schar::@3 - print_schar::b#10 = phi( print_schar::@3/print_schar::b#11 ) + print_schar::b#8 = phi( print_schar::@3/print_schar::b#9 ) print_char_cursor#39 = phi( print_schar::@3/print_char_cursor#12 ) print_char_cursor#5 = print_char_cursor#39 to:print_schar::@2 print_schar::@2: scope:[print_schar] from print_schar::@4 print_schar::@5 print_char_cursor#71 = phi( print_schar::@4/print_char_cursor#4, print_schar::@5/print_char_cursor#5 ) - print_schar::b#8 = phi( print_schar::@4/print_schar::b#0, print_schar::@5/print_schar::b#10 ) - print_uchar::b#0 = (byte)print_schar::b#8 + print_schar::b#6 = phi( print_schar::@4/print_schar::b#0, print_schar::@5/print_schar::b#8 ) + print_uchar::b#0 = (byte)print_schar::b#6 call print_uchar to:print_schar::@6 print_schar::@6: scope:[print_schar] from print_schar::@2 @@ -157,18 +157,18 @@ print_schar::@return: scope:[print_schar] from print_schar::@6 to:@return void print_uchar(byte print_uchar::b) -print_uchar: scope:[print_uchar] from print_schar::@2 - print_char_cursor#72 = phi( print_schar::@2/print_char_cursor#71 ) - print_uchar::b#1 = phi( print_schar::@2/print_uchar::b#0 ) - print_uchar::$0 = print_uchar::b#1 >> 4 +print_uchar: scope:[print_uchar] from do_perspective::@10 do_perspective::@8 print_schar::@2 + print_char_cursor#72 = phi( do_perspective::@10/print_char_cursor#26, do_perspective::@8/print_char_cursor#75, print_schar::@2/print_char_cursor#71 ) + print_uchar::b#3 = phi( do_perspective::@10/print_uchar::b#2, do_perspective::@8/print_uchar::b#1, print_schar::@2/print_uchar::b#0 ) + print_uchar::$0 = print_uchar::b#3 >> 4 print_char::ch#3 = print_hextab[print_uchar::$0] call print_char to:print_uchar::@1 print_uchar::@1: scope:[print_uchar] from print_uchar - print_uchar::b#2 = phi( print_uchar/print_uchar::b#1 ) + print_uchar::b#4 = phi( print_uchar/print_uchar::b#3 ) print_char_cursor#42 = phi( print_uchar/print_char_cursor#12 ) print_char_cursor#8 = print_char_cursor#42 - print_uchar::$2 = print_uchar::b#2 & $f + print_uchar::$2 = print_uchar::b#4 & $f print_char::ch#4 = print_hextab[print_uchar::$2] call print_char to:print_uchar::@2 @@ -342,12 +342,12 @@ do_perspective::@7: scope:[do_perspective] from do_perspective::@6 do_perspective::@8: scope:[do_perspective] from do_perspective::@7 print_line_cursor#31 = phi( do_perspective::@7/print_line_cursor#32 ) print_char_cursor#75 = phi( do_perspective::@7/print_char_cursor#24 ) - print_schar::b#4 = xr - call print_schar + print_uchar::b#1 = (byte)xr + call print_uchar to:do_perspective::@9 do_perspective::@9: scope:[do_perspective] from do_perspective::@8 print_line_cursor#30 = phi( do_perspective::@8/print_line_cursor#31 ) - print_char_cursor#58 = phi( do_perspective::@8/print_char_cursor#7 ) + print_char_cursor#58 = phi( do_perspective::@8/print_char_cursor#10 ) print_char_cursor#25 = print_char_cursor#58 print_str::str#5 = do_perspective::str4 call print_str @@ -356,12 +356,12 @@ do_perspective::@10: scope:[do_perspective] from do_perspective::@9 print_line_cursor#29 = phi( do_perspective::@9/print_line_cursor#30 ) print_char_cursor#59 = phi( do_perspective::@9/print_char_cursor#1 ) print_char_cursor#26 = print_char_cursor#59 - print_schar::b#5 = yr - call print_schar + print_uchar::b#2 = (byte)yr + call print_uchar to:do_perspective::@11 do_perspective::@11: scope:[do_perspective] from do_perspective::@10 print_line_cursor#28 = phi( do_perspective::@10/print_line_cursor#29 ) - print_char_cursor#60 = phi( do_perspective::@10/print_char_cursor#7 ) + print_char_cursor#60 = phi( do_perspective::@10/print_char_cursor#10 ) print_char_cursor#27 = print_char_cursor#60 print_str::str#6 = do_perspective::str5 call print_str @@ -741,8 +741,6 @@ signed byte~ print_schar::$4 signed byte print_schar::b signed byte print_schar::b#0 signed byte print_schar::b#1 -signed byte print_schar::b#10 -signed byte print_schar::b#11 signed byte print_schar::b#2 signed byte print_schar::b#3 signed byte print_schar::b#4 @@ -782,6 +780,8 @@ byte print_uchar::b byte print_uchar::b#0 byte print_uchar::b#1 byte print_uchar::b#2 +byte print_uchar::b#3 +byte print_uchar::b#4 volatile word psp1 loadstore volatile word psp2 loadstore volatile signed byte xr loadstore @@ -791,10 +791,10 @@ volatile signed byte zr loadstore Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#1 > 0 Adding number conversion cast (unumber) 0 in print_str::$1 = 0 != *print_str::str#7 Adding number conversion cast (unumber) $28 in print_ln::$0 = print_line_cursor#12 + $28 -Adding number conversion cast (snumber) 0 in print_schar::$0 = print_schar::b#6 < 0 -Adding number conversion cast (unumber) 4 in print_uchar::$0 = print_uchar::b#1 >> 4 -Adding number conversion cast (unumber) $f in print_uchar::$2 = print_uchar::b#2 & $f -Adding number conversion cast (unumber) print_uchar::$2 in print_uchar::$2 = print_uchar::b#2 & (unumber)$f +Adding number conversion cast (snumber) 0 in print_schar::$0 = print_schar::b#4 < 0 +Adding number conversion cast (unumber) 4 in print_uchar::$0 = print_uchar::b#3 >> 4 +Adding number conversion cast (unumber) $f in print_uchar::$2 = print_uchar::b#4 & $f +Adding number conversion cast (unumber) print_uchar::$2 in print_uchar::$2 = print_uchar::b#4 & (unumber)$f Adding number conversion cast (unumber) $3e8 in memset::num#0 = $3e8 Adding number conversion cast (snumber) $39 in do_perspective::x#0 = $39 Adding number conversion cast (snumber) -$47 in do_perspective::y#0 = -$47 @@ -860,7 +860,7 @@ Finalized unsigned number type (byte) 1 Finalized unsigned number type (word) $100 Finalized signed number type (signed byte) 2 Successful SSA optimization PassNFinalizeNumberTypeConversions -Inferred type updated to byte in print_uchar::$2 = print_uchar::b#2 & $f +Inferred type updated to byte in print_uchar::$2 = print_uchar::b#4 & $f Inferred type updated to byte in mulf_init::$3 = mulf_init::i#2 + 1 Inferred type updated to byte in mulf_init::$4 = mulf_init::i#2 + 1 Inferred type updated to byte in mulf_init::$5 = 1 - mulf_init::i#2 @@ -881,12 +881,12 @@ Alias print_char_cursor#1 = print_char_cursor#66 print_char_cursor#67 print_char Alias print_char_cursor#0 = print_char_cursor#34 Alias print_line_cursor#0 = print_ln::$0 print_line_cursor#13 print_char_cursor#2 print_line_cursor#14 print_char_cursor#37 print_line_cursor#1 print_char_cursor#3 Alias print_char_cursor#69 = print_char_cursor#78 print_char_cursor#70 -Alias print_schar::b#10 = print_schar::b#9 print_schar::b#6 print_schar::b#7 print_schar::b#11 +Alias print_schar::b#4 = print_schar::b#7 print_schar::b#5 print_schar::b#9 print_schar::b#8 Alias print_char_cursor#38 = print_char_cursor#4 Alias print_schar::b#0 = print_schar::$4 Alias print_char_cursor#39 = print_char_cursor#5 Alias print_char_cursor#40 = print_char_cursor#6 print_char_cursor#41 print_char_cursor#7 -Alias print_uchar::b#1 = print_uchar::b#2 +Alias print_uchar::b#3 = print_uchar::b#4 Alias print_char_cursor#42 = print_char_cursor#8 Alias print_char_cursor#10 = print_char_cursor#9 print_char_cursor#43 print_char_cursor#44 Alias print_char_cursor#11 = print_char_cursor#46 print_char_cursor#12 @@ -933,8 +933,6 @@ Identical Phi Values print_char_cursor#36 print_char_cursor#68 Identical Phi Values print_char_cursor#38 print_char_cursor#11 Identical Phi Values print_char_cursor#39 print_char_cursor#11 Identical Phi Values print_char_cursor#40 print_char_cursor#10 -Identical Phi Values print_uchar::b#1 print_uchar::b#0 -Identical Phi Values print_char_cursor#72 print_char_cursor#71 Identical Phi Values print_char_cursor#42 print_char_cursor#11 Identical Phi Values print_char_cursor#10 print_char_cursor#11 Identical Phi Values print_line_cursor#15 print_screen#5 @@ -957,9 +955,9 @@ Identical Phi Values print_char_cursor#21 print_char_cursor#40 Identical Phi Values print_char_cursor#22 print_char_cursor#1 Identical Phi Values print_char_cursor#23 print_char_cursor#40 Identical Phi Values print_char_cursor#24 print_char_cursor#1 -Identical Phi Values print_char_cursor#25 print_char_cursor#40 +Identical Phi Values print_char_cursor#25 print_char_cursor#10 Identical Phi Values print_char_cursor#26 print_char_cursor#1 -Identical Phi Values print_char_cursor#27 print_char_cursor#40 +Identical Phi Values print_char_cursor#27 print_char_cursor#10 Identical Phi Values print_char_cursor#28 print_char_cursor#1 Identical Phi Values print_line_cursor#19 print_line_cursor#0 Identical Phi Values print_char_cursor#29 print_line_cursor#0 @@ -980,7 +978,7 @@ Simple Condition memset::$1 [2] if(memset::num#0<=0) goto memset::@1 Simple Condition memset::$3 [9] if(memset::dst#2!=memset::end#0) goto memset::@4 Simple Condition print_str::$1 [16] if(0!=*print_str::str#7) goto print_str::@2 Simple Condition print_ln::$1 [26] if(print_line_cursor#0> 4 + [96] print_char::ch#3 = print_hextab[print_uchar::$0] + [97] call print_char + to:print_uchar::@1 +print_uchar::@1: scope:[print_uchar] from print_uchar + [98] print_uchar::$2 = print_uchar::b#3 & $f + [99] print_char::ch#4 = print_hextab[print_uchar::$2] + [100] call print_char + to:print_uchar::@return +print_uchar::@return: scope:[print_uchar] from print_uchar::@1 + [101] return + to:@return + void print_ln() print_ln: scope:[print_ln] from do_perspective::@12 - [94] phi() + [102] phi() to:print_ln::@1 print_ln::@1: scope:[print_ln] from print_ln 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> 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 + [110] return to:@return @@ -1472,9 +1476,10 @@ byte print_char::ch#3 20002.0 byte print_char::ch#4 20002.0 byte print_char::ch#5 130004.0 byte* print_char_cursor -byte* print_char_cursor#1 1269.4615384615383 -byte* print_char_cursor#11 4661.035714285714 +byte* print_char_cursor#1 1277.230769230769 +byte* print_char_cursor#11 4673.423076923077 byte* print_char_cursor#45 116003.5 +byte* print_char_cursor#72 3734.6666666666665 byte* print_char_cursor#77 1506.0 void print_cls() byte* print_line_cursor @@ -1484,10 +1489,8 @@ void print_ln() void print_schar(signed byte print_schar::b) signed byte print_schar::b signed byte print_schar::b#0 2002.0 -signed byte print_schar::b#10 534.1666666666667 -signed byte print_schar::b#4 202.0 -signed byte print_schar::b#5 202.0 -signed byte print_schar::b#8 2002.0 +signed byte print_schar::b#4 500.5 +signed byte print_schar::b#6 2002.0 byte* print_screen void print_str(byte* print_str::str) byte* print_str::str @@ -1498,11 +1501,14 @@ void print_uchar(byte print_uchar::b) byte~ print_uchar::$0 20002.0 byte~ print_uchar::$2 20002.0 byte print_uchar::b -byte print_uchar::b#0 5250.75 +byte print_uchar::b#0 2002.0 +byte print_uchar::b#1 202.0 +byte print_uchar::b#2 202.0 +byte print_uchar::b#3 5301.25 volatile word psp1 loadstore 0.5909090909090909 volatile word psp2 loadstore 0.6190476190476191 -volatile signed byte xr loadstore 184.0 -volatile signed byte yr loadstore 122.66666666666667 +volatile signed byte xr loadstore 167.16666666666669 +volatile signed byte yr loadstore 111.44444444444446 volatile signed byte zr loadstore 1003.0 Initial phi equivalence classes @@ -1511,10 +1517,11 @@ Initial phi equivalence classes [ mulf_init::add#2 mulf_init::add#1 ] [ memset::dst#2 memset::dst#1 ] [ print_str::str#7 print_str::str#10 print_str::str#0 ] -[ print_schar::b#8 print_schar::b#0 print_schar::b#10 print_schar::b#5 print_schar::b#4 ] +[ print_schar::b#6 print_schar::b#0 print_schar::b#4 ] +[ print_uchar::b#3 print_uchar::b#2 print_uchar::b#1 print_uchar::b#0 ] [ print_line_cursor#12 print_line_cursor#0 ] [ print_char::ch#5 print_char::ch#0 print_char::ch#3 print_char::ch#4 ] -[ print_char_cursor#45 print_char_cursor#1 print_char_cursor#77 print_char_cursor#11 ] +[ print_char_cursor#45 print_char_cursor#72 print_char_cursor#1 print_char_cursor#77 print_char_cursor#11 ] Added variable xr to live range equivalence class [ xr ] Added variable yr to live range equivalence class [ yr ] Added variable zr to live range equivalence class [ zr ] @@ -1523,7 +1530,6 @@ Added variable psp2 to live range equivalence class [ psp2 ] Added variable mulf_init::val#0 to live range equivalence class [ mulf_init::val#0 ] Added variable mulf_init::$2 to live range equivalence class [ mulf_init::$2 ] Added variable mulf_init::$6 to live range equivalence class [ mulf_init::$6 ] -Added variable print_uchar::b#0 to live range equivalence class [ print_uchar::b#0 ] Added variable print_uchar::$0 to live range equivalence class [ print_uchar::$0 ] Added variable print_uchar::$2 to live range equivalence class [ print_uchar::$2 ] Complete equivalence classes @@ -1532,10 +1538,11 @@ Complete equivalence classes [ mulf_init::add#2 mulf_init::add#1 ] [ memset::dst#2 memset::dst#1 ] [ print_str::str#7 print_str::str#10 print_str::str#0 ] -[ print_schar::b#8 print_schar::b#0 print_schar::b#10 print_schar::b#5 print_schar::b#4 ] +[ print_schar::b#6 print_schar::b#0 print_schar::b#4 ] +[ print_uchar::b#3 print_uchar::b#2 print_uchar::b#1 print_uchar::b#0 ] [ print_line_cursor#12 print_line_cursor#0 ] [ print_char::ch#5 print_char::ch#0 print_char::ch#3 print_char::ch#4 ] -[ print_char_cursor#45 print_char_cursor#1 print_char_cursor#77 print_char_cursor#11 ] +[ print_char_cursor#45 print_char_cursor#72 print_char_cursor#1 print_char_cursor#77 print_char_cursor#11 ] [ xr ] [ yr ] [ zr ] @@ -1544,7 +1551,6 @@ Complete equivalence classes [ mulf_init::val#0 ] [ mulf_init::$2 ] [ mulf_init::$6 ] -[ print_uchar::b#0 ] [ print_uchar::$0 ] [ print_uchar::$2 ] Allocated zp[2]:2 [ mulf_init::sqr#2 mulf_init::sqr#1 ] @@ -1552,19 +1558,19 @@ Allocated zp[1]:4 [ mulf_init::i#2 mulf_init::i#1 ] Allocated zp[2]:5 [ mulf_init::add#2 mulf_init::add#1 ] Allocated zp[2]:7 [ memset::dst#2 memset::dst#1 ] Allocated zp[2]:9 [ print_str::str#7 print_str::str#10 print_str::str#0 ] -Allocated zp[1]:11 [ print_schar::b#8 print_schar::b#0 print_schar::b#10 print_schar::b#5 print_schar::b#4 ] -Allocated zp[2]:12 [ print_line_cursor#12 print_line_cursor#0 ] -Allocated zp[1]:14 [ print_char::ch#5 print_char::ch#0 print_char::ch#3 print_char::ch#4 ] -Allocated zp[2]:15 [ print_char_cursor#45 print_char_cursor#1 print_char_cursor#77 print_char_cursor#11 ] -Allocated zp[1]:17 [ xr ] -Allocated zp[1]:18 [ yr ] -Allocated zp[1]:19 [ zr ] -Allocated zp[2]:20 [ psp1 ] -Allocated zp[2]:22 [ psp2 ] -Allocated zp[1]:24 [ mulf_init::val#0 ] -Allocated zp[1]:25 [ mulf_init::$2 ] -Allocated zp[1]:26 [ mulf_init::$6 ] -Allocated zp[1]:27 [ print_uchar::b#0 ] +Allocated zp[1]:11 [ print_schar::b#6 print_schar::b#0 print_schar::b#4 ] +Allocated zp[1]:12 [ print_uchar::b#3 print_uchar::b#2 print_uchar::b#1 print_uchar::b#0 ] +Allocated zp[2]:13 [ print_line_cursor#12 print_line_cursor#0 ] +Allocated zp[1]:15 [ print_char::ch#5 print_char::ch#0 print_char::ch#3 print_char::ch#4 ] +Allocated zp[2]:16 [ print_char_cursor#45 print_char_cursor#72 print_char_cursor#1 print_char_cursor#77 print_char_cursor#11 ] +Allocated zp[1]:18 [ xr ] +Allocated zp[1]:19 [ yr ] +Allocated zp[1]:20 [ zr ] +Allocated zp[2]:21 [ psp1 ] +Allocated zp[2]:23 [ psp2 ] +Allocated zp[1]:25 [ mulf_init::val#0 ] +Allocated zp[1]:26 [ mulf_init::$2 ] +Allocated zp[1]:27 [ mulf_init::$6 ] Allocated zp[1]:28 [ print_uchar::$0 ] Allocated zp[1]:29 [ print_uchar::$2 ] REGISTER UPLIFT POTENTIAL REGISTERS @@ -1577,15 +1583,15 @@ Statement [11] psp1 = (word)mulf_sqr1 [ psp1 ] ( main:7 [ psp1 ] { } ) always c Statement [12] psp2 = (word)mulf_sqr2 [ psp1 psp2 ] ( main:7 [ psp1 psp2 ] { } ) always clobbers reg byte a Statement [22] mulf_init::$2 = - mulf_init::i#2 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 mulf_init::$2 ] ( main:7::mulf_init:10 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 mulf_init::$2 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:4 [ mulf_init::i#2 mulf_init::i#1 ] -Removing always clobbered register reg byte a as potential for zp[1]:24 [ mulf_init::val#0 ] +Removing always clobbered register reg byte a as potential for zp[1]:25 [ mulf_init::val#0 ] Statement [23] mulf_sqr1[mulf_init::$2] = mulf_init::val#0 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 mulf_init::$2 ] ( main:7::mulf_init:10 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 mulf_init::$2 ] { } ) always clobbers reg byte a -Removing always clobbered register reg byte a as potential for zp[1]:25 [ mulf_init::$2 ] +Removing always clobbered register reg byte a as potential for zp[1]:26 [ mulf_init::$2 ] Statement [24] (mulf_sqr1+$100)[mulf_init::$2] = mulf_init::val#0 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 ] ( main:7::mulf_init:10 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 ] { } ) always clobbers reg byte a Statement [25] (mulf_sqr2+1)[mulf_init::i#2] = mulf_init::val#0 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 ] ( main:7::mulf_init:10 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 ] { } ) always clobbers reg byte a Statement [26] (mulf_sqr2+$100+1)[mulf_init::i#2] = mulf_init::val#0 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 ] ( main:7::mulf_init:10 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 ] { } ) always clobbers reg byte a Statement [27] mulf_init::$6 = 1 - mulf_init::i#2 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 mulf_init::$6 ] ( main:7::mulf_init:10 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 mulf_init::$6 ] { } ) always clobbers reg byte a Statement [28] mulf_sqr2[mulf_init::$6] = mulf_init::val#0 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 mulf_init::$6 ] ( main:7::mulf_init:10 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 mulf_init::val#0 mulf_init::$6 ] { } ) always clobbers reg byte a -Removing always clobbered register reg byte a as potential for zp[1]:26 [ mulf_init::$6 ] +Removing always clobbered register reg byte a as potential for zp[1]:27 [ mulf_init::$6 ] Statement [29] (mulf_sqr2+$100)[mulf_init::$6] = mulf_init::val#0 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 ] ( main:7::mulf_init:10 [ mulf_init::sqr#2 mulf_init::i#2 mulf_init::add#2 ] { } ) always clobbers reg byte a Statement [30] mulf_init::sqr#1 = mulf_init::sqr#2 + mulf_init::add#2 [ mulf_init::i#2 mulf_init::add#2 mulf_init::sqr#1 ] ( main:7::mulf_init:10 [ mulf_init::i#2 mulf_init::add#2 mulf_init::sqr#1 ] { } ) always clobbers reg byte a Statement [31] mulf_init::add#1 = mulf_init::add#2 + 2 [ mulf_init::i#2 mulf_init::sqr#1 mulf_init::add#1 ] ( main:7::mulf_init:10 [ mulf_init::i#2 mulf_init::sqr#1 mulf_init::add#1 ] { } ) always clobbers reg byte a @@ -1593,19 +1599,19 @@ Statement [67] if(memset::dst#2!=memset::end#0) goto memset::@2 [ memset::dst#2 Statement [69] *memset::dst#2 = memset::c#0 [ memset::dst#2 ] ( main:7::print_cls:13::memset:36 [ psp1 psp2 memset::dst#2 ] { } ) always clobbers reg byte a reg byte y Statement [73] if(0!=*print_str::str#7) goto print_str::@2 [ print_str::str#7 print_char_cursor#1 ] ( main:7::do_perspective:15::print_str:39 [ psp1 psp2 print_str::str#7 print_char_cursor#1 ] { } main:7::do_perspective:15::print_str:43 [ psp1 psp2 print_str::str#7 print_char_cursor#1 ] { { print_char_cursor#11 = print_char_cursor#77 } } main:7::do_perspective:15::print_str:47 [ psp1 psp2 print_str::str#7 print_char_cursor#1 ] { { print_char_cursor#11 = print_char_cursor#77 } } main:7::do_perspective:15::print_str:51 [ psp1 psp2 print_str::str#7 print_char_cursor#1 ] { { print_char_cursor#11 = print_char_cursor#77 } } main:7::do_perspective:15::print_str:57 [ yr print_str::str#7 print_char_cursor#1 ] { { print_char_cursor#11 = print_char_cursor#77 } } main:7::do_perspective:15::print_str:61 [ print_str::str#7 print_char_cursor#1 ] { { print_char_cursor#11 = print_char_cursor#77 } } ) always clobbers reg byte a reg byte y Statement [75] print_char::ch#0 = *print_str::str#7 [ print_str::str#7 print_char_cursor#1 print_char::ch#0 ] ( main:7::do_perspective:15::print_str:39 [ psp1 psp2 print_str::str#7 print_char_cursor#1 print_char::ch#0 ] { { print_char::ch#0 = print_char::ch#5 } { print_char_cursor#1 = print_char_cursor#45 } } main:7::do_perspective:15::print_str:43 [ psp1 psp2 print_str::str#7 print_char_cursor#1 print_char::ch#0 ] { { print_char_cursor#11 = print_char_cursor#77 } { print_char::ch#0 = print_char::ch#5 } { print_char_cursor#1 = print_char_cursor#45 } } main:7::do_perspective:15::print_str:47 [ psp1 psp2 print_str::str#7 print_char_cursor#1 print_char::ch#0 ] { { print_char_cursor#11 = print_char_cursor#77 } { print_char::ch#0 = print_char::ch#5 } { print_char_cursor#1 = print_char_cursor#45 } } main:7::do_perspective:15::print_str:51 [ psp1 psp2 print_str::str#7 print_char_cursor#1 print_char::ch#0 ] { { print_char_cursor#11 = print_char_cursor#77 } { print_char::ch#0 = print_char::ch#5 } { print_char_cursor#1 = print_char_cursor#45 } } main:7::do_perspective:15::print_str:57 [ yr print_str::str#7 print_char_cursor#1 print_char::ch#0 ] { { print_char_cursor#11 = print_char_cursor#77 } { print_char::ch#0 = print_char::ch#5 } { print_char_cursor#1 = print_char_cursor#45 } } main:7::do_perspective:15::print_str:61 [ print_str::str#7 print_char_cursor#1 print_char::ch#0 ] { { print_char_cursor#11 = print_char_cursor#77 } { print_char::ch#0 = print_char::ch#5 } { print_char_cursor#1 = print_char_cursor#45 } } ) always clobbers reg byte a reg byte y -Statement [88] print_schar::b#0 = - print_schar::b#10 [ print_char_cursor#11 print_schar::b#0 ] ( main:7::do_perspective:15::print_schar:41 [ psp1 psp2 print_char_cursor#11 print_schar::b#0 ] { } main:7::do_perspective:15::print_schar:45 [ psp1 psp2 print_char_cursor#11 print_schar::b#0 ] { } main:7::do_perspective:15::print_schar:49 [ psp1 psp2 print_char_cursor#11 print_schar::b#0 ] { } main:7::do_perspective:15::print_schar:55 [ yr print_char_cursor#11 print_schar::b#0 ] { { print_schar::b#10 = print_schar::b#4 xr } } main:7::do_perspective:15::print_schar:59 [ print_char_cursor#11 print_schar::b#0 ] { { print_schar::b#10 = print_schar::b#5 yr } } ) always clobbers reg byte a +Statement [88] print_schar::b#0 = - print_schar::b#4 [ print_char_cursor#11 print_schar::b#0 ] ( main:7::do_perspective:15::print_schar:41 [ psp1 psp2 print_char_cursor#11 print_schar::b#0 ] { } main:7::do_perspective:15::print_schar:45 [ psp1 psp2 print_char_cursor#11 print_schar::b#0 ] { } main:7::do_perspective:15::print_schar:49 [ psp1 psp2 print_char_cursor#11 print_schar::b#0 ] { } ) always clobbers reg byte a Statement [89] xr = do_perspective::x#0 [ xr psp1 psp2 ] ( main:7::do_perspective:15::perspective:53 [ print_char_cursor#1 xr psp1 psp2 ] { } ) always clobbers reg byte a Statement [90] yr = do_perspective::y#0 [ xr yr psp1 psp2 ] ( main:7::do_perspective:15::perspective:53 [ print_char_cursor#1 xr yr psp1 psp2 ] { } ) always clobbers reg byte a Statement [91] zr = do_perspective::z#0 [ xr yr zr psp1 psp2 ] ( main:7::do_perspective:15::perspective:53 [ print_char_cursor#1 xr yr zr psp1 psp2 ] { } ) always clobbers reg byte a Statement 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 } always clobbers reg byte a reg byte y -Statement [96] print_line_cursor#0 = print_line_cursor#12 + $28 [ print_char_cursor#1 print_line_cursor#0 ] ( main:7::do_perspective:15::print_ln:63 [ print_char_cursor#1 print_line_cursor#0 ] { } ) always clobbers reg byte a -Statement [97] if(print_line_cursor#0> 4 [ print_char_cursor#11 print_uchar::b#0 print_uchar::$0 ] ( main:7::do_perspective:15::print_schar:41::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::b#0 print_uchar::$0 ] { { print_char::ch#3 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:45::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::b#0 print_uchar::$0 ] { { print_char::ch#3 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:49::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::b#0 print_uchar::$0 ] { { print_char::ch#3 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:55::print_uchar:84 [ yr print_char_cursor#11 print_uchar::b#0 print_uchar::$0 ] { { print_schar::b#10 = print_schar::b#4 xr } { print_char::ch#3 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:59::print_uchar:84 [ print_char_cursor#11 print_uchar::b#0 print_uchar::$0 ] { { print_schar::b#10 = print_schar::b#5 yr } { print_char::ch#3 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } ) always clobbers reg byte a -Removing always clobbered register reg byte a as potential for zp[1]:27 [ print_uchar::b#0 ] -Statement [106] print_uchar::$2 = print_uchar::b#0 & $f [ print_char_cursor#11 print_uchar::$2 ] ( main:7::do_perspective:15::print_schar:41::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::$2 ] { { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:45::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::$2 ] { { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:49::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::$2 ] { { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:55::print_uchar:84 [ yr print_char_cursor#11 print_uchar::$2 ] { { print_schar::b#10 = print_schar::b#4 xr } { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:59::print_uchar:84 [ print_char_cursor#11 print_uchar::$2 ] { { print_schar::b#10 = print_schar::b#5 yr } { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } ) always clobbers reg byte a +Statement [95] print_uchar::$0 = print_uchar::b#3 >> 4 [ print_uchar::b#3 print_char_cursor#72 print_uchar::$0 ] ( main:7::do_perspective:15::print_uchar:55 [ yr print_uchar::b#3 print_char_cursor#72 print_uchar::$0 ] { { print_uchar::b#1 = print_uchar::b#3 } { print_char_cursor#1 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#3 = print_char::ch#5 } } main:7::do_perspective:15::print_uchar:59 [ print_uchar::b#3 print_char_cursor#72 print_uchar::$0 ] { { print_uchar::b#2 = print_uchar::b#3 } { print_char_cursor#1 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#3 = print_char::ch#5 } } main:7::do_perspective:15::print_schar:41::print_uchar:84 [ psp1 psp2 print_uchar::b#3 print_char_cursor#72 print_uchar::$0 ] { { print_uchar::b#0 = print_uchar::b#3 } { print_char_cursor#11 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#3 = print_char::ch#5 } } main:7::do_perspective:15::print_schar:45::print_uchar:84 [ psp1 psp2 print_uchar::b#3 print_char_cursor#72 print_uchar::$0 ] { { print_uchar::b#0 = print_uchar::b#3 } { print_char_cursor#11 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#3 = print_char::ch#5 } } main:7::do_perspective:15::print_schar:49::print_uchar:84 [ psp1 psp2 print_uchar::b#3 print_char_cursor#72 print_uchar::$0 ] { { print_uchar::b#0 = print_uchar::b#3 } { print_char_cursor#11 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#3 = print_char::ch#5 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:12 [ print_uchar::b#3 print_uchar::b#2 print_uchar::b#1 print_uchar::b#0 ] +Statement [98] print_uchar::$2 = print_uchar::b#3 & $f [ print_char_cursor#11 print_uchar::$2 ] ( main:7::do_perspective:15::print_uchar:55 [ yr print_char_cursor#11 print_uchar::$2 ] { { print_uchar::b#1 = print_uchar::b#3 } { print_char_cursor#1 = print_char_cursor#72 } { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_uchar:59 [ print_char_cursor#11 print_uchar::$2 ] { { print_uchar::b#2 = print_uchar::b#3 } { print_char_cursor#1 = print_char_cursor#72 } { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:41::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::$2 ] { { print_uchar::b#0 = print_uchar::b#3 } { print_char_cursor#11 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#4 = print_char::ch#5 } } main:7::do_perspective:15::print_schar:45::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::$2 ] { { print_uchar::b#0 = print_uchar::b#3 } { print_char_cursor#11 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#4 = print_char::ch#5 } } main:7::do_perspective:15::print_schar:49::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::$2 ] { { print_uchar::b#0 = print_uchar::b#3 } { print_char_cursor#11 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#4 = print_char::ch#5 } } ) always clobbers reg byte a +Statement [104] print_line_cursor#0 = print_line_cursor#12 + $28 [ print_char_cursor#1 print_line_cursor#0 ] ( main:7::do_perspective:15::print_ln:63 [ print_char_cursor#1 print_line_cursor#0 ] { } ) always clobbers reg byte a +Statement [105] if(print_line_cursor#0> 4 [ print_char_cursor#11 print_uchar::b#0 print_uchar::$0 ] ( main:7::do_perspective:15::print_schar:41::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::b#0 print_uchar::$0 ] { { print_char::ch#3 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:45::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::b#0 print_uchar::$0 ] { { print_char::ch#3 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:49::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::b#0 print_uchar::$0 ] { { print_char::ch#3 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:55::print_uchar:84 [ yr print_char_cursor#11 print_uchar::b#0 print_uchar::$0 ] { { print_schar::b#10 = print_schar::b#4 xr } { print_char::ch#3 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:59::print_uchar:84 [ print_char_cursor#11 print_uchar::b#0 print_uchar::$0 ] { { print_schar::b#10 = print_schar::b#5 yr } { print_char::ch#3 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } ) always clobbers reg byte a -Statement [106] print_uchar::$2 = print_uchar::b#0 & $f [ print_char_cursor#11 print_uchar::$2 ] ( main:7::do_perspective:15::print_schar:41::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::$2 ] { { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:45::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::$2 ] { { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:49::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::$2 ] { { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:55::print_uchar:84 [ yr print_char_cursor#11 print_uchar::$2 ] { { print_schar::b#10 = print_schar::b#4 xr } { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:59::print_uchar:84 [ print_char_cursor#11 print_uchar::$2 ] { { print_schar::b#10 = print_schar::b#5 yr } { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } ) always clobbers reg byte a +Statement [95] print_uchar::$0 = print_uchar::b#3 >> 4 [ print_uchar::b#3 print_char_cursor#72 print_uchar::$0 ] ( main:7::do_perspective:15::print_uchar:55 [ yr print_uchar::b#3 print_char_cursor#72 print_uchar::$0 ] { { print_uchar::b#1 = print_uchar::b#3 } { print_char_cursor#1 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#3 = print_char::ch#5 } } main:7::do_perspective:15::print_uchar:59 [ print_uchar::b#3 print_char_cursor#72 print_uchar::$0 ] { { print_uchar::b#2 = print_uchar::b#3 } { print_char_cursor#1 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#3 = print_char::ch#5 } } main:7::do_perspective:15::print_schar:41::print_uchar:84 [ psp1 psp2 print_uchar::b#3 print_char_cursor#72 print_uchar::$0 ] { { print_uchar::b#0 = print_uchar::b#3 } { print_char_cursor#11 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#3 = print_char::ch#5 } } main:7::do_perspective:15::print_schar:45::print_uchar:84 [ psp1 psp2 print_uchar::b#3 print_char_cursor#72 print_uchar::$0 ] { { print_uchar::b#0 = print_uchar::b#3 } { print_char_cursor#11 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#3 = print_char::ch#5 } } main:7::do_perspective:15::print_schar:49::print_uchar:84 [ psp1 psp2 print_uchar::b#3 print_char_cursor#72 print_uchar::$0 ] { { print_uchar::b#0 = print_uchar::b#3 } { print_char_cursor#11 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#3 = print_char::ch#5 } } ) always clobbers reg byte a +Statement [98] print_uchar::$2 = print_uchar::b#3 & $f [ print_char_cursor#11 print_uchar::$2 ] ( main:7::do_perspective:15::print_uchar:55 [ yr print_char_cursor#11 print_uchar::$2 ] { { print_uchar::b#1 = print_uchar::b#3 } { print_char_cursor#1 = print_char_cursor#72 } { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_uchar:59 [ print_char_cursor#11 print_uchar::$2 ] { { print_uchar::b#2 = print_uchar::b#3 } { print_char_cursor#1 = print_char_cursor#72 } { print_char::ch#4 = print_char::ch#5 } { print_char_cursor#11 = print_char_cursor#45 } } main:7::do_perspective:15::print_schar:41::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::$2 ] { { print_uchar::b#0 = print_uchar::b#3 } { print_char_cursor#11 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#4 = print_char::ch#5 } } main:7::do_perspective:15::print_schar:45::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::$2 ] { { print_uchar::b#0 = print_uchar::b#3 } { print_char_cursor#11 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#4 = print_char::ch#5 } } main:7::do_perspective:15::print_schar:49::print_uchar:84 [ psp1 psp2 print_char_cursor#11 print_uchar::$2 ] { { print_uchar::b#0 = print_uchar::b#3 } { print_char_cursor#11 = print_char_cursor#72 print_char_cursor#45 } { print_char::ch#4 = print_char::ch#5 } } ) always clobbers reg byte a +Statement [104] print_line_cursor#0 = print_line_cursor#12 + $28 [ print_char_cursor#1 print_line_cursor#0 ] ( main:7::do_perspective:15::print_ln:63 [ print_char_cursor#1 print_line_cursor#0 ] { } ) always clobbers reg byte a +Statement [105] if(print_line_cursor#0print_schar] print_schar_from___b1: - // [78] phi print_schar::b#10 = do_perspective::x#0 [phi:do_perspective::@1->print_schar#0] -- vbsxx=vbsc1 + // [78] phi print_schar::b#4 = do_perspective::x#0 [phi:do_perspective::@1->print_schar#0] -- vbsxx=vbsc1 ldx #x jsr print_schar // [42] phi from do_perspective::@1 to do_perspective::@2 [phi:do_perspective::@1->do_perspective::@2] @@ -1983,7 +1989,7 @@ do_perspective: { // [45] call print_schar // [78] phi from do_perspective::@3 to print_schar [phi:do_perspective::@3->print_schar] print_schar_from___b3: - // [78] phi print_schar::b#10 = do_perspective::y#0 [phi:do_perspective::@3->print_schar#0] -- vbsxx=vbsc1 + // [78] phi print_schar::b#4 = do_perspective::y#0 [phi:do_perspective::@3->print_schar#0] -- vbsxx=vbsc1 ldx #y jsr print_schar // [46] phi from do_perspective::@3 to do_perspective::@4 [phi:do_perspective::@3->do_perspective::@4] @@ -2009,7 +2015,7 @@ do_perspective: { // [49] call print_schar // [78] phi from do_perspective::@5 to print_schar [phi:do_perspective::@5->print_schar] print_schar_from___b5: - // [78] phi print_schar::b#10 = do_perspective::z#0 [phi:do_perspective::@5->print_schar#0] -- vbsxx=vbsc1 + // [78] phi print_schar::b#4 = do_perspective::z#0 [phi:do_perspective::@5->print_schar#0] -- vbsxx=vbsc1 ldx #z jsr print_schar // [50] phi from do_perspective::@5 to do_perspective::@6 [phi:do_perspective::@5->do_perspective::@6] @@ -2037,13 +2043,14 @@ do_perspective: { jmp __b8 // do_perspective::@8 __b8: - // [54] print_schar::b#4 = xr -- vbsxx=vbsz1 + // [54] print_uchar::b#1 = (byte)xr -- vbuxx=vbuz1 ldx.z xr - // [55] call print_schar - // [78] phi from do_perspective::@8 to print_schar [phi:do_perspective::@8->print_schar] - print_schar_from___b8: - // [78] phi print_schar::b#10 = print_schar::b#4 [phi:do_perspective::@8->print_schar#0] -- register_copy - jsr print_schar + // [55] call print_uchar + // [94] phi from do_perspective::@8 to print_uchar [phi:do_perspective::@8->print_uchar] + print_uchar_from___b8: + // [94] phi print_char_cursor#72 = print_char_cursor#1 [phi:do_perspective::@8->print_uchar#0] -- register_copy + // [94] phi print_uchar::b#3 = print_uchar::b#1 [phi:do_perspective::@8->print_uchar#1] -- register_copy + jsr print_uchar // [56] phi from do_perspective::@8 to do_perspective::@9 [phi:do_perspective::@8->do_perspective::@9] __b9_from___b8: jmp __b9 @@ -2062,13 +2069,14 @@ do_perspective: { jmp __b10 // do_perspective::@10 __b10: - // [58] print_schar::b#5 = yr -- vbsxx=vbsz1 + // [58] print_uchar::b#2 = (byte)yr -- vbuxx=vbuz1 ldx.z yr - // [59] call print_schar - // [78] phi from do_perspective::@10 to print_schar [phi:do_perspective::@10->print_schar] - print_schar_from___b10: - // [78] phi print_schar::b#10 = print_schar::b#5 [phi:do_perspective::@10->print_schar#0] -- register_copy - jsr print_schar + // [59] call print_uchar + // [94] phi from do_perspective::@10 to print_uchar [phi:do_perspective::@10->print_uchar] + print_uchar_from___b10: + // [94] phi print_char_cursor#72 = print_char_cursor#1 [phi:do_perspective::@10->print_uchar#0] -- register_copy + // [94] phi print_uchar::b#3 = print_uchar::b#2 [phi:do_perspective::@10->print_uchar#1] -- register_copy + jsr print_uchar // [60] phi from do_perspective::@10 to do_perspective::@11 [phi:do_perspective::@10->do_perspective::@11] __b11_from___b10: jmp __b11 @@ -2090,7 +2098,7 @@ do_perspective: { // do_perspective::@12 __b12: // [63] call print_ln - // [94] phi from do_perspective::@12 to print_ln [phi:do_perspective::@12->print_ln] + // [102] phi from do_perspective::@12 to print_ln [phi:do_perspective::@12->print_ln] print_ln_from___b12: jsr print_ln jmp __breturn @@ -2184,10 +2192,10 @@ print_str: { ldy #0 lda (str),y // [76] call print_char - // [99] phi from print_str::@2 to print_char [phi:print_str::@2->print_char] + // [107] phi from print_str::@2 to print_char [phi:print_str::@2->print_char] print_char_from___b2: - // [99] phi print_char_cursor#45 = print_char_cursor#1 [phi:print_str::@2->print_char#0] -- register_copy - // [99] phi print_char::ch#5 = print_char::ch#0 [phi:print_str::@2->print_char#1] -- register_copy + // [107] phi print_char_cursor#45 = print_char_cursor#1 [phi:print_str::@2->print_char#0] -- register_copy + // [107] phi print_char::ch#5 = print_char::ch#0 [phi:print_str::@2->print_char#1] -- register_copy jsr print_char jmp __b3 // print_str::@3 @@ -2203,7 +2211,7 @@ print_str: { // Print a signed char as HEX // print_schar(signed byte register(X) b) print_schar: { - // [79] if(print_schar::b#10<0) goto print_schar::@1 -- vbsxx_lt_0_then_la1 + // [79] if(print_schar::b#4<0) goto print_schar::@1 -- vbsxx_lt_0_then_la1 cpx #0 bmi __b1_from_print_schar // [80] phi from print_schar to print_schar::@3 [phi:print_schar->print_schar::@3] @@ -2212,21 +2220,25 @@ print_schar: { // print_schar::@3 __b3: // [81] call print_char - // [99] phi from print_schar::@3 to print_char [phi:print_schar::@3->print_char] + // [107] phi from print_schar::@3 to print_char [phi:print_schar::@3->print_char] print_char_from___b3: - // [99] phi print_char_cursor#45 = print_char_cursor#1 [phi:print_schar::@3->print_char#0] -- register_copy - // [99] phi print_char::ch#5 = ' ' [phi:print_schar::@3->print_char#1] -- vbuaa=vbuc1 + // [107] phi print_char_cursor#45 = print_char_cursor#1 [phi:print_schar::@3->print_char#0] -- register_copy + // [107] phi print_char::ch#5 = ' ' [phi:print_schar::@3->print_char#1] -- vbuaa=vbuc1 lda #' ' jsr print_char // [82] phi from print_schar::@3 print_schar::@4 to print_schar::@2 [phi:print_schar::@3/print_schar::@4->print_schar::@2] __b2_from___b3: __b2_from___b4: - // [82] phi print_schar::b#8 = print_schar::b#10 [phi:print_schar::@3/print_schar::@4->print_schar::@2#0] -- register_copy + // [82] phi print_schar::b#6 = print_schar::b#4 [phi:print_schar::@3/print_schar::@4->print_schar::@2#0] -- register_copy jmp __b2 // print_schar::@2 __b2: - // [83] print_uchar::b#0 = (byte)print_schar::b#8 + // [83] print_uchar::b#0 = (byte)print_schar::b#6 // [84] call print_uchar + // [94] phi from print_schar::@2 to print_uchar [phi:print_schar::@2->print_uchar] + print_uchar_from___b2: + // [94] phi print_char_cursor#72 = print_char_cursor#11 [phi:print_schar::@2->print_uchar#0] -- register_copy + // [94] phi print_uchar::b#3 = print_uchar::b#0 [phi:print_schar::@2->print_uchar#1] -- register_copy jsr print_uchar jmp __breturn // print_schar::@return @@ -2239,16 +2251,16 @@ print_schar: { // print_schar::@1 __b1: // [87] call print_char - // [99] phi from print_schar::@1 to print_char [phi:print_schar::@1->print_char] + // [107] phi from print_schar::@1 to print_char [phi:print_schar::@1->print_char] print_char_from___b1: - // [99] phi print_char_cursor#45 = print_char_cursor#1 [phi:print_schar::@1->print_char#0] -- register_copy - // [99] phi print_char::ch#5 = '-' [phi:print_schar::@1->print_char#1] -- vbuaa=vbuc1 + // [107] phi print_char_cursor#45 = print_char_cursor#1 [phi:print_schar::@1->print_char#0] -- register_copy + // [107] phi print_char::ch#5 = '-' [phi:print_schar::@1->print_char#1] -- vbuaa=vbuc1 lda #'-' jsr print_char jmp __b4 // print_schar::@4 __b4: - // [88] print_schar::b#0 = - print_schar::b#10 -- vbsxx=_neg_vbsxx + // [88] print_schar::b#0 = - print_schar::b#4 -- vbsxx=_neg_vbsxx txa eor #$ff clc @@ -2294,25 +2306,65 @@ perspective: { __breturn: // [93] return rts +} + // print_uchar +// Print a char as HEX +// print_uchar(byte register(X) b) +print_uchar: { + // [95] print_uchar::$0 = print_uchar::b#3 >> 4 -- vbuaa=vbuxx_ror_4 + txa + lsr + lsr + lsr + lsr + // [96] print_char::ch#3 = print_hextab[print_uchar::$0] -- vbuaa=pbuc1_derefidx_vbuaa + tay + lda print_hextab,y + // [97] call print_char + // Table of hexadecimal digits + // [107] phi from print_uchar to print_char [phi:print_uchar->print_char] + print_char_from_print_uchar: + // [107] phi print_char_cursor#45 = print_char_cursor#72 [phi:print_uchar->print_char#0] -- register_copy + // [107] phi print_char::ch#5 = print_char::ch#3 [phi:print_uchar->print_char#1] -- register_copy + jsr print_char + jmp __b1 + // print_uchar::@1 + __b1: + // [98] print_uchar::$2 = print_uchar::b#3 & $f -- vbuxx=vbuxx_band_vbuc1 + lda #$f + axs #0 + // [99] print_char::ch#4 = print_hextab[print_uchar::$2] -- vbuaa=pbuc1_derefidx_vbuxx + lda print_hextab,x + // [100] call print_char + // [107] phi from print_uchar::@1 to print_char [phi:print_uchar::@1->print_char] + print_char_from___b1: + // [107] phi print_char_cursor#45 = print_char_cursor#11 [phi:print_uchar::@1->print_char#0] -- register_copy + // [107] phi print_char::ch#5 = print_char::ch#4 [phi:print_uchar::@1->print_char#1] -- register_copy + jsr print_char + jmp __breturn + // print_uchar::@return + __breturn: + // [101] return + rts } // print_ln // Print a newline print_ln: { - // [95] phi from print_ln to print_ln::@1 [phi:print_ln->print_ln::@1] + // [103] phi from print_ln to print_ln::@1 [phi:print_ln->print_ln::@1] __b1_from_print_ln: - // [95] phi print_line_cursor#12 = print_screen#0 [phi:print_ln->print_ln::@1#0] -- pbuz1=pbuc1 + // [103] phi print_line_cursor#12 = print_screen#0 [phi:print_ln->print_ln::@1#0] -- pbuz1=pbuc1 lda #print_screen sta.z print_line_cursor+1 jmp __b1 - // [95] phi from print_ln::@1 to print_ln::@1 [phi:print_ln::@1->print_ln::@1] + // [103] phi from print_ln::@1 to print_ln::@1 [phi:print_ln::@1->print_ln::@1] __b1_from___b1: - // [95] phi print_line_cursor#12 = print_line_cursor#0 [phi:print_ln::@1->print_ln::@1#0] -- register_copy + // [103] phi print_line_cursor#12 = print_line_cursor#0 [phi:print_ln::@1->print_ln::@1#0] -- register_copy jmp __b1 // print_ln::@1 __b1: - // [96] print_line_cursor#0 = print_line_cursor#12 + $28 -- pbuz1=pbuz1_plus_vbuc1 + // [104] print_line_cursor#0 = print_line_cursor#12 + $28 -- pbuz1=pbuz1_plus_vbuc1 lda #$28 clc adc.z print_line_cursor @@ -2320,7 +2372,7 @@ print_ln: { bcc !+ inc.z print_line_cursor+1 !: - // [97] if(print_line_cursor#0> 4 -- vbuaa=vbuxx_ror_4 - txa - lsr - lsr - lsr - lsr - // [104] print_char::ch#3 = print_hextab[print_uchar::$0] -- vbuaa=pbuc1_derefidx_vbuaa - tay - lda print_hextab,y - // [105] call print_char - // Table of hexadecimal digits - // [99] phi from print_uchar to print_char [phi:print_uchar->print_char] - print_char_from_print_uchar: - // [99] phi print_char_cursor#45 = print_char_cursor#11 [phi:print_uchar->print_char#0] -- register_copy - // [99] phi print_char::ch#5 = print_char::ch#3 [phi:print_uchar->print_char#1] -- register_copy - jsr print_char - jmp __b1 - // print_uchar::@1 - __b1: - // [106] print_uchar::$2 = print_uchar::b#0 & $f -- vbuxx=vbuxx_band_vbuc1 - lda #$f - axs #0 - // [107] print_char::ch#4 = print_hextab[print_uchar::$2] -- vbuaa=pbuc1_derefidx_vbuxx - lda print_hextab,x - // [108] call print_char - // [99] phi from print_uchar::@1 to print_char [phi:print_uchar::@1->print_char] - print_char_from___b1: - // [99] phi print_char_cursor#45 = print_char_cursor#11 [phi:print_uchar::@1->print_char#0] -- register_copy - // [99] phi print_char::ch#5 = print_char::ch#4 [phi:print_uchar::@1->print_char#1] -- register_copy - jsr print_char - jmp __breturn - // print_uchar::@return - __breturn: - // [109] return + // [110] return rts } // File Data @@ -2463,9 +2475,9 @@ Removing instruction jmp __b4 Removing instruction jmp __breturn Removing instruction jmp __b1 Removing instruction jmp __breturn -Removing instruction jmp __breturn Removing instruction jmp __b1 Removing instruction jmp __breturn +Removing instruction jmp __breturn Succesful ASM optimization Pass5NextJumpElimination Removing instruction lda #0 Removing instruction lda #0 @@ -2519,6 +2531,7 @@ Removing instruction __b3_from_print_schar: Removing instruction print_char_from___b3: Removing instruction __b2_from___b3: Removing instruction __b2_from___b4: +Removing instruction print_uchar_from___b2: Removing instruction __b1_from_print_schar: Removing instruction print_char_from___b1: Removing instruction __b1_from___b1: @@ -2544,10 +2557,10 @@ Removing instruction __b5: Removing instruction __b6: Removing instruction __b7: Removing instruction __b8: -Removing instruction print_schar_from___b8: +Removing instruction print_uchar_from___b8: Removing instruction __b9: Removing instruction __b10: -Removing instruction print_schar_from___b10: +Removing instruction print_uchar_from___b10: Removing instruction __b11: Removing instruction __b12: Removing instruction __breturn: @@ -2561,13 +2574,13 @@ Removing instruction __b3: Removing instruction __breturn: Removing instruction __b4: Removing instruction __breturn: -Removing instruction __b1_from_print_ln: -Removing instruction __breturn: -Removing instruction __breturn: Removing instruction print_char_from_print_uchar: Removing instruction __b1: Removing instruction print_char_from___b1: Removing instruction __breturn: +Removing instruction __b1_from_print_ln: +Removing instruction __breturn: +Removing instruction __breturn: Succesful ASM optimization Pass5UnusedLabelElimination Removing instruction jmp __b1 Removing instruction jmp __b1 @@ -2643,9 +2656,10 @@ 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 1269.4615384615383 -byte* print_char_cursor#11 print_char_cursor zp[2]:6 4661.035714285714 +byte* print_char_cursor#1 print_char_cursor zp[2]:6 1277.230769230769 +byte* print_char_cursor#11 print_char_cursor zp[2]:6 4673.423076923077 byte* print_char_cursor#45 print_char_cursor zp[2]:6 116003.5 +byte* print_char_cursor#72 print_char_cursor zp[2]:6 3734.6666666666665 byte* print_char_cursor#77 print_char_cursor zp[2]:6 1506.0 void print_cls() const to_nomodify byte* print_hextab[] = "0123456789abcdef"z @@ -2656,10 +2670,8 @@ 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 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 +signed byte print_schar::b#4 reg byte x 500.5 +signed byte print_schar::b#6 reg byte x 2002.0 byte* print_screen const byte* print_screen#0 print_screen = (byte*) 1024 void print_str(byte* print_str::str) @@ -2671,19 +2683,23 @@ void print_uchar(byte print_uchar::b) 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 5250.75 +byte print_uchar::b#0 reg byte x 2002.0 +byte print_uchar::b#1 reg byte x 202.0 +byte print_uchar::b#2 reg byte x 202.0 +byte print_uchar::b#3 reg byte x 5301.25 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 xr loadstore zp[1]:8 167.16666666666669 +volatile signed byte yr loadstore zp[1]:9 111.44444444444446 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#8 print_schar::b#0 print_schar::b#10 print_schar::b#5 print_schar::b#4 ] +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#2 print_uchar::b#1 print_uchar::b#0 ] 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#1 print_char_cursor#77 print_char_cursor#11 ] +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 [ xr ] zp[1]:9 [ yr ] zp[1]:10 [ zr ] @@ -2692,7 +2708,6 @@ 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 ] @@ -2925,7 +2940,7 @@ do_perspective: { // print_schar(x) // [41] call print_schar // [78] phi from do_perspective::@1 to print_schar [phi:do_perspective::@1->print_schar] - // [78] phi print_schar::b#10 = do_perspective::x#0 [phi:do_perspective::@1->print_schar#0] -- vbsxx=vbsc1 + // [78] phi print_schar::b#4 = do_perspective::x#0 [phi:do_perspective::@1->print_schar#0] -- vbsxx=vbsc1 ldx #x jsr print_schar // [42] phi from do_perspective::@1 to do_perspective::@2 [phi:do_perspective::@1->do_perspective::@2] @@ -2945,7 +2960,7 @@ do_perspective: { // print_schar(y) // [45] call print_schar // [78] phi from do_perspective::@3 to print_schar [phi:do_perspective::@3->print_schar] - // [78] phi print_schar::b#10 = do_perspective::y#0 [phi:do_perspective::@3->print_schar#0] -- vbsxx=vbsc1 + // [78] phi print_schar::b#4 = do_perspective::y#0 [phi:do_perspective::@3->print_schar#0] -- vbsxx=vbsc1 ldx #y jsr print_schar // [46] phi from do_perspective::@3 to do_perspective::@4 [phi:do_perspective::@3->do_perspective::@4] @@ -2965,7 +2980,7 @@ do_perspective: { // print_schar(z) // [49] call print_schar // [78] phi from do_perspective::@5 to print_schar [phi:do_perspective::@5->print_schar] - // [78] phi print_schar::b#10 = do_perspective::z#0 [phi:do_perspective::@5->print_schar#0] -- vbsxx=vbsc1 + // [78] phi print_schar::b#4 = do_perspective::z#0 [phi:do_perspective::@5->print_schar#0] -- vbsxx=vbsc1 ldx #z jsr print_schar // [50] phi from do_perspective::@5 to do_perspective::@6 [phi:do_perspective::@5->do_perspective::@6] @@ -2986,13 +3001,14 @@ do_perspective: { // [53] call perspective jsr perspective // do_perspective::@8 - // print_schar(xr) - // [54] print_schar::b#4 = xr -- vbsxx=vbsz1 + // print_uchar((char)xr) + // [54] print_uchar::b#1 = (byte)xr -- vbuxx=vbuz1 ldx.z xr - // [55] call print_schar - // [78] phi from do_perspective::@8 to print_schar [phi:do_perspective::@8->print_schar] - // [78] phi print_schar::b#10 = print_schar::b#4 [phi:do_perspective::@8->print_schar#0] -- register_copy - jsr print_schar + // [55] call print_uchar + // [94] phi from do_perspective::@8 to print_uchar [phi:do_perspective::@8->print_uchar] + // [94] phi print_char_cursor#72 = print_char_cursor#1 [phi:do_perspective::@8->print_uchar#0] -- register_copy + // [94] phi print_uchar::b#3 = print_uchar::b#1 [phi:do_perspective::@8->print_uchar#1] -- register_copy + jsr print_uchar // [56] phi from do_perspective::@8 to do_perspective::@9 [phi:do_perspective::@8->do_perspective::@9] // do_perspective::@9 // print_str(",") @@ -3006,13 +3022,14 @@ do_perspective: { sta.z print_str.str+1 jsr print_str // do_perspective::@10 - // print_schar(yr) - // [58] print_schar::b#5 = yr -- vbsxx=vbsz1 + // print_uchar((char)yr) + // [58] print_uchar::b#2 = (byte)yr -- vbuxx=vbuz1 ldx.z yr - // [59] call print_schar - // [78] phi from do_perspective::@10 to print_schar [phi:do_perspective::@10->print_schar] - // [78] phi print_schar::b#10 = print_schar::b#5 [phi:do_perspective::@10->print_schar#0] -- register_copy - jsr print_schar + // [59] call print_uchar + // [94] phi from do_perspective::@10 to print_uchar [phi:do_perspective::@10->print_uchar] + // [94] phi print_char_cursor#72 = print_char_cursor#1 [phi:do_perspective::@10->print_uchar#0] -- register_copy + // [94] phi print_uchar::b#3 = print_uchar::b#2 [phi:do_perspective::@10->print_uchar#1] -- register_copy + jsr print_uchar // [60] phi from do_perspective::@10 to do_perspective::@11 [phi:do_perspective::@10->do_perspective::@11] // do_perspective::@11 // print_str(")") @@ -3029,7 +3046,7 @@ do_perspective: { // do_perspective::@12 // print_ln() // [63] call print_ln - // [94] phi from do_perspective::@12 to print_ln [phi:do_perspective::@12->print_ln] + // [102] phi from do_perspective::@12 to print_ln [phi:do_perspective::@12->print_ln] jsr print_ln // do_perspective::@return // } @@ -3118,9 +3135,9 @@ print_str: { ldy #0 lda (str),y // [76] call print_char - // [99] phi from print_str::@2 to print_char [phi:print_str::@2->print_char] - // [99] phi print_char_cursor#45 = print_char_cursor#1 [phi:print_str::@2->print_char#0] -- register_copy - // [99] phi print_char::ch#5 = print_char::ch#0 [phi:print_str::@2->print_char#1] -- register_copy + // [107] phi from print_str::@2 to print_char [phi:print_str::@2->print_char] + // [107] phi print_char_cursor#45 = print_char_cursor#1 [phi:print_str::@2->print_char#0] -- register_copy + // [107] phi print_char::ch#5 = print_char::ch#0 [phi:print_str::@2->print_char#1] -- register_copy jsr print_char // print_str::@3 // print_char(*(str++)); @@ -3136,25 +3153,28 @@ print_str: { // print_schar(signed byte register(X) b) print_schar: { // if(b<0) - // [79] if(print_schar::b#10<0) goto print_schar::@1 -- vbsxx_lt_0_then_la1 + // [79] if(print_schar::b#4<0) goto print_schar::@1 -- vbsxx_lt_0_then_la1 cpx #0 bmi __b1 // [80] phi from print_schar to print_schar::@3 [phi:print_schar->print_schar::@3] // print_schar::@3 // print_char(' ') // [81] call print_char - // [99] phi from print_schar::@3 to print_char [phi:print_schar::@3->print_char] - // [99] phi print_char_cursor#45 = print_char_cursor#1 [phi:print_schar::@3->print_char#0] -- register_copy - // [99] phi print_char::ch#5 = ' ' [phi:print_schar::@3->print_char#1] -- vbuaa=vbuc1 + // [107] phi from print_schar::@3 to print_char [phi:print_schar::@3->print_char] + // [107] phi print_char_cursor#45 = print_char_cursor#1 [phi:print_schar::@3->print_char#0] -- register_copy + // [107] phi print_char::ch#5 = ' ' [phi:print_schar::@3->print_char#1] -- vbuaa=vbuc1 lda #' ' jsr print_char // [82] phi from print_schar::@3 print_schar::@4 to print_schar::@2 [phi:print_schar::@3/print_schar::@4->print_schar::@2] - // [82] phi print_schar::b#8 = print_schar::b#10 [phi:print_schar::@3/print_schar::@4->print_schar::@2#0] -- register_copy + // [82] phi print_schar::b#6 = print_schar::b#4 [phi:print_schar::@3/print_schar::@4->print_schar::@2#0] -- register_copy // print_schar::@2 __b2: // print_uchar((char)b) - // [83] print_uchar::b#0 = (byte)print_schar::b#8 + // [83] print_uchar::b#0 = (byte)print_schar::b#6 // [84] call print_uchar + // [94] phi from print_schar::@2 to print_uchar [phi:print_schar::@2->print_uchar] + // [94] phi print_char_cursor#72 = print_char_cursor#11 [phi:print_schar::@2->print_uchar#0] -- register_copy + // [94] phi print_uchar::b#3 = print_uchar::b#0 [phi:print_schar::@2->print_uchar#1] -- register_copy jsr print_uchar // print_schar::@return // } @@ -3165,14 +3185,14 @@ print_schar: { __b1: // print_char('-') // [87] call print_char - // [99] phi from print_schar::@1 to print_char [phi:print_schar::@1->print_char] - // [99] phi print_char_cursor#45 = print_char_cursor#1 [phi:print_schar::@1->print_char#0] -- register_copy - // [99] phi print_char::ch#5 = '-' [phi:print_schar::@1->print_char#1] -- vbuaa=vbuc1 + // [107] phi from print_schar::@1 to print_char [phi:print_schar::@1->print_char] + // [107] phi print_char_cursor#45 = print_char_cursor#1 [phi:print_schar::@1->print_char#0] -- register_copy + // [107] phi print_char::ch#5 = '-' [phi:print_schar::@1->print_char#1] -- vbuaa=vbuc1 lda #'-' jsr print_char // print_schar::@4 // b = -b - // [88] print_schar::b#0 = - print_schar::b#10 -- vbsxx=_neg_vbsxx + // [88] print_schar::b#0 = - print_schar::b#4 -- vbsxx=_neg_vbsxx txa eor #$ff clc @@ -3220,22 +3240,61 @@ perspective: { // } // [93] return rts +} + // print_uchar +// Print a char as HEX +// print_uchar(byte register(X) b) +print_uchar: { + // b>>4 + // [95] print_uchar::$0 = print_uchar::b#3 >> 4 -- vbuaa=vbuxx_ror_4 + txa + lsr + lsr + lsr + lsr + // print_char(print_hextab[b>>4]) + // [96] print_char::ch#3 = print_hextab[print_uchar::$0] -- vbuaa=pbuc1_derefidx_vbuaa + tay + lda print_hextab,y + // [97] call print_char + // Table of hexadecimal digits + // [107] phi from print_uchar to print_char [phi:print_uchar->print_char] + // [107] phi print_char_cursor#45 = print_char_cursor#72 [phi:print_uchar->print_char#0] -- register_copy + // [107] phi print_char::ch#5 = print_char::ch#3 [phi:print_uchar->print_char#1] -- register_copy + jsr print_char + // print_uchar::@1 + // b&$f + // [98] print_uchar::$2 = print_uchar::b#3 & $f -- vbuxx=vbuxx_band_vbuc1 + lda #$f + axs #0 + // print_char(print_hextab[b&$f]) + // [99] print_char::ch#4 = print_hextab[print_uchar::$2] -- vbuaa=pbuc1_derefidx_vbuxx + lda print_hextab,x + // [100] call print_char + // [107] phi from print_uchar::@1 to print_char [phi:print_uchar::@1->print_char] + // [107] phi print_char_cursor#45 = print_char_cursor#11 [phi:print_uchar::@1->print_char#0] -- register_copy + // [107] phi print_char::ch#5 = print_char::ch#4 [phi:print_uchar::@1->print_char#1] -- register_copy + jsr print_char + // print_uchar::@return + // } + // [101] return + rts } // print_ln // Print a newline print_ln: { - // [95] phi from print_ln to print_ln::@1 [phi:print_ln->print_ln::@1] - // [95] phi print_line_cursor#12 = print_screen#0 [phi:print_ln->print_ln::@1#0] -- pbuz1=pbuc1 + // [103] phi from print_ln to print_ln::@1 [phi:print_ln->print_ln::@1] + // [103] phi print_line_cursor#12 = print_screen#0 [phi:print_ln->print_ln::@1#0] -- pbuz1=pbuc1 lda #print_screen sta.z print_line_cursor+1 - // [95] phi from print_ln::@1 to print_ln::@1 [phi:print_ln::@1->print_ln::@1] - // [95] phi print_line_cursor#12 = print_line_cursor#0 [phi:print_ln::@1->print_ln::@1#0] -- register_copy + // [103] phi from print_ln::@1 to print_ln::@1 [phi:print_ln::@1->print_ln::@1] + // [103] phi print_line_cursor#12 = print_line_cursor#0 [phi:print_ln::@1->print_ln::@1#0] -- register_copy // print_ln::@1 __b1: // print_line_cursor + $28 - // [96] print_line_cursor#0 = print_line_cursor#12 + $28 -- pbuz1=pbuz1_plus_vbuc1 + // [104] print_line_cursor#0 = print_line_cursor#12 + $28 -- pbuz1=pbuz1_plus_vbuc1 lda #$28 clc adc.z print_line_cursor @@ -3244,7 +3303,7 @@ print_ln: { inc.z print_line_cursor+1 !: // while (print_line_cursor>4 - // [103] print_uchar::$0 = print_uchar::b#0 >> 4 -- vbuaa=vbuxx_ror_4 - txa - lsr - lsr - lsr - lsr - // print_char(print_hextab[b>>4]) - // [104] print_char::ch#3 = print_hextab[print_uchar::$0] -- vbuaa=pbuc1_derefidx_vbuaa - tay - lda print_hextab,y - // [105] call print_char - // Table of hexadecimal digits - // [99] phi from print_uchar to print_char [phi:print_uchar->print_char] - // [99] phi print_char_cursor#45 = print_char_cursor#11 [phi:print_uchar->print_char#0] -- register_copy - // [99] phi print_char::ch#5 = print_char::ch#3 [phi:print_uchar->print_char#1] -- register_copy - jsr print_char - // print_uchar::@1 - // b&$f - // [106] print_uchar::$2 = print_uchar::b#0 & $f -- vbuxx=vbuxx_band_vbuc1 - lda #$f - axs #0 - // print_char(print_hextab[b&$f]) - // [107] print_char::ch#4 = print_hextab[print_uchar::$2] -- vbuaa=pbuc1_derefidx_vbuxx - lda print_hextab,x - // [108] call print_char - // [99] phi from print_uchar::@1 to print_char [phi:print_uchar::@1->print_char] - // [99] phi print_char_cursor#45 = print_char_cursor#11 [phi:print_uchar::@1->print_char#0] -- register_copy - // [99] phi print_char::ch#5 = print_char::ch#4 [phi:print_uchar::@1->print_char#1] -- register_copy - jsr print_char - // print_uchar::@return - // } - // [109] return + // [110] return rts } // File Data diff --git a/src/test/ref/examples/c64/3d/perspective.sym b/src/test/ref/examples/c64/3d/perspective.sym index 9a63d1cee..7649bfb30 100644 --- a/src/test/ref/examples/c64/3d/perspective.sym +++ b/src/test/ref/examples/c64/3d/perspective.sym @@ -67,9 +67,10 @@ 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 1269.4615384615383 -byte* print_char_cursor#11 print_char_cursor zp[2]:6 4661.035714285714 +byte* print_char_cursor#1 print_char_cursor zp[2]:6 1277.230769230769 +byte* print_char_cursor#11 print_char_cursor zp[2]:6 4673.423076923077 byte* print_char_cursor#45 print_char_cursor zp[2]:6 116003.5 +byte* print_char_cursor#72 print_char_cursor zp[2]:6 3734.6666666666665 byte* print_char_cursor#77 print_char_cursor zp[2]:6 1506.0 void print_cls() const to_nomodify byte* print_hextab[] = "0123456789abcdef"z @@ -80,10 +81,8 @@ 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 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 +signed byte print_schar::b#4 reg byte x 500.5 +signed byte print_schar::b#6 reg byte x 2002.0 byte* print_screen const byte* print_screen#0 print_screen = (byte*) 1024 void print_str(byte* print_str::str) @@ -95,19 +94,23 @@ void print_uchar(byte print_uchar::b) 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 5250.75 +byte print_uchar::b#0 reg byte x 2002.0 +byte print_uchar::b#1 reg byte x 202.0 +byte print_uchar::b#2 reg byte x 202.0 +byte print_uchar::b#3 reg byte x 5301.25 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 xr loadstore zp[1]:8 167.16666666666669 +volatile signed byte yr loadstore zp[1]:9 111.44444444444446 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#8 print_schar::b#0 print_schar::b#10 print_schar::b#5 print_schar::b#4 ] +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#2 print_uchar::b#1 print_uchar::b#0 ] 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#1 print_char_cursor#77 print_char_cursor#11 ] +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 [ xr ] zp[1]:9 [ yr ] zp[1]:10 [ zr ] @@ -116,6 +119,5 @@ 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 ]