1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-02-19 08:31:01 +00:00

Fixed a few array initializer kickasm problems. Changed atan2 to use it.

This commit is contained in:
jespergravgaard 2019-06-30 23:33:30 +02:00
parent c4bcbddcd4
commit cc08edb0e4
23 changed files with 4888 additions and 5469 deletions

View File

@ -53,6 +53,8 @@ public class Pass3AssertArrayLengths extends Pass2SsaAssertion {
if(!assignedSizeVal.equals(declaredSizeInt)) {
throw new CompileError("Error! Array length mismatch " + constantVar.toString(getProgram()));
}
} else if(constantValue instanceof ConstantArrayKickAsm) {
// KickAsm array initializer is assumed good!
} else {
ConstantLiteral constantLiteral = constantValue.calculateLiteral(getScope());
if(constantLiteral instanceof ConstantString) {

View File

@ -483,7 +483,7 @@ public class Pass4CodeGeneration {
if(size instanceof ConstantValue) {
ConstantLiteral sizeLiteral = ((ConstantValue) size).calculateLiteral(getScope());
if(sizeLiteral instanceof ConstantInteger) {
bytes = (int)sizeLiteral.getValue() * elementType.getSizeBytes();
bytes = (int)(((ConstantInteger) sizeLiteral).getInteger() * elementType.getSizeBytes());
}
}
}

View File

@ -5,13 +5,10 @@
const byte CORDIC_ITERATIONS_16 = 15;
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
word* CORDIC_ATAN2_ANGLES_16 = 0x1000;
// Populate cordic angles table
kickasm(pc CORDIC_ATAN2_ANGLES_16, uses CORDIC_ITERATIONS_16) {{
word[CORDIC_ITERATIONS_16] CORDIC_ATAN2_ANGLES_16 = kickasm {{
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
}};
// Find the atan2(x, y) - which is the angle of the line from (0,0) to (x,y)
// Finding the angle requires a binary search using CORDIC_ITERATIONS_16
@ -48,12 +45,9 @@ word atan2_16(signed word x, signed word y) {
const byte CORDIC_ITERATIONS_8 = 8;
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
byte* CORDIC_ATAN2_ANGLES_8 = 0x1100;
// Populate cordic angles table
kickasm(pc CORDIC_ATAN2_ANGLES_8, uses CORDIC_ITERATIONS_8) {{
byte[CORDIC_ITERATIONS_8] CORDIC_ATAN2_ANGLES_8 = kickasm {{
.fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2
}}
}};
// Find the atan2(x, y) - which is the angle of the line from (0,0) to (x,y)
// Finding the angle requires a binary search using CORDIC_ITERATIONS

View File

@ -5,12 +5,6 @@
.pc = $80d "Program"
// The number of iterations performed during 16-bit CORDIC atan2 calculation
.const CORDIC_ITERATIONS_16 = $f
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
.label CORDIC_ATAN2_ANGLES_16 = $1000
// The number of iterations performed during 8-bit CORDIC atan2 calculation
.const CORDIC_ITERATIONS_8 = 8
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
.label CORDIC_ATAN2_ANGLES_8 = $1100
.label D018 = $d018
// Color Ram
.label COLS = $d800
@ -18,8 +12,6 @@
.label SCREEN = $2800
.label SCREEN_REF = $2c00
.label print_char_cursor = 9
// Populate cordic angles table
// Populate cordic angles table
main: {
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
.label _12 = $10
@ -453,14 +445,12 @@ init_font_hex: {
}
// Bit patterns for symbols 0-f (3x5 pixels) used in font hex
FONT_HEX_PROTO: .byte 2, 5, 5, 5, 2, 6, 2, 2, 2, 7, 6, 1, 2, 4, 7, 6, 1, 2, 1, 6, 5, 5, 7, 1, 1, 7, 4, 6, 1, 6, 3, 4, 6, 5, 2, 7, 1, 1, 1, 1, 2, 5, 2, 5, 2, 2, 5, 3, 1, 1, 2, 5, 7, 5, 5, 6, 5, 6, 5, 6, 2, 5, 4, 5, 2, 6, 5, 5, 5, 6, 7, 4, 6, 4, 7, 7, 4, 6, 4, 4
print_hextab: .text "0123456789abcdef"
.pc = CORDIC_ATAN2_ANGLES_16 "CORDIC_ATAN2_ANGLES_16"
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
CORDIC_ATAN2_ANGLES_16:
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
.pc = CORDIC_ATAN2_ANGLES_8 "CORDIC_ATAN2_ANGLES_8"
.fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2
print_hextab: .text "0123456789abcdef"
.pc = SCREEN_REF "SCREEN_REF"
.for(var y=-12;y<=12;y++)
.for(var x=-19;x<=20;x++)

View File

@ -2,247 +2,238 @@
[0] phi()
to:@1
@1: scope:[] from @begin
kickasm(location (const word*) CORDIC_ATAN2_ANGLES_16#0 uses CORDIC_ITERATIONS_16#0) {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
to:@2
@2: scope:[] from @1
kickasm(location (const byte*) CORDIC_ATAN2_ANGLES_8#0 uses CORDIC_ITERATIONS_8#0) {{ .fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2
}}
to:@3
@3: scope:[] from @2
kickasm(location (const byte*) SCREEN_REF#0) {{ .for(var y=-12;y<=12;y++)
.for(var x=-19;x<=20;x++)
.byte round(256*atan2(y, x)/PI/2)
}}
to:@4
@4: scope:[] from @3
[4] phi()
[5] call main
to:@2
@2: scope:[] from @1
[2] phi()
[3] call main
to:@end
@end: scope:[] from @4
[6] phi()
main: scope:[main] from @4
[7] phi()
[8] call init_font_hex
@end: scope:[] from @2
[4] phi()
main: scope:[main] from @2
[5] phi()
[6] call init_font_hex
to:main::toD0181
main::toD0181: scope:[main] from main
[9] phi()
[7] phi()
to:main::@6
main::@6: scope:[main] from main::toD0181
[10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
[8] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
to:main::@1
main::@1: scope:[main] from main::@3 main::@6
[11] (byte*) main::screen#5 ← phi( main::@6/(const byte*) SCREEN#0 main::@3/(byte*) main::screen#1 )
[11] (word) main::diff_sum#7 ← phi( main::@6/(byte) 0 main::@3/(word) main::diff_sum#1 )
[11] (byte*) main::screen_ref#5 ← phi( main::@6/(const byte*) SCREEN_REF#0 main::@3/(byte*) main::screen_ref#1 )
[11] (signed byte) main::y#4 ← phi( main::@6/(signed byte) -$c main::@3/(signed byte) main::y#1 )
[9] (byte*) main::screen#5 ← phi( main::@6/(const byte*) SCREEN#0 main::@3/(byte*) main::screen#1 )
[9] (word) main::diff_sum#7 ← phi( main::@6/(byte) 0 main::@3/(word) main::diff_sum#1 )
[9] (byte*) main::screen_ref#5 ← phi( main::@6/(const byte*) SCREEN_REF#0 main::@3/(byte*) main::screen_ref#1 )
[9] (signed byte) main::y#4 ← phi( main::@6/(signed byte) -$c main::@3/(signed byte) main::y#1 )
to:main::@2
main::@2: scope:[main] from main::@1 main::@8
[12] (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#5 main::@8/(byte*) main::screen#1 )
[12] (word) main::diff_sum#2 ← phi( main::@1/(word) main::diff_sum#7 main::@8/(word) main::diff_sum#1 )
[12] (byte*) main::screen_ref#2 ← phi( main::@1/(byte*) main::screen_ref#5 main::@8/(byte*) main::screen_ref#1 )
[12] (signed byte) main::x#2 ← phi( main::@1/(signed byte) -$13 main::@8/(signed byte) main::x#1 )
[13] (word) main::xw#0 ← (byte)(signed byte) main::x#2 w= (byte) 0
[14] (word) main::yw#0 ← (byte)(signed byte) main::y#4 w= (byte) 0
[15] (signed word) atan2_16::x#0 ← (signed word)(word) main::xw#0
[16] (signed word) atan2_16::y#0 ← (signed word)(word) main::yw#0
[17] call atan2_16
[18] (word) atan2_16::return#2 ← (word) atan2_16::return#0
[10] (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#5 main::@8/(byte*) main::screen#1 )
[10] (word) main::diff_sum#2 ← phi( main::@1/(word) main::diff_sum#7 main::@8/(word) main::diff_sum#1 )
[10] (byte*) main::screen_ref#2 ← phi( main::@1/(byte*) main::screen_ref#5 main::@8/(byte*) main::screen_ref#1 )
[10] (signed byte) main::x#2 ← phi( main::@1/(signed byte) -$13 main::@8/(signed byte) main::x#1 )
[11] (word) main::xw#0 ← (byte)(signed byte) main::x#2 w= (byte) 0
[12] (word) main::yw#0 ← (byte)(signed byte) main::y#4 w= (byte) 0
[13] (signed word) atan2_16::x#0 ← (signed word)(word) main::xw#0
[14] (signed word) atan2_16::y#0 ← (signed word)(word) main::yw#0
[15] call atan2_16
[16] (word) atan2_16::return#2 ← (word) atan2_16::return#0
to:main::@7
main::@7: scope:[main] from main::@2
[19] (word) main::angle_w#0 ← (word) atan2_16::return#2
[20] (word~) main::$12 ← (word) main::angle_w#0 + (byte) $80
[21] (byte) main::ang_w#0 ← > (word~) main::$12
[22] (byte) diff::bb1#0 ← (byte) main::ang_w#0
[23] (byte) diff::bb2#0 ← *((byte*) main::screen_ref#2)
[24] call diff
[25] (byte) diff::return#0 ← (byte) diff::return#1
[17] (word) main::angle_w#0 ← (word) atan2_16::return#2
[18] (word~) main::$12 ← (word) main::angle_w#0 + (byte) $80
[19] (byte) main::ang_w#0 ← > (word~) main::$12
[20] (byte) diff::bb1#0 ← (byte) main::ang_w#0
[21] (byte) diff::bb2#0 ← *((byte*) main::screen_ref#2)
[22] call diff
[23] (byte) diff::return#0 ← (byte) diff::return#1
to:main::@8
main::@8: scope:[main] from main::@7
[26] (byte~) main::$14 ← (byte) diff::return#0
[27] (word) main::diff_sum#1 ← (word) main::diff_sum#2 + (byte~) main::$14
[28] (byte~) main::$15 ← (byte) main::ang_w#0 - *((byte*) main::screen_ref#2)
[29] *((byte*) main::screen#2) ← (byte~) main::$15
[30] (byte*) main::screen#1 ← ++ (byte*) main::screen#2
[31] (byte*) main::screen_ref#1 ← ++ (byte*) main::screen_ref#2
[32] (signed byte) main::x#1 ← ++ (signed byte) main::x#2
[33] if((signed byte) main::x#1!=(signed byte) $15) goto main::@2
[24] (byte~) main::$14 ← (byte) diff::return#0
[25] (word) main::diff_sum#1 ← (word) main::diff_sum#2 + (byte~) main::$14
[26] (byte~) main::$15 ← (byte) main::ang_w#0 - *((byte*) main::screen_ref#2)
[27] *((byte*) main::screen#2) ← (byte~) main::$15
[28] (byte*) main::screen#1 ← ++ (byte*) main::screen#2
[29] (byte*) main::screen_ref#1 ← ++ (byte*) main::screen_ref#2
[30] (signed byte) main::x#1 ← ++ (signed byte) main::x#2
[31] if((signed byte) main::x#1!=(signed byte) $15) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@8
[34] (signed byte) main::y#1 ← ++ (signed byte) main::y#4
[35] if((signed byte) main::y#1!=(signed byte) $d) goto main::@1
[32] (signed byte) main::y#1 ← ++ (signed byte) main::y#4
[33] if((signed byte) main::y#1!=(signed byte) $d) goto main::@1
to:main::@4
main::@4: scope:[main] from main::@3
[36] (word) print_word::w#0 ← (word) main::diff_sum#1
[37] call print_word
[34] (word) print_word::w#0 ← (word) main::diff_sum#1
[35] call print_word
to:main::@5
main::@5: scope:[main] from main::@4 main::@5
[38] *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13) ← ++ *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13)
[36] *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13) ← ++ *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13)
to:main::@5
print_word: scope:[print_word] from main::@4
[39] (byte) print_byte::b#0 ← > (word) print_word::w#0
[40] call print_byte
[37] (byte) print_byte::b#0 ← > (word) print_word::w#0
[38] call print_byte
to:print_word::@1
print_word::@1: scope:[print_word] from print_word
[41] (byte) print_byte::b#1 ← < (word) print_word::w#0
[42] call print_byte
[39] (byte) print_byte::b#1 ← < (word) print_word::w#0
[40] call print_byte
to:print_word::@return
print_word::@return: scope:[print_word] from print_word::@1
[43] return
[41] return
to:@return
print_byte: scope:[print_byte] from print_word print_word::@1
[44] (byte*) print_char_cursor#24 ← phi( print_word/(byte*) 1024 print_word::@1/(byte*) print_char_cursor#19 )
[44] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[45] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
[46] (byte) print_char::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0)
[47] call print_char
[42] (byte*) print_char_cursor#24 ← phi( print_word/(byte*) 1024 print_word::@1/(byte*) print_char_cursor#19 )
[42] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[43] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
[44] (byte) print_char::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0)
[45] call print_char
to:print_byte::@1
print_byte::@1: scope:[print_byte] from print_byte
[48] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
[49] (byte) print_char::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2)
[50] call print_char
[46] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
[47] (byte) print_char::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2)
[48] call print_char
to:print_byte::@return
print_byte::@return: scope:[print_byte] from print_byte::@1
[51] return
[49] return
to:@return
print_char: scope:[print_char] from print_byte print_byte::@1
[52] (byte*) print_char_cursor#18 ← phi( print_byte/(byte*) print_char_cursor#24 print_byte::@1/(byte*) print_char_cursor#19 )
[52] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
[53] *((byte*) print_char_cursor#18) ← (byte) print_char::ch#2
[54] (byte*) print_char_cursor#19 ← ++ (byte*) print_char_cursor#18
[50] (byte*) print_char_cursor#18 ← phi( print_byte/(byte*) print_char_cursor#24 print_byte::@1/(byte*) print_char_cursor#19 )
[50] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
[51] *((byte*) print_char_cursor#18) ← (byte) print_char::ch#2
[52] (byte*) print_char_cursor#19 ← ++ (byte*) print_char_cursor#18
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[55] return
[53] return
to:@return
diff: scope:[diff] from main::@7
[56] if((byte) diff::bb1#0<(byte) diff::bb2#0) goto diff::@1
[54] if((byte) diff::bb1#0<(byte) diff::bb2#0) goto diff::@1
to:diff::@2
diff::@2: scope:[diff] from diff
[57] (byte~) diff::$2 ← (byte) diff::bb1#0 - (byte) diff::bb2#0
[55] (byte~) diff::$2 ← (byte) diff::bb1#0 - (byte) diff::bb2#0
to:diff::@3
diff::@3: scope:[diff] from diff::@1 diff::@2
[58] (byte) diff::return#1 ← phi( diff::@1/(byte~) diff::$4 diff::@2/(byte~) diff::$2 )
[56] (byte) diff::return#1 ← phi( diff::@1/(byte~) diff::$4 diff::@2/(byte~) diff::$2 )
to:diff::@return
diff::@return: scope:[diff] from diff::@3
[59] return
[57] return
to:@return
diff::@1: scope:[diff] from diff
[60] (byte~) diff::$4 ← (byte) diff::bb2#0 - (byte) diff::bb1#0
[58] (byte~) diff::$4 ← (byte) diff::bb2#0 - (byte) diff::bb1#0
to:diff::@3
atan2_16: scope:[atan2_16] from main::@2
[61] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1
[59] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1
to:atan2_16::@2
atan2_16::@2: scope:[atan2_16] from atan2_16
[62] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0
[60] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0
to:atan2_16::@3
atan2_16::@3: scope:[atan2_16] from atan2_16::@1 atan2_16::@2
[63] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 )
[64] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4
[61] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 )
[62] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4
to:atan2_16::@5
atan2_16::@5: scope:[atan2_16] from atan2_16::@3
[65] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
[63] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@6: scope:[atan2_16] from atan2_16::@4 atan2_16::@5
[66] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#8 atan2_16::@5/(signed word~) atan2_16::$7 )
[64] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#8 atan2_16::@5/(signed word~) atan2_16::$7 )
to:atan2_16::@10
atan2_16::@10: scope:[atan2_16] from atan2_16::@14 atan2_16::@6
[67] (word) atan2_16::angle#12 ← phi( atan2_16::@14/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[67] (byte) atan2_16::i#2 ← phi( atan2_16::@14/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[67] (signed word) atan2_16::xi#3 ← phi( atan2_16::@14/(signed word) atan2_16::xi#7 atan2_16::@6/(signed word) atan2_16::xi#0 )
[67] (signed word) atan2_16::yi#3 ← phi( atan2_16::@14/(signed word) atan2_16::yi#7 atan2_16::@6/(signed word) atan2_16::yi#0 )
[68] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
[65] (word) atan2_16::angle#12 ← phi( atan2_16::@14/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[65] (byte) atan2_16::i#2 ← phi( atan2_16::@14/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[65] (signed word) atan2_16::xi#3 ← phi( atan2_16::@14/(signed word) atan2_16::xi#7 atan2_16::@6/(signed word) atan2_16::xi#0 )
[65] (signed word) atan2_16::yi#3 ← phi( atan2_16::@14/(signed word) atan2_16::yi#7 atan2_16::@6/(signed word) atan2_16::yi#0 )
[66] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
to:atan2_16::@12
atan2_16::@12: scope:[atan2_16] from atan2_16::@10 atan2_16::@14
[69] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@14/(word) atan2_16::angle#13 )
[70] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[71] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
[67] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@14/(word) atan2_16::angle#13 )
[68] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[69] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
to:atan2_16::@16
atan2_16::@16: scope:[atan2_16] from atan2_16::@12
[72] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
[70] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
to:atan2_16::@7
atan2_16::@7: scope:[atan2_16] from atan2_16::@12 atan2_16::@16
[73] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@16/(word) atan2_16::angle#4 )
[74] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
[71] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@16/(word) atan2_16::angle#4 )
[72] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
to:atan2_16::@9
atan2_16::@9: scope:[atan2_16] from atan2_16::@7
[75] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
[73] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
to:atan2_16::@8
atan2_16::@8: scope:[atan2_16] from atan2_16::@7 atan2_16::@9
[76] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
[74] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
to:atan2_16::@return
atan2_16::@return: scope:[atan2_16] from atan2_16::@8
[77] return
[75] return
to:@return
atan2_16::@11: scope:[atan2_16] from atan2_16::@10
[78] (signed word) atan2_16::xd#0 ← (signed word) atan2_16::xi#3 >> (byte) atan2_16::i#2
[79] (signed word) atan2_16::yd#0 ← (signed word) atan2_16::yi#3 >> (byte) atan2_16::i#2
[80] if((signed word) atan2_16::yi#3>(signed byte) 0) goto atan2_16::@13
[76] (signed word) atan2_16::xd#0 ← (signed word) atan2_16::xi#3 >> (byte) atan2_16::i#2
[77] (signed word) atan2_16::yd#0 ← (signed word) atan2_16::yi#3 >> (byte) atan2_16::i#2
[78] if((signed word) atan2_16::yi#3>(signed byte) 0) goto atan2_16::@13
to:atan2_16::@15
atan2_16::@15: scope:[atan2_16] from atan2_16::@11
[81] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#0
[82] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#0
[83] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
[84] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
[79] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#0
[80] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#0
[81] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
[82] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
to:atan2_16::@14
atan2_16::@14: scope:[atan2_16] from atan2_16::@13 atan2_16::@15
[85] (signed word) atan2_16::xi#7 ← phi( atan2_16::@13/(signed word) atan2_16::xi#1 atan2_16::@15/(signed word) atan2_16::xi#2 )
[85] (word) atan2_16::angle#13 ← phi( atan2_16::@13/(word) atan2_16::angle#2 atan2_16::@15/(word) atan2_16::angle#3 )
[85] (signed word) atan2_16::yi#7 ← phi( atan2_16::@13/(signed word) atan2_16::yi#1 atan2_16::@15/(signed word) atan2_16::yi#2 )
[86] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[87] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12
[83] (signed word) atan2_16::xi#7 ← phi( atan2_16::@13/(signed word) atan2_16::xi#1 atan2_16::@15/(signed word) atan2_16::xi#2 )
[83] (word) atan2_16::angle#13 ← phi( atan2_16::@13/(word) atan2_16::angle#2 atan2_16::@15/(word) atan2_16::angle#3 )
[83] (signed word) atan2_16::yi#7 ← phi( atan2_16::@13/(signed word) atan2_16::yi#1 atan2_16::@15/(signed word) atan2_16::yi#2 )
[84] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[85] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12
to:atan2_16::@10
atan2_16::@13: scope:[atan2_16] from atan2_16::@11
[88] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#0
[89] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#0
[90] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[91] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
[86] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#0
[87] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#0
[88] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[89] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
to:atan2_16::@14
atan2_16::@4: scope:[atan2_16] from atan2_16::@3
[92] (signed word~) atan2_16::xi#8 ← (signed word) atan2_16::x#0
[90] (signed word~) atan2_16::xi#8 ← (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@1: scope:[atan2_16] from atan2_16
[93] (signed word~) atan2_16::yi#11 ← (signed word) atan2_16::y#0
[91] (signed word~) atan2_16::yi#11 ← (signed word) atan2_16::y#0
to:atan2_16::@3
init_font_hex: scope:[init_font_hex] from main
[94] phi()
[92] phi()
to:init_font_hex::@1
init_font_hex::@1: scope:[init_font_hex] from init_font_hex init_font_hex::@5
[95] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[95] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[95] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
[93] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[93] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[93] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
to:init_font_hex::@2
init_font_hex::@2: scope:[init_font_hex] from init_font_hex::@1 init_font_hex::@4
[96] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[96] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[96] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[97] *((byte*) init_font_hex::charset#2) ← (byte) 0
[94] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[94] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[94] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[95] *((byte*) init_font_hex::charset#2) ← (byte) 0
to:init_font_hex::@3
init_font_hex::@3: scope:[init_font_hex] from init_font_hex::@2 init_font_hex::@3
[98] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[98] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[99] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[100] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[101] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[102] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[103] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[104] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[105] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
[96] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[96] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[97] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[98] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[99] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[100] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[101] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[102] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[103] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
to:init_font_hex::@4
init_font_hex::@4: scope:[init_font_hex] from init_font_hex::@3
[106] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[107] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[108] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[109] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[110] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[111] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[112] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
[104] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[105] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[106] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[107] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[108] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[109] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[110] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
to:init_font_hex::@5
init_font_hex::@5: scope:[init_font_hex] from init_font_hex::@4
[113] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[114] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[115] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
[111] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[112] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[113] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
to:init_font_hex::@return
init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5
[116] return
[114] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +1,17 @@
(label) @1
(label) @2
(label) @3
(label) @4
(label) @begin
(label) @end
(byte*) CHARSET
(const byte*) CHARSET#0 CHARSET = (byte*) 8192
(byte*) COLS
(const byte*) COLS#0 COLS = (byte*) 55296
(word*) CORDIC_ATAN2_ANGLES_16
(const word*) CORDIC_ATAN2_ANGLES_16#0 CORDIC_ATAN2_ANGLES_16 = (word*) 4096
(byte*) CORDIC_ATAN2_ANGLES_8
(const byte*) CORDIC_ATAN2_ANGLES_8#0 CORDIC_ATAN2_ANGLES_8 = (byte*) 4352
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16
(const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 CORDIC_ATAN2_ANGLES_16 = kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
(byte) CORDIC_ITERATIONS_16
(const byte) CORDIC_ITERATIONS_16#0 CORDIC_ITERATIONS_16 = (byte) $f
(byte) CORDIC_ITERATIONS_8
(const byte) CORDIC_ITERATIONS_8#0 CORDIC_ITERATIONS_8 = (byte) 8
(byte*) D018
(const byte*) D018#0 D018 = (byte*) 53272
(byte[]) FONT_HEX_PROTO

View File

@ -5,19 +5,11 @@
.pc = $80d "Program"
// The number of iterations performed during 16-bit CORDIC atan2 calculation
.const CORDIC_ITERATIONS_16 = $f
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
.label CORDIC_ATAN2_ANGLES_16 = $1000
// The number of iterations performed during 8-bit CORDIC atan2 calculation
.const CORDIC_ITERATIONS_8 = 8
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
.label CORDIC_ATAN2_ANGLES_8 = $1100
.label D018 = $d018
// Color Ram
.label COLS = $d800
.label CHARSET = $2000
.label SCREEN = $2800
// Populate cordic angles table
// Populate cordic angles table
main: {
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
.label _11 = $a
@ -361,10 +353,8 @@ init_font_hex: {
}
// Bit patterns for symbols 0-f (3x5 pixels) used in font hex
FONT_HEX_PROTO: .byte 2, 5, 5, 5, 2, 6, 2, 2, 2, 7, 6, 1, 2, 4, 7, 6, 1, 2, 1, 6, 5, 5, 7, 1, 1, 7, 4, 6, 1, 6, 3, 4, 6, 5, 2, 7, 1, 1, 1, 1, 2, 5, 2, 5, 2, 2, 5, 3, 1, 1, 2, 5, 7, 5, 5, 6, 5, 6, 5, 6, 2, 5, 4, 5, 2, 6, 5, 5, 5, 6, 7, 4, 6, 4, 7, 7, 4, 6, 4, 4
.pc = CORDIC_ATAN2_ANGLES_16 "CORDIC_ATAN2_ANGLES_16"
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
CORDIC_ATAN2_ANGLES_16:
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
.pc = CORDIC_ATAN2_ANGLES_8 "CORDIC_ATAN2_ANGLES_8"
.fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2

View File

@ -2,173 +2,164 @@
[0] phi()
to:@1
@1: scope:[] from @begin
kickasm(location (const word*) CORDIC_ATAN2_ANGLES_16#0 uses CORDIC_ITERATIONS_16#0) {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
to:@2
@2: scope:[] from @1
kickasm(location (const byte*) CORDIC_ATAN2_ANGLES_8#0 uses CORDIC_ITERATIONS_8#0) {{ .fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2
}}
to:@3
@3: scope:[] from @2
[3] phi()
[4] call main
[1] phi()
[2] call main
to:@end
@end: scope:[] from @3
[5] phi()
main: scope:[main] from @3
[6] phi()
[7] call init_font_hex
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
[5] call init_font_hex
to:main::toD0181
main::toD0181: scope:[main] from main
[8] phi()
[6] phi()
to:main::@5
main::@5: scope:[main] from main::toD0181
[9] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
[7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
to:main::@1
main::@1: scope:[main] from main::@3 main::@5
[10] (byte*) main::screen#4 ← phi( main::@5/(const byte*) SCREEN#0 main::@3/(byte*) main::screen#1 )
[10] (signed byte) main::y#4 ← phi( main::@5/(signed byte) -$c main::@3/(signed byte) main::y#1 )
[8] (byte*) main::screen#4 ← phi( main::@5/(const byte*) SCREEN#0 main::@3/(byte*) main::screen#1 )
[8] (signed byte) main::y#4 ← phi( main::@5/(signed byte) -$c main::@3/(signed byte) main::y#1 )
to:main::@2
main::@2: scope:[main] from main::@1 main::@6
[11] (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#4 main::@6/(byte*) main::screen#1 )
[11] (signed byte) main::x#2 ← phi( main::@1/(signed byte) -$13 main::@6/(signed byte) main::x#1 )
[12] (word) main::xw#0 ← (byte)(signed byte) main::x#2 w= (byte) 0
[13] (word) main::yw#0 ← (byte)(signed byte) main::y#4 w= (byte) 0
[14] (signed word) atan2_16::x#0 ← (signed word)(word) main::xw#0
[15] (signed word) atan2_16::y#0 ← (signed word)(word) main::yw#0
[16] call atan2_16
[17] (word) atan2_16::return#2 ← (word) atan2_16::return#0
[9] (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#4 main::@6/(byte*) main::screen#1 )
[9] (signed byte) main::x#2 ← phi( main::@1/(signed byte) -$13 main::@6/(signed byte) main::x#1 )
[10] (word) main::xw#0 ← (byte)(signed byte) main::x#2 w= (byte) 0
[11] (word) main::yw#0 ← (byte)(signed byte) main::y#4 w= (byte) 0
[12] (signed word) atan2_16::x#0 ← (signed word)(word) main::xw#0
[13] (signed word) atan2_16::y#0 ← (signed word)(word) main::yw#0
[14] call atan2_16
[15] (word) atan2_16::return#2 ← (word) atan2_16::return#0
to:main::@6
main::@6: scope:[main] from main::@2
[18] (word) main::angle_w#0 ← (word) atan2_16::return#2
[19] (word~) main::$11 ← (word) main::angle_w#0 + (byte) $80
[20] (byte) main::ang_w#0 ← > (word~) main::$11
[21] *((byte*) main::screen#2) ← (byte) main::ang_w#0
[22] (byte*) main::screen#1 ← ++ (byte*) main::screen#2
[23] (signed byte) main::x#1 ← ++ (signed byte) main::x#2
[24] if((signed byte) main::x#1!=(signed byte) $15) goto main::@2
[16] (word) main::angle_w#0 ← (word) atan2_16::return#2
[17] (word~) main::$11 ← (word) main::angle_w#0 + (byte) $80
[18] (byte) main::ang_w#0 ← > (word~) main::$11
[19] *((byte*) main::screen#2) ← (byte) main::ang_w#0
[20] (byte*) main::screen#1 ← ++ (byte*) main::screen#2
[21] (signed byte) main::x#1 ← ++ (signed byte) main::x#2
[22] if((signed byte) main::x#1!=(signed byte) $15) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@6
[25] (signed byte) main::y#1 ← ++ (signed byte) main::y#4
[26] if((signed byte) main::y#1!=(signed byte) $d) goto main::@1
[23] (signed byte) main::y#1 ← ++ (signed byte) main::y#4
[24] if((signed byte) main::y#1!=(signed byte) $d) goto main::@1
to:main::@4
main::@4: scope:[main] from main::@3 main::@4
[27] *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13) ← ++ *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13)
[25] *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13) ← ++ *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13)
to:main::@4
atan2_16: scope:[atan2_16] from main::@2
[28] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1
[26] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1
to:atan2_16::@2
atan2_16::@2: scope:[atan2_16] from atan2_16
[29] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0
[27] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0
to:atan2_16::@3
atan2_16::@3: scope:[atan2_16] from atan2_16::@1 atan2_16::@2
[30] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 )
[31] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4
[28] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 )
[29] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4
to:atan2_16::@5
atan2_16::@5: scope:[atan2_16] from atan2_16::@3
[32] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
[30] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@6: scope:[atan2_16] from atan2_16::@4 atan2_16::@5
[33] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#8 atan2_16::@5/(signed word~) atan2_16::$7 )
[31] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#8 atan2_16::@5/(signed word~) atan2_16::$7 )
to:atan2_16::@10
atan2_16::@10: scope:[atan2_16] from atan2_16::@14 atan2_16::@6
[34] (word) atan2_16::angle#12 ← phi( atan2_16::@14/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[34] (byte) atan2_16::i#2 ← phi( atan2_16::@14/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[34] (signed word) atan2_16::xi#3 ← phi( atan2_16::@14/(signed word) atan2_16::xi#7 atan2_16::@6/(signed word) atan2_16::xi#0 )
[34] (signed word) atan2_16::yi#3 ← phi( atan2_16::@14/(signed word) atan2_16::yi#7 atan2_16::@6/(signed word) atan2_16::yi#0 )
[35] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
[32] (word) atan2_16::angle#12 ← phi( atan2_16::@14/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[32] (byte) atan2_16::i#2 ← phi( atan2_16::@14/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[32] (signed word) atan2_16::xi#3 ← phi( atan2_16::@14/(signed word) atan2_16::xi#7 atan2_16::@6/(signed word) atan2_16::xi#0 )
[32] (signed word) atan2_16::yi#3 ← phi( atan2_16::@14/(signed word) atan2_16::yi#7 atan2_16::@6/(signed word) atan2_16::yi#0 )
[33] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
to:atan2_16::@12
atan2_16::@12: scope:[atan2_16] from atan2_16::@10 atan2_16::@14
[36] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@14/(word) atan2_16::angle#13 )
[37] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[38] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
[34] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@14/(word) atan2_16::angle#13 )
[35] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[36] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
to:atan2_16::@16
atan2_16::@16: scope:[atan2_16] from atan2_16::@12
[39] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
[37] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
to:atan2_16::@7
atan2_16::@7: scope:[atan2_16] from atan2_16::@12 atan2_16::@16
[40] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@16/(word) atan2_16::angle#4 )
[41] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
[38] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@16/(word) atan2_16::angle#4 )
[39] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
to:atan2_16::@9
atan2_16::@9: scope:[atan2_16] from atan2_16::@7
[42] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
[40] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
to:atan2_16::@8
atan2_16::@8: scope:[atan2_16] from atan2_16::@7 atan2_16::@9
[43] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
[41] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
to:atan2_16::@return
atan2_16::@return: scope:[atan2_16] from atan2_16::@8
[44] return
[42] return
to:@return
atan2_16::@11: scope:[atan2_16] from atan2_16::@10
[45] (signed word) atan2_16::xd#0 ← (signed word) atan2_16::xi#3 >> (byte) atan2_16::i#2
[46] (signed word) atan2_16::yd#0 ← (signed word) atan2_16::yi#3 >> (byte) atan2_16::i#2
[47] if((signed word) atan2_16::yi#3>(signed byte) 0) goto atan2_16::@13
[43] (signed word) atan2_16::xd#0 ← (signed word) atan2_16::xi#3 >> (byte) atan2_16::i#2
[44] (signed word) atan2_16::yd#0 ← (signed word) atan2_16::yi#3 >> (byte) atan2_16::i#2
[45] if((signed word) atan2_16::yi#3>(signed byte) 0) goto atan2_16::@13
to:atan2_16::@15
atan2_16::@15: scope:[atan2_16] from atan2_16::@11
[48] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#0
[49] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#0
[50] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
[51] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
[46] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#0
[47] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#0
[48] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
[49] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
to:atan2_16::@14
atan2_16::@14: scope:[atan2_16] from atan2_16::@13 atan2_16::@15
[52] (signed word) atan2_16::xi#7 ← phi( atan2_16::@13/(signed word) atan2_16::xi#1 atan2_16::@15/(signed word) atan2_16::xi#2 )
[52] (word) atan2_16::angle#13 ← phi( atan2_16::@13/(word) atan2_16::angle#2 atan2_16::@15/(word) atan2_16::angle#3 )
[52] (signed word) atan2_16::yi#7 ← phi( atan2_16::@13/(signed word) atan2_16::yi#1 atan2_16::@15/(signed word) atan2_16::yi#2 )
[53] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[54] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12
[50] (signed word) atan2_16::xi#7 ← phi( atan2_16::@13/(signed word) atan2_16::xi#1 atan2_16::@15/(signed word) atan2_16::xi#2 )
[50] (word) atan2_16::angle#13 ← phi( atan2_16::@13/(word) atan2_16::angle#2 atan2_16::@15/(word) atan2_16::angle#3 )
[50] (signed word) atan2_16::yi#7 ← phi( atan2_16::@13/(signed word) atan2_16::yi#1 atan2_16::@15/(signed word) atan2_16::yi#2 )
[51] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[52] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12
to:atan2_16::@10
atan2_16::@13: scope:[atan2_16] from atan2_16::@11
[55] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#0
[56] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#0
[57] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[58] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
[53] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#0
[54] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#0
[55] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[56] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
to:atan2_16::@14
atan2_16::@4: scope:[atan2_16] from atan2_16::@3
[59] (signed word~) atan2_16::xi#8 ← (signed word) atan2_16::x#0
[57] (signed word~) atan2_16::xi#8 ← (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@1: scope:[atan2_16] from atan2_16
[60] (signed word~) atan2_16::yi#11 ← (signed word) atan2_16::y#0
[58] (signed word~) atan2_16::yi#11 ← (signed word) atan2_16::y#0
to:atan2_16::@3
init_font_hex: scope:[init_font_hex] from main
[61] phi()
[59] phi()
to:init_font_hex::@1
init_font_hex::@1: scope:[init_font_hex] from init_font_hex init_font_hex::@5
[62] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[62] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[62] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
[60] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[60] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[60] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
to:init_font_hex::@2
init_font_hex::@2: scope:[init_font_hex] from init_font_hex::@1 init_font_hex::@4
[63] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[63] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[63] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[64] *((byte*) init_font_hex::charset#2) ← (byte) 0
[61] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[61] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[61] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[62] *((byte*) init_font_hex::charset#2) ← (byte) 0
to:init_font_hex::@3
init_font_hex::@3: scope:[init_font_hex] from init_font_hex::@2 init_font_hex::@3
[65] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[65] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[66] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[67] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[68] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[69] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[70] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[71] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[72] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
[63] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[63] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[64] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[65] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[66] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[67] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[68] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[69] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[70] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
to:init_font_hex::@4
init_font_hex::@4: scope:[init_font_hex] from init_font_hex::@3
[73] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[74] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[75] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[76] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[77] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[78] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[79] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
[71] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[72] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[73] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[74] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[75] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[76] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[77] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
to:init_font_hex::@5
init_font_hex::@5: scope:[init_font_hex] from init_font_hex::@4
[80] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[81] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[82] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
[78] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[79] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[80] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
to:init_font_hex::@return
init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5
[83] return
[81] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +1,16 @@
(label) @1
(label) @2
(label) @3
(label) @begin
(label) @end
(byte*) CHARSET
(const byte*) CHARSET#0 CHARSET = (byte*) 8192
(byte*) COLS
(const byte*) COLS#0 COLS = (byte*) 55296
(word*) CORDIC_ATAN2_ANGLES_16
(const word*) CORDIC_ATAN2_ANGLES_16#0 CORDIC_ATAN2_ANGLES_16 = (word*) 4096
(byte*) CORDIC_ATAN2_ANGLES_8
(const byte*) CORDIC_ATAN2_ANGLES_8#0 CORDIC_ATAN2_ANGLES_8 = (byte*) 4352
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16
(const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 CORDIC_ATAN2_ANGLES_16 = kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
(byte) CORDIC_ITERATIONS_16
(const byte) CORDIC_ITERATIONS_16#0 CORDIC_ITERATIONS_16 = (byte) $f
(byte) CORDIC_ITERATIONS_8
(const byte) CORDIC_ITERATIONS_8#0 CORDIC_ITERATIONS_8 = (byte) 8
(byte*) D018
(const byte*) D018#0 D018 = (byte*) 53272
(byte[]) FONT_HEX_PROTO

View File

@ -5,18 +5,10 @@
.pc = $80d "Program"
// The number of iterations performed during 16-bit CORDIC atan2 calculation
.const CORDIC_ITERATIONS_16 = $f
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
.label CORDIC_ATAN2_ANGLES_16 = $1000
// The number of iterations performed during 8-bit CORDIC atan2 calculation
.const CORDIC_ITERATIONS_8 = 8
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
.label CORDIC_ATAN2_ANGLES_8 = $1100
.label RASTER = $d012
.label D018 = $d018
.label CHARSET = $2000
.label SCREEN = $2800
// Populate cordic angles table
// Populate cordic angles table
main: {
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
.label clear_char = 2
@ -383,10 +375,8 @@ init_font_hex: {
}
// Bit patterns for symbols 0-f (3x5 pixels) used in font hex
FONT_HEX_PROTO: .byte 2, 5, 5, 5, 2, 6, 2, 2, 2, 7, 6, 1, 2, 4, 7, 6, 1, 2, 1, 6, 5, 5, 7, 1, 1, 7, 4, 6, 1, 6, 3, 4, 6, 5, 2, 7, 1, 1, 1, 1, 2, 5, 2, 5, 2, 2, 5, 3, 1, 1, 2, 5, 7, 5, 5, 6, 5, 6, 5, 6, 2, 5, 4, 5, 2, 6, 5, 5, 5, 6, 7, 4, 6, 4, 7, 7, 4, 6, 4, 4
.pc = CORDIC_ATAN2_ANGLES_16 "CORDIC_ATAN2_ANGLES_16"
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
CORDIC_ATAN2_ANGLES_16:
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
.pc = CORDIC_ATAN2_ANGLES_8 "CORDIC_ATAN2_ANGLES_8"
.fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2

View File

@ -2,190 +2,181 @@
[0] phi()
to:@1
@1: scope:[] from @begin
kickasm(location (const word*) CORDIC_ATAN2_ANGLES_16#0 uses CORDIC_ITERATIONS_16#0) {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
to:@2
@2: scope:[] from @1
kickasm(location (const byte*) CORDIC_ATAN2_ANGLES_8#0 uses CORDIC_ITERATIONS_8#0) {{ .fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2
}}
to:@3
@3: scope:[] from @2
[3] phi()
[4] call main
[1] phi()
[2] call main
to:@end
@end: scope:[] from @3
[5] phi()
main: scope:[main] from @3
[6] phi()
[7] call init_font_hex
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
[5] call init_font_hex
to:main::toD0181
main::toD0181: scope:[main] from main
[8] phi()
[6] phi()
to:main::@5
main::@5: scope:[main] from main::toD0181
[9] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
[10] call init_screen
[7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
[8] call init_screen
to:main::@1
main::@1: scope:[main] from main::@3 main::@4 main::@5
[11] (byte*) main::clear_char#5 ← phi( main::@5/(const byte*) CHARSET#0 main::@4/(byte*) main::clear_char#1 )
[9] (byte*) main::clear_char#5 ← phi( main::@5/(const byte*) CHARSET#0 main::@4/(byte*) main::clear_char#1 )
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[12] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2
[10] if(*((const byte*) RASTER#0)!=(byte) $ff) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
[13] if((byte*) main::clear_char#5>=(const byte*) CHARSET#0+(word) $800) goto main::@1
[11] if((byte*) main::clear_char#5>=(const byte*) CHARSET#0+(word) $800) goto main::@1
to:main::@4
main::@4: scope:[main] from main::@3
[14] *((byte*) main::clear_char#5) ← (byte) 0
[15] (byte*) main::clear_char#1 ← ++ (byte*) main::clear_char#5
[12] *((byte*) main::clear_char#5) ← (byte) 0
[13] (byte*) main::clear_char#1 ← ++ (byte*) main::clear_char#5
to:main::@1
init_screen: scope:[init_screen] from main::@5
[16] phi()
[14] phi()
to:init_screen::@1
init_screen::@1: scope:[init_screen] from init_screen init_screen::@3
[17] (byte*) init_screen::screen#4 ← phi( init_screen/(const byte*) SCREEN#0 init_screen::@3/(byte*) init_screen::screen#1 )
[17] (signed byte) init_screen::y#4 ← phi( init_screen/(signed byte) -$c init_screen::@3/(signed byte) init_screen::y#1 )
[15] (byte*) init_screen::screen#4 ← phi( init_screen/(const byte*) SCREEN#0 init_screen::@3/(byte*) init_screen::screen#1 )
[15] (signed byte) init_screen::y#4 ← phi( init_screen/(signed byte) -$c init_screen::@3/(signed byte) init_screen::y#1 )
to:init_screen::@2
init_screen::@2: scope:[init_screen] from init_screen::@1 init_screen::@4
[18] (byte*) init_screen::screen#2 ← phi( init_screen::@1/(byte*) init_screen::screen#4 init_screen::@4/(byte*) init_screen::screen#1 )
[18] (signed byte) init_screen::x#2 ← phi( init_screen::@1/(signed byte) -$13 init_screen::@4/(signed byte) init_screen::x#1 )
[19] (word) init_screen::xw#0 ← (byte)(signed byte) init_screen::x#2 w= (byte) 0
[20] (word) init_screen::yw#0 ← (byte)(signed byte) init_screen::y#4 w= (byte) 0
[21] (signed word) atan2_16::x#0 ← (signed word)(word) init_screen::xw#0
[22] (signed word) atan2_16::y#0 ← (signed word)(word) init_screen::yw#0
[23] call atan2_16
[24] (word) atan2_16::return#2 ← (word) atan2_16::return#0
[16] (byte*) init_screen::screen#2 ← phi( init_screen::@1/(byte*) init_screen::screen#4 init_screen::@4/(byte*) init_screen::screen#1 )
[16] (signed byte) init_screen::x#2 ← phi( init_screen::@1/(signed byte) -$13 init_screen::@4/(signed byte) init_screen::x#1 )
[17] (word) init_screen::xw#0 ← (byte)(signed byte) init_screen::x#2 w= (byte) 0
[18] (word) init_screen::yw#0 ← (byte)(signed byte) init_screen::y#4 w= (byte) 0
[19] (signed word) atan2_16::x#0 ← (signed word)(word) init_screen::xw#0
[20] (signed word) atan2_16::y#0 ← (signed word)(word) init_screen::yw#0
[21] call atan2_16
[22] (word) atan2_16::return#2 ← (word) atan2_16::return#0
to:init_screen::@4
init_screen::@4: scope:[init_screen] from init_screen::@2
[25] (word) init_screen::angle_w#0 ← (word) atan2_16::return#2
[26] (word~) init_screen::$7 ← (word) init_screen::angle_w#0 + (byte) $80
[27] (byte) init_screen::ang_w#0 ← > (word~) init_screen::$7
[28] *((byte*) init_screen::screen#2) ← (byte) init_screen::ang_w#0
[29] (byte*) init_screen::screen#1 ← ++ (byte*) init_screen::screen#2
[30] (signed byte) init_screen::x#1 ← ++ (signed byte) init_screen::x#2
[31] if((signed byte) init_screen::x#1!=(signed byte) $15) goto init_screen::@2
[23] (word) init_screen::angle_w#0 ← (word) atan2_16::return#2
[24] (word~) init_screen::$7 ← (word) init_screen::angle_w#0 + (byte) $80
[25] (byte) init_screen::ang_w#0 ← > (word~) init_screen::$7
[26] *((byte*) init_screen::screen#2) ← (byte) init_screen::ang_w#0
[27] (byte*) init_screen::screen#1 ← ++ (byte*) init_screen::screen#2
[28] (signed byte) init_screen::x#1 ← ++ (signed byte) init_screen::x#2
[29] if((signed byte) init_screen::x#1!=(signed byte) $15) goto init_screen::@2
to:init_screen::@3
init_screen::@3: scope:[init_screen] from init_screen::@4
[32] (signed byte) init_screen::y#1 ← ++ (signed byte) init_screen::y#4
[33] if((signed byte) init_screen::y#1!=(signed byte) $d) goto init_screen::@1
[30] (signed byte) init_screen::y#1 ← ++ (signed byte) init_screen::y#4
[31] if((signed byte) init_screen::y#1!=(signed byte) $d) goto init_screen::@1
to:init_screen::@return
init_screen::@return: scope:[init_screen] from init_screen::@3
[34] return
[32] return
to:@return
atan2_16: scope:[atan2_16] from init_screen::@2
[35] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1
[33] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1
to:atan2_16::@2
atan2_16::@2: scope:[atan2_16] from atan2_16
[36] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0
[34] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0
to:atan2_16::@3
atan2_16::@3: scope:[atan2_16] from atan2_16::@1 atan2_16::@2
[37] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 )
[38] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4
[35] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 )
[36] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4
to:atan2_16::@5
atan2_16::@5: scope:[atan2_16] from atan2_16::@3
[39] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
[37] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@6: scope:[atan2_16] from atan2_16::@4 atan2_16::@5
[40] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#8 atan2_16::@5/(signed word~) atan2_16::$7 )
[38] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#8 atan2_16::@5/(signed word~) atan2_16::$7 )
to:atan2_16::@10
atan2_16::@10: scope:[atan2_16] from atan2_16::@14 atan2_16::@6
[41] (word) atan2_16::angle#12 ← phi( atan2_16::@14/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[41] (byte) atan2_16::i#2 ← phi( atan2_16::@14/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[41] (signed word) atan2_16::xi#3 ← phi( atan2_16::@14/(signed word) atan2_16::xi#7 atan2_16::@6/(signed word) atan2_16::xi#0 )
[41] (signed word) atan2_16::yi#3 ← phi( atan2_16::@14/(signed word) atan2_16::yi#7 atan2_16::@6/(signed word) atan2_16::yi#0 )
[42] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
[39] (word) atan2_16::angle#12 ← phi( atan2_16::@14/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[39] (byte) atan2_16::i#2 ← phi( atan2_16::@14/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[39] (signed word) atan2_16::xi#3 ← phi( atan2_16::@14/(signed word) atan2_16::xi#7 atan2_16::@6/(signed word) atan2_16::xi#0 )
[39] (signed word) atan2_16::yi#3 ← phi( atan2_16::@14/(signed word) atan2_16::yi#7 atan2_16::@6/(signed word) atan2_16::yi#0 )
[40] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
to:atan2_16::@12
atan2_16::@12: scope:[atan2_16] from atan2_16::@10 atan2_16::@14
[43] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@14/(word) atan2_16::angle#13 )
[44] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[45] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
[41] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@14/(word) atan2_16::angle#13 )
[42] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[43] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
to:atan2_16::@16
atan2_16::@16: scope:[atan2_16] from atan2_16::@12
[46] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
[44] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
to:atan2_16::@7
atan2_16::@7: scope:[atan2_16] from atan2_16::@12 atan2_16::@16
[47] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@16/(word) atan2_16::angle#4 )
[48] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
[45] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@16/(word) atan2_16::angle#4 )
[46] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
to:atan2_16::@9
atan2_16::@9: scope:[atan2_16] from atan2_16::@7
[49] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
[47] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
to:atan2_16::@8
atan2_16::@8: scope:[atan2_16] from atan2_16::@7 atan2_16::@9
[50] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
[48] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
to:atan2_16::@return
atan2_16::@return: scope:[atan2_16] from atan2_16::@8
[51] return
[49] return
to:@return
atan2_16::@11: scope:[atan2_16] from atan2_16::@10
[52] (signed word) atan2_16::xd#0 ← (signed word) atan2_16::xi#3 >> (byte) atan2_16::i#2
[53] (signed word) atan2_16::yd#0 ← (signed word) atan2_16::yi#3 >> (byte) atan2_16::i#2
[54] if((signed word) atan2_16::yi#3>(signed byte) 0) goto atan2_16::@13
[50] (signed word) atan2_16::xd#0 ← (signed word) atan2_16::xi#3 >> (byte) atan2_16::i#2
[51] (signed word) atan2_16::yd#0 ← (signed word) atan2_16::yi#3 >> (byte) atan2_16::i#2
[52] if((signed word) atan2_16::yi#3>(signed byte) 0) goto atan2_16::@13
to:atan2_16::@15
atan2_16::@15: scope:[atan2_16] from atan2_16::@11
[55] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#0
[56] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#0
[57] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
[58] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
[53] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#0
[54] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#0
[55] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
[56] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
to:atan2_16::@14
atan2_16::@14: scope:[atan2_16] from atan2_16::@13 atan2_16::@15
[59] (signed word) atan2_16::xi#7 ← phi( atan2_16::@13/(signed word) atan2_16::xi#1 atan2_16::@15/(signed word) atan2_16::xi#2 )
[59] (word) atan2_16::angle#13 ← phi( atan2_16::@13/(word) atan2_16::angle#2 atan2_16::@15/(word) atan2_16::angle#3 )
[59] (signed word) atan2_16::yi#7 ← phi( atan2_16::@13/(signed word) atan2_16::yi#1 atan2_16::@15/(signed word) atan2_16::yi#2 )
[60] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[61] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12
[57] (signed word) atan2_16::xi#7 ← phi( atan2_16::@13/(signed word) atan2_16::xi#1 atan2_16::@15/(signed word) atan2_16::xi#2 )
[57] (word) atan2_16::angle#13 ← phi( atan2_16::@13/(word) atan2_16::angle#2 atan2_16::@15/(word) atan2_16::angle#3 )
[57] (signed word) atan2_16::yi#7 ← phi( atan2_16::@13/(signed word) atan2_16::yi#1 atan2_16::@15/(signed word) atan2_16::yi#2 )
[58] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[59] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12
to:atan2_16::@10
atan2_16::@13: scope:[atan2_16] from atan2_16::@11
[62] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#0
[63] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#0
[64] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[65] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
[60] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#0
[61] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#0
[62] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[63] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
to:atan2_16::@14
atan2_16::@4: scope:[atan2_16] from atan2_16::@3
[66] (signed word~) atan2_16::xi#8 ← (signed word) atan2_16::x#0
[64] (signed word~) atan2_16::xi#8 ← (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@1: scope:[atan2_16] from atan2_16
[67] (signed word~) atan2_16::yi#11 ← (signed word) atan2_16::y#0
[65] (signed word~) atan2_16::yi#11 ← (signed word) atan2_16::y#0
to:atan2_16::@3
init_font_hex: scope:[init_font_hex] from main
[68] phi()
[66] phi()
to:init_font_hex::@1
init_font_hex::@1: scope:[init_font_hex] from init_font_hex init_font_hex::@5
[69] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[69] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[69] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
[67] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[67] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[67] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
to:init_font_hex::@2
init_font_hex::@2: scope:[init_font_hex] from init_font_hex::@1 init_font_hex::@4
[70] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[70] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[70] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[71] *((byte*) init_font_hex::charset#2) ← (byte) 0
[68] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[68] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[68] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[69] *((byte*) init_font_hex::charset#2) ← (byte) 0
to:init_font_hex::@3
init_font_hex::@3: scope:[init_font_hex] from init_font_hex::@2 init_font_hex::@3
[72] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[72] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[73] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[74] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[75] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[76] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[77] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[78] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[79] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
[70] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[70] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[71] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[72] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[73] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[74] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[75] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[76] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[77] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
to:init_font_hex::@4
init_font_hex::@4: scope:[init_font_hex] from init_font_hex::@3
[80] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[81] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[82] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[83] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[84] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[85] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[86] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
[78] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[79] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[80] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[81] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[82] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[83] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[84] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
to:init_font_hex::@5
init_font_hex::@5: scope:[init_font_hex] from init_font_hex::@4
[87] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[88] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[89] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
[85] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[86] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[87] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
to:init_font_hex::@return
init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5
[90] return
[88] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,14 @@
(label) @1
(label) @2
(label) @3
(label) @begin
(label) @end
(byte*) CHARSET
(const byte*) CHARSET#0 CHARSET = (byte*) 8192
(word*) CORDIC_ATAN2_ANGLES_16
(const word*) CORDIC_ATAN2_ANGLES_16#0 CORDIC_ATAN2_ANGLES_16 = (word*) 4096
(byte*) CORDIC_ATAN2_ANGLES_8
(const byte*) CORDIC_ATAN2_ANGLES_8#0 CORDIC_ATAN2_ANGLES_8 = (byte*) 4352
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16
(const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 CORDIC_ATAN2_ANGLES_16 = kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
(byte) CORDIC_ITERATIONS_16
(const byte) CORDIC_ITERATIONS_16#0 CORDIC_ITERATIONS_16 = (byte) $f
(byte) CORDIC_ITERATIONS_8
(const byte) CORDIC_ITERATIONS_8#0 CORDIC_ITERATIONS_8 = (byte) 8
(byte*) D018
(const byte*) D018#0 D018 = (byte*) 53272
(byte[]) FONT_HEX_PROTO

View File

@ -6,18 +6,10 @@
.label D018 = $d018
// Color Ram
.label COLS = $d800
// The number of iterations performed during 16-bit CORDIC atan2 calculation
.const CORDIC_ITERATIONS_16 = $f
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
.label CORDIC_ATAN2_ANGLES_16 = $1000
// The number of iterations performed during 8-bit CORDIC atan2 calculation
.const CORDIC_ITERATIONS_8 = 8
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
.label CORDIC_ATAN2_ANGLES_8 = $1100
.label CHARSET = $2000
.label SCREEN = $2800
// Populate cordic angles table
// Populate cordic angles table
main: {
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
.label screen = 4
@ -289,10 +281,7 @@ init_font_hex: {
}
// Bit patterns for symbols 0-f (3x5 pixels) used in font hex
FONT_HEX_PROTO: .byte 2, 5, 5, 5, 2, 6, 2, 2, 2, 7, 6, 1, 2, 4, 7, 6, 1, 2, 1, 6, 5, 5, 7, 1, 1, 7, 4, 6, 1, 6, 3, 4, 6, 5, 2, 7, 1, 1, 1, 1, 2, 5, 2, 5, 2, 2, 5, 3, 1, 1, 2, 5, 7, 5, 5, 6, 5, 6, 5, 6, 2, 5, 4, 5, 2, 6, 5, 5, 5, 6, 7, 4, 6, 4, 7, 7, 4, 6, 4, 4
.pc = CORDIC_ATAN2_ANGLES_16 "CORDIC_ATAN2_ANGLES_16"
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
.pc = CORDIC_ATAN2_ANGLES_8 "CORDIC_ATAN2_ANGLES_8"
.fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
CORDIC_ATAN2_ANGLES_8:
.fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2

View File

@ -2,167 +2,158 @@
[0] phi()
to:@1
@1: scope:[] from @begin
kickasm(location (const word*) CORDIC_ATAN2_ANGLES_16#0 uses CORDIC_ITERATIONS_16#0) {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
to:@2
@2: scope:[] from @1
kickasm(location (const byte*) CORDIC_ATAN2_ANGLES_8#0 uses CORDIC_ITERATIONS_8#0) {{ .fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2
}}
to:@3
@3: scope:[] from @2
[3] phi()
[4] call main
[1] phi()
[2] call main
to:@end
@end: scope:[] from @3
[5] phi()
main: scope:[main] from @3
[6] phi()
[7] call init_font_hex
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
[5] call init_font_hex
to:main::toD0181
main::toD0181: scope:[main] from main
[8] phi()
[6] phi()
to:main::@5
main::@5: scope:[main] from main::toD0181
[9] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
[7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
to:main::@1
main::@1: scope:[main] from main::@3 main::@5
[10] (byte*) main::screen#4 ← phi( main::@5/(const byte*) SCREEN#0 main::@3/(byte*) main::screen#1 )
[10] (signed byte) main::y#4 ← phi( main::@5/(signed byte) -$c main::@3/(signed byte) main::y#1 )
[8] (byte*) main::screen#4 ← phi( main::@5/(const byte*) SCREEN#0 main::@3/(byte*) main::screen#1 )
[8] (signed byte) main::y#4 ← phi( main::@5/(signed byte) -$c main::@3/(signed byte) main::y#1 )
to:main::@2
main::@2: scope:[main] from main::@1 main::@6
[11] (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#4 main::@6/(byte*) main::screen#1 )
[11] (signed byte) main::x#2 ← phi( main::@1/(signed byte) -$13 main::@6/(signed byte) main::x#1 )
[12] (signed byte) atan2_8::x#0 ← (signed byte) main::x#2
[13] (signed byte) atan2_8::y#0 ← (signed byte) main::y#4
[14] call atan2_8
[15] (byte) atan2_8::return#2 ← (byte) atan2_8::return#0
[9] (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#4 main::@6/(byte*) main::screen#1 )
[9] (signed byte) main::x#2 ← phi( main::@1/(signed byte) -$13 main::@6/(signed byte) main::x#1 )
[10] (signed byte) atan2_8::x#0 ← (signed byte) main::x#2
[11] (signed byte) atan2_8::y#0 ← (signed byte) main::y#4
[12] call atan2_8
[13] (byte) atan2_8::return#2 ← (byte) atan2_8::return#0
to:main::@6
main::@6: scope:[main] from main::@2
[16] (byte) main::angle#0 ← (byte) atan2_8::return#2
[17] *((byte*) main::screen#2) ← (byte) main::angle#0
[18] (byte*) main::screen#1 ← ++ (byte*) main::screen#2
[19] (signed byte) main::x#1 ← ++ (signed byte) main::x#2
[20] if((signed byte) main::x#1!=(signed byte) $15) goto main::@2
[14] (byte) main::angle#0 ← (byte) atan2_8::return#2
[15] *((byte*) main::screen#2) ← (byte) main::angle#0
[16] (byte*) main::screen#1 ← ++ (byte*) main::screen#2
[17] (signed byte) main::x#1 ← ++ (signed byte) main::x#2
[18] if((signed byte) main::x#1!=(signed byte) $15) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@6
[21] (signed byte) main::y#1 ← ++ (signed byte) main::y#4
[22] if((signed byte) main::y#1!=(signed byte) $d) goto main::@1
[19] (signed byte) main::y#1 ← ++ (signed byte) main::y#4
[20] if((signed byte) main::y#1!=(signed byte) $d) goto main::@1
to:main::@4
main::@4: scope:[main] from main::@3 main::@4
[23] *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13) ← ++ *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13)
[21] *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13) ← ++ *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13)
to:main::@4
atan2_8: scope:[atan2_8] from main::@2
[24] if((signed byte) atan2_8::y#0>(signed byte) 0) goto atan2_8::@1
[22] if((signed byte) atan2_8::y#0>(signed byte) 0) goto atan2_8::@1
to:atan2_8::@2
atan2_8::@2: scope:[atan2_8] from atan2_8
[25] (signed byte~) atan2_8::$2 ← - (signed byte) atan2_8::y#0
[23] (signed byte~) atan2_8::$2 ← - (signed byte) atan2_8::y#0
to:atan2_8::@3
atan2_8::@3: scope:[atan2_8] from atan2_8::@1 atan2_8::@2
[26] (signed byte) atan2_8::yi#0 ← phi( atan2_8::@1/(signed byte~) atan2_8::yi#11 atan2_8::@2/(signed byte~) atan2_8::$2 )
[27] if((signed byte) atan2_8::x#0>(signed byte) 0) goto atan2_8::@4
[24] (signed byte) atan2_8::yi#0 ← phi( atan2_8::@1/(signed byte~) atan2_8::yi#11 atan2_8::@2/(signed byte~) atan2_8::$2 )
[25] if((signed byte) atan2_8::x#0>(signed byte) 0) goto atan2_8::@4
to:atan2_8::@5
atan2_8::@5: scope:[atan2_8] from atan2_8::@3
[28] (signed byte~) atan2_8::$7 ← - (signed byte) atan2_8::x#0
[26] (signed byte~) atan2_8::$7 ← - (signed byte) atan2_8::x#0
to:atan2_8::@6
atan2_8::@6: scope:[atan2_8] from atan2_8::@4 atan2_8::@5
[29] (signed byte) atan2_8::xi#0 ← phi( atan2_8::@4/(signed byte~) atan2_8::xi#8 atan2_8::@5/(signed byte~) atan2_8::$7 )
[27] (signed byte) atan2_8::xi#0 ← phi( atan2_8::@4/(signed byte~) atan2_8::xi#8 atan2_8::@5/(signed byte~) atan2_8::$7 )
to:atan2_8::@10
atan2_8::@10: scope:[atan2_8] from atan2_8::@14 atan2_8::@6
[30] (byte) atan2_8::angle#12 ← phi( atan2_8::@14/(byte) atan2_8::angle#13 atan2_8::@6/(byte) 0 )
[30] (byte) atan2_8::i#2 ← phi( atan2_8::@14/(byte) atan2_8::i#1 atan2_8::@6/(byte) 0 )
[30] (signed byte) atan2_8::xi#3 ← phi( atan2_8::@14/(signed byte) atan2_8::xi#7 atan2_8::@6/(signed byte) atan2_8::xi#0 )
[30] (signed byte) atan2_8::yi#3 ← phi( atan2_8::@14/(signed byte) atan2_8::yi#7 atan2_8::@6/(signed byte) atan2_8::yi#0 )
[31] if((signed byte) atan2_8::yi#3!=(signed byte) 0) goto atan2_8::@11
[28] (byte) atan2_8::angle#12 ← phi( atan2_8::@14/(byte) atan2_8::angle#13 atan2_8::@6/(byte) 0 )
[28] (byte) atan2_8::i#2 ← phi( atan2_8::@14/(byte) atan2_8::i#1 atan2_8::@6/(byte) 0 )
[28] (signed byte) atan2_8::xi#3 ← phi( atan2_8::@14/(signed byte) atan2_8::xi#7 atan2_8::@6/(signed byte) atan2_8::xi#0 )
[28] (signed byte) atan2_8::yi#3 ← phi( atan2_8::@14/(signed byte) atan2_8::yi#7 atan2_8::@6/(signed byte) atan2_8::yi#0 )
[29] if((signed byte) atan2_8::yi#3!=(signed byte) 0) goto atan2_8::@11
to:atan2_8::@12
atan2_8::@12: scope:[atan2_8] from atan2_8::@10 atan2_8::@14
[32] (byte) atan2_8::angle#6 ← phi( atan2_8::@10/(byte) atan2_8::angle#12 atan2_8::@14/(byte) atan2_8::angle#13 )
[33] (byte) atan2_8::angle#1 ← (byte) atan2_8::angle#6 >> (byte) 1
[34] if((signed byte) atan2_8::x#0>=(signed byte) 0) goto atan2_8::@7
[30] (byte) atan2_8::angle#6 ← phi( atan2_8::@10/(byte) atan2_8::angle#12 atan2_8::@14/(byte) atan2_8::angle#13 )
[31] (byte) atan2_8::angle#1 ← (byte) atan2_8::angle#6 >> (byte) 1
[32] if((signed byte) atan2_8::x#0>=(signed byte) 0) goto atan2_8::@7
to:atan2_8::@16
atan2_8::@16: scope:[atan2_8] from atan2_8::@12
[35] (byte) atan2_8::angle#4 ← (byte) $80 - (byte) atan2_8::angle#1
[33] (byte) atan2_8::angle#4 ← (byte) $80 - (byte) atan2_8::angle#1
to:atan2_8::@7
atan2_8::@7: scope:[atan2_8] from atan2_8::@12 atan2_8::@16
[36] (byte) atan2_8::angle#11 ← phi( atan2_8::@12/(byte) atan2_8::angle#1 atan2_8::@16/(byte) atan2_8::angle#4 )
[37] if((signed byte) atan2_8::y#0>=(signed byte) 0) goto atan2_8::@8
[34] (byte) atan2_8::angle#11 ← phi( atan2_8::@12/(byte) atan2_8::angle#1 atan2_8::@16/(byte) atan2_8::angle#4 )
[35] if((signed byte) atan2_8::y#0>=(signed byte) 0) goto atan2_8::@8
to:atan2_8::@9
atan2_8::@9: scope:[atan2_8] from atan2_8::@7
[38] (byte) atan2_8::angle#5 ← - (byte) atan2_8::angle#11
[36] (byte) atan2_8::angle#5 ← - (byte) atan2_8::angle#11
to:atan2_8::@8
atan2_8::@8: scope:[atan2_8] from atan2_8::@7 atan2_8::@9
[39] (byte) atan2_8::return#0 ← phi( atan2_8::@9/(byte) atan2_8::angle#5 atan2_8::@7/(byte) atan2_8::angle#11 )
[37] (byte) atan2_8::return#0 ← phi( atan2_8::@9/(byte) atan2_8::angle#5 atan2_8::@7/(byte) atan2_8::angle#11 )
to:atan2_8::@return
atan2_8::@return: scope:[atan2_8] from atan2_8::@8
[40] return
[38] return
to:@return
atan2_8::@11: scope:[atan2_8] from atan2_8::@10
[41] (signed byte) atan2_8::xd#0 ← (signed byte) atan2_8::xi#3 >> (byte) atan2_8::i#2
[42] (signed byte) atan2_8::yd#0 ← (signed byte) atan2_8::yi#3 >> (byte) atan2_8::i#2
[43] if((signed byte) atan2_8::yi#3>(signed byte) 0) goto atan2_8::@13
[39] (signed byte) atan2_8::xd#0 ← (signed byte) atan2_8::xi#3 >> (byte) atan2_8::i#2
[40] (signed byte) atan2_8::yd#0 ← (signed byte) atan2_8::yi#3 >> (byte) atan2_8::i#2
[41] if((signed byte) atan2_8::yi#3>(signed byte) 0) goto atan2_8::@13
to:atan2_8::@15
atan2_8::@15: scope:[atan2_8] from atan2_8::@11
[44] (signed byte) atan2_8::xi#2 ← (signed byte) atan2_8::xi#3 - (signed byte) atan2_8::yd#0
[45] (signed byte) atan2_8::yi#2 ← (signed byte) atan2_8::yi#3 + (signed byte) atan2_8::xd#0
[46] (byte) atan2_8::angle#3 ← (byte) atan2_8::angle#12 - *((const byte*) CORDIC_ATAN2_ANGLES_8#0 + (byte) atan2_8::i#2)
[42] (signed byte) atan2_8::xi#2 ← (signed byte) atan2_8::xi#3 - (signed byte) atan2_8::yd#0
[43] (signed byte) atan2_8::yi#2 ← (signed byte) atan2_8::yi#3 + (signed byte) atan2_8::xd#0
[44] (byte) atan2_8::angle#3 ← (byte) atan2_8::angle#12 - *((const byte[CORDIC_ITERATIONS_8#0]) CORDIC_ATAN2_ANGLES_8#0 + (byte) atan2_8::i#2)
to:atan2_8::@14
atan2_8::@14: scope:[atan2_8] from atan2_8::@13 atan2_8::@15
[47] (signed byte) atan2_8::xi#7 ← phi( atan2_8::@13/(signed byte) atan2_8::xi#1 atan2_8::@15/(signed byte) atan2_8::xi#2 )
[47] (byte) atan2_8::angle#13 ← phi( atan2_8::@13/(byte) atan2_8::angle#2 atan2_8::@15/(byte) atan2_8::angle#3 )
[47] (signed byte) atan2_8::yi#7 ← phi( atan2_8::@13/(signed byte) atan2_8::yi#1 atan2_8::@15/(signed byte) atan2_8::yi#2 )
[48] (byte) atan2_8::i#1 ← ++ (byte) atan2_8::i#2
[49] if((byte) atan2_8::i#1==(const byte) CORDIC_ITERATIONS_8#0-(byte) 1+(byte) 1) goto atan2_8::@12
[45] (signed byte) atan2_8::xi#7 ← phi( atan2_8::@13/(signed byte) atan2_8::xi#1 atan2_8::@15/(signed byte) atan2_8::xi#2 )
[45] (byte) atan2_8::angle#13 ← phi( atan2_8::@13/(byte) atan2_8::angle#2 atan2_8::@15/(byte) atan2_8::angle#3 )
[45] (signed byte) atan2_8::yi#7 ← phi( atan2_8::@13/(signed byte) atan2_8::yi#1 atan2_8::@15/(signed byte) atan2_8::yi#2 )
[46] (byte) atan2_8::i#1 ← ++ (byte) atan2_8::i#2
[47] if((byte) atan2_8::i#1==(const byte) CORDIC_ITERATIONS_8#0-(byte) 1+(byte) 1) goto atan2_8::@12
to:atan2_8::@10
atan2_8::@13: scope:[atan2_8] from atan2_8::@11
[50] (signed byte) atan2_8::xi#1 ← (signed byte) atan2_8::xi#3 + (signed byte) atan2_8::yd#0
[51] (signed byte) atan2_8::yi#1 ← (signed byte) atan2_8::yi#3 - (signed byte) atan2_8::xd#0
[52] (byte) atan2_8::angle#2 ← (byte) atan2_8::angle#12 + *((const byte*) CORDIC_ATAN2_ANGLES_8#0 + (byte) atan2_8::i#2)
[48] (signed byte) atan2_8::xi#1 ← (signed byte) atan2_8::xi#3 + (signed byte) atan2_8::yd#0
[49] (signed byte) atan2_8::yi#1 ← (signed byte) atan2_8::yi#3 - (signed byte) atan2_8::xd#0
[50] (byte) atan2_8::angle#2 ← (byte) atan2_8::angle#12 + *((const byte[CORDIC_ITERATIONS_8#0]) CORDIC_ATAN2_ANGLES_8#0 + (byte) atan2_8::i#2)
to:atan2_8::@14
atan2_8::@4: scope:[atan2_8] from atan2_8::@3
[53] (signed byte~) atan2_8::xi#8 ← (signed byte) atan2_8::x#0
[51] (signed byte~) atan2_8::xi#8 ← (signed byte) atan2_8::x#0
to:atan2_8::@6
atan2_8::@1: scope:[atan2_8] from atan2_8
[54] (signed byte~) atan2_8::yi#11 ← (signed byte) atan2_8::y#0
[52] (signed byte~) atan2_8::yi#11 ← (signed byte) atan2_8::y#0
to:atan2_8::@3
init_font_hex: scope:[init_font_hex] from main
[55] phi()
[53] phi()
to:init_font_hex::@1
init_font_hex::@1: scope:[init_font_hex] from init_font_hex init_font_hex::@5
[56] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[56] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[56] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
[54] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[54] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[54] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
to:init_font_hex::@2
init_font_hex::@2: scope:[init_font_hex] from init_font_hex::@1 init_font_hex::@4
[57] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[57] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[57] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[58] *((byte*) init_font_hex::charset#2) ← (byte) 0
[55] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[55] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[55] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[56] *((byte*) init_font_hex::charset#2) ← (byte) 0
to:init_font_hex::@3
init_font_hex::@3: scope:[init_font_hex] from init_font_hex::@2 init_font_hex::@3
[59] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[59] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[60] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[61] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[62] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[63] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[64] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[65] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[66] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
[57] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[57] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[58] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[59] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[60] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[61] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[62] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[63] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[64] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
to:init_font_hex::@4
init_font_hex::@4: scope:[init_font_hex] from init_font_hex::@3
[67] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[68] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[69] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[70] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[71] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[72] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[73] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
[65] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[66] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[67] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[68] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[69] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[70] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[71] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
to:init_font_hex::@5
init_font_hex::@5: scope:[init_font_hex] from init_font_hex::@4
[74] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[75] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[76] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
[72] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[73] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[74] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
to:init_font_hex::@return
init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5
[77] return
[75] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,13 @@
(label) @1
(label) @2
(label) @3
(label) @begin
(label) @end
(byte*) CHARSET
(const byte*) CHARSET#0 CHARSET = (byte*) 8192
(byte*) COLS
(const byte*) COLS#0 COLS = (byte*) 55296
(word*) CORDIC_ATAN2_ANGLES_16
(const word*) CORDIC_ATAN2_ANGLES_16#0 CORDIC_ATAN2_ANGLES_16 = (word*) 4096
(byte*) CORDIC_ATAN2_ANGLES_8
(const byte*) CORDIC_ATAN2_ANGLES_8#0 CORDIC_ATAN2_ANGLES_8 = (byte*) 4352
(byte) CORDIC_ITERATIONS_16
(const byte) CORDIC_ITERATIONS_16#0 CORDIC_ITERATIONS_16 = (byte) $f
(byte[CORDIC_ITERATIONS_8#0]) CORDIC_ATAN2_ANGLES_8
(const byte[CORDIC_ITERATIONS_8#0]) CORDIC_ATAN2_ANGLES_8#0 CORDIC_ATAN2_ANGLES_8 = kickasm {{ .fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2
}}
(byte) CORDIC_ITERATIONS_8
(const byte) CORDIC_ITERATIONS_8#0 CORDIC_ITERATIONS_8 = (byte) 8
(byte*) D018

View File

@ -6,16 +6,8 @@
.label D018 = $d018
// The number of iterations performed during 16-bit CORDIC atan2 calculation
.const CORDIC_ITERATIONS_16 = $f
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
.label CORDIC_ATAN2_ANGLES_16 = $1000
// The number of iterations performed during 8-bit CORDIC atan2 calculation
.const CORDIC_ITERATIONS_8 = 8
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
.label CORDIC_ATAN2_ANGLES_8 = $1100
.label CHARSET = $2000
.label SCREEN = $2800
// Populate cordic angles table
// Populate cordic angles table
main: {
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
jsr init_font_hex
@ -361,10 +353,8 @@ init_font_hex: {
}
// Bit patterns for symbols 0-f (3x5 pixels) used in font hex
FONT_HEX_PROTO: .byte 2, 5, 5, 5, 2, 6, 2, 2, 2, 7, 6, 1, 2, 4, 7, 6, 1, 2, 1, 6, 5, 5, 7, 1, 1, 7, 4, 6, 1, 6, 3, 4, 6, 5, 2, 7, 1, 1, 1, 1, 2, 5, 2, 5, 2, 2, 5, 3, 1, 1, 2, 5, 7, 5, 5, 6, 5, 6, 5, 6, 2, 5, 4, 5, 2, 6, 5, 5, 5, 6, 7, 4, 6, 4, 7, 7, 4, 6, 4, 4
.pc = CORDIC_ATAN2_ANGLES_16 "CORDIC_ATAN2_ANGLES_16"
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
CORDIC_ATAN2_ANGLES_16:
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
.pc = CORDIC_ATAN2_ANGLES_8 "CORDIC_ATAN2_ANGLES_8"
.fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2

View File

@ -2,180 +2,171 @@
[0] phi()
to:@1
@1: scope:[] from @begin
kickasm(location (const word*) CORDIC_ATAN2_ANGLES_16#0 uses CORDIC_ITERATIONS_16#0) {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
to:@2
@2: scope:[] from @1
kickasm(location (const byte*) CORDIC_ATAN2_ANGLES_8#0 uses CORDIC_ITERATIONS_8#0) {{ .fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2
}}
to:@3
@3: scope:[] from @2
[3] phi()
[4] call main
[1] phi()
[2] call main
to:@end
@end: scope:[] from @3
[5] phi()
main: scope:[main] from @3
[6] phi()
[7] call init_font_hex
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
[5] call init_font_hex
to:main::toD0181
main::toD0181: scope:[main] from main
[8] phi()
[6] phi()
to:main::@1
main::@1: scope:[main] from main::toD0181
[9] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
[10] call init_angle_screen
[7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
[8] call init_angle_screen
to:main::@return
main::@return: scope:[main] from main::@1
[11] return
[9] return
to:@return
init_angle_screen: scope:[init_angle_screen] from main::@1
[12] phi()
[10] phi()
to:init_angle_screen::@1
init_angle_screen::@1: scope:[init_angle_screen] from init_angle_screen init_angle_screen::@3
[13] (byte*) init_angle_screen::screen#4 ← phi( init_angle_screen/(const byte*) SCREEN#0 init_angle_screen::@3/(byte*) init_angle_screen::screen#1 )
[13] (signed byte) init_angle_screen::y#4 ← phi( init_angle_screen/(signed byte) -$c init_angle_screen::@3/(signed byte) init_angle_screen::y#1 )
[11] (byte*) init_angle_screen::screen#4 ← phi( init_angle_screen/(const byte*) SCREEN#0 init_angle_screen::@3/(byte*) init_angle_screen::screen#1 )
[11] (signed byte) init_angle_screen::y#4 ← phi( init_angle_screen/(signed byte) -$c init_angle_screen::@3/(signed byte) init_angle_screen::y#1 )
to:init_angle_screen::@2
init_angle_screen::@2: scope:[init_angle_screen] from init_angle_screen::@1 init_angle_screen::@4
[14] (byte*) init_angle_screen::screen#2 ← phi( init_angle_screen::@1/(byte*) init_angle_screen::screen#4 init_angle_screen::@4/(byte*) init_angle_screen::screen#1 )
[14] (signed byte) init_angle_screen::x#2 ← phi( init_angle_screen::@1/(signed byte) -$13 init_angle_screen::@4/(signed byte) init_angle_screen::x#1 )
[15] (word) init_angle_screen::xw#0 ← (byte)(signed byte) init_angle_screen::x#2 w= (byte) 0
[16] (word) init_angle_screen::yw#0 ← (byte)(signed byte) init_angle_screen::y#4 w= (byte) 0
[17] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0
[18] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0
[19] call atan2_16
[20] (word) atan2_16::return#2 ← (word) atan2_16::return#0
[12] (byte*) init_angle_screen::screen#2 ← phi( init_angle_screen::@1/(byte*) init_angle_screen::screen#4 init_angle_screen::@4/(byte*) init_angle_screen::screen#1 )
[12] (signed byte) init_angle_screen::x#2 ← phi( init_angle_screen::@1/(signed byte) -$13 init_angle_screen::@4/(signed byte) init_angle_screen::x#1 )
[13] (word) init_angle_screen::xw#0 ← (byte)(signed byte) init_angle_screen::x#2 w= (byte) 0
[14] (word) init_angle_screen::yw#0 ← (byte)(signed byte) init_angle_screen::y#4 w= (byte) 0
[15] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0
[16] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0
[17] call atan2_16
[18] (word) atan2_16::return#2 ← (word) atan2_16::return#0
to:init_angle_screen::@4
init_angle_screen::@4: scope:[init_angle_screen] from init_angle_screen::@2
[21] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2
[22] (word~) init_angle_screen::$7 ← (word) init_angle_screen::angle_w#0 + (byte) $80
[23] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$7
[24] *((byte*) init_angle_screen::screen#2) ← (byte) init_angle_screen::ang_w#0
[25] (byte*) init_angle_screen::screen#1 ← ++ (byte*) init_angle_screen::screen#2
[26] (signed byte) init_angle_screen::x#1 ← ++ (signed byte) init_angle_screen::x#2
[27] if((signed byte) init_angle_screen::x#1!=(signed byte) $15) goto init_angle_screen::@2
[19] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2
[20] (word~) init_angle_screen::$7 ← (word) init_angle_screen::angle_w#0 + (byte) $80
[21] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$7
[22] *((byte*) init_angle_screen::screen#2) ← (byte) init_angle_screen::ang_w#0
[23] (byte*) init_angle_screen::screen#1 ← ++ (byte*) init_angle_screen::screen#2
[24] (signed byte) init_angle_screen::x#1 ← ++ (signed byte) init_angle_screen::x#2
[25] if((signed byte) init_angle_screen::x#1!=(signed byte) $15) goto init_angle_screen::@2
to:init_angle_screen::@3
init_angle_screen::@3: scope:[init_angle_screen] from init_angle_screen::@4
[28] (signed byte) init_angle_screen::y#1 ← ++ (signed byte) init_angle_screen::y#4
[29] if((signed byte) init_angle_screen::y#1!=(signed byte) $d) goto init_angle_screen::@1
[26] (signed byte) init_angle_screen::y#1 ← ++ (signed byte) init_angle_screen::y#4
[27] if((signed byte) init_angle_screen::y#1!=(signed byte) $d) goto init_angle_screen::@1
to:init_angle_screen::@return
init_angle_screen::@return: scope:[init_angle_screen] from init_angle_screen::@3
[30] return
[28] return
to:@return
atan2_16: scope:[atan2_16] from init_angle_screen::@2
[31] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1
[29] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1
to:atan2_16::@2
atan2_16::@2: scope:[atan2_16] from atan2_16
[32] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0
[30] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0
to:atan2_16::@3
atan2_16::@3: scope:[atan2_16] from atan2_16::@1 atan2_16::@2
[33] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 )
[34] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4
[31] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 )
[32] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4
to:atan2_16::@5
atan2_16::@5: scope:[atan2_16] from atan2_16::@3
[35] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
[33] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@6: scope:[atan2_16] from atan2_16::@4 atan2_16::@5
[36] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#8 atan2_16::@5/(signed word~) atan2_16::$7 )
[34] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#8 atan2_16::@5/(signed word~) atan2_16::$7 )
to:atan2_16::@10
atan2_16::@10: scope:[atan2_16] from atan2_16::@14 atan2_16::@6
[37] (word) atan2_16::angle#12 ← phi( atan2_16::@14/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[37] (byte) atan2_16::i#2 ← phi( atan2_16::@14/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[37] (signed word) atan2_16::xi#3 ← phi( atan2_16::@14/(signed word) atan2_16::xi#7 atan2_16::@6/(signed word) atan2_16::xi#0 )
[37] (signed word) atan2_16::yi#3 ← phi( atan2_16::@14/(signed word) atan2_16::yi#7 atan2_16::@6/(signed word) atan2_16::yi#0 )
[38] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
[35] (word) atan2_16::angle#12 ← phi( atan2_16::@14/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[35] (byte) atan2_16::i#2 ← phi( atan2_16::@14/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[35] (signed word) atan2_16::xi#3 ← phi( atan2_16::@14/(signed word) atan2_16::xi#7 atan2_16::@6/(signed word) atan2_16::xi#0 )
[35] (signed word) atan2_16::yi#3 ← phi( atan2_16::@14/(signed word) atan2_16::yi#7 atan2_16::@6/(signed word) atan2_16::yi#0 )
[36] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
to:atan2_16::@12
atan2_16::@12: scope:[atan2_16] from atan2_16::@10 atan2_16::@14
[39] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@14/(word) atan2_16::angle#13 )
[40] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[41] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
[37] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@14/(word) atan2_16::angle#13 )
[38] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[39] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
to:atan2_16::@16
atan2_16::@16: scope:[atan2_16] from atan2_16::@12
[42] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
[40] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
to:atan2_16::@7
atan2_16::@7: scope:[atan2_16] from atan2_16::@12 atan2_16::@16
[43] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@16/(word) atan2_16::angle#4 )
[44] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
[41] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@16/(word) atan2_16::angle#4 )
[42] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
to:atan2_16::@9
atan2_16::@9: scope:[atan2_16] from atan2_16::@7
[45] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
[43] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
to:atan2_16::@8
atan2_16::@8: scope:[atan2_16] from atan2_16::@7 atan2_16::@9
[46] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
[44] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
to:atan2_16::@return
atan2_16::@return: scope:[atan2_16] from atan2_16::@8
[47] return
[45] return
to:@return
atan2_16::@11: scope:[atan2_16] from atan2_16::@10
[48] (signed word) atan2_16::xd#0 ← (signed word) atan2_16::xi#3 >> (byte) atan2_16::i#2
[49] (signed word) atan2_16::yd#0 ← (signed word) atan2_16::yi#3 >> (byte) atan2_16::i#2
[50] if((signed word) atan2_16::yi#3>(signed byte) 0) goto atan2_16::@13
[46] (signed word) atan2_16::xd#0 ← (signed word) atan2_16::xi#3 >> (byte) atan2_16::i#2
[47] (signed word) atan2_16::yd#0 ← (signed word) atan2_16::yi#3 >> (byte) atan2_16::i#2
[48] if((signed word) atan2_16::yi#3>(signed byte) 0) goto atan2_16::@13
to:atan2_16::@15
atan2_16::@15: scope:[atan2_16] from atan2_16::@11
[51] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#0
[52] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#0
[53] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
[54] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
[49] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#0
[50] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#0
[51] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
[52] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
to:atan2_16::@14
atan2_16::@14: scope:[atan2_16] from atan2_16::@13 atan2_16::@15
[55] (signed word) atan2_16::xi#7 ← phi( atan2_16::@13/(signed word) atan2_16::xi#1 atan2_16::@15/(signed word) atan2_16::xi#2 )
[55] (word) atan2_16::angle#13 ← phi( atan2_16::@13/(word) atan2_16::angle#2 atan2_16::@15/(word) atan2_16::angle#3 )
[55] (signed word) atan2_16::yi#7 ← phi( atan2_16::@13/(signed word) atan2_16::yi#1 atan2_16::@15/(signed word) atan2_16::yi#2 )
[56] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[57] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12
[53] (signed word) atan2_16::xi#7 ← phi( atan2_16::@13/(signed word) atan2_16::xi#1 atan2_16::@15/(signed word) atan2_16::xi#2 )
[53] (word) atan2_16::angle#13 ← phi( atan2_16::@13/(word) atan2_16::angle#2 atan2_16::@15/(word) atan2_16::angle#3 )
[53] (signed word) atan2_16::yi#7 ← phi( atan2_16::@13/(signed word) atan2_16::yi#1 atan2_16::@15/(signed word) atan2_16::yi#2 )
[54] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[55] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12
to:atan2_16::@10
atan2_16::@13: scope:[atan2_16] from atan2_16::@11
[58] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#0
[59] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#0
[60] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[61] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
[56] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#0
[57] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#0
[58] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[59] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
to:atan2_16::@14
atan2_16::@4: scope:[atan2_16] from atan2_16::@3
[62] (signed word~) atan2_16::xi#8 ← (signed word) atan2_16::x#0
[60] (signed word~) atan2_16::xi#8 ← (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@1: scope:[atan2_16] from atan2_16
[63] (signed word~) atan2_16::yi#11 ← (signed word) atan2_16::y#0
[61] (signed word~) atan2_16::yi#11 ← (signed word) atan2_16::y#0
to:atan2_16::@3
init_font_hex: scope:[init_font_hex] from main
[64] phi()
[62] phi()
to:init_font_hex::@1
init_font_hex::@1: scope:[init_font_hex] from init_font_hex init_font_hex::@5
[65] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[65] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[65] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
[63] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[63] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[63] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
to:init_font_hex::@2
init_font_hex::@2: scope:[init_font_hex] from init_font_hex::@1 init_font_hex::@4
[66] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[66] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[66] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[67] *((byte*) init_font_hex::charset#2) ← (byte) 0
[64] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[64] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[64] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[65] *((byte*) init_font_hex::charset#2) ← (byte) 0
to:init_font_hex::@3
init_font_hex::@3: scope:[init_font_hex] from init_font_hex::@2 init_font_hex::@3
[68] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[68] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[69] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[70] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[71] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[72] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[73] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[74] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[75] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
[66] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[66] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[67] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[68] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[69] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[70] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[71] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[72] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[73] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
to:init_font_hex::@4
init_font_hex::@4: scope:[init_font_hex] from init_font_hex::@3
[76] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[77] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[78] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[79] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[80] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[81] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[82] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
[74] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[75] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[76] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[77] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[78] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[79] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[80] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
to:init_font_hex::@5
init_font_hex::@5: scope:[init_font_hex] from init_font_hex::@4
[83] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[84] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[85] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
[81] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[82] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[83] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
to:init_font_hex::@return
init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5
[86] return
[84] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,14 @@
(label) @1
(label) @2
(label) @3
(label) @begin
(label) @end
(byte*) CHARSET
(const byte*) CHARSET#0 CHARSET = (byte*) 8192
(word*) CORDIC_ATAN2_ANGLES_16
(const word*) CORDIC_ATAN2_ANGLES_16#0 CORDIC_ATAN2_ANGLES_16 = (word*) 4096
(byte*) CORDIC_ATAN2_ANGLES_8
(const byte*) CORDIC_ATAN2_ANGLES_8#0 CORDIC_ATAN2_ANGLES_8 = (byte*) 4352
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16
(const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 CORDIC_ATAN2_ANGLES_16 = kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
(byte) CORDIC_ITERATIONS_16
(const byte) CORDIC_ITERATIONS_16#0 CORDIC_ITERATIONS_16 = (byte) $f
(byte) CORDIC_ITERATIONS_8
(const byte) CORDIC_ITERATIONS_8#0 CORDIC_ITERATIONS_8 = (byte) 8
(byte*) D018
(const byte*) D018#0 D018 = (byte*) 53272
(byte[]) FONT_HEX_PROTO