mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-02-07 05:30:43 +00:00
Fixed struct tests
This commit is contained in:
parent
587027397d
commit
f09e4da4d4
@ -62,7 +62,7 @@ print_ln::@return: scope:[print_ln] from print_ln::@1
|
||||
(void()) print_str((byte*) print_str::str)
|
||||
print_str: scope:[print_str] from print_dword_decimal::@1 print_person::@2
|
||||
[24] (byte*) print_char_cursor#41 ← phi( print_dword_decimal::@1/(byte*) print_char_cursor#39 print_person::@2/(byte*) print_char_cursor#25 )
|
||||
[24] (byte*) print_str::str#5 ← phi( print_dword_decimal::@1/(const byte[$b]) decimal_digits_long#0 print_person::@2/(byte*) print_str::str#2 )
|
||||
[24] (byte*) print_str::str#5 ← phi( print_dword_decimal::@1/(const byte[$b]) decimal_digits_long print_person::@2/(byte*) print_str::str#2 )
|
||||
to:print_str::@1
|
||||
print_str::@1: scope:[print_str] from print_str print_str::@2
|
||||
[25] (byte*) print_char_cursor#18 ← phi( print_str/(byte*) print_char_cursor#41 print_str::@2/(byte*) print_char_cursor#1 )
|
||||
@ -105,7 +105,7 @@ ultoa: scope:[ultoa] from print_dword_decimal
|
||||
[39] phi()
|
||||
to:ultoa::@1
|
||||
ultoa::@1: scope:[ultoa] from ultoa ultoa::@4
|
||||
[40] (byte*) ultoa::buffer#11 ← phi( ultoa::@4/(byte*) ultoa::buffer#14 ultoa/(const byte[$b]) decimal_digits_long#0 )
|
||||
[40] (byte*) ultoa::buffer#11 ← phi( ultoa::@4/(byte*) ultoa::buffer#14 ultoa/(const byte[$b]) decimal_digits_long )
|
||||
[40] (byte) ultoa::started#2 ← phi( ultoa::@4/(byte) ultoa::started#4 ultoa/(byte) 0 )
|
||||
[40] (dword) ultoa::value#2 ← phi( ultoa::@4/(dword) ultoa::value#6 ultoa/(dword) ultoa::value#1 )
|
||||
[40] (byte) ultoa::digit#2 ← phi( ultoa::@4/(byte) ultoa::digit#1 ultoa/(byte) 0 )
|
||||
@ -113,7 +113,7 @@ ultoa::@1: scope:[ultoa] from ultoa ultoa::@4
|
||||
to:ultoa::@3
|
||||
ultoa::@3: scope:[ultoa] from ultoa::@1
|
||||
[42] (byte~) ultoa::$4 ← (byte)(dword) ultoa::value#2
|
||||
[43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS#0 + (byte~) ultoa::$4)
|
||||
[43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS + (byte~) ultoa::$4)
|
||||
[44] (byte*) ultoa::buffer#3 ← ++ (byte*) ultoa::buffer#11
|
||||
[45] *((byte*) ultoa::buffer#3) ← (byte) 0
|
||||
to:ultoa::@return
|
||||
@ -122,7 +122,7 @@ ultoa::@return: scope:[ultoa] from ultoa::@3
|
||||
to:@return
|
||||
ultoa::@2: scope:[ultoa] from ultoa::@1
|
||||
[47] (byte~) ultoa::$11 ← (byte) ultoa::digit#2 << (byte) 2
|
||||
[48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG#0 + (byte~) ultoa::$11)
|
||||
[48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG + (byte~) ultoa::$11)
|
||||
[49] if((byte) 0!=(byte) ultoa::started#2) goto ultoa::@5
|
||||
to:ultoa::@7
|
||||
ultoa::@7: scope:[ultoa] from ultoa::@2
|
||||
@ -156,7 +156,7 @@ ultoa_append::@1: scope:[ultoa_append] from ultoa_append ultoa_append::@2
|
||||
[62] if((dword) ultoa_append::value#2>=(dword) ultoa_append::sub#0) goto ultoa_append::@2
|
||||
to:ultoa_append::@3
|
||||
ultoa_append::@3: scope:[ultoa_append] from ultoa_append::@1
|
||||
[63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS#0 + (byte) ultoa_append::digit#2)
|
||||
[63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS + (byte) ultoa_append::digit#2)
|
||||
to:ultoa_append::@return
|
||||
ultoa_append::@return: scope:[ultoa_append] from ultoa_append::@3
|
||||
[64] return
|
||||
|
@ -91,13 +91,13 @@ CONTROL FLOW GRAPH SSA
|
||||
@begin: scope:[] from
|
||||
to:@8
|
||||
@8: scope:[] from @begin
|
||||
(byte[]) DIGITS#0 ← (const string) $0
|
||||
(byte[]) DIGITS ← (const string) $0
|
||||
to:@10
|
||||
@10: scope:[] from @8
|
||||
(dword[]) RADIX_BINARY_VALUES_LONG#0 ← { (number) $80000000, (number) $40000000, (number) $20000000, (number) $10000000, (number) $8000000, (number) $4000000, (number) $2000000, (number) $1000000, (number) $800000, (number) $400000, (number) $200000, (number) $100000, (number) $80000, (number) $40000, (number) $20000, (number) $10000, (number) $8000, (number) $4000, (number) $2000, (number) $1000, (number) $800, (number) $400, (number) $200, (number) $100, (number) $80, (number) $40, (number) $20, (number) $10, (number) 8, (number) 4, (number) 2 }
|
||||
(dword[]) RADIX_OCTAL_VALUES_LONG#0 ← { (number) $40000000, (number) $8000000, (number) $1000000, (number) $200000, (number) $40000, (number) $8000, (number) $1000, (number) $200, (number) $40, (number) 8 }
|
||||
(dword[]) RADIX_DECIMAL_VALUES_LONG#0 ← { (number) $3b9aca00, (number) $5f5e100, (number) $989680, (number) $f4240, (number) $186a0, (number) $2710, (number) $3e8, (number) $64, (number) $a }
|
||||
(dword[]) RADIX_HEXADECIMAL_VALUES_LONG#0 ← { (number) $10000000, (number) $1000000, (number) $100000, (number) $10000, (number) $1000, (number) $100, (number) $10 }
|
||||
(dword[]) RADIX_BINARY_VALUES_LONG ← { (number) $80000000, (number) $40000000, (number) $20000000, (number) $10000000, (number) $8000000, (number) $4000000, (number) $2000000, (number) $1000000, (number) $800000, (number) $400000, (number) $200000, (number) $100000, (number) $80000, (number) $40000, (number) $20000, (number) $10000, (number) $8000, (number) $4000, (number) $2000, (number) $1000, (number) $800, (number) $400, (number) $200, (number) $100, (number) $80, (number) $40, (number) $20, (number) $10, (number) 8, (number) 4, (number) 2 }
|
||||
(dword[]) RADIX_OCTAL_VALUES_LONG ← { (number) $40000000, (number) $8000000, (number) $1000000, (number) $200000, (number) $40000, (number) $8000, (number) $1000, (number) $200, (number) $40, (number) 8 }
|
||||
(dword[]) RADIX_DECIMAL_VALUES_LONG ← { (number) $3b9aca00, (number) $5f5e100, (number) $989680, (number) $f4240, (number) $186a0, (number) $2710, (number) $3e8, (number) $64, (number) $a }
|
||||
(dword[]) RADIX_HEXADECIMAL_VALUES_LONG ← { (number) $10000000, (number) $1000000, (number) $100000, (number) $10000, (number) $1000, (number) $100, (number) $10 }
|
||||
to:@12
|
||||
|
||||
(void()) ultoa((dword) ultoa::value , (byte*) ultoa::buffer , (byte) ultoa::radix)
|
||||
@ -114,7 +114,7 @@ ultoa::@1: scope:[ultoa] from ultoa
|
||||
(byte*) ultoa::buffer#17 ← phi( ultoa/(byte*) ultoa::buffer#21 )
|
||||
(dword) ultoa::value#8 ← phi( ultoa/(dword) ultoa::value#12 )
|
||||
(byte) ultoa::max_digits#1 ← (number) $a
|
||||
(dword*) ultoa::digit_values#1 ← (dword[]) RADIX_DECIMAL_VALUES_LONG#0
|
||||
(dword*) ultoa::digit_values#1 ← (dword[]) RADIX_DECIMAL_VALUES_LONG
|
||||
to:ultoa::@8
|
||||
ultoa::@9: scope:[ultoa] from ultoa
|
||||
(dword) ultoa::value#13 ← phi( ultoa/(dword) ultoa::value#12 )
|
||||
@ -127,7 +127,7 @@ ultoa::@2: scope:[ultoa] from ultoa::@9
|
||||
(byte*) ultoa::buffer#18 ← phi( ultoa::@9/(byte*) ultoa::buffer#16 )
|
||||
(dword) ultoa::value#9 ← phi( ultoa::@9/(dword) ultoa::value#13 )
|
||||
(byte) ultoa::max_digits#2 ← (number) 8
|
||||
(dword*) ultoa::digit_values#2 ← (dword[]) RADIX_HEXADECIMAL_VALUES_LONG#0
|
||||
(dword*) ultoa::digit_values#2 ← (dword[]) RADIX_HEXADECIMAL_VALUES_LONG
|
||||
to:ultoa::@8
|
||||
ultoa::@10: scope:[ultoa] from ultoa::@9
|
||||
(dword) ultoa::value#14 ← phi( ultoa::@9/(dword) ultoa::value#13 )
|
||||
@ -140,7 +140,7 @@ ultoa::@3: scope:[ultoa] from ultoa::@10
|
||||
(byte*) ultoa::buffer#19 ← phi( ultoa::@10/(byte*) ultoa::buffer#13 )
|
||||
(dword) ultoa::value#10 ← phi( ultoa::@10/(dword) ultoa::value#14 )
|
||||
(byte) ultoa::max_digits#3 ← (number) $b
|
||||
(dword*) ultoa::digit_values#3 ← (dword[]) RADIX_OCTAL_VALUES_LONG#0
|
||||
(dword*) ultoa::digit_values#3 ← (dword[]) RADIX_OCTAL_VALUES_LONG
|
||||
to:ultoa::@8
|
||||
ultoa::@11: scope:[ultoa] from ultoa::@10
|
||||
(dword) ultoa::value#15 ← phi( ultoa::@10/(dword) ultoa::value#14 )
|
||||
@ -153,7 +153,7 @@ ultoa::@4: scope:[ultoa] from ultoa::@11
|
||||
(byte*) ultoa::buffer#20 ← phi( ultoa::@11/(byte*) ultoa::buffer#10 )
|
||||
(dword) ultoa::value#11 ← phi( ultoa::@11/(dword) ultoa::value#15 )
|
||||
(byte) ultoa::max_digits#4 ← (number) $20
|
||||
(dword*) ultoa::digit_values#4 ← (dword[]) RADIX_BINARY_VALUES_LONG#0
|
||||
(dword*) ultoa::digit_values#4 ← (dword[]) RADIX_BINARY_VALUES_LONG
|
||||
to:ultoa::@8
|
||||
ultoa::@12: scope:[ultoa] from ultoa::@11
|
||||
(byte*) ultoa::buffer#6 ← phi( ultoa::@11/(byte*) ultoa::buffer#10 )
|
||||
@ -205,7 +205,7 @@ ultoa::@20: scope:[ultoa] from ultoa::@18
|
||||
(byte*) ultoa::buffer#7 ← phi( ultoa::@18/(byte*) ultoa::buffer#11 )
|
||||
(dword) ultoa::value#3 ← phi( ultoa::@18/(dword) ultoa::value#5 )
|
||||
(byte~) ultoa::$4 ← ((byte)) (dword) ultoa::value#3
|
||||
*((byte*) ultoa::buffer#7) ← *((byte[]) DIGITS#0 + (byte~) ultoa::$4)
|
||||
*((byte*) ultoa::buffer#7) ← *((byte[]) DIGITS + (byte~) ultoa::$4)
|
||||
(byte*) ultoa::buffer#3 ← ++ (byte*) ultoa::buffer#7
|
||||
*((byte*) ultoa::buffer#3) ← (number) 0
|
||||
to:ultoa::@return
|
||||
@ -270,7 +270,7 @@ ultoa_append::@3: scope:[ultoa_append] from ultoa_append::@1
|
||||
(dword) ultoa_append::value#4 ← phi( ultoa_append::@1/(dword) ultoa_append::value#2 )
|
||||
(byte*) ultoa_append::buffer#1 ← phi( ultoa_append::@1/(byte*) ultoa_append::buffer#2 )
|
||||
(byte) ultoa_append::digit#3 ← phi( ultoa_append::@1/(byte) ultoa_append::digit#4 )
|
||||
*((byte*) ultoa_append::buffer#1) ← *((byte[]) DIGITS#0 + (byte) ultoa_append::digit#3)
|
||||
*((byte*) ultoa_append::buffer#1) ← *((byte[]) DIGITS + (byte) ultoa_append::digit#3)
|
||||
(dword) ultoa_append::return#1 ← (dword) ultoa_append::value#4
|
||||
to:ultoa_append::@return
|
||||
ultoa_append::@return: scope:[ultoa_append] from ultoa_append::@3
|
||||
@ -335,7 +335,7 @@ print_ln::@return: scope:[print_ln] from print_ln::@2
|
||||
@26: scope:[] from @12
|
||||
(byte*) print_line_cursor#24 ← phi( @12/(byte*) print_line_cursor#0 )
|
||||
(byte*) print_char_cursor#44 ← phi( @12/(byte*) print_char_cursor#0 )
|
||||
(byte[$b]) decimal_digits_long#0 ← { fill( $b, 0) }
|
||||
(byte[$b]) decimal_digits_long ← { fill( $b, 0) }
|
||||
to:@36
|
||||
|
||||
(void()) print_dword_decimal((dword) print_dword_decimal::w)
|
||||
@ -343,13 +343,13 @@ print_dword_decimal: scope:[print_dword_decimal] from print_person
|
||||
(byte*) print_char_cursor#42 ← phi( print_person/(byte*) print_char_cursor#39 )
|
||||
(dword) print_dword_decimal::w#1 ← phi( print_person/(dword) print_dword_decimal::w#0 )
|
||||
(dword) ultoa::value#1 ← (dword) print_dword_decimal::w#1
|
||||
(byte*) ultoa::buffer#5 ← (byte[$b]) decimal_digits_long#0
|
||||
(byte*) ultoa::buffer#5 ← (byte[$b]) decimal_digits_long
|
||||
(byte) ultoa::radix#0 ← (const byte) DECIMAL
|
||||
call ultoa
|
||||
to:print_dword_decimal::@1
|
||||
print_dword_decimal::@1: scope:[print_dword_decimal] from print_dword_decimal
|
||||
(byte*) print_char_cursor#37 ← phi( print_dword_decimal/(byte*) print_char_cursor#42 )
|
||||
(byte*) print_str::str#1 ← (byte[$b]) decimal_digits_long#0
|
||||
(byte*) print_str::str#1 ← (byte[$b]) decimal_digits_long
|
||||
call print_str
|
||||
to:print_dword_decimal::@2
|
||||
print_dword_decimal::@2: scope:[print_dword_decimal] from print_dword_decimal::@1
|
||||
@ -487,7 +487,6 @@ SYMBOL TABLE SSA
|
||||
(const byte) BINARY = (number) 2
|
||||
(const byte) DECIMAL = (number) $a
|
||||
(byte[]) DIGITS
|
||||
(byte[]) DIGITS#0
|
||||
(const byte) HEXADECIMAL = (number) $10
|
||||
(const byte) OCTAL = (number) 8
|
||||
(dword) Person::id
|
||||
@ -497,16 +496,11 @@ SYMBOL TABLE SSA
|
||||
(const byte) RADIX::HEXADECIMAL = (number) $10
|
||||
(const byte) RADIX::OCTAL = (number) 8
|
||||
(dword[]) RADIX_BINARY_VALUES_LONG
|
||||
(dword[]) RADIX_BINARY_VALUES_LONG#0
|
||||
(dword[]) RADIX_DECIMAL_VALUES_LONG
|
||||
(dword[]) RADIX_DECIMAL_VALUES_LONG#0
|
||||
(dword[]) RADIX_HEXADECIMAL_VALUES_LONG
|
||||
(dword[]) RADIX_HEXADECIMAL_VALUES_LONG#0
|
||||
(dword[]) RADIX_OCTAL_VALUES_LONG
|
||||
(dword[]) RADIX_OCTAL_VALUES_LONG#0
|
||||
(const byte) SIZEOF_DWORD = (byte) 4
|
||||
(byte[$b]) decimal_digits_long
|
||||
(byte[$b]) decimal_digits_long#0
|
||||
(dword) henry_id
|
||||
(dword) henry_id#0
|
||||
(byte[3]) henry_initials
|
||||
@ -812,10 +806,10 @@ Adding number conversion cast (unumber) $28 in (byte*~) print_ln::$0 ← (byte*)
|
||||
Adding number conversion cast (unumber) $1b244 in (dword) jesper_id#0 ← (number) $1b244
|
||||
Adding number conversion cast (unumber) $4466d in (dword) henry_id#0 ← (number) $4466d
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Added casts to value list in (dword[]) RADIX_BINARY_VALUES_LONG#0 ← (dword[]){ (dword)(number) $80000000, (dword)(number) $40000000, (dword)(number) $20000000, (dword)(number) $10000000, (dword)(number) $8000000, (dword)(number) $4000000, (dword)(number) $2000000, (dword)(number) $1000000, (dword)(number) $800000, (dword)(number) $400000, (dword)(number) $200000, (dword)(number) $100000, (dword)(number) $80000, (dword)(number) $40000, (dword)(number) $20000, (dword)(number) $10000, (dword)(number) $8000, (dword)(number) $4000, (dword)(number) $2000, (dword)(number) $1000, (dword)(number) $800, (dword)(number) $400, (dword)(number) $200, (dword)(number) $100, (dword)(number) $80, (dword)(number) $40, (dword)(number) $20, (dword)(number) $10, (dword)(number) 8, (dword)(number) 4, (dword)(number) 2 }
|
||||
Added casts to value list in (dword[]) RADIX_OCTAL_VALUES_LONG#0 ← (dword[]){ (dword)(number) $40000000, (dword)(number) $8000000, (dword)(number) $1000000, (dword)(number) $200000, (dword)(number) $40000, (dword)(number) $8000, (dword)(number) $1000, (dword)(number) $200, (dword)(number) $40, (dword)(number) 8 }
|
||||
Added casts to value list in (dword[]) RADIX_DECIMAL_VALUES_LONG#0 ← (dword[]){ (dword)(number) $3b9aca00, (dword)(number) $5f5e100, (dword)(number) $989680, (dword)(number) $f4240, (dword)(number) $186a0, (dword)(number) $2710, (dword)(number) $3e8, (dword)(number) $64, (dword)(number) $a }
|
||||
Added casts to value list in (dword[]) RADIX_HEXADECIMAL_VALUES_LONG#0 ← (dword[]){ (dword)(number) $10000000, (dword)(number) $1000000, (dword)(number) $100000, (dword)(number) $10000, (dword)(number) $1000, (dword)(number) $100, (dword)(number) $10 }
|
||||
Added casts to value list in (dword[]) RADIX_BINARY_VALUES_LONG ← (dword[]){ (dword)(number) $80000000, (dword)(number) $40000000, (dword)(number) $20000000, (dword)(number) $10000000, (dword)(number) $8000000, (dword)(number) $4000000, (dword)(number) $2000000, (dword)(number) $1000000, (dword)(number) $800000, (dword)(number) $400000, (dword)(number) $200000, (dword)(number) $100000, (dword)(number) $80000, (dword)(number) $40000, (dword)(number) $20000, (dword)(number) $10000, (dword)(number) $8000, (dword)(number) $4000, (dword)(number) $2000, (dword)(number) $1000, (dword)(number) $800, (dword)(number) $400, (dword)(number) $200, (dword)(number) $100, (dword)(number) $80, (dword)(number) $40, (dword)(number) $20, (dword)(number) $10, (dword)(number) 8, (dword)(number) 4, (dword)(number) 2 }
|
||||
Added casts to value list in (dword[]) RADIX_OCTAL_VALUES_LONG ← (dword[]){ (dword)(number) $40000000, (dword)(number) $8000000, (dword)(number) $1000000, (dword)(number) $200000, (dword)(number) $40000, (dword)(number) $8000, (dword)(number) $1000, (dword)(number) $200, (dword)(number) $40, (dword)(number) 8 }
|
||||
Added casts to value list in (dword[]) RADIX_DECIMAL_VALUES_LONG ← (dword[]){ (dword)(number) $3b9aca00, (dword)(number) $5f5e100, (dword)(number) $989680, (dword)(number) $f4240, (dword)(number) $186a0, (dword)(number) $2710, (dword)(number) $3e8, (dword)(number) $64, (dword)(number) $a }
|
||||
Added casts to value list in (dword[]) RADIX_HEXADECIMAL_VALUES_LONG ← (dword[]){ (dword)(number) $10000000, (dword)(number) $1000000, (dword)(number) $100000, (dword)(number) $10000, (dword)(number) $1000, (dword)(number) $100, (dword)(number) $10 }
|
||||
Successful SSA optimization PassNAddInitializerValueListTypeCasts
|
||||
Inlining cast (byte) ultoa::max_digits#1 ← (unumber)(number) $a
|
||||
Inlining cast (byte) ultoa::max_digits#2 ← (unumber)(number) 8
|
||||
@ -1011,18 +1005,18 @@ Rewriting ! if()-condition to reversed if() [52] (bool~) ultoa::$9 ← ! (bool~)
|
||||
Rewriting || if()-condition to two if()s [51] (bool~) ultoa::$8 ← (byte) ultoa::started#2 || (bool~) ultoa::$7
|
||||
Successful SSA optimization Pass2ConditionalAndOrRewriting
|
||||
Warning! Adding boolean cast to non-boolean condition (byte) ultoa::started#2
|
||||
Constant right-side identified [113] (byte[$b]) decimal_digits_long#0 ← { fill( $b, 0) }
|
||||
Constant right-side identified [113] (byte[$b]) decimal_digits_long ← { fill( $b, 0) }
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Identified constant from value list (dword[]) { (dword) $80000000, (dword) $40000000, (dword) $20000000, (dword) $10000000, (dword) $8000000, (dword) $4000000, (dword) $2000000, (dword) $1000000, (dword) $800000, (dword) $400000, (dword) $200000, (dword) $100000, (dword) $80000, (dword) $40000, (dword) $20000, (dword) $10000, (dword) $8000, (dword) $4000, (dword) $2000, (dword) $1000, (dword) $800, (dword) $400, (dword) $200, (dword) $100, (dword) $80, (dword) $40, (dword) $20, (dword) $10, (dword) 8, (dword) 4, (dword) 2 }
|
||||
Identified constant from value list (dword[]) { (dword) $40000000, (dword) $8000000, (dword) $1000000, (dword) $200000, (dword) $40000, (dword) $8000, (dword) $1000, (dword) $200, (dword) $40, (dword) 8 }
|
||||
Identified constant from value list (dword[]) { (dword) $3b9aca00, (dword) $5f5e100, (dword) $989680, (dword) $f4240, (dword) $186a0, (dword) $2710, (dword) $3e8, (dword) $64, (dword) $a }
|
||||
Identified constant from value list (dword[]) { (dword) $10000000, (dword) $1000000, (dword) $100000, (dword) $10000, (dword) $1000, (dword) $100, (dword) $10 }
|
||||
Successful SSA optimization Pass2ConstantInitializerValueLists
|
||||
Constant (const byte[]) DIGITS#0 = $0
|
||||
Constant (const dword[]) RADIX_BINARY_VALUES_LONG#0 = { $80000000, $40000000, $20000000, $10000000, $8000000, $4000000, $2000000, $1000000, $800000, $400000, $200000, $100000, $80000, $40000, $20000, $10000, $8000, $4000, $2000, $1000, $800, $400, $200, $100, $80, $40, $20, $10, 8, 4, 2 }
|
||||
Constant (const dword[]) RADIX_OCTAL_VALUES_LONG#0 = { $40000000, $8000000, $1000000, $200000, $40000, $8000, $1000, $200, $40, 8 }
|
||||
Constant (const dword[]) RADIX_DECIMAL_VALUES_LONG#0 = { $3b9aca00, $5f5e100, $989680, $f4240, $186a0, $2710, $3e8, $64, $a }
|
||||
Constant (const dword[]) RADIX_HEXADECIMAL_VALUES_LONG#0 = { $10000000, $1000000, $100000, $10000, $1000, $100, $10 }
|
||||
Constant (const byte[]) DIGITS = $0
|
||||
Constant (const dword[]) RADIX_BINARY_VALUES_LONG = { $80000000, $40000000, $20000000, $10000000, $8000000, $4000000, $2000000, $1000000, $800000, $400000, $200000, $100000, $80000, $40000, $20000, $10000, $8000, $4000, $2000, $1000, $800, $400, $200, $100, $80, $40, $20, $10, 8, 4, 2 }
|
||||
Constant (const dword[]) RADIX_OCTAL_VALUES_LONG = { $40000000, $8000000, $1000000, $200000, $40000, $8000, $1000, $200, $40, 8 }
|
||||
Constant (const dword[]) RADIX_DECIMAL_VALUES_LONG = { $3b9aca00, $5f5e100, $989680, $f4240, $186a0, $2710, $3e8, $64, $a }
|
||||
Constant (const dword[]) RADIX_HEXADECIMAL_VALUES_LONG = { $10000000, $1000000, $100000, $10000, $1000, $100, $10 }
|
||||
Constant (const byte) ultoa::max_digits#0 = 0
|
||||
Constant (const dword*) ultoa::digit_values#0 = (dword*) 0
|
||||
Constant (const byte) ultoa::max_digits#1 = $a
|
||||
@ -1034,7 +1028,7 @@ Constant (const byte) ultoa::digit#0 = 0
|
||||
Constant (const byte) ultoa::started#1 = 1
|
||||
Constant (const byte) ultoa_append::digit#0 = 0
|
||||
Constant (const byte*) print_char_cursor#0 = (byte*) 1024
|
||||
Constant (const byte[$b]) decimal_digits_long#0 = { fill( $b, 0) }
|
||||
Constant (const byte[$b]) decimal_digits_long = { fill( $b, 0) }
|
||||
Constant (const byte) ultoa::radix#0 = DECIMAL
|
||||
Constant (const dword) jesper_id#0 = $1b244
|
||||
Constant (const byte[3]) jesper_initials#0 = $1
|
||||
@ -1042,12 +1036,12 @@ Constant (const dword) henry_id#0 = $4466d
|
||||
Constant (const byte[3]) henry_initials#0 = $2
|
||||
Constant (const byte) print_char::ch#0 = ' '
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant (const dword*) ultoa::digit_values#1 = RADIX_DECIMAL_VALUES_LONG#0
|
||||
Constant (const dword*) ultoa::digit_values#2 = RADIX_HEXADECIMAL_VALUES_LONG#0
|
||||
Constant (const dword*) ultoa::digit_values#3 = RADIX_OCTAL_VALUES_LONG#0
|
||||
Constant (const dword*) ultoa::digit_values#4 = RADIX_BINARY_VALUES_LONG#0
|
||||
Constant (const byte*) ultoa::buffer#5 = decimal_digits_long#0
|
||||
Constant (const byte*) print_str::str#1 = decimal_digits_long#0
|
||||
Constant (const dword*) ultoa::digit_values#1 = RADIX_DECIMAL_VALUES_LONG
|
||||
Constant (const dword*) ultoa::digit_values#2 = RADIX_HEXADECIMAL_VALUES_LONG
|
||||
Constant (const dword*) ultoa::digit_values#3 = RADIX_OCTAL_VALUES_LONG
|
||||
Constant (const dword*) ultoa::digit_values#4 = RADIX_BINARY_VALUES_LONG
|
||||
Constant (const byte*) ultoa::buffer#5 = decimal_digits_long
|
||||
Constant (const byte*) print_str::str#1 = decimal_digits_long
|
||||
Constant (const dword) print_person::person_id#0 = jesper_id#0
|
||||
Constant (const byte[3]) print_person::person_initials#0 = jesper_initials#0
|
||||
Constant (const dword) print_person::person_id#1 = henry_id#0
|
||||
@ -1107,9 +1101,9 @@ Eliminating unused constant (const dword*) ultoa::digit_values#2
|
||||
Eliminating unused constant (const dword*) ultoa::digit_values#3
|
||||
Eliminating unused constant (const dword*) ultoa::digit_values#4
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Eliminating unused constant (const dword[]) RADIX_BINARY_VALUES_LONG#0
|
||||
Eliminating unused constant (const dword[]) RADIX_OCTAL_VALUES_LONG#0
|
||||
Eliminating unused constant (const dword[]) RADIX_HEXADECIMAL_VALUES_LONG#0
|
||||
Eliminating unused constant (const dword[]) RADIX_BINARY_VALUES_LONG
|
||||
Eliminating unused constant (const dword[]) RADIX_OCTAL_VALUES_LONG
|
||||
Eliminating unused constant (const dword[]) RADIX_HEXADECIMAL_VALUES_LONG
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Rewriting multiplication to use shift [3] (byte~) ultoa::$11 ← (byte) ultoa::digit#2 * (const byte) SIZEOF_DWORD
|
||||
Successful SSA optimization Pass2MultiplyToShiftRewriting
|
||||
@ -1126,19 +1120,19 @@ Inlining constant with var siblings (const byte[3]) print_person::person_initial
|
||||
Inlining constant with var siblings (const byte*) print_char_cursor#0
|
||||
Constant inlined print_person::person_initials#1 = (const byte[3]) henry_initials#0
|
||||
Constant inlined ultoa::started#1 = (byte) 1
|
||||
Constant inlined $0 = (const byte[]) DIGITS#0
|
||||
Constant inlined $0 = (const byte[]) DIGITS
|
||||
Constant inlined $1 = (const byte[3]) jesper_initials#0
|
||||
Constant inlined $2 = (const byte[3]) henry_initials#0
|
||||
Constant inlined print_char_cursor#0 = (byte*) 1024
|
||||
Constant inlined ultoa::buffer#5 = (const byte[$b]) decimal_digits_long#0
|
||||
Constant inlined ultoa::buffer#5 = (const byte[$b]) decimal_digits_long
|
||||
Constant inlined print_person::person_id#1 = (const dword) henry_id#0
|
||||
Constant inlined print_person::person_id#0 = (const dword) jesper_id#0
|
||||
Constant inlined ultoa::$5 = (const byte) ultoa::max_digits#1-(byte) 1
|
||||
Constant inlined ultoa::started#0 = (byte) 0
|
||||
Constant inlined ultoa::digit#0 = (byte) 0
|
||||
Constant inlined ultoa_append::digit#0 = (byte) 0
|
||||
Constant inlined ultoa::digit_values#1 = (const dword[]) RADIX_DECIMAL_VALUES_LONG#0
|
||||
Constant inlined print_str::str#1 = (const byte[$b]) decimal_digits_long#0
|
||||
Constant inlined ultoa::digit_values#1 = (const dword[]) RADIX_DECIMAL_VALUES_LONG
|
||||
Constant inlined print_str::str#1 = (const byte[$b]) decimal_digits_long
|
||||
Constant inlined print_person::person_initials#0 = (const byte[3]) jesper_initials#0
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Eliminating unused constant (const byte) SIZEOF_DWORD
|
||||
@ -1294,7 +1288,7 @@ print_ln::@return: scope:[print_ln] from print_ln::@1
|
||||
(void()) print_str((byte*) print_str::str)
|
||||
print_str: scope:[print_str] from print_dword_decimal::@1 print_person::@2
|
||||
[24] (byte*) print_char_cursor#41 ← phi( print_dword_decimal::@1/(byte*) print_char_cursor#39 print_person::@2/(byte*) print_char_cursor#25 )
|
||||
[24] (byte*) print_str::str#5 ← phi( print_dword_decimal::@1/(const byte[$b]) decimal_digits_long#0 print_person::@2/(byte*) print_str::str#2 )
|
||||
[24] (byte*) print_str::str#5 ← phi( print_dword_decimal::@1/(const byte[$b]) decimal_digits_long print_person::@2/(byte*) print_str::str#2 )
|
||||
to:print_str::@1
|
||||
print_str::@1: scope:[print_str] from print_str print_str::@2
|
||||
[25] (byte*) print_char_cursor#18 ← phi( print_str/(byte*) print_char_cursor#41 print_str::@2/(byte*) print_char_cursor#1 )
|
||||
@ -1337,7 +1331,7 @@ ultoa: scope:[ultoa] from print_dword_decimal
|
||||
[39] phi()
|
||||
to:ultoa::@1
|
||||
ultoa::@1: scope:[ultoa] from ultoa ultoa::@4
|
||||
[40] (byte*) ultoa::buffer#11 ← phi( ultoa::@4/(byte*) ultoa::buffer#14 ultoa/(const byte[$b]) decimal_digits_long#0 )
|
||||
[40] (byte*) ultoa::buffer#11 ← phi( ultoa::@4/(byte*) ultoa::buffer#14 ultoa/(const byte[$b]) decimal_digits_long )
|
||||
[40] (byte) ultoa::started#2 ← phi( ultoa::@4/(byte) ultoa::started#4 ultoa/(byte) 0 )
|
||||
[40] (dword) ultoa::value#2 ← phi( ultoa::@4/(dword) ultoa::value#6 ultoa/(dword) ultoa::value#1 )
|
||||
[40] (byte) ultoa::digit#2 ← phi( ultoa::@4/(byte) ultoa::digit#1 ultoa/(byte) 0 )
|
||||
@ -1345,7 +1339,7 @@ ultoa::@1: scope:[ultoa] from ultoa ultoa::@4
|
||||
to:ultoa::@3
|
||||
ultoa::@3: scope:[ultoa] from ultoa::@1
|
||||
[42] (byte~) ultoa::$4 ← (byte)(dword) ultoa::value#2
|
||||
[43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS#0 + (byte~) ultoa::$4)
|
||||
[43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS + (byte~) ultoa::$4)
|
||||
[44] (byte*) ultoa::buffer#3 ← ++ (byte*) ultoa::buffer#11
|
||||
[45] *((byte*) ultoa::buffer#3) ← (byte) 0
|
||||
to:ultoa::@return
|
||||
@ -1354,7 +1348,7 @@ ultoa::@return: scope:[ultoa] from ultoa::@3
|
||||
to:@return
|
||||
ultoa::@2: scope:[ultoa] from ultoa::@1
|
||||
[47] (byte~) ultoa::$11 ← (byte) ultoa::digit#2 << (byte) 2
|
||||
[48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG#0 + (byte~) ultoa::$11)
|
||||
[48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG + (byte~) ultoa::$11)
|
||||
[49] if((byte) 0!=(byte) ultoa::started#2) goto ultoa::@5
|
||||
to:ultoa::@7
|
||||
ultoa::@7: scope:[ultoa] from ultoa::@2
|
||||
@ -1388,7 +1382,7 @@ ultoa_append::@1: scope:[ultoa_append] from ultoa_append ultoa_append::@2
|
||||
[62] if((dword) ultoa_append::value#2>=(dword) ultoa_append::sub#0) goto ultoa_append::@2
|
||||
to:ultoa_append::@3
|
||||
ultoa_append::@3: scope:[ultoa_append] from ultoa_append::@1
|
||||
[63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS#0 + (byte) ultoa_append::digit#2)
|
||||
[63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS + (byte) ultoa_append::digit#2)
|
||||
to:ultoa_append::@return
|
||||
ultoa_append::@return: scope:[ultoa_append] from ultoa_append::@3
|
||||
[64] return
|
||||
@ -1400,14 +1394,8 @@ ultoa_append::@2: scope:[ultoa_append] from ultoa_append::@1
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(byte[]) DIGITS
|
||||
(dword) Person::id
|
||||
(byte[3]) Person::initials
|
||||
(dword[]) RADIX_BINARY_VALUES_LONG
|
||||
(dword[]) RADIX_DECIMAL_VALUES_LONG
|
||||
(dword[]) RADIX_HEXADECIMAL_VALUES_LONG
|
||||
(dword[]) RADIX_OCTAL_VALUES_LONG
|
||||
(byte[$b]) decimal_digits_long
|
||||
(dword) henry_id
|
||||
(byte[3]) henry_initials
|
||||
(dword) jesper_id
|
||||
@ -1808,7 +1796,7 @@ print_dword_decimal: {
|
||||
// [24] phi from print_dword_decimal::@1 to print_str [phi:print_dword_decimal::@1->print_str]
|
||||
print_str_from_b1:
|
||||
// [24] phi (byte*) print_char_cursor#41 = (byte*) print_char_cursor#39 [phi:print_dword_decimal::@1->print_str#0] -- register_copy
|
||||
// [24] phi (byte*) print_str::str#5 = (const byte[$b]) decimal_digits_long#0 [phi:print_dword_decimal::@1->print_str#1] -- pbuz1=pbuc1
|
||||
// [24] phi (byte*) print_str::str#5 = (const byte[$b]) decimal_digits_long [phi:print_dword_decimal::@1->print_str#1] -- pbuz1=pbuc1
|
||||
lda #<decimal_digits_long
|
||||
sta.z print_str.str
|
||||
lda #>decimal_digits_long
|
||||
@ -1841,7 +1829,7 @@ ultoa: {
|
||||
.label buffer_14 = $14
|
||||
// [40] phi from ultoa to ultoa::@1 [phi:ultoa->ultoa::@1]
|
||||
b1_from_ultoa:
|
||||
// [40] phi (byte*) ultoa::buffer#11 = (const byte[$b]) decimal_digits_long#0 [phi:ultoa->ultoa::@1#0] -- pbuz1=pbuc1
|
||||
// [40] phi (byte*) ultoa::buffer#11 = (const byte[$b]) decimal_digits_long [phi:ultoa->ultoa::@1#0] -- pbuz1=pbuc1
|
||||
lda #<decimal_digits_long
|
||||
sta.z buffer_11
|
||||
lda #>decimal_digits_long
|
||||
@ -1866,7 +1854,7 @@ ultoa: {
|
||||
// [42] (byte~) ultoa::$4 ← (byte)(dword) ultoa::value#2 -- vbuz1=_byte_vduz2
|
||||
lda.z value
|
||||
sta.z _4
|
||||
// [43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS#0 + (byte~) ultoa::$4) -- _deref_pbuz1=pbuc1_derefidx_vbuz2
|
||||
// [43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS + (byte~) ultoa::$4) -- _deref_pbuz1=pbuc1_derefidx_vbuz2
|
||||
ldy.z _4
|
||||
lda DIGITS,y
|
||||
ldy #0
|
||||
@ -1895,7 +1883,7 @@ ultoa: {
|
||||
asl
|
||||
asl
|
||||
sta.z _11
|
||||
// [48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG#0 + (byte~) ultoa::$11) -- vduz1=pduc1_derefidx_vbuz2
|
||||
// [48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG + (byte~) ultoa::$11) -- vduz1=pduc1_derefidx_vbuz2
|
||||
ldy.z _11
|
||||
lda RADIX_DECIMAL_VALUES_LONG,y
|
||||
sta.z digit_value
|
||||
@ -2055,7 +2043,7 @@ ultoa_append: {
|
||||
jmp b3
|
||||
// ultoa_append::@3
|
||||
b3:
|
||||
// [63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS#0 + (byte) ultoa_append::digit#2) -- _deref_pbuz1=pbuc1_derefidx_vbuz2
|
||||
// [63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS + (byte) ultoa_append::digit#2) -- _deref_pbuz1=pbuc1_derefidx_vbuz2
|
||||
ldy.z digit
|
||||
lda DIGITS,y
|
||||
ldy #0
|
||||
@ -2112,13 +2100,13 @@ Statement [28] *((byte*) print_char_cursor#18) ← *((byte*) print_str::str#3) [
|
||||
Statement [31] *((byte*) print_char_cursor#18) ← (const byte) print_char::ch#0 [ print_char_cursor#18 ] ( main:2::print_person:5::print_char:13 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#18 ] main:2::print_person:7::print_char:13 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#18 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [34] (dword) ultoa::value#1 ← (dword) print_dword_decimal::w#0 [ print_char_cursor#39 ultoa::value#1 ] ( main:2::print_person:5::print_dword_decimal:11 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::value#1 ] main:2::print_person:7::print_dword_decimal:11 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::value#1 ] ) always clobbers reg byte a
|
||||
Statement [42] (byte~) ultoa::$4 ← (byte)(dword) ultoa::value#2 [ ultoa::buffer#11 ultoa::$4 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#11 ultoa::$4 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#11 ultoa::$4 ] ) always clobbers reg byte a
|
||||
Statement [43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS#0 + (byte~) ultoa::$4) [ ultoa::buffer#11 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#11 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#11 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS + (byte~) ultoa::$4) [ ultoa::buffer#11 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#11 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#11 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [44] (byte*) ultoa::buffer#3 ← ++ (byte*) ultoa::buffer#11 [ ultoa::buffer#3 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#3 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#3 ] ) always clobbers reg byte a
|
||||
Statement [45] *((byte*) ultoa::buffer#3) ← (byte) 0 [ ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [47] (byte~) ultoa::$11 ← (byte) ultoa::digit#2 << (byte) 2 [ ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::$11 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::$11 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::$11 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:14 [ ultoa::digit#2 ultoa::digit#1 ]
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:19 [ ultoa::started#2 ultoa::started#4 ]
|
||||
Statement [48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG#0 + (byte~) ultoa::$11) [ ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] ) always clobbers reg byte a
|
||||
Statement [48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG + (byte~) ultoa::$11) [ ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] ) always clobbers reg byte a
|
||||
Statement [50] if((dword) ultoa::value#2>=(dword) ultoa::digit_value#0) goto ultoa::@5 [ ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] ) always clobbers reg byte a
|
||||
Statement [53] (byte*) ultoa_append::buffer#0 ← (byte*) ultoa::buffer#11 [ ultoa::digit#2 ultoa::value#2 ultoa::buffer#11 ultoa::digit_value#0 ultoa_append::buffer#0 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::buffer#11 ultoa::digit_value#0 ultoa_append::buffer#0 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::buffer#11 ultoa::digit_value#0 ultoa_append::buffer#0 ] ) always clobbers reg byte a
|
||||
Statement [54] (dword) ultoa_append::value#0 ← (dword) ultoa::value#2 [ ultoa::digit#2 ultoa::buffer#11 ultoa::digit_value#0 ultoa_append::buffer#0 ultoa_append::value#0 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa::digit_value#0 ultoa_append::buffer#0 ultoa_append::value#0 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa::digit_value#0 ultoa_append::buffer#0 ultoa_append::value#0 ] ) always clobbers reg byte a
|
||||
@ -2127,7 +2115,7 @@ Statement [57] (dword) ultoa_append::return#0 ← (dword) ultoa_append::value#2
|
||||
Statement [58] (dword) ultoa::value#0 ← (dword) ultoa_append::return#0 [ ultoa::digit#2 ultoa::buffer#11 ultoa::value#0 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa::value#0 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa::value#0 ] ) always clobbers reg byte a
|
||||
Statement [62] if((dword) ultoa_append::value#2>=(dword) ultoa_append::sub#0) goto ultoa_append::@2 [ ultoa_append::buffer#0 ultoa_append::sub#0 ultoa_append::value#2 ultoa_append::digit#2 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::buffer#0 ultoa_append::sub#0 ultoa_append::value#2 ultoa_append::digit#2 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::buffer#0 ultoa_append::sub#0 ultoa_append::value#2 ultoa_append::digit#2 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:26 [ ultoa_append::digit#2 ultoa_append::digit#1 ]
|
||||
Statement [63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS#0 + (byte) ultoa_append::digit#2) [ ultoa_append::value#2 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::value#2 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::value#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS + (byte) ultoa_append::digit#2) [ ultoa_append::value#2 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::value#2 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::value#2 ] ) always clobbers reg byte a reg byte y
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:14 [ ultoa::digit#2 ultoa::digit#1 ]
|
||||
Statement [66] (dword) ultoa_append::value#1 ← (dword) ultoa_append::value#2 - (dword) ultoa_append::sub#0 [ ultoa_append::buffer#0 ultoa_append::sub#0 ultoa_append::value#1 ultoa_append::digit#1 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::buffer#0 ultoa_append::sub#0 ultoa_append::value#1 ultoa_append::digit#1 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::buffer#0 ultoa_append::sub#0 ultoa_append::value#1 ultoa_append::digit#1 ] ) always clobbers reg byte a
|
||||
Statement [6] (byte*~) print_char_cursor#49 ← (byte*) print_line_cursor#1 [ print_char_cursor#49 print_line_cursor#1 ] ( main:2 [ print_char_cursor#49 print_line_cursor#1 ] ) always clobbers reg byte a
|
||||
@ -2140,11 +2128,11 @@ Statement [28] *((byte*) print_char_cursor#18) ← *((byte*) print_str::str#3) [
|
||||
Statement [31] *((byte*) print_char_cursor#18) ← (const byte) print_char::ch#0 [ print_char_cursor#18 ] ( main:2::print_person:5::print_char:13 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#18 ] main:2::print_person:7::print_char:13 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#18 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [34] (dword) ultoa::value#1 ← (dword) print_dword_decimal::w#0 [ print_char_cursor#39 ultoa::value#1 ] ( main:2::print_person:5::print_dword_decimal:11 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::value#1 ] main:2::print_person:7::print_dword_decimal:11 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::value#1 ] ) always clobbers reg byte a
|
||||
Statement [42] (byte~) ultoa::$4 ← (byte)(dword) ultoa::value#2 [ ultoa::buffer#11 ultoa::$4 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#11 ultoa::$4 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#11 ultoa::$4 ] ) always clobbers reg byte a
|
||||
Statement [43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS#0 + (byte~) ultoa::$4) [ ultoa::buffer#11 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#11 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#11 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS + (byte~) ultoa::$4) [ ultoa::buffer#11 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#11 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#11 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [44] (byte*) ultoa::buffer#3 ← ++ (byte*) ultoa::buffer#11 [ ultoa::buffer#3 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#3 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::buffer#3 ] ) always clobbers reg byte a
|
||||
Statement [45] *((byte*) ultoa::buffer#3) ← (byte) 0 [ ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [47] (byte~) ultoa::$11 ← (byte) ultoa::digit#2 << (byte) 2 [ ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::$11 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::$11 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::$11 ] ) always clobbers reg byte a
|
||||
Statement [48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG#0 + (byte~) ultoa::$11) [ ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] ) always clobbers reg byte a
|
||||
Statement [48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG + (byte~) ultoa::$11) [ ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] ) always clobbers reg byte a
|
||||
Statement [50] if((dword) ultoa::value#2>=(dword) ultoa::digit_value#0) goto ultoa::@5 [ ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::started#2 ultoa::buffer#11 ultoa::digit_value#0 ] ) always clobbers reg byte a
|
||||
Statement [53] (byte*) ultoa_append::buffer#0 ← (byte*) ultoa::buffer#11 [ ultoa::digit#2 ultoa::value#2 ultoa::buffer#11 ultoa::digit_value#0 ultoa_append::buffer#0 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::buffer#11 ultoa::digit_value#0 ultoa_append::buffer#0 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::value#2 ultoa::buffer#11 ultoa::digit_value#0 ultoa_append::buffer#0 ] ) always clobbers reg byte a
|
||||
Statement [54] (dword) ultoa_append::value#0 ← (dword) ultoa::value#2 [ ultoa::digit#2 ultoa::buffer#11 ultoa::digit_value#0 ultoa_append::buffer#0 ultoa_append::value#0 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa::digit_value#0 ultoa_append::buffer#0 ultoa_append::value#0 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa::digit_value#0 ultoa_append::buffer#0 ultoa_append::value#0 ] ) always clobbers reg byte a
|
||||
@ -2152,7 +2140,7 @@ Statement [55] (dword) ultoa_append::sub#0 ← (dword) ultoa::digit_value#0 [ ul
|
||||
Statement [57] (dword) ultoa_append::return#0 ← (dword) ultoa_append::value#2 [ ultoa::digit#2 ultoa::buffer#11 ultoa_append::return#0 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::return#0 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::return#0 ] ) always clobbers reg byte a
|
||||
Statement [58] (dword) ultoa::value#0 ← (dword) ultoa_append::return#0 [ ultoa::digit#2 ultoa::buffer#11 ultoa::value#0 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa::value#0 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa::value#0 ] ) always clobbers reg byte a
|
||||
Statement [62] if((dword) ultoa_append::value#2>=(dword) ultoa_append::sub#0) goto ultoa_append::@2 [ ultoa_append::buffer#0 ultoa_append::sub#0 ultoa_append::value#2 ultoa_append::digit#2 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::buffer#0 ultoa_append::sub#0 ultoa_append::value#2 ultoa_append::digit#2 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::buffer#0 ultoa_append::sub#0 ultoa_append::value#2 ultoa_append::digit#2 ] ) always clobbers reg byte a
|
||||
Statement [63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS#0 + (byte) ultoa_append::digit#2) [ ultoa_append::value#2 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::value#2 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::value#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS + (byte) ultoa_append::digit#2) [ ultoa_append::value#2 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::value#2 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::value#2 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [66] (dword) ultoa_append::value#1 ← (dword) ultoa_append::value#2 - (dword) ultoa_append::sub#0 [ ultoa_append::buffer#0 ultoa_append::sub#0 ultoa_append::value#1 ultoa_append::digit#1 ] ( main:2::print_person:5::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::buffer#0 ultoa_append::sub#0 ultoa_append::value#1 ultoa_append::digit#1 ] main:2::print_person:7::print_dword_decimal:11::ultoa:35::ultoa_append:56 [ print_person::person_initials#2 print_line_cursor#20 print_char_cursor#39 ultoa::digit#2 ultoa::buffer#11 ultoa_append::buffer#0 ultoa_append::sub#0 ultoa_append::value#1 ultoa_append::digit#1 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_DWORD:2 [ print_person::person_id#2 ] : zp ZP_DWORD:2 ,
|
||||
Potential registers zp ZP_WORD:6 [ print_person::person_initials#2 ] : zp ZP_WORD:6 ,
|
||||
@ -2462,7 +2450,7 @@ print_dword_decimal: {
|
||||
// [24] phi from print_dword_decimal::@1 to print_str [phi:print_dword_decimal::@1->print_str]
|
||||
print_str_from_b1:
|
||||
// [24] phi (byte*) print_char_cursor#41 = (byte*) print_char_cursor#39 [phi:print_dword_decimal::@1->print_str#0] -- register_copy
|
||||
// [24] phi (byte*) print_str::str#5 = (const byte[$b]) decimal_digits_long#0 [phi:print_dword_decimal::@1->print_str#1] -- pbuz1=pbuc1
|
||||
// [24] phi (byte*) print_str::str#5 = (const byte[$b]) decimal_digits_long [phi:print_dword_decimal::@1->print_str#1] -- pbuz1=pbuc1
|
||||
lda #<decimal_digits_long
|
||||
sta.z print_str.str
|
||||
lda #>decimal_digits_long
|
||||
@ -2489,7 +2477,7 @@ ultoa: {
|
||||
.label value = 2
|
||||
// [40] phi from ultoa to ultoa::@1 [phi:ultoa->ultoa::@1]
|
||||
b1_from_ultoa:
|
||||
// [40] phi (byte*) ultoa::buffer#11 = (const byte[$b]) decimal_digits_long#0 [phi:ultoa->ultoa::@1#0] -- pbuz1=pbuc1
|
||||
// [40] phi (byte*) ultoa::buffer#11 = (const byte[$b]) decimal_digits_long [phi:ultoa->ultoa::@1#0] -- pbuz1=pbuc1
|
||||
lda #<decimal_digits_long
|
||||
sta.z buffer
|
||||
lda #>decimal_digits_long
|
||||
@ -2512,7 +2500,7 @@ ultoa: {
|
||||
b3:
|
||||
// [42] (byte~) ultoa::$4 ← (byte)(dword) ultoa::value#2 -- vbuaa=_byte_vduz1
|
||||
lda.z value
|
||||
// [43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS#0 + (byte~) ultoa::$4) -- _deref_pbuz1=pbuc1_derefidx_vbuaa
|
||||
// [43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS + (byte~) ultoa::$4) -- _deref_pbuz1=pbuc1_derefidx_vbuaa
|
||||
tay
|
||||
lda DIGITS,y
|
||||
ldy #0
|
||||
@ -2537,7 +2525,7 @@ ultoa: {
|
||||
lda.z digit
|
||||
asl
|
||||
asl
|
||||
// [48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG#0 + (byte~) ultoa::$11) -- vduz1=pduc1_derefidx_vbuaa
|
||||
// [48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG + (byte~) ultoa::$11) -- vduz1=pduc1_derefidx_vbuaa
|
||||
tay
|
||||
lda RADIX_DECIMAL_VALUES_LONG,y
|
||||
sta.z digit_value
|
||||
@ -2657,7 +2645,7 @@ ultoa_append: {
|
||||
jmp b3
|
||||
// ultoa_append::@3
|
||||
b3:
|
||||
// [63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS#0 + (byte) ultoa_append::digit#2) -- _deref_pbuz1=pbuc1_derefidx_vbuxx
|
||||
// [63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS + (byte) ultoa_append::digit#2) -- _deref_pbuz1=pbuc1_derefidx_vbuxx
|
||||
lda DIGITS,x
|
||||
ldy #0
|
||||
sta (buffer),y
|
||||
@ -2789,21 +2777,15 @@ FINAL SYMBOL TABLE
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte[]) DIGITS
|
||||
(const byte[]) DIGITS#0 DIGITS = (string) "0123456789abcdef"z
|
||||
(const byte[]) DIGITS DIGITS = (string) "0123456789abcdef"z
|
||||
(dword) Person::id
|
||||
(byte[3]) Person::initials
|
||||
(const byte) RADIX::BINARY BINARY = (number) 2
|
||||
(const byte) RADIX::DECIMAL DECIMAL = (number) $a
|
||||
(const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10
|
||||
(const byte) RADIX::OCTAL OCTAL = (number) 8
|
||||
(dword[]) RADIX_BINARY_VALUES_LONG
|
||||
(dword[]) RADIX_DECIMAL_VALUES_LONG
|
||||
(const dword[]) RADIX_DECIMAL_VALUES_LONG#0 RADIX_DECIMAL_VALUES_LONG = { (dword) $3b9aca00, (dword) $5f5e100, (dword) $989680, (dword) $f4240, (dword) $186a0, (dword) $2710, (dword) $3e8, (dword) $64, (dword) $a }
|
||||
(dword[]) RADIX_HEXADECIMAL_VALUES_LONG
|
||||
(dword[]) RADIX_OCTAL_VALUES_LONG
|
||||
(byte[$b]) decimal_digits_long
|
||||
(const byte[$b]) decimal_digits_long#0 decimal_digits_long = { fill( $b, 0) }
|
||||
(const dword[]) RADIX_DECIMAL_VALUES_LONG RADIX_DECIMAL_VALUES_LONG = { (dword) $3b9aca00, (dword) $5f5e100, (dword) $989680, (dword) $f4240, (dword) $186a0, (dword) $2710, (dword) $3e8, (dword) $64, (dword) $a }
|
||||
(const byte[$b]) decimal_digits_long decimal_digits_long = { fill( $b, 0) }
|
||||
(dword) henry_id
|
||||
(const dword) henry_id#0 henry_id = (dword) $4466d
|
||||
(byte[3]) henry_initials
|
||||
@ -3149,7 +3131,7 @@ print_dword_decimal: {
|
||||
// [37] call print_str
|
||||
// [24] phi from print_dword_decimal::@1 to print_str [phi:print_dword_decimal::@1->print_str]
|
||||
// [24] phi (byte*) print_char_cursor#41 = (byte*) print_char_cursor#39 [phi:print_dword_decimal::@1->print_str#0] -- register_copy
|
||||
// [24] phi (byte*) print_str::str#5 = (const byte[$b]) decimal_digits_long#0 [phi:print_dword_decimal::@1->print_str#1] -- pbuz1=pbuc1
|
||||
// [24] phi (byte*) print_str::str#5 = (const byte[$b]) decimal_digits_long [phi:print_dword_decimal::@1->print_str#1] -- pbuz1=pbuc1
|
||||
lda #<decimal_digits_long
|
||||
sta.z print_str.str
|
||||
lda #>decimal_digits_long
|
||||
@ -3174,7 +3156,7 @@ ultoa: {
|
||||
.label digit = $c
|
||||
.label value = 2
|
||||
// [40] phi from ultoa to ultoa::@1 [phi:ultoa->ultoa::@1]
|
||||
// [40] phi (byte*) ultoa::buffer#11 = (const byte[$b]) decimal_digits_long#0 [phi:ultoa->ultoa::@1#0] -- pbuz1=pbuc1
|
||||
// [40] phi (byte*) ultoa::buffer#11 = (const byte[$b]) decimal_digits_long [phi:ultoa->ultoa::@1#0] -- pbuz1=pbuc1
|
||||
lda #<decimal_digits_long
|
||||
sta.z buffer
|
||||
lda #>decimal_digits_long
|
||||
@ -3197,7 +3179,7 @@ ultoa: {
|
||||
// [42] (byte~) ultoa::$4 ← (byte)(dword) ultoa::value#2 -- vbuaa=_byte_vduz1
|
||||
lda.z value
|
||||
// *buffer++ = DIGITS[(char)value]
|
||||
// [43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS#0 + (byte~) ultoa::$4) -- _deref_pbuz1=pbuc1_derefidx_vbuaa
|
||||
// [43] *((byte*) ultoa::buffer#11) ← *((const byte[]) DIGITS + (byte~) ultoa::$4) -- _deref_pbuz1=pbuc1_derefidx_vbuaa
|
||||
tay
|
||||
lda DIGITS,y
|
||||
ldy #0
|
||||
@ -3224,7 +3206,7 @@ ultoa: {
|
||||
lda.z digit
|
||||
asl
|
||||
asl
|
||||
// [48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG#0 + (byte~) ultoa::$11) -- vduz1=pduc1_derefidx_vbuaa
|
||||
// [48] (dword) ultoa::digit_value#0 ← *((const dword[]) RADIX_DECIMAL_VALUES_LONG + (byte~) ultoa::$11) -- vduz1=pduc1_derefidx_vbuaa
|
||||
tay
|
||||
lda RADIX_DECIMAL_VALUES_LONG,y
|
||||
sta.z digit_value
|
||||
@ -3339,7 +3321,7 @@ ultoa_append: {
|
||||
!:
|
||||
// ultoa_append::@3
|
||||
// *buffer = DIGITS[digit]
|
||||
// [63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS#0 + (byte) ultoa_append::digit#2) -- _deref_pbuz1=pbuc1_derefidx_vbuxx
|
||||
// [63] *((byte*) ultoa_append::buffer#0) ← *((const byte[]) DIGITS + (byte) ultoa_append::digit#2) -- _deref_pbuz1=pbuc1_derefidx_vbuxx
|
||||
lda DIGITS,x
|
||||
ldy #0
|
||||
sta (buffer),y
|
||||
|
@ -1,21 +1,15 @@
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte[]) DIGITS
|
||||
(const byte[]) DIGITS#0 DIGITS = (string) "0123456789abcdef"z
|
||||
(const byte[]) DIGITS DIGITS = (string) "0123456789abcdef"z
|
||||
(dword) Person::id
|
||||
(byte[3]) Person::initials
|
||||
(const byte) RADIX::BINARY BINARY = (number) 2
|
||||
(const byte) RADIX::DECIMAL DECIMAL = (number) $a
|
||||
(const byte) RADIX::HEXADECIMAL HEXADECIMAL = (number) $10
|
||||
(const byte) RADIX::OCTAL OCTAL = (number) 8
|
||||
(dword[]) RADIX_BINARY_VALUES_LONG
|
||||
(dword[]) RADIX_DECIMAL_VALUES_LONG
|
||||
(const dword[]) RADIX_DECIMAL_VALUES_LONG#0 RADIX_DECIMAL_VALUES_LONG = { (dword) $3b9aca00, (dword) $5f5e100, (dword) $989680, (dword) $f4240, (dword) $186a0, (dword) $2710, (dword) $3e8, (dword) $64, (dword) $a }
|
||||
(dword[]) RADIX_HEXADECIMAL_VALUES_LONG
|
||||
(dword[]) RADIX_OCTAL_VALUES_LONG
|
||||
(byte[$b]) decimal_digits_long
|
||||
(const byte[$b]) decimal_digits_long#0 decimal_digits_long = { fill( $b, 0) }
|
||||
(const dword[]) RADIX_DECIMAL_VALUES_LONG RADIX_DECIMAL_VALUES_LONG = { (dword) $3b9aca00, (dword) $5f5e100, (dword) $989680, (dword) $f4240, (dword) $186a0, (dword) $2710, (dword) $3e8, (dword) $64, (dword) $a }
|
||||
(const byte[$b]) decimal_digits_long decimal_digits_long = { fill( $b, 0) }
|
||||
(dword) henry_id
|
||||
(const dword) henry_id#0 henry_id = (dword) $4466d
|
||||
(byte[3]) henry_initials
|
||||
|
@ -24,21 +24,21 @@ main::@return: scope:[main] from main::@1
|
||||
(void()) print_person((struct Person*) print_person::person)
|
||||
print_person: scope:[print_person] from main main::@1
|
||||
[9] (byte) idx#15 ← phi( main/(byte) 0 main::@1/(byte) idx#10 )
|
||||
[9] (struct Person*) print_person::person#2 ← phi( main/(const struct Person[]) persons#0 main::@1/(const struct Person*) main::person#1 )
|
||||
[9] (struct Person*) print_person::person#2 ← phi( main/(const struct Person[]) persons main::@1/(const struct Person*) main::person#1 )
|
||||
[10] (byte~) print_person::$0 ← (byte) '0' + *((byte*)(struct Person*) print_person::person#2)
|
||||
[11] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte~) print_person::$0
|
||||
[11] *((const byte*) SCREEN + (byte) idx#15) ← (byte~) print_person::$0
|
||||
[12] (byte) idx#4 ← ++ (byte) idx#15
|
||||
[13] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' '
|
||||
[13] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' '
|
||||
[14] (byte) idx#5 ← ++ (byte) idx#4
|
||||
[15] *((const byte*) SCREEN#0 + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS)
|
||||
[15] *((const byte*) SCREEN + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS)
|
||||
[16] (byte) idx#6 ← ++ (byte) idx#5
|
||||
[17] (byte[4]) print_person::$3 ← (byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS
|
||||
[18] *((const byte*) SCREEN#0 + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1)
|
||||
[18] *((const byte*) SCREEN + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1)
|
||||
[19] (byte) idx#7 ← ++ (byte) idx#6
|
||||
[20] (byte[4]) print_person::$4 ← (byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS
|
||||
[21] *((const byte*) SCREEN#0 + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2)
|
||||
[21] *((const byte*) SCREEN + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2)
|
||||
[22] (byte) idx#8 ← ++ (byte) idx#7
|
||||
[23] *((const byte*) SCREEN#0 + (byte) idx#8) ← (byte) ' '
|
||||
[23] *((const byte*) SCREEN + (byte) idx#8) ← (byte) ' '
|
||||
[24] (byte) idx#10 ← ++ (byte) idx#8
|
||||
to:print_person::@return
|
||||
print_person::@return: scope:[print_person] from print_person
|
||||
|
@ -9,13 +9,13 @@ Rewriting struct pointer member access *((struct Person*) print_person::person).
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@begin: scope:[] from
|
||||
(struct Person[]) persons#0 ← { { (number) 1, (const string) $0 }, { (number) 8, (const string) $1 } }
|
||||
(struct Person[]) persons ← { { (number) 1, (const string) $0 }, { (number) 8, (const string) $1 } }
|
||||
to:@1
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @2
|
||||
(byte) idx#18 ← phi( @2/(byte) idx#19 )
|
||||
(struct Person*) main::person#0 ← (struct Person[]) persons#0
|
||||
(struct Person*) main::person#0 ← (struct Person[]) persons
|
||||
(struct Person*) print_person::person#0 ← (struct Person*) main::person#0
|
||||
call print_person
|
||||
to:main::@1
|
||||
@ -37,7 +37,7 @@ main::@return: scope:[main] from main::@2
|
||||
return
|
||||
to:@return
|
||||
@1: scope:[] from @begin
|
||||
(byte*) SCREEN#0 ← ((byte*)) (number) $400
|
||||
(byte*) SCREEN ← ((byte*)) (number) $400
|
||||
(byte) idx#3 ← (number) 0
|
||||
to:@2
|
||||
|
||||
@ -47,20 +47,20 @@ print_person: scope:[print_person] from main main::@1
|
||||
(struct Person*) print_person::person#2 ← phi( main/(struct Person*) print_person::person#0 main::@1/(struct Person*) print_person::person#1 )
|
||||
(byte*) print_person::$1 ← (byte*)(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
(byte~) print_person::$0 ← (byte) '0' + *((byte*) print_person::$1)
|
||||
*((byte*) SCREEN#0 + (byte) idx#15) ← (byte~) print_person::$0
|
||||
*((byte*) SCREEN + (byte) idx#15) ← (byte~) print_person::$0
|
||||
(byte) idx#4 ← ++ (byte) idx#15
|
||||
*((byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' '
|
||||
*((byte*) SCREEN + (byte) idx#4) ← (byte) ' '
|
||||
(byte) idx#5 ← ++ (byte) idx#4
|
||||
(byte[4]) print_person::$2 ← (byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS
|
||||
*((byte*) SCREEN#0 + (byte) idx#5) ← *((byte[4]) print_person::$2 + (number) 0)
|
||||
*((byte*) SCREEN + (byte) idx#5) ← *((byte[4]) print_person::$2 + (number) 0)
|
||||
(byte) idx#6 ← ++ (byte) idx#5
|
||||
(byte[4]) print_person::$3 ← (byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS
|
||||
*((byte*) SCREEN#0 + (byte) idx#6) ← *((byte[4]) print_person::$3 + (number) 1)
|
||||
*((byte*) SCREEN + (byte) idx#6) ← *((byte[4]) print_person::$3 + (number) 1)
|
||||
(byte) idx#7 ← ++ (byte) idx#6
|
||||
(byte[4]) print_person::$4 ← (byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS
|
||||
*((byte*) SCREEN#0 + (byte) idx#7) ← *((byte[4]) print_person::$4 + (number) 2)
|
||||
*((byte*) SCREEN + (byte) idx#7) ← *((byte[4]) print_person::$4 + (number) 2)
|
||||
(byte) idx#8 ← ++ (byte) idx#7
|
||||
*((byte*) SCREEN#0 + (byte) idx#8) ← (byte) ' '
|
||||
*((byte*) SCREEN + (byte) idx#8) ← (byte) ' '
|
||||
(byte) idx#9 ← ++ (byte) idx#8
|
||||
to:print_person::@return
|
||||
print_person::@return: scope:[print_person] from print_person
|
||||
@ -91,7 +91,6 @@ SYMBOL TABLE SSA
|
||||
(byte) Person::id
|
||||
(byte[4]) Person::initials
|
||||
(byte*) SCREEN
|
||||
(byte*) SCREEN#0
|
||||
(const byte) SIZEOF_STRUCT_PERSON = (byte) 5
|
||||
(byte) idx
|
||||
(byte) idx#0
|
||||
@ -123,7 +122,6 @@ SYMBOL TABLE SSA
|
||||
(struct Person*) main::person#1
|
||||
(struct Person*) main::person#2
|
||||
(struct Person[]) persons
|
||||
(struct Person[]) persons#0
|
||||
(void()) print_person((struct Person*) print_person::person)
|
||||
(byte~) print_person::$0
|
||||
(byte*) print_person::$1
|
||||
@ -137,13 +135,13 @@ SYMBOL TABLE SSA
|
||||
(struct Person*) print_person::person#2
|
||||
|
||||
Adding number conversion cast (unumber) 0 in (byte) idx#3 ← (number) 0
|
||||
Adding number conversion cast (unumber) 0 in *((byte*) SCREEN#0 + (byte) idx#5) ← *((byte[4]) print_person::$2 + (number) 0)
|
||||
Adding number conversion cast (unumber) 1 in *((byte*) SCREEN#0 + (byte) idx#6) ← *((byte[4]) print_person::$3 + (number) 1)
|
||||
Adding number conversion cast (unumber) 2 in *((byte*) SCREEN#0 + (byte) idx#7) ← *((byte[4]) print_person::$4 + (number) 2)
|
||||
Adding number conversion cast (unumber) 0 in *((byte*) SCREEN + (byte) idx#5) ← *((byte[4]) print_person::$2 + (number) 0)
|
||||
Adding number conversion cast (unumber) 1 in *((byte*) SCREEN + (byte) idx#6) ← *((byte[4]) print_person::$3 + (number) 1)
|
||||
Adding number conversion cast (unumber) 2 in *((byte*) SCREEN + (byte) idx#7) ← *((byte[4]) print_person::$4 + (number) 2)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Added casts to value list in (struct Person[]) persons#0 ← (struct Person[]){ (struct Person){ (byte)(number) 1, (const string) $0 }, (struct Person){ (byte)(number) 8, (const string) $1 } }
|
||||
Added casts to value list in (struct Person[]) persons ← (struct Person[]){ (struct Person){ (byte)(number) 1, (const string) $0 }, (struct Person){ (byte)(number) 8, (const string) $1 } }
|
||||
Successful SSA optimization PassNAddInitializerValueListTypeCasts
|
||||
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
|
||||
Inlining cast (byte*) SCREEN ← (byte*)(number) $400
|
||||
Inlining cast (byte) idx#3 ← (unumber)(number) 0
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant integer cast 1
|
||||
@ -176,11 +174,11 @@ Identified constant from value list (struct Person) { id: (byte) 8, initials: (c
|
||||
Successful SSA optimization Pass2ConstantInitializerValueLists
|
||||
Identified constant from value list (struct Person[]) { { id: (byte) 1, initials: (const string) $0 }, { id: (byte) 8, initials: (const string) $1 } }
|
||||
Successful SSA optimization Pass2ConstantInitializerValueLists
|
||||
Constant (const struct Person[]) persons#0 = { { id: 1, initials: $0 }, { id: 8, initials: $1 } }
|
||||
Constant (const byte*) SCREEN#0 = (byte*) 1024
|
||||
Constant (const struct Person[]) persons = { { id: 1, initials: $0 }, { id: 8, initials: $1 } }
|
||||
Constant (const byte*) SCREEN = (byte*) 1024
|
||||
Constant (const byte) idx#19 = 0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant (const struct Person*) main::person#0 = persons#0
|
||||
Constant (const struct Person*) main::person#0 = persons
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant (const struct Person*) print_person::person#0 = main::person#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
@ -188,7 +186,7 @@ Converting *(pointer+n) to pointer[n] [19] (byte~) print_person::$0 ← (byte) '
|
||||
Successful SSA optimization Pass2InlineDerefIdx
|
||||
Simplifying expression containing zero (byte*)print_person::person#2 in [18] (byte*) print_person::$1 ← (byte*)(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
Simplifying expression containing zero (byte*)print_person::person#2 in [19] (byte~) print_person::$0 ← (byte) '0' + *((byte*)(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_ID)
|
||||
Simplifying expression containing zero print_person::$2 in [25] *((const byte*) SCREEN#0 + (byte) idx#5) ← *((byte[4]) print_person::$2 + (byte) 0)
|
||||
Simplifying expression containing zero print_person::$2 in [25] *((const byte*) SCREEN + (byte) idx#5) ← *((byte[4]) print_person::$2 + (byte) 0)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused variable (byte*) print_person::$1 and assignment [6] (byte*) print_person::$1 ← (byte*)(struct Person*) print_person::person#2
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
@ -199,7 +197,7 @@ Constant (const struct Person*) main::person#1 = main::person#0+SIZEOF_STRUCT_PE
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant (const struct Person*) print_person::person#1 = main::person#1
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Converting *(pointer+n) to pointer[n] [12] *((const byte*) SCREEN#0 + (byte) idx#5) ← *((byte[4]) print_person::$2) -- *((byte[4])print_person::person#2 + OFFSET_STRUCT_PERSON_INITIALS)
|
||||
Converting *(pointer+n) to pointer[n] [12] *((const byte*) SCREEN + (byte) idx#5) ← *((byte[4]) print_person::$2) -- *((byte[4])print_person::person#2 + OFFSET_STRUCT_PERSON_INITIALS)
|
||||
Successful SSA optimization Pass2InlineDerefIdx
|
||||
Eliminating unused variable (byte[4]) print_person::$2 and assignment [9] (byte[4]) print_person::$2 ← (byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
@ -208,8 +206,8 @@ Inlining constant with var siblings (const struct Person*) print_person::person#
|
||||
Inlining constant with var siblings (const struct Person*) print_person::person#1
|
||||
Inlining constant with var siblings (const byte) idx#19
|
||||
Constant inlined idx#19 = (byte) 0
|
||||
Constant inlined print_person::person#0 = (const struct Person[]) persons#0
|
||||
Constant inlined main::person#0 = (const struct Person[]) persons#0
|
||||
Constant inlined print_person::person#0 = (const struct Person[]) persons
|
||||
Constant inlined main::person#0 = (const struct Person[]) persons
|
||||
Constant inlined print_person::person#1 = (const struct Person*) main::person#1
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Constant array inlined into struct $0 = (string) "jgr"
|
||||
@ -266,21 +264,21 @@ main::@return: scope:[main] from main::@1
|
||||
(void()) print_person((struct Person*) print_person::person)
|
||||
print_person: scope:[print_person] from main main::@1
|
||||
[9] (byte) idx#15 ← phi( main/(byte) 0 main::@1/(byte) idx#10 )
|
||||
[9] (struct Person*) print_person::person#2 ← phi( main/(const struct Person[]) persons#0 main::@1/(const struct Person*) main::person#1 )
|
||||
[9] (struct Person*) print_person::person#2 ← phi( main/(const struct Person[]) persons main::@1/(const struct Person*) main::person#1 )
|
||||
[10] (byte~) print_person::$0 ← (byte) '0' + *((byte*)(struct Person*) print_person::person#2)
|
||||
[11] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte~) print_person::$0
|
||||
[11] *((const byte*) SCREEN + (byte) idx#15) ← (byte~) print_person::$0
|
||||
[12] (byte) idx#4 ← ++ (byte) idx#15
|
||||
[13] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' '
|
||||
[13] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' '
|
||||
[14] (byte) idx#5 ← ++ (byte) idx#4
|
||||
[15] *((const byte*) SCREEN#0 + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS)
|
||||
[15] *((const byte*) SCREEN + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS)
|
||||
[16] (byte) idx#6 ← ++ (byte) idx#5
|
||||
[17] (byte[4]) print_person::$3 ← (byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS
|
||||
[18] *((const byte*) SCREEN#0 + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1)
|
||||
[18] *((const byte*) SCREEN + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1)
|
||||
[19] (byte) idx#7 ← ++ (byte) idx#6
|
||||
[20] (byte[4]) print_person::$4 ← (byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS
|
||||
[21] *((const byte*) SCREEN#0 + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2)
|
||||
[21] *((const byte*) SCREEN + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2)
|
||||
[22] (byte) idx#8 ← ++ (byte) idx#7
|
||||
[23] *((const byte*) SCREEN#0 + (byte) idx#8) ← (byte) ' '
|
||||
[23] *((const byte*) SCREEN + (byte) idx#8) ← (byte) ' '
|
||||
[24] (byte) idx#10 ← ++ (byte) idx#8
|
||||
to:print_person::@return
|
||||
print_person::@return: scope:[print_person] from print_person
|
||||
@ -291,7 +289,6 @@ print_person::@return: scope:[print_person] from print_person
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(byte) Person::id
|
||||
(byte[4]) Person::initials
|
||||
(byte*) SCREEN
|
||||
(byte) idx
|
||||
(byte) idx#10 1.0
|
||||
(byte) idx#15 2.0
|
||||
@ -302,7 +299,6 @@ VARIABLE REGISTER WEIGHTS
|
||||
(byte) idx#8 3.0
|
||||
(void()) main()
|
||||
(struct Person*) main::person
|
||||
(struct Person[]) persons
|
||||
(void()) print_person((struct Person*) print_person::person)
|
||||
(byte~) print_person::$0 4.0
|
||||
(byte[4]) print_person::$3 4.0
|
||||
@ -387,7 +383,7 @@ main: {
|
||||
// [9] phi (byte) idx#15 = (byte) 0 [phi:main->print_person#0] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta.z idx_15
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons#0 [phi:main->print_person#1] -- pssz1=pssc1
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons [phi:main->print_person#1] -- pssz1=pssc1
|
||||
lda #<persons
|
||||
sta.z print_person.person
|
||||
lda #>persons
|
||||
@ -427,7 +423,7 @@ print_person: {
|
||||
ldy #0
|
||||
adc (person),y
|
||||
sta.z _0
|
||||
// [11] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte~) print_person::$0 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
// [11] *((const byte*) SCREEN + (byte) idx#15) ← (byte~) print_person::$0 -- pbuc1_derefidx_vbuz1=vbuz2
|
||||
lda.z _0
|
||||
ldy.z idx_15
|
||||
sta SCREEN,y
|
||||
@ -435,7 +431,7 @@ print_person: {
|
||||
ldy.z idx_15
|
||||
iny
|
||||
sty.z idx
|
||||
// [13] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
// [13] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #' '
|
||||
ldy.z idx
|
||||
sta SCREEN,y
|
||||
@ -443,7 +439,7 @@ print_person: {
|
||||
ldy.z idx
|
||||
iny
|
||||
sty.z idx_5
|
||||
// [15] *((const byte*) SCREEN#0 + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuc2
|
||||
// [15] *((const byte*) SCREEN + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuc2
|
||||
ldx.z idx_5
|
||||
ldy #OFFSET_STRUCT_PERSON_INITIALS
|
||||
lda (person),y
|
||||
@ -460,7 +456,7 @@ print_person: {
|
||||
lda #0
|
||||
adc.z person+1
|
||||
sta.z _3+1
|
||||
// [18] *((const byte*) SCREEN#0 + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuc2
|
||||
// [18] *((const byte*) SCREEN + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuc2
|
||||
ldx.z idx_6
|
||||
ldy #1
|
||||
lda (_3),y
|
||||
@ -477,7 +473,7 @@ print_person: {
|
||||
lda #0
|
||||
adc.z person+1
|
||||
sta.z _4+1
|
||||
// [21] *((const byte*) SCREEN#0 + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuc2
|
||||
// [21] *((const byte*) SCREEN + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuc2
|
||||
ldx.z idx_7
|
||||
ldy #2
|
||||
lda (_4),y
|
||||
@ -486,7 +482,7 @@ print_person: {
|
||||
ldy.z idx_7
|
||||
iny
|
||||
sty.z idx_8
|
||||
// [23] *((const byte*) SCREEN#0 + (byte) idx#8) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
// [23] *((const byte*) SCREEN + (byte) idx#8) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #' '
|
||||
ldy.z idx_8
|
||||
sta SCREEN,y
|
||||
@ -511,29 +507,29 @@ REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [10] (byte~) print_person::$0 ← (byte) '0' + *((byte*)(struct Person*) print_person::person#2) [ print_person::person#2 idx#15 print_person::$0 ] ( main:2::print_person:5 [ print_person::person#2 idx#15 print_person::$0 ] main:2::print_person:7 [ print_person::person#2 idx#15 print_person::$0 ] ) always clobbers reg byte a reg byte y
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ idx#15 idx#10 ]
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ idx#15 idx#10 ]
|
||||
Statement [13] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' [ print_person::person#2 idx#4 ] ( main:2::print_person:5 [ print_person::person#2 idx#4 ] main:2::print_person:7 [ print_person::person#2 idx#4 ] ) always clobbers reg byte a
|
||||
Statement [13] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' [ print_person::person#2 idx#4 ] ( main:2::print_person:5 [ print_person::person#2 idx#4 ] main:2::print_person:7 [ print_person::person#2 idx#4 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ idx#4 ]
|
||||
Statement [15] *((const byte*) SCREEN#0 + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS) [ print_person::person#2 idx#5 ] ( main:2::print_person:5 [ print_person::person#2 idx#5 ] main:2::print_person:7 [ print_person::person#2 idx#5 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [15] *((const byte*) SCREEN + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS) [ print_person::person#2 idx#5 ] ( main:2::print_person:5 [ print_person::person#2 idx#5 ] main:2::print_person:7 [ print_person::person#2 idx#5 ] ) always clobbers reg byte a reg byte y
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ idx#5 ]
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:7 [ idx#5 ]
|
||||
Statement [17] (byte[4]) print_person::$3 ← (byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS [ print_person::person#2 idx#6 print_person::$3 ] ( main:2::print_person:5 [ print_person::person#2 idx#6 print_person::$3 ] main:2::print_person:7 [ print_person::person#2 idx#6 print_person::$3 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ idx#6 ]
|
||||
Statement [18] *((const byte*) SCREEN#0 + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1) [ print_person::person#2 idx#6 ] ( main:2::print_person:5 [ print_person::person#2 idx#6 ] main:2::print_person:7 [ print_person::person#2 idx#6 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [18] *((const byte*) SCREEN + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1) [ print_person::person#2 idx#6 ] ( main:2::print_person:5 [ print_person::person#2 idx#6 ] main:2::print_person:7 [ print_person::person#2 idx#6 ] ) always clobbers reg byte a reg byte y
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:8 [ idx#6 ]
|
||||
Statement [20] (byte[4]) print_person::$4 ← (byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS [ idx#7 print_person::$4 ] ( main:2::print_person:5 [ idx#7 print_person::$4 ] main:2::print_person:7 [ idx#7 print_person::$4 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:11 [ idx#7 ]
|
||||
Statement [21] *((const byte*) SCREEN#0 + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2) [ idx#7 ] ( main:2::print_person:5 [ idx#7 ] main:2::print_person:7 [ idx#7 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [21] *((const byte*) SCREEN + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2) [ idx#7 ] ( main:2::print_person:5 [ idx#7 ] main:2::print_person:7 [ idx#7 ] ) always clobbers reg byte a reg byte y
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:11 [ idx#7 ]
|
||||
Statement [23] *((const byte*) SCREEN#0 + (byte) idx#8) ← (byte) ' ' [ idx#8 ] ( main:2::print_person:5 [ idx#8 ] main:2::print_person:7 [ idx#8 ] ) always clobbers reg byte a
|
||||
Statement [23] *((const byte*) SCREEN + (byte) idx#8) ← (byte) ' ' [ idx#8 ] ( main:2::print_person:5 [ idx#8 ] main:2::print_person:7 [ idx#8 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:14 [ idx#8 ]
|
||||
Statement [10] (byte~) print_person::$0 ← (byte) '0' + *((byte*)(struct Person*) print_person::person#2) [ print_person::person#2 idx#15 print_person::$0 ] ( main:2::print_person:5 [ print_person::person#2 idx#15 print_person::$0 ] main:2::print_person:7 [ print_person::person#2 idx#15 print_person::$0 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [13] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' [ print_person::person#2 idx#4 ] ( main:2::print_person:5 [ print_person::person#2 idx#4 ] main:2::print_person:7 [ print_person::person#2 idx#4 ] ) always clobbers reg byte a
|
||||
Statement [15] *((const byte*) SCREEN#0 + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS) [ print_person::person#2 idx#5 ] ( main:2::print_person:5 [ print_person::person#2 idx#5 ] main:2::print_person:7 [ print_person::person#2 idx#5 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [13] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' [ print_person::person#2 idx#4 ] ( main:2::print_person:5 [ print_person::person#2 idx#4 ] main:2::print_person:7 [ print_person::person#2 idx#4 ] ) always clobbers reg byte a
|
||||
Statement [15] *((const byte*) SCREEN + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS) [ print_person::person#2 idx#5 ] ( main:2::print_person:5 [ print_person::person#2 idx#5 ] main:2::print_person:7 [ print_person::person#2 idx#5 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [17] (byte[4]) print_person::$3 ← (byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS [ print_person::person#2 idx#6 print_person::$3 ] ( main:2::print_person:5 [ print_person::person#2 idx#6 print_person::$3 ] main:2::print_person:7 [ print_person::person#2 idx#6 print_person::$3 ] ) always clobbers reg byte a
|
||||
Statement [18] *((const byte*) SCREEN#0 + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1) [ print_person::person#2 idx#6 ] ( main:2::print_person:5 [ print_person::person#2 idx#6 ] main:2::print_person:7 [ print_person::person#2 idx#6 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [18] *((const byte*) SCREEN + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1) [ print_person::person#2 idx#6 ] ( main:2::print_person:5 [ print_person::person#2 idx#6 ] main:2::print_person:7 [ print_person::person#2 idx#6 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [20] (byte[4]) print_person::$4 ← (byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS [ idx#7 print_person::$4 ] ( main:2::print_person:5 [ idx#7 print_person::$4 ] main:2::print_person:7 [ idx#7 print_person::$4 ] ) always clobbers reg byte a
|
||||
Statement [21] *((const byte*) SCREEN#0 + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2) [ idx#7 ] ( main:2::print_person:5 [ idx#7 ] main:2::print_person:7 [ idx#7 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [23] *((const byte*) SCREEN#0 + (byte) idx#8) ← (byte) ' ' [ idx#8 ] ( main:2::print_person:5 [ idx#8 ] main:2::print_person:7 [ idx#8 ] ) always clobbers reg byte a
|
||||
Statement [21] *((const byte*) SCREEN + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2) [ idx#7 ] ( main:2::print_person:5 [ idx#7 ] main:2::print_person:7 [ idx#7 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [23] *((const byte*) SCREEN + (byte) idx#8) ← (byte) ' ' [ idx#8 ] ( main:2::print_person:5 [ idx#8 ] main:2::print_person:7 [ idx#8 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_WORD:2 [ print_person::person#2 ] : zp ZP_WORD:2 ,
|
||||
Potential registers zp ZP_BYTE:4 [ idx#15 idx#10 ] : zp ZP_BYTE:4 , reg byte x ,
|
||||
Potential registers zp ZP_BYTE:5 [ print_person::$0 ] : zp ZP_BYTE:5 , reg byte a , reg byte x , reg byte y ,
|
||||
@ -596,7 +592,7 @@ main: {
|
||||
print_person_from_main:
|
||||
// [9] phi (byte) idx#15 = (byte) 0 [phi:main->print_person#0] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons#0 [phi:main->print_person#1] -- pssz1=pssc1
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons [phi:main->print_person#1] -- pssz1=pssc1
|
||||
lda #<persons
|
||||
sta.z print_person.person
|
||||
lda #>persons
|
||||
@ -634,16 +630,16 @@ print_person: {
|
||||
clc
|
||||
ldy #0
|
||||
adc (person),y
|
||||
// [11] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte~) print_person::$0 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
// [11] *((const byte*) SCREEN + (byte) idx#15) ← (byte~) print_person::$0 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
sta SCREEN,x
|
||||
// [12] (byte) idx#4 ← ++ (byte) idx#15 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [13] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [13] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,x
|
||||
// [14] (byte) idx#5 ← ++ (byte) idx#4 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [15] *((const byte*) SCREEN#0 + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2
|
||||
// [15] *((const byte*) SCREEN + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2
|
||||
ldy #OFFSET_STRUCT_PERSON_INITIALS
|
||||
lda (person),y
|
||||
sta SCREEN,x
|
||||
@ -657,7 +653,7 @@ print_person: {
|
||||
lda #0
|
||||
adc.z person+1
|
||||
sta.z _3+1
|
||||
// [18] *((const byte*) SCREEN#0 + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2
|
||||
// [18] *((const byte*) SCREEN + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2
|
||||
ldy #1
|
||||
lda (_3),y
|
||||
sta SCREEN,x
|
||||
@ -671,13 +667,13 @@ print_person: {
|
||||
bcc !+
|
||||
inc.z _4+1
|
||||
!:
|
||||
// [21] *((const byte*) SCREEN#0 + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2
|
||||
// [21] *((const byte*) SCREEN + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2
|
||||
ldy #2
|
||||
lda (_4),y
|
||||
sta SCREEN,x
|
||||
// [22] (byte) idx#8 ← ++ (byte) idx#7 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [23] *((const byte*) SCREEN#0 + (byte) idx#8) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [23] *((const byte*) SCREEN + (byte) idx#8) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,x
|
||||
// [24] (byte) idx#10 ← ++ (byte) idx#8 -- vbuxx=_inc_vbuxx
|
||||
@ -729,8 +725,7 @@ FINAL SYMBOL TABLE
|
||||
(const byte) OFFSET_STRUCT_PERSON_INITIALS OFFSET_STRUCT_PERSON_INITIALS = (byte) 1
|
||||
(byte) Person::id
|
||||
(byte[4]) Person::initials
|
||||
(byte*) SCREEN
|
||||
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
|
||||
(const byte*) SCREEN SCREEN = (byte*) 1024
|
||||
(const byte) SIZEOF_STRUCT_PERSON SIZEOF_STRUCT_PERSON = (byte) 5
|
||||
(byte) idx
|
||||
(byte) idx#10 reg byte x 1.0
|
||||
@ -744,9 +739,8 @@ FINAL SYMBOL TABLE
|
||||
(label) main::@1
|
||||
(label) main::@return
|
||||
(struct Person*) main::person
|
||||
(const struct Person*) main::person#1 person = (const struct Person[]) persons#0+(const byte) SIZEOF_STRUCT_PERSON
|
||||
(struct Person[]) persons
|
||||
(const struct Person[]) persons#0 persons = { { id: (byte) 1, initials: (string) "jgr" }, { id: (byte) 8, initials: (string) "hbg" } }
|
||||
(const struct Person*) main::person#1 person = (const struct Person[]) persons+(const byte) SIZEOF_STRUCT_PERSON
|
||||
(const struct Person[]) persons persons = { { id: (byte) 1, initials: (string) "jgr" }, { id: (byte) 8, initials: (string) "hbg" } }
|
||||
(void()) print_person((struct Person*) print_person::person)
|
||||
(byte~) print_person::$0 reg byte a 4.0
|
||||
(byte[4]) print_person::$3 $3 zp ZP_WORD:4 4.0
|
||||
@ -794,7 +788,7 @@ main: {
|
||||
// [9] phi from main to print_person [phi:main->print_person]
|
||||
// [9] phi (byte) idx#15 = (byte) 0 [phi:main->print_person#0] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons#0 [phi:main->print_person#1] -- pssz1=pssc1
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons [phi:main->print_person#1] -- pssz1=pssc1
|
||||
lda #<persons
|
||||
sta.z print_person.person
|
||||
lda #>persons
|
||||
@ -830,20 +824,20 @@ print_person: {
|
||||
ldy #0
|
||||
adc (person),y
|
||||
// SCREEN[idx++] = '0'+person->id
|
||||
// [11] *((const byte*) SCREEN#0 + (byte) idx#15) ← (byte~) print_person::$0 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
// [11] *((const byte*) SCREEN + (byte) idx#15) ← (byte~) print_person::$0 -- pbuc1_derefidx_vbuxx=vbuaa
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = '0'+person->id;
|
||||
// [12] (byte) idx#4 ← ++ (byte) idx#15 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// SCREEN[idx++] = ' '
|
||||
// [13] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [13] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = ' ';
|
||||
// [14] (byte) idx#5 ← ++ (byte) idx#4 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// SCREEN[idx++] = person->initials[0]
|
||||
// [15] *((const byte*) SCREEN#0 + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2
|
||||
// [15] *((const byte*) SCREEN + (byte) idx#5) ← *((byte[4])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_INITIALS) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2
|
||||
ldy #OFFSET_STRUCT_PERSON_INITIALS
|
||||
lda (person),y
|
||||
sta SCREEN,x
|
||||
@ -859,7 +853,7 @@ print_person: {
|
||||
lda #0
|
||||
adc.z person+1
|
||||
sta.z _3+1
|
||||
// [18] *((const byte*) SCREEN#0 + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2
|
||||
// [18] *((const byte*) SCREEN + (byte) idx#6) ← *((byte[4]) print_person::$3 + (byte) 1) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2
|
||||
ldy #1
|
||||
lda (_3),y
|
||||
sta SCREEN,x
|
||||
@ -875,7 +869,7 @@ print_person: {
|
||||
bcc !+
|
||||
inc.z _4+1
|
||||
!:
|
||||
// [21] *((const byte*) SCREEN#0 + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2
|
||||
// [21] *((const byte*) SCREEN + (byte) idx#7) ← *((byte[4]) print_person::$4 + (byte) 2) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuc2
|
||||
ldy #2
|
||||
lda (_4),y
|
||||
sta SCREEN,x
|
||||
@ -883,7 +877,7 @@ print_person: {
|
||||
// [22] (byte) idx#8 ← ++ (byte) idx#7 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// SCREEN[idx++] = ' '
|
||||
// [23] *((const byte*) SCREEN#0 + (byte) idx#8) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [23] *((const byte*) SCREEN + (byte) idx#8) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = ' ';
|
||||
|
@ -4,8 +4,7 @@
|
||||
(const byte) OFFSET_STRUCT_PERSON_INITIALS OFFSET_STRUCT_PERSON_INITIALS = (byte) 1
|
||||
(byte) Person::id
|
||||
(byte[4]) Person::initials
|
||||
(byte*) SCREEN
|
||||
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
|
||||
(const byte*) SCREEN SCREEN = (byte*) 1024
|
||||
(const byte) SIZEOF_STRUCT_PERSON SIZEOF_STRUCT_PERSON = (byte) 5
|
||||
(byte) idx
|
||||
(byte) idx#10 reg byte x 1.0
|
||||
@ -19,9 +18,8 @@
|
||||
(label) main::@1
|
||||
(label) main::@return
|
||||
(struct Person*) main::person
|
||||
(const struct Person*) main::person#1 person = (const struct Person[]) persons#0+(const byte) SIZEOF_STRUCT_PERSON
|
||||
(struct Person[]) persons
|
||||
(const struct Person[]) persons#0 persons = { { id: (byte) 1, initials: (string) "jgr" }, { id: (byte) 8, initials: (string) "hbg" } }
|
||||
(const struct Person*) main::person#1 person = (const struct Person[]) persons+(const byte) SIZEOF_STRUCT_PERSON
|
||||
(const struct Person[]) persons persons = { { id: (byte) 1, initials: (string) "jgr" }, { id: (byte) 8, initials: (string) "hbg" } }
|
||||
(void()) print_person((struct Person*) print_person::person)
|
||||
(byte~) print_person::$0 reg byte a 4.0
|
||||
(byte[4]) print_person::$3 $3 zp ZP_WORD:4 4.0
|
||||
|
@ -24,10 +24,10 @@ main::@return: scope:[main] from main::@1
|
||||
(void()) print_person((struct Person*) print_person::person)
|
||||
print_person: scope:[print_person] from main main::@1
|
||||
[9] (byte) idx#13 ← phi( main/(byte) 0 main::@1/(byte) idx#16 )
|
||||
[9] (struct Person*) print_person::person#2 ← phi( main/(const struct Person[]) persons#0 main::@1/(const struct Person[]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON )
|
||||
[10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + *((byte*)(struct Person*) print_person::person#2))
|
||||
[9] (struct Person*) print_person::person#2 ← phi( main/(const struct Person[]) persons main::@1/(const struct Person[]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON )
|
||||
[10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + *((byte*)(struct Person*) print_person::person#2))
|
||||
[11] (byte) idx#4 ← ++ (byte) idx#13
|
||||
[12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' '
|
||||
[12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' '
|
||||
[13] (byte) idx#5 ← ++ (byte) idx#4
|
||||
to:print_person::@1
|
||||
print_person::@1: scope:[print_person] from print_person print_person::@2
|
||||
@ -37,7 +37,7 @@ print_person::@1: scope:[print_person] from print_person print_person::@2
|
||||
[16] if((byte) 0!=*((byte[$10]) print_person::$1 + (byte) print_person::i#2)) goto print_person::@2
|
||||
to:print_person::@3
|
||||
print_person::@3: scope:[print_person] from print_person::@1
|
||||
[17] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' '
|
||||
[17] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' '
|
||||
[18] (byte) idx#16 ← ++ (byte) idx#14
|
||||
to:print_person::@return
|
||||
print_person::@return: scope:[print_person] from print_person::@3
|
||||
@ -45,7 +45,7 @@ print_person::@return: scope:[print_person] from print_person::@3
|
||||
to:@return
|
||||
print_person::@2: scope:[print_person] from print_person::@1
|
||||
[20] (byte[$10]) print_person::$2 ← (byte[$10])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
[21] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2)
|
||||
[21] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2)
|
||||
[22] (byte) idx#6 ← ++ (byte) idx#14
|
||||
[23] (byte) print_person::i#1 ← ++ (byte) print_person::i#2
|
||||
to:print_person::@1
|
||||
|
@ -11,20 +11,20 @@ Culled Empty Block (label) print_person::@6
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@begin: scope:[] from
|
||||
(struct Person[]) persons#0 ← { { (number) 4, (const string) $0 }, { (number) 7, (const string) $1 } }
|
||||
(struct Person[]) persons ← { { (number) 4, (const string) $0 }, { (number) 7, (const string) $1 } }
|
||||
to:@1
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @2
|
||||
(byte) idx#18 ← phi( @2/(byte) idx#20 )
|
||||
(struct Person*) print_person::person#0 ← (struct Person[]) persons#0
|
||||
(struct Person*) print_person::person#0 ← (struct Person[]) persons
|
||||
call print_person
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main
|
||||
(byte) idx#10 ← phi( main/(byte) idx#8 )
|
||||
(byte) idx#0 ← (byte) idx#10
|
||||
(number~) main::$3 ← (number) 1 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
(struct Person*~) main::$1 ← (struct Person[]) persons#0 + (number~) main::$3
|
||||
(struct Person*~) main::$1 ← (struct Person[]) persons + (number~) main::$3
|
||||
(struct Person*) print_person::person#1 ← (struct Person*~) main::$1
|
||||
call print_person
|
||||
to:main::@2
|
||||
@ -38,9 +38,9 @@ main::@return: scope:[main] from main::@2
|
||||
return
|
||||
to:@return
|
||||
@1: scope:[] from @begin
|
||||
(byte*) SCREEN#0 ← ((byte*)) (number) $400
|
||||
(byte*) SCREEN ← ((byte*)) (number) $400
|
||||
(byte) idx#3 ← (number) 0
|
||||
(byte[]) DIGIT#0 ← (const string) $2
|
||||
(byte[]) DIGIT ← (const string) $2
|
||||
to:@2
|
||||
|
||||
(void()) print_person((struct Person*) print_person::person)
|
||||
@ -48,9 +48,9 @@ print_person: scope:[print_person] from main main::@1
|
||||
(byte) idx#13 ← phi( main/(byte) idx#18 main::@1/(byte) idx#0 )
|
||||
(struct Person*) print_person::person#2 ← phi( main/(struct Person*) print_person::person#0 main::@1/(struct Person*) print_person::person#1 )
|
||||
(byte*) print_person::$0 ← (byte*)(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
*((byte*) SCREEN#0 + (byte) idx#13) ← *((byte[]) DIGIT#0 + *((byte*) print_person::$0))
|
||||
*((byte*) SCREEN + (byte) idx#13) ← *((byte[]) DIGIT + *((byte*) print_person::$0))
|
||||
(byte) idx#4 ← ++ (byte) idx#13
|
||||
*((byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' '
|
||||
*((byte*) SCREEN + (byte) idx#4) ← (byte) ' '
|
||||
(byte) idx#5 ← ++ (byte) idx#4
|
||||
(byte) print_person::i#0 ← (number) 0
|
||||
to:print_person::@1
|
||||
@ -67,13 +67,13 @@ print_person::@2: scope:[print_person] from print_person::@1
|
||||
(byte) print_person::i#3 ← phi( print_person::@1/(byte) print_person::i#2 )
|
||||
(struct Person*) print_person::person#4 ← phi( print_person::@1/(struct Person*) print_person::person#3 )
|
||||
(byte[$10]) print_person::$2 ← (byte[$10])(struct Person*) print_person::person#4 + (const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
*((byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#3)
|
||||
*((byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#3)
|
||||
(byte) idx#6 ← ++ (byte) idx#14
|
||||
(byte) print_person::i#1 ← ++ (byte) print_person::i#3
|
||||
to:print_person::@1
|
||||
print_person::@3: scope:[print_person] from print_person::@1
|
||||
(byte) idx#15 ← phi( print_person::@1/(byte) idx#19 )
|
||||
*((byte*) SCREEN#0 + (byte) idx#15) ← (byte) ' '
|
||||
*((byte*) SCREEN + (byte) idx#15) ← (byte) ' '
|
||||
(byte) idx#7 ← ++ (byte) idx#15
|
||||
to:print_person::@return
|
||||
print_person::@return: scope:[print_person] from print_person::@3
|
||||
@ -101,13 +101,11 @@ SYMBOL TABLE SSA
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte[]) DIGIT
|
||||
(byte[]) DIGIT#0
|
||||
(const byte) OFFSET_STRUCT_PERSON_ID = (byte) 0
|
||||
(const byte) OFFSET_STRUCT_PERSON_NAME = (byte) 1
|
||||
(byte) Person::id
|
||||
(byte[$10]) Person::name
|
||||
(byte*) SCREEN
|
||||
(byte*) SCREEN#0
|
||||
(const byte) SIZEOF_STRUCT_PERSON = (byte) $11
|
||||
(byte) idx
|
||||
(byte) idx#0
|
||||
@ -138,7 +136,6 @@ SYMBOL TABLE SSA
|
||||
(label) main::@2
|
||||
(label) main::@return
|
||||
(struct Person[]) persons
|
||||
(struct Person[]) persons#0
|
||||
(void()) print_person((struct Person*) print_person::person)
|
||||
(byte*) print_person::$0
|
||||
(byte[$10]) print_person::$1
|
||||
@ -166,9 +163,9 @@ Adding number conversion cast (unumber) 0 in (byte) idx#3 ← (number) 0
|
||||
Adding number conversion cast (unumber) 0 in (byte) print_person::i#0 ← (number) 0
|
||||
Adding number conversion cast (unumber) 0 in (bool~) print_person::$3 ← (number) 0 != *((byte[$10]) print_person::$1 + (byte) print_person::i#2)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Added casts to value list in (struct Person[]) persons#0 ← (struct Person[]){ (struct Person){ (byte)(number) 4, (const string) $0 }, (struct Person){ (byte)(number) 7, (const string) $1 } }
|
||||
Added casts to value list in (struct Person[]) persons ← (struct Person[]){ (struct Person){ (byte)(number) 4, (const string) $0 }, (struct Person){ (byte)(number) 7, (const string) $1 } }
|
||||
Successful SSA optimization PassNAddInitializerValueListTypeCasts
|
||||
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
|
||||
Inlining cast (byte*) SCREEN ← (byte*)(number) $400
|
||||
Inlining cast (byte) idx#3 ← (unumber)(number) 0
|
||||
Inlining cast (byte) print_person::i#0 ← (unumber)(number) 0
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
@ -211,26 +208,26 @@ Identified constant from value list (struct Person) { id: (byte) 7, name: (const
|
||||
Successful SSA optimization Pass2ConstantInitializerValueLists
|
||||
Identified constant from value list (struct Person[]) { { id: (byte) 4, name: (const string) $0 }, { id: (byte) 7, name: (const string) $1 } }
|
||||
Successful SSA optimization Pass2ConstantInitializerValueLists
|
||||
Constant (const struct Person[]) persons#0 = { { id: 4, name: $0 }, { id: 7, name: $1 } }
|
||||
Constant (const struct Person[]) persons = { { id: 4, name: $0 }, { id: 7, name: $1 } }
|
||||
Constant (const byte) main::$3 = 1*SIZEOF_STRUCT_PERSON
|
||||
Constant (const byte*) SCREEN#0 = (byte*) 1024
|
||||
Constant (const byte*) SCREEN = (byte*) 1024
|
||||
Constant (const byte) idx#20 = 0
|
||||
Constant (const byte[]) DIGIT#0 = $2
|
||||
Constant (const byte[]) DIGIT = $2
|
||||
Constant (const byte) print_person::i#0 = 0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant (const struct Person*) print_person::person#0 = persons#0
|
||||
Constant (const struct Person*) print_person::person#0 = persons
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Converting *(pointer+n) to pointer[n] [20] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + *((byte*) print_person::$0)) -- *((byte*)print_person::person#2 + OFFSET_STRUCT_PERSON_ID)
|
||||
Converting *(pointer+n) to pointer[n] [20] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + *((byte*) print_person::$0)) -- *((byte*)print_person::person#2 + OFFSET_STRUCT_PERSON_ID)
|
||||
Successful SSA optimization Pass2InlineDerefIdx
|
||||
Simplifying expression containing zero (byte*)print_person::person#2 in [19] (byte*) print_person::$0 ← (byte*)(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
Simplifying expression containing zero (byte*)print_person::person#2 in [20] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + *((byte*)(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_ID))
|
||||
Simplifying expression containing zero (byte*)print_person::person#2 in [20] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + *((byte*)(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_ID))
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused variable (byte*) print_person::$0 and assignment [5] (byte*) print_person::$0 ← (byte*)(struct Person*) print_person::person#2
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant right-side identified [1] (struct Person*) print_person::person#1 ← (const struct Person[]) persons#0 + (const byte) main::$3
|
||||
Constant right-side identified [1] (struct Person*) print_person::person#1 ← (const struct Person[]) persons + (const byte) main::$3
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const struct Person*) print_person::person#1 = persons#0+main::$3
|
||||
Constant (const struct Person*) print_person::person#1 = persons+main::$3
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining constant with var siblings (const byte) print_person::i#0
|
||||
Inlining constant with var siblings (const struct Person*) print_person::person#0
|
||||
@ -238,10 +235,10 @@ Inlining constant with var siblings (const struct Person*) print_person::person#
|
||||
Inlining constant with var siblings (const byte) idx#20
|
||||
Constant inlined idx#20 = (byte) 0
|
||||
Constant inlined main::$3 = (byte) 1*(const byte) SIZEOF_STRUCT_PERSON
|
||||
Constant inlined print_person::person#0 = (const struct Person[]) persons#0
|
||||
Constant inlined print_person::person#0 = (const struct Person[]) persons
|
||||
Constant inlined print_person::i#0 = (byte) 0
|
||||
Constant inlined $2 = (const byte[]) DIGIT#0
|
||||
Constant inlined print_person::person#1 = (const struct Person[]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON
|
||||
Constant inlined $2 = (const byte[]) DIGIT
|
||||
Constant inlined print_person::person#1 = (const struct Person[]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Constant array inlined into struct $0 = (string) "jesper"
|
||||
Constant array inlined into struct $1 = (string) "henriette"
|
||||
@ -300,10 +297,10 @@ main::@return: scope:[main] from main::@1
|
||||
(void()) print_person((struct Person*) print_person::person)
|
||||
print_person: scope:[print_person] from main main::@1
|
||||
[9] (byte) idx#13 ← phi( main/(byte) 0 main::@1/(byte) idx#16 )
|
||||
[9] (struct Person*) print_person::person#2 ← phi( main/(const struct Person[]) persons#0 main::@1/(const struct Person[]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON )
|
||||
[10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + *((byte*)(struct Person*) print_person::person#2))
|
||||
[9] (struct Person*) print_person::person#2 ← phi( main/(const struct Person[]) persons main::@1/(const struct Person[]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON )
|
||||
[10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + *((byte*)(struct Person*) print_person::person#2))
|
||||
[11] (byte) idx#4 ← ++ (byte) idx#13
|
||||
[12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' '
|
||||
[12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' '
|
||||
[13] (byte) idx#5 ← ++ (byte) idx#4
|
||||
to:print_person::@1
|
||||
print_person::@1: scope:[print_person] from print_person print_person::@2
|
||||
@ -313,7 +310,7 @@ print_person::@1: scope:[print_person] from print_person print_person::@2
|
||||
[16] if((byte) 0!=*((byte[$10]) print_person::$1 + (byte) print_person::i#2)) goto print_person::@2
|
||||
to:print_person::@3
|
||||
print_person::@3: scope:[print_person] from print_person::@1
|
||||
[17] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' '
|
||||
[17] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' '
|
||||
[18] (byte) idx#16 ← ++ (byte) idx#14
|
||||
to:print_person::@return
|
||||
print_person::@return: scope:[print_person] from print_person::@3
|
||||
@ -321,17 +318,15 @@ print_person::@return: scope:[print_person] from print_person::@3
|
||||
to:@return
|
||||
print_person::@2: scope:[print_person] from print_person::@1
|
||||
[20] (byte[$10]) print_person::$2 ← (byte[$10])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
[21] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2)
|
||||
[21] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2)
|
||||
[22] (byte) idx#6 ← ++ (byte) idx#14
|
||||
[23] (byte) print_person::i#1 ← ++ (byte) print_person::i#2
|
||||
to:print_person::@1
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(byte[]) DIGIT
|
||||
(byte) Person::id
|
||||
(byte[$10]) Person::name
|
||||
(byte*) SCREEN
|
||||
(byte) idx
|
||||
(byte) idx#13 3.0
|
||||
(byte) idx#14 6.5
|
||||
@ -340,7 +335,6 @@ VARIABLE REGISTER WEIGHTS
|
||||
(byte) idx#5 4.0
|
||||
(byte) idx#6 11.0
|
||||
(void()) main()
|
||||
(struct Person[]) persons
|
||||
(void()) print_person((struct Person*) print_person::person)
|
||||
(byte[$10]) print_person::$1 22.0
|
||||
(byte[$10]) print_person::$2 22.0
|
||||
@ -416,7 +410,7 @@ main: {
|
||||
// [9] phi (byte) idx#13 = (byte) 0 [phi:main->print_person#0] -- vbuz1=vbuc1
|
||||
lda #0
|
||||
sta.z idx_13
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons#0 [phi:main->print_person#1] -- pssz1=pssc1
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons [phi:main->print_person#1] -- pssz1=pssc1
|
||||
lda #<persons
|
||||
sta.z print_person.person
|
||||
lda #>persons
|
||||
@ -431,7 +425,7 @@ main: {
|
||||
// [9] phi from main::@1 to print_person [phi:main::@1->print_person]
|
||||
print_person_from_b1:
|
||||
// [9] phi (byte) idx#13 = (byte) idx#16 [phi:main::@1->print_person#0] -- register_copy
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON [phi:main::@1->print_person#1] -- pssz1=pssc1
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON [phi:main::@1->print_person#1] -- pssz1=pssc1
|
||||
lda #<persons+1*SIZEOF_STRUCT_PERSON
|
||||
sta.z print_person.person
|
||||
lda #>persons+1*SIZEOF_STRUCT_PERSON
|
||||
@ -450,7 +444,7 @@ print_person: {
|
||||
.label _2 = $a
|
||||
.label i = 5
|
||||
.label person = 2
|
||||
// [10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + *((byte*)(struct Person*) print_person::person#2)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_(_deref_pbuz2)
|
||||
// [10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + *((byte*)(struct Person*) print_person::person#2)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_(_deref_pbuz2)
|
||||
ldx.z idx_13
|
||||
ldy #0
|
||||
lda (person),y
|
||||
@ -461,7 +455,7 @@ print_person: {
|
||||
ldy.z idx_13
|
||||
iny
|
||||
sty.z idx
|
||||
// [12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
// [12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #' '
|
||||
ldy.z idx
|
||||
sta SCREEN,y
|
||||
@ -494,7 +488,7 @@ print_person: {
|
||||
jmp b3
|
||||
// print_person::@3
|
||||
b3:
|
||||
// [17] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
// [17] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #' '
|
||||
ldy.z idx_14
|
||||
sta SCREEN,y
|
||||
@ -517,7 +511,7 @@ print_person: {
|
||||
lda #0
|
||||
adc.z person+1
|
||||
sta.z _2+1
|
||||
// [21] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuz3
|
||||
// [21] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuz3
|
||||
ldx.z idx_14
|
||||
ldy.z i
|
||||
lda (_2),y
|
||||
@ -545,25 +539,25 @@ print_person: {
|
||||
.byte 0
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + *((byte*)(struct Person*) print_person::person#2)) [ print_person::person#2 idx#13 ] ( main:2::print_person:5 [ print_person::person#2 idx#13 ] main:2::print_person:7 [ print_person::person#2 idx#13 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + *((byte*)(struct Person*) print_person::person#2)) [ print_person::person#2 idx#13 ] ( main:2::print_person:5 [ print_person::person#2 idx#13 ] main:2::print_person:7 [ print_person::person#2 idx#13 ] ) always clobbers reg byte a reg byte y
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ idx#13 idx#16 ]
|
||||
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:4 [ idx#13 idx#16 ]
|
||||
Statement [12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' [ print_person::person#2 idx#4 ] ( main:2::print_person:5 [ print_person::person#2 idx#4 ] main:2::print_person:7 [ print_person::person#2 idx#4 ] ) always clobbers reg byte a
|
||||
Statement [12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' [ print_person::person#2 idx#4 ] ( main:2::print_person:5 [ print_person::person#2 idx#4 ] main:2::print_person:7 [ print_person::person#2 idx#4 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ idx#4 ]
|
||||
Statement [15] (byte[$10]) print_person::$1 ← (byte[$10])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_NAME [ print_person::person#2 print_person::i#2 idx#14 print_person::$1 ] ( main:2::print_person:5 [ print_person::person#2 print_person::i#2 idx#14 print_person::$1 ] main:2::print_person:7 [ print_person::person#2 print_person::i#2 idx#14 print_person::$1 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ print_person::i#2 print_person::i#1 ]
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ idx#14 idx#5 idx#6 ]
|
||||
Statement [16] if((byte) 0!=*((byte[$10]) print_person::$1 + (byte) print_person::i#2)) goto print_person::@2 [ print_person::person#2 print_person::i#2 idx#14 ] ( main:2::print_person:5 [ print_person::person#2 print_person::i#2 idx#14 ] main:2::print_person:7 [ print_person::person#2 print_person::i#2 idx#14 ] ) always clobbers reg byte a
|
||||
Statement [17] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' ' [ idx#14 ] ( main:2::print_person:5 [ idx#14 ] main:2::print_person:7 [ idx#14 ] ) always clobbers reg byte a
|
||||
Statement [17] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' ' [ idx#14 ] ( main:2::print_person:5 [ idx#14 ] main:2::print_person:7 [ idx#14 ] ) always clobbers reg byte a
|
||||
Statement [20] (byte[$10]) print_person::$2 ← (byte[$10])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_NAME [ print_person::person#2 print_person::i#2 idx#14 print_person::$2 ] ( main:2::print_person:5 [ print_person::person#2 print_person::i#2 idx#14 print_person::$2 ] main:2::print_person:7 [ print_person::person#2 print_person::i#2 idx#14 print_person::$2 ] ) always clobbers reg byte a
|
||||
Statement [21] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2) [ print_person::person#2 print_person::i#2 idx#14 ] ( main:2::print_person:5 [ print_person::person#2 print_person::i#2 idx#14 ] main:2::print_person:7 [ print_person::person#2 print_person::i#2 idx#14 ] ) always clobbers reg byte a
|
||||
Statement [10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + *((byte*)(struct Person*) print_person::person#2)) [ print_person::person#2 idx#13 ] ( main:2::print_person:5 [ print_person::person#2 idx#13 ] main:2::print_person:7 [ print_person::person#2 idx#13 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' [ print_person::person#2 idx#4 ] ( main:2::print_person:5 [ print_person::person#2 idx#4 ] main:2::print_person:7 [ print_person::person#2 idx#4 ] ) always clobbers reg byte a
|
||||
Statement [21] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2) [ print_person::person#2 print_person::i#2 idx#14 ] ( main:2::print_person:5 [ print_person::person#2 print_person::i#2 idx#14 ] main:2::print_person:7 [ print_person::person#2 print_person::i#2 idx#14 ] ) always clobbers reg byte a
|
||||
Statement [10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + *((byte*)(struct Person*) print_person::person#2)) [ print_person::person#2 idx#13 ] ( main:2::print_person:5 [ print_person::person#2 idx#13 ] main:2::print_person:7 [ print_person::person#2 idx#13 ] ) always clobbers reg byte a reg byte y
|
||||
Statement [12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' [ print_person::person#2 idx#4 ] ( main:2::print_person:5 [ print_person::person#2 idx#4 ] main:2::print_person:7 [ print_person::person#2 idx#4 ] ) always clobbers reg byte a
|
||||
Statement [15] (byte[$10]) print_person::$1 ← (byte[$10])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_NAME [ print_person::person#2 print_person::i#2 idx#14 print_person::$1 ] ( main:2::print_person:5 [ print_person::person#2 print_person::i#2 idx#14 print_person::$1 ] main:2::print_person:7 [ print_person::person#2 print_person::i#2 idx#14 print_person::$1 ] ) always clobbers reg byte a
|
||||
Statement [16] if((byte) 0!=*((byte[$10]) print_person::$1 + (byte) print_person::i#2)) goto print_person::@2 [ print_person::person#2 print_person::i#2 idx#14 ] ( main:2::print_person:5 [ print_person::person#2 print_person::i#2 idx#14 ] main:2::print_person:7 [ print_person::person#2 print_person::i#2 idx#14 ] ) always clobbers reg byte a
|
||||
Statement [17] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' ' [ idx#14 ] ( main:2::print_person:5 [ idx#14 ] main:2::print_person:7 [ idx#14 ] ) always clobbers reg byte a
|
||||
Statement [17] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' ' [ idx#14 ] ( main:2::print_person:5 [ idx#14 ] main:2::print_person:7 [ idx#14 ] ) always clobbers reg byte a
|
||||
Statement [20] (byte[$10]) print_person::$2 ← (byte[$10])(struct Person*) print_person::person#2 + (const byte) OFFSET_STRUCT_PERSON_NAME [ print_person::person#2 print_person::i#2 idx#14 print_person::$2 ] ( main:2::print_person:5 [ print_person::person#2 print_person::i#2 idx#14 print_person::$2 ] main:2::print_person:7 [ print_person::person#2 print_person::i#2 idx#14 print_person::$2 ] ) always clobbers reg byte a
|
||||
Statement [21] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2) [ print_person::person#2 print_person::i#2 idx#14 ] ( main:2::print_person:5 [ print_person::person#2 print_person::i#2 idx#14 ] main:2::print_person:7 [ print_person::person#2 print_person::i#2 idx#14 ] ) always clobbers reg byte a
|
||||
Statement [21] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2) [ print_person::person#2 print_person::i#2 idx#14 ] ( main:2::print_person:5 [ print_person::person#2 print_person::i#2 idx#14 ] main:2::print_person:7 [ print_person::person#2 print_person::i#2 idx#14 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_WORD:2 [ print_person::person#2 ] : zp ZP_WORD:2 ,
|
||||
Potential registers zp ZP_BYTE:4 [ idx#13 idx#16 ] : zp ZP_BYTE:4 , reg byte x ,
|
||||
Potential registers zp ZP_BYTE:5 [ print_person::i#2 print_person::i#1 ] : zp ZP_BYTE:5 , reg byte x , reg byte y ,
|
||||
@ -619,7 +613,7 @@ main: {
|
||||
print_person_from_main:
|
||||
// [9] phi (byte) idx#13 = (byte) 0 [phi:main->print_person#0] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons#0 [phi:main->print_person#1] -- pssz1=pssc1
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons [phi:main->print_person#1] -- pssz1=pssc1
|
||||
lda #<persons
|
||||
sta.z print_person.person
|
||||
lda #>persons
|
||||
@ -634,7 +628,7 @@ main: {
|
||||
// [9] phi from main::@1 to print_person [phi:main::@1->print_person]
|
||||
print_person_from_b1:
|
||||
// [9] phi (byte) idx#13 = (byte) idx#16 [phi:main::@1->print_person#0] -- register_copy
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON [phi:main::@1->print_person#1] -- pssz1=pssc1
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON [phi:main::@1->print_person#1] -- pssz1=pssc1
|
||||
lda #<persons+1*SIZEOF_STRUCT_PERSON
|
||||
sta.z print_person.person
|
||||
lda #>persons+1*SIZEOF_STRUCT_PERSON
|
||||
@ -652,7 +646,7 @@ print_person: {
|
||||
.label _1 = 4
|
||||
.label _2 = 6
|
||||
.label person = 2
|
||||
// [10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + *((byte*)(struct Person*) print_person::person#2)) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_(_deref_pbuz1)
|
||||
// [10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + *((byte*)(struct Person*) print_person::person#2)) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_(_deref_pbuz1)
|
||||
ldy #0
|
||||
lda (person),y
|
||||
tay
|
||||
@ -660,7 +654,7 @@ print_person: {
|
||||
sta SCREEN,x
|
||||
// [11] (byte) idx#4 ← ++ (byte) idx#13 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,x
|
||||
// [13] (byte) idx#5 ← ++ (byte) idx#4 -- vbuxx=_inc_vbuxx
|
||||
@ -688,7 +682,7 @@ print_person: {
|
||||
jmp b3
|
||||
// print_person::@3
|
||||
b3:
|
||||
// [17] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [17] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,x
|
||||
// [18] (byte) idx#16 ← ++ (byte) idx#14 -- vbuxx=_inc_vbuxx
|
||||
@ -708,7 +702,7 @@ print_person: {
|
||||
lda #0
|
||||
adc.z person+1
|
||||
sta.z _2+1
|
||||
// [21] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuyy
|
||||
// [21] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuyy
|
||||
lda (_2),y
|
||||
sta SCREEN,x
|
||||
// [22] (byte) idx#6 ← ++ (byte) idx#14 -- vbuxx=_inc_vbuxx
|
||||
@ -768,13 +762,11 @@ FINAL SYMBOL TABLE
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte[]) DIGIT
|
||||
(const byte[]) DIGIT#0 DIGIT = (string) "0123456789"
|
||||
(const byte[]) DIGIT DIGIT = (string) "0123456789"
|
||||
(const byte) OFFSET_STRUCT_PERSON_NAME OFFSET_STRUCT_PERSON_NAME = (byte) 1
|
||||
(byte) Person::id
|
||||
(byte[$10]) Person::name
|
||||
(byte*) SCREEN
|
||||
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
|
||||
(const byte*) SCREEN SCREEN = (byte*) 1024
|
||||
(const byte) SIZEOF_STRUCT_PERSON SIZEOF_STRUCT_PERSON = (byte) $11
|
||||
(byte) idx
|
||||
(byte) idx#13 reg byte x 3.0
|
||||
@ -786,8 +778,7 @@ FINAL SYMBOL TABLE
|
||||
(void()) main()
|
||||
(label) main::@1
|
||||
(label) main::@return
|
||||
(struct Person[]) persons
|
||||
(const struct Person[]) persons#0 persons = { { id: (byte) 4, name: (string) "jesper" }, { id: (byte) 7, name: (string) "henriette" } }
|
||||
(const struct Person[]) persons persons = { { id: (byte) 4, name: (string) "jesper" }, { id: (byte) 7, name: (string) "henriette" } }
|
||||
(void()) print_person((struct Person*) print_person::person)
|
||||
(byte[$10]) print_person::$1 $1 zp ZP_WORD:4 22.0
|
||||
(byte[$10]) print_person::$2 $2 zp ZP_WORD:6 22.0
|
||||
@ -837,7 +828,7 @@ main: {
|
||||
// [9] phi from main to print_person [phi:main->print_person]
|
||||
// [9] phi (byte) idx#13 = (byte) 0 [phi:main->print_person#0] -- vbuxx=vbuc1
|
||||
ldx #0
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons#0 [phi:main->print_person#1] -- pssz1=pssc1
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons [phi:main->print_person#1] -- pssz1=pssc1
|
||||
lda #<persons
|
||||
sta.z print_person.person
|
||||
lda #>persons
|
||||
@ -849,7 +840,7 @@ main: {
|
||||
// [7] call print_person
|
||||
// [9] phi from main::@1 to print_person [phi:main::@1->print_person]
|
||||
// [9] phi (byte) idx#13 = (byte) idx#16 [phi:main::@1->print_person#0] -- register_copy
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON [phi:main::@1->print_person#1] -- pssz1=pssc1
|
||||
// [9] phi (struct Person*) print_person::person#2 = (const struct Person[]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON [phi:main::@1->print_person#1] -- pssz1=pssc1
|
||||
lda #<persons+1*SIZEOF_STRUCT_PERSON
|
||||
sta.z print_person.person
|
||||
lda #>persons+1*SIZEOF_STRUCT_PERSON
|
||||
@ -867,7 +858,7 @@ print_person: {
|
||||
.label _2 = 6
|
||||
.label person = 2
|
||||
// SCREEN[idx++] = DIGIT[person->id]
|
||||
// [10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + *((byte*)(struct Person*) print_person::person#2)) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_(_deref_pbuz1)
|
||||
// [10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + *((byte*)(struct Person*) print_person::person#2)) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_(_deref_pbuz1)
|
||||
ldy #0
|
||||
lda (person),y
|
||||
tay
|
||||
@ -877,7 +868,7 @@ print_person: {
|
||||
// [11] (byte) idx#4 ← ++ (byte) idx#13 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// SCREEN[idx++] = ' '
|
||||
// [12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = ' ';
|
||||
@ -904,7 +895,7 @@ print_person: {
|
||||
bne b2
|
||||
// print_person::@3
|
||||
// SCREEN[idx++] = ' '
|
||||
// [17] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [17] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = ' ';
|
||||
@ -925,7 +916,7 @@ print_person: {
|
||||
lda #0
|
||||
adc.z person+1
|
||||
sta.z _2+1
|
||||
// [21] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuyy
|
||||
// [21] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::$2 + (byte) print_person::i#2) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuyy
|
||||
lda (_2),y
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = person->name[i];
|
||||
|
@ -1,13 +1,11 @@
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte[]) DIGIT
|
||||
(const byte[]) DIGIT#0 DIGIT = (string) "0123456789"
|
||||
(const byte[]) DIGIT DIGIT = (string) "0123456789"
|
||||
(const byte) OFFSET_STRUCT_PERSON_NAME OFFSET_STRUCT_PERSON_NAME = (byte) 1
|
||||
(byte) Person::id
|
||||
(byte[$10]) Person::name
|
||||
(byte*) SCREEN
|
||||
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
|
||||
(const byte*) SCREEN SCREEN = (byte*) 1024
|
||||
(const byte) SIZEOF_STRUCT_PERSON SIZEOF_STRUCT_PERSON = (byte) $11
|
||||
(byte) idx
|
||||
(byte) idx#13 reg byte x 3.0
|
||||
@ -19,8 +17,7 @@
|
||||
(void()) main()
|
||||
(label) main::@1
|
||||
(label) main::@return
|
||||
(struct Person[]) persons
|
||||
(const struct Person[]) persons#0 persons = { { id: (byte) 4, name: (string) "jesper" }, { id: (byte) 7, name: (string) "henriette" } }
|
||||
(const struct Person[]) persons persons = { { id: (byte) 4, name: (string) "jesper" }, { id: (byte) 7, name: (string) "henriette" } }
|
||||
(void()) print_person((struct Person*) print_person::person)
|
||||
(byte[$10]) print_person::$1 $1 zp ZP_WORD:4 22.0
|
||||
(byte[$10]) print_person::$2 $2 zp ZP_WORD:6 22.0
|
||||
|
@ -10,14 +10,14 @@
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
[4] *((byte*)(const struct Person[2]) persons#0) ← (byte) 7
|
||||
[5] *((byte*)(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9
|
||||
[6] *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a'
|
||||
[7] *((byte[$d])(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'b'
|
||||
[8] *((word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141
|
||||
[9] *((word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b
|
||||
[10] *((const byte*) main::SCREEN#0) ← *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8)
|
||||
[11] *((const byte*) main::SCREEN#0+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8)
|
||||
[4] *((byte*)(const struct Person[2]) persons) ← (byte) 7
|
||||
[5] *((byte*)(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9
|
||||
[6] *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a'
|
||||
[7] *((byte[$d])(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'b'
|
||||
[8] *((word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141
|
||||
[9] *((word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b
|
||||
[10] *((const byte*) main::SCREEN) ← *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8)
|
||||
[11] *((const byte*) main::SCREEN+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[12] return
|
||||
|
@ -18,38 +18,38 @@ Rewriting struct pointer member access *((struct Person*) main::person).name
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@begin: scope:[] from
|
||||
(struct Person[2]) persons#0 ← { fill( 2, 0) }
|
||||
(struct Person[2]) persons ← { fill( 2, 0) }
|
||||
to:@1
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
(number~) main::$0 ← (number) 0 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
(byte*) main::$6 ← (byte*)(struct Person[2]) persons#0 + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
(byte*) main::$6 ← (byte*)(struct Person[2]) persons + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
*((byte*) main::$6 + (number~) main::$0) ← (number) 7
|
||||
(number~) main::$1 ← (number) 1 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
(byte*) main::$7 ← (byte*)(struct Person[2]) persons#0 + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
(byte*) main::$7 ← (byte*)(struct Person[2]) persons + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
*((byte*) main::$7 + (number~) main::$1) ← (number) 9
|
||||
(number~) main::$2 ← (number) 0 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
(byte[$d]) main::$8 ← (byte[$d])(struct Person[2]) persons#0 + (number~) main::$2
|
||||
(byte[$d]) main::$8 ← (byte[$d])(struct Person[2]) persons + (number~) main::$2
|
||||
(byte[$d]) main::$9 ← (byte[$d]) main::$8 + (const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
*((byte[$d]) main::$9 + (number) 8) ← (byte) 'a'
|
||||
(number~) main::$3 ← (number) 1 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
(byte[$d]) main::$10 ← (byte[$d])(struct Person[2]) persons#0 + (number~) main::$3
|
||||
(byte[$d]) main::$10 ← (byte[$d])(struct Person[2]) persons + (number~) main::$3
|
||||
(byte[$d]) main::$11 ← (byte[$d]) main::$10 + (const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
*((byte[$d]) main::$11 + (number) 8) ← (byte) 'b'
|
||||
(number~) main::$4 ← (number) 0 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
(word*) main::$12 ← (word*)(struct Person[2]) persons#0 + (const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
(word*) main::$12 ← (word*)(struct Person[2]) persons + (const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
*((word*) main::$12 + (number~) main::$4) ← (number) $141
|
||||
(number~) main::$5 ← (number) 1 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
(word*) main::$13 ← (word*)(struct Person[2]) persons#0 + (const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
(word*) main::$13 ← (word*)(struct Person[2]) persons + (const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
*((word*) main::$13 + (number~) main::$5) ← (number) $7b
|
||||
(byte*) main::SCREEN#0 ← ((byte*)) (number) $400
|
||||
(struct Person*) main::person#0 ← (struct Person[2]) persons#0
|
||||
(byte*) main::SCREEN ← ((byte*)) (number) $400
|
||||
(struct Person*) main::person#0 ← (struct Person[2]) persons
|
||||
(byte[$d]) main::$14 ← (byte[$d])(struct Person*) main::person#0 + (const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
*((byte*) main::SCREEN#0 + (number) 0) ← *((byte[$d]) main::$14 + (number) 8)
|
||||
*((byte*) main::SCREEN + (number) 0) ← *((byte[$d]) main::$14 + (number) 8)
|
||||
(struct Person*) main::person#1 ← (struct Person*) main::person#0 + (const byte) SIZEOF_STRUCT_PERSON
|
||||
(byte[$d]) main::$15 ← (byte[$d])(struct Person*) main::person#1 + (const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
*((byte*) main::SCREEN#0 + (number) 1) ← *((byte[$d]) main::$15 + (number) 8)
|
||||
*((byte*) main::SCREEN + (number) 1) ← *((byte[$d]) main::$15 + (number) 8)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
@ -92,12 +92,10 @@ SYMBOL TABLE SSA
|
||||
(byte[$d]) main::$9
|
||||
(label) main::@return
|
||||
(byte*) main::SCREEN
|
||||
(byte*) main::SCREEN#0
|
||||
(struct Person*) main::person
|
||||
(struct Person*) main::person#0
|
||||
(struct Person*) main::person#1
|
||||
(struct Person[2]) persons
|
||||
(struct Person[2]) persons#0
|
||||
|
||||
Adding number conversion cast (unumber) 0 in (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) 0 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
@ -117,16 +115,16 @@ Adding number conversion cast (unumber) $141 in *((word*) main::$12 + (unumber~)
|
||||
Adding number conversion cast (unumber) 1 in (number~) main::$5 ← (number) 1 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
Adding number conversion cast (unumber) main::$5 in (number~) main::$5 ← (unumber)(number) 1 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
Adding number conversion cast (unumber) $7b in *((word*) main::$13 + (unumber~) main::$5) ← (number) $7b
|
||||
Adding number conversion cast (unumber) 8 in *((byte*) main::SCREEN#0 + (number) 0) ← *((byte[$d]) main::$14 + (number) 8)
|
||||
Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN#0 + (number) 0) ← *((byte[$d]) main::$14 + (unumber)(number) 8)
|
||||
Adding number conversion cast (unumber) 8 in *((byte*) main::SCREEN#0 + (number) 1) ← *((byte[$d]) main::$15 + (number) 8)
|
||||
Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN#0 + (number) 1) ← *((byte[$d]) main::$15 + (unumber)(number) 8)
|
||||
Adding number conversion cast (unumber) 8 in *((byte*) main::SCREEN + (number) 0) ← *((byte[$d]) main::$14 + (number) 8)
|
||||
Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← *((byte[$d]) main::$14 + (unumber)(number) 8)
|
||||
Adding number conversion cast (unumber) 8 in *((byte*) main::SCREEN + (number) 1) ← *((byte[$d]) main::$15 + (number) 8)
|
||||
Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← *((byte[$d]) main::$15 + (unumber)(number) 8)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast *((byte*) main::$6 + (unumber~) main::$0) ← (unumber)(number) 7
|
||||
Inlining cast *((byte*) main::$7 + (unumber~) main::$1) ← (unumber)(number) 9
|
||||
Inlining cast *((word*) main::$12 + (unumber~) main::$4) ← (unumber)(number) $141
|
||||
Inlining cast *((word*) main::$13 + (unumber~) main::$5) ← (unumber)(number) $7b
|
||||
Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400
|
||||
Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 7
|
||||
@ -169,7 +167,7 @@ Inferred type updated to byte in (unumber~) main::$2 ← (byte) 0 * (const byte)
|
||||
Inferred type updated to byte in (unumber~) main::$3 ← (byte) 1 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
Inferred type updated to byte in (unumber~) main::$4 ← (byte) 0 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
Inferred type updated to byte in (unumber~) main::$5 ← (byte) 1 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
Constant right-side identified [0] (struct Person[2]) persons#0 ← { fill( 2, 0) }
|
||||
Constant right-side identified [0] (struct Person[2]) persons ← { fill( 2, 0) }
|
||||
Constant right-side identified [1] (byte~) main::$0 ← (byte) 0 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
Constant right-side identified [4] (byte~) main::$1 ← (byte) 1 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
Constant right-side identified [7] (byte~) main::$2 ← (byte) 0 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
@ -177,53 +175,53 @@ Constant right-side identified [11] (byte~) main::$3 ← (byte) 1 * (const byte)
|
||||
Constant right-side identified [15] (byte~) main::$4 ← (byte) 0 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
Constant right-side identified [18] (byte~) main::$5 ← (byte) 1 * (const byte) SIZEOF_STRUCT_PERSON
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const struct Person[2]) persons#0 = { fill( 2, 0) }
|
||||
Constant (const struct Person[2]) persons = { fill( 2, 0) }
|
||||
Constant (const byte) main::$0 = 0*SIZEOF_STRUCT_PERSON
|
||||
Constant (const byte) main::$1 = 1*SIZEOF_STRUCT_PERSON
|
||||
Constant (const byte) main::$2 = 0*SIZEOF_STRUCT_PERSON
|
||||
Constant (const byte) main::$3 = 1*SIZEOF_STRUCT_PERSON
|
||||
Constant (const byte) main::$4 = 0*SIZEOF_STRUCT_PERSON
|
||||
Constant (const byte) main::$5 = 1*SIZEOF_STRUCT_PERSON
|
||||
Constant (const byte*) main::SCREEN#0 = (byte*) 1024
|
||||
Constant (const byte*) main::SCREEN = (byte*) 1024
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant (const struct Person*) main::person#0 = persons#0
|
||||
Constant (const struct Person*) main::person#0 = persons
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant value identified (byte*)persons#0 in [2] (byte*) main::$6 ← (byte*)(const struct Person[2]) persons#0 + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
Constant value identified (byte*)persons#0 in [5] (byte*) main::$7 ← (byte*)(const struct Person[2]) persons#0 + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
Constant value identified (byte[$d])persons#0 in [8] (byte[$d]) main::$8 ← (byte[$d])(const struct Person[2]) persons#0 + (const byte) main::$2
|
||||
Constant value identified (byte[$d])persons#0 in [12] (byte[$d]) main::$10 ← (byte[$d])(const struct Person[2]) persons#0 + (const byte) main::$3
|
||||
Constant value identified (word*)persons#0 in [16] (word*) main::$12 ← (word*)(const struct Person[2]) persons#0 + (const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
Constant value identified (word*)persons#0 in [19] (word*) main::$13 ← (word*)(const struct Person[2]) persons#0 + (const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
Constant value identified (byte*)persons in [2] (byte*) main::$6 ← (byte*)(const struct Person[2]) persons + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
Constant value identified (byte*)persons in [5] (byte*) main::$7 ← (byte*)(const struct Person[2]) persons + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
Constant value identified (byte[$d])persons in [8] (byte[$d]) main::$8 ← (byte[$d])(const struct Person[2]) persons + (const byte) main::$2
|
||||
Constant value identified (byte[$d])persons in [12] (byte[$d]) main::$10 ← (byte[$d])(const struct Person[2]) persons + (const byte) main::$3
|
||||
Constant value identified (word*)persons in [16] (word*) main::$12 ← (word*)(const struct Person[2]) persons + (const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
Constant value identified (word*)persons in [19] (word*) main::$13 ← (word*)(const struct Person[2]) persons + (const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
Constant value identified (byte[$d])main::person#0 in [23] (byte[$d]) main::$14 ← (byte[$d])(const struct Person*) main::person#0 + (const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Successful SSA optimization Pass2ConstantValues
|
||||
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_STRUCT_PERSON in
|
||||
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_STRUCT_PERSON in
|
||||
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_STRUCT_PERSON in
|
||||
Successful SSA optimization PassNSimplifyConstantZero
|
||||
Simplifying expression containing zero (byte*)persons#0 in [2] (byte*) main::$6 ← (byte*)(const struct Person[2]) persons#0 + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
Simplifying expression containing zero (byte*)persons in [2] (byte*) main::$6 ← (byte*)(const struct Person[2]) persons + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
Simplifying expression containing zero main::$6 in [3] *((byte*) main::$6 + (const byte) main::$0) ← (byte) 7
|
||||
Simplifying expression containing zero (byte*)persons#0 in [5] (byte*) main::$7 ← (byte*)(const struct Person[2]) persons#0 + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
Simplifying expression containing zero (byte[$d])persons#0 in [8] (byte[$d]) main::$8 ← (byte[$d])(const struct Person[2]) persons#0 + (const byte) main::$2
|
||||
Simplifying expression containing zero (byte*)persons in [5] (byte*) main::$7 ← (byte*)(const struct Person[2]) persons + (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
Simplifying expression containing zero (byte[$d])persons in [8] (byte[$d]) main::$8 ← (byte[$d])(const struct Person[2]) persons + (const byte) main::$2
|
||||
Simplifying expression containing zero main::$12 in [17] *((word*) main::$12 + (const byte) main::$4) ← (word) $141
|
||||
Simplifying expression containing zero main::SCREEN#0 in [24] *((const byte*) main::SCREEN#0 + (byte) 0) ← *((byte[$d]) main::$14 + (byte) 8)
|
||||
Simplifying expression containing zero main::SCREEN in [24] *((const byte*) main::SCREEN + (byte) 0) ← *((byte[$d]) main::$14 + (byte) 8)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant (const byte) main::$0
|
||||
Eliminating unused constant (const byte) main::$2
|
||||
Eliminating unused constant (const byte) main::$4
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_PERSON_ID
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant right-side identified [7] (byte[$d]) main::$10 ← (byte[$d])(const struct Person[2]) persons#0 + (const byte) main::$3
|
||||
Constant right-side identified [10] (word*) main::$12 ← (word*)(const struct Person[2]) persons#0 + (const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
Constant right-side identified [12] (word*) main::$13 ← (word*)(const struct Person[2]) persons#0 + (const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
Constant right-side identified [7] (byte[$d]) main::$10 ← (byte[$d])(const struct Person[2]) persons + (const byte) main::$3
|
||||
Constant right-side identified [10] (word*) main::$12 ← (word*)(const struct Person[2]) persons + (const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
Constant right-side identified [12] (word*) main::$13 ← (word*)(const struct Person[2]) persons + (const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
Constant right-side identified [14] (byte[$d]) main::$14 ← (byte[$d])(const struct Person*) main::person#0 + (const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Constant right-side identified [16] (struct Person*) main::person#1 ← (const struct Person*) main::person#0 + (const byte) SIZEOF_STRUCT_PERSON
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) main::$6 = (byte*)persons#0
|
||||
Constant (const byte*) main::$7 = (byte*)persons#0
|
||||
Constant (const byte[$d]) main::$8 = (byte[$d])persons#0
|
||||
Constant (const byte[$d]) main::$10 = (byte[$d])persons#0+main::$3
|
||||
Constant (const word*) main::$12 = (word*)persons#0+OFFSET_STRUCT_PERSON_AGE
|
||||
Constant (const word*) main::$13 = (word*)persons#0+OFFSET_STRUCT_PERSON_AGE
|
||||
Constant (const byte*) main::$6 = (byte*)persons
|
||||
Constant (const byte*) main::$7 = (byte*)persons
|
||||
Constant (const byte[$d]) main::$8 = (byte[$d])persons
|
||||
Constant (const byte[$d]) main::$10 = (byte[$d])persons+main::$3
|
||||
Constant (const word*) main::$12 = (word*)persons+OFFSET_STRUCT_PERSON_AGE
|
||||
Constant (const word*) main::$13 = (word*)persons+OFFSET_STRUCT_PERSON_AGE
|
||||
Constant (const byte[$d]) main::$14 = (byte[$d])main::person#0+OFFSET_STRUCT_PERSON_NAME
|
||||
Constant (const struct Person*) main::person#1 = main::person#0+SIZEOF_STRUCT_PERSON
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
@ -238,28 +236,28 @@ Constant (const byte[$d]) main::$11 = main::$10+OFFSET_STRUCT_PERSON_NAME
|
||||
Constant (const byte[$d]) main::$15 = (byte[$d])main::person#1+OFFSET_STRUCT_PERSON_NAME
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining constant with different constant siblings (const struct Person*) main::person#0
|
||||
Constant inlined main::$12 = (word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
Constant inlined main::$13 = (word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
Constant inlined main::$14 = (byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Constant inlined main::$12 = (word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
Constant inlined main::$13 = (word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE
|
||||
Constant inlined main::$14 = (byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Constant inlined main::$15 = (byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Constant inlined main::$10 = (byte[$d])(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON
|
||||
Constant inlined main::$11 = (byte[$d])(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Constant inlined main::$10 = (byte[$d])(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON
|
||||
Constant inlined main::$11 = (byte[$d])(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Constant inlined main::$1 = (byte) 1*(const byte) SIZEOF_STRUCT_PERSON
|
||||
Constant inlined main::$5 = (byte) 1*(const byte) SIZEOF_STRUCT_PERSON
|
||||
Constant inlined main::$6 = (byte*)(const struct Person[2]) persons#0
|
||||
Constant inlined main::$6 = (byte*)(const struct Person[2]) persons
|
||||
Constant inlined main::$3 = (byte) 1*(const byte) SIZEOF_STRUCT_PERSON
|
||||
Constant inlined main::$9 = (byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Constant inlined main::$7 = (byte*)(const struct Person[2]) persons#0
|
||||
Constant inlined main::person#0 = (const struct Person[2]) persons#0
|
||||
Constant inlined main::$8 = (byte[$d])(const struct Person[2]) persons#0
|
||||
Constant inlined main::$9 = (byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Constant inlined main::$7 = (byte*)(const struct Person[2]) persons
|
||||
Constant inlined main::person#0 = (const struct Person[2]) persons
|
||||
Constant inlined main::$8 = (byte[$d])(const struct Person[2]) persons
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *((byte*)persons#0+1*SIZEOF_STRUCT_PERSON)
|
||||
Consolidated array index constant in *((byte[$d])persons#0+OFFSET_STRUCT_PERSON_NAME+8)
|
||||
Consolidated array index constant in *((byte[$d])persons#0+1*SIZEOF_STRUCT_PERSON+OFFSET_STRUCT_PERSON_NAME+8)
|
||||
Consolidated array index constant in *((word*)persons#0+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON)
|
||||
Consolidated array index constant in *((byte[$d])persons#0+OFFSET_STRUCT_PERSON_NAME+8)
|
||||
Consolidated array index constant in *((byte*)persons+1*SIZEOF_STRUCT_PERSON)
|
||||
Consolidated array index constant in *((byte[$d])persons+OFFSET_STRUCT_PERSON_NAME+8)
|
||||
Consolidated array index constant in *((byte[$d])persons+1*SIZEOF_STRUCT_PERSON+OFFSET_STRUCT_PERSON_NAME+8)
|
||||
Consolidated array index constant in *((word*)persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON)
|
||||
Consolidated array index constant in *((byte[$d])persons+OFFSET_STRUCT_PERSON_NAME+8)
|
||||
Consolidated array index constant in *((byte[$d])main::person#1+OFFSET_STRUCT_PERSON_NAME+8)
|
||||
Consolidated array index constant in *(main::SCREEN#0+1)
|
||||
Consolidated array index constant in *(main::SCREEN+1)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
@ -288,14 +286,14 @@ FINAL CONTROL FLOW GRAPH
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
[4] *((byte*)(const struct Person[2]) persons#0) ← (byte) 7
|
||||
[5] *((byte*)(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9
|
||||
[6] *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a'
|
||||
[7] *((byte[$d])(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'b'
|
||||
[8] *((word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141
|
||||
[9] *((word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b
|
||||
[10] *((const byte*) main::SCREEN#0) ← *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8)
|
||||
[11] *((const byte*) main::SCREEN#0+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8)
|
||||
[4] *((byte*)(const struct Person[2]) persons) ← (byte) 7
|
||||
[5] *((byte*)(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9
|
||||
[6] *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a'
|
||||
[7] *((byte[$d])(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'b'
|
||||
[8] *((word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141
|
||||
[9] *((word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b
|
||||
[10] *((const byte*) main::SCREEN) ← *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8)
|
||||
[11] *((const byte*) main::SCREEN+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[12] return
|
||||
@ -307,9 +305,7 @@ VARIABLE REGISTER WEIGHTS
|
||||
(byte) Person::id
|
||||
(byte[$d]) Person::name
|
||||
(void()) main()
|
||||
(byte*) main::SCREEN
|
||||
(struct Person*) main::person
|
||||
(struct Person[2]) persons
|
||||
|
||||
Initial phi equivalence classes
|
||||
Complete equivalence classes
|
||||
@ -344,32 +340,32 @@ bend:
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
.label person = persons+SIZEOF_STRUCT_PERSON
|
||||
// [4] *((byte*)(const struct Person[2]) persons#0) ← (byte) 7 -- _deref_pbuc1=vbuc2
|
||||
// [4] *((byte*)(const struct Person[2]) persons) ← (byte) 7 -- _deref_pbuc1=vbuc2
|
||||
lda #7
|
||||
sta persons
|
||||
// [5] *((byte*)(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9 -- _deref_pbuc1=vbuc2
|
||||
// [5] *((byte*)(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9 -- _deref_pbuc1=vbuc2
|
||||
lda #9
|
||||
sta persons+1*SIZEOF_STRUCT_PERSON
|
||||
// [6] *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a' -- _deref_pbuc1=vbuc2
|
||||
// [6] *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a' -- _deref_pbuc1=vbuc2
|
||||
lda #'a'
|
||||
sta persons+OFFSET_STRUCT_PERSON_NAME+8
|
||||
// [7] *((byte[$d])(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'b' -- _deref_pbuc1=vbuc2
|
||||
// [7] *((byte[$d])(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'b' -- _deref_pbuc1=vbuc2
|
||||
lda #'b'
|
||||
sta persons+1*SIZEOF_STRUCT_PERSON+OFFSET_STRUCT_PERSON_NAME+8
|
||||
// [8] *((word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141 -- _deref_pwuc1=vwuc2
|
||||
// [8] *((word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141 -- _deref_pwuc1=vwuc2
|
||||
lda #<$141
|
||||
sta persons+OFFSET_STRUCT_PERSON_AGE
|
||||
lda #>$141
|
||||
sta persons+OFFSET_STRUCT_PERSON_AGE+1
|
||||
// [9] *((word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b -- _deref_pwuc1=vbuc2
|
||||
// [9] *((word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b -- _deref_pwuc1=vbuc2
|
||||
lda #0
|
||||
sta persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON+1
|
||||
lda #<$7b
|
||||
sta persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON
|
||||
// [10] *((const byte*) main::SCREEN#0) ← *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [10] *((const byte*) main::SCREEN) ← *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda persons+OFFSET_STRUCT_PERSON_NAME+8
|
||||
sta SCREEN
|
||||
// [11] *((const byte*) main::SCREEN#0+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [11] *((const byte*) main::SCREEN+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda person+OFFSET_STRUCT_PERSON_NAME+8
|
||||
sta SCREEN+1
|
||||
jmp breturn
|
||||
@ -382,14 +378,14 @@ main: {
|
||||
persons: .fill $10*2, 0
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [4] *((byte*)(const struct Person[2]) persons#0) ← (byte) 7 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [5] *((byte*)(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [6] *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [7] *((byte[$d])(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'b' [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [8] *((word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [9] *((word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [10] *((const byte*) main::SCREEN#0) ← *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [11] *((const byte*) main::SCREEN#0+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [4] *((byte*)(const struct Person[2]) persons) ← (byte) 7 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [5] *((byte*)(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [6] *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a' [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [7] *((byte[$d])(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'b' [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [8] *((word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141 [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [9] *((word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [10] *((const byte*) main::SCREEN) ← *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [11] *((const byte*) main::SCREEN+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [Person]
|
||||
@ -429,32 +425,32 @@ bend:
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
.label person = persons+SIZEOF_STRUCT_PERSON
|
||||
// [4] *((byte*)(const struct Person[2]) persons#0) ← (byte) 7 -- _deref_pbuc1=vbuc2
|
||||
// [4] *((byte*)(const struct Person[2]) persons) ← (byte) 7 -- _deref_pbuc1=vbuc2
|
||||
lda #7
|
||||
sta persons
|
||||
// [5] *((byte*)(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9 -- _deref_pbuc1=vbuc2
|
||||
// [5] *((byte*)(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9 -- _deref_pbuc1=vbuc2
|
||||
lda #9
|
||||
sta persons+1*SIZEOF_STRUCT_PERSON
|
||||
// [6] *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a' -- _deref_pbuc1=vbuc2
|
||||
// [6] *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a' -- _deref_pbuc1=vbuc2
|
||||
lda #'a'
|
||||
sta persons+OFFSET_STRUCT_PERSON_NAME+8
|
||||
// [7] *((byte[$d])(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'b' -- _deref_pbuc1=vbuc2
|
||||
// [7] *((byte[$d])(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'b' -- _deref_pbuc1=vbuc2
|
||||
lda #'b'
|
||||
sta persons+1*SIZEOF_STRUCT_PERSON+OFFSET_STRUCT_PERSON_NAME+8
|
||||
// [8] *((word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141 -- _deref_pwuc1=vwuc2
|
||||
// [8] *((word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141 -- _deref_pwuc1=vwuc2
|
||||
lda #<$141
|
||||
sta persons+OFFSET_STRUCT_PERSON_AGE
|
||||
lda #>$141
|
||||
sta persons+OFFSET_STRUCT_PERSON_AGE+1
|
||||
// [9] *((word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b -- _deref_pwuc1=vbuc2
|
||||
// [9] *((word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b -- _deref_pwuc1=vbuc2
|
||||
lda #0
|
||||
sta persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON+1
|
||||
lda #<$7b
|
||||
sta persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON
|
||||
// [10] *((const byte*) main::SCREEN#0) ← *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [10] *((const byte*) main::SCREEN) ← *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda persons+OFFSET_STRUCT_PERSON_NAME+8
|
||||
sta SCREEN
|
||||
// [11] *((const byte*) main::SCREEN#0+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [11] *((const byte*) main::SCREEN+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda person+OFFSET_STRUCT_PERSON_NAME+8
|
||||
sta SCREEN+1
|
||||
jmp breturn
|
||||
@ -496,12 +492,10 @@ FINAL SYMBOL TABLE
|
||||
(const byte) SIZEOF_STRUCT_PERSON SIZEOF_STRUCT_PERSON = (byte) $10
|
||||
(void()) main()
|
||||
(label) main::@return
|
||||
(byte*) main::SCREEN
|
||||
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
|
||||
(const byte*) main::SCREEN SCREEN = (byte*) 1024
|
||||
(struct Person*) main::person
|
||||
(const struct Person*) main::person#1 person = (const struct Person[2]) persons#0+(const byte) SIZEOF_STRUCT_PERSON
|
||||
(struct Person[2]) persons
|
||||
(const struct Person[2]) persons#0 persons = { fill( 2, 0) }
|
||||
(const struct Person*) main::person#1 person = (const struct Person[2]) persons+(const byte) SIZEOF_STRUCT_PERSON
|
||||
(const struct Person[2]) persons persons = { fill( 2, 0) }
|
||||
|
||||
|
||||
|
||||
@ -529,39 +523,39 @@ main: {
|
||||
.label SCREEN = $400
|
||||
.label person = persons+SIZEOF_STRUCT_PERSON
|
||||
// persons[0].id = 7
|
||||
// [4] *((byte*)(const struct Person[2]) persons#0) ← (byte) 7 -- _deref_pbuc1=vbuc2
|
||||
// [4] *((byte*)(const struct Person[2]) persons) ← (byte) 7 -- _deref_pbuc1=vbuc2
|
||||
lda #7
|
||||
sta persons
|
||||
// persons[1].id = 9
|
||||
// [5] *((byte*)(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9 -- _deref_pbuc1=vbuc2
|
||||
// [5] *((byte*)(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) 9 -- _deref_pbuc1=vbuc2
|
||||
lda #9
|
||||
sta persons+1*SIZEOF_STRUCT_PERSON
|
||||
// persons[0].name[8] = 'a'
|
||||
// [6] *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a' -- _deref_pbuc1=vbuc2
|
||||
// [6] *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'a' -- _deref_pbuc1=vbuc2
|
||||
lda #'a'
|
||||
sta persons+OFFSET_STRUCT_PERSON_NAME+8
|
||||
// persons[1].name[8] = 'b'
|
||||
// [7] *((byte[$d])(const struct Person[2]) persons#0+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'b' -- _deref_pbuc1=vbuc2
|
||||
// [7] *((byte[$d])(const struct Person[2]) persons+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) ← (byte) 'b' -- _deref_pbuc1=vbuc2
|
||||
lda #'b'
|
||||
sta persons+1*SIZEOF_STRUCT_PERSON+OFFSET_STRUCT_PERSON_NAME+8
|
||||
// persons[0].age = 321
|
||||
// [8] *((word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141 -- _deref_pwuc1=vwuc2
|
||||
// [8] *((word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE) ← (word) $141 -- _deref_pwuc1=vwuc2
|
||||
lda #<$141
|
||||
sta persons+OFFSET_STRUCT_PERSON_AGE
|
||||
lda #>$141
|
||||
sta persons+OFFSET_STRUCT_PERSON_AGE+1
|
||||
// persons[1].age = 123
|
||||
// [9] *((word*)(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b -- _deref_pwuc1=vbuc2
|
||||
// [9] *((word*)(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_AGE+(byte) 1*(const byte) SIZEOF_STRUCT_PERSON) ← (byte) $7b -- _deref_pwuc1=vbuc2
|
||||
lda #0
|
||||
sta persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON+1
|
||||
lda #<$7b
|
||||
sta persons+OFFSET_STRUCT_PERSON_AGE+1*SIZEOF_STRUCT_PERSON
|
||||
// SCREEN[0] = person->name[8]
|
||||
// [10] *((const byte*) main::SCREEN#0) ← *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [10] *((const byte*) main::SCREEN) ← *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda persons+OFFSET_STRUCT_PERSON_NAME+8
|
||||
sta SCREEN
|
||||
// SCREEN[1] = person->name[8]
|
||||
// [11] *((const byte*) main::SCREEN#0+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [11] *((const byte*) main::SCREEN+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 8) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda person+OFFSET_STRUCT_PERSON_NAME+8
|
||||
sta SCREEN+1
|
||||
// main::@return
|
||||
|
@ -9,10 +9,8 @@
|
||||
(const byte) SIZEOF_STRUCT_PERSON SIZEOF_STRUCT_PERSON = (byte) $10
|
||||
(void()) main()
|
||||
(label) main::@return
|
||||
(byte*) main::SCREEN
|
||||
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
|
||||
(const byte*) main::SCREEN SCREEN = (byte*) 1024
|
||||
(struct Person*) main::person
|
||||
(const struct Person*) main::person#1 person = (const struct Person[2]) persons#0+(const byte) SIZEOF_STRUCT_PERSON
|
||||
(struct Person[2]) persons
|
||||
(const struct Person[2]) persons#0 persons = { fill( 2, 0) }
|
||||
(const struct Person*) main::person#1 person = (const struct Person[2]) persons+(const byte) SIZEOF_STRUCT_PERSON
|
||||
(const struct Person[2]) persons persons = { fill( 2, 0) }
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
[4] *((const byte*) main::SCREEN#0) ← *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2)
|
||||
[5] *((const byte*) main::SCREEN#0+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2)
|
||||
[4] *((const byte*) main::SCREEN) ← *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2)
|
||||
[5] *((const byte*) main::SCREEN+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[6] return
|
||||
|
@ -6,18 +6,18 @@ Rewriting struct pointer member access *((struct Person*) main::person).name
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@begin: scope:[] from
|
||||
(struct Person[2]) persons#0 ← { { (number) 7, (const string) $0, (number) $141 }, { (number) 9, (const string) $1, (number) $7b } }
|
||||
(struct Person[2]) persons ← { { (number) 7, (const string) $0, (number) $141 }, { (number) 9, (const string) $1, (number) $7b } }
|
||||
to:@1
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
(byte*) main::SCREEN#0 ← ((byte*)) (number) $400
|
||||
(struct Person*) main::person#0 ← (struct Person[2]) persons#0
|
||||
(byte*) main::SCREEN ← ((byte*)) (number) $400
|
||||
(struct Person*) main::person#0 ← (struct Person[2]) persons
|
||||
(byte[$d]) main::$0 ← (byte[$d])(struct Person*) main::person#0 + (const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
*((byte*) main::SCREEN#0 + (number) 0) ← *((byte[$d]) main::$0 + (number) 2)
|
||||
*((byte*) main::SCREEN + (number) 0) ← *((byte[$d]) main::$0 + (number) 2)
|
||||
(struct Person*) main::person#1 ← (struct Person*) main::person#0 + (const byte) SIZEOF_STRUCT_PERSON
|
||||
(byte[$d]) main::$1 ← (byte[$d])(struct Person*) main::person#1 + (const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
*((byte*) main::SCREEN#0 + (number) 1) ← *((byte[$d]) main::$1 + (number) 2)
|
||||
*((byte*) main::SCREEN + (number) 1) ← *((byte[$d]) main::$1 + (number) 2)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
@ -46,21 +46,19 @@ SYMBOL TABLE SSA
|
||||
(byte[$d]) main::$1
|
||||
(label) main::@return
|
||||
(byte*) main::SCREEN
|
||||
(byte*) main::SCREEN#0
|
||||
(struct Person*) main::person
|
||||
(struct Person*) main::person#0
|
||||
(struct Person*) main::person#1
|
||||
(struct Person[2]) persons
|
||||
(struct Person[2]) persons#0
|
||||
|
||||
Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN#0 + (number) 0) ← *((byte[$d]) main::$0 + (number) 2)
|
||||
Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN#0 + (number) 0) ← *((byte[$d]) main::$0 + (unumber)(number) 2)
|
||||
Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN#0 + (number) 1) ← *((byte[$d]) main::$1 + (number) 2)
|
||||
Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN#0 + (number) 1) ← *((byte[$d]) main::$1 + (unumber)(number) 2)
|
||||
Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN + (number) 0) ← *((byte[$d]) main::$0 + (number) 2)
|
||||
Adding number conversion cast (unumber) 0 in *((byte*) main::SCREEN + (number) 0) ← *((byte[$d]) main::$0 + (unumber)(number) 2)
|
||||
Adding number conversion cast (unumber) 2 in *((byte*) main::SCREEN + (number) 1) ← *((byte[$d]) main::$1 + (number) 2)
|
||||
Adding number conversion cast (unumber) 1 in *((byte*) main::SCREEN + (number) 1) ← *((byte[$d]) main::$1 + (unumber)(number) 2)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Added casts to value list in (struct Person[2]) persons#0 ← (struct Person[2]){ (struct Person){ (byte)(number) 7, (const string) $0, (word)(number) $141 }, (struct Person){ (byte)(number) 9, (const string) $1, (word)(number) $7b } }
|
||||
Added casts to value list in (struct Person[2]) persons ← (struct Person[2]){ (struct Person){ (byte)(number) 7, (const string) $0, (word)(number) $141 }, (struct Person){ (byte)(number) 9, (const string) $1, (word)(number) $7b } }
|
||||
Successful SSA optimization PassNAddInitializerValueListTypeCasts
|
||||
Inlining cast (byte*) main::SCREEN#0 ← (byte*)(number) $400
|
||||
Inlining cast (byte*) main::SCREEN ← (byte*)(number) $400
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant integer cast 7
|
||||
Simplifying constant integer cast $141
|
||||
@ -82,14 +80,14 @@ Identified constant from value list (struct Person) { id: (byte) 9, name: (const
|
||||
Successful SSA optimization Pass2ConstantInitializerValueLists
|
||||
Identified constant from value list (struct Person[2]) { { id: (byte) 7, name: (const string) $0, age: (word) $141 }, { id: (byte) 9, name: (const string) $1, age: (word) $7b } }
|
||||
Successful SSA optimization Pass2ConstantInitializerValueLists
|
||||
Constant (const struct Person[2]) persons#0 = { { id: 7, name: $0, age: $141 }, { id: 9, name: $1, age: $7b } }
|
||||
Constant (const byte*) main::SCREEN#0 = (byte*) 1024
|
||||
Constant (const struct Person[2]) persons = { { id: 7, name: $0, age: $141 }, { id: 9, name: $1, age: $7b } }
|
||||
Constant (const byte*) main::SCREEN = (byte*) 1024
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant (const struct Person*) main::person#0 = persons#0
|
||||
Constant (const struct Person*) main::person#0 = persons
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant value identified (byte[$d])main::person#0 in [3] (byte[$d]) main::$0 ← (byte[$d])(const struct Person*) main::person#0 + (const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Successful SSA optimization Pass2ConstantValues
|
||||
Simplifying expression containing zero main::SCREEN#0 in [4] *((const byte*) main::SCREEN#0 + (byte) 0) ← *((byte[$d]) main::$0 + (byte) 2)
|
||||
Simplifying expression containing zero main::SCREEN in [4] *((const byte*) main::SCREEN + (byte) 0) ← *((byte[$d]) main::$0 + (byte) 2)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Constant right-side identified [0] (byte[$d]) main::$0 ← (byte[$d])(const struct Person*) main::person#0 + (const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Constant right-side identified [2] (struct Person*) main::person#1 ← (const struct Person*) main::person#0 + (const byte) SIZEOF_STRUCT_PERSON
|
||||
@ -105,15 +103,15 @@ Constant (const byte[$d]) main::$1 = (byte[$d])main::person#1+OFFSET_STRUCT_PERS
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining constant with different constant siblings (const struct Person*) main::person#0
|
||||
Constant inlined main::$1 = (byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Constant inlined main::person#0 = (const struct Person[2]) persons#0
|
||||
Constant inlined main::$0 = (byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Constant inlined main::person#0 = (const struct Person[2]) persons
|
||||
Constant inlined main::$0 = (byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Constant array inlined into struct $0 = (string) "jesper"
|
||||
Constant array inlined into struct $1 = (string) "henry"
|
||||
Successful SSA optimization Pass2ArrayInStructInlining
|
||||
Consolidated array index constant in *((byte[$d])persons#0+OFFSET_STRUCT_PERSON_NAME+2)
|
||||
Consolidated array index constant in *((byte[$d])persons+OFFSET_STRUCT_PERSON_NAME+2)
|
||||
Consolidated array index constant in *((byte[$d])main::person#1+OFFSET_STRUCT_PERSON_NAME+2)
|
||||
Consolidated array index constant in *(main::SCREEN#0+1)
|
||||
Consolidated array index constant in *(main::SCREEN+1)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
@ -142,8 +140,8 @@ FINAL CONTROL FLOW GRAPH
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
[4] *((const byte*) main::SCREEN#0) ← *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2)
|
||||
[5] *((const byte*) main::SCREEN#0+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2)
|
||||
[4] *((const byte*) main::SCREEN) ← *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2)
|
||||
[5] *((const byte*) main::SCREEN+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[6] return
|
||||
@ -155,9 +153,7 @@ VARIABLE REGISTER WEIGHTS
|
||||
(byte) Person::id
|
||||
(byte[$d]) Person::name
|
||||
(void()) main()
|
||||
(byte*) main::SCREEN
|
||||
(struct Person*) main::person
|
||||
(struct Person[2]) persons
|
||||
|
||||
Initial phi equivalence classes
|
||||
Complete equivalence classes
|
||||
@ -191,10 +187,10 @@ bend:
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
.label person = persons+SIZEOF_STRUCT_PERSON
|
||||
// [4] *((const byte*) main::SCREEN#0) ← *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [4] *((const byte*) main::SCREEN) ← *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda persons+OFFSET_STRUCT_PERSON_NAME+2
|
||||
sta SCREEN
|
||||
// [5] *((const byte*) main::SCREEN#0+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [5] *((const byte*) main::SCREEN+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda person+OFFSET_STRUCT_PERSON_NAME+2
|
||||
sta SCREEN+1
|
||||
jmp breturn
|
||||
@ -216,8 +212,8 @@ main: {
|
||||
.word $7b
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [4] *((const byte*) main::SCREEN#0) ← *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [5] *((const byte*) main::SCREEN#0+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [4] *((const byte*) main::SCREEN) ← *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [5] *((const byte*) main::SCREEN+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [Person]
|
||||
@ -256,10 +252,10 @@ bend:
|
||||
main: {
|
||||
.label SCREEN = $400
|
||||
.label person = persons+SIZEOF_STRUCT_PERSON
|
||||
// [4] *((const byte*) main::SCREEN#0) ← *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [4] *((const byte*) main::SCREEN) ← *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda persons+OFFSET_STRUCT_PERSON_NAME+2
|
||||
sta SCREEN
|
||||
// [5] *((const byte*) main::SCREEN#0+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [5] *((const byte*) main::SCREEN+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda person+OFFSET_STRUCT_PERSON_NAME+2
|
||||
sta SCREEN+1
|
||||
jmp breturn
|
||||
@ -309,12 +305,10 @@ FINAL SYMBOL TABLE
|
||||
(const byte) SIZEOF_STRUCT_PERSON SIZEOF_STRUCT_PERSON = (byte) $10
|
||||
(void()) main()
|
||||
(label) main::@return
|
||||
(byte*) main::SCREEN
|
||||
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
|
||||
(const byte*) main::SCREEN SCREEN = (byte*) 1024
|
||||
(struct Person*) main::person
|
||||
(const struct Person*) main::person#1 person = (const struct Person[2]) persons#0+(const byte) SIZEOF_STRUCT_PERSON
|
||||
(struct Person[2]) persons
|
||||
(const struct Person[2]) persons#0 persons = { { id: (byte) 7, name: (string) "jesper", age: (word) $141 }, { id: (byte) 9, name: (string) "henry", age: (word) $7b } }
|
||||
(const struct Person*) main::person#1 person = (const struct Person[2]) persons+(const byte) SIZEOF_STRUCT_PERSON
|
||||
(const struct Person[2]) persons persons = { { id: (byte) 7, name: (string) "jesper", age: (word) $141 }, { id: (byte) 9, name: (string) "henry", age: (word) $7b } }
|
||||
|
||||
|
||||
|
||||
@ -341,11 +335,11 @@ main: {
|
||||
.label SCREEN = $400
|
||||
.label person = persons+SIZEOF_STRUCT_PERSON
|
||||
// SCREEN[0] = person->name[2]
|
||||
// [4] *((const byte*) main::SCREEN#0) ← *((byte[$d])(const struct Person[2]) persons#0+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [4] *((const byte*) main::SCREEN) ← *((byte[$d])(const struct Person[2]) persons+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda persons+OFFSET_STRUCT_PERSON_NAME+2
|
||||
sta SCREEN
|
||||
// SCREEN[1] = person->name[2]
|
||||
// [5] *((const byte*) main::SCREEN#0+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [5] *((const byte*) main::SCREEN+(byte) 1) ← *((byte[$d])(const struct Person*) main::person#1+(const byte) OFFSET_STRUCT_PERSON_NAME+(byte) 2) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda person+OFFSET_STRUCT_PERSON_NAME+2
|
||||
sta SCREEN+1
|
||||
// main::@return
|
||||
|
@ -8,10 +8,8 @@
|
||||
(const byte) SIZEOF_STRUCT_PERSON SIZEOF_STRUCT_PERSON = (byte) $10
|
||||
(void()) main()
|
||||
(label) main::@return
|
||||
(byte*) main::SCREEN
|
||||
(const byte*) main::SCREEN#0 SCREEN = (byte*) 1024
|
||||
(const byte*) main::SCREEN SCREEN = (byte*) 1024
|
||||
(struct Person*) main::person
|
||||
(const struct Person*) main::person#1 person = (const struct Person[2]) persons#0+(const byte) SIZEOF_STRUCT_PERSON
|
||||
(struct Person[2]) persons
|
||||
(const struct Person[2]) persons#0 persons = { { id: (byte) 7, name: (string) "jesper", age: (word) $141 }, { id: (byte) 9, name: (string) "henry", age: (word) $7b } }
|
||||
(const struct Person*) main::person#1 person = (const struct Person[2]) persons+(const byte) SIZEOF_STRUCT_PERSON
|
||||
(const struct Person[2]) persons persons = { { id: (byte) 7, name: (string) "jesper", age: (word) $141 }, { id: (byte) 9, name: (string) "henry", age: (word) $7b } }
|
||||
|
||||
|
@ -26,9 +26,9 @@ print_person: scope:[print_person] from main main::@1
|
||||
[9] (byte[$10]) print_person::person_name#4 ← phi( main/(const byte[$10]) main::jesper_name#0 main::@1/(const byte[$10]) main::henriette_name#0 )
|
||||
[9] (byte) idx#13 ← phi( main/(byte) 0 main::@1/(byte) idx#16 )
|
||||
[9] (byte) print_person::person_id#2 ← phi( main/(const byte) main::jesper_id#0 main::@1/(const byte) main::henriette_id#0 )
|
||||
[10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + (byte) print_person::person_id#2)
|
||||
[10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + (byte) print_person::person_id#2)
|
||||
[11] (byte) idx#4 ← ++ (byte) idx#13
|
||||
[12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' '
|
||||
[12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' '
|
||||
[13] (byte) idx#5 ← ++ (byte) idx#4
|
||||
to:print_person::@1
|
||||
print_person::@1: scope:[print_person] from print_person print_person::@2
|
||||
@ -37,14 +37,14 @@ print_person::@1: scope:[print_person] from print_person print_person::@2
|
||||
[15] if((byte) 0!=*((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2)) goto print_person::@2
|
||||
to:print_person::@3
|
||||
print_person::@3: scope:[print_person] from print_person::@1
|
||||
[16] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' '
|
||||
[16] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' '
|
||||
[17] (byte) idx#16 ← ++ (byte) idx#14
|
||||
to:print_person::@return
|
||||
print_person::@return: scope:[print_person] from print_person::@3
|
||||
[18] return
|
||||
to:@return
|
||||
print_person::@2: scope:[print_person] from print_person::@1
|
||||
[19] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2)
|
||||
[19] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2)
|
||||
[20] (byte) idx#6 ← ++ (byte) idx#14
|
||||
[21] (byte) print_person::i#1 ← ++ (byte) print_person::i#2
|
||||
to:print_person::@1
|
||||
|
@ -61,9 +61,9 @@ main::@return: scope:[main] from main::@2
|
||||
return
|
||||
to:@return
|
||||
@1: scope:[] from @begin
|
||||
(byte*) SCREEN#0 ← ((byte*)) (number) $400
|
||||
(byte*) SCREEN ← ((byte*)) (number) $400
|
||||
(byte) idx#3 ← (number) 0
|
||||
(byte[]) DIGIT#0 ← (const string) $0
|
||||
(byte[]) DIGIT ← (const string) $0
|
||||
to:@2
|
||||
|
||||
(void()) print_person((byte) print_person::person_id , (byte[$10]) print_person::person_name)
|
||||
@ -71,9 +71,9 @@ print_person: scope:[print_person] from main main::@1
|
||||
(byte[$10]) print_person::person_name#4 ← phi( main/(byte[$10]) print_person::person_name#0 main::@1/(byte[$10]) print_person::person_name#1 )
|
||||
(byte) idx#13 ← phi( main/(byte) idx#18 main::@1/(byte) idx#0 )
|
||||
(byte) print_person::person_id#2 ← phi( main/(byte) print_person::person_id#0 main::@1/(byte) print_person::person_id#1 )
|
||||
*((byte*) SCREEN#0 + (byte) idx#13) ← *((byte[]) DIGIT#0 + (byte) print_person::person_id#2)
|
||||
*((byte*) SCREEN + (byte) idx#13) ← *((byte[]) DIGIT + (byte) print_person::person_id#2)
|
||||
(byte) idx#4 ← ++ (byte) idx#13
|
||||
*((byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' '
|
||||
*((byte*) SCREEN + (byte) idx#4) ← (byte) ' '
|
||||
(byte) idx#5 ← ++ (byte) idx#4
|
||||
(byte) print_person::i#0 ← (number) 0
|
||||
to:print_person::@1
|
||||
@ -88,13 +88,13 @@ print_person::@2: scope:[print_person] from print_person::@1
|
||||
(byte) idx#14 ← phi( print_person::@1/(byte) idx#19 )
|
||||
(byte) print_person::i#3 ← phi( print_person::@1/(byte) print_person::i#2 )
|
||||
(byte[$10]) print_person::person_name#3 ← phi( print_person::@1/(byte[$10]) print_person::person_name#2 )
|
||||
*((byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::person_name#3 + (byte) print_person::i#3)
|
||||
*((byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::person_name#3 + (byte) print_person::i#3)
|
||||
(byte) idx#6 ← ++ (byte) idx#14
|
||||
(byte) print_person::i#1 ← ++ (byte) print_person::i#3
|
||||
to:print_person::@1
|
||||
print_person::@3: scope:[print_person] from print_person::@1
|
||||
(byte) idx#15 ← phi( print_person::@1/(byte) idx#19 )
|
||||
*((byte*) SCREEN#0 + (byte) idx#15) ← (byte) ' '
|
||||
*((byte*) SCREEN + (byte) idx#15) ← (byte) ' '
|
||||
(byte) idx#7 ← ++ (byte) idx#15
|
||||
to:print_person::@return
|
||||
print_person::@return: scope:[print_person] from print_person::@3
|
||||
@ -120,11 +120,9 @@ SYMBOL TABLE SSA
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte[]) DIGIT
|
||||
(byte[]) DIGIT#0
|
||||
(byte) Person::id
|
||||
(byte[$10]) Person::name
|
||||
(byte*) SCREEN
|
||||
(byte*) SCREEN#0
|
||||
(byte) idx
|
||||
(byte) idx#0
|
||||
(byte) idx#1
|
||||
@ -192,7 +190,7 @@ Adding number conversion cast (unumber) 0 in (bool~) print_person::$0 ← (numbe
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast (byte) main::jesper_id#0 ← (unumber)(number) 4
|
||||
Inlining cast (byte) main::henriette_id#0 ← (unumber)(number) 7
|
||||
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $400
|
||||
Inlining cast (byte*) SCREEN ← (byte*)(number) $400
|
||||
Inlining cast (byte) idx#3 ← (unumber)(number) 0
|
||||
Inlining cast (byte) print_person::i#0 ← (unumber)(number) 0
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
@ -230,9 +228,9 @@ Constant (const byte) main::jesper_id#0 = 4
|
||||
Constant (const byte[$10]) main::jesper_name#0 = main::$2
|
||||
Constant (const byte) main::henriette_id#0 = 7
|
||||
Constant (const byte[$10]) main::henriette_name#0 = main::$3
|
||||
Constant (const byte*) SCREEN#0 = (byte*) 1024
|
||||
Constant (const byte*) SCREEN = (byte*) 1024
|
||||
Constant (const byte) idx#20 = 0
|
||||
Constant (const byte[]) DIGIT#0 = $0
|
||||
Constant (const byte[]) DIGIT = $0
|
||||
Constant (const byte) print_person::i#0 = 0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant (const byte) print_person::person_id#0 = main::jesper_id#0
|
||||
@ -253,7 +251,7 @@ Constant inlined main::$2 = (const byte[$10]) main::jesper_name#0
|
||||
Constant inlined print_person::i#0 = (byte) 0
|
||||
Constant inlined print_person::person_name#1 = (const byte[$10]) main::henriette_name#0
|
||||
Constant inlined main::$3 = (const byte[$10]) main::henriette_name#0
|
||||
Constant inlined $0 = (const byte[]) DIGIT#0
|
||||
Constant inlined $0 = (const byte[]) DIGIT
|
||||
Constant inlined print_person::person_name#0 = (const byte[$10]) main::jesper_name#0
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Adding NOP phi() at start of @begin
|
||||
@ -312,9 +310,9 @@ print_person: scope:[print_person] from main main::@1
|
||||
[9] (byte[$10]) print_person::person_name#4 ← phi( main/(const byte[$10]) main::jesper_name#0 main::@1/(const byte[$10]) main::henriette_name#0 )
|
||||
[9] (byte) idx#13 ← phi( main/(byte) 0 main::@1/(byte) idx#16 )
|
||||
[9] (byte) print_person::person_id#2 ← phi( main/(const byte) main::jesper_id#0 main::@1/(const byte) main::henriette_id#0 )
|
||||
[10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + (byte) print_person::person_id#2)
|
||||
[10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + (byte) print_person::person_id#2)
|
||||
[11] (byte) idx#4 ← ++ (byte) idx#13
|
||||
[12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' '
|
||||
[12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' '
|
||||
[13] (byte) idx#5 ← ++ (byte) idx#4
|
||||
to:print_person::@1
|
||||
print_person::@1: scope:[print_person] from print_person print_person::@2
|
||||
@ -323,24 +321,22 @@ print_person::@1: scope:[print_person] from print_person print_person::@2
|
||||
[15] if((byte) 0!=*((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2)) goto print_person::@2
|
||||
to:print_person::@3
|
||||
print_person::@3: scope:[print_person] from print_person::@1
|
||||
[16] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' '
|
||||
[16] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' '
|
||||
[17] (byte) idx#16 ← ++ (byte) idx#14
|
||||
to:print_person::@return
|
||||
print_person::@return: scope:[print_person] from print_person::@3
|
||||
[18] return
|
||||
to:@return
|
||||
print_person::@2: scope:[print_person] from print_person::@1
|
||||
[19] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2)
|
||||
[19] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2)
|
||||
[20] (byte) idx#6 ← ++ (byte) idx#14
|
||||
[21] (byte) print_person::i#1 ← ++ (byte) print_person::i#2
|
||||
to:print_person::@1
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(byte[]) DIGIT
|
||||
(byte) Person::id
|
||||
(byte[$10]) Person::name
|
||||
(byte*) SCREEN
|
||||
(byte) idx
|
||||
(byte) idx#13 3.0
|
||||
(byte) idx#14 9.75
|
||||
@ -471,7 +467,7 @@ print_person: {
|
||||
.label i = 6
|
||||
.label person_id = 2
|
||||
.label person_name = 4
|
||||
// [10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + (byte) print_person::person_id#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2
|
||||
// [10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + (byte) print_person::person_id#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2
|
||||
ldy.z person_id
|
||||
lda DIGIT,y
|
||||
ldy.z idx_13
|
||||
@ -480,7 +476,7 @@ print_person: {
|
||||
ldy.z idx_13
|
||||
iny
|
||||
sty.z idx
|
||||
// [12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
// [12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #' '
|
||||
ldy.z idx
|
||||
sta SCREEN,y
|
||||
@ -505,7 +501,7 @@ print_person: {
|
||||
jmp b3
|
||||
// print_person::@3
|
||||
b3:
|
||||
// [16] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
// [16] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' ' -- pbuc1_derefidx_vbuz1=vbuc2
|
||||
lda #' '
|
||||
ldy.z idx_14
|
||||
sta SCREEN,y
|
||||
@ -520,7 +516,7 @@ print_person: {
|
||||
rts
|
||||
// print_person::@2
|
||||
b2:
|
||||
// [19] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuz3
|
||||
// [19] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuz3
|
||||
ldx.z idx_14
|
||||
ldy.z i
|
||||
lda (person_name),y
|
||||
@ -540,20 +536,20 @@ print_person: {
|
||||
.byte 0
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + (byte) print_person::person_id#2) [ idx#13 print_person::person_name#4 ] ( main:2::print_person:5 [ idx#13 print_person::person_name#4 ] main:2::print_person:7 [ idx#13 print_person::person_name#4 ] ) always clobbers reg byte a
|
||||
Statement [10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + (byte) print_person::person_id#2) [ idx#13 print_person::person_name#4 ] ( main:2::print_person:5 [ idx#13 print_person::person_name#4 ] main:2::print_person:7 [ idx#13 print_person::person_name#4 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ idx#13 idx#16 ]
|
||||
Statement [12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' [ print_person::person_name#4 idx#4 ] ( main:2::print_person:5 [ print_person::person_name#4 idx#4 ] main:2::print_person:7 [ print_person::person_name#4 idx#4 ] ) always clobbers reg byte a
|
||||
Statement [12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' [ print_person::person_name#4 idx#4 ] ( main:2::print_person:5 [ print_person::person_name#4 idx#4 ] main:2::print_person:7 [ print_person::person_name#4 idx#4 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:8 [ idx#4 ]
|
||||
Statement [15] if((byte) 0!=*((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2)) goto print_person::@2 [ print_person::person_name#4 print_person::i#2 idx#14 ] ( main:2::print_person:5 [ print_person::person_name#4 print_person::i#2 idx#14 ] main:2::print_person:7 [ print_person::person_name#4 print_person::i#2 idx#14 ] ) always clobbers reg byte a
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ print_person::i#2 print_person::i#1 ]
|
||||
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:7 [ idx#14 idx#5 idx#6 ]
|
||||
Statement [16] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' ' [ idx#14 ] ( main:2::print_person:5 [ idx#14 ] main:2::print_person:7 [ idx#14 ] ) always clobbers reg byte a
|
||||
Statement [19] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2) [ print_person::person_name#4 print_person::i#2 idx#14 ] ( main:2::print_person:5 [ print_person::person_name#4 print_person::i#2 idx#14 ] main:2::print_person:7 [ print_person::person_name#4 print_person::i#2 idx#14 ] ) always clobbers reg byte a
|
||||
Statement [10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + (byte) print_person::person_id#2) [ idx#13 print_person::person_name#4 ] ( main:2::print_person:5 [ idx#13 print_person::person_name#4 ] main:2::print_person:7 [ idx#13 print_person::person_name#4 ] ) always clobbers reg byte a
|
||||
Statement [12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' [ print_person::person_name#4 idx#4 ] ( main:2::print_person:5 [ print_person::person_name#4 idx#4 ] main:2::print_person:7 [ print_person::person_name#4 idx#4 ] ) always clobbers reg byte a
|
||||
Statement [16] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' ' [ idx#14 ] ( main:2::print_person:5 [ idx#14 ] main:2::print_person:7 [ idx#14 ] ) always clobbers reg byte a
|
||||
Statement [19] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2) [ print_person::person_name#4 print_person::i#2 idx#14 ] ( main:2::print_person:5 [ print_person::person_name#4 print_person::i#2 idx#14 ] main:2::print_person:7 [ print_person::person_name#4 print_person::i#2 idx#14 ] ) always clobbers reg byte a
|
||||
Statement [10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + (byte) print_person::person_id#2) [ idx#13 print_person::person_name#4 ] ( main:2::print_person:5 [ idx#13 print_person::person_name#4 ] main:2::print_person:7 [ idx#13 print_person::person_name#4 ] ) always clobbers reg byte a
|
||||
Statement [12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' [ print_person::person_name#4 idx#4 ] ( main:2::print_person:5 [ print_person::person_name#4 idx#4 ] main:2::print_person:7 [ print_person::person_name#4 idx#4 ] ) always clobbers reg byte a
|
||||
Statement [15] if((byte) 0!=*((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2)) goto print_person::@2 [ print_person::person_name#4 print_person::i#2 idx#14 ] ( main:2::print_person:5 [ print_person::person_name#4 print_person::i#2 idx#14 ] main:2::print_person:7 [ print_person::person_name#4 print_person::i#2 idx#14 ] ) always clobbers reg byte a
|
||||
Statement [16] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' ' [ idx#14 ] ( main:2::print_person:5 [ idx#14 ] main:2::print_person:7 [ idx#14 ] ) always clobbers reg byte a
|
||||
Statement [19] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2) [ print_person::person_name#4 print_person::i#2 idx#14 ] ( main:2::print_person:5 [ print_person::person_name#4 print_person::i#2 idx#14 ] main:2::print_person:7 [ print_person::person_name#4 print_person::i#2 idx#14 ] ) always clobbers reg byte a
|
||||
Statement [16] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' ' [ idx#14 ] ( main:2::print_person:5 [ idx#14 ] main:2::print_person:7 [ idx#14 ] ) always clobbers reg byte a
|
||||
Statement [19] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2) [ print_person::person_name#4 print_person::i#2 idx#14 ] ( main:2::print_person:5 [ print_person::person_name#4 print_person::i#2 idx#14 ] main:2::print_person:7 [ print_person::person_name#4 print_person::i#2 idx#14 ] ) always clobbers reg byte a
|
||||
Potential registers zp ZP_BYTE:2 [ print_person::person_id#2 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_BYTE:3 [ idx#13 idx#16 ] : zp ZP_BYTE:3 , reg byte x , reg byte y ,
|
||||
Potential registers zp ZP_WORD:4 [ print_person::person_name#4 ] : zp ZP_WORD:4 ,
|
||||
@ -648,14 +644,14 @@ main: {
|
||||
// print_person(byte register(X) person_id, byte[$10] zeropage(2) person_name)
|
||||
print_person: {
|
||||
.label person_name = 2
|
||||
// [10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + (byte) print_person::person_id#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuxx
|
||||
// [10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + (byte) print_person::person_id#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuxx
|
||||
lda DIGIT,x
|
||||
sta SCREEN,y
|
||||
// [11] (byte) idx#4 ← ++ (byte) idx#13 -- vbuxx=_inc_vbuyy
|
||||
tya
|
||||
tax
|
||||
inx
|
||||
// [12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,x
|
||||
// [13] (byte) idx#5 ← ++ (byte) idx#4 -- vbuxx=_inc_vbuxx
|
||||
@ -675,7 +671,7 @@ print_person: {
|
||||
jmp b3
|
||||
// print_person::@3
|
||||
b3:
|
||||
// [16] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [16] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,x
|
||||
// [17] (byte) idx#16 ← ++ (byte) idx#14 -- vbuyy=_inc_vbuxx
|
||||
@ -689,7 +685,7 @@ print_person: {
|
||||
rts
|
||||
// print_person::@2
|
||||
b2:
|
||||
// [19] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuyy
|
||||
// [19] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuyy
|
||||
lda (person_name),y
|
||||
sta SCREEN,x
|
||||
// [20] (byte) idx#6 ← ++ (byte) idx#14 -- vbuxx=_inc_vbuxx
|
||||
@ -741,12 +737,10 @@ FINAL SYMBOL TABLE
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte[]) DIGIT
|
||||
(const byte[]) DIGIT#0 DIGIT = (string) "0123456789"
|
||||
(const byte[]) DIGIT DIGIT = (string) "0123456789"
|
||||
(byte) Person::id
|
||||
(byte[$10]) Person::name
|
||||
(byte*) SCREEN
|
||||
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
|
||||
(const byte*) SCREEN SCREEN = (byte*) 1024
|
||||
(byte) idx
|
||||
(byte) idx#13 reg byte y 3.0
|
||||
(byte) idx#14 reg byte x 9.75
|
||||
@ -852,7 +846,7 @@ main: {
|
||||
print_person: {
|
||||
.label person_name = 2
|
||||
// SCREEN[idx++] = DIGIT[person.id]
|
||||
// [10] *((const byte*) SCREEN#0 + (byte) idx#13) ← *((const byte[]) DIGIT#0 + (byte) print_person::person_id#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuxx
|
||||
// [10] *((const byte*) SCREEN + (byte) idx#13) ← *((const byte[]) DIGIT + (byte) print_person::person_id#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuxx
|
||||
lda DIGIT,x
|
||||
sta SCREEN,y
|
||||
// SCREEN[idx++] = DIGIT[person.id];
|
||||
@ -861,7 +855,7 @@ print_person: {
|
||||
tax
|
||||
inx
|
||||
// SCREEN[idx++] = ' '
|
||||
// [12] *((const byte*) SCREEN#0 + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [12] *((const byte*) SCREEN + (byte) idx#4) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = ' ';
|
||||
@ -880,7 +874,7 @@ print_person: {
|
||||
bne b2
|
||||
// print_person::@3
|
||||
// SCREEN[idx++] = ' '
|
||||
// [16] *((const byte*) SCREEN#0 + (byte) idx#14) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
// [16] *((const byte*) SCREEN + (byte) idx#14) ← (byte) ' ' -- pbuc1_derefidx_vbuxx=vbuc2
|
||||
lda #' '
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = ' ';
|
||||
@ -895,7 +889,7 @@ print_person: {
|
||||
// print_person::@2
|
||||
b2:
|
||||
// SCREEN[idx++] = person.name[i]
|
||||
// [19] *((const byte*) SCREEN#0 + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuyy
|
||||
// [19] *((const byte*) SCREEN + (byte) idx#14) ← *((byte[$10]) print_person::person_name#4 + (byte) print_person::i#2) -- pbuc1_derefidx_vbuxx=pbuz1_derefidx_vbuyy
|
||||
lda (person_name),y
|
||||
sta SCREEN,x
|
||||
// SCREEN[idx++] = person.name[i];
|
||||
|
@ -1,12 +1,10 @@
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte[]) DIGIT
|
||||
(const byte[]) DIGIT#0 DIGIT = (string) "0123456789"
|
||||
(const byte[]) DIGIT DIGIT = (string) "0123456789"
|
||||
(byte) Person::id
|
||||
(byte[$10]) Person::name
|
||||
(byte*) SCREEN
|
||||
(const byte*) SCREEN#0 SCREEN = (byte*) 1024
|
||||
(const byte*) SCREEN SCREEN = (byte*) 1024
|
||||
(byte) idx
|
||||
(byte) idx#13 reg byte y 3.0
|
||||
(byte) idx#14 reg byte x 9.75
|
||||
|
Loading…
x
Reference in New Issue
Block a user