1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-08 17:54:40 +00:00

Fixing more tests with word arrays/pointers. Preparing for #139

This commit is contained in:
jespergravgaard 2019-04-19 11:56:21 +02:00
parent 4e93f0b056
commit 5a54b45ed9
26 changed files with 4737 additions and 4772 deletions

View File

@ -18,7 +18,7 @@ void main() {
print_str(" ");
print_word(0);
print_ln();
for(byte i=0; i<20*2; i=i+2) {
for(byte i=0; i<20; i++) {
print_byte(i);
print_str(" ");
print_word(lintab1[i]);
@ -49,6 +49,6 @@ void lin16u_gen(word min, word max, word* lintab, word length) {
for(word i=0; i<length; i++) {
*lintab = >val;
val = val + step;
lintab = lintab+2;
lintab++;
}
}

View File

@ -9,7 +9,7 @@ word[] charset_spec_row = { %1111011111011010, %1111011111011110, %1111001001001
void main() {
byte* charset = CHARSET+8;
for(byte c=0;c!=6;c=c+2) {
for(byte c=0;c!=4;c++) {
gen_char3(charset, charset_spec_row[c]);
charset = charset+8;
}

View File

@ -14,23 +14,23 @@ void main() {
*((byte*)ub_screen) = ub;
*((signed byte*)ub_screen+1) = sb;
*((word*)ub_screen+2)= uw;
*((signed word*)ub_screen+4) = sw;
*((word*)ub_screen+1)= uw;
*((signed word*)ub_screen+2) = sw;
*((byte*)sb_screen) = ub;
*((signed byte*)sb_screen+1) = sb;
*((word*)sb_screen+2)= uw;
*((signed word*)sb_screen+4) = sw;
*((word*)sb_screen+1)= uw;
*((signed word*)sb_screen+2) = sw;
*((byte*)uw_screen) = ub;
*((signed byte*)uw_screen+1) = sb;
*((word*)uw_screen+2)= uw;
*((signed word*)uw_screen+4) = sw;
*((word*)uw_screen+1)= uw;
*((signed word*)uw_screen+2) = sw;
*((byte*)sw_screen) = ub;
*((signed byte*)sw_screen+1) = sb;
*((word*)sw_screen+2)= uw;
*((signed word*)sw_screen+4) = sw;
*((word*)sw_screen+1)= uw;
*((signed word*)sw_screen+2) = sw;
}

View File

@ -7,7 +7,7 @@ void main() {
signed word[120] sintab1;
sin16s_gen(sintab1, wavelength);
print_cls();
for(signed word* st1 = sintab1; st1<sintab1+wavelength*2; st1 = st1+2 ) {
for(signed word* st1 = sintab1; st1<sintab1+wavelength; st1++ ) {
signed word sw = *st1;
if(sw>=0) {
print_str(" ");

View File

@ -10,11 +10,8 @@ void main() {
print_cls();
for(byte i: 0..191) {
signed byte sb = sintabb[i];
signed word sw = *(sintabw+(word)i*2);
signed word sw = *(sintabw+(word)i);
signed byte sd = sb-(signed byte)>sw;
if(sd>=0) {
print_str(" ");
}
print_sbyte(sd);
print_str(" ");
}

View File

@ -3,11 +3,11 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.const SIZEOF_WORD = 2
.label rem16u = $f
.label print_char_cursor = 7
.label print_line_cursor = 3
.label print_line_cursor = 2
main: {
.label i = 2
lda #<lintab1
sta lin16u_gen.lintab
lda #>lintab1
@ -85,10 +85,9 @@ main: {
lda #>$400
sta print_line_cursor+1
jsr print_ln
lda #0
sta i
ldx #0
b1:
ldx i
stx print_byte.b
lda print_line_cursor
sta print_char_cursor
lda print_line_cursor+1
@ -99,7 +98,9 @@ main: {
lda #>str1
sta print_str.str+1
jsr print_str
ldy i
txa
asl
tay
lda lintab1,y
sta print_word.w
lda lintab1+1,y
@ -110,7 +111,9 @@ main: {
lda #>str1
sta print_str.str+1
jsr print_str
ldy i
txa
asl
tay
lda lintab2,y
sta print_word.w
lda lintab2+1,y
@ -121,18 +124,17 @@ main: {
lda #>str1
sta print_str.str+1
jsr print_str
ldy i
txa
asl
tay
lda lintab3,y
sta print_word.w
lda lintab3+1,y
sta print_word.w+1
jsr print_word
jsr print_ln
lda i
clc
adc #2
sta i
cmp #$14*2
inx
cpx #$14
bcc b1
lda print_line_cursor
sta print_char_cursor
@ -197,21 +199,22 @@ print_ln: {
rts
}
// Print a word as HEX
// print_word(word zeropage(5) w)
// print_word(word zeropage(4) w)
print_word: {
.label w = 5
.label w = 4
lda w+1
tax
sta print_byte.b
jsr print_byte
lda w
tax
sta print_byte.b
jsr print_byte
rts
}
// Print a byte as HEX
// print_byte(byte register(X) b)
// print_byte(byte zeropage(6) b)
print_byte: {
txa
.label b = 6
lda b
lsr
lsr
lsr
@ -220,8 +223,9 @@ print_byte: {
lda print_hextab,y
jsr print_char
lda #$f
axs #0
lda print_hextab,x
and b
tay
lda print_hextab,y
jsr print_char
rts
}
@ -237,9 +241,9 @@ print_char: {
rts
}
// Print a zero-terminated string
// print_str(byte* zeropage(5) str)
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 5
.label str = 4
b1:
ldy #0
lda (str),y
@ -262,7 +266,7 @@ print_str: {
}
// Clear the screen. Also resets current line/char cursor.
print_cls: {
.label sc = 3
.label sc = 2
lda #<$400
sta sc
lda #>$400
@ -286,18 +290,18 @@ print_cls: {
// Generate word linear table
// lintab - the table to generate into
// length - the number of points in a total sinus wavelength (the size of the table)
// lin16u_gen(word zeropage(5) min, word zeropage(3) max, word* zeropage(7) lintab)
// lin16u_gen(word zeropage(4) min, word zeropage(2) max, word* zeropage(7) lintab)
lin16u_gen: {
.label _5 = 5
.label ampl = 3
.label _5 = 4
.label ampl = 2
.label stepi = $13
.label stepf = $11
.label step = $15
.label val = 9
.label lintab = 7
.label i = 3
.label max = 3
.label min = 5
.label i = 2
.label max = 2
.label min = 4
lda ampl
sec
sbc min
@ -365,9 +369,9 @@ lin16u_gen: {
lda val+3
adc step+3
sta val+3
lda lintab
lda #SIZEOF_WORD
clc
adc #2
adc lintab
sta lintab
bcc !+
inc lintab+1
@ -390,10 +394,10 @@ lin16u_gen: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(3) dividend, word zeropage($d) divisor, word zeropage($f) rem)
// divr16u(word zeropage(2) dividend, word zeropage($d) divisor, word zeropage($f) rem)
divr16u: {
.label rem = $f
.label dividend = 3
.label dividend = 2
.label quotient = $11
.label return = $11
.label divisor = $d

View File

@ -62,211 +62,214 @@ main::@13: scope:[main] from main::@1
[31] call print_str
to:main::@14
main::@14: scope:[main] from main::@13
[32] (word) print_word::w#3 ← *((const word[$14]) main::lintab1#0 + (byte) main::i#10)
[33] call print_word
[32] (byte) main::$27 ← (byte) main::i#10 << (byte/signed byte/word/signed word/dword/signed dword) 1
[33] (word) print_word::w#3 ← *((const word[$14]) main::lintab1#0 + (byte) main::$27)
[34] call print_word
to:main::@15
main::@15: scope:[main] from main::@14
[34] phi()
[35] call print_str
[35] phi()
[36] call print_str
to:main::@16
main::@16: scope:[main] from main::@15
[36] (word) print_word::w#4 ← *((const word[$14]) main::lintab2#0 + (byte) main::i#10)
[37] call print_word
[37] (byte) main::$28 ← (byte) main::i#10 << (byte/signed byte/word/signed word/dword/signed dword) 1
[38] (word) print_word::w#4 ← *((const word[$14]) main::lintab2#0 + (byte) main::$28)
[39] call print_word
to:main::@17
main::@17: scope:[main] from main::@16
[38] phi()
[39] call print_str
[40] phi()
[41] call print_str
to:main::@18
main::@18: scope:[main] from main::@17
[40] (word) print_word::w#5 ← *((const word[$14]) main::lintab3#0 + (byte) main::i#10)
[41] call print_word
[42] (byte) main::$29 ← (byte) main::i#10 << (byte/signed byte/word/signed word/dword/signed dword) 1
[43] (word) print_word::w#5 ← *((const word[$14]) main::lintab3#0 + (byte) main::$29)
[44] call print_word
to:main::@19
main::@19: scope:[main] from main::@18
[42] phi()
[43] call print_ln
[45] phi()
[46] call print_ln
to:main::@20
main::@20: scope:[main] from main::@19
[44] (byte) main::i#1 ← (byte) main::i#10 + (byte/signed byte/word/signed word/dword/signed dword) 2
[45] if((byte) main::i#1<(byte/signed byte/word/signed word/dword/signed dword) $14*(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@1
[47] (byte) main::i#1 ← ++ (byte) main::i#10
[48] if((byte) main::i#1<(byte/signed byte/word/signed word/dword/signed dword) $14) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@20
[46] (byte*~) print_char_cursor#100 ← (byte*) print_line_cursor#1
[47] call print_str
[49] (byte*~) print_char_cursor#100 ← (byte*) print_line_cursor#1
[50] call print_str
to:main::@21
main::@21: scope:[main] from main::@2
[48] phi()
[49] call print_word
[51] phi()
[52] call print_word
to:main::@22
main::@22: scope:[main] from main::@21
[50] phi()
[51] call print_str
[53] phi()
[54] call print_str
to:main::@23
main::@23: scope:[main] from main::@22
[52] phi()
[53] call print_word
[55] phi()
[56] call print_word
to:main::@24
main::@24: scope:[main] from main::@23
[54] phi()
[55] call print_str
[57] phi()
[58] call print_str
to:main::@25
main::@25: scope:[main] from main::@24
[56] phi()
[57] call print_word
[59] phi()
[60] call print_word
to:main::@26
main::@26: scope:[main] from main::@25
[58] phi()
[59] call print_ln
[61] phi()
[62] call print_ln
to:main::@return
main::@return: scope:[main] from main::@26
[60] return
[63] return
to:@return
print_ln: scope:[print_ln] from main::@12 main::@19 main::@26
[61] (byte*) print_line_cursor#21 ← phi( main::@12/((byte*))(word/signed word/dword/signed dword) $400 main::@19/(byte*) print_line_cursor#1 main::@26/(byte*) print_line_cursor#1 )
[64] (byte*) print_line_cursor#21 ← phi( main::@12/((byte*))(word/signed word/dword/signed dword) $400 main::@19/(byte*) print_line_cursor#1 main::@26/(byte*) print_line_cursor#1 )
to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
[62] (byte*) print_line_cursor#11 ← phi( print_ln/(byte*) print_line_cursor#21 print_ln::@1/(byte*) print_line_cursor#1 )
[63] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#11 + (byte/signed byte/word/signed word/dword/signed dword) $28
[64] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#11) goto print_ln::@1
[65] (byte*) print_line_cursor#11 ← phi( print_ln/(byte*) print_line_cursor#21 print_ln::@1/(byte*) print_line_cursor#1 )
[66] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#11 + (byte/signed byte/word/signed word/dword/signed dword) $28
[67] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#11) goto print_ln::@1
to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@1
[65] return
[68] return
to:@return
print_word: scope:[print_word] from main::@11 main::@14 main::@16 main::@18 main::@21 main::@23 main::@25 main::@7 main::@9
[66] (word) print_word::w#10 ← phi( main::@11/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@14/(word) print_word::w#3 main::@16/(word) print_word::w#4 main::@18/(word) print_word::w#5 main::@21/(word/signed word/dword/signed dword) $7461 main::@23/(word/dword/signed dword) $f781 main::@25/(word/signed word/dword/signed dword) $6488 main::@7/(word/signed word/dword/signed dword) $22d main::@9/(word/signed word/dword/signed dword) $79cb )
[67] (byte) print_byte::b#0 ← > (word) print_word::w#10
[68] call print_byte
[69] (word) print_word::w#10 ← phi( main::@11/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@14/(word) print_word::w#3 main::@16/(word) print_word::w#4 main::@18/(word) print_word::w#5 main::@21/(word/signed word/dword/signed dword) $7461 main::@23/(word/dword/signed dword) $f781 main::@25/(word/signed word/dword/signed dword) $6488 main::@7/(word/signed word/dword/signed dword) $22d main::@9/(word/signed word/dword/signed dword) $79cb )
[70] (byte) print_byte::b#0 ← > (word) print_word::w#10
[71] call print_byte
to:print_word::@1
print_word::@1: scope:[print_word] from print_word
[69] (byte) print_byte::b#1 ← < (word) print_word::w#10
[70] call print_byte
[72] (byte) print_byte::b#1 ← < (word) print_word::w#10
[73] call print_byte
to:print_word::@return
print_word::@return: scope:[print_word] from print_word::@1
[71] return
[74] return
to:@return
print_byte: scope:[print_byte] from main::@1 print_word print_word::@1
[72] (byte*) print_char_cursor#81 ← phi( main::@1/(byte*~) print_char_cursor#91 print_word/(byte*) print_char_cursor#2 print_word::@1/(byte*) print_char_cursor#11 )
[72] (byte) print_byte::b#3 ← phi( main::@1/(byte) print_byte::b#2 print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[73] (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (byte/signed byte/word/signed word/dword/signed dword) 4
[74] (byte) print_char::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0)
[75] call print_char
[75] (byte*) print_char_cursor#81 ← phi( main::@1/(byte*~) print_char_cursor#91 print_word/(byte*) print_char_cursor#2 print_word::@1/(byte*) print_char_cursor#11 )
[75] (byte) print_byte::b#3 ← phi( main::@1/(byte) print_byte::b#2 print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[76] (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (byte/signed byte/word/signed word/dword/signed dword) 4
[77] (byte) print_char::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0)
[78] call print_char
to:print_byte::@1
print_byte::@1: scope:[print_byte] from print_byte
[76] (byte~) print_byte::$2 ← (byte) print_byte::b#3 & (byte/signed byte/word/signed word/dword/signed dword) $f
[77] (byte) print_char::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2)
[78] call print_char
[79] (byte~) print_byte::$2 ← (byte) print_byte::b#3 & (byte/signed byte/word/signed word/dword/signed dword) $f
[80] (byte) print_char::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2)
[81] call print_char
to:print_byte::@return
print_byte::@return: scope:[print_byte] from print_byte::@1
[79] return
[82] return
to:@return
print_char: scope:[print_char] from print_byte print_byte::@1
[80] (byte*) print_char_cursor#50 ← phi( print_byte/(byte*) print_char_cursor#81 print_byte::@1/(byte*) print_char_cursor#11 )
[80] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
[81] *((byte*) print_char_cursor#50) ← (byte) print_char::ch#2
[82] (byte*) print_char_cursor#11 ← ++ (byte*) print_char_cursor#50
[83] (byte*) print_char_cursor#50 ← phi( print_byte/(byte*) print_char_cursor#81 print_byte::@1/(byte*) print_char_cursor#11 )
[83] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
[84] *((byte*) print_char_cursor#50) ← (byte) print_char::ch#2
[85] (byte*) print_char_cursor#11 ← ++ (byte*) print_char_cursor#50
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[83] return
[86] return
to:@return
print_str: scope:[print_str] from main::@10 main::@13 main::@15 main::@17 main::@2 main::@22 main::@24 main::@6 main::@8
[84] (byte*) print_char_cursor#86 ← phi( main::@10/(byte*) print_char_cursor#11 main::@13/(byte*) print_char_cursor#11 main::@15/(byte*) print_char_cursor#11 main::@17/(byte*) print_char_cursor#11 main::@2/(byte*~) print_char_cursor#100 main::@22/(byte*) print_char_cursor#11 main::@24/(byte*) print_char_cursor#11 main::@6/((byte*))(word/signed word/dword/signed dword) $400 main::@8/(byte*) print_char_cursor#11 )
[84] (byte*) print_str::str#12 ← phi( main::@10/(const string) main::str1 main::@13/(const string) main::str1 main::@15/(const string) main::str1 main::@17/(const string) main::str1 main::@2/(const string) main::str main::@22/(const string) main::str1 main::@24/(const string) main::str1 main::@6/(const string) main::str main::@8/(const string) main::str1 )
[87] (byte*) print_char_cursor#86 ← phi( main::@10/(byte*) print_char_cursor#11 main::@13/(byte*) print_char_cursor#11 main::@15/(byte*) print_char_cursor#11 main::@17/(byte*) print_char_cursor#11 main::@2/(byte*~) print_char_cursor#100 main::@22/(byte*) print_char_cursor#11 main::@24/(byte*) print_char_cursor#11 main::@6/((byte*))(word/signed word/dword/signed dword) $400 main::@8/(byte*) print_char_cursor#11 )
[87] (byte*) print_str::str#12 ← phi( main::@10/(const string) main::str1 main::@13/(const string) main::str1 main::@15/(const string) main::str1 main::@17/(const string) main::str1 main::@2/(const string) main::str main::@22/(const string) main::str1 main::@24/(const string) main::str1 main::@6/(const string) main::str main::@8/(const string) main::str1 )
to:print_str::@1
print_str::@1: scope:[print_str] from print_str print_str::@2
[85] (byte*) print_char_cursor#2 ← phi( print_str/(byte*) print_char_cursor#86 print_str::@2/(byte*) print_char_cursor#1 )
[85] (byte*) print_str::str#10 ← phi( print_str/(byte*) print_str::str#12 print_str::@2/(byte*) print_str::str#0 )
[86] if(*((byte*) print_str::str#10)!=(byte) '@') goto print_str::@2
[88] (byte*) print_char_cursor#2 ← phi( print_str/(byte*) print_char_cursor#86 print_str::@2/(byte*) print_char_cursor#1 )
[88] (byte*) print_str::str#10 ← phi( print_str/(byte*) print_str::str#12 print_str::@2/(byte*) print_str::str#0 )
[89] if(*((byte*) print_str::str#10)!=(byte) '@') goto print_str::@2
to:print_str::@return
print_str::@return: scope:[print_str] from print_str::@1
[87] return
[90] return
to:@return
print_str::@2: scope:[print_str] from print_str::@1
[88] *((byte*) print_char_cursor#2) ← *((byte*) print_str::str#10)
[89] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#2
[90] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#10
[91] *((byte*) print_char_cursor#2) ← *((byte*) print_str::str#10)
[92] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#2
[93] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#10
to:print_str::@1
print_cls: scope:[print_cls] from main::@5
[91] phi()
[94] phi()
to:print_cls::@1
print_cls::@1: scope:[print_cls] from print_cls print_cls::@1
[92] (byte*) print_cls::sc#2 ← phi( print_cls/((byte*))(word/signed word/dword/signed dword) $400 print_cls::@1/(byte*) print_cls::sc#1 )
[93] *((byte*) print_cls::sc#2) ← (byte) ' '
[94] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2
[95] if((byte*) print_cls::sc#1!=((byte*))(word/signed word/dword/signed dword) $400+(word/signed word/dword/signed dword) $3e8) goto print_cls::@1
[95] (byte*) print_cls::sc#2 ← phi( print_cls/((byte*))(word/signed word/dword/signed dword) $400 print_cls::@1/(byte*) print_cls::sc#1 )
[96] *((byte*) print_cls::sc#2) ← (byte) ' '
[97] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2
[98] if((byte*) print_cls::sc#1!=((byte*))(word/signed word/dword/signed dword) $400+(word/signed word/dword/signed dword) $3e8) goto print_cls::@1
to:print_cls::@return
print_cls::@return: scope:[print_cls] from print_cls::@1
[96] return
[99] return
to:@return
lin16u_gen: scope:[lin16u_gen] from main main::@3 main::@4
[97] (word*) lin16u_gen::lintab#5 ← phi( main/(const word[$14]) main::lintab1#0 main::@3/(const word[$14]) main::lintab2#0 main::@4/(const word[$14]) main::lintab3#0 )
[97] (word) lin16u_gen::min#3 ← phi( main/(word/signed word/dword/signed dword) $22d main::@3/(word/signed word/dword/signed dword) $79cb main::@4/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[97] (word) lin16u_gen::max#3 ← phi( main/(word/signed word/dword/signed dword) $7461 main::@3/(word/dword/signed dword) $f781 main::@4/(word/signed word/dword/signed dword) $6488 )
[98] (word) lin16u_gen::ampl#0 ← (word) lin16u_gen::max#3 - (word) lin16u_gen::min#3
[99] (word) divr16u::dividend#1 ← (word) lin16u_gen::ampl#0
[100] call divr16u
[101] (word) divr16u::return#2 ← (word) divr16u::return#0
[100] (word*) lin16u_gen::lintab#5 ← phi( main/(const word[$14]) main::lintab1#0 main::@3/(const word[$14]) main::lintab2#0 main::@4/(const word[$14]) main::lintab3#0 )
[100] (word) lin16u_gen::min#3 ← phi( main/(word/signed word/dword/signed dword) $22d main::@3/(word/signed word/dword/signed dword) $79cb main::@4/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[100] (word) lin16u_gen::max#3 ← phi( main/(word/signed word/dword/signed dword) $7461 main::@3/(word/dword/signed dword) $f781 main::@4/(word/signed word/dword/signed dword) $6488 )
[101] (word) lin16u_gen::ampl#0 ← (word) lin16u_gen::max#3 - (word) lin16u_gen::min#3
[102] (word) divr16u::dividend#1 ← (word) lin16u_gen::ampl#0
[103] call divr16u
[104] (word) divr16u::return#2 ← (word) divr16u::return#0
to:lin16u_gen::@2
lin16u_gen::@2: scope:[lin16u_gen] from lin16u_gen
[102] (word) lin16u_gen::stepi#0 ← (word) divr16u::return#2
[103] (word) divr16u::rem#4 ← (word) rem16u#1
[104] call divr16u
[105] (word) divr16u::return#3 ← (word) divr16u::return#0
[105] (word) lin16u_gen::stepi#0 ← (word) divr16u::return#2
[106] (word) divr16u::rem#4 ← (word) rem16u#1
[107] call divr16u
[108] (word) divr16u::return#3 ← (word) divr16u::return#0
to:lin16u_gen::@3
lin16u_gen::@3: scope:[lin16u_gen] from lin16u_gen::@2
[106] (word) lin16u_gen::stepf#0 ← (word) divr16u::return#3
[107] (dword) lin16u_gen::step#0 ← (word) lin16u_gen::stepi#0 dw= (word) lin16u_gen::stepf#0
[108] (dword) lin16u_gen::val#0 ← (word) lin16u_gen::min#3 dw= (byte/signed byte/word/signed word/dword/signed dword) 0
[109] (word) lin16u_gen::stepf#0 ← (word) divr16u::return#3
[110] (dword) lin16u_gen::step#0 ← (word) lin16u_gen::stepi#0 dw= (word) lin16u_gen::stepf#0
[111] (dword) lin16u_gen::val#0 ← (word) lin16u_gen::min#3 dw= (byte/signed byte/word/signed word/dword/signed dword) 0
to:lin16u_gen::@1
lin16u_gen::@1: scope:[lin16u_gen] from lin16u_gen::@1 lin16u_gen::@3
[109] (word) lin16u_gen::i#2 ← phi( lin16u_gen::@1/(word) lin16u_gen::i#1 lin16u_gen::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[109] (word*) lin16u_gen::lintab#4 ← phi( lin16u_gen::@1/(word*) lin16u_gen::lintab#3 lin16u_gen::@3/(word*) lin16u_gen::lintab#5 )
[109] (dword) lin16u_gen::val#2 ← phi( lin16u_gen::@1/(dword) lin16u_gen::val#1 lin16u_gen::@3/(dword) lin16u_gen::val#0 )
[110] (word~) lin16u_gen::$5 ← > (dword) lin16u_gen::val#2
[111] *((word*) lin16u_gen::lintab#4) ← (word~) lin16u_gen::$5
[112] (dword) lin16u_gen::val#1 ← (dword) lin16u_gen::val#2 + (dword) lin16u_gen::step#0
[113] (word*) lin16u_gen::lintab#3 ← (word*) lin16u_gen::lintab#4 + (byte/signed byte/word/signed word/dword/signed dword) 2
[114] (word) lin16u_gen::i#1 ← ++ (word) lin16u_gen::i#2
[115] if((word) lin16u_gen::i#1<(byte/signed byte/word/signed word/dword/signed dword) $14) goto lin16u_gen::@1
[112] (word) lin16u_gen::i#2 ← phi( lin16u_gen::@1/(word) lin16u_gen::i#1 lin16u_gen::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[112] (word*) lin16u_gen::lintab#4 ← phi( lin16u_gen::@1/(word*) lin16u_gen::lintab#3 lin16u_gen::@3/(word*) lin16u_gen::lintab#5 )
[112] (dword) lin16u_gen::val#2 ← phi( lin16u_gen::@1/(dword) lin16u_gen::val#1 lin16u_gen::@3/(dword) lin16u_gen::val#0 )
[113] (word~) lin16u_gen::$5 ← > (dword) lin16u_gen::val#2
[114] *((word*) lin16u_gen::lintab#4) ← (word~) lin16u_gen::$5
[115] (dword) lin16u_gen::val#1 ← (dword) lin16u_gen::val#2 + (dword) lin16u_gen::step#0
[116] (word*) lin16u_gen::lintab#3 ← (word*) lin16u_gen::lintab#4 + (const byte) SIZEOF_WORD
[117] (word) lin16u_gen::i#1 ← ++ (word) lin16u_gen::i#2
[118] if((word) lin16u_gen::i#1<(byte/signed byte/word/signed word/dword/signed dword) $14) goto lin16u_gen::@1
to:lin16u_gen::@return
lin16u_gen::@return: scope:[lin16u_gen] from lin16u_gen::@1
[116] return
[119] return
to:@return
divr16u: scope:[divr16u] from lin16u_gen lin16u_gen::@2
[117] (word) divr16u::divisor#6 ← phi( lin16u_gen/(byte/signed byte/word/signed word/dword/signed dword) $14-(byte/signed byte/word/signed word/dword/signed dword) 1 lin16u_gen::@2/(byte/signed byte/word/signed word/dword/signed dword) $14-(byte/signed byte/word/signed word/dword/signed dword) 1 )
[117] (word) divr16u::dividend#5 ← phi( lin16u_gen/(word) divr16u::dividend#1 lin16u_gen::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[117] (word) divr16u::rem#10 ← phi( lin16u_gen/(byte/signed byte/word/signed word/dword/signed dword) 0 lin16u_gen::@2/(word) divr16u::rem#4 )
[120] (word) divr16u::divisor#6 ← phi( lin16u_gen/(byte/signed byte/word/signed word/dword/signed dword) $14-(byte/signed byte/word/signed word/dword/signed dword) 1 lin16u_gen::@2/(byte/signed byte/word/signed word/dword/signed dword) $14-(byte/signed byte/word/signed word/dword/signed dword) 1 )
[120] (word) divr16u::dividend#5 ← phi( lin16u_gen/(word) divr16u::dividend#1 lin16u_gen::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[120] (word) divr16u::rem#10 ← phi( lin16u_gen/(byte/signed byte/word/signed word/dword/signed dword) 0 lin16u_gen::@2/(word) divr16u::rem#4 )
to:divr16u::@1
divr16u::@1: scope:[divr16u] from divr16u divr16u::@3
[118] (byte) divr16u::i#2 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(byte) divr16u::i#1 )
[118] (word) divr16u::quotient#3 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(word) divr16u::return#0 )
[118] (word) divr16u::dividend#3 ← phi( divr16u/(word) divr16u::dividend#5 divr16u::@3/(word) divr16u::dividend#0 )
[118] (word) divr16u::rem#5 ← phi( divr16u/(word) divr16u::rem#10 divr16u::@3/(word) divr16u::rem#11 )
[119] (word) divr16u::rem#0 ← (word) divr16u::rem#5 << (byte/signed byte/word/signed word/dword/signed dword) 1
[120] (byte~) divr16u::$1 ← > (word) divr16u::dividend#3
[121] (byte~) divr16u::$2 ← (byte~) divr16u::$1 & (byte/word/signed word/dword/signed dword) $80
[122] if((byte~) divr16u::$2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16u::@2
[121] (byte) divr16u::i#2 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(byte) divr16u::i#1 )
[121] (word) divr16u::quotient#3 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(word) divr16u::return#0 )
[121] (word) divr16u::dividend#3 ← phi( divr16u/(word) divr16u::dividend#5 divr16u::@3/(word) divr16u::dividend#0 )
[121] (word) divr16u::rem#5 ← phi( divr16u/(word) divr16u::rem#10 divr16u::@3/(word) divr16u::rem#11 )
[122] (word) divr16u::rem#0 ← (word) divr16u::rem#5 << (byte/signed byte/word/signed word/dword/signed dword) 1
[123] (byte~) divr16u::$1 ← > (word) divr16u::dividend#3
[124] (byte~) divr16u::$2 ← (byte~) divr16u::$1 & (byte/word/signed word/dword/signed dword) $80
[125] if((byte~) divr16u::$2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16u::@2
to:divr16u::@4
divr16u::@4: scope:[divr16u] from divr16u::@1
[123] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte/signed byte/word/signed word/dword/signed dword) 1
[126] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte/signed byte/word/signed word/dword/signed dword) 1
to:divr16u::@2
divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4
[124] (word) divr16u::rem#6 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 )
[125] (word) divr16u::dividend#0 ← (word) divr16u::dividend#3 << (byte/signed byte/word/signed word/dword/signed dword) 1
[126] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte/signed byte/word/signed word/dword/signed dword) 1
[127] if((word) divr16u::rem#6<(word) divr16u::divisor#6) goto divr16u::@3
[127] (word) divr16u::rem#6 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 )
[128] (word) divr16u::dividend#0 ← (word) divr16u::dividend#3 << (byte/signed byte/word/signed word/dword/signed dword) 1
[129] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte/signed byte/word/signed word/dword/signed dword) 1
[130] if((word) divr16u::rem#6<(word) divr16u::divisor#6) goto divr16u::@3
to:divr16u::@5
divr16u::@5: scope:[divr16u] from divr16u::@2
[128] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1
[129] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (word) divr16u::divisor#6
[131] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1
[132] (word) divr16u::rem#2 ← (word) divr16u::rem#6 - (word) divr16u::divisor#6
to:divr16u::@3
divr16u::@3: scope:[divr16u] from divr16u::@2 divr16u::@5
[130] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 )
[130] (word) divr16u::rem#11 ← phi( divr16u::@2/(word) divr16u::rem#6 divr16u::@5/(word) divr16u::rem#2 )
[131] (byte) divr16u::i#1 ← ++ (byte) divr16u::i#2
[132] if((byte) divr16u::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto divr16u::@1
[133] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 )
[133] (word) divr16u::rem#11 ← phi( divr16u::@2/(word) divr16u::rem#6 divr16u::@5/(word) divr16u::rem#2 )
[134] (byte) divr16u::i#1 ← ++ (byte) divr16u::i#2
[135] if((byte) divr16u::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto divr16u::@1
to:divr16u::@6
divr16u::@6: scope:[divr16u] from divr16u::@3
[133] (word) rem16u#1 ← (word) divr16u::rem#11
[136] (word) rem16u#1 ← (word) divr16u::rem#11
to:divr16u::@return
divr16u::@return: scope:[divr16u] from divr16u::@6
[134] return
[137] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
(label) @1
(label) @begin
(label) @end
(const byte) SIZEOF_WORD SIZEOF_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(word()) divr16u((word) divr16u::dividend , (word) divr16u::divisor , (word) divr16u::rem)
(byte~) divr16u::$1 reg byte a 22.0
(byte~) divr16u::$2 reg byte a 22.0
@ -12,10 +13,10 @@
(label) divr16u::@6
(label) divr16u::@return
(word) divr16u::dividend
(word) divr16u::dividend#0 dividend zp ZP_WORD:3 2.75
(word) divr16u::dividend#1 dividend zp ZP_WORD:3 4.0
(word) divr16u::dividend#3 dividend zp ZP_WORD:3 5.0
(word) divr16u::dividend#5 dividend zp ZP_WORD:3 4.0
(word) divr16u::dividend#0 dividend zp ZP_WORD:2 2.75
(word) divr16u::dividend#1 dividend zp ZP_WORD:2 4.0
(word) divr16u::dividend#3 dividend zp ZP_WORD:2 5.0
(word) divr16u::dividend#5 dividend zp ZP_WORD:2 4.0
(word) divr16u::divisor
(word) divr16u::divisor#6 divisor zp ZP_WORD:13 1.375
(byte) divr16u::i
@ -39,25 +40,25 @@
(word) divr16u::return#2 return zp ZP_WORD:17 4.0
(word) divr16u::return#3 return zp ZP_WORD:17 4.0
(void()) lin16u_gen((word) lin16u_gen::min , (word) lin16u_gen::max , (word*) lin16u_gen::lintab , (word) lin16u_gen::length)
(word~) lin16u_gen::$5 $5 zp ZP_WORD:5 22.0
(word~) lin16u_gen::$5 $5 zp ZP_WORD:4 22.0
(label) lin16u_gen::@1
(label) lin16u_gen::@2
(label) lin16u_gen::@3
(label) lin16u_gen::@return
(word) lin16u_gen::ampl
(word) lin16u_gen::ampl#0 ampl zp ZP_WORD:3 4.0
(word) lin16u_gen::ampl#0 ampl zp ZP_WORD:2 4.0
(word) lin16u_gen::i
(word) lin16u_gen::i#1 i zp ZP_WORD:3 16.5
(word) lin16u_gen::i#2 i zp ZP_WORD:3 4.4
(word) lin16u_gen::i#1 i zp ZP_WORD:2 16.5
(word) lin16u_gen::i#2 i zp ZP_WORD:2 4.4
(word) lin16u_gen::length
(word*) lin16u_gen::lintab
(word*) lin16u_gen::lintab#3 lintab zp ZP_WORD:7 7.333333333333333
(word*) lin16u_gen::lintab#4 lintab zp ZP_WORD:7 8.75
(word*) lin16u_gen::lintab#5 lintab zp ZP_WORD:7 0.16666666666666666
(word) lin16u_gen::max
(word) lin16u_gen::max#3 max zp ZP_WORD:3 2.0
(word) lin16u_gen::max#3 max zp ZP_WORD:2 2.0
(word) lin16u_gen::min
(word) lin16u_gen::min#3 min zp ZP_WORD:5 0.36363636363636365
(word) lin16u_gen::min#3 min zp ZP_WORD:4 0.36363636363636365
(dword) lin16u_gen::step
(dword) lin16u_gen::step#0 step zp ZP_DWORD:21 1.4444444444444446
(word) lin16u_gen::stepf
@ -69,6 +70,9 @@
(dword) lin16u_gen::val#1 val zp ZP_DWORD:9 5.5
(dword) lin16u_gen::val#2 val zp ZP_DWORD:9 11.666666666666666
(void()) main()
(byte) main::$27 reg byte a 22.0
(byte) main::$28 reg byte a 22.0
(byte) main::$29 reg byte a 22.0
(label) main::@1
(label) main::@10
(label) main::@11
@ -97,8 +101,8 @@
(label) main::@9
(label) main::@return
(byte) main::i
(byte) main::i#1 i zp ZP_BYTE:2 16.5
(byte) main::i#10 i zp ZP_BYTE:2 3.666666666666667
(byte) main::i#1 reg byte x 16.5
(byte) main::i#10 reg byte x 3.142857142857143
(word[$14]) main::lintab1
(const word[$14]) main::lintab1#0 lintab1 = { fill( $14, 0) }
(word[$14]) main::lintab2
@ -109,14 +113,14 @@
(const string) main::str1 str1 = (string) " @"
(void()) print_byte((byte) print_byte::b)
(byte~) print_byte::$0 reg byte a 4.0
(byte~) print_byte::$2 reg byte x 4.0
(byte~) print_byte::$2 reg byte a 4.0
(label) print_byte::@1
(label) print_byte::@return
(byte) print_byte::b
(byte) print_byte::b#0 reg byte x 4.0
(byte) print_byte::b#1 reg byte x 4.0
(byte) print_byte::b#2 reg byte x 11.0
(byte) print_byte::b#3 reg byte x 4.75
(byte) print_byte::b#0 b zp ZP_BYTE:6 4.0
(byte) print_byte::b#1 b zp ZP_BYTE:6 4.0
(byte) print_byte::b#2 b zp ZP_BYTE:6 11.0
(byte) print_byte::b#3 b zp ZP_BYTE:6 4.75
(void()) print_char((byte) print_char::ch)
(label) print_char::@return
(byte) print_char::ch
@ -127,7 +131,7 @@
(byte*) print_char_cursor#1 print_char_cursor zp ZP_WORD:7 101.0
(byte*~) print_char_cursor#100 print_char_cursor zp ZP_WORD:7 4.0
(byte*) print_char_cursor#11 print_char_cursor zp ZP_WORD:7 4.228571428571427
(byte*) print_char_cursor#2 print_char_cursor zp ZP_WORD:7 12.791666666666664
(byte*) print_char_cursor#2 print_char_cursor zp ZP_WORD:7 11.37037037037037
(byte*) print_char_cursor#50 print_char_cursor zp ZP_WORD:7 4.0
(byte*) print_char_cursor#81 print_char_cursor zp ZP_WORD:7 5.666666666666667
(byte*) print_char_cursor#86 print_char_cursor zp ZP_WORD:7 45.0
@ -136,14 +140,14 @@
(label) print_cls::@1
(label) print_cls::@return
(byte*) print_cls::sc
(byte*) print_cls::sc#1 sc zp ZP_WORD:3 16.5
(byte*) print_cls::sc#2 sc zp ZP_WORD:3 16.5
(byte*) print_cls::sc#1 sc zp ZP_WORD:2 16.5
(byte*) print_cls::sc#2 sc zp ZP_WORD:2 16.5
(byte[]) print_hextab
(const byte[]) print_hextab#0 print_hextab = (string) "0123456789abcdef"
(byte*) print_line_cursor
(byte*) print_line_cursor#1 print_line_cursor zp ZP_WORD:3 8.891891891891891
(byte*) print_line_cursor#11 print_line_cursor zp ZP_WORD:3 204.0
(byte*) print_line_cursor#21 print_line_cursor zp ZP_WORD:3 15.0
(byte*) print_line_cursor#1 print_line_cursor zp ZP_WORD:2 8.225
(byte*) print_line_cursor#11 print_line_cursor zp ZP_WORD:2 204.0
(byte*) print_line_cursor#21 print_line_cursor zp ZP_WORD:2 15.0
(void()) print_ln()
(label) print_ln::@1
(label) print_ln::@return
@ -153,24 +157,24 @@
(label) print_str::@2
(label) print_str::@return
(byte*) print_str::str
(byte*) print_str::str#0 str zp ZP_WORD:5 202.0
(byte*) print_str::str#10 str zp ZP_WORD:5 101.5
(byte*) print_str::str#12 str zp ZP_WORD:5 2.0
(byte*) print_str::str#0 str zp ZP_WORD:4 202.0
(byte*) print_str::str#10 str zp ZP_WORD:4 101.5
(byte*) print_str::str#12 str zp ZP_WORD:4 2.0
(void()) print_word((word) print_word::w)
(label) print_word::@1
(label) print_word::@return
(word) print_word::w
(word) print_word::w#10 w zp ZP_WORD:5 12.333333333333332
(word) print_word::w#3 w zp ZP_WORD:5 22.0
(word) print_word::w#4 w zp ZP_WORD:5 22.0
(word) print_word::w#5 w zp ZP_WORD:5 22.0
(word) print_word::w#10 w zp ZP_WORD:4 12.333333333333332
(word) print_word::w#3 w zp ZP_WORD:4 22.0
(word) print_word::w#4 w zp ZP_WORD:4 22.0
(word) print_word::w#5 w zp ZP_WORD:4 22.0
(word) rem16u
(word) rem16u#1 rem16u zp ZP_WORD:15 0.8
zp ZP_BYTE:2 [ main::i#10 main::i#1 ]
zp ZP_WORD:3 [ print_line_cursor#11 print_line_cursor#21 print_line_cursor#1 print_cls::sc#2 print_cls::sc#1 lin16u_gen::max#3 lin16u_gen::ampl#0 divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#1 divr16u::dividend#0 lin16u_gen::i#2 lin16u_gen::i#1 ]
zp ZP_WORD:5 [ print_word::w#10 print_word::w#3 print_word::w#4 print_word::w#5 print_str::str#10 print_str::str#12 print_str::str#0 lin16u_gen::min#3 lin16u_gen::$5 ]
reg byte x [ print_byte::b#3 print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
reg byte x [ main::i#10 main::i#1 ]
zp ZP_WORD:2 [ print_line_cursor#11 print_line_cursor#21 print_line_cursor#1 print_cls::sc#2 print_cls::sc#1 lin16u_gen::max#3 lin16u_gen::ampl#0 divr16u::dividend#3 divr16u::dividend#5 divr16u::dividend#1 divr16u::dividend#0 lin16u_gen::i#2 lin16u_gen::i#1 ]
zp ZP_WORD:4 [ print_word::w#10 print_word::w#3 print_word::w#4 print_word::w#5 print_str::str#10 print_str::str#12 print_str::str#0 lin16u_gen::min#3 lin16u_gen::$5 ]
zp ZP_BYTE:6 [ print_byte::b#3 print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
zp ZP_WORD:7 [ print_char_cursor#86 print_char_cursor#50 print_char_cursor#81 print_char_cursor#91 print_char_cursor#2 print_char_cursor#11 print_char_cursor#100 print_char_cursor#1 lin16u_gen::lintab#4 lin16u_gen::lintab#3 lin16u_gen::lintab#5 ]
zp ZP_DWORD:9 [ lin16u_gen::val#2 lin16u_gen::val#1 lin16u_gen::val#0 ]
@ -178,8 +182,11 @@ zp ZP_WORD:13 [ divr16u::divisor#6 ]
zp ZP_WORD:15 [ divr16u::rem#5 divr16u::rem#10 divr16u::rem#4 divr16u::rem#11 divr16u::rem#6 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 ]
zp ZP_WORD:17 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 divr16u::return#3 lin16u_gen::stepf#0 ]
reg byte x [ divr16u::i#2 divr16u::i#1 ]
reg byte a [ main::$27 ]
reg byte a [ main::$28 ]
reg byte a [ main::$29 ]
reg byte a [ print_byte::$0 ]
reg byte x [ print_byte::$2 ]
reg byte a [ print_byte::$2 ]
zp ZP_WORD:19 [ lin16u_gen::stepi#0 ]
zp ZP_DWORD:21 [ lin16u_gen::step#0 ]
reg byte a [ divr16u::$1 ]

View File

@ -6,19 +6,21 @@
.label SCREEN = $400
.label CHARSET = $3000
main: {
.label charset = 2
.label c = 4
lda #0
sta c
.label charset = 3
.label c = 2
lda #<CHARSET+8
sta charset
lda #>CHARSET+8
sta charset+1
lda #0
sta c
b1:
ldy c
lda charset_spec_row,y
lda c
asl
tax
lda charset_spec_row,x
sta gen_char3.spec
lda charset_spec_row+1,y
lda charset_spec_row+1,x
sta gen_char3.spec+1
jsr gen_char3
lda #8
@ -28,11 +30,8 @@ main: {
bcc !+
inc charset+1
!:
lda c
clc
adc #2
sta c
lda #6
inc c
lda #4
cmp c
bne b1
lda #SCREEN/$40|CHARSET/$400
@ -41,9 +40,9 @@ main: {
}
// Generate one 5x3 character from a 16-bit char spec
// The 5x3 char is stored as 5x 3-bit rows followed by a zero. %aaabbbcc cdddeee0
// gen_char3(byte* zeropage(2) dst, word zeropage(6) spec)
// gen_char3(byte* zeropage(3) dst, word zeropage(6) spec)
gen_char3: {
.label dst = 2
.label dst = 3
.label spec = 6
.label r = 5
lda #0

View File

@ -11,53 +11,54 @@ main: scope:[main] from @1
[4] phi()
to:main::@1
main::@1: scope:[main] from main main::@3
[5] (byte) main::c#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::c#1 )
[5] (byte*) main::charset#2 ← phi( main/(const byte*) CHARSET#0+(byte/signed byte/word/signed word/dword/signed dword) 8 main::@3/(byte*) main::charset#1 )
[6] (byte*) gen_char3::dst#0 ← (byte*) main::charset#2
[7] (word) gen_char3::spec#0 ← *((const word[]) charset_spec_row#0 + (byte) main::c#2)
[8] call gen_char3
[5] (byte) main::c#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::c#1 )
[6] (byte) main::$10 ← (byte) main::c#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[7] (byte*) gen_char3::dst#0 ← (byte*) main::charset#2
[8] (word) gen_char3::spec#0 ← *((const word[]) charset_spec_row#0 + (byte) main::$10)
[9] call gen_char3
to:main::@3
main::@3: scope:[main] from main::@1
[9] (byte*) main::charset#1 ← (byte*) main::charset#2 + (byte/signed byte/word/signed word/dword/signed dword) 8
[10] (byte) main::c#1 ← (byte) main::c#2 + (byte/signed byte/word/signed word/dword/signed dword) 2
[11] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 6) goto main::@1
[10] (byte*) main::charset#1 ← (byte*) main::charset#2 + (byte/signed byte/word/signed word/dword/signed dword) 8
[11] (byte) main::c#1 ← ++ (byte) main::c#2
[12] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 4) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@3
[12] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) SCREEN#0/(byte/signed byte/word/signed word/dword/signed dword) $40|((word))(const byte*) CHARSET#0/(word/signed word/dword/signed dword) $400
[13] *((const byte*) VIC_MEMORY#0) ← ((byte))((word))(const byte*) SCREEN#0/(byte/signed byte/word/signed word/dword/signed dword) $40|((word))(const byte*) CHARSET#0/(word/signed word/dword/signed dword) $400
to:main::@return
main::@return: scope:[main] from main::@2
[13] return
[14] return
to:@return
gen_char3: scope:[gen_char3] from main::@1
[14] phi()
[15] phi()
to:gen_char3::@1
gen_char3::@1: scope:[gen_char3] from gen_char3 gen_char3::@5
[15] (byte) gen_char3::r#6 ← phi( gen_char3/(byte/signed byte/word/signed word/dword/signed dword) 0 gen_char3::@5/(byte) gen_char3::r#1 )
[15] (word) gen_char3::spec#4 ← phi( gen_char3/(word) gen_char3::spec#0 gen_char3::@5/(word) gen_char3::spec#1 )
[16] (byte) gen_char3::r#6 ← phi( gen_char3/(byte/signed byte/word/signed word/dword/signed dword) 0 gen_char3::@5/(byte) gen_char3::r#1 )
[16] (word) gen_char3::spec#4 ← phi( gen_char3/(word) gen_char3::spec#0 gen_char3::@5/(word) gen_char3::spec#1 )
to:gen_char3::@2
gen_char3::@2: scope:[gen_char3] from gen_char3::@1 gen_char3::@3
[16] (byte) gen_char3::c#2 ← phi( gen_char3::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 gen_char3::@3/(byte) gen_char3::c#1 )
[16] (byte) gen_char3::b#4 ← phi( gen_char3::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 gen_char3::@3/(byte) gen_char3::b#1 )
[16] (word) gen_char3::spec#2 ← phi( gen_char3::@1/(word) gen_char3::spec#4 gen_char3::@3/(word) gen_char3::spec#1 )
[17] (byte~) gen_char3::$0 ← > (word) gen_char3::spec#2
[18] (byte~) gen_char3::$1 ← (byte~) gen_char3::$0 & (byte/word/signed word/dword/signed dword) $80
[19] if((byte~) gen_char3::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gen_char3::@3
[17] (byte) gen_char3::c#2 ← phi( gen_char3::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 gen_char3::@3/(byte) gen_char3::c#1 )
[17] (byte) gen_char3::b#4 ← phi( gen_char3::@1/(byte/signed byte/word/signed word/dword/signed dword) 0 gen_char3::@3/(byte) gen_char3::b#1 )
[17] (word) gen_char3::spec#2 ← phi( gen_char3::@1/(word) gen_char3::spec#4 gen_char3::@3/(word) gen_char3::spec#1 )
[18] (byte~) gen_char3::$0 ← > (word) gen_char3::spec#2
[19] (byte~) gen_char3::$1 ← (byte~) gen_char3::$0 & (byte/word/signed word/dword/signed dword) $80
[20] if((byte~) gen_char3::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gen_char3::@3
to:gen_char3::@4
gen_char3::@4: scope:[gen_char3] from gen_char3::@2
[20] (byte) gen_char3::b#2 ← (byte) gen_char3::b#4 | (byte/signed byte/word/signed word/dword/signed dword) 1
[21] (byte) gen_char3::b#2 ← (byte) gen_char3::b#4 | (byte/signed byte/word/signed word/dword/signed dword) 1
to:gen_char3::@3
gen_char3::@3: scope:[gen_char3] from gen_char3::@2 gen_char3::@4
[21] (byte) gen_char3::b#3 ← phi( gen_char3::@2/(byte) gen_char3::b#4 gen_char3::@4/(byte) gen_char3::b#2 )
[22] (byte) gen_char3::b#1 ← (byte) gen_char3::b#3 << (byte/signed byte/word/signed word/dword/signed dword) 1
[23] (word) gen_char3::spec#1 ← (word) gen_char3::spec#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[24] (byte) gen_char3::c#1 ← ++ (byte) gen_char3::c#2
[25] if((byte) gen_char3::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 3) goto gen_char3::@2
[22] (byte) gen_char3::b#3 ← phi( gen_char3::@2/(byte) gen_char3::b#4 gen_char3::@4/(byte) gen_char3::b#2 )
[23] (byte) gen_char3::b#1 ← (byte) gen_char3::b#3 << (byte/signed byte/word/signed word/dword/signed dword) 1
[24] (word) gen_char3::spec#1 ← (word) gen_char3::spec#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[25] (byte) gen_char3::c#1 ← ++ (byte) gen_char3::c#2
[26] if((byte) gen_char3::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 3) goto gen_char3::@2
to:gen_char3::@5
gen_char3::@5: scope:[gen_char3] from gen_char3::@3
[26] *((byte*) gen_char3::dst#0 + (byte) gen_char3::r#6) ← (byte) gen_char3::b#1
[27] (byte) gen_char3::r#1 ← ++ (byte) gen_char3::r#6
[28] if((byte) gen_char3::r#1!=(byte/signed byte/word/signed word/dword/signed dword) 5) goto gen_char3::@1
[27] *((byte*) gen_char3::dst#0 + (byte) gen_char3::r#6) ← (byte) gen_char3::b#1
[28] (byte) gen_char3::r#1 ← ++ (byte) gen_char3::r#6
[29] if((byte) gen_char3::r#1!=(byte/signed byte/word/signed word/dword/signed dword) 5) goto gen_char3::@1
to:gen_char3::@return
gen_char3::@return: scope:[gen_char3] from gen_char3::@5
[29] return
[30] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,7 @@
(byte) gen_char3::c#1 reg byte x 1501.5
(byte) gen_char3::c#2 reg byte x 250.25
(byte*) gen_char3::dst
(byte*) gen_char3::dst#0 dst zp ZP_WORD:2 6.588235294117648
(byte*) gen_char3::dst#0 dst zp ZP_WORD:3 6.588235294117648
(byte) gen_char3::r
(byte) gen_char3::r#1 r zp ZP_BYTE:5 151.5
(byte) gen_char3::r#6 r zp ZP_BYTE:5 25.25
@ -37,22 +37,24 @@
(word) gen_char3::spec#2 spec zp ZP_WORD:6 443.42857142857144
(word) gen_char3::spec#4 spec zp ZP_WORD:6 204.0
(void()) main()
(byte) main::$10 reg byte x 11.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@return
(byte) main::c
(byte) main::c#1 c zp ZP_BYTE:4 16.5
(byte) main::c#2 c zp ZP_BYTE:4 6.6000000000000005
(byte) main::c#1 c zp ZP_BYTE:2 16.5
(byte) main::c#2 c zp ZP_BYTE:2 5.5
(byte*) main::charset
(byte*) main::charset#1 charset zp ZP_WORD:2 7.333333333333333
(byte*) main::charset#2 charset zp ZP_WORD:2 8.25
(byte*) main::charset#1 charset zp ZP_WORD:3 7.333333333333333
(byte*) main::charset#2 charset zp ZP_WORD:3 6.6000000000000005
zp ZP_WORD:2 [ main::charset#2 main::charset#1 gen_char3::dst#0 ]
zp ZP_BYTE:4 [ main::c#2 main::c#1 ]
zp ZP_BYTE:2 [ main::c#2 main::c#1 ]
zp ZP_WORD:3 [ main::charset#2 main::charset#1 gen_char3::dst#0 ]
zp ZP_BYTE:5 [ gen_char3::r#6 gen_char3::r#1 ]
zp ZP_WORD:6 [ gen_char3::spec#2 gen_char3::spec#4 gen_char3::spec#0 gen_char3::spec#1 ]
reg byte x [ gen_char3::c#2 gen_char3::c#1 ]
reg byte y [ gen_char3::b#3 gen_char3::b#4 gen_char3::b#1 gen_char3::b#2 ]
reg byte x [ main::$10 ]
reg byte a [ gen_char3::$0 ]
reg byte a [ gen_char3::$1 ]

View File

@ -2,6 +2,8 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.const SIZEOF_WORD = 2
.const SIZEOF_SIGNED_WORD = 2
.label ub_screen = $400
.label sb_screen = $428
.label uw_screen = $450
@ -16,48 +18,48 @@ main: {
lda #sb
sta ub_screen+1
lda #<uw
sta ub_screen+2
sta ub_screen+1*SIZEOF_WORD
lda #>uw
sta ub_screen+2+1
sta ub_screen+1*SIZEOF_WORD+1
lda #<sw
sta ub_screen+4
sta ub_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta ub_screen+4+1
sta ub_screen+2*SIZEOF_SIGNED_WORD+1
lda #ub
sta sb_screen
lda #sb
sta sb_screen+1
lda #<uw
sta sb_screen+2
sta sb_screen+1*SIZEOF_WORD
lda #>uw
sta sb_screen+2+1
sta sb_screen+1*SIZEOF_WORD+1
lda #<sw
sta sb_screen+4
sta sb_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta sb_screen+4+1
sta sb_screen+2*SIZEOF_SIGNED_WORD+1
lda #ub
sta uw_screen
lda #sb
sta uw_screen+1
lda #<uw
sta uw_screen+2
sta uw_screen+1*SIZEOF_WORD
lda #>uw
sta uw_screen+2+1
sta uw_screen+1*SIZEOF_WORD+1
lda #<sw
sta uw_screen+4
sta uw_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta uw_screen+4+1
sta uw_screen+2*SIZEOF_SIGNED_WORD+1
lda #ub
sta sw_screen
lda #sb
sta sw_screen+1
lda #<uw
sta sw_screen+2
sta sw_screen+1*SIZEOF_WORD
lda #>uw
sta sw_screen+2+1
sta sw_screen+1*SIZEOF_WORD+1
lda #<sw
sta sw_screen+4
sta sw_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta sw_screen+4+1
sta sw_screen+2*SIZEOF_SIGNED_WORD+1
rts
}

View File

@ -10,20 +10,20 @@
main: scope:[main] from @1
[4] *(((byte*))(const byte*) ub_screen#0) ← (const byte) ub#0
[5] *(((signed byte*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0
[6] *(((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0
[7] *(((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0
[6] *(((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0
[7] *(((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0
[8] *(((byte*))(const signed byte*) sb_screen#0) ← (const byte) ub#0
[9] *(((signed byte*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0
[10] *(((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0
[11] *(((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0
[10] *(((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0
[11] *(((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0
[12] *(((byte*))(const word*) uw_screen#0) ← (const byte) ub#0
[13] *(((signed byte*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0
[14] *(((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0
[15] *(((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0
[14] *(((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0
[15] *(((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0
[16] *(((byte*))(const signed word*) sw_screen#0) ← (const byte) ub#0
[17] *(((signed byte*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0
[18] *(((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0
[19] *(((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0
[18] *(((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0
[19] *(((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0
to:main::@return
main::@return: scope:[main] from main
[20] return

View File

@ -1,3 +1,11 @@
Fixing pointer addition (word*~) main::$4 ← (word*~) main::$3 + (byte/signed byte/word/signed word/dword/signed dword) 1
Fixing pointer addition (signed word*~) main::$6 ← (signed word*~) main::$5 + (byte/signed byte/word/signed word/dword/signed dword) 2
Fixing pointer addition (word*~) main::$11 ← (word*~) main::$10 + (byte/signed byte/word/signed word/dword/signed dword) 1
Fixing pointer addition (signed word*~) main::$13 ← (signed word*~) main::$12 + (byte/signed byte/word/signed word/dword/signed dword) 2
Fixing pointer addition (word*~) main::$18 ← (word*~) main::$17 + (byte/signed byte/word/signed word/dword/signed dword) 1
Fixing pointer addition (signed word*~) main::$20 ← (signed word*~) main::$19 + (byte/signed byte/word/signed word/dword/signed dword) 2
Fixing pointer addition (word*~) main::$25 ← (word*~) main::$24 + (byte/signed byte/word/signed word/dword/signed dword) 1
Fixing pointer addition (signed word*~) main::$27 ← (signed word*~) main::$26 + (byte/signed byte/word/signed word/dword/signed dword) 2
Identified constant variable (byte*) ub_screen
Identified constant variable (signed byte*) sb_screen
Identified constant variable (word*) uw_screen
@ -27,10 +35,12 @@ main: scope:[main] from @1
(signed byte*~) main::$2 ← (signed byte*~) main::$1 + (byte/signed byte/word/signed word/dword/signed dword) 1
*((signed byte*~) main::$2) ← (signed byte) sb#1
(word*~) main::$3 ← ((word*)) (byte*) ub_screen#0
(word*~) main::$4 ← (word*~) main::$3 + (byte/signed byte/word/signed word/dword/signed dword) 2
(byte/signed byte/word/signed word/dword/signed dword) main::$28 ← (byte/signed byte/word/signed word/dword/signed dword) 1 * (const byte) SIZEOF_WORD
(word*~) main::$4 ← (word*~) main::$3 + (byte/signed byte/word/signed word/dword/signed dword) main::$28
*((word*~) main::$4) ← (word) uw#0
(signed word*~) main::$5 ← ((signed word*)) (byte*) ub_screen#0
(signed word*~) main::$6 ← (signed word*~) main::$5 + (byte/signed byte/word/signed word/dword/signed dword) 4
(byte/signed byte/word/signed word/dword/signed dword) main::$29 ← (byte/signed byte/word/signed word/dword/signed dword) 2 * (const byte) SIZEOF_SIGNED_WORD
(signed word*~) main::$6 ← (signed word*~) main::$5 + (byte/signed byte/word/signed word/dword/signed dword) main::$29
*((signed word*~) main::$6) ← (signed word) sw#1
(byte*~) main::$7 ← ((byte*)) (signed byte*) sb_screen#0
*((byte*~) main::$7) ← (byte) ub#0
@ -38,10 +48,12 @@ main: scope:[main] from @1
(signed byte*~) main::$9 ← (signed byte*~) main::$8 + (byte/signed byte/word/signed word/dword/signed dword) 1
*((signed byte*~) main::$9) ← (signed byte) sb#1
(word*~) main::$10 ← ((word*)) (signed byte*) sb_screen#0
(word*~) main::$11 ← (word*~) main::$10 + (byte/signed byte/word/signed word/dword/signed dword) 2
(byte/signed byte/word/signed word/dword/signed dword) main::$30 ← (byte/signed byte/word/signed word/dword/signed dword) 1 * (const byte) SIZEOF_WORD
(word*~) main::$11 ← (word*~) main::$10 + (byte/signed byte/word/signed word/dword/signed dword) main::$30
*((word*~) main::$11) ← (word) uw#0
(signed word*~) main::$12 ← ((signed word*)) (signed byte*) sb_screen#0
(signed word*~) main::$13 ← (signed word*~) main::$12 + (byte/signed byte/word/signed word/dword/signed dword) 4
(byte/signed byte/word/signed word/dword/signed dword) main::$31 ← (byte/signed byte/word/signed word/dword/signed dword) 2 * (const byte) SIZEOF_SIGNED_WORD
(signed word*~) main::$13 ← (signed word*~) main::$12 + (byte/signed byte/word/signed word/dword/signed dword) main::$31
*((signed word*~) main::$13) ← (signed word) sw#1
(byte*~) main::$14 ← ((byte*)) (word*) uw_screen#0
*((byte*~) main::$14) ← (byte) ub#0
@ -49,10 +61,12 @@ main: scope:[main] from @1
(signed byte*~) main::$16 ← (signed byte*~) main::$15 + (byte/signed byte/word/signed word/dword/signed dword) 1
*((signed byte*~) main::$16) ← (signed byte) sb#1
(word*~) main::$17 ← ((word*)) (word*) uw_screen#0
(word*~) main::$18 ← (word*~) main::$17 + (byte/signed byte/word/signed word/dword/signed dword) 2
(byte/signed byte/word/signed word/dword/signed dword) main::$32 ← (byte/signed byte/word/signed word/dword/signed dword) 1 * (const byte) SIZEOF_WORD
(word*~) main::$18 ← (word*~) main::$17 + (byte/signed byte/word/signed word/dword/signed dword) main::$32
*((word*~) main::$18) ← (word) uw#0
(signed word*~) main::$19 ← ((signed word*)) (word*) uw_screen#0
(signed word*~) main::$20 ← (signed word*~) main::$19 + (byte/signed byte/word/signed word/dword/signed dword) 4
(byte/signed byte/word/signed word/dword/signed dword) main::$33 ← (byte/signed byte/word/signed word/dword/signed dword) 2 * (const byte) SIZEOF_SIGNED_WORD
(signed word*~) main::$20 ← (signed word*~) main::$19 + (byte/signed byte/word/signed word/dword/signed dword) main::$33
*((signed word*~) main::$20) ← (signed word) sw#1
(byte*~) main::$21 ← ((byte*)) (signed word*) sw_screen#0
*((byte*~) main::$21) ← (byte) ub#0
@ -60,10 +74,12 @@ main: scope:[main] from @1
(signed byte*~) main::$23 ← (signed byte*~) main::$22 + (byte/signed byte/word/signed word/dword/signed dword) 1
*((signed byte*~) main::$23) ← (signed byte) sb#1
(word*~) main::$24 ← ((word*)) (signed word*) sw_screen#0
(word*~) main::$25 ← (word*~) main::$24 + (byte/signed byte/word/signed word/dword/signed dword) 2
(byte/signed byte/word/signed word/dword/signed dword) main::$34 ← (byte/signed byte/word/signed word/dword/signed dword) 1 * (const byte) SIZEOF_WORD
(word*~) main::$25 ← (word*~) main::$24 + (byte/signed byte/word/signed word/dword/signed dword) main::$34
*((word*~) main::$25) ← (word) uw#0
(signed word*~) main::$26 ← ((signed word*)) (signed word*) sw_screen#0
(signed word*~) main::$27 ← (signed word*~) main::$26 + (byte/signed byte/word/signed word/dword/signed dword) 4
(byte/signed byte/word/signed word/dword/signed dword) main::$35 ← (byte/signed byte/word/signed word/dword/signed dword) 2 * (const byte) SIZEOF_SIGNED_WORD
(signed word*~) main::$27 ← (signed word*~) main::$26 + (byte/signed byte/word/signed word/dword/signed dword) main::$35
*((signed word*~) main::$27) ← (signed word) sw#1
to:main::@return
main::@return: scope:[main] from main
@ -85,6 +101,8 @@ SYMBOL TABLE SSA
(label) @2
(label) @begin
(label) @end
(const byte) SIZEOF_SIGNED_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(const byte) SIZEOF_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(void()) main()
(byte*~) main::$0
(signed byte*~) main::$1
@ -107,7 +125,15 @@ SYMBOL TABLE SSA
(word*~) main::$25
(signed word*~) main::$26
(signed word*~) main::$27
(byte/signed byte/word/signed word/dword/signed dword) main::$28
(byte/signed byte/word/signed word/dword/signed dword) main::$29
(word*~) main::$3
(byte/signed byte/word/signed word/dword/signed dword) main::$30
(byte/signed byte/word/signed word/dword/signed dword) main::$31
(byte/signed byte/word/signed word/dword/signed dword) main::$32
(byte/signed byte/word/signed word/dword/signed dword) main::$33
(byte/signed byte/word/signed word/dword/signed dword) main::$34
(byte/signed byte/word/signed word/dword/signed dword) main::$35
(word*~) main::$4
(signed word*~) main::$5
(signed word*~) main::$6
@ -152,6 +178,14 @@ Constant (const byte) ub#0 = $29
Constant (const signed byte) sb#0 = -$29
Constant (const word) uw#0 = $3000
Constant (const signed word) sw#0 = -$3000
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$28 = 1*SIZEOF_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$29 = 2*SIZEOF_SIGNED_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$30 = 1*SIZEOF_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$31 = 2*SIZEOF_SIGNED_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$32 = 1*SIZEOF_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$33 = 2*SIZEOF_SIGNED_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$34 = 1*SIZEOF_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$35 = 2*SIZEOF_SIGNED_WORD
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) main::$0 = ((byte*))ub_screen#0
Constant (const signed byte*) main::$1 = ((signed byte*))ub_screen#0
@ -171,43 +205,51 @@ Constant (const word*) main::$24 = ((word*))sw_screen#0
Constant (const signed word*) main::$26 = ((signed word*))sw_screen#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const signed byte*) main::$2 = main::$1+1
Constant (const word*) main::$4 = main::$3+2
Constant (const signed word*) main::$6 = main::$5+4
Constant (const word*) main::$4 = main::$3+main::$28
Constant (const signed word*) main::$6 = main::$5+main::$29
Constant (const signed byte*) main::$9 = main::$8+1
Constant (const word*) main::$11 = main::$10+2
Constant (const signed word*) main::$13 = main::$12+4
Constant (const word*) main::$11 = main::$10+main::$30
Constant (const signed word*) main::$13 = main::$12+main::$31
Constant (const signed byte*) main::$16 = main::$15+1
Constant (const word*) main::$18 = main::$17+2
Constant (const signed word*) main::$20 = main::$19+4
Constant (const word*) main::$18 = main::$17+main::$32
Constant (const signed word*) main::$20 = main::$19+main::$33
Constant (const signed byte*) main::$23 = main::$22+1
Constant (const word*) main::$25 = main::$24+2
Constant (const signed word*) main::$27 = main::$26+4
Constant (const word*) main::$25 = main::$24+main::$34
Constant (const signed word*) main::$27 = main::$26+main::$35
Successful SSA optimization Pass2ConstantIdentification
Constant inlined main::$34 = (byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD
Constant inlined main::$12 = ((signed word*))(const signed byte*) sb_screen#0
Constant inlined main::$13 = ((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4
Constant inlined main::$35 = (byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD
Constant inlined main::$13 = ((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD
Constant inlined main::$14 = ((byte*))(const word*) uw_screen#0
Constant inlined main::$15 = ((signed byte*))(const word*) uw_screen#0
Constant inlined main::$30 = (byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD
Constant inlined main::$31 = (byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD
Constant inlined main::$32 = (byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD
Constant inlined main::$10 = ((word*))(const signed byte*) sb_screen#0
Constant inlined main::$11 = ((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::$33 = (byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD
Constant inlined main::$11 = ((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD
Constant inlined main::$16 = ((signed byte*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::$17 = ((word*))(const word*) uw_screen#0
Constant inlined main::$18 = ((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::$18 = ((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD
Constant inlined main::$19 = ((signed word*))(const word*) uw_screen#0
Constant inlined main::$23 = ((signed byte*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::$24 = ((word*))(const signed word*) sw_screen#0
Constant inlined main::$25 = ((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::$25 = ((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD
Constant inlined main::$26 = ((signed word*))(const signed word*) sw_screen#0
Constant inlined main::$20 = ((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4
Constant inlined main::$20 = ((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD
Constant inlined main::$21 = ((byte*))(const signed word*) sw_screen#0
Constant inlined main::$22 = ((signed byte*))(const signed word*) sw_screen#0
Constant inlined main::$1 = ((signed byte*))(const byte*) ub_screen#0
Constant inlined main::$27 = ((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4
Constant inlined main::$27 = ((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD
Constant inlined main::$28 = (byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD
Constant inlined main::$2 = ((signed byte*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::$29 = (byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD
Constant inlined main::$0 = ((byte*))(const byte*) ub_screen#0
Constant inlined main::$5 = ((signed word*))(const byte*) ub_screen#0
Constant inlined main::$6 = ((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4
Constant inlined main::$6 = ((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD
Constant inlined main::$3 = ((word*))(const byte*) ub_screen#0
Constant inlined main::$4 = ((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::$4 = ((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD
Constant inlined main::$9 = ((signed byte*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1
Constant inlined main::$7 = ((byte*))(const signed byte*) sb_screen#0
Constant inlined main::$8 = ((signed byte*))(const signed byte*) sb_screen#0
@ -237,20 +279,20 @@ FINAL CONTROL FLOW GRAPH
main: scope:[main] from @1
[4] *(((byte*))(const byte*) ub_screen#0) ← (const byte) ub#0
[5] *(((signed byte*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0
[6] *(((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0
[7] *(((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0
[6] *(((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0
[7] *(((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0
[8] *(((byte*))(const signed byte*) sb_screen#0) ← (const byte) ub#0
[9] *(((signed byte*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0
[10] *(((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0
[11] *(((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0
[10] *(((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0
[11] *(((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0
[12] *(((byte*))(const word*) uw_screen#0) ← (const byte) ub#0
[13] *(((signed byte*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0
[14] *(((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0
[15] *(((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0
[14] *(((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0
[15] *(((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0
[16] *(((byte*))(const signed word*) sw_screen#0) ← (const byte) ub#0
[17] *(((signed byte*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0
[18] *(((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0
[19] *(((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0
[18] *(((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0
[19] *(((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0
to:main::@return
main::@return: scope:[main] from main
[20] return
@ -279,6 +321,8 @@ INITIAL ASM
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_WORD = 2
.const SIZEOF_SIGNED_WORD = 2
.label ub_screen = $400
.label sb_screen = $428
.label uw_screen = $450
@ -309,64 +353,64 @@ main: {
//SEG11 [5] *(((signed byte*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2
lda #sb
sta ub_screen+1
//SEG12 [6] *(((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
//SEG12 [6] *(((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
lda #<uw
sta ub_screen+2
sta ub_screen+1*SIZEOF_WORD
lda #>uw
sta ub_screen+2+1
//SEG13 [7] *(((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
sta ub_screen+1*SIZEOF_WORD+1
//SEG13 [7] *(((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
lda #<sw
sta ub_screen+4
sta ub_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta ub_screen+4+1
sta ub_screen+2*SIZEOF_SIGNED_WORD+1
//SEG14 [8] *(((byte*))(const signed byte*) sb_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2
lda #ub
sta sb_screen
//SEG15 [9] *(((signed byte*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2
lda #sb
sta sb_screen+1
//SEG16 [10] *(((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
//SEG16 [10] *(((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
lda #<uw
sta sb_screen+2
sta sb_screen+1*SIZEOF_WORD
lda #>uw
sta sb_screen+2+1
//SEG17 [11] *(((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
sta sb_screen+1*SIZEOF_WORD+1
//SEG17 [11] *(((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
lda #<sw
sta sb_screen+4
sta sb_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta sb_screen+4+1
sta sb_screen+2*SIZEOF_SIGNED_WORD+1
//SEG18 [12] *(((byte*))(const word*) uw_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2
lda #ub
sta uw_screen
//SEG19 [13] *(((signed byte*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2
lda #sb
sta uw_screen+1
//SEG20 [14] *(((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
//SEG20 [14] *(((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
lda #<uw
sta uw_screen+2
sta uw_screen+1*SIZEOF_WORD
lda #>uw
sta uw_screen+2+1
//SEG21 [15] *(((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
sta uw_screen+1*SIZEOF_WORD+1
//SEG21 [15] *(((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
lda #<sw
sta uw_screen+4
sta uw_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta uw_screen+4+1
sta uw_screen+2*SIZEOF_SIGNED_WORD+1
//SEG22 [16] *(((byte*))(const signed word*) sw_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2
lda #ub
sta sw_screen
//SEG23 [17] *(((signed byte*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2
lda #sb
sta sw_screen+1
//SEG24 [18] *(((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
//SEG24 [18] *(((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
lda #<uw
sta sw_screen+2
sta sw_screen+1*SIZEOF_WORD
lda #>uw
sta sw_screen+2+1
//SEG25 [19] *(((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
sta sw_screen+1*SIZEOF_WORD+1
//SEG25 [19] *(((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
lda #<sw
sta sw_screen+4
sta sw_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta sw_screen+4+1
sta sw_screen+2*SIZEOF_SIGNED_WORD+1
jmp breturn
//SEG26 main::@return
breturn:
@ -377,20 +421,20 @@ main: {
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *(((byte*))(const byte*) ub_screen#0) ← (const byte) ub#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [5] *(((signed byte*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] *(((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] *(((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [6] *(((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [7] *(((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [8] *(((byte*))(const signed byte*) sb_screen#0) ← (const byte) ub#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [9] *(((signed byte*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [10] *(((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [11] *(((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [10] *(((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [11] *(((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [12] *(((byte*))(const word*) uw_screen#0) ← (const byte) ub#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [13] *(((signed byte*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [14] *(((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [15] *(((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [14] *(((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [15] *(((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [16] *(((byte*))(const signed word*) sw_screen#0) ← (const byte) ub#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [17] *(((signed byte*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [18] *(((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [19] *(((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [18] *(((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [19] *(((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
REGISTER UPLIFT SCOPES
Uplift Scope [main]
@ -407,6 +451,8 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_WORD = 2
.const SIZEOF_SIGNED_WORD = 2
.label ub_screen = $400
.label sb_screen = $428
.label uw_screen = $450
@ -437,64 +483,64 @@ main: {
//SEG11 [5] *(((signed byte*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2
lda #sb
sta ub_screen+1
//SEG12 [6] *(((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
//SEG12 [6] *(((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
lda #<uw
sta ub_screen+2
sta ub_screen+1*SIZEOF_WORD
lda #>uw
sta ub_screen+2+1
//SEG13 [7] *(((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
sta ub_screen+1*SIZEOF_WORD+1
//SEG13 [7] *(((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
lda #<sw
sta ub_screen+4
sta ub_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta ub_screen+4+1
sta ub_screen+2*SIZEOF_SIGNED_WORD+1
//SEG14 [8] *(((byte*))(const signed byte*) sb_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2
lda #ub
sta sb_screen
//SEG15 [9] *(((signed byte*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2
lda #sb
sta sb_screen+1
//SEG16 [10] *(((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
//SEG16 [10] *(((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
lda #<uw
sta sb_screen+2
sta sb_screen+1*SIZEOF_WORD
lda #>uw
sta sb_screen+2+1
//SEG17 [11] *(((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
sta sb_screen+1*SIZEOF_WORD+1
//SEG17 [11] *(((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
lda #<sw
sta sb_screen+4
sta sb_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta sb_screen+4+1
sta sb_screen+2*SIZEOF_SIGNED_WORD+1
//SEG18 [12] *(((byte*))(const word*) uw_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2
lda #ub
sta uw_screen
//SEG19 [13] *(((signed byte*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2
lda #sb
sta uw_screen+1
//SEG20 [14] *(((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
//SEG20 [14] *(((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
lda #<uw
sta uw_screen+2
sta uw_screen+1*SIZEOF_WORD
lda #>uw
sta uw_screen+2+1
//SEG21 [15] *(((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
sta uw_screen+1*SIZEOF_WORD+1
//SEG21 [15] *(((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
lda #<sw
sta uw_screen+4
sta uw_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta uw_screen+4+1
sta uw_screen+2*SIZEOF_SIGNED_WORD+1
//SEG22 [16] *(((byte*))(const signed word*) sw_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2
lda #ub
sta sw_screen
//SEG23 [17] *(((signed byte*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2
lda #sb
sta sw_screen+1
//SEG24 [18] *(((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
//SEG24 [18] *(((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
lda #<uw
sta sw_screen+2
sta sw_screen+1*SIZEOF_WORD
lda #>uw
sta sw_screen+2+1
//SEG25 [19] *(((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
sta sw_screen+1*SIZEOF_WORD+1
//SEG25 [19] *(((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
lda #<sw
sta sw_screen+4
sta sw_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta sw_screen+4+1
sta sw_screen+2*SIZEOF_SIGNED_WORD+1
jmp breturn
//SEG26 main::@return
breturn:
@ -524,6 +570,8 @@ FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(const byte) SIZEOF_WORD SIZEOF_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(void()) main()
(label) main::@return
(signed byte) sb
@ -555,6 +603,8 @@ Score: 150
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_WORD = 2
.const SIZEOF_SIGNED_WORD = 2
.label ub_screen = $400
.label sb_screen = $428
.label uw_screen = $450
@ -577,64 +627,64 @@ main: {
//SEG11 [5] *(((signed byte*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2
lda #sb
sta ub_screen+1
//SEG12 [6] *(((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
//SEG12 [6] *(((word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
lda #<uw
sta ub_screen+2
sta ub_screen+1*SIZEOF_WORD
lda #>uw
sta ub_screen+2+1
//SEG13 [7] *(((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
sta ub_screen+1*SIZEOF_WORD+1
//SEG13 [7] *(((signed word*))(const byte*) ub_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
lda #<sw
sta ub_screen+4
sta ub_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta ub_screen+4+1
sta ub_screen+2*SIZEOF_SIGNED_WORD+1
//SEG14 [8] *(((byte*))(const signed byte*) sb_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2
lda #ub
sta sb_screen
//SEG15 [9] *(((signed byte*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2
lda #sb
sta sb_screen+1
//SEG16 [10] *(((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
//SEG16 [10] *(((word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
lda #<uw
sta sb_screen+2
sta sb_screen+1*SIZEOF_WORD
lda #>uw
sta sb_screen+2+1
//SEG17 [11] *(((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
sta sb_screen+1*SIZEOF_WORD+1
//SEG17 [11] *(((signed word*))(const signed byte*) sb_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
lda #<sw
sta sb_screen+4
sta sb_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta sb_screen+4+1
sta sb_screen+2*SIZEOF_SIGNED_WORD+1
//SEG18 [12] *(((byte*))(const word*) uw_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2
lda #ub
sta uw_screen
//SEG19 [13] *(((signed byte*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2
lda #sb
sta uw_screen+1
//SEG20 [14] *(((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
//SEG20 [14] *(((word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
lda #<uw
sta uw_screen+2
sta uw_screen+1*SIZEOF_WORD
lda #>uw
sta uw_screen+2+1
//SEG21 [15] *(((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
sta uw_screen+1*SIZEOF_WORD+1
//SEG21 [15] *(((signed word*))(const word*) uw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
lda #<sw
sta uw_screen+4
sta uw_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta uw_screen+4+1
sta uw_screen+2*SIZEOF_SIGNED_WORD+1
//SEG22 [16] *(((byte*))(const signed word*) sw_screen#0) ← (const byte) ub#0 -- _deref_pbuc1=vbuc2
lda #ub
sta sw_screen
//SEG23 [17] *(((signed byte*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const signed byte) sb#0 -- _deref_pbsc1=vbsc2
lda #sb
sta sw_screen+1
//SEG24 [18] *(((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
//SEG24 [18] *(((word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(const byte) SIZEOF_WORD) ← (const word) uw#0 -- _deref_pwuc1=vwuc2
lda #<uw
sta sw_screen+2
sta sw_screen+1*SIZEOF_WORD
lda #>uw
sta sw_screen+2+1
//SEG25 [19] *(((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
sta sw_screen+1*SIZEOF_WORD+1
//SEG25 [19] *(((signed word*))(const signed word*) sw_screen#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) SIZEOF_SIGNED_WORD) ← (const signed word) sw#0 -- _deref_pwsc1=vwsc2
lda #<sw
sta sw_screen+4
sta sw_screen+2*SIZEOF_SIGNED_WORD
lda #>sw
sta sw_screen+4+1
sta sw_screen+2*SIZEOF_SIGNED_WORD+1
//SEG26 main::@return
//SEG27 [20] return
rts

View File

@ -1,6 +1,8 @@
(label) @1
(label) @begin
(label) @end
(const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(const byte) SIZEOF_WORD SIZEOF_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(void()) main()
(label) main::@return
(signed byte) sb

View File

@ -2,6 +2,7 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.const SIZEOF_SIGNED_WORD = 2
// PI*2 in u[4.28] format
.const PI2_u4f28 = $6487ed51
// PI in u[4.28] format
@ -45,19 +46,19 @@ main: {
lda #>str
sta print_str.str+1
jsr print_str
lda st1
lda #SIZEOF_SIGNED_WORD
clc
adc #2
adc st1
sta st1
bcc !+
inc st1+1
!:
lda st1+1
cmp #>sintab1+wavelength*2
cmp #>sintab1+wavelength*SIZEOF_SIGNED_WORD
bcc b1
bne !+
lda st1
cmp #<sintab1+wavelength*2
cmp #<sintab1+wavelength*SIZEOF_SIGNED_WORD
bcc b1
!:
rts
@ -211,9 +212,9 @@ sin16s_gen: {
iny
lda _1+1
sta (sintab),y
lda sintab
lda #SIZEOF_SIGNED_WORD
clc
adc #2
adc sintab
sta sintab
bcc !+
inc sintab+1

View File

@ -35,8 +35,8 @@ main::@5: scope:[main] from main::@2
[17] call print_str
to:main::@6
main::@6: scope:[main] from main::@5
[18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (byte/signed byte/word/signed word/dword/signed dword) 2
[19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@1
[18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (const byte) SIZEOF_SIGNED_WORD
[19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@6
[20] return
@ -142,7 +142,7 @@ sin16s_gen::@1: scope:[sin16s_gen] from sin16s_gen::@2 sin16s_gen::@3
sin16s_gen::@3: scope:[sin16s_gen] from sin16s_gen::@1
[66] (signed word~) sin16s_gen::$1 ← (signed word) sin16s::return#0
[67] *((signed word*) sin16s_gen::sintab#2) ← (signed word~) sin16s_gen::$1
[68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (byte/signed byte/word/signed word/dword/signed dword) 2
[68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
[69] (dword) sin16s_gen::x#1 ← (dword) sin16s_gen::x#2 + (dword) sin16s_gen::step#0
[70] (word) sin16s_gen::i#1 ← ++ (word) sin16s_gen::i#2
[71] if((word) sin16s_gen::i#1<(const word) main::wavelength#0) goto sin16s_gen::@1

View File

@ -1,3 +1,7 @@
Fixing pointer increment (signed word*) sin16s_gen::sintab ← ++ (signed word*) sin16s_gen::sintab
Fixing pointer increment (signed word*) sin16s_gen2::sintab ← ++ (signed word*) sin16s_gen2::sintab
Fixing pointer increment (signed word*) main::st1 ← ++ (signed word*) main::st1
Fixing pointer addition (signed word*~) main::$7 ← (signed word[$78]) main::sintab1 + (word) main::wavelength
Identified constant variable (word) main::wavelength
CONTROL FLOW GRAPH SSA
@ -220,13 +224,12 @@ sin16s_gen::@4: scope:[sin16s_gen] from sin16s_gen::@1
(signed word) sin16s::return#3 ← phi( sin16s_gen::@1/(signed word) sin16s::return#0 )
(signed word~) sin16s_gen::$1 ← (signed word) sin16s::return#3
*((signed word*) sin16s_gen::sintab#2) ← (signed word~) sin16s_gen::$1
(signed word*~) sin16s_gen::$2 ← (signed word*) sin16s_gen::sintab#2 + (byte/signed byte/word/signed word/dword/signed dword) 2
(signed word*) sin16s_gen::sintab#0 ← (signed word*~) sin16s_gen::$2
(dword~) sin16s_gen::$3 ← (dword) sin16s_gen::x#3 + (dword) sin16s_gen::step#1
(dword) sin16s_gen::x#1 ← (dword~) sin16s_gen::$3
(signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
(dword~) sin16s_gen::$2 ← (dword) sin16s_gen::x#3 + (dword) sin16s_gen::step#1
(dword) sin16s_gen::x#1 ← (dword~) sin16s_gen::$2
(word) sin16s_gen::i#1 ← ++ (word) sin16s_gen::i#2
(bool~) sin16s_gen::$4 ← (word) sin16s_gen::i#1 < (word) sin16s_gen::wavelength#2
if((bool~) sin16s_gen::$4) goto sin16s_gen::@1
(bool~) sin16s_gen::$3 ← (word) sin16s_gen::i#1 < (word) sin16s_gen::wavelength#2
if((bool~) sin16s_gen::$3) goto sin16s_gen::@1
to:sin16s_gen::@return
sin16s_gen::@return: scope:[sin16s_gen] from sin16s_gen::@4
(word) rem16u#16 ← phi( sin16s_gen::@4/(word) rem16u#22 )
@ -593,12 +596,11 @@ main::@8: scope:[main] from main::@7
(signed word*) main::st1#3 ← phi( main::@7/(signed word*) main::st1#4 )
(byte*) print_char_cursor#38 ← phi( main::@7/(byte*) print_char_cursor#2 )
(byte*) print_char_cursor#18 ← (byte*) print_char_cursor#38
(signed word*~) main::$7 ← (signed word*) main::st1#3 + (byte/signed byte/word/signed word/dword/signed dword) 2
(signed word*) main::st1#1 ← (signed word*~) main::$7
(word/signed dword/dword~) main::$8 ← (word) main::wavelength#0 * (byte/signed byte/word/signed word/dword/signed dword) 2
(signed word*~) main::$9 ← (signed word[$78]) main::sintab1#0 + (word/signed dword/dword~) main::$8
(bool~) main::$10 ← (signed word*) main::st1#1 < (signed word*~) main::$9
if((bool~) main::$10) goto main::@1
(signed word*) main::st1#1 ← (signed word*) main::st1#3 + (const byte) SIZEOF_SIGNED_WORD
(word) main::$9 ← (word) main::wavelength#0 * (const byte) SIZEOF_SIGNED_WORD
(signed word*~) main::$7 ← (signed word[$78]) main::sintab1#0 + (word) main::$9
(bool~) main::$8 ← (signed word*) main::st1#1 < (signed word*~) main::$7
if((bool~) main::$8) goto main::@1
to:main::@return
main::@3: scope:[main] from main::@1
(byte*) print_line_cursor#19 ← phi( main::@1/(byte*) print_line_cursor#17 )
@ -659,6 +661,7 @@ SYMBOL TABLE SSA
(dword) PI_HALF_u4f28#0
(dword) PI_u4f28
(dword) PI_u4f28#0
(const byte) SIZEOF_SIGNED_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(dword()) div32u16u((dword) div32u16u::dividend , (word) div32u16u::divisor)
(word~) div32u16u::$0
(word~) div32u16u::$1
@ -767,12 +770,11 @@ SYMBOL TABLE SSA
(word) divr16u::return#5
(word) divr16u::return#6
(void()) main()
(bool~) main::$10
(bool~) main::$2
(bool~) main::$3
(signed word*~) main::$7
(word/signed dword/dword~) main::$8
(signed word*~) main::$9
(bool~) main::$8
(word) main::$9
(label) main::@1
(label) main::@2
(label) main::@3
@ -1176,9 +1178,8 @@ SYMBOL TABLE SSA
(void()) sin16s_gen((signed word*) sin16s_gen::sintab , (word) sin16s_gen::wavelength)
(dword~) sin16s_gen::$0
(signed word~) sin16s_gen::$1
(signed word*~) sin16s_gen::$2
(dword~) sin16s_gen::$3
(bool~) sin16s_gen::$4
(dword~) sin16s_gen::$2
(bool~) sin16s_gen::$3
(label) sin16s_gen::@1
(label) sin16s_gen::@3
(label) sin16s_gen::@4
@ -1214,11 +1215,11 @@ SYMBOL TABLE SSA
Inversing boolean not [10] (bool~) divr16u::$4 ← (byte~) divr16u::$2 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [9] (bool~) divr16u::$3 ← (byte~) divr16u::$2 != (byte/signed byte/word/signed word/dword/signed dword) 0
Inversing boolean not [18] (bool~) divr16u::$9 ← (word) divr16u::rem#6 < (word) divr16u::divisor#2 from [17] (bool~) divr16u::$8 ← (word) divr16u::rem#6 >= (word) divr16u::divisor#2
Inversing boolean not [74] (bool~) mul16u::$3 ← (byte/word~) mul16u::$1 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [73] (bool~) mul16u::$2 ← (byte/word~) mul16u::$1 != (byte/signed byte/word/signed word/dword/signed dword) 0
Inversing boolean not [124] (bool~) sin16s::$1 ← (dword) sin16s::x#3 < (dword) PI_u4f28#0 from [123] (bool~) sin16s::$0 ← (dword) sin16s::x#3 >= (dword) PI_u4f28#0
Inversing boolean not [128] (bool~) sin16s::$3 ← (dword) sin16s::x#4 < (dword) PI_HALF_u4f28#0 from [127] (bool~) sin16s::$2 ← (dword) sin16s::x#4 >= (dword) PI_HALF_u4f28#0
Inversing boolean not [188] (bool~) sin16s::$17 ← (byte) sin16s::isUpper#2 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [187] (bool~) sin16s::$16 ← (byte) sin16s::isUpper#2 != (byte/signed byte/word/signed word/dword/signed dword) 0
Inversing boolean not [232] (bool~) print_sword::$1 ← (signed word) print_sword::w#2 >= (byte/signed byte/word/signed word/dword/signed dword) 0 from [231] (bool~) print_sword::$0 ← (signed word) print_sword::w#2 < (byte/signed byte/word/signed word/dword/signed dword) 0
Inversing boolean not [317] (bool~) main::$3 ← (signed word) main::sw#0 < (byte/signed byte/word/signed word/dword/signed dword) 0 from [316] (bool~) main::$2 ← (signed word) main::sw#0 >= (byte/signed byte/word/signed word/dword/signed dword) 0
Inversing boolean not [123] (bool~) sin16s::$1 ← (dword) sin16s::x#3 < (dword) PI_u4f28#0 from [122] (bool~) sin16s::$0 ← (dword) sin16s::x#3 >= (dword) PI_u4f28#0
Inversing boolean not [127] (bool~) sin16s::$3 ← (dword) sin16s::x#4 < (dword) PI_HALF_u4f28#0 from [126] (bool~) sin16s::$2 ← (dword) sin16s::x#4 >= (dword) PI_HALF_u4f28#0
Inversing boolean not [187] (bool~) sin16s::$17 ← (byte) sin16s::isUpper#2 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [186] (bool~) sin16s::$16 ← (byte) sin16s::isUpper#2 != (byte/signed byte/word/signed word/dword/signed dword) 0
Inversing boolean not [231] (bool~) print_sword::$1 ← (signed word) print_sword::w#2 >= (byte/signed byte/word/signed word/dword/signed dword) 0 from [230] (bool~) print_sword::$0 ← (signed word) print_sword::w#2 < (byte/signed byte/word/signed word/dword/signed dword) 0
Inversing boolean not [316] (bool~) main::$3 ← (signed word) main::sw#0 < (byte/signed byte/word/signed word/dword/signed dword) 0 from [315] (bool~) main::$2 ← (signed word) main::sw#0 >= (byte/signed byte/word/signed word/dword/signed dword) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (word) divr16u::rem#0 = (word~) divr16u::$0 (word) divr16u::rem#7
Alias (word) divr16u::dividend#0 = (word~) divr16u::$6 (word) divr16u::dividend#8
@ -1265,8 +1266,7 @@ Alias (dword) sin16s_gen::step#1 = (dword) sin16s_gen::step#2
Alias (word) sin16s_gen::i#2 = (word) sin16s_gen::i#3
Alias (word) sin16s_gen::wavelength#2 = (word) sin16s_gen::wavelength#3
Alias (word) rem16u#16 = (word) rem16u#22 (word) rem16u#26 (word) rem16u#7
Alias (signed word*) sin16s_gen::sintab#0 = (signed word*~) sin16s_gen::$2
Alias (dword) sin16s_gen::x#1 = (dword~) sin16s_gen::$3
Alias (dword) sin16s_gen::x#1 = (dword~) sin16s_gen::$2
Alias (dword) sin16s::x#3 = (dword) sin16s::x#5
Alias (dword) sin16s::x#1 = (dword~) sin16s::$18
Alias (word) sin16s::x1#0 = (word~) sin16s::$5 (word) sin16s::x1#1 (word) sin16s::x1#4 (word) sin16s::x1#2 (word) sin16s::x1#3
@ -1325,7 +1325,6 @@ Alias (word) rem16u#18 = (word) rem16u#27 (word) rem16u#30 (word) rem16u#24 (wor
Alias (byte*) print_line_cursor#11 = (byte*) print_line_cursor#14 (byte*) print_line_cursor#16 (byte*) print_line_cursor#8 (byte*) print_line_cursor#4
Alias (byte*) print_char_cursor#17 = (byte*) print_char_cursor#37
Alias (byte*) print_char_cursor#18 = (byte*) print_char_cursor#38 (byte*) print_char_cursor#40 (byte*) print_char_cursor#20
Alias (signed word*) main::st1#1 = (signed word*~) main::$7
Alias (byte*) print_char_cursor#49 = (byte*) print_char_cursor#54
Alias (signed word) main::sw#0 = (signed word) main::sw#3 (signed word) main::sw#2
Alias (signed word*) main::st1#2 = (signed word*) main::st1#7 (signed word*) main::st1#6
@ -1406,15 +1405,15 @@ Simple Condition (bool~) divr16u::$9 [19] if((word) divr16u::rem#6<(word) divr16
Simple Condition (bool~) divr16u::$11 [26] if((byte) divr16u::i#1!=rangelast(0,$f)) goto divr16u::@1
Simple Condition (bool~) mul16u::$0 [70] if((word) mul16u::a#2!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul16u::@2
Simple Condition (bool~) mul16u::$3 [75] if((byte/word~) mul16u::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul16u::@4
Simple Condition (bool~) sin16s_gen::$4 [117] if((word) sin16s_gen::i#1<(word) sin16s_gen::wavelength#0) goto sin16s_gen::@1
Simple Condition (bool~) sin16s::$1 [125] if((dword) sin16s::x#0<(dword) PI_u4f28#0) goto sin16s::@1
Simple Condition (bool~) sin16s::$3 [129] if((dword) sin16s::x#4<(dword) PI_HALF_u4f28#0) goto sin16s::@2
Simple Condition (bool~) sin16s::$17 [189] if((byte) sin16s::isUpper#2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto sin16s::@3
Simple Condition (bool~) print_str::$0 [222] if(*((byte*) print_str::str#3)!=(byte) '@') goto print_str::@2
Simple Condition (bool~) print_sword::$1 [233] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1
Simple Condition (bool~) print_cls::$1 [293] if((byte*) print_cls::sc#1!=(byte*~) print_cls::$0) goto print_cls::@1
Simple Condition (bool~) main::$3 [318] if((signed word) main::sw#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2
Simple Condition (bool~) main::$10 [333] if((signed word*) main::st1#1<(signed word*~) main::$9) goto main::@1
Simple Condition (bool~) sin16s_gen::$3 [116] if((word) sin16s_gen::i#1<(word) sin16s_gen::wavelength#0) goto sin16s_gen::@1
Simple Condition (bool~) sin16s::$1 [124] if((dword) sin16s::x#0<(dword) PI_u4f28#0) goto sin16s::@1
Simple Condition (bool~) sin16s::$3 [128] if((dword) sin16s::x#4<(dword) PI_HALF_u4f28#0) goto sin16s::@2
Simple Condition (bool~) sin16s::$17 [188] if((byte) sin16s::isUpper#2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto sin16s::@3
Simple Condition (bool~) print_str::$0 [221] if(*((byte*) print_str::str#3)!=(byte) '@') goto print_str::@2
Simple Condition (bool~) print_sword::$1 [232] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1
Simple Condition (bool~) print_cls::$1 [292] if((byte*) print_cls::sc#1!=(byte*~) print_cls::$0) goto print_cls::@1
Simple Condition (bool~) main::$3 [317] if((signed word) main::sw#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2
Simple Condition (bool~) main::$8 [331] if((signed word*) main::st1#1<(signed word*~) main::$7) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const word) rem16u#0 = 0
Constant (const word) divr16u::quotient#0 = 0
@ -1447,12 +1446,12 @@ Constant (const byte*) print_cls::sc#0 = print_line_cursor#0
Constant (const byte*) print_cls::$0 = print_line_cursor#0+$3e8
Constant (const signed word*) sin16s_gen::sintab#1 = main::sintab1#0
Constant (const word) sin16s_gen::wavelength#0 = main::wavelength#0
Constant (const word/signed dword/dword) main::$8 = main::wavelength#0*2
Constant (const word) main::$9 = main::wavelength#0*SIZEOF_SIGNED_WORD
Successful SSA optimization Pass2ConstantIdentification
Constant (const word) divr16u::dividend#1 = >div32u16u::dividend#0
Constant (const word) divr16u::dividend#2 = <div32u16u::dividend#0
Constant (const word) div32u16u::divisor#0 = sin16s_gen::wavelength#0
Constant (const signed word*) main::$9 = main::sintab1#0+main::$8
Constant (const signed word*) main::$7 = main::sintab1#0+main::$9
Successful SSA optimization Pass2ConstantIdentification
Constant (const word) divr16u::divisor#0 = div32u16u::divisor#0
Constant (const word) divr16u::divisor#1 = div32u16u::divisor#0
@ -1532,8 +1531,8 @@ Constant inlined sin16s_gen::x#0 = (byte/signed byte/word/signed word/dword/sign
Constant inlined print_str::str#2 = (const string) main::str1
Constant inlined div32u16u::divisor#0 = (const word) main::wavelength#0
Constant inlined print_str::str#1 = (const string) main::str
Constant inlined main::$9 = (const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::$8 = (const word) main::wavelength#0*(byte/signed byte/word/signed word/dword/signed dword) 2
Constant inlined main::$9 = (const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD
Constant inlined main::$7 = (const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD
Successful SSA optimization Pass2ConstantInlining
Identical Phi Values (word) divr16u::divisor#6 (const word) main::wavelength#0
Successful SSA optimization Pass2IdenticalPhiElimination
@ -1711,8 +1710,8 @@ main::@5: scope:[main] from main::@2
[17] call print_str
to:main::@6
main::@6: scope:[main] from main::@5
[18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (byte/signed byte/word/signed word/dword/signed dword) 2
[19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@1
[18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (const byte) SIZEOF_SIGNED_WORD
[19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@6
[20] return
@ -1818,7 +1817,7 @@ sin16s_gen::@1: scope:[sin16s_gen] from sin16s_gen::@2 sin16s_gen::@3
sin16s_gen::@3: scope:[sin16s_gen] from sin16s_gen::@1
[66] (signed word~) sin16s_gen::$1 ← (signed word) sin16s::return#0
[67] *((signed word*) sin16s_gen::sintab#2) ← (signed word~) sin16s_gen::$1
[68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (byte/signed byte/word/signed word/dword/signed dword) 2
[68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
[69] (dword) sin16s_gen::x#1 ← (dword) sin16s_gen::x#2 + (dword) sin16s_gen::step#0
[70] (word) sin16s_gen::i#1 ← ++ (word) sin16s_gen::i#2
[71] if((word) sin16s_gen::i#1<(const word) main::wavelength#0) goto sin16s_gen::@1
@ -2368,6 +2367,7 @@ INITIAL ASM
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_SIGNED_WORD = 2
// PI*2 in u[4.28] format
.const PI2_u4f28 = $6487ed51
// PI in u[4.28] format
@ -2488,21 +2488,21 @@ main: {
jmp b6
//SEG43 main::@6
b6:
//SEG44 [18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- pwsz1=pwsz1_plus_2
lda st1
//SEG44 [18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (const byte) SIZEOF_SIGNED_WORD -- pwsz1=pwsz1_plus_vbuc1
lda #SIZEOF_SIGNED_WORD
clc
adc #2
adc st1
sta st1
bcc !+
inc st1+1
!:
//SEG45 [19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@1 -- pwsz1_lt_pwsc1_then_la1
//SEG45 [19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD) goto main::@1 -- pwsz1_lt_pwsc1_then_la1
lda st1+1
cmp #>sintab1+wavelength*2
cmp #>sintab1+wavelength*SIZEOF_SIGNED_WORD
bcc b1_from_b6
bne !+
lda st1
cmp #<sintab1+wavelength*2
cmp #<sintab1+wavelength*SIZEOF_SIGNED_WORD
bcc b1_from_b6
!:
jmp breturn
@ -2839,10 +2839,10 @@ sin16s_gen: {
iny
lda _1+1
sta (sintab),y
//SEG144 [68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- pwsz1=pwsz1_plus_2
lda sintab
//SEG144 [68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (const byte) SIZEOF_SIGNED_WORD -- pwsz1=pwsz1_plus_vbuc1
lda #SIZEOF_SIGNED_WORD
clc
adc #2
adc sintab
sta sintab
bcc !+
inc sintab+1
@ -3620,8 +3620,8 @@ REGISTER UPLIFT POTENTIAL REGISTERS
Statement [9] (signed word) main::sw#0 ← *((signed word*) main::st1#2) [ main::st1#2 print_char_cursor#49 main::sw#0 ] ( main:2 [ main::st1#2 print_char_cursor#49 main::sw#0 ] ) always clobbers reg byte a reg byte y
Statement [10] if((signed word) main::sw#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2 [ main::st1#2 print_char_cursor#49 main::sw#0 ] ( main:2 [ main::st1#2 print_char_cursor#49 main::sw#0 ] ) always clobbers reg byte a
Statement [14] (signed word) print_sword::w#1 ← (signed word) main::sw#0 [ main::st1#2 print_char_cursor#48 print_sword::w#1 ] ( main:2 [ main::st1#2 print_char_cursor#48 print_sword::w#1 ] ) always clobbers reg byte a
Statement [18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [ main::st1#1 print_char_cursor#2 ] ( main:2 [ main::st1#1 print_char_cursor#2 ] ) always clobbers reg byte a
Statement [19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@1 [ main::st1#1 print_char_cursor#2 ] ( main:2 [ main::st1#1 print_char_cursor#2 ] ) always clobbers reg byte a
Statement [18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (const byte) SIZEOF_SIGNED_WORD [ main::st1#1 print_char_cursor#2 ] ( main:2 [ main::st1#1 print_char_cursor#2 ] ) always clobbers reg byte a
Statement [19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD) goto main::@1 [ main::st1#1 print_char_cursor#2 ] ( main:2 [ main::st1#1 print_char_cursor#2 ] ) always clobbers reg byte a
Statement [23] if(*((byte*) print_str::str#3)!=(byte) '@') goto print_str::@2 [ print_char_cursor#2 print_str::str#3 ] ( main:2::print_str:12 [ main::st1#2 main::sw#0 print_char_cursor#2 print_str::str#3 ] main:2::print_str:17 [ main::st1#2 print_char_cursor#2 print_str::str#3 ] ) always clobbers reg byte a reg byte y
Statement [25] *((byte*) print_char_cursor#2) ← *((byte*) print_str::str#3) [ print_char_cursor#2 print_str::str#3 ] ( main:2::print_str:12 [ main::st1#2 main::sw#0 print_char_cursor#2 print_str::str#3 ] main:2::print_str:17 [ main::st1#2 print_char_cursor#2 print_str::str#3 ] ) always clobbers reg byte a reg byte y
Statement [28] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1 [ print_char_cursor#48 print_sword::w#1 ] ( main:2::print_sword:15 [ main::st1#2 print_char_cursor#48 print_sword::w#1 ] ) always clobbers reg byte a
@ -3641,7 +3641,7 @@ Statement [63] (dword) sin16s::x#0 ← (dword) sin16s_gen::x#2 [ sin16s_gen::ste
Statement [65] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 sin16s::return#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 sin16s::return#0 ] ) always clobbers reg byte a
Statement [66] (signed word~) sin16s_gen::$1 ← (signed word) sin16s::return#0 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 sin16s_gen::$1 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 sin16s_gen::$1 ] ) always clobbers reg byte a
Statement [67] *((signed word*) sin16s_gen::sintab#2) ← (signed word~) sin16s_gen::$1 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 ] ) always clobbers reg byte a reg byte y
Statement [68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::i#2 sin16s_gen::sintab#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::i#2 sin16s_gen::sintab#0 ] ) always clobbers reg byte a
Statement [68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (const byte) SIZEOF_SIGNED_WORD [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::i#2 sin16s_gen::sintab#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::i#2 sin16s_gen::sintab#0 ] ) always clobbers reg byte a
Statement [69] (dword) sin16s_gen::x#1 ← (dword) sin16s_gen::x#2 + (dword) sin16s_gen::step#0 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#1 sin16s_gen::sintab#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#1 sin16s_gen::sintab#0 ] ) always clobbers reg byte a
Statement [71] if((word) sin16s_gen::i#1<(const word) main::wavelength#0) goto sin16s_gen::@1 [ sin16s_gen::step#0 sin16s_gen::x#1 sin16s_gen::sintab#0 sin16s_gen::i#1 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::x#1 sin16s_gen::sintab#0 sin16s_gen::i#1 ] ) always clobbers reg byte a
Statement [73] if((dword) sin16s::x#0<(const dword) PI_u4f28#0) goto sin16s::@1 [ sin16s::x#0 ] ( main:2::sin16s_gen:5::sin16s:64 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 sin16s::x#0 ] ) always clobbers reg byte a
@ -3702,8 +3702,8 @@ Statement [158] (word) rem16u#1 ← (word) divr16u::rem#11 [ divr16u::return#0 r
Statement [9] (signed word) main::sw#0 ← *((signed word*) main::st1#2) [ main::st1#2 print_char_cursor#49 main::sw#0 ] ( main:2 [ main::st1#2 print_char_cursor#49 main::sw#0 ] ) always clobbers reg byte a reg byte y
Statement [10] if((signed word) main::sw#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2 [ main::st1#2 print_char_cursor#49 main::sw#0 ] ( main:2 [ main::st1#2 print_char_cursor#49 main::sw#0 ] ) always clobbers reg byte a
Statement [14] (signed word) print_sword::w#1 ← (signed word) main::sw#0 [ main::st1#2 print_char_cursor#48 print_sword::w#1 ] ( main:2 [ main::st1#2 print_char_cursor#48 print_sword::w#1 ] ) always clobbers reg byte a
Statement [18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [ main::st1#1 print_char_cursor#2 ] ( main:2 [ main::st1#1 print_char_cursor#2 ] ) always clobbers reg byte a
Statement [19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@1 [ main::st1#1 print_char_cursor#2 ] ( main:2 [ main::st1#1 print_char_cursor#2 ] ) always clobbers reg byte a
Statement [18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (const byte) SIZEOF_SIGNED_WORD [ main::st1#1 print_char_cursor#2 ] ( main:2 [ main::st1#1 print_char_cursor#2 ] ) always clobbers reg byte a
Statement [19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD) goto main::@1 [ main::st1#1 print_char_cursor#2 ] ( main:2 [ main::st1#1 print_char_cursor#2 ] ) always clobbers reg byte a
Statement [23] if(*((byte*) print_str::str#3)!=(byte) '@') goto print_str::@2 [ print_char_cursor#2 print_str::str#3 ] ( main:2::print_str:12 [ main::st1#2 main::sw#0 print_char_cursor#2 print_str::str#3 ] main:2::print_str:17 [ main::st1#2 print_char_cursor#2 print_str::str#3 ] ) always clobbers reg byte a reg byte y
Statement [25] *((byte*) print_char_cursor#2) ← *((byte*) print_str::str#3) [ print_char_cursor#2 print_str::str#3 ] ( main:2::print_str:12 [ main::st1#2 main::sw#0 print_char_cursor#2 print_str::str#3 ] main:2::print_str:17 [ main::st1#2 print_char_cursor#2 print_str::str#3 ] ) always clobbers reg byte a reg byte y
Statement [28] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1 [ print_char_cursor#48 print_sword::w#1 ] ( main:2::print_sword:15 [ main::st1#2 print_char_cursor#48 print_sword::w#1 ] ) always clobbers reg byte a
@ -3721,7 +3721,7 @@ Statement [63] (dword) sin16s::x#0 ← (dword) sin16s_gen::x#2 [ sin16s_gen::ste
Statement [65] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 sin16s::return#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 sin16s::return#0 ] ) always clobbers reg byte a
Statement [66] (signed word~) sin16s_gen::$1 ← (signed word) sin16s::return#0 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 sin16s_gen::$1 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 sin16s_gen::$1 ] ) always clobbers reg byte a
Statement [67] *((signed word*) sin16s_gen::sintab#2) ← (signed word~) sin16s_gen::$1 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 ] ) always clobbers reg byte a reg byte y
Statement [68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::i#2 sin16s_gen::sintab#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::i#2 sin16s_gen::sintab#0 ] ) always clobbers reg byte a
Statement [68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (const byte) SIZEOF_SIGNED_WORD [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::i#2 sin16s_gen::sintab#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::i#2 sin16s_gen::sintab#0 ] ) always clobbers reg byte a
Statement [69] (dword) sin16s_gen::x#1 ← (dword) sin16s_gen::x#2 + (dword) sin16s_gen::step#0 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#1 sin16s_gen::sintab#0 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::i#2 sin16s_gen::x#1 sin16s_gen::sintab#0 ] ) always clobbers reg byte a
Statement [71] if((word) sin16s_gen::i#1<(const word) main::wavelength#0) goto sin16s_gen::@1 [ sin16s_gen::step#0 sin16s_gen::x#1 sin16s_gen::sintab#0 sin16s_gen::i#1 ] ( main:2::sin16s_gen:5 [ sin16s_gen::step#0 sin16s_gen::x#1 sin16s_gen::sintab#0 sin16s_gen::i#1 ] ) always clobbers reg byte a
Statement [73] if((dword) sin16s::x#0<(const dword) PI_u4f28#0) goto sin16s::@1 [ sin16s::x#0 ] ( main:2::sin16s_gen:5::sin16s:64 [ sin16s_gen::step#0 sin16s_gen::x#2 sin16s_gen::sintab#2 sin16s_gen::i#2 sin16s::x#0 ] ) always clobbers reg byte a
@ -3923,6 +3923,7 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_SIGNED_WORD = 2
// PI*2 in u[4.28] format
.const PI2_u4f28 = $6487ed51
// PI in u[4.28] format
@ -4039,21 +4040,21 @@ main: {
jmp b6
//SEG43 main::@6
b6:
//SEG44 [18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- pwsz1=pwsz1_plus_2
lda st1
//SEG44 [18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (const byte) SIZEOF_SIGNED_WORD -- pwsz1=pwsz1_plus_vbuc1
lda #SIZEOF_SIGNED_WORD
clc
adc #2
adc st1
sta st1
bcc !+
inc st1+1
!:
//SEG45 [19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@1 -- pwsz1_lt_pwsc1_then_la1
//SEG45 [19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD) goto main::@1 -- pwsz1_lt_pwsc1_then_la1
lda st1+1
cmp #>sintab1+wavelength*2
cmp #>sintab1+wavelength*SIZEOF_SIGNED_WORD
bcc b1_from_b6
bne !+
lda st1
cmp #<sintab1+wavelength*2
cmp #<sintab1+wavelength*SIZEOF_SIGNED_WORD
bcc b1_from_b6
!:
jmp breturn
@ -4355,10 +4356,10 @@ sin16s_gen: {
iny
lda _1+1
sta (sintab),y
//SEG144 [68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- pwsz1=pwsz1_plus_2
lda sintab
//SEG144 [68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (const byte) SIZEOF_SIGNED_WORD -- pwsz1=pwsz1_plus_vbuc1
lda #SIZEOF_SIGNED_WORD
clc
adc #2
adc sintab
sta sintab
bcc !+
inc sintab+1
@ -5205,6 +5206,7 @@ FINAL SYMBOL TABLE
(const dword) PI_HALF_u4f28#0 PI_HALF_u4f28 = (dword/signed dword) $1921fb54
(dword) PI_u4f28
(const dword) PI_u4f28#0 PI_u4f28 = (dword/signed dword) $3243f6a9
(const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(dword()) div32u16u((dword) div32u16u::dividend , (word) div32u16u::divisor)
(label) div32u16u::@1
(label) div32u16u::@2
@ -5480,6 +5482,7 @@ Score: 20861
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.const SIZEOF_SIGNED_WORD = 2
// PI*2 in u[4.28] format
.const PI2_u4f28 = $6487ed51
// PI in u[4.28] format
@ -5564,21 +5567,21 @@ main: {
sta print_str.str+1
jsr print_str
//SEG43 main::@6
//SEG44 [18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- pwsz1=pwsz1_plus_2
lda st1
//SEG44 [18] (signed word*) main::st1#1 ← (signed word*) main::st1#2 + (const byte) SIZEOF_SIGNED_WORD -- pwsz1=pwsz1_plus_vbuc1
lda #SIZEOF_SIGNED_WORD
clc
adc #2
adc st1
sta st1
bcc !+
inc st1+1
!:
//SEG45 [19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@1 -- pwsz1_lt_pwsc1_then_la1
//SEG45 [19] if((signed word*) main::st1#1<(const signed word[$78]) main::sintab1#0+(const word) main::wavelength#0*(const byte) SIZEOF_SIGNED_WORD) goto main::@1 -- pwsz1_lt_pwsc1_then_la1
lda st1+1
cmp #>sintab1+wavelength*2
cmp #>sintab1+wavelength*SIZEOF_SIGNED_WORD
bcc b1
bne !+
lda st1
cmp #<sintab1+wavelength*2
cmp #<sintab1+wavelength*SIZEOF_SIGNED_WORD
bcc b1
!:
//SEG46 main::@return
@ -5830,10 +5833,10 @@ sin16s_gen: {
iny
lda _1+1
sta (sintab),y
//SEG144 [68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- pwsz1=pwsz1_plus_2
lda sintab
//SEG144 [68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (const byte) SIZEOF_SIGNED_WORD -- pwsz1=pwsz1_plus_vbuc1
lda #SIZEOF_SIGNED_WORD
clc
adc #2
adc sintab
sta sintab
bcc !+
inc sintab+1

View File

@ -7,6 +7,7 @@
(const dword) PI_HALF_u4f28#0 PI_HALF_u4f28 = (dword/signed dword) $1921fb54
(dword) PI_u4f28
(const dword) PI_u4f28#0 PI_u4f28 = (dword/signed dword) $3243f6a9
(const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(dword()) div32u16u((dword) div32u16u::dividend , (word) div32u16u::divisor)
(label) div32u16u::@1
(label) div32u16u::@2

View File

@ -1,6 +1,7 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.const SIZEOF_SIGNED_WORD = 2
// PI*2 in u[4.28] format
.const PI2_u4f28 = $6487ed51
// PI in u[4.28] format
@ -20,10 +21,9 @@ main: {
.label wavelength = $c0
.label _3 = 2
.label _4 = 2
.label _5 = 2
.label _11 = 2
.label sb = 4
.label sw = $f
.label sd = 4
jsr sin8s_gen
jsr sin16s_gen
jsr print_cls
@ -39,44 +39,32 @@ main: {
sta _3
lda #0
sta _3+1
asl _4
rol _4+1
asl _11
rol _11+1
clc
lda _5
lda _4
adc #<sintabw
sta _5
lda _5+1
sta _4
lda _4+1
adc #>sintabw
sta _5+1
sta _4+1
ldy #0
lda (_5),y
lda (_4),y
sta sw
iny
lda (_5),y
lda (_4),y
sta sw+1
eor #$ff
sec
adc sd
sta sd
bmi b2
lda #<str1
sta print_str.str
lda #>str1
sta print_str.str+1
jsr print_str
b2:
adc sb
sta print_sbyte.b
jsr print_sbyte
lda #<str
sta print_str.str
lda #>str
sta print_str.str+1
jsr print_str
inx
cpx #$c0
bne b1
rts
str: .text " @"
str1: .text " @"
sintabb: .fill $c0, 0
sintabw: .fill 2*$c0, 0
}
@ -84,6 +72,10 @@ main: {
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
lda #<main.str
sta str
lda #>main.str
sta str+1
b1:
ldy #0
lda (str),y
@ -216,9 +208,9 @@ sin16s_gen: {
iny
lda _1+1
sta (sintab),y
lda sintab
lda #SIZEOF_SIGNED_WORD
clc
adc #2
adc sintab
sta sintab
bcc !+
inc sintab+1

View File

@ -10,465 +10,456 @@
main: scope:[main] from @1
[4] phi()
[5] call sin8s_gen
to:main::@4
main::@4: scope:[main] from main
to:main::@2
main::@2: scope:[main] from main
[6] phi()
[7] call sin16s_gen
to:main::@5
main::@5: scope:[main] from main::@4
to:main::@3
main::@3: scope:[main] from main::@2
[8] phi()
[9] call print_cls
to:main::@1
main::@1: scope:[main] from main::@5 main::@7
[10] (byte*) print_char_cursor#45 ← phi( main::@5/(const byte*) print_line_cursor#0 main::@7/(byte*) print_char_cursor#2 )
[10] (byte) main::i#2 ← phi( main::@5/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@7/(byte) main::i#1 )
main::@1: scope:[main] from main::@3 main::@5
[10] (byte*) print_char_cursor#42 ← phi( main::@3/(const byte*) print_line_cursor#0 main::@5/(byte*) print_char_cursor#19 )
[10] (byte) main::i#2 ← phi( main::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@5/(byte) main::i#1 )
[11] (signed byte) main::sb#0 ← *((const signed byte[$c0]) main::sintabb#0 + (byte) main::i#2)
[12] (word~) main::$3 ← ((word)) (byte) main::i#2
[13] (word~) main::$4 ← (word~) main::$3 << (byte/signed byte/word/signed word/dword/signed dword) 1
[14] (signed word*~) main::$5 ← (const signed word[$c0]) main::sintabw#0 + (word~) main::$4
[15] (signed word) main::sw#0 ← *((signed word*~) main::$5)
[16] (byte~) main::$6 ← > (signed word) main::sw#0
[17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$6
[18] if((signed byte) main::sd#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@1
[19] phi()
[20] call print_str
to:main::@2
main::@2: scope:[main] from main::@1 main::@3
[21] (byte*) print_char_cursor#44 ← phi( main::@1/(byte*) print_char_cursor#45 main::@3/(byte*) print_char_cursor#2 )
[22] (signed byte) print_sbyte::b#1 ← (signed byte) main::sd#0
[23] call print_sbyte
to:main::@6
main::@6: scope:[main] from main::@2
[24] phi()
[25] call print_str
to:main::@7
main::@7: scope:[main] from main::@6
[26] (byte) main::i#1 ← ++ (byte) main::i#2
[27] if((byte) main::i#1!=(byte/word/signed word/dword/signed dword) $c0) goto main::@1
[13] (word) main::$11 ← (word~) main::$3 << (byte/signed byte/word/signed word/dword/signed dword) 1
[14] (signed word*~) main::$4 ← (const signed word[$c0]) main::sintabw#0 + (word) main::$11
[15] (signed word) main::sw#0 ← *((signed word*~) main::$4)
[16] (byte~) main::$5 ← > (signed word) main::sw#0
[17] (signed byte) main::sd#0 ← (signed byte) main::sb#0 - (signed byte)(byte~) main::$5
[18] (signed byte) print_sbyte::b#1 ← (signed byte) main::sd#0
[19] call print_sbyte
to:main::@4
main::@4: scope:[main] from main::@1
[20] phi()
[21] call print_str
to:main::@5
main::@5: scope:[main] from main::@4
[22] (byte) main::i#1 ← ++ (byte) main::i#2
[23] if((byte) main::i#1!=(byte/word/signed word/dword/signed dword) $c0) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@7
[28] return
main::@return: scope:[main] from main::@5
[24] return
to:@return
print_str: scope:[print_str] from main::@3 main::@6
[29] (byte*) print_char_cursor#47 ← phi( main::@3/(byte*) print_char_cursor#45 main::@6/(byte*) print_char_cursor#10 )
[29] (byte*) print_str::str#5 ← phi( main::@3/(const string) main::str1 main::@6/(const string) main::str )
print_str: scope:[print_str] from main::@4
[25] phi()
to:print_str::@1
print_str::@1: scope:[print_str] from print_str print_str::@2
[30] (byte*) print_char_cursor#2 ← phi( print_str/(byte*) print_char_cursor#47 print_str::@2/(byte*) print_char_cursor#1 )
[30] (byte*) print_str::str#3 ← phi( print_str/(byte*) print_str::str#5 print_str::@2/(byte*) print_str::str#0 )
[31] if(*((byte*) print_str::str#3)!=(byte) '@') goto print_str::@2
[26] (byte*) print_char_cursor#19 ← phi( print_str/(byte*) print_char_cursor#10 print_str::@2/(byte*) print_char_cursor#1 )
[26] (byte*) print_str::str#2 ← phi( print_str/(const string) main::str print_str::@2/(byte*) print_str::str#0 )
[27] if(*((byte*) print_str::str#2)!=(byte) '@') goto print_str::@2
to:print_str::@return
print_str::@return: scope:[print_str] from print_str::@1
[32] return
[28] return
to:@return
print_str::@2: scope:[print_str] from print_str::@1
[33] *((byte*) print_char_cursor#2) ← *((byte*) print_str::str#3)
[34] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#2
[35] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#3
[29] *((byte*) print_char_cursor#19) ← *((byte*) print_str::str#2)
[30] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#19
[31] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#2
to:print_str::@1
print_sbyte: scope:[print_sbyte] from main::@2
[36] if((signed byte) print_sbyte::b#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1
print_sbyte: scope:[print_sbyte] from main::@1
[32] if((signed byte) print_sbyte::b#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1
to:print_sbyte::@3
print_sbyte::@3: scope:[print_sbyte] from print_sbyte
[37] phi()
[38] call print_char
[33] phi()
[34] call print_char
to:print_sbyte::@2
print_sbyte::@2: scope:[print_sbyte] from print_sbyte::@3 print_sbyte::@4
[39] (signed byte) print_sbyte::b#4 ← phi( print_sbyte::@4/(signed byte) print_sbyte::b#0 print_sbyte::@3/(signed byte) print_sbyte::b#1 )
[40] call print_byte
[35] (signed byte) print_sbyte::b#4 ← phi( print_sbyte::@4/(signed byte) print_sbyte::b#0 print_sbyte::@3/(signed byte) print_sbyte::b#1 )
[36] call print_byte
to:print_sbyte::@return
print_sbyte::@return: scope:[print_sbyte] from print_sbyte::@2
[41] return
[37] return
to:@return
print_sbyte::@1: scope:[print_sbyte] from print_sbyte
[42] phi()
[43] call print_char
[38] phi()
[39] call print_char
to:print_sbyte::@4
print_sbyte::@4: scope:[print_sbyte] from print_sbyte::@1
[44] (signed byte) print_sbyte::b#0 ← - (signed byte) print_sbyte::b#1
[40] (signed byte) print_sbyte::b#0 ← - (signed byte) print_sbyte::b#1
to:print_sbyte::@2
print_char: scope:[print_char] from print_byte print_byte::@1 print_sbyte::@1 print_sbyte::@3
[45] (byte*) print_char_cursor#29 ← phi( print_byte/(byte*) print_char_cursor#10 print_byte::@1/(byte*) print_char_cursor#10 print_sbyte::@1/(byte*) print_char_cursor#44 print_sbyte::@3/(byte*) print_char_cursor#44 )
[45] (byte) print_char::ch#4 ← phi( print_byte/(byte) print_char::ch#2 print_byte::@1/(byte) print_char::ch#3 print_sbyte::@1/(byte) '-' print_sbyte::@3/(byte) ' ' )
[46] *((byte*) print_char_cursor#29) ← (byte) print_char::ch#4
[47] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#29
[41] (byte*) print_char_cursor#28 ← phi( print_byte/(byte*) print_char_cursor#10 print_byte::@1/(byte*) print_char_cursor#10 print_sbyte::@1/(byte*) print_char_cursor#42 print_sbyte::@3/(byte*) print_char_cursor#42 )
[41] (byte) print_char::ch#4 ← phi( print_byte/(byte) print_char::ch#2 print_byte::@1/(byte) print_char::ch#3 print_sbyte::@1/(byte) '-' print_sbyte::@3/(byte) ' ' )
[42] *((byte*) print_char_cursor#28) ← (byte) print_char::ch#4
[43] (byte*) print_char_cursor#10 ← ++ (byte*) print_char_cursor#28
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[48] return
[44] return
to:@return
print_byte: scope:[print_byte] from print_sbyte::@2
[49] (byte~) print_byte::$0 ← (byte)(signed byte) print_sbyte::b#4 >> (byte/signed byte/word/signed word/dword/signed dword) 4
[50] (byte) print_char::ch#2 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0)
[51] call print_char
[45] (byte~) print_byte::$0 ← (byte)(signed byte) print_sbyte::b#4 >> (byte/signed byte/word/signed word/dword/signed dword) 4
[46] (byte) print_char::ch#2 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0)
[47] call print_char
to:print_byte::@1
print_byte::@1: scope:[print_byte] from print_byte
[52] (byte~) print_byte::$2 ← (byte)(signed byte) print_sbyte::b#4 & (byte/signed byte/word/signed word/dword/signed dword) $f
[53] (byte) print_char::ch#3 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2)
[54] call print_char
[48] (byte~) print_byte::$2 ← (byte)(signed byte) print_sbyte::b#4 & (byte/signed byte/word/signed word/dword/signed dword) $f
[49] (byte) print_char::ch#3 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2)
[50] call print_char
to:print_byte::@return
print_byte::@return: scope:[print_byte] from print_byte::@1
[55] return
[51] return
to:@return
print_cls: scope:[print_cls] from main::@5
[56] phi()
print_cls: scope:[print_cls] from main::@3
[52] phi()
to:print_cls::@1
print_cls::@1: scope:[print_cls] from print_cls print_cls::@1
[57] (byte*) print_cls::sc#2 ← phi( print_cls/(const byte*) print_line_cursor#0 print_cls::@1/(byte*) print_cls::sc#1 )
[58] *((byte*) print_cls::sc#2) ← (byte) ' '
[59] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2
[60] if((byte*) print_cls::sc#1!=(const byte*) print_line_cursor#0+(word/signed word/dword/signed dword) $3e8) goto print_cls::@1
[53] (byte*) print_cls::sc#2 ← phi( print_cls/(const byte*) print_line_cursor#0 print_cls::@1/(byte*) print_cls::sc#1 )
[54] *((byte*) print_cls::sc#2) ← (byte) ' '
[55] (byte*) print_cls::sc#1 ← ++ (byte*) print_cls::sc#2
[56] if((byte*) print_cls::sc#1!=(const byte*) print_line_cursor#0+(word/signed word/dword/signed dword) $3e8) goto print_cls::@1
to:print_cls::@return
print_cls::@return: scope:[print_cls] from print_cls::@1
[61] return
[57] return
to:@return
sin16s_gen: scope:[sin16s_gen] from main::@4
[62] phi()
[63] call div32u16u
[64] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0
sin16s_gen: scope:[sin16s_gen] from main::@2
[58] phi()
[59] call div32u16u
[60] (dword) div32u16u::return#2 ← (dword) div32u16u::return#0
to:sin16s_gen::@2
sin16s_gen::@2: scope:[sin16s_gen] from sin16s_gen
[65] (dword) sin16s_gen::step#0 ← (dword) div32u16u::return#2
[61] (dword) sin16s_gen::step#0 ← (dword) div32u16u::return#2
to:sin16s_gen::@1
sin16s_gen::@1: scope:[sin16s_gen] from sin16s_gen::@2 sin16s_gen::@3
[66] (word) sin16s_gen::i#2 ← phi( sin16s_gen::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 sin16s_gen::@3/(word) sin16s_gen::i#1 )
[66] (signed word*) sin16s_gen::sintab#2 ← phi( sin16s_gen::@2/(const signed word[$c0]) main::sintabw#0 sin16s_gen::@3/(signed word*) sin16s_gen::sintab#0 )
[66] (dword) sin16s_gen::x#2 ← phi( sin16s_gen::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 sin16s_gen::@3/(dword) sin16s_gen::x#1 )
[67] (dword) sin16s::x#0 ← (dword) sin16s_gen::x#2
[68] call sin16s
[69] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1
[62] (word) sin16s_gen::i#2 ← phi( sin16s_gen::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 sin16s_gen::@3/(word) sin16s_gen::i#1 )
[62] (signed word*) sin16s_gen::sintab#2 ← phi( sin16s_gen::@2/(const signed word[$c0]) main::sintabw#0 sin16s_gen::@3/(signed word*) sin16s_gen::sintab#0 )
[62] (dword) sin16s_gen::x#2 ← phi( sin16s_gen::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 sin16s_gen::@3/(dword) sin16s_gen::x#1 )
[63] (dword) sin16s::x#0 ← (dword) sin16s_gen::x#2
[64] call sin16s
[65] (signed word) sin16s::return#0 ← (signed word) sin16s::return#1
to:sin16s_gen::@3
sin16s_gen::@3: scope:[sin16s_gen] from sin16s_gen::@1
[70] (signed word~) sin16s_gen::$1 ← (signed word) sin16s::return#0
[71] *((signed word*) sin16s_gen::sintab#2) ← (signed word~) sin16s_gen::$1
[72] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (byte/signed byte/word/signed word/dword/signed dword) 2
[73] (dword) sin16s_gen::x#1 ← (dword) sin16s_gen::x#2 + (dword) sin16s_gen::step#0
[74] (word) sin16s_gen::i#1 ← ++ (word) sin16s_gen::i#2
[75] if((word) sin16s_gen::i#1<(const word) main::wavelength#0) goto sin16s_gen::@1
[66] (signed word~) sin16s_gen::$1 ← (signed word) sin16s::return#0
[67] *((signed word*) sin16s_gen::sintab#2) ← (signed word~) sin16s_gen::$1
[68] (signed word*) sin16s_gen::sintab#0 ← (signed word*) sin16s_gen::sintab#2 + (const byte) SIZEOF_SIGNED_WORD
[69] (dword) sin16s_gen::x#1 ← (dword) sin16s_gen::x#2 + (dword) sin16s_gen::step#0
[70] (word) sin16s_gen::i#1 ← ++ (word) sin16s_gen::i#2
[71] if((word) sin16s_gen::i#1<(const word) main::wavelength#0) goto sin16s_gen::@1
to:sin16s_gen::@return
sin16s_gen::@return: scope:[sin16s_gen] from sin16s_gen::@3
[76] return
[72] return
to:@return
sin16s: scope:[sin16s] from sin16s_gen::@1
[77] if((dword) sin16s::x#0<(const dword) PI_u4f28#0) goto sin16s::@1
[73] if((dword) sin16s::x#0<(const dword) PI_u4f28#0) goto sin16s::@1
to:sin16s::@4
sin16s::@4: scope:[sin16s] from sin16s
[78] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28#0
[74] (dword) sin16s::x#1 ← (dword) sin16s::x#0 - (const dword) PI_u4f28#0
to:sin16s::@1
sin16s::@1: scope:[sin16s] from sin16s sin16s::@4
[79] (byte) sin16s::isUpper#2 ← phi( sin16s/(byte/signed byte/word/signed word/dword/signed dword) 0 sin16s::@4/(byte/signed byte/word/signed word/dword/signed dword) 1 )
[79] (dword) sin16s::x#4 ← phi( sin16s/(dword) sin16s::x#0 sin16s::@4/(dword) sin16s::x#1 )
[80] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28#0) goto sin16s::@2
[75] (byte) sin16s::isUpper#2 ← phi( sin16s/(byte/signed byte/word/signed word/dword/signed dword) 0 sin16s::@4/(byte/signed byte/word/signed word/dword/signed dword) 1 )
[75] (dword) sin16s::x#4 ← phi( sin16s/(dword) sin16s::x#0 sin16s::@4/(dword) sin16s::x#1 )
[76] if((dword) sin16s::x#4<(const dword) PI_HALF_u4f28#0) goto sin16s::@2
to:sin16s::@5
sin16s::@5: scope:[sin16s] from sin16s::@1
[81] (dword) sin16s::x#2 ← (const dword) PI_u4f28#0 - (dword) sin16s::x#4
[77] (dword) sin16s::x#2 ← (const dword) PI_u4f28#0 - (dword) sin16s::x#4
to:sin16s::@2
sin16s::@2: scope:[sin16s] from sin16s::@1 sin16s::@5
[82] (dword) sin16s::x#6 ← phi( sin16s::@1/(dword) sin16s::x#4 sin16s::@5/(dword) sin16s::x#2 )
[83] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte/signed byte/word/signed word/dword/signed dword) 3
[84] (word) sin16s::x1#0 ← > (dword~) sin16s::$4
[85] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0
[86] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0
[87] call mulu16_sel
[88] (word) mulu16_sel::return#0 ← (word) mulu16_sel::return#12
[78] (dword) sin16s::x#6 ← phi( sin16s::@1/(dword) sin16s::x#4 sin16s::@5/(dword) sin16s::x#2 )
[79] (dword~) sin16s::$4 ← (dword) sin16s::x#6 << (byte/signed byte/word/signed word/dword/signed dword) 3
[80] (word) sin16s::x1#0 ← > (dword~) sin16s::$4
[81] (word) mulu16_sel::v1#0 ← (word) sin16s::x1#0
[82] (word) mulu16_sel::v2#0 ← (word) sin16s::x1#0
[83] call mulu16_sel
[84] (word) mulu16_sel::return#0 ← (word) mulu16_sel::return#12
to:sin16s::@7
sin16s::@7: scope:[sin16s] from sin16s::@2
[89] (word) sin16s::x2#0 ← (word) mulu16_sel::return#0
[90] (word) mulu16_sel::v1#1 ← (word) sin16s::x2#0
[91] (word) mulu16_sel::v2#1 ← (word) sin16s::x1#0
[92] call mulu16_sel
[93] (word) mulu16_sel::return#1 ← (word) mulu16_sel::return#12
[85] (word) sin16s::x2#0 ← (word) mulu16_sel::return#0
[86] (word) mulu16_sel::v1#1 ← (word) sin16s::x2#0
[87] (word) mulu16_sel::v2#1 ← (word) sin16s::x1#0
[88] call mulu16_sel
[89] (word) mulu16_sel::return#1 ← (word) mulu16_sel::return#12
to:sin16s::@8
sin16s::@8: scope:[sin16s] from sin16s::@7
[94] (word) sin16s::x3#0 ← (word) mulu16_sel::return#1
[95] (word) mulu16_sel::v1#2 ← (word) sin16s::x3#0
[96] call mulu16_sel
[97] (word) mulu16_sel::return#2 ← (word) mulu16_sel::return#12
[90] (word) sin16s::x3#0 ← (word) mulu16_sel::return#1
[91] (word) mulu16_sel::v1#2 ← (word) sin16s::x3#0
[92] call mulu16_sel
[93] (word) mulu16_sel::return#2 ← (word) mulu16_sel::return#12
to:sin16s::@9
sin16s::@9: scope:[sin16s] from sin16s::@8
[98] (word) sin16s::x3_6#0 ← (word) mulu16_sel::return#2
[99] (word) sin16s::usinx#0 ← (word) sin16s::x1#0 - (word) sin16s::x3_6#0
[100] (word) mulu16_sel::v1#3 ← (word) sin16s::x3#0
[101] (word) mulu16_sel::v2#3 ← (word) sin16s::x1#0
[102] call mulu16_sel
[103] (word) mulu16_sel::return#10 ← (word) mulu16_sel::return#12
[94] (word) sin16s::x3_6#0 ← (word) mulu16_sel::return#2
[95] (word) sin16s::usinx#0 ← (word) sin16s::x1#0 - (word) sin16s::x3_6#0
[96] (word) mulu16_sel::v1#3 ← (word) sin16s::x3#0
[97] (word) mulu16_sel::v2#3 ← (word) sin16s::x1#0
[98] call mulu16_sel
[99] (word) mulu16_sel::return#10 ← (word) mulu16_sel::return#12
to:sin16s::@10
sin16s::@10: scope:[sin16s] from sin16s::@9
[104] (word) sin16s::x4#0 ← (word) mulu16_sel::return#10
[105] (word) mulu16_sel::v1#4 ← (word) sin16s::x4#0
[106] (word) mulu16_sel::v2#4 ← (word) sin16s::x1#0
[107] call mulu16_sel
[108] (word) mulu16_sel::return#11 ← (word) mulu16_sel::return#12
[100] (word) sin16s::x4#0 ← (word) mulu16_sel::return#10
[101] (word) mulu16_sel::v1#4 ← (word) sin16s::x4#0
[102] (word) mulu16_sel::v2#4 ← (word) sin16s::x1#0
[103] call mulu16_sel
[104] (word) mulu16_sel::return#11 ← (word) mulu16_sel::return#12
to:sin16s::@11
sin16s::@11: scope:[sin16s] from sin16s::@10
[109] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
[110] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 4
[111] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0
[112] if((byte) sin16s::isUpper#2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto sin16s::@12
[105] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
[106] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 4
[107] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0
[108] if((byte) sin16s::isUpper#2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto sin16s::@12
to:sin16s::@6
sin16s::@6: scope:[sin16s] from sin16s::@11
[113] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1
[109] (signed word) sin16s::sinx#1 ← - (signed word)(word) sin16s::usinx#1
to:sin16s::@3
sin16s::@3: scope:[sin16s] from sin16s::@12 sin16s::@6
[114] (signed word) sin16s::return#1 ← phi( sin16s::@12/(signed word~) sin16s::return#5 sin16s::@6/(signed word) sin16s::sinx#1 )
[110] (signed word) sin16s::return#1 ← phi( sin16s::@12/(signed word~) sin16s::return#5 sin16s::@6/(signed word) sin16s::sinx#1 )
to:sin16s::@return
sin16s::@return: scope:[sin16s] from sin16s::@3
[115] return
[111] return
to:@return
sin16s::@12: scope:[sin16s] from sin16s::@11
[116] (signed word~) sin16s::return#5 ← (signed word)(word) sin16s::usinx#1
[112] (signed word~) sin16s::return#5 ← (signed word)(word) sin16s::usinx#1
to:sin16s::@3
mulu16_sel: scope:[mulu16_sel] from sin16s::@10 sin16s::@2 sin16s::@7 sin16s::@8 sin16s::@9
[117] (byte) mulu16_sel::select#5 ← phi( sin16s::@9/(byte/signed byte/word/signed word/dword/signed dword) 0 sin16s::@10/(byte/signed byte/word/signed word/dword/signed dword) 0 sin16s::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 sin16s::@7/(byte/signed byte/word/signed word/dword/signed dword) 1 sin16s::@8/(byte/signed byte/word/signed word/dword/signed dword) 1 )
[117] (word) mulu16_sel::v2#5 ← phi( sin16s::@9/(word) mulu16_sel::v2#3 sin16s::@10/(word) mulu16_sel::v2#4 sin16s::@2/(word) mulu16_sel::v2#0 sin16s::@7/(word) mulu16_sel::v2#1 sin16s::@8/(dword/signed dword) $10000/(byte/signed byte/word/signed word/dword/signed dword) 6 )
[117] (word) mulu16_sel::v1#5 ← phi( sin16s::@9/(word) mulu16_sel::v1#3 sin16s::@10/(word) mulu16_sel::v1#4 sin16s::@2/(word) mulu16_sel::v1#0 sin16s::@7/(word) mulu16_sel::v1#1 sin16s::@8/(word) mulu16_sel::v1#2 )
[118] (word) mul16u::a#1 ← (word) mulu16_sel::v1#5
[119] (word) mul16u::b#0 ← (word) mulu16_sel::v2#5
[120] call mul16u
[121] (dword) mul16u::return#2 ← (dword) mul16u::res#2
[113] (byte) mulu16_sel::select#5 ← phi( sin16s::@9/(byte/signed byte/word/signed word/dword/signed dword) 0 sin16s::@10/(byte/signed byte/word/signed word/dword/signed dword) 0 sin16s::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 sin16s::@7/(byte/signed byte/word/signed word/dword/signed dword) 1 sin16s::@8/(byte/signed byte/word/signed word/dword/signed dword) 1 )
[113] (word) mulu16_sel::v2#5 ← phi( sin16s::@9/(word) mulu16_sel::v2#3 sin16s::@10/(word) mulu16_sel::v2#4 sin16s::@2/(word) mulu16_sel::v2#0 sin16s::@7/(word) mulu16_sel::v2#1 sin16s::@8/(dword/signed dword) $10000/(byte/signed byte/word/signed word/dword/signed dword) 6 )
[113] (word) mulu16_sel::v1#5 ← phi( sin16s::@9/(word) mulu16_sel::v1#3 sin16s::@10/(word) mulu16_sel::v1#4 sin16s::@2/(word) mulu16_sel::v1#0 sin16s::@7/(word) mulu16_sel::v1#1 sin16s::@8/(word) mulu16_sel::v1#2 )
[114] (word) mul16u::a#1 ← (word) mulu16_sel::v1#5
[115] (word) mul16u::b#0 ← (word) mulu16_sel::v2#5
[116] call mul16u
[117] (dword) mul16u::return#2 ← (dword) mul16u::res#2
to:mulu16_sel::@1
mulu16_sel::@1: scope:[mulu16_sel] from mulu16_sel
[122] (dword~) mulu16_sel::$0 ← (dword) mul16u::return#2
[123] (dword~) mulu16_sel::$1 ← (dword~) mulu16_sel::$0 << (byte) mulu16_sel::select#5
[124] (word) mulu16_sel::return#12 ← > (dword~) mulu16_sel::$1
[118] (dword~) mulu16_sel::$0 ← (dword) mul16u::return#2
[119] (dword~) mulu16_sel::$1 ← (dword~) mulu16_sel::$0 << (byte) mulu16_sel::select#5
[120] (word) mulu16_sel::return#12 ← > (dword~) mulu16_sel::$1
to:mulu16_sel::@return
mulu16_sel::@return: scope:[mulu16_sel] from mulu16_sel::@1
[125] return
[121] return
to:@return
mul16u: scope:[mul16u] from mulu16_sel
[126] (dword) mul16u::mb#0 ← ((dword)) (word) mul16u::b#0
[122] (dword) mul16u::mb#0 ← ((dword)) (word) mul16u::b#0
to:mul16u::@1
mul16u::@1: scope:[mul16u] from mul16u mul16u::@3
[127] (dword) mul16u::mb#2 ← phi( mul16u/(dword) mul16u::mb#0 mul16u::@3/(dword) mul16u::mb#1 )
[127] (dword) mul16u::res#2 ← phi( mul16u/(byte/signed byte/word/signed word/dword/signed dword) 0 mul16u::@3/(dword) mul16u::res#6 )
[127] (word) mul16u::a#2 ← phi( mul16u/(word) mul16u::a#1 mul16u::@3/(word) mul16u::a#0 )
[128] if((word) mul16u::a#2!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul16u::@2
[123] (dword) mul16u::mb#2 ← phi( mul16u/(dword) mul16u::mb#0 mul16u::@3/(dword) mul16u::mb#1 )
[123] (dword) mul16u::res#2 ← phi( mul16u/(byte/signed byte/word/signed word/dword/signed dword) 0 mul16u::@3/(dword) mul16u::res#6 )
[123] (word) mul16u::a#2 ← phi( mul16u/(word) mul16u::a#1 mul16u::@3/(word) mul16u::a#0 )
[124] if((word) mul16u::a#2!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul16u::@2
to:mul16u::@return
mul16u::@return: scope:[mul16u] from mul16u::@1
[129] return
[125] return
to:@return
mul16u::@2: scope:[mul16u] from mul16u::@1
[130] (byte/word~) mul16u::$1 ← (word) mul16u::a#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[131] if((byte/word~) mul16u::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul16u::@3
[126] (byte/word~) mul16u::$1 ← (word) mul16u::a#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[127] if((byte/word~) mul16u::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul16u::@3
to:mul16u::@4
mul16u::@4: scope:[mul16u] from mul16u::@2
[132] (dword) mul16u::res#1 ← (dword) mul16u::res#2 + (dword) mul16u::mb#2
[128] (dword) mul16u::res#1 ← (dword) mul16u::res#2 + (dword) mul16u::mb#2
to:mul16u::@3
mul16u::@3: scope:[mul16u] from mul16u::@2 mul16u::@4
[133] (dword) mul16u::res#6 ← phi( mul16u::@2/(dword) mul16u::res#2 mul16u::@4/(dword) mul16u::res#1 )
[134] (word) mul16u::a#0 ← (word) mul16u::a#2 >> (byte/signed byte/word/signed word/dword/signed dword) 1
[135] (dword) mul16u::mb#1 ← (dword) mul16u::mb#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[129] (dword) mul16u::res#6 ← phi( mul16u::@2/(dword) mul16u::res#2 mul16u::@4/(dword) mul16u::res#1 )
[130] (word) mul16u::a#0 ← (word) mul16u::a#2 >> (byte/signed byte/word/signed word/dword/signed dword) 1
[131] (dword) mul16u::mb#1 ← (dword) mul16u::mb#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
to:mul16u::@1
div32u16u: scope:[div32u16u] from sin16s_gen
[136] phi()
[137] call divr16u
[138] (word) divr16u::return#3 ← (word) divr16u::return#0
[132] phi()
[133] call divr16u
[134] (word) divr16u::return#3 ← (word) divr16u::return#0
to:div32u16u::@1
div32u16u::@1: scope:[div32u16u] from div32u16u
[139] (word) div32u16u::quotient_hi#0 ← (word) divr16u::return#3
[140] (word) divr16u::rem#5 ← (word) rem16u#1
[141] call divr16u
[142] (word) divr16u::return#4 ← (word) divr16u::return#0
[135] (word) div32u16u::quotient_hi#0 ← (word) divr16u::return#3
[136] (word) divr16u::rem#5 ← (word) rem16u#1
[137] call divr16u
[138] (word) divr16u::return#4 ← (word) divr16u::return#0
to:div32u16u::@2
div32u16u::@2: scope:[div32u16u] from div32u16u::@1
[143] (word) div32u16u::quotient_lo#0 ← (word) divr16u::return#4
[144] (dword) div32u16u::return#0 ← (word) div32u16u::quotient_hi#0 dw= (word) div32u16u::quotient_lo#0
[139] (word) div32u16u::quotient_lo#0 ← (word) divr16u::return#4
[140] (dword) div32u16u::return#0 ← (word) div32u16u::quotient_hi#0 dw= (word) div32u16u::quotient_lo#0
to:div32u16u::@return
div32u16u::@return: scope:[div32u16u] from div32u16u::@2
[145] return
[141] return
to:@return
divr16u: scope:[divr16u] from div16u div32u16u div32u16u::@1
[146] (word) divr16u::dividend#6 ← phi( div16u/(const word) PI2_u4f12#0 div32u16u/>(const dword) PI2_u4f28#0 div32u16u::@1/<(const dword) PI2_u4f28#0 )
[146] (word) divr16u::rem#11 ← phi( div16u/(byte/signed byte/word/signed word/dword/signed dword) 0 div32u16u/(byte/signed byte/word/signed word/dword/signed dword) 0 div32u16u::@1/(word) divr16u::rem#5 )
[142] (word) divr16u::dividend#6 ← phi( div16u/(const word) PI2_u4f12#0 div32u16u/>(const dword) PI2_u4f28#0 div32u16u::@1/<(const dword) PI2_u4f28#0 )
[142] (word) divr16u::rem#11 ← phi( div16u/(byte/signed byte/word/signed word/dword/signed dword) 0 div32u16u/(byte/signed byte/word/signed word/dword/signed dword) 0 div32u16u::@1/(word) divr16u::rem#5 )
to:divr16u::@1
divr16u::@1: scope:[divr16u] from divr16u divr16u::@3
[147] (byte) divr16u::i#2 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(byte) divr16u::i#1 )
[147] (word) divr16u::quotient#3 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(word) divr16u::return#0 )
[147] (word) divr16u::dividend#4 ← phi( divr16u/(word) divr16u::dividend#6 divr16u::@3/(word) divr16u::dividend#0 )
[147] (word) divr16u::rem#6 ← phi( divr16u/(word) divr16u::rem#11 divr16u::@3/(word) divr16u::rem#10 )
[148] (word) divr16u::rem#0 ← (word) divr16u::rem#6 << (byte/signed byte/word/signed word/dword/signed dword) 1
[149] (byte~) divr16u::$1 ← > (word) divr16u::dividend#4
[150] (byte~) divr16u::$2 ← (byte~) divr16u::$1 & (byte/word/signed word/dword/signed dword) $80
[151] if((byte~) divr16u::$2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16u::@2
[143] (byte) divr16u::i#2 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(byte) divr16u::i#1 )
[143] (word) divr16u::quotient#3 ← phi( divr16u/(byte/signed byte/word/signed word/dword/signed dword) 0 divr16u::@3/(word) divr16u::return#0 )
[143] (word) divr16u::dividend#4 ← phi( divr16u/(word) divr16u::dividend#6 divr16u::@3/(word) divr16u::dividend#0 )
[143] (word) divr16u::rem#6 ← phi( divr16u/(word) divr16u::rem#11 divr16u::@3/(word) divr16u::rem#10 )
[144] (word) divr16u::rem#0 ← (word) divr16u::rem#6 << (byte/signed byte/word/signed word/dword/signed dword) 1
[145] (byte~) divr16u::$1 ← > (word) divr16u::dividend#4
[146] (byte~) divr16u::$2 ← (byte~) divr16u::$1 & (byte/word/signed word/dword/signed dword) $80
[147] if((byte~) divr16u::$2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16u::@2
to:divr16u::@4
divr16u::@4: scope:[divr16u] from divr16u::@1
[152] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte/signed byte/word/signed word/dword/signed dword) 1
[148] (word) divr16u::rem#1 ← (word) divr16u::rem#0 | (byte/signed byte/word/signed word/dword/signed dword) 1
to:divr16u::@2
divr16u::@2: scope:[divr16u] from divr16u::@1 divr16u::@4
[153] (word) divr16u::rem#7 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 )
[154] (word) divr16u::dividend#0 ← (word) divr16u::dividend#4 << (byte/signed byte/word/signed word/dword/signed dword) 1
[155] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte/signed byte/word/signed word/dword/signed dword) 1
[156] if((word) divr16u::rem#7<(const word) main::wavelength#0) goto divr16u::@3
[149] (word) divr16u::rem#7 ← phi( divr16u::@1/(word) divr16u::rem#0 divr16u::@4/(word) divr16u::rem#1 )
[150] (word) divr16u::dividend#0 ← (word) divr16u::dividend#4 << (byte/signed byte/word/signed word/dword/signed dword) 1
[151] (word) divr16u::quotient#1 ← (word) divr16u::quotient#3 << (byte/signed byte/word/signed word/dword/signed dword) 1
[152] if((word) divr16u::rem#7<(const word) main::wavelength#0) goto divr16u::@3
to:divr16u::@5
divr16u::@5: scope:[divr16u] from divr16u::@2
[157] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1
[158] (word) divr16u::rem#2 ← (word) divr16u::rem#7 - (const word) main::wavelength#0
[153] (word) divr16u::quotient#2 ← ++ (word) divr16u::quotient#1
[154] (word) divr16u::rem#2 ← (word) divr16u::rem#7 - (const word) main::wavelength#0
to:divr16u::@3
divr16u::@3: scope:[divr16u] from divr16u::@2 divr16u::@5
[159] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 )
[159] (word) divr16u::rem#10 ← phi( divr16u::@2/(word) divr16u::rem#7 divr16u::@5/(word) divr16u::rem#2 )
[160] (byte) divr16u::i#1 ← ++ (byte) divr16u::i#2
[161] if((byte) divr16u::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto divr16u::@1
[155] (word) divr16u::return#0 ← phi( divr16u::@2/(word) divr16u::quotient#1 divr16u::@5/(word) divr16u::quotient#2 )
[155] (word) divr16u::rem#10 ← phi( divr16u::@2/(word) divr16u::rem#7 divr16u::@5/(word) divr16u::rem#2 )
[156] (byte) divr16u::i#1 ← ++ (byte) divr16u::i#2
[157] if((byte) divr16u::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $10) goto divr16u::@1
to:divr16u::@6
divr16u::@6: scope:[divr16u] from divr16u::@3
[162] (word) rem16u#1 ← (word) divr16u::rem#10
[158] (word) rem16u#1 ← (word) divr16u::rem#10
to:divr16u::@return
divr16u::@return: scope:[divr16u] from divr16u::@6
[163] return
[159] return
to:@return
sin8s_gen: scope:[sin8s_gen] from main
[164] phi()
[165] call div16u
[166] (word) div16u::return#2 ← (word) div16u::return#0
[160] phi()
[161] call div16u
[162] (word) div16u::return#2 ← (word) div16u::return#0
to:sin8s_gen::@2
sin8s_gen::@2: scope:[sin8s_gen] from sin8s_gen
[167] (word) sin8s_gen::step#0 ← (word) div16u::return#2
[163] (word) sin8s_gen::step#0 ← (word) div16u::return#2
to:sin8s_gen::@1
sin8s_gen::@1: scope:[sin8s_gen] from sin8s_gen::@2 sin8s_gen::@3
[168] (word) sin8s_gen::i#2 ← phi( sin8s_gen::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 sin8s_gen::@3/(word) sin8s_gen::i#1 )
[168] (signed byte*) sin8s_gen::sintab#2 ← phi( sin8s_gen::@2/(const signed byte[$c0]) main::sintabb#0 sin8s_gen::@3/(signed byte*) sin8s_gen::sintab#0 )
[168] (word) sin8s_gen::x#2 ← phi( sin8s_gen::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 sin8s_gen::@3/(word) sin8s_gen::x#1 )
[169] (word) sin8s::x#0 ← (word) sin8s_gen::x#2
[170] call sin8s
[171] (signed byte) sin8s::return#0 ← (signed byte) sin8s::return#1
[164] (word) sin8s_gen::i#2 ← phi( sin8s_gen::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 sin8s_gen::@3/(word) sin8s_gen::i#1 )
[164] (signed byte*) sin8s_gen::sintab#2 ← phi( sin8s_gen::@2/(const signed byte[$c0]) main::sintabb#0 sin8s_gen::@3/(signed byte*) sin8s_gen::sintab#0 )
[164] (word) sin8s_gen::x#2 ← phi( sin8s_gen::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 sin8s_gen::@3/(word) sin8s_gen::x#1 )
[165] (word) sin8s::x#0 ← (word) sin8s_gen::x#2
[166] call sin8s
[167] (signed byte) sin8s::return#0 ← (signed byte) sin8s::return#1
to:sin8s_gen::@3
sin8s_gen::@3: scope:[sin8s_gen] from sin8s_gen::@1
[172] (signed byte~) sin8s_gen::$1 ← (signed byte) sin8s::return#0
[173] *((signed byte*) sin8s_gen::sintab#2) ← (signed byte~) sin8s_gen::$1
[174] (signed byte*) sin8s_gen::sintab#0 ← ++ (signed byte*) sin8s_gen::sintab#2
[175] (word) sin8s_gen::x#1 ← (word) sin8s_gen::x#2 + (word) sin8s_gen::step#0
[176] (word) sin8s_gen::i#1 ← ++ (word) sin8s_gen::i#2
[177] if((word) sin8s_gen::i#1<(const word) main::wavelength#0) goto sin8s_gen::@1
[168] (signed byte~) sin8s_gen::$1 ← (signed byte) sin8s::return#0
[169] *((signed byte*) sin8s_gen::sintab#2) ← (signed byte~) sin8s_gen::$1
[170] (signed byte*) sin8s_gen::sintab#0 ← ++ (signed byte*) sin8s_gen::sintab#2
[171] (word) sin8s_gen::x#1 ← (word) sin8s_gen::x#2 + (word) sin8s_gen::step#0
[172] (word) sin8s_gen::i#1 ← ++ (word) sin8s_gen::i#2
[173] if((word) sin8s_gen::i#1<(const word) main::wavelength#0) goto sin8s_gen::@1
to:sin8s_gen::@return
sin8s_gen::@return: scope:[sin8s_gen] from sin8s_gen::@3
[178] return
[174] return
to:@return
sin8s: scope:[sin8s] from sin8s_gen::@1
[179] if((word) sin8s::x#0<(const word) PI_u4f12#0) goto sin8s::@1
[175] if((word) sin8s::x#0<(const word) PI_u4f12#0) goto sin8s::@1
to:sin8s::@5
sin8s::@5: scope:[sin8s] from sin8s
[180] (word) sin8s::x#1 ← (word) sin8s::x#0 - (const word) PI_u4f12#0
[176] (word) sin8s::x#1 ← (word) sin8s::x#0 - (const word) PI_u4f12#0
to:sin8s::@1
sin8s::@1: scope:[sin8s] from sin8s sin8s::@5
[181] (byte) sin8s::isUpper#10 ← phi( sin8s/(byte/signed byte/word/signed word/dword/signed dword) 0 sin8s::@5/(byte/signed byte/word/signed word/dword/signed dword) 1 )
[181] (word) sin8s::x#4 ← phi( sin8s/(word) sin8s::x#0 sin8s::@5/(word) sin8s::x#1 )
[182] if((word) sin8s::x#4<(const word) PI_HALF_u4f12#0) goto sin8s::@2
[177] (byte) sin8s::isUpper#10 ← phi( sin8s/(byte/signed byte/word/signed word/dword/signed dword) 0 sin8s::@5/(byte/signed byte/word/signed word/dword/signed dword) 1 )
[177] (word) sin8s::x#4 ← phi( sin8s/(word) sin8s::x#0 sin8s::@5/(word) sin8s::x#1 )
[178] if((word) sin8s::x#4<(const word) PI_HALF_u4f12#0) goto sin8s::@2
to:sin8s::@6
sin8s::@6: scope:[sin8s] from sin8s::@1
[183] (word) sin8s::x#2 ← (const word) PI_u4f12#0 - (word) sin8s::x#4
[179] (word) sin8s::x#2 ← (const word) PI_u4f12#0 - (word) sin8s::x#4
to:sin8s::@2
sin8s::@2: scope:[sin8s] from sin8s::@1 sin8s::@6
[184] (word) sin8s::x#6 ← phi( sin8s::@1/(word) sin8s::x#4 sin8s::@6/(word) sin8s::x#2 )
[185] (word~) sin8s::$4 ← (word) sin8s::x#6 << (byte/signed byte/word/signed word/dword/signed dword) 3
[186] (byte) sin8s::x1#0 ← > (word~) sin8s::$4
[187] (byte) mulu8_sel::v1#0 ← (byte) sin8s::x1#0
[188] (byte) mulu8_sel::v2#0 ← (byte) sin8s::x1#0
[189] call mulu8_sel
[190] (byte) mulu8_sel::return#0 ← (byte) mulu8_sel::return#12
[180] (word) sin8s::x#6 ← phi( sin8s::@1/(word) sin8s::x#4 sin8s::@6/(word) sin8s::x#2 )
[181] (word~) sin8s::$4 ← (word) sin8s::x#6 << (byte/signed byte/word/signed word/dword/signed dword) 3
[182] (byte) sin8s::x1#0 ← > (word~) sin8s::$4
[183] (byte) mulu8_sel::v1#0 ← (byte) sin8s::x1#0
[184] (byte) mulu8_sel::v2#0 ← (byte) sin8s::x1#0
[185] call mulu8_sel
[186] (byte) mulu8_sel::return#0 ← (byte) mulu8_sel::return#12
to:sin8s::@9
sin8s::@9: scope:[sin8s] from sin8s::@2
[191] (byte) sin8s::x2#0 ← (byte) mulu8_sel::return#0
[192] (byte) mulu8_sel::v1#1 ← (byte) sin8s::x2#0
[193] (byte) mulu8_sel::v2#1 ← (byte) sin8s::x1#0
[194] call mulu8_sel
[195] (byte) mulu8_sel::return#1 ← (byte) mulu8_sel::return#12
[187] (byte) sin8s::x2#0 ← (byte) mulu8_sel::return#0
[188] (byte) mulu8_sel::v1#1 ← (byte) sin8s::x2#0
[189] (byte) mulu8_sel::v2#1 ← (byte) sin8s::x1#0
[190] call mulu8_sel
[191] (byte) mulu8_sel::return#1 ← (byte) mulu8_sel::return#12
to:sin8s::@10
sin8s::@10: scope:[sin8s] from sin8s::@9
[196] (byte) sin8s::x3#0 ← (byte) mulu8_sel::return#1
[197] (byte) mulu8_sel::v1#2 ← (byte) sin8s::x3#0
[198] call mulu8_sel
[199] (byte) mulu8_sel::return#2 ← (byte) mulu8_sel::return#12
[192] (byte) sin8s::x3#0 ← (byte) mulu8_sel::return#1
[193] (byte) mulu8_sel::v1#2 ← (byte) sin8s::x3#0
[194] call mulu8_sel
[195] (byte) mulu8_sel::return#2 ← (byte) mulu8_sel::return#12
to:sin8s::@11
sin8s::@11: scope:[sin8s] from sin8s::@10
[200] (byte) sin8s::x3_6#0 ← (byte) mulu8_sel::return#2
[201] (byte) sin8s::usinx#0 ← (byte) sin8s::x1#0 - (byte) sin8s::x3_6#0
[202] (byte) mulu8_sel::v1#3 ← (byte) sin8s::x3#0
[203] (byte) mulu8_sel::v2#3 ← (byte) sin8s::x1#0
[204] call mulu8_sel
[205] (byte) mulu8_sel::return#10 ← (byte) mulu8_sel::return#12
[196] (byte) sin8s::x3_6#0 ← (byte) mulu8_sel::return#2
[197] (byte) sin8s::usinx#0 ← (byte) sin8s::x1#0 - (byte) sin8s::x3_6#0
[198] (byte) mulu8_sel::v1#3 ← (byte) sin8s::x3#0
[199] (byte) mulu8_sel::v2#3 ← (byte) sin8s::x1#0
[200] call mulu8_sel
[201] (byte) mulu8_sel::return#10 ← (byte) mulu8_sel::return#12
to:sin8s::@12
sin8s::@12: scope:[sin8s] from sin8s::@11
[206] (byte) sin8s::x4#0 ← (byte) mulu8_sel::return#10
[207] (byte) mulu8_sel::v1#4 ← (byte) sin8s::x4#0
[208] (byte) mulu8_sel::v2#4 ← (byte) sin8s::x1#0
[209] call mulu8_sel
[210] (byte) mulu8_sel::return#11 ← (byte) mulu8_sel::return#12
[202] (byte) sin8s::x4#0 ← (byte) mulu8_sel::return#10
[203] (byte) mulu8_sel::v1#4 ← (byte) sin8s::x4#0
[204] (byte) mulu8_sel::v2#4 ← (byte) sin8s::x1#0
[205] call mulu8_sel
[206] (byte) mulu8_sel::return#11 ← (byte) mulu8_sel::return#12
to:sin8s::@13
sin8s::@13: scope:[sin8s] from sin8s::@12
[211] (byte) sin8s::x5#0 ← (byte) mulu8_sel::return#11
[212] (byte) sin8s::x5_128#0 ← (byte) sin8s::x5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 4
[213] (byte) sin8s::usinx#1 ← (byte) sin8s::usinx#0 + (byte) sin8s::x5_128#0
[214] if((byte) sin8s::usinx#1<(byte/word/signed word/dword/signed dword) $80) goto sin8s::@3
[207] (byte) sin8s::x5#0 ← (byte) mulu8_sel::return#11
[208] (byte) sin8s::x5_128#0 ← (byte) sin8s::x5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 4
[209] (byte) sin8s::usinx#1 ← (byte) sin8s::usinx#0 + (byte) sin8s::x5_128#0
[210] if((byte) sin8s::usinx#1<(byte/word/signed word/dword/signed dword) $80) goto sin8s::@3
to:sin8s::@7
sin8s::@7: scope:[sin8s] from sin8s::@13
[215] (byte) sin8s::usinx#2 ← -- (byte) sin8s::usinx#1
[211] (byte) sin8s::usinx#2 ← -- (byte) sin8s::usinx#1
to:sin8s::@3
sin8s::@3: scope:[sin8s] from sin8s::@13 sin8s::@7
[216] (byte) sin8s::usinx#4 ← phi( sin8s::@13/(byte) sin8s::usinx#1 sin8s::@7/(byte) sin8s::usinx#2 )
[217] if((byte) sin8s::isUpper#10==(byte/signed byte/word/signed word/dword/signed dword) 0) goto sin8s::@14
[212] (byte) sin8s::usinx#4 ← phi( sin8s::@13/(byte) sin8s::usinx#1 sin8s::@7/(byte) sin8s::usinx#2 )
[213] if((byte) sin8s::isUpper#10==(byte/signed byte/word/signed word/dword/signed dword) 0) goto sin8s::@14
to:sin8s::@8
sin8s::@8: scope:[sin8s] from sin8s::@3
[218] (signed byte) sin8s::sinx#1 ← - (signed byte)(byte) sin8s::usinx#4
[214] (signed byte) sin8s::sinx#1 ← - (signed byte)(byte) sin8s::usinx#4
to:sin8s::@4
sin8s::@4: scope:[sin8s] from sin8s::@14 sin8s::@8
[219] (signed byte) sin8s::return#1 ← phi( sin8s::@14/(signed byte~) sin8s::return#5 sin8s::@8/(signed byte) sin8s::sinx#1 )
[215] (signed byte) sin8s::return#1 ← phi( sin8s::@14/(signed byte~) sin8s::return#5 sin8s::@8/(signed byte) sin8s::sinx#1 )
to:sin8s::@return
sin8s::@return: scope:[sin8s] from sin8s::@4
[220] return
[216] return
to:@return
sin8s::@14: scope:[sin8s] from sin8s::@3
[221] (signed byte~) sin8s::return#5 ← (signed byte)(byte) sin8s::usinx#4
[217] (signed byte~) sin8s::return#5 ← (signed byte)(byte) sin8s::usinx#4
to:sin8s::@4
mulu8_sel: scope:[mulu8_sel] from sin8s::@10 sin8s::@11 sin8s::@12 sin8s::@2 sin8s::@9
[222] (byte) mulu8_sel::select#5 ← phi( sin8s::@9/(byte/signed byte/word/signed word/dword/signed dword) 1 sin8s::@10/(byte/signed byte/word/signed word/dword/signed dword) 1 sin8s::@11/(byte/signed byte/word/signed word/dword/signed dword) 0 sin8s::@12/(byte/signed byte/word/signed word/dword/signed dword) 0 sin8s::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[222] (byte) mulu8_sel::v2#5 ← phi( sin8s::@9/(byte) mulu8_sel::v2#1 sin8s::@10/(const byte) sin8s::DIV_6#0 sin8s::@11/(byte) mulu8_sel::v2#3 sin8s::@12/(byte) mulu8_sel::v2#4 sin8s::@2/(byte) mulu8_sel::v2#0 )
[222] (byte) mulu8_sel::v1#5 ← phi( sin8s::@9/(byte) mulu8_sel::v1#1 sin8s::@10/(byte) mulu8_sel::v1#2 sin8s::@11/(byte) mulu8_sel::v1#3 sin8s::@12/(byte) mulu8_sel::v1#4 sin8s::@2/(byte) mulu8_sel::v1#0 )
[223] (byte) mul8u::a#1 ← (byte) mulu8_sel::v1#5
[224] (byte) mul8u::b#0 ← (byte) mulu8_sel::v2#5
[225] call mul8u
[226] (word) mul8u::return#2 ← (word) mul8u::res#2
[218] (byte) mulu8_sel::select#5 ← phi( sin8s::@9/(byte/signed byte/word/signed word/dword/signed dword) 1 sin8s::@10/(byte/signed byte/word/signed word/dword/signed dword) 1 sin8s::@11/(byte/signed byte/word/signed word/dword/signed dword) 0 sin8s::@12/(byte/signed byte/word/signed word/dword/signed dword) 0 sin8s::@2/(byte/signed byte/word/signed word/dword/signed dword) 0 )
[218] (byte) mulu8_sel::v2#5 ← phi( sin8s::@9/(byte) mulu8_sel::v2#1 sin8s::@10/(const byte) sin8s::DIV_6#0 sin8s::@11/(byte) mulu8_sel::v2#3 sin8s::@12/(byte) mulu8_sel::v2#4 sin8s::@2/(byte) mulu8_sel::v2#0 )
[218] (byte) mulu8_sel::v1#5 ← phi( sin8s::@9/(byte) mulu8_sel::v1#1 sin8s::@10/(byte) mulu8_sel::v1#2 sin8s::@11/(byte) mulu8_sel::v1#3 sin8s::@12/(byte) mulu8_sel::v1#4 sin8s::@2/(byte) mulu8_sel::v1#0 )
[219] (byte) mul8u::a#1 ← (byte) mulu8_sel::v1#5
[220] (byte) mul8u::b#0 ← (byte) mulu8_sel::v2#5
[221] call mul8u
[222] (word) mul8u::return#2 ← (word) mul8u::res#2
to:mulu8_sel::@1
mulu8_sel::@1: scope:[mulu8_sel] from mulu8_sel
[227] (word~) mulu8_sel::$0 ← (word) mul8u::return#2
[228] (word~) mulu8_sel::$1 ← (word~) mulu8_sel::$0 << (byte) mulu8_sel::select#5
[229] (byte) mulu8_sel::return#12 ← > (word~) mulu8_sel::$1
[223] (word~) mulu8_sel::$0 ← (word) mul8u::return#2
[224] (word~) mulu8_sel::$1 ← (word~) mulu8_sel::$0 << (byte) mulu8_sel::select#5
[225] (byte) mulu8_sel::return#12 ← > (word~) mulu8_sel::$1
to:mulu8_sel::@return
mulu8_sel::@return: scope:[mulu8_sel] from mulu8_sel::@1
[230] return
[226] return
to:@return
mul8u: scope:[mul8u] from mulu8_sel
[231] (word) mul8u::mb#0 ← ((word)) (byte) mul8u::b#0
[227] (word) mul8u::mb#0 ← ((word)) (byte) mul8u::b#0
to:mul8u::@1
mul8u::@1: scope:[mul8u] from mul8u mul8u::@3
[232] (word) mul8u::mb#2 ← phi( mul8u/(word) mul8u::mb#0 mul8u::@3/(word) mul8u::mb#1 )
[232] (word) mul8u::res#2 ← phi( mul8u/(byte/signed byte/word/signed word/dword/signed dword) 0 mul8u::@3/(word) mul8u::res#6 )
[232] (byte) mul8u::a#2 ← phi( mul8u/(byte) mul8u::a#1 mul8u::@3/(byte) mul8u::a#0 )
[233] if((byte) mul8u::a#2!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul8u::@2
[228] (word) mul8u::mb#2 ← phi( mul8u/(word) mul8u::mb#0 mul8u::@3/(word) mul8u::mb#1 )
[228] (word) mul8u::res#2 ← phi( mul8u/(byte/signed byte/word/signed word/dword/signed dword) 0 mul8u::@3/(word) mul8u::res#6 )
[228] (byte) mul8u::a#2 ← phi( mul8u/(byte) mul8u::a#1 mul8u::@3/(byte) mul8u::a#0 )
[229] if((byte) mul8u::a#2!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul8u::@2
to:mul8u::@return
mul8u::@return: scope:[mul8u] from mul8u::@1
[234] return
[230] return
to:@return
mul8u::@2: scope:[mul8u] from mul8u::@1
[235] (byte~) mul8u::$1 ← (byte) mul8u::a#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[236] if((byte~) mul8u::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul8u::@3
[231] (byte~) mul8u::$1 ← (byte) mul8u::a#2 & (byte/signed byte/word/signed word/dword/signed dword) 1
[232] if((byte~) mul8u::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul8u::@3
to:mul8u::@4
mul8u::@4: scope:[mul8u] from mul8u::@2
[237] (word) mul8u::res#1 ← (word) mul8u::res#2 + (word) mul8u::mb#2
[233] (word) mul8u::res#1 ← (word) mul8u::res#2 + (word) mul8u::mb#2
to:mul8u::@3
mul8u::@3: scope:[mul8u] from mul8u::@2 mul8u::@4
[238] (word) mul8u::res#6 ← phi( mul8u::@2/(word) mul8u::res#2 mul8u::@4/(word) mul8u::res#1 )
[239] (byte) mul8u::a#0 ← (byte) mul8u::a#2 >> (byte/signed byte/word/signed word/dword/signed dword) 1
[240] (word) mul8u::mb#1 ← (word) mul8u::mb#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
[234] (word) mul8u::res#6 ← phi( mul8u::@2/(word) mul8u::res#2 mul8u::@4/(word) mul8u::res#1 )
[235] (byte) mul8u::a#0 ← (byte) mul8u::a#2 >> (byte/signed byte/word/signed word/dword/signed dword) 1
[236] (word) mul8u::mb#1 ← (word) mul8u::mb#2 << (byte/signed byte/word/signed word/dword/signed dword) 1
to:mul8u::@1
div16u: scope:[div16u] from sin8s_gen
[241] phi()
[242] call divr16u
[243] (word) divr16u::return#2 ← (word) divr16u::return#0
[237] phi()
[238] call divr16u
[239] (word) divr16u::return#2 ← (word) divr16u::return#0
to:div16u::@1
div16u::@1: scope:[div16u] from div16u
[244] (word) div16u::return#0 ← (word) divr16u::return#2
[240] (word) div16u::return#0 ← (word) divr16u::return#2
to:div16u::@return
div16u::@return: scope:[div16u] from div16u::@1
[245] return
[241] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,7 @@
(const word) PI_u4f12#0 PI_u4f12 = (word/signed word/dword/signed dword) $3244
(dword) PI_u4f28
(const dword) PI_u4f28#0 PI_u4f28 = (dword/signed dword) $3243f6a9
(const byte) SIZEOF_SIGNED_WORD SIZEOF_SIGNED_WORD = (byte/signed byte/word/signed word/dword/signed dword) 2
(word()) div16u((word) div16u::dividend , (word) div16u::divisor)
(label) div16u::@1
(label) div16u::@return
@ -72,31 +73,28 @@
(word) divr16u::return#3 return zp ZP_WORD:15 4.0
(word) divr16u::return#4 return zp ZP_WORD:15 4.0
(void()) main()
(word) main::$11 $11 zp ZP_WORD:2 22.0
(word~) main::$3 $3 zp ZP_WORD:2 22.0
(word~) main::$4 $4 zp ZP_WORD:2 22.0
(signed word*~) main::$5 $5 zp ZP_WORD:2 22.0
(byte~) main::$6 reg byte a 11.0
(signed word*~) main::$4 $4 zp ZP_WORD:2 22.0
(byte~) main::$5 reg byte a 11.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@return
(byte) main::i
(byte) main::i#1 reg byte x 16.5
(byte) main::i#2 reg byte x 2.75
(byte) main::i#2 reg byte x 3.6666666666666665
(signed byte) main::sb
(signed byte) main::sb#0 sb zp ZP_BYTE:4 3.6666666666666665
(signed byte) main::sd
(signed byte) main::sd#0 sd zp ZP_BYTE:4 6.6000000000000005
(signed byte) main::sd#0 reg byte a 22.0
(signed byte[$c0]) main::sintabb
(const signed byte[$c0]) main::sintabb#0 sintabb = { fill( $c0, 0) }
(signed word[$c0]) main::sintabw
(const signed word[$c0]) main::sintabw#0 sintabw = { fill( $c0, 0) }
(const string) main::str str = (string) " @"
(const string) main::str1 str1 = (string) " @"
(signed word) main::sw
(signed word) main::sw#0 sw zp ZP_WORD:15 22.0
(word) main::wavelength
@ -215,12 +213,10 @@
(byte) print_char::ch#4 reg byte a 6.0
(byte*) print_char_cursor
(byte*) print_char_cursor#1 print_char_cursor zp ZP_WORD:5 101.0
(byte*) print_char_cursor#10 print_char_cursor zp ZP_WORD:5 1.0
(byte*) print_char_cursor#2 print_char_cursor zp ZP_WORD:5 40.875
(byte*) print_char_cursor#29 print_char_cursor zp ZP_WORD:5 6.0
(byte*) print_char_cursor#44 print_char_cursor zp ZP_WORD:5 5.200000000000001
(byte*) print_char_cursor#45 print_char_cursor zp ZP_WORD:5 3.3000000000000003
(byte*) print_char_cursor#47 print_char_cursor zp ZP_WORD:5 24.0
(byte*) print_char_cursor#10 print_char_cursor zp ZP_WORD:5 0.4444444444444444
(byte*) print_char_cursor#19 print_char_cursor zp ZP_WORD:5 45.142857142857146
(byte*) print_char_cursor#28 print_char_cursor zp ZP_WORD:5 6.0
(byte*) print_char_cursor#42 print_char_cursor zp ZP_WORD:5 1.25
(void()) print_cls()
(label) print_cls::@1
(label) print_cls::@return
@ -248,8 +244,7 @@
(label) print_str::@return
(byte*) print_str::str
(byte*) print_str::str#0 str zp ZP_WORD:2 202.0
(byte*) print_str::str#3 str zp ZP_WORD:2 101.5
(byte*) print_str::str#5 str zp ZP_WORD:2 2.0
(byte*) print_str::str#2 str zp ZP_WORD:2 101.0
(word) rem16u
(word) rem16u#1 rem16u zp ZP_WORD:2 0.8
(signed word()) sin16s((dword) sin16s::x)
@ -388,10 +383,10 @@
(word) sin8s_gen::x#2 x zp ZP_WORD:2 4.714285714285714
reg byte x [ main::i#2 main::i#1 ]
zp ZP_WORD:2 [ print_str::str#3 print_str::str#5 print_str::str#0 print_cls::sc#2 print_cls::sc#1 sin16s_gen::sintab#2 sin16s_gen::sintab#0 divr16u::rem#6 divr16u::rem#11 divr16u::rem#5 divr16u::rem#10 divr16u::rem#7 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin8s_gen::x#2 sin8s_gen::x#1 main::$3 main::$4 main::$5 ]
zp ZP_BYTE:4 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 main::sd#0 main::sb#0 sin16s::isUpper#2 sin8s::isUpper#10 ]
zp ZP_WORD:2 [ print_str::str#2 print_str::str#0 print_cls::sc#2 print_cls::sc#1 sin16s_gen::sintab#2 sin16s_gen::sintab#0 divr16u::rem#6 divr16u::rem#11 divr16u::rem#5 divr16u::rem#10 divr16u::rem#7 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 rem16u#1 sin8s_gen::x#2 sin8s_gen::x#1 main::$3 main::$11 main::$4 ]
zp ZP_BYTE:4 [ print_sbyte::b#4 print_sbyte::b#0 print_sbyte::b#1 sin16s::isUpper#2 sin8s::isUpper#10 main::sb#0 ]
reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ]
zp ZP_WORD:5 [ print_char_cursor#29 print_char_cursor#47 print_char_cursor#44 print_char_cursor#45 print_char_cursor#2 print_char_cursor#10 print_char_cursor#1 sin16s_gen::i#2 sin16s_gen::i#1 divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 sin8s_gen::sintab#2 sin8s_gen::sintab#0 ]
zp ZP_WORD:5 [ print_char_cursor#28 print_char_cursor#42 print_char_cursor#19 print_char_cursor#10 print_char_cursor#1 sin16s_gen::i#2 sin16s_gen::i#1 divr16u::dividend#4 divr16u::dividend#6 divr16u::dividend#0 sin8s_gen::sintab#2 sin8s_gen::sintab#0 ]
zp ZP_DWORD:7 [ sin16s_gen::x#2 sin16s_gen::x#1 ]
zp ZP_DWORD:11 [ sin16s::x#6 sin16s::x#4 sin16s::x#0 sin16s::x#1 sin16s::x#2 sin16s::$4 mul16u::res#2 mul16u::res#6 mul16u::res#1 mul16u::return#2 mulu16_sel::$0 mulu16_sel::$1 ]
zp ZP_WORD:15 [ sin16s::return#1 sin16s::return#5 sin16s::sinx#1 sin16s::usinx#1 sin16s::return#0 sin16s_gen::$1 sin16s::usinx#0 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#3 divr16u::return#4 divr16u::return#2 div32u16u::quotient_lo#0 div16u::return#2 sin8s_gen::step#0 div16u::return#0 main::sw#0 ]
@ -407,7 +402,8 @@ reg byte x [ mulu8_sel::v1#5 mulu8_sel::v1#1 mulu8_sel::v1#2 mulu8_sel::v1#3 mul
reg byte y [ mulu8_sel::v2#5 mulu8_sel::v2#1 mulu8_sel::v2#3 mulu8_sel::v2#4 mulu8_sel::v2#0 ]
zp ZP_BYTE:27 [ mulu8_sel::select#5 ]
reg byte x [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ]
reg byte a [ main::$6 ]
reg byte a [ main::$5 ]
reg byte a [ main::sd#0 ]
reg byte a [ print_byte::$0 ]
reg byte a [ print_byte::$2 ]
zp ZP_DWORD:28 [ div32u16u::return#2 sin16s_gen::step#0 div32u16u::return#0 ]

View File

@ -9,14 +9,14 @@ main: scope:[main] from @1
(word/signed dword/dword/signed word~) main::$1 ← (word/signed word/dword/signed dword) $400 + (byte/word/signed word/dword/signed dword~) main::$0
(byte*) main::SCREEN#0 ← ((byte*)) (word/signed dword/dword/signed word~) main::$1
(word[3]) main::words#0 ← ((word*)) (word/signed word/dword/signed dword) $400
(byte) main::$6 ← (byte/signed byte/word/signed word/dword/signed dword) 1 * (const byte) SIZEOF_WORD
(word) main::w1#0 ← *((word[3]) main::words#0 + (byte) main::$6)
(byte/signed byte/word/signed word/dword/signed dword) main::$6 ← (byte/signed byte/word/signed word/dword/signed dword) 1 * (const byte) SIZEOF_WORD
(word) main::w1#0 ← *((word[3]) main::words#0 + (byte/signed byte/word/signed word/dword/signed dword) main::$6)
(byte~) main::$2 ← < (word) main::w1#0
*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$2
(byte~) main::$3 ← > (word) main::w1#0
*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$3
(byte) main::$7 ← (byte/signed byte/word/signed word/dword/signed dword) 2 * (const byte) SIZEOF_WORD
(word) main::w2#0 ← *((word[3]) main::words#0 + (byte) main::$7)
(byte/signed byte/word/signed word/dword/signed dword) main::$7 ← (byte/signed byte/word/signed word/dword/signed dword) 2 * (const byte) SIZEOF_WORD
(word) main::w2#0 ← *((word[3]) main::words#0 + (byte/signed byte/word/signed word/dword/signed dword) main::$7)
(byte~) main::$4 ← < (word) main::w2#0
*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte~) main::$4
(byte~) main::$5 ← > (word) main::w2#0
@ -45,8 +45,8 @@ SYMBOL TABLE SSA
(byte~) main::$3
(byte~) main::$4
(byte~) main::$5
(byte) main::$6
(byte) main::$7
(byte/signed byte/word/signed word/dword/signed dword) main::$6
(byte/signed byte/word/signed word/dword/signed dword) main::$7
(label) main::@return
(byte*) main::SCREEN
(byte*) main::SCREEN#0
@ -61,8 +61,8 @@ Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
Constant (const byte/word/signed word/dword/signed dword) main::$0 = 6*$28
Constant (const word[3]) main::words#0 = ((word*))$400
Constant (const byte) main::$6 = 1*SIZEOF_WORD
Constant (const byte) main::$7 = 2*SIZEOF_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$6 = 1*SIZEOF_WORD
Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$7 = 2*SIZEOF_WORD
Successful SSA optimization Pass2ConstantIdentification
Constant (const word/signed dword/dword/signed word) main::$1 = $400+main::$0
Successful SSA optimization Pass2ConstantIdentification