1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-06-11 01:29:36 +00:00
kickc/src/test/ref/constants.log

2951 lines
176 KiB
Plaintext
Raw Normal View History

Inlined call call __init
Eliminating unused variable with no statement memset::$2
Eliminating unused variable with no statement test_bytes::$1
Eliminating unused variable with no statement test_sbytes::$1
Eliminating unused variable with no statement test_sbytes::$3
Eliminating unused variable with no statement test_sbytes::$5
2018-08-22 22:24:32 +00:00
CONTROL FLOW GRAPH SSA
void print_str(char *str)
print_str: scope:[print_str] from assert_byte assert_byte::@1 assert_byte::@3 assert_byte::@4 assert_sbyte assert_sbyte::@1 assert_sbyte::@3 assert_sbyte::@4
2020-10-05 20:58:02 +00:00
print_char_cursor#87 = phi( assert_byte/print_char_cursor#77, assert_byte::@1/print_char_cursor#78, assert_byte::@3/print_char_cursor#79, assert_byte::@4/print_char_cursor#16, assert_sbyte/print_char_cursor#82, assert_sbyte::@1/print_char_cursor#83, assert_sbyte::@3/print_char_cursor#84, assert_sbyte::@4/print_char_cursor#28 )
print_str::str#12 = phi( assert_byte/print_str::str#1, assert_byte::@1/print_str::str#3, assert_byte::@3/print_str::str#4, assert_byte::@4/print_str::str#2, assert_sbyte/print_str::str#5, assert_sbyte::@1/print_str::str#7, assert_sbyte::@3/print_str::str#8, assert_sbyte::@4/print_str::str#6 )
to:print_str::@1
print_str::@1: scope:[print_str] from print_str print_str::@3
2020-10-05 20:58:02 +00:00
print_char_cursor#73 = phi( print_str/print_char_cursor#87, print_str::@3/print_char_cursor#0 )
print_str::str#9 = phi( print_str/print_str::str#12, print_str::@3/print_str::str#0 )
print_str::$1 = 0 != *print_str::str#9
if(print_str::$1) goto print_str::@2
to:print_str::@return
print_str::@2: scope:[print_str] from print_str::@1
2020-10-05 20:58:02 +00:00
print_char_cursor#72 = phi( print_str::@1/print_char_cursor#73 )
print_str::str#10 = phi( print_str::@1/print_str::str#9 )
print_char::ch#0 = *print_str::str#10
call print_char
to:print_str::@3
print_str::@3: scope:[print_str] from print_str::@2
2020-10-05 20:58:02 +00:00
print_str::str#11 = phi( print_str::@2/print_str::str#10 )
print_char_cursor#37 = phi( print_str::@2/print_char_cursor#5 )
print_char_cursor#0 = print_char_cursor#37
print_str::str#0 = ++ print_str::str#11
to:print_str::@1
print_str::@return: scope:[print_str] from print_str::@1
2020-10-05 20:58:02 +00:00
print_char_cursor#38 = phi( print_str::@1/print_char_cursor#73 )
print_char_cursor#1 = print_char_cursor#38
return
to:@return
2020-10-05 20:58:02 +00:00
void print_ln()
print_ln: scope:[print_ln] from assert_byte::@2 assert_sbyte::@2
2020-10-05 20:58:02 +00:00
print_char_cursor#74 = phi( assert_byte::@2/print_char_cursor#80, assert_sbyte::@2/print_char_cursor#85 )
print_line_cursor#49 = phi( assert_byte::@2/print_line_cursor#52, assert_sbyte::@2/print_line_cursor#54 )
to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
2020-10-05 20:58:02 +00:00
print_char_cursor#39 = phi( print_ln/print_char_cursor#74, print_ln::@1/print_char_cursor#39 )
print_line_cursor#25 = phi( print_ln/print_line_cursor#49, print_ln::@1/print_line_cursor#0 )
print_ln::$0 = print_line_cursor#25 + $28
print_line_cursor#0 = print_ln::$0
print_ln::$1 = print_line_cursor#0 < print_char_cursor#39
if(print_ln::$1) goto print_ln::@1
to:print_ln::@2
print_ln::@2: scope:[print_ln] from print_ln::@1
2020-10-05 20:58:02 +00:00
print_line_cursor#26 = phi( print_ln::@1/print_line_cursor#0 )
print_char_cursor#2 = print_line_cursor#26
to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@2
2020-10-05 20:58:02 +00:00
print_char_cursor#40 = phi( print_ln::@2/print_char_cursor#2 )
print_line_cursor#27 = phi( print_ln::@2/print_line_cursor#26 )
print_line_cursor#1 = print_line_cursor#27
print_char_cursor#3 = print_char_cursor#40
return
to:@return
void print_char(char ch)
print_char: scope:[print_char] from print_str::@2
2020-10-05 20:58:02 +00:00
print_char_cursor#41 = phi( print_str::@2/print_char_cursor#72 )
print_char::ch#1 = phi( print_str::@2/print_char::ch#0 )
*print_char_cursor#41 = print_char::ch#1
print_char_cursor#4 = ++ print_char_cursor#41
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
2020-10-05 20:58:02 +00:00
print_char_cursor#42 = phi( print_char/print_char_cursor#4 )
print_char_cursor#5 = print_char_cursor#42
return
to:@return
2020-10-05 20:58:02 +00:00
void print_cls()
print_cls: scope:[print_cls] from main
2020-10-05 20:58:02 +00:00
print_screen#2 = phi( main/print_screen#5 )
memset::str#0 = (void *)print_screen#2
2020-10-05 20:58:02 +00:00
memset::c#0 = ' '
memset::num#0 = $3e8
call memset
memset::return#0 = memset::return#2
to:print_cls::@1
print_cls::@1: scope:[print_cls] from print_cls
2020-10-05 20:58:02 +00:00
print_screen#3 = phi( print_cls/print_screen#2 )
print_line_cursor#2 = print_screen#3
print_char_cursor#6 = print_line_cursor#2
to:print_cls::@return
print_cls::@return: scope:[print_cls] from print_cls::@1
2020-10-05 20:58:02 +00:00
print_char_cursor#43 = phi( print_cls::@1/print_char_cursor#6 )
print_line_cursor#28 = phi( print_cls::@1/print_line_cursor#2 )
print_line_cursor#3 = print_line_cursor#28
print_char_cursor#7 = print_char_cursor#43
return
to:@return
void * memset(void *str , char c , unsigned int num)
memset: scope:[memset] from print_cls
memset::c#4 = phi( print_cls/memset::c#0 )
memset::str#3 = phi( print_cls/memset::str#0 )
memset::num#1 = phi( print_cls/memset::num#0 )
memset::$0 = memset::num#1 > 0
memset::$1 = ! memset::$0
if(memset::$1) goto memset::@1
to:memset::@2
memset::@1: scope:[memset] from memset memset::@3
memset::str#1 = phi( memset/memset::str#3, memset::@3/memset::str#4 )
memset::return#1 = memset::str#1
to:memset::@return
memset::@2: scope:[memset] from memset
memset::c#3 = phi( memset/memset::c#4 )
memset::num#2 = phi( memset/memset::num#1 )
memset::str#2 = phi( memset/memset::str#3 )
memset::$4 = (char *)memset::str#2
memset::end#0 = memset::$4 + memset::num#2
memset::dst#0 = ((char *)) memset::str#2
to:memset::@3
memset::@3: scope:[memset] from memset::@2 memset::@4
memset::c#2 = phi( memset::@2/memset::c#3, memset::@4/memset::c#1 )
memset::str#4 = phi( memset::@2/memset::str#2, memset::@4/memset::str#5 )
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
memset::$3 = memset::dst#2 != memset::end#1
if(memset::$3) goto memset::@4
to:memset::@1
memset::@4: scope:[memset] from memset::@3
memset::str#5 = phi( memset::@3/memset::str#4 )
memset::end#2 = phi( memset::@3/memset::end#1 )
memset::dst#3 = phi( memset::@3/memset::dst#2 )
memset::c#1 = phi( memset::@3/memset::c#2 )
*memset::dst#3 = memset::c#1
memset::dst#1 = ++ memset::dst#3
to:memset::@3
memset::@return: scope:[memset] from memset::@1
memset::return#3 = phi( memset::@1/memset::return#1 )
memset::return#2 = memset::return#3
return
to:@return
2020-10-05 20:58:02 +00:00
void main()
main: scope:[main] from __start::@1
2020-10-05 20:58:02 +00:00
print_char_cursor#75 = phi( __start::@1/print_char_cursor#86 )
print_line_cursor#50 = phi( __start::@1/print_line_cursor#55 )
print_screen#5 = phi( __start::@1/print_screen#7 )
call print_cls
to:main::@1
main::@1: scope:[main] from main
2020-10-05 20:58:02 +00:00
print_char_cursor#44 = phi( main/print_char_cursor#7 )
print_line_cursor#29 = phi( main/print_line_cursor#3 )
print_line_cursor#4 = print_line_cursor#29
print_char_cursor#8 = print_char_cursor#44
*BG_COLOR = GREEN
call test_bytes
to:main::@2
main::@2: scope:[main] from main::@1
2020-10-05 20:58:02 +00:00
print_line_cursor#30 = phi( main::@1/print_line_cursor#11 )
print_char_cursor#45 = phi( main::@1/print_char_cursor#15 )
print_char_cursor#9 = print_char_cursor#45
print_line_cursor#5 = print_line_cursor#30
call test_sbytes
to:main::@3
main::@3: scope:[main] from main::@2
2020-10-05 20:58:02 +00:00
print_line_cursor#31 = phi( main::@2/print_line_cursor#19 )
print_char_cursor#46 = phi( main::@2/print_char_cursor#27 )
print_char_cursor#10 = print_char_cursor#46
print_line_cursor#6 = print_line_cursor#31
to:main::@return
main::@return: scope:[main] from main::@3
2020-10-05 20:58:02 +00:00
print_char_cursor#47 = phi( main::@3/print_char_cursor#10 )
print_line_cursor#32 = phi( main::@3/print_line_cursor#6 )
print_line_cursor#7 = print_line_cursor#32
print_char_cursor#11 = print_char_cursor#47
return
to:@return
2020-10-05 20:58:02 +00:00
void test_bytes()
test_bytes: scope:[test_bytes] from main::@1
2020-10-05 20:58:02 +00:00
print_line_cursor#51 = phi( main::@1/print_line_cursor#4 )
print_char_cursor#76 = phi( main::@1/print_char_cursor#8 )
assert_byte::msg#0 = test_bytes::msg
assert_byte::b#0 = test_bytes::bb
assert_byte::c#0 = 0
call assert_byte
to:test_bytes::@1
test_bytes::@1: scope:[test_bytes] from test_bytes
2020-10-05 20:58:02 +00:00
print_line_cursor#33 = phi( test_bytes/print_line_cursor#13 )
print_char_cursor#48 = phi( test_bytes/print_char_cursor#21 )
print_char_cursor#12 = print_char_cursor#48
print_line_cursor#8 = print_line_cursor#33
test_bytes::bc#0 = test_bytes::bb + 2
2020-10-05 20:58:02 +00:00
assert_byte::msg#1 = test_bytes::msg1
assert_byte::b#1 = test_bytes::bc#0
assert_byte::c#1 = 2
call assert_byte
to:test_bytes::@2
test_bytes::@2: scope:[test_bytes] from test_bytes::@1
2020-10-05 20:58:02 +00:00
test_bytes::bc#1 = phi( test_bytes::@1/test_bytes::bc#0 )
print_line_cursor#34 = phi( test_bytes::@1/print_line_cursor#13 )
print_char_cursor#49 = phi( test_bytes::@1/print_char_cursor#21 )
print_char_cursor#13 = print_char_cursor#49
print_line_cursor#9 = print_line_cursor#34
test_bytes::$5 = (signed char)test_bytes::bc#1
2020-10-05 20:58:02 +00:00
test_bytes::$3 = test_bytes::$5 - 4
test_bytes::bd#0 = (char)test_bytes::$3
2020-10-05 20:58:02 +00:00
assert_byte::msg#2 = test_bytes::msg2
assert_byte::b#2 = test_bytes::bd#0
assert_byte::c#2 = $fe
call assert_byte
to:test_bytes::@3
test_bytes::@3: scope:[test_bytes] from test_bytes::@2
2020-10-05 20:58:02 +00:00
print_line_cursor#35 = phi( test_bytes::@2/print_line_cursor#13 )
print_char_cursor#50 = phi( test_bytes::@2/print_char_cursor#21 )
print_char_cursor#14 = print_char_cursor#50
print_line_cursor#10 = print_line_cursor#35
to:test_bytes::@return
test_bytes::@return: scope:[test_bytes] from test_bytes::@3
2020-10-05 20:58:02 +00:00
print_line_cursor#36 = phi( test_bytes::@3/print_line_cursor#10 )
print_char_cursor#51 = phi( test_bytes::@3/print_char_cursor#14 )
print_char_cursor#15 = print_char_cursor#51
print_line_cursor#11 = print_line_cursor#36
return
to:@return
void assert_byte(char *msg , char b , char c)
assert_byte: scope:[assert_byte] from test_bytes test_bytes::@1 test_bytes::@2
2020-10-05 20:58:02 +00:00
print_line_cursor#68 = phi( test_bytes/print_line_cursor#51, test_bytes::@1/print_line_cursor#8, test_bytes::@2/print_line_cursor#9 )
assert_byte::c#5 = phi( test_bytes/assert_byte::c#0, test_bytes::@1/assert_byte::c#1, test_bytes::@2/assert_byte::c#2 )
assert_byte::b#5 = phi( test_bytes/assert_byte::b#0, test_bytes::@1/assert_byte::b#1, test_bytes::@2/assert_byte::b#2 )
print_char_cursor#77 = phi( test_bytes/print_char_cursor#76, test_bytes::@1/print_char_cursor#12, test_bytes::@2/print_char_cursor#13 )
assert_byte::msg#3 = phi( test_bytes/assert_byte::msg#0, test_bytes::@1/assert_byte::msg#1, test_bytes::@2/assert_byte::msg#2 )
print_str::str#1 = assert_byte::msg#3
call print_str
to:assert_byte::@4
assert_byte::@4: scope:[assert_byte] from assert_byte
2020-10-05 20:58:02 +00:00
print_line_cursor#66 = phi( assert_byte/print_line_cursor#68 )
assert_byte::c#4 = phi( assert_byte/assert_byte::c#5 )
assert_byte::b#4 = phi( assert_byte/assert_byte::b#5 )
print_char_cursor#52 = phi( assert_byte/print_char_cursor#1 )
print_char_cursor#16 = print_char_cursor#52
print_str::str#2 = assert_byte::str
call print_str
to:assert_byte::@5
assert_byte::@5: scope:[assert_byte] from assert_byte::@4
2020-10-05 20:58:02 +00:00
print_line_cursor#64 = phi( assert_byte::@4/print_line_cursor#66 )
assert_byte::c#3 = phi( assert_byte::@4/assert_byte::c#4 )
assert_byte::b#3 = phi( assert_byte::@4/assert_byte::b#4 )
print_char_cursor#53 = phi( assert_byte::@4/print_char_cursor#1 )
print_char_cursor#17 = print_char_cursor#53
assert_byte::$2 = assert_byte::b#3 != assert_byte::c#3
if(assert_byte::$2) goto assert_byte::@1
to:assert_byte::@3
assert_byte::@1: scope:[assert_byte] from assert_byte::@5
2020-10-05 20:58:02 +00:00
print_line_cursor#60 = phi( assert_byte::@5/print_line_cursor#64 )
print_char_cursor#78 = phi( assert_byte::@5/print_char_cursor#17 )
*BG_COLOR = RED
print_str::str#3 = assert_byte::str1
call print_str
to:assert_byte::@6
assert_byte::@6: scope:[assert_byte] from assert_byte::@1
2020-10-05 20:58:02 +00:00
print_line_cursor#56 = phi( assert_byte::@1/print_line_cursor#60 )
print_char_cursor#54 = phi( assert_byte::@1/print_char_cursor#1 )
print_char_cursor#18 = print_char_cursor#54
to:assert_byte::@2
assert_byte::@3: scope:[assert_byte] from assert_byte::@5
2020-10-05 20:58:02 +00:00
print_line_cursor#61 = phi( assert_byte::@5/print_line_cursor#64 )
print_char_cursor#79 = phi( assert_byte::@5/print_char_cursor#17 )
print_str::str#4 = assert_byte::str2
call print_str
to:assert_byte::@7
assert_byte::@7: scope:[assert_byte] from assert_byte::@3
2020-10-05 20:58:02 +00:00
print_line_cursor#57 = phi( assert_byte::@3/print_line_cursor#61 )
print_char_cursor#55 = phi( assert_byte::@3/print_char_cursor#1 )
print_char_cursor#19 = print_char_cursor#55
to:assert_byte::@2
assert_byte::@2: scope:[assert_byte] from assert_byte::@6 assert_byte::@7
2020-10-05 20:58:02 +00:00
print_char_cursor#80 = phi( assert_byte::@6/print_char_cursor#18, assert_byte::@7/print_char_cursor#19 )
print_line_cursor#52 = phi( assert_byte::@6/print_line_cursor#56, assert_byte::@7/print_line_cursor#57 )
call print_ln
to:assert_byte::@8
assert_byte::@8: scope:[assert_byte] from assert_byte::@2
2020-10-05 20:58:02 +00:00
print_char_cursor#56 = phi( assert_byte::@2/print_char_cursor#3 )
print_line_cursor#37 = phi( assert_byte::@2/print_line_cursor#1 )
print_line_cursor#12 = print_line_cursor#37
print_char_cursor#20 = print_char_cursor#56
to:assert_byte::@return
assert_byte::@return: scope:[assert_byte] from assert_byte::@8
2020-10-05 20:58:02 +00:00
print_line_cursor#38 = phi( assert_byte::@8/print_line_cursor#12 )
print_char_cursor#57 = phi( assert_byte::@8/print_char_cursor#20 )
print_char_cursor#21 = print_char_cursor#57
print_line_cursor#13 = print_line_cursor#38
return
to:@return
2020-10-05 20:58:02 +00:00
void test_sbytes()
test_sbytes: scope:[test_sbytes] from main::@2
2020-10-05 20:58:02 +00:00
print_line_cursor#53 = phi( main::@2/print_line_cursor#5 )
print_char_cursor#81 = phi( main::@2/print_char_cursor#9 )
assert_sbyte::msg#0 = test_sbytes::msg
assert_sbyte::b#0 = test_sbytes::bb
assert_sbyte::c#0 = 0
call assert_sbyte
to:test_sbytes::@1
test_sbytes::@1: scope:[test_sbytes] from test_sbytes
2020-10-05 20:58:02 +00:00
print_line_cursor#39 = phi( test_sbytes/print_line_cursor#21 )
print_char_cursor#58 = phi( test_sbytes/print_char_cursor#33 )
print_char_cursor#22 = print_char_cursor#58
print_line_cursor#14 = print_line_cursor#39
test_sbytes::bc#0 = test_sbytes::bb + 2
2020-10-05 20:58:02 +00:00
assert_sbyte::msg#1 = test_sbytes::msg1
assert_sbyte::b#1 = test_sbytes::bc#0
assert_sbyte::c#1 = 2
call assert_sbyte
to:test_sbytes::@2
test_sbytes::@2: scope:[test_sbytes] from test_sbytes::@1
2020-10-05 20:58:02 +00:00
test_sbytes::bc#1 = phi( test_sbytes::@1/test_sbytes::bc#0 )
print_line_cursor#40 = phi( test_sbytes::@1/print_line_cursor#21 )
print_char_cursor#59 = phi( test_sbytes::@1/print_char_cursor#33 )
print_char_cursor#23 = print_char_cursor#59
print_line_cursor#15 = print_line_cursor#40
test_sbytes::bd#0 = test_sbytes::bc#1 - 4
2020-10-05 20:58:02 +00:00
assert_sbyte::msg#2 = test_sbytes::msg2
assert_sbyte::b#2 = test_sbytes::bd#0
assert_sbyte::c#2 = -2
call assert_sbyte
to:test_sbytes::@3
test_sbytes::@3: scope:[test_sbytes] from test_sbytes::@2
2020-10-05 20:58:02 +00:00
test_sbytes::bd#1 = phi( test_sbytes::@2/test_sbytes::bd#0 )
print_line_cursor#41 = phi( test_sbytes::@2/print_line_cursor#21 )
print_char_cursor#60 = phi( test_sbytes::@2/print_char_cursor#33 )
print_char_cursor#24 = print_char_cursor#60
print_line_cursor#16 = print_line_cursor#41
test_sbytes::be#0 = - test_sbytes::bd#1
2020-10-05 20:58:02 +00:00
assert_sbyte::msg#3 = test_sbytes::msg3
assert_sbyte::b#3 = test_sbytes::be#0
assert_sbyte::c#3 = 2
call assert_sbyte
to:test_sbytes::@4
test_sbytes::@4: scope:[test_sbytes] from test_sbytes::@3
2020-10-05 20:58:02 +00:00
print_line_cursor#42 = phi( test_sbytes::@3/print_line_cursor#21 )
print_char_cursor#61 = phi( test_sbytes::@3/print_char_cursor#33 )
print_char_cursor#25 = print_char_cursor#61
print_line_cursor#17 = print_line_cursor#42
assert_sbyte::msg#4 = test_sbytes::msg4
assert_sbyte::b#4 = test_sbytes::bf
assert_sbyte::c#4 = 2
call assert_sbyte
to:test_sbytes::@5
test_sbytes::@5: scope:[test_sbytes] from test_sbytes::@4
2020-10-05 20:58:02 +00:00
print_line_cursor#43 = phi( test_sbytes::@4/print_line_cursor#21 )
print_char_cursor#62 = phi( test_sbytes::@4/print_char_cursor#33 )
print_char_cursor#26 = print_char_cursor#62
print_line_cursor#18 = print_line_cursor#43
to:test_sbytes::@return
test_sbytes::@return: scope:[test_sbytes] from test_sbytes::@5
2020-10-05 20:58:02 +00:00
print_line_cursor#44 = phi( test_sbytes::@5/print_line_cursor#18 )
print_char_cursor#63 = phi( test_sbytes::@5/print_char_cursor#26 )
print_char_cursor#27 = print_char_cursor#63
print_line_cursor#19 = print_line_cursor#44
return
to:@return
void assert_sbyte(char *msg , signed char b , signed char c)
assert_sbyte: scope:[assert_sbyte] from test_sbytes test_sbytes::@1 test_sbytes::@2 test_sbytes::@3 test_sbytes::@4
2020-10-05 20:58:02 +00:00
print_line_cursor#69 = phi( test_sbytes/print_line_cursor#53, test_sbytes::@1/print_line_cursor#14, test_sbytes::@2/print_line_cursor#15, test_sbytes::@3/print_line_cursor#16, test_sbytes::@4/print_line_cursor#17 )
assert_sbyte::c#7 = phi( test_sbytes/assert_sbyte::c#0, test_sbytes::@1/assert_sbyte::c#1, test_sbytes::@2/assert_sbyte::c#2, test_sbytes::@3/assert_sbyte::c#3, test_sbytes::@4/assert_sbyte::c#4 )
assert_sbyte::b#7 = phi( test_sbytes/assert_sbyte::b#0, test_sbytes::@1/assert_sbyte::b#1, test_sbytes::@2/assert_sbyte::b#2, test_sbytes::@3/assert_sbyte::b#3, test_sbytes::@4/assert_sbyte::b#4 )
print_char_cursor#82 = phi( test_sbytes/print_char_cursor#81, test_sbytes::@1/print_char_cursor#22, test_sbytes::@2/print_char_cursor#23, test_sbytes::@3/print_char_cursor#24, test_sbytes::@4/print_char_cursor#25 )
assert_sbyte::msg#5 = phi( test_sbytes/assert_sbyte::msg#0, test_sbytes::@1/assert_sbyte::msg#1, test_sbytes::@2/assert_sbyte::msg#2, test_sbytes::@3/assert_sbyte::msg#3, test_sbytes::@4/assert_sbyte::msg#4 )
print_str::str#5 = assert_sbyte::msg#5
call print_str
to:assert_sbyte::@4
assert_sbyte::@4: scope:[assert_sbyte] from assert_sbyte
2020-10-05 20:58:02 +00:00
print_line_cursor#67 = phi( assert_sbyte/print_line_cursor#69 )
assert_sbyte::c#6 = phi( assert_sbyte/assert_sbyte::c#7 )
assert_sbyte::b#6 = phi( assert_sbyte/assert_sbyte::b#7 )
print_char_cursor#64 = phi( assert_sbyte/print_char_cursor#1 )
print_char_cursor#28 = print_char_cursor#64
print_str::str#6 = assert_sbyte::str
call print_str
to:assert_sbyte::@5
assert_sbyte::@5: scope:[assert_sbyte] from assert_sbyte::@4
2020-10-05 20:58:02 +00:00
print_line_cursor#65 = phi( assert_sbyte::@4/print_line_cursor#67 )
assert_sbyte::c#5 = phi( assert_sbyte::@4/assert_sbyte::c#6 )
assert_sbyte::b#5 = phi( assert_sbyte::@4/assert_sbyte::b#6 )
print_char_cursor#65 = phi( assert_sbyte::@4/print_char_cursor#1 )
print_char_cursor#29 = print_char_cursor#65
assert_sbyte::$2 = assert_sbyte::b#5 != assert_sbyte::c#5
if(assert_sbyte::$2) goto assert_sbyte::@1
to:assert_sbyte::@3
assert_sbyte::@1: scope:[assert_sbyte] from assert_sbyte::@5
2020-10-05 20:58:02 +00:00
print_line_cursor#62 = phi( assert_sbyte::@5/print_line_cursor#65 )
print_char_cursor#83 = phi( assert_sbyte::@5/print_char_cursor#29 )
*BG_COLOR = RED
print_str::str#7 = assert_sbyte::str1
call print_str
to:assert_sbyte::@6
assert_sbyte::@6: scope:[assert_sbyte] from assert_sbyte::@1
2020-10-05 20:58:02 +00:00
print_line_cursor#58 = phi( assert_sbyte::@1/print_line_cursor#62 )
print_char_cursor#66 = phi( assert_sbyte::@1/print_char_cursor#1 )
print_char_cursor#30 = print_char_cursor#66
to:assert_sbyte::@2
assert_sbyte::@3: scope:[assert_sbyte] from assert_sbyte::@5
2020-10-05 20:58:02 +00:00
print_line_cursor#63 = phi( assert_sbyte::@5/print_line_cursor#65 )
print_char_cursor#84 = phi( assert_sbyte::@5/print_char_cursor#29 )
print_str::str#8 = assert_sbyte::str2
call print_str
to:assert_sbyte::@7
assert_sbyte::@7: scope:[assert_sbyte] from assert_sbyte::@3
2020-10-05 20:58:02 +00:00
print_line_cursor#59 = phi( assert_sbyte::@3/print_line_cursor#63 )
print_char_cursor#67 = phi( assert_sbyte::@3/print_char_cursor#1 )
print_char_cursor#31 = print_char_cursor#67
to:assert_sbyte::@2
assert_sbyte::@2: scope:[assert_sbyte] from assert_sbyte::@6 assert_sbyte::@7
2020-10-05 20:58:02 +00:00
print_char_cursor#85 = phi( assert_sbyte::@6/print_char_cursor#30, assert_sbyte::@7/print_char_cursor#31 )
print_line_cursor#54 = phi( assert_sbyte::@6/print_line_cursor#58, assert_sbyte::@7/print_line_cursor#59 )
call print_ln
to:assert_sbyte::@8
assert_sbyte::@8: scope:[assert_sbyte] from assert_sbyte::@2
2020-10-05 20:58:02 +00:00
print_char_cursor#68 = phi( assert_sbyte::@2/print_char_cursor#3 )
print_line_cursor#45 = phi( assert_sbyte::@2/print_line_cursor#1 )
print_line_cursor#20 = print_line_cursor#45
print_char_cursor#32 = print_char_cursor#68
to:assert_sbyte::@return
assert_sbyte::@return: scope:[assert_sbyte] from assert_sbyte::@8
2020-10-05 20:58:02 +00:00
print_line_cursor#46 = phi( assert_sbyte::@8/print_line_cursor#20 )
print_char_cursor#69 = phi( assert_sbyte::@8/print_char_cursor#32 )
print_char_cursor#33 = print_char_cursor#69
print_line_cursor#21 = print_line_cursor#46
return
to:@return
2020-06-27 19:18:00 +00:00
2020-10-05 20:58:02 +00:00
void __start()
__start: scope:[__start] from
to:__start::__init1
__start::__init1: scope:[__start] from __start
print_screen#0 = (char *)$400
2020-10-05 20:58:02 +00:00
print_line_cursor#22 = print_screen#0
print_char_cursor#34 = print_line_cursor#22
to:__start::@1
__start::@1: scope:[__start] from __start::__init1
2020-10-05 20:58:02 +00:00
print_screen#7 = phi( __start::__init1/print_screen#0 )
print_char_cursor#86 = phi( __start::__init1/print_char_cursor#34 )
print_line_cursor#55 = phi( __start::__init1/print_line_cursor#22 )
call main
to:__start::@2
__start::@2: scope:[__start] from __start::@1
2020-10-05 20:58:02 +00:00
print_screen#6 = phi( __start::@1/print_screen#7 )
print_char_cursor#70 = phi( __start::@1/print_char_cursor#11 )
print_line_cursor#47 = phi( __start::@1/print_line_cursor#7 )
print_line_cursor#23 = print_line_cursor#47
print_char_cursor#35 = print_char_cursor#70
to:__start::@return
__start::@return: scope:[__start] from __start::@2
2020-10-05 20:58:02 +00:00
print_char_cursor#71 = phi( __start::@2/print_char_cursor#35 )
print_line_cursor#48 = phi( __start::@2/print_line_cursor#23 )
print_screen#4 = phi( __start::@2/print_screen#6 )
print_screen#1 = print_screen#4
print_line_cursor#24 = print_line_cursor#48
print_char_cursor#36 = print_char_cursor#71
2020-06-27 19:18:00 +00:00
return
to:@return
2017-12-29 10:21:11 +00:00
SYMBOL TABLE SSA
__constant char * const BG_COLOR = (char *)$d021
__constant const char GREEN = 5
__constant char RADIX::BINARY = 2
__constant char RADIX::DECIMAL = $a
__constant char RADIX::HEXADECIMAL = $10
__constant char RADIX::OCTAL = 8
__constant const char RED = 2
2020-10-05 20:58:02 +00:00
void __start()
void assert_byte(char *msg , char b , char c)
bool assert_byte::$2
char assert_byte::b
char assert_byte::b#0
char assert_byte::b#1
char assert_byte::b#2
char assert_byte::b#3
char assert_byte::b#4
char assert_byte::b#5
char assert_byte::c
char assert_byte::c#0
char assert_byte::c#1
char assert_byte::c#2
char assert_byte::c#3
char assert_byte::c#4
char assert_byte::c#5
char *assert_byte::msg
char *assert_byte::msg#0
char *assert_byte::msg#1
char *assert_byte::msg#2
char *assert_byte::msg#3
__constant char assert_byte::str[2] = " "
__constant char assert_byte::str1[6] = "fail!"
__constant char assert_byte::str2[3] = "ok"
void assert_sbyte(char *msg , signed char b , signed char c)
bool assert_sbyte::$2
signed char assert_sbyte::b
signed char assert_sbyte::b#0
signed char assert_sbyte::b#1
signed char assert_sbyte::b#2
signed char assert_sbyte::b#3
signed char assert_sbyte::b#4
signed char assert_sbyte::b#5
signed char assert_sbyte::b#6
signed char assert_sbyte::b#7
signed char assert_sbyte::c
signed char assert_sbyte::c#0
signed char assert_sbyte::c#1
signed char assert_sbyte::c#2
signed char assert_sbyte::c#3
signed char assert_sbyte::c#4
signed char assert_sbyte::c#5
signed char assert_sbyte::c#6
signed char assert_sbyte::c#7
char *assert_sbyte::msg
char *assert_sbyte::msg#0
char *assert_sbyte::msg#1
char *assert_sbyte::msg#2
char *assert_sbyte::msg#3
char *assert_sbyte::msg#4
char *assert_sbyte::msg#5
__constant char assert_sbyte::str[2] = " "
__constant char assert_sbyte::str1[6] = "fail!"
__constant char assert_sbyte::str2[3] = "ok"
2020-10-05 20:58:02 +00:00
void main()
void * memset(void *str , char c , unsigned int num)
bool memset::$0
bool memset::$1
bool memset::$3
char *memset::$4
char memset::c
char memset::c#0
char memset::c#1
char memset::c#2
char memset::c#3
char memset::c#4
char *memset::dst
char *memset::dst#0
char *memset::dst#1
char *memset::dst#2
char *memset::dst#3
char *memset::end
char *memset::end#0
char *memset::end#1
char *memset::end#2
unsigned int memset::num
unsigned int memset::num#0
unsigned int memset::num#1
unsigned int memset::num#2
void *memset::return
void *memset::return#0
void *memset::return#1
void *memset::return#2
void *memset::return#3
void *memset::str
void *memset::str#0
void *memset::str#1
void *memset::str#2
void *memset::str#3
void *memset::str#4
void *memset::str#5
void print_char(char ch)
char print_char::ch
char print_char::ch#0
char print_char::ch#1
char *print_char_cursor
char *print_char_cursor#0
char *print_char_cursor#1
char *print_char_cursor#10
char *print_char_cursor#11
char *print_char_cursor#12
char *print_char_cursor#13
char *print_char_cursor#14
char *print_char_cursor#15
char *print_char_cursor#16
char *print_char_cursor#17
char *print_char_cursor#18
char *print_char_cursor#19
char *print_char_cursor#2
char *print_char_cursor#20
char *print_char_cursor#21
char *print_char_cursor#22
char *print_char_cursor#23
char *print_char_cursor#24
char *print_char_cursor#25
char *print_char_cursor#26
char *print_char_cursor#27
char *print_char_cursor#28
char *print_char_cursor#29
char *print_char_cursor#3
char *print_char_cursor#30
char *print_char_cursor#31
char *print_char_cursor#32
char *print_char_cursor#33
char *print_char_cursor#34
char *print_char_cursor#35
char *print_char_cursor#36
char *print_char_cursor#37
char *print_char_cursor#38
char *print_char_cursor#39
char *print_char_cursor#4
char *print_char_cursor#40
char *print_char_cursor#41
char *print_char_cursor#42
char *print_char_cursor#43
char *print_char_cursor#44
char *print_char_cursor#45
char *print_char_cursor#46
char *print_char_cursor#47
char *print_char_cursor#48
char *print_char_cursor#49
char *print_char_cursor#5
char *print_char_cursor#50
char *print_char_cursor#51
char *print_char_cursor#52
char *print_char_cursor#53
char *print_char_cursor#54
char *print_char_cursor#55
char *print_char_cursor#56
char *print_char_cursor#57
char *print_char_cursor#58
char *print_char_cursor#59
char *print_char_cursor#6
char *print_char_cursor#60
char *print_char_cursor#61
char *print_char_cursor#62
char *print_char_cursor#63
char *print_char_cursor#64
char *print_char_cursor#65
char *print_char_cursor#66
char *print_char_cursor#67
char *print_char_cursor#68
char *print_char_cursor#69
char *print_char_cursor#7
char *print_char_cursor#70
char *print_char_cursor#71
char *print_char_cursor#72
char *print_char_cursor#73
char *print_char_cursor#74
char *print_char_cursor#75
char *print_char_cursor#76
char *print_char_cursor#77
char *print_char_cursor#78
char *print_char_cursor#79
char *print_char_cursor#8
char *print_char_cursor#80
char *print_char_cursor#81
char *print_char_cursor#82
char *print_char_cursor#83
char *print_char_cursor#84
char *print_char_cursor#85
char *print_char_cursor#86
char *print_char_cursor#87
char *print_char_cursor#9
2020-10-05 20:58:02 +00:00
void print_cls()
char *print_line_cursor
char *print_line_cursor#0
char *print_line_cursor#1
char *print_line_cursor#10
char *print_line_cursor#11
char *print_line_cursor#12
char *print_line_cursor#13
char *print_line_cursor#14
char *print_line_cursor#15
char *print_line_cursor#16
char *print_line_cursor#17
char *print_line_cursor#18
char *print_line_cursor#19
char *print_line_cursor#2
char *print_line_cursor#20
char *print_line_cursor#21
char *print_line_cursor#22
char *print_line_cursor#23
char *print_line_cursor#24
char *print_line_cursor#25
char *print_line_cursor#26
char *print_line_cursor#27
char *print_line_cursor#28
char *print_line_cursor#29
char *print_line_cursor#3
char *print_line_cursor#30
char *print_line_cursor#31
char *print_line_cursor#32
char *print_line_cursor#33
char *print_line_cursor#34
char *print_line_cursor#35
char *print_line_cursor#36
char *print_line_cursor#37
char *print_line_cursor#38
char *print_line_cursor#39
char *print_line_cursor#4
char *print_line_cursor#40
char *print_line_cursor#41
char *print_line_cursor#42
char *print_line_cursor#43
char *print_line_cursor#44
char *print_line_cursor#45
char *print_line_cursor#46
char *print_line_cursor#47
char *print_line_cursor#48
char *print_line_cursor#49
char *print_line_cursor#5
char *print_line_cursor#50
char *print_line_cursor#51
char *print_line_cursor#52
char *print_line_cursor#53
char *print_line_cursor#54
char *print_line_cursor#55
char *print_line_cursor#56
char *print_line_cursor#57
char *print_line_cursor#58
char *print_line_cursor#59
char *print_line_cursor#6
char *print_line_cursor#60
char *print_line_cursor#61
char *print_line_cursor#62
char *print_line_cursor#63
char *print_line_cursor#64
char *print_line_cursor#65
char *print_line_cursor#66
char *print_line_cursor#67
char *print_line_cursor#68
char *print_line_cursor#69
char *print_line_cursor#7
char *print_line_cursor#8
char *print_line_cursor#9
2020-10-05 20:58:02 +00:00
void print_ln()
char *print_ln::$0
bool print_ln::$1
char *print_screen
char *print_screen#0
char *print_screen#1
char *print_screen#2
char *print_screen#3
char *print_screen#4
char *print_screen#5
char *print_screen#6
char *print_screen#7
void print_str(char *str)
bool print_str::$1
char *print_str::str
char *print_str::str#0
char *print_str::str#1
char *print_str::str#10
char *print_str::str#11
char *print_str::str#12
char *print_str::str#2
char *print_str::str#3
char *print_str::str#4
char *print_str::str#5
char *print_str::str#6
char *print_str::str#7
char *print_str::str#8
char *print_str::str#9
2020-10-05 20:58:02 +00:00
void test_bytes()
number test_bytes::$3
signed char test_bytes::$5
__constant char test_bytes::bb = 0
char test_bytes::bc
char test_bytes::bc#0
char test_bytes::bc#1
char test_bytes::bd
char test_bytes::bd#0
__constant char test_bytes::msg[4] = "0=0"
__constant char test_bytes::msg1[6] = "0+2=2"
__constant char test_bytes::msg2[$a] = "0+2-4=254"
2020-10-05 20:58:02 +00:00
void test_sbytes()
__constant signed char test_sbytes::bb = 0
signed char test_sbytes::bc
signed char test_sbytes::bc#0
signed char test_sbytes::bc#1
signed char test_sbytes::bd
signed char test_sbytes::bd#0
signed char test_sbytes::bd#1
signed char test_sbytes::be
signed char test_sbytes::be#0
__constant signed char test_sbytes::bf = (signed char)-$7f-$7f
__constant char test_sbytes::msg[4] = "0=0"
__constant char test_sbytes::msg1[6] = "0+2=2"
__constant char test_sbytes::msg2[9] = "0+2-4=-2"
__constant char test_sbytes::msg3[$b] = "-(0+2-4)=2"
__constant char test_sbytes::msg4[$b] = "-127-127=2"
2020-10-05 20:58:02 +00:00
Adding number conversion cast (unumber) 0 in print_str::$1 = 0 != *print_str::str#9
Adding number conversion cast (unumber) $28 in print_ln::$0 = print_line_cursor#25 + $28
Adding number conversion cast (unumber) $3e8 in memset::num#0 = $3e8
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#1 > 0
2020-10-05 20:58:02 +00:00
Adding number conversion cast (unumber) 0 in assert_byte::c#0 = 0
Adding number conversion cast (unumber) 2 in test_bytes::bc#0 = test_bytes::bb + 2
2020-10-05 20:58:02 +00:00
Adding number conversion cast (unumber) 2 in assert_byte::c#1 = 2
Adding number conversion cast (snumber) 4 in test_bytes::$3 = test_bytes::$5 - 4
Adding number conversion cast (snumber) test_bytes::$3 in test_bytes::$3 = test_bytes::$5 - (snumber)4
Adding number conversion cast (unumber) $fe in assert_byte::c#2 = $fe
Adding number conversion cast (snumber) 0 in assert_sbyte::c#0 = 0
Adding number conversion cast (snumber) 2 in test_sbytes::bc#0 = test_sbytes::bb + 2
2020-10-05 20:58:02 +00:00
Adding number conversion cast (snumber) 2 in assert_sbyte::c#1 = 2
Adding number conversion cast (snumber) 4 in test_sbytes::bd#0 = test_sbytes::bc#1 - 4
2020-10-05 20:58:02 +00:00
Adding number conversion cast (snumber) -2 in assert_sbyte::c#2 = -2
Adding number conversion cast (snumber) 2 in assert_sbyte::c#3 = 2
Adding number conversion cast (snumber) 2 in assert_sbyte::c#4 = 2
2019-05-30 20:29:04 +00:00
Successful SSA optimization PassNAddNumberTypeConversions
2020-10-05 20:58:02 +00:00
Inlining cast memset::num#0 = (unumber)$3e8
Inlining cast memset::dst#0 = (char *)memset::str#2
2020-10-05 20:58:02 +00:00
Inlining cast assert_byte::c#0 = (unumber)0
Inlining cast assert_byte::c#1 = (unumber)2
Inlining cast assert_byte::c#2 = (unumber)$fe
Inlining cast assert_sbyte::c#0 = (snumber)0
Inlining cast assert_sbyte::c#1 = (snumber)2
Inlining cast assert_sbyte::c#2 = (snumber)-2
Inlining cast assert_sbyte::c#3 = (snumber)2
Inlining cast assert_sbyte::c#4 = (snumber)2
2019-05-30 20:29:04 +00:00
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (char *) 53281
Simplifying constant integer cast 0
2019-05-30 20:29:04 +00:00
Simplifying constant integer cast $28
Simplifying constant integer cast $3e8
Simplifying constant integer cast 0
Simplifying constant integer cast 0
2019-05-30 20:29:04 +00:00
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast 4
Simplifying constant integer cast $fe
Simplifying constant integer cast 0
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast 4
Simplifying constant integer cast -2
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant pointer cast (char *) 1024
2019-05-30 20:29:04 +00:00
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) $28
Finalized unsigned number type (unsigned int) $3e8
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 2
Finalized unsigned number type (char) 2
Finalized signed number type (signed char) 4
Finalized unsigned number type (char) $fe
Finalized signed number type (signed char) 0
Finalized signed number type (signed char) 2
Finalized signed number type (signed char) 2
Finalized signed number type (signed char) 4
Finalized signed number type (signed char) -2
Finalized signed number type (signed char) 2
Finalized signed number type (signed char) 2
2019-05-30 20:29:04 +00:00
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to signed char in test_bytes::$3 = test_bytes::$5 - 4
Inversing boolean not [46] memset::$1 = memset::num#1 <= 0 from [45] memset::$0 = memset::num#1 > 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias print_str::str#10 = print_str::str#9 print_str::str#11
Alias print_char_cursor#1 = print_char_cursor#72 print_char_cursor#73 print_char_cursor#38
Alias print_char_cursor#0 = print_char_cursor#37
Alias print_line_cursor#0 = print_ln::$0 print_line_cursor#26 print_char_cursor#2 print_line_cursor#27 print_char_cursor#40 print_line_cursor#1 print_char_cursor#3
Alias print_char_cursor#4 = print_char_cursor#42 print_char_cursor#5
Alias print_line_cursor#2 = print_screen#3 print_screen#2 print_char_cursor#6 print_line_cursor#28 print_char_cursor#43 print_line_cursor#3 print_char_cursor#7
Alias memset::return#1 = memset::str#1 memset::return#3 memset::return#2
Alias memset::str#2 = memset::str#3
Alias memset::num#1 = memset::num#2
Alias memset::c#3 = memset::c#4
Alias memset::c#1 = memset::c#2
Alias memset::dst#2 = memset::dst#3
Alias memset::end#1 = memset::end#2
Alias memset::str#4 = memset::str#5
2020-06-27 19:18:00 +00:00
Alias print_line_cursor#29 = print_line_cursor#4
Alias print_char_cursor#44 = print_char_cursor#8
Alias print_char_cursor#45 = print_char_cursor#9
Alias print_line_cursor#30 = print_line_cursor#5
Alias print_char_cursor#10 = print_char_cursor#46 print_char_cursor#47 print_char_cursor#11
Alias print_line_cursor#31 = print_line_cursor#6 print_line_cursor#32 print_line_cursor#7
Alias print_char_cursor#12 = print_char_cursor#48
Alias print_line_cursor#33 = print_line_cursor#8
Alias test_bytes::bc#0 = test_bytes::bc#1
2020-06-27 19:18:00 +00:00
Alias print_char_cursor#13 = print_char_cursor#49
Alias print_line_cursor#34 = print_line_cursor#9
Alias print_char_cursor#14 = print_char_cursor#50 print_char_cursor#51 print_char_cursor#15
Alias print_line_cursor#10 = print_line_cursor#35 print_line_cursor#36 print_line_cursor#11
Alias assert_byte::b#3 = assert_byte::b#4 assert_byte::b#5
Alias assert_byte::c#3 = assert_byte::c#4 assert_byte::c#5
2020-06-27 19:18:00 +00:00
Alias print_line_cursor#56 = print_line_cursor#66 print_line_cursor#68 print_line_cursor#64 print_line_cursor#60 print_line_cursor#61 print_line_cursor#57
Alias print_char_cursor#16 = print_char_cursor#52
Alias print_char_cursor#17 = print_char_cursor#53 print_char_cursor#78 print_char_cursor#79
Alias print_char_cursor#18 = print_char_cursor#54
Alias print_char_cursor#19 = print_char_cursor#55
Alias print_line_cursor#12 = print_line_cursor#37 print_line_cursor#38 print_line_cursor#13
Alias print_char_cursor#20 = print_char_cursor#56 print_char_cursor#57 print_char_cursor#21
Alias print_char_cursor#22 = print_char_cursor#58
Alias print_line_cursor#14 = print_line_cursor#39
Alias test_sbytes::bc#0 = test_sbytes::bc#1
2020-06-27 19:18:00 +00:00
Alias print_char_cursor#23 = print_char_cursor#59
Alias print_line_cursor#15 = print_line_cursor#40
Alias test_sbytes::bd#0 = test_sbytes::bd#1
2020-06-27 19:18:00 +00:00
Alias print_char_cursor#24 = print_char_cursor#60
Alias print_line_cursor#16 = print_line_cursor#41
Alias print_char_cursor#25 = print_char_cursor#61
Alias print_line_cursor#17 = print_line_cursor#42
Alias print_char_cursor#26 = print_char_cursor#62 print_char_cursor#63 print_char_cursor#27
Alias print_line_cursor#18 = print_line_cursor#43 print_line_cursor#44 print_line_cursor#19
Alias assert_sbyte::b#5 = assert_sbyte::b#6 assert_sbyte::b#7
Alias assert_sbyte::c#5 = assert_sbyte::c#6 assert_sbyte::c#7
2020-06-27 19:18:00 +00:00
Alias print_line_cursor#58 = print_line_cursor#67 print_line_cursor#69 print_line_cursor#65 print_line_cursor#62 print_line_cursor#63 print_line_cursor#59
Alias print_char_cursor#28 = print_char_cursor#64
Alias print_char_cursor#29 = print_char_cursor#65 print_char_cursor#83 print_char_cursor#84
Alias print_char_cursor#30 = print_char_cursor#66
Alias print_char_cursor#31 = print_char_cursor#67
Alias print_line_cursor#20 = print_line_cursor#45 print_line_cursor#46 print_line_cursor#21
Alias print_char_cursor#32 = print_char_cursor#68 print_char_cursor#69 print_char_cursor#33
Alias print_screen#0 = print_line_cursor#22 print_char_cursor#34 print_line_cursor#55 print_char_cursor#86 print_screen#7 print_screen#6 print_screen#4 print_screen#1
Alias print_line_cursor#23 = print_line_cursor#47 print_line_cursor#48 print_line_cursor#24
Alias print_char_cursor#35 = print_char_cursor#70 print_char_cursor#71 print_char_cursor#36
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2AliasElimination
Alias print_line_cursor#52 = print_line_cursor#56
2020-06-27 19:18:00 +00:00
Alias print_line_cursor#54 = print_line_cursor#58
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2AliasElimination
Identical Phi Values print_char_cursor#0 print_char_cursor#4
Identical Phi Values print_char_cursor#39 print_char_cursor#74
Identical Phi Values print_char::ch#1 print_char::ch#0
Identical Phi Values print_char_cursor#41 print_char_cursor#1
Identical Phi Values print_line_cursor#2 print_screen#5
2020-10-05 20:58:02 +00:00
Identical Phi Values memset::num#1 memset::num#0
Identical Phi Values memset::str#2 memset::str#0
Identical Phi Values memset::c#3 memset::c#0
Identical Phi Values memset::end#1 memset::end#0
Identical Phi Values memset::str#4 memset::str#2
Identical Phi Values memset::c#1 memset::c#3
Identical Phi Values print_screen#5 print_screen#0
Identical Phi Values print_line_cursor#50 print_screen#0
Identical Phi Values print_char_cursor#75 print_screen#0
Identical Phi Values print_line_cursor#29 print_line_cursor#2
Identical Phi Values print_char_cursor#44 print_line_cursor#2
Identical Phi Values print_char_cursor#45 print_char_cursor#14
Identical Phi Values print_line_cursor#30 print_line_cursor#10
Identical Phi Values print_char_cursor#10 print_char_cursor#26
Identical Phi Values print_line_cursor#31 print_line_cursor#18
Identical Phi Values print_char_cursor#76 print_char_cursor#44
Identical Phi Values print_line_cursor#51 print_line_cursor#29
Identical Phi Values print_char_cursor#12 print_char_cursor#20
Identical Phi Values print_line_cursor#33 print_line_cursor#12
Identical Phi Values print_char_cursor#13 print_char_cursor#20
Identical Phi Values print_line_cursor#34 print_line_cursor#12
Identical Phi Values print_char_cursor#14 print_char_cursor#20
Identical Phi Values print_line_cursor#10 print_line_cursor#12
Identical Phi Values print_char_cursor#16 print_char_cursor#1
Identical Phi Values print_char_cursor#17 print_char_cursor#1
Identical Phi Values print_char_cursor#18 print_char_cursor#1
Identical Phi Values print_char_cursor#19 print_char_cursor#1
Identical Phi Values print_line_cursor#12 print_line_cursor#0
Identical Phi Values print_char_cursor#20 print_line_cursor#0
Identical Phi Values print_char_cursor#81 print_char_cursor#45
Identical Phi Values print_line_cursor#53 print_line_cursor#30
Identical Phi Values print_char_cursor#22 print_char_cursor#32
Identical Phi Values print_line_cursor#14 print_line_cursor#20
Identical Phi Values print_char_cursor#23 print_char_cursor#32
Identical Phi Values print_line_cursor#15 print_line_cursor#20
Identical Phi Values print_char_cursor#24 print_char_cursor#32
Identical Phi Values print_line_cursor#16 print_line_cursor#20
Identical Phi Values print_char_cursor#25 print_char_cursor#32
Identical Phi Values print_line_cursor#17 print_line_cursor#20
Identical Phi Values print_char_cursor#26 print_char_cursor#32
Identical Phi Values print_line_cursor#18 print_line_cursor#20
Identical Phi Values print_char_cursor#28 print_char_cursor#1
Identical Phi Values print_char_cursor#29 print_char_cursor#1
Identical Phi Values print_char_cursor#30 print_char_cursor#1
Identical Phi Values print_char_cursor#31 print_char_cursor#1
Identical Phi Values print_line_cursor#20 print_line_cursor#0
Identical Phi Values print_char_cursor#32 print_line_cursor#0
Identical Phi Values print_line_cursor#23 print_line_cursor#31
Identical Phi Values print_char_cursor#35 print_char_cursor#10
2019-05-30 20:29:04 +00:00
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values memset::return#1 memset::str#0
2020-10-05 20:58:02 +00:00
Identical Phi Values print_char_cursor#80 print_char_cursor#1
Identical Phi Values print_char_cursor#82 print_line_cursor#0
Identical Phi Values print_line_cursor#54 print_line_cursor#0
Identical Phi Values print_char_cursor#85 print_char_cursor#1
2019-05-30 20:29:04 +00:00
Successful SSA optimization Pass2IdenticalPhiElimination
2020-10-05 20:58:02 +00:00
Identical Phi Values print_char_cursor#74 print_char_cursor#1
2019-05-30 20:29:04 +00:00
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition print_str::$1 [3] if(0!=*print_str::str#10) goto print_str::@2
Simple Condition print_ln::$1 [13] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1
Simple Condition memset::$1 [28] if(memset::num#0<=0) goto memset::@1
Simple Condition memset::$3 [35] if(memset::dst#2!=memset::end#0) goto memset::@4
2020-10-05 20:58:02 +00:00
Simple Condition assert_byte::$2 [77] if(assert_byte::b#3!=assert_byte::c#3) goto assert_byte::@1
Simple Condition assert_sbyte::$2 [127] if(assert_sbyte::b#5!=assert_sbyte::c#5) goto assert_sbyte::@1
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConditionalJumpSimplification
2020-10-05 20:58:02 +00:00
Constant right-side identified [54] test_bytes::bc#0 = test_bytes::bb + 2
Constant right-side identified [95] test_sbytes::bc#0 = test_sbytes::bb + 2
2019-05-30 20:29:04 +00:00
Successful SSA optimization Pass2ConstantRValueConsolidation
2020-10-05 20:58:02 +00:00
Constant memset::c#0 = ' '
Constant memset::num#0 = $3e8
Constant assert_byte::msg#0 = test_bytes::msg
Constant assert_byte::b#0 = test_bytes::bb
Constant assert_byte::c#0 = 0
Constant test_bytes::bc#0 = test_bytes::bb+2
Constant assert_byte::msg#1 = test_bytes::msg1
Constant assert_byte::c#1 = 2
Constant assert_byte::msg#2 = test_bytes::msg2
Constant assert_byte::c#2 = $fe
Constant print_str::str#2 = assert_byte::str
Constant print_str::str#3 = assert_byte::str1
Constant print_str::str#4 = assert_byte::str2
Constant assert_sbyte::msg#0 = test_sbytes::msg
Constant assert_sbyte::b#0 = test_sbytes::bb
Constant assert_sbyte::c#0 = 0
Constant test_sbytes::bc#0 = test_sbytes::bb+2
Constant assert_sbyte::msg#1 = test_sbytes::msg1
Constant assert_sbyte::c#1 = 2
Constant assert_sbyte::msg#2 = test_sbytes::msg2
Constant assert_sbyte::c#2 = -2
Constant assert_sbyte::msg#3 = test_sbytes::msg3
Constant assert_sbyte::c#3 = 2
Constant assert_sbyte::msg#4 = test_sbytes::msg4
Constant assert_sbyte::b#4 = test_sbytes::bf
Constant assert_sbyte::c#4 = 2
Constant print_str::str#6 = assert_sbyte::str
Constant print_str::str#7 = assert_sbyte::str1
Constant print_str::str#8 = assert_sbyte::str2
Constant print_screen#0 = (char *) 1024
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConstantIdentification
Constant memset::str#0 = (void *)print_screen#0
2020-10-05 20:58:02 +00:00
Constant assert_byte::b#1 = test_bytes::bc#0
Constant test_bytes::$5 = (signed char)test_bytes::bc#0
2020-10-05 20:58:02 +00:00
Constant assert_sbyte::b#1 = test_sbytes::bc#0
2019-05-30 20:29:04 +00:00
Successful SSA optimization Pass2ConstantIdentification
Constant memset::return#0 = memset::str#0
Constant memset::$4 = (char *)memset::str#0
Constant memset::dst#0 = (char *)memset::str#0
2019-10-20 15:06:17 +00:00
Successful SSA optimization Pass2ConstantIdentification
if() condition always false - eliminating [28] if(memset::num#0<=0) goto memset::@1
Successful SSA optimization Pass2ConstantIfs
2020-10-05 20:58:02 +00:00
Consolidated constant strings into msg
Consolidated constant strings into msg1
Consolidated constant strings into str
Consolidated constant strings into str1
Consolidated constant strings into str2
2019-05-30 20:29:04 +00:00
Successful SSA optimization Pass2ConstantStringConsolidation
Simplifying expression containing zero 2 in
Simplifying expression containing zero 2 in
2019-05-30 20:29:04 +00:00
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant memset::return#0
Successful SSA optimization PassNEliminateUnusedVars
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::__init1
Removing unused procedure block __start::@1
Removing unused procedure block __start::@2
Removing unused procedure block __start::@return
2020-06-27 19:18:00 +00:00
Successful SSA optimization PassNEliminateEmptyStart
Constant right-side identified [17] memset::end#0 = memset::$4 + memset::num#0
2020-10-05 20:58:02 +00:00
Constant right-side identified [30] test_bytes::$3 = test_bytes::$5 - 4
Constant right-side identified [47] test_sbytes::bd#0 = test_sbytes::bc#0 - 4
2019-10-20 15:06:17 +00:00
Successful SSA optimization Pass2ConstantRValueConsolidation
2020-10-05 20:58:02 +00:00
Constant memset::end#0 = memset::$4+memset::num#0
Constant test_bytes::$3 = test_bytes::$5-4
Constant test_sbytes::bd#0 = test_sbytes::bc#0-4
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConstantIdentification
Constant test_bytes::bd#0 = (char)test_bytes::$3
2020-10-05 20:58:02 +00:00
Constant assert_sbyte::b#2 = test_sbytes::bd#0
2019-05-30 20:29:04 +00:00
Successful SSA optimization Pass2ConstantIdentification
2020-10-05 20:58:02 +00:00
Constant assert_byte::b#2 = test_bytes::bd#0
2019-10-20 15:06:17 +00:00
Successful SSA optimization Pass2ConstantIdentification
2020-10-05 20:58:02 +00:00
Constant right-side identified [44] test_sbytes::be#0 = - test_sbytes::bd#0
2019-05-30 20:29:04 +00:00
Successful SSA optimization Pass2ConstantRValueConsolidation
2020-10-05 20:58:02 +00:00
Constant test_sbytes::be#0 = -test_sbytes::bd#0
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConstantIdentification
2020-10-05 20:58:02 +00:00
Constant assert_sbyte::b#3 = test_sbytes::be#0
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConstantIdentification
2020-10-05 20:58:02 +00:00
Inlining constant with var siblings print_str::str#2
Inlining constant with var siblings print_str::str#3
Inlining constant with var siblings print_str::str#4
Inlining constant with var siblings print_str::str#6
Inlining constant with var siblings print_str::str#7
Inlining constant with var siblings print_str::str#8
Inlining constant with var siblings memset::dst#0
2020-10-05 20:58:02 +00:00
Inlining constant with var siblings assert_byte::msg#0
Inlining constant with var siblings assert_byte::b#0
Inlining constant with var siblings assert_byte::c#0
Inlining constant with var siblings assert_byte::msg#1
Inlining constant with var siblings assert_byte::c#1
Inlining constant with var siblings assert_byte::msg#2
Inlining constant with var siblings assert_byte::c#2
Inlining constant with var siblings assert_byte::b#1
Inlining constant with var siblings assert_byte::b#2
Inlining constant with var siblings assert_sbyte::msg#0
Inlining constant with var siblings assert_sbyte::b#0
Inlining constant with var siblings assert_sbyte::c#0
Inlining constant with var siblings assert_sbyte::msg#1
Inlining constant with var siblings assert_sbyte::c#1
Inlining constant with var siblings assert_sbyte::msg#2
Inlining constant with var siblings assert_sbyte::c#2
Inlining constant with var siblings assert_sbyte::msg#3
Inlining constant with var siblings assert_sbyte::c#3
Inlining constant with var siblings assert_sbyte::msg#4
Inlining constant with var siblings assert_sbyte::b#4
Inlining constant with var siblings assert_sbyte::c#4
Inlining constant with var siblings assert_sbyte::b#1
Inlining constant with var siblings assert_sbyte::b#2
Inlining constant with var siblings assert_sbyte::b#3
Constant inlined test_bytes::msg = msg
Constant inlined test_sbytes::msg = msg
Constant inlined assert_sbyte::b#2 = test_sbytes::bd#0
Constant inlined assert_sbyte::c#1 = 2
Constant inlined assert_sbyte::b#1 = test_sbytes::bc#0
Constant inlined assert_sbyte::c#0 = 0
Constant inlined assert_byte::b#0 = test_bytes::bb
Constant inlined assert_sbyte::str1 = str1
Constant inlined assert_sbyte::b#0 = test_sbytes::bb
Constant inlined assert_byte::b#1 = test_bytes::bc#0
Constant inlined assert_sbyte::str2 = str2
Constant inlined assert_byte::c#0 = 0
Constant inlined assert_byte::b#2 = test_bytes::bd#0
Constant inlined assert_byte::c#1 = 2
Constant inlined test_bytes::$3 = (signed char)test_bytes::bc#0-4
2020-10-05 20:58:02 +00:00
Constant inlined assert_byte::c#2 = $fe
Constant inlined assert_sbyte::c#4 = 2
Constant inlined assert_sbyte::b#4 = test_sbytes::bf
Constant inlined assert_sbyte::c#3 = 2
Constant inlined assert_sbyte::b#3 = test_sbytes::be#0
Constant inlined test_bytes::$5 = (signed char)test_bytes::bc#0
2020-10-05 20:58:02 +00:00
Constant inlined assert_sbyte::c#2 = -2
Constant inlined memset::$4 = (char *)memset::str#0
2020-10-05 20:58:02 +00:00
Constant inlined assert_byte::str2 = str2
Constant inlined assert_byte::msg#0 = msg
Constant inlined test_sbytes::msg1 = msg1
Constant inlined assert_byte::str1 = str1
Constant inlined assert_byte::msg#1 = msg1
Constant inlined assert_byte::msg#2 = test_bytes::msg2
Constant inlined assert_sbyte::msg#0 = msg
Constant inlined assert_sbyte::msg#1 = msg1
Constant inlined assert_sbyte::msg#2 = test_sbytes::msg2
Constant inlined assert_sbyte::msg#3 = test_sbytes::msg3
Constant inlined assert_sbyte::str = str
Constant inlined assert_byte::str = str
Constant inlined test_bytes::msg1 = msg1
Constant inlined print_str::str#4 = str2
Constant inlined assert_sbyte::msg#4 = test_sbytes::msg4
Constant inlined print_str::str#3 = str1
Constant inlined print_str::str#2 = str
Constant inlined memset::dst#0 = (char *)memset::str#0
2020-10-05 20:58:02 +00:00
Constant inlined print_str::str#8 = str2
Constant inlined print_str::str#7 = str1
Constant inlined print_str::str#6 = str
2018-08-22 20:23:42 +00:00
Successful SSA optimization Pass2ConstantInlining
Finalized unsigned number type (char) 2
Finalized unsigned number type (char) 8
Finalized unsigned number type (char) $a
Finalized unsigned number type (char) $10
Finalized signed number type (signed char) -$7f
Finalized unsigned number type (char) $7f
Successful SSA optimization PassNFinalizeNumberTypeConversions
2017-12-29 10:21:11 +00:00
Added new block during phi lifting print_ln::@3(between print_ln::@1 and print_ln::@1)
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@2
2019-05-30 20:29:04 +00:00
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of print_cls
Adding NOP phi() at start of print_cls::@1
Adding NOP phi() at start of test_bytes
Adding NOP phi() at start of test_bytes::@3
Adding NOP phi() at start of test_sbytes
Adding NOP phi() at start of test_sbytes::@1
Adding NOP phi() at start of test_sbytes::@2
Adding NOP phi() at start of test_sbytes::@3
Adding NOP phi() at start of test_sbytes::@4
2019-05-30 20:29:04 +00:00
Adding NOP phi() at start of test_sbytes::@5
Adding NOP phi() at start of memset
Adding NOP phi() at start of memset::@2
Adding NOP phi() at start of memset::@1
Adding NOP phi() at start of assert_byte::@7
Adding NOP phi() at start of assert_byte::@8
Adding NOP phi() at start of assert_byte::@6
2019-05-30 20:29:04 +00:00
Adding NOP phi() at start of assert_sbyte::@7
Adding NOP phi() at start of assert_sbyte::@8
Adding NOP phi() at start of assert_sbyte::@6
2019-05-30 20:29:04 +00:00
Adding NOP phi() at start of print_ln::@2
CALL GRAPH
2020-06-27 19:18:00 +00:00
Calls in [main] to print_cls:1 test_bytes:3 test_sbytes:5
Calls in [print_cls] to memset:9
Calls in [test_bytes] to assert_byte:13 assert_byte:16 assert_byte:19
Calls in [test_sbytes] to assert_sbyte:23 assert_sbyte:25 assert_sbyte:27 assert_sbyte:29 assert_sbyte:31
Calls in [assert_byte] to print_str:47 print_str:49 print_str:52 print_ln:55 print_str:60
Calls in [assert_sbyte] to print_str:66 print_str:68 print_str:71 print_ln:74 print_str:79
Calls in [print_str] to print_char:88
Created 15 initial phi equivalence classes
2020-10-05 20:58:02 +00:00
Not coalescing [14] print_char_cursor#98 = print_line_cursor#0
Coalesced [15] print_line_cursor#74 = print_line_cursor#0
Not coalescing [17] print_char_cursor#99 = print_line_cursor#0
Coalesced (already) [18] print_line_cursor#75 = print_line_cursor#0
Coalesced [42] memset::dst#4 = memset::dst#1
Coalesced [45] print_str::str#13 = print_str::str#1
Coalesced [46] print_char_cursor#88 = print_char_cursor#77
Coalesced [48] print_char_cursor#91 = print_char_cursor#1
Coalesced (already) [51] print_char_cursor#90 = print_char_cursor#1
Coalesced [54] print_line_cursor#70 = print_line_cursor#52
Coalesced (already) [59] print_char_cursor#89 = print_char_cursor#1
Coalesced [64] print_str::str#14 = print_str::str#5
Not coalescing [65] print_char_cursor#92 = print_line_cursor#0
Coalesced (already) [67] print_char_cursor#95 = print_char_cursor#1
Coalesced (already) [70] print_char_cursor#94 = print_char_cursor#1
Coalesced (already) [73] print_line_cursor#71 = print_line_cursor#0
Coalesced (already) [78] print_char_cursor#93 = print_char_cursor#1
Coalesced [82] print_str::str#15 = print_str::str#12
Coalesced (already) [83] print_char_cursor#96 = print_char_cursor#87
Coalesced [90] print_str::str#16 = print_str::str#0
Coalesced [91] print_char_cursor#97 = print_char_cursor#4
Coalesced [93] print_line_cursor#72 = print_line_cursor#49
Coalesced (already) [99] print_line_cursor#73 = print_line_cursor#0
Coalesced down to 10 phi equivalence classes
2020-10-05 20:58:02 +00:00
Culled Empty Block label main::@3
Culled Empty Block label print_cls::@1
Culled Empty Block label test_bytes::@3
Culled Empty Block label test_sbytes::@5
Culled Empty Block label memset::@2
Culled Empty Block label memset::@1
Culled Empty Block label assert_byte::@7
Culled Empty Block label assert_byte::@8
Culled Empty Block label assert_byte::@6
Culled Empty Block label assert_sbyte::@7
Culled Empty Block label assert_sbyte::@8
Culled Empty Block label assert_sbyte::@6
Culled Empty Block label print_ln::@2
Culled Empty Block label print_ln::@3
Renumbering block memset::@3 to memset::@1
Renumbering block memset::@4 to memset::@2
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@2
Adding NOP phi() at start of print_cls
Adding NOP phi() at start of test_bytes
Adding NOP phi() at start of test_sbytes
Adding NOP phi() at start of test_sbytes::@1
Adding NOP phi() at start of test_sbytes::@2
Adding NOP phi() at start of test_sbytes::@3
Adding NOP phi() at start of test_sbytes::@4
Adding NOP phi() at start of memset
Adding NOP phi() at start of assert_byte::@4
Adding NOP phi() at start of assert_byte::@3
Adding NOP phi() at start of assert_byte::@2
Adding NOP phi() at start of assert_sbyte::@4
Adding NOP phi() at start of assert_sbyte::@3
Adding NOP phi() at start of assert_sbyte::@2
2017-12-29 10:21:11 +00:00
FINAL CONTROL FLOW GRAPH
2020-10-05 20:58:02 +00:00
void main()
2020-06-27 19:18:00 +00:00
main: scope:[main] from
[0] phi()
[1] call print_cls
to:main::@1
main::@1: scope:[main] from main
2020-10-05 20:58:02 +00:00
[2] *BG_COLOR = GREEN
[3] call test_bytes
to:main::@2
main::@2: scope:[main] from main::@1
2020-06-27 19:18:00 +00:00
[4] phi()
[5] call test_sbytes
to:main::@return
main::@return: scope:[main] from main::@2
2020-06-27 19:18:00 +00:00
[6] return
to:@return
2020-10-05 20:58:02 +00:00
void print_cls()
print_cls: scope:[print_cls] from main
[7] phi()
[8] call memset
to:print_cls::@return
print_cls::@return: scope:[print_cls] from print_cls
[9] return
to:@return
2020-10-05 20:58:02 +00:00
void test_bytes()
test_bytes: scope:[test_bytes] from main::@1
[10] phi()
[11] call assert_byte
to:test_bytes::@1
test_bytes::@1: scope:[test_bytes] from test_bytes
2020-10-05 20:58:02 +00:00
[12] print_char_cursor#98 = print_line_cursor#0
[13] call assert_byte
to:test_bytes::@2
test_bytes::@2: scope:[test_bytes] from test_bytes::@1
2020-10-05 20:58:02 +00:00
[14] print_char_cursor#99 = print_line_cursor#0
[15] call assert_byte
to:test_bytes::@return
test_bytes::@return: scope:[test_bytes] from test_bytes::@2
[16] return
to:@return
2020-10-05 20:58:02 +00:00
void test_sbytes()
test_sbytes: scope:[test_sbytes] from main::@2
[17] phi()
[18] call assert_sbyte
to:test_sbytes::@1
test_sbytes::@1: scope:[test_sbytes] from test_sbytes
[19] phi()
[20] call assert_sbyte
to:test_sbytes::@2
test_sbytes::@2: scope:[test_sbytes] from test_sbytes::@1
[21] phi()
[22] call assert_sbyte
to:test_sbytes::@3
test_sbytes::@3: scope:[test_sbytes] from test_sbytes::@2
[23] phi()
[24] call assert_sbyte
to:test_sbytes::@4
test_sbytes::@4: scope:[test_sbytes] from test_sbytes::@3
[25] phi()
[26] call assert_sbyte
to:test_sbytes::@return
test_sbytes::@return: scope:[test_sbytes] from test_sbytes::@4
[27] return
to:@return
void * memset(void *str , char c , unsigned int num)
memset: scope:[memset] from print_cls
[28] phi()
to:memset::@1
memset::@1: scope:[memset] from memset memset::@2
[29] memset::dst#2 = phi( memset/(char *)memset::str#0, memset::@2/memset::dst#1 )
2020-10-05 20:58:02 +00:00
[30] if(memset::dst#2!=memset::end#0) goto memset::@2
to:memset::@return
memset::@return: scope:[memset] from memset::@1
[31] return
to:@return
memset::@2: scope:[memset] from memset::@1
2020-10-05 20:58:02 +00:00
[32] *memset::dst#2 = memset::c#0
[33] memset::dst#1 = ++ memset::dst#2
to:memset::@1
void assert_byte(char *msg , char b , char c)
assert_byte: scope:[assert_byte] from test_bytes test_bytes::@1 test_bytes::@2
2020-10-05 20:58:02 +00:00
[34] print_line_cursor#52 = phi( test_bytes/print_screen#0, test_bytes::@1/print_line_cursor#0, test_bytes::@2/print_line_cursor#0 )
[34] assert_byte::c#3 = phi( test_bytes/0, test_bytes::@1/2, test_bytes::@2/$fe )
[34] assert_byte::b#3 = phi( test_bytes/test_bytes::bb, test_bytes::@1/test_bytes::bc#0, test_bytes::@2/test_bytes::bd#0 )
[34] print_char_cursor#77 = phi( test_bytes/print_screen#0, test_bytes::@1/print_char_cursor#98, test_bytes::@2/print_char_cursor#99 )
[34] assert_byte::msg#3 = phi( test_bytes/msg, test_bytes::@1/msg1, test_bytes::@2/test_bytes::msg2 )
[35] print_str::str#1 = assert_byte::msg#3
[36] call print_str
to:assert_byte::@4
assert_byte::@4: scope:[assert_byte] from assert_byte
[37] phi()
[38] call print_str
to:assert_byte::@5
assert_byte::@5: scope:[assert_byte] from assert_byte::@4
2020-10-05 20:58:02 +00:00
[39] if(assert_byte::b#3!=assert_byte::c#3) goto assert_byte::@1
to:assert_byte::@3
assert_byte::@3: scope:[assert_byte] from assert_byte::@5
[40] phi()
[41] call print_str
to:assert_byte::@2
assert_byte::@2: scope:[assert_byte] from assert_byte::@1 assert_byte::@3
[42] phi()
[43] call print_ln
to:assert_byte::@return
assert_byte::@return: scope:[assert_byte] from assert_byte::@2
[44] return
to:@return
assert_byte::@1: scope:[assert_byte] from assert_byte::@5
2020-10-05 20:58:02 +00:00
[45] *BG_COLOR = RED
[46] call print_str
to:assert_byte::@2
void assert_sbyte(char *msg , signed char b , signed char c)
assert_sbyte: scope:[assert_sbyte] from test_sbytes test_sbytes::@1 test_sbytes::@2 test_sbytes::@3 test_sbytes::@4
2020-10-05 20:58:02 +00:00
[47] assert_sbyte::c#5 = phi( test_sbytes/0, test_sbytes::@1/2, test_sbytes::@2/-2, test_sbytes::@3/2, test_sbytes::@4/2 )
[47] assert_sbyte::b#5 = phi( test_sbytes/test_sbytes::bb, test_sbytes::@1/test_sbytes::bc#0, test_sbytes::@2/test_sbytes::bd#0, test_sbytes::@3/test_sbytes::be#0, test_sbytes::@4/test_sbytes::bf )
[47] assert_sbyte::msg#5 = phi( test_sbytes/msg, test_sbytes::@1/msg1, test_sbytes::@2/test_sbytes::msg2, test_sbytes::@3/test_sbytes::msg3, test_sbytes::@4/test_sbytes::msg4 )
[48] print_str::str#5 = assert_sbyte::msg#5
[49] print_char_cursor#92 = print_line_cursor#0
[50] call print_str
to:assert_sbyte::@4
assert_sbyte::@4: scope:[assert_sbyte] from assert_sbyte
[51] phi()
[52] call print_str
to:assert_sbyte::@5
assert_sbyte::@5: scope:[assert_sbyte] from assert_sbyte::@4
2020-10-05 20:58:02 +00:00
[53] if(assert_sbyte::b#5!=assert_sbyte::c#5) goto assert_sbyte::@1
to:assert_sbyte::@3
assert_sbyte::@3: scope:[assert_sbyte] from assert_sbyte::@5
[54] phi()
[55] call print_str
to:assert_sbyte::@2
assert_sbyte::@2: scope:[assert_sbyte] from assert_sbyte::@1 assert_sbyte::@3
[56] phi()
[57] call print_ln
to:assert_sbyte::@return
assert_sbyte::@return: scope:[assert_sbyte] from assert_sbyte::@2
[58] return
to:@return
assert_sbyte::@1: scope:[assert_sbyte] from assert_sbyte::@5
2020-10-05 20:58:02 +00:00
[59] *BG_COLOR = RED
[60] call print_str
to:assert_sbyte::@2
void print_str(char *str)
print_str: scope:[print_str] from assert_byte assert_byte::@1 assert_byte::@3 assert_byte::@4 assert_sbyte assert_sbyte::@1 assert_sbyte::@3 assert_sbyte::@4
2020-10-05 20:58:02 +00:00
[61] print_char_cursor#87 = phi( assert_byte/print_char_cursor#77, assert_byte::@1/print_char_cursor#1, assert_byte::@3/print_char_cursor#1, assert_byte::@4/print_char_cursor#1, assert_sbyte/print_char_cursor#92, assert_sbyte::@1/print_char_cursor#1, assert_sbyte::@3/print_char_cursor#1, assert_sbyte::@4/print_char_cursor#1 )
[61] print_str::str#12 = phi( assert_byte/print_str::str#1, assert_byte::@1/str1, assert_byte::@3/str2, assert_byte::@4/str, assert_sbyte/print_str::str#5, assert_sbyte::@1/str1, assert_sbyte::@3/str2, assert_sbyte::@4/str )
to:print_str::@1
print_str::@1: scope:[print_str] from print_str print_str::@3
2020-10-05 20:58:02 +00:00
[62] print_char_cursor#1 = phi( print_str/print_char_cursor#87, print_str::@3/print_char_cursor#4 )
[62] print_str::str#10 = phi( print_str/print_str::str#12, print_str::@3/print_str::str#0 )
[63] if(0!=*print_str::str#10) goto print_str::@2
to:print_str::@return
print_str::@return: scope:[print_str] from print_str::@1
[64] return
to:@return
print_str::@2: scope:[print_str] from print_str::@1
2020-10-05 20:58:02 +00:00
[65] print_char::ch#0 = *print_str::str#10
[66] call print_char
to:print_str::@3
print_str::@3: scope:[print_str] from print_str::@2
2020-10-05 20:58:02 +00:00
[67] print_str::str#0 = ++ print_str::str#10
to:print_str::@1
2020-10-05 20:58:02 +00:00
void print_ln()
print_ln: scope:[print_ln] from assert_byte::@2 assert_sbyte::@2
2020-10-05 20:58:02 +00:00
[68] print_line_cursor#49 = phi( assert_byte::@2/print_line_cursor#52, assert_sbyte::@2/print_line_cursor#0 )
to:print_ln::@1
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
2020-10-05 20:58:02 +00:00
[69] print_line_cursor#25 = phi( print_ln/print_line_cursor#49, print_ln::@1/print_line_cursor#0 )
[70] print_line_cursor#0 = print_line_cursor#25 + $28
[71] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1
to:print_ln::@return
print_ln::@return: scope:[print_ln] from print_ln::@1
[72] return
to:@return
void print_char(char ch)
print_char: scope:[print_char] from print_str::@2
2020-10-05 20:58:02 +00:00
[73] *print_char_cursor#1 = print_char::ch#0
[74] print_char_cursor#4 = ++ print_char_cursor#1
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[75] return
to:@return
VARIABLE REGISTER WEIGHTS
void assert_byte(char *msg , char b , char c)
char assert_byte::b
char assert_byte::b#3 // 20.2
char assert_byte::c
char assert_byte::c#3 // 20.2
char *assert_byte::msg
char *assert_byte::msg#3 // 101.0
void assert_sbyte(char *msg , signed char b , signed char c)
signed char assert_sbyte::b
signed char assert_sbyte::b#5 // 16.833333333333332
signed char assert_sbyte::c
signed char assert_sbyte::c#5 // 16.833333333333332
char *assert_sbyte::msg
char *assert_sbyte::msg#5 // 101.0
2020-10-05 20:58:02 +00:00
void main()
void * memset(void *str , char c , unsigned int num)
char memset::c
char *memset::dst
char *memset::dst#1 // 2002.0
char *memset::dst#2 // 1334.6666666666667
char *memset::end
unsigned int memset::num
void *memset::return
void *memset::str
void print_char(char ch)
char print_char::ch
char print_char::ch#0 // 110002.0
char *print_char_cursor
char *print_char_cursor#1 // 8207.814814814814
char *print_char_cursor#4 // 27500.5
char *print_char_cursor#77 // 61.5
char *print_char_cursor#87 // 1809.0
char *print_char_cursor#92 // 202.0
char *print_char_cursor#98 // 22.0
char *print_char_cursor#99 // 22.0
2020-10-05 20:58:02 +00:00
void print_cls()
char *print_line_cursor
char *print_line_cursor#0 // 840.2499999999999
char *print_line_cursor#25 // 21003.0
char *print_line_cursor#49 // 1203.0
char *print_line_cursor#52 // 11.181818181818182
2020-10-05 20:58:02 +00:00
void print_ln()
char *print_screen
void print_str(char *str)
char *print_str::str
char *print_str::str#0 // 20002.0
char *print_str::str#1 // 202.0
char *print_str::str#10 // 10251.25
char *print_str::str#12 // 1203.0
char *print_str::str#5 // 101.0
2020-10-05 20:58:02 +00:00
void test_bytes()
char test_bytes::bc
char test_bytes::bd
2020-10-05 20:58:02 +00:00
void test_sbytes()
signed char test_sbytes::bc
signed char test_sbytes::bd
signed char test_sbytes::be
Initial phi equivalence classes
[ memset::dst#2 memset::dst#1 ]
[ assert_byte::msg#3 ]
[ assert_byte::b#3 ]
[ assert_byte::c#3 ]
[ assert_sbyte::msg#5 ]
[ assert_sbyte::b#5 ]
[ assert_sbyte::c#5 ]
[ print_char_cursor#87 print_char_cursor#77 print_char_cursor#98 print_char_cursor#99 print_char_cursor#1 print_char_cursor#92 print_char_cursor#4 ]
[ print_str::str#10 print_str::str#12 print_str::str#1 print_str::str#5 print_str::str#0 ]
2020-06-27 19:18:00 +00:00
[ print_line_cursor#25 print_line_cursor#49 print_line_cursor#52 print_line_cursor#0 ]
Added variable print_char::ch#0 to live range equivalence class [ print_char::ch#0 ]
Complete equivalence classes
[ memset::dst#2 memset::dst#1 ]
[ assert_byte::msg#3 ]
[ assert_byte::b#3 ]
[ assert_byte::c#3 ]
[ assert_sbyte::msg#5 ]
[ assert_sbyte::b#5 ]
[ assert_sbyte::c#5 ]
[ print_char_cursor#87 print_char_cursor#77 print_char_cursor#98 print_char_cursor#99 print_char_cursor#1 print_char_cursor#92 print_char_cursor#4 ]
[ print_str::str#10 print_str::str#12 print_str::str#1 print_str::str#5 print_str::str#0 ]
2020-06-27 19:18:00 +00:00
[ print_line_cursor#25 print_line_cursor#49 print_line_cursor#52 print_line_cursor#0 ]
[ print_char::ch#0 ]
Allocated zp[1]:2 [ print_char::ch#0 ]
Allocated zp[2]:3 [ print_char_cursor#87 print_char_cursor#77 print_char_cursor#98 print_char_cursor#99 print_char_cursor#1 print_char_cursor#92 print_char_cursor#4 ]
Allocated zp[2]:5 [ print_str::str#10 print_str::str#12 print_str::str#1 print_str::str#5 print_str::str#0 ]
Allocated zp[2]:7 [ print_line_cursor#25 print_line_cursor#49 print_line_cursor#52 print_line_cursor#0 ]
Allocated zp[2]:9 [ memset::dst#2 memset::dst#1 ]
Allocated zp[2]:11 [ assert_byte::msg#3 ]
Allocated zp[2]:13 [ assert_sbyte::msg#5 ]
Allocated zp[1]:15 [ assert_byte::b#3 ]
Allocated zp[1]:16 [ assert_byte::c#3 ]
Allocated zp[1]:17 [ assert_sbyte::b#5 ]
Allocated zp[1]:18 [ assert_sbyte::c#5 ]
REGISTER UPLIFT POTENTIAL REGISTERS
2020-10-05 20:58:02 +00:00
Statement [2] *BG_COLOR = GREEN [ ] ( [ ] { } ) always clobbers reg byte a
Statement [12] print_char_cursor#98 = print_line_cursor#0 [ print_char_cursor#98 print_line_cursor#0 ] ( test_bytes:3 [ print_char_cursor#98 print_line_cursor#0 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } } ) always clobbers reg byte a
Statement [14] print_char_cursor#99 = print_line_cursor#0 [ print_line_cursor#0 print_char_cursor#99 ] ( test_bytes:3 [ print_line_cursor#0 print_char_cursor#99 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } } ) always clobbers reg byte a
Statement [30] if(memset::dst#2!=memset::end#0) goto memset::@2 [ memset::dst#2 ] ( print_cls:1::memset:8 [ memset::dst#2 ] { } ) always clobbers reg byte a
Statement [32] *memset::dst#2 = memset::c#0 [ memset::dst#2 ] ( print_cls:1::memset:8 [ memset::dst#2 ] { } ) always clobbers reg byte a reg byte y
Statement [35] print_str::str#1 = assert_byte::msg#3 [ print_char_cursor#77 assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#1 ] ( test_bytes:3::assert_byte:11 [ print_char_cursor#77 assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#1 ] { { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } { print_char_cursor#77 = print_char_cursor#87 } } test_bytes:3::assert_byte:13 [ print_char_cursor#77 assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#1 ] { { print_char_cursor#77 = print_char_cursor#98 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:15 [ print_char_cursor#77 assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#1 ] { { print_char_cursor#77 = print_char_cursor#99 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:15 [ assert_byte::b#3 ]
Removing always clobbered register reg byte a as potential for zp[1]:16 [ assert_byte::c#3 ]
2020-10-05 20:58:02 +00:00
Statement [45] *BG_COLOR = RED [ print_line_cursor#52 print_char_cursor#1 ] ( test_bytes:3::assert_byte:11 [ print_line_cursor#52 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13 [ print_line_cursor#52 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15 [ print_line_cursor#52 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } ) always clobbers reg byte a
Statement [48] print_str::str#5 = assert_sbyte::msg#5 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 ] ( test_sbytes:5::assert_sbyte:18 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:20 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:22 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:24 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:26 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:17 [ assert_sbyte::b#5 ]
Removing always clobbered register reg byte a as potential for zp[1]:18 [ assert_sbyte::c#5 ]
2020-10-05 20:58:02 +00:00
Statement [49] print_char_cursor#92 = print_line_cursor#0 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#92 ] ( test_sbytes:5::assert_sbyte:18 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#92 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:20 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#92 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:22 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#92 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:24 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#92 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:26 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#92 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } ) always clobbers reg byte a
Statement [59] *BG_COLOR = RED [ print_line_cursor#0 print_char_cursor#1 ] ( test_sbytes:5::assert_sbyte:18 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:20 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:22 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:24 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:26 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } ) always clobbers reg byte a
Statement [63] if(0!=*print_str::str#10) goto print_str::@2 [ print_char_cursor#1 print_str::str#10 ] ( test_bytes:3::assert_byte:11::print_str:36 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } { print_char_cursor#77 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:36 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#98 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:15::print_str:36 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#99 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:11::print_str:38 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:38 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:38 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:11::print_str:41 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:41 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:41 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:11::print_str:46 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:46 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:46 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:18::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:20::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:22::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:24::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 =
Removing always clobbered register reg byte y as potential for zp[1]:15 [ assert_byte::b#3 ]
Removing always clobbered register reg byte y as potential for zp[1]:16 [ assert_byte::c#3 ]
Removing always clobbered register reg byte y as potential for zp[1]:17 [ assert_sbyte::b#5 ]
Removing always clobbered register reg byte y as potential for zp[1]:18 [ assert_sbyte::c#5 ]
2020-10-05 20:58:02 +00:00
Statement [65] print_char::ch#0 = *print_str::str#10 [ print_char_cursor#1 print_str::str#10 print_char::ch#0 ] ( test_bytes:3::assert_byte:11::print_str:36 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } { print_char_cursor#77 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:36 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#98 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:15::print_str:36 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#99 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:11::print_str:38 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:38 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:38 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:11::print_str:41 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:41 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:41 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:11::print_str:46 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:46 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:46 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:18::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:20::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:22::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_curs
Statement [70] print_line_cursor#0 = print_line_cursor#25 + $28 [ print_line_cursor#0 print_char_cursor#1 ] ( test_bytes:3::assert_byte:11::print_ln:43 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#49 = print_line_cursor#52 } } test_bytes:3::assert_byte:13::print_ln:43 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 print_line_cursor#49 } } test_bytes:3::assert_byte:15::print_ln:43 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 print_line_cursor#49 } } test_sbytes:5::assert_sbyte:18::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:20::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:22::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:24::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:26::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } ) always clobbers reg byte a
Statement [71] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1 [ print_line_cursor#0 print_char_cursor#1 ] ( test_bytes:3::assert_byte:11::print_ln:43 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#49 = print_line_cursor#52 } } test_bytes:3::assert_byte:13::print_ln:43 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 print_line_cursor#49 } } test_bytes:3::assert_byte:15::print_ln:43 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 print_line_cursor#49 } } test_sbytes:5::assert_sbyte:18::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:20::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:22::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:24::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:26::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } ) always clobbers reg byte a
Statement [73] *print_char_cursor#1 = print_char::ch#0 [ print_char_cursor#1 ] ( test_bytes:3::assert_byte:11::print_str:36::print_char:66 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } { print_char_cursor#77 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:36::print_char:66 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:15::print_str:36::print_char:66 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:11::print_str:38::print_char:66 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:38::print_char:66 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:38::print_char:66 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:11::print_str:41::print_char:66 [ print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:41::print_char:66 [ print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:41::print_char:66 [ print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:11::print_str:46::print_char:66 [ print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:46::print_char:66 [ print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:46::print_char:66 [ print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:18::print_str:50::print_char:66 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#10 print_char_cursor#1 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:20::print_str:50::print_char:66 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#10 print_char_cursor#1 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:22::print_str:50::print_char:66 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#10 print_char_cursor#1 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:2
Statement [2] *BG_COLOR = GREEN [ ] ( [ ] { } ) always clobbers reg byte a
Statement [12] print_char_cursor#98 = print_line_cursor#0 [ print_char_cursor#98 print_line_cursor#0 ] ( test_bytes:3 [ print_char_cursor#98 print_line_cursor#0 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } } ) always clobbers reg byte a
Statement [14] print_char_cursor#99 = print_line_cursor#0 [ print_line_cursor#0 print_char_cursor#99 ] ( test_bytes:3 [ print_line_cursor#0 print_char_cursor#99 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } } ) always clobbers reg byte a
Statement [30] if(memset::dst#2!=memset::end#0) goto memset::@2 [ memset::dst#2 ] ( print_cls:1::memset:8 [ memset::dst#2 ] { } ) always clobbers reg byte a
Statement [32] *memset::dst#2 = memset::c#0 [ memset::dst#2 ] ( print_cls:1::memset:8 [ memset::dst#2 ] { } ) always clobbers reg byte a reg byte y
Statement [35] print_str::str#1 = assert_byte::msg#3 [ print_char_cursor#77 assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#1 ] ( test_bytes:3::assert_byte:11 [ print_char_cursor#77 assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#1 ] { { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } { print_char_cursor#77 = print_char_cursor#87 } } test_bytes:3::assert_byte:13 [ print_char_cursor#77 assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#1 ] { { print_char_cursor#77 = print_char_cursor#98 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:15 [ print_char_cursor#77 assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#1 ] { { print_char_cursor#77 = print_char_cursor#99 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } ) always clobbers reg byte a
Statement [45] *BG_COLOR = RED [ print_line_cursor#52 print_char_cursor#1 ] ( test_bytes:3::assert_byte:11 [ print_line_cursor#52 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13 [ print_line_cursor#52 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15 [ print_line_cursor#52 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } ) always clobbers reg byte a
Statement [48] print_str::str#5 = assert_sbyte::msg#5 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 ] ( test_sbytes:5::assert_sbyte:18 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:20 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:22 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:24 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:26 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } ) always clobbers reg byte a
Statement [49] print_char_cursor#92 = print_line_cursor#0 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#92 ] ( test_sbytes:5::assert_sbyte:18 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#92 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:20 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#92 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:22 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#92 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:24 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#92 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:26 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#5 print_char_cursor#92 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } ) always clobbers reg byte a
Statement [59] *BG_COLOR = RED [ print_line_cursor#0 print_char_cursor#1 ] ( test_sbytes:5::assert_sbyte:18 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:20 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:22 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:24 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:26 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } ) always clobbers reg byte a
Statement [63] if(0!=*print_str::str#10) goto print_str::@2 [ print_char_cursor#1 print_str::str#10 ] ( test_bytes:3::assert_byte:11::print_str:36 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } { print_char_cursor#77 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:36 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#98 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:15::print_str:36 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#99 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:11::print_str:38 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:38 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:38 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:11::print_str:41 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:41 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:41 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:11::print_str:46 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:46 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:46 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:18::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:20::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:22::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:24::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 =
Statement [65] print_char::ch#0 = *print_str::str#10 [ print_char_cursor#1 print_str::str#10 print_char::ch#0 ] ( test_bytes:3::assert_byte:11::print_str:36 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } { print_char_cursor#77 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:36 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#98 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:15::print_str:36 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#99 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:11::print_str:38 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:38 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:38 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:11::print_str:41 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:41 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:41 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:11::print_str:46 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:46 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:46 [ print_line_cursor#52 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:18::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:20::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:22::print_str:50 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_char_cursor#1 print_str::str#10 print_char::ch#0 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_curs
Statement [70] print_line_cursor#0 = print_line_cursor#25 + $28 [ print_line_cursor#0 print_char_cursor#1 ] ( test_bytes:3::assert_byte:11::print_ln:43 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#49 = print_line_cursor#52 } } test_bytes:3::assert_byte:13::print_ln:43 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 print_line_cursor#49 } } test_bytes:3::assert_byte:15::print_ln:43 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 print_line_cursor#49 } } test_sbytes:5::assert_sbyte:18::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:20::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:22::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:24::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:26::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } ) always clobbers reg byte a
Statement [71] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1 [ print_line_cursor#0 print_char_cursor#1 ] ( test_bytes:3::assert_byte:11::print_ln:43 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#49 = print_line_cursor#52 } } test_bytes:3::assert_byte:13::print_ln:43 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 print_line_cursor#49 } } test_bytes:3::assert_byte:15::print_ln:43 [ print_line_cursor#0 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 print_line_cursor#49 } } test_sbytes:5::assert_sbyte:18::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:20::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:22::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:24::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } test_sbytes:5::assert_sbyte:26::print_ln:57 [ print_line_cursor#0 print_char_cursor#1 ] { { print_line_cursor#0 = print_line_cursor#49 } } ) always clobbers reg byte a
Statement [73] *print_char_cursor#1 = print_char::ch#0 [ print_char_cursor#1 ] ( test_bytes:3::assert_byte:11::print_str:36::print_char:66 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } { print_char_cursor#77 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:36::print_char:66 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:15::print_str:36::print_char:66 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 print_char_cursor#87 } { print_line_cursor#0 = print_line_cursor#52 } { print_str::str#1 = print_str::str#12 assert_byte::msg#3 } } test_bytes:3::assert_byte:11::print_str:38::print_char:66 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:38::print_char:66 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:38::print_char:66 [ assert_byte::b#3 assert_byte::c#3 print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:11::print_str:41::print_char:66 [ print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:41::print_char:66 [ print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:41::print_char:66 [ print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:11::print_str:46::print_char:66 [ print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:13::print_str:46::print_char:66 [ print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#98 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_bytes:3::assert_byte:15::print_str:46::print_char:66 [ print_line_cursor#52 print_str::str#10 print_char_cursor#1 ] { { print_char_cursor#77 = print_char_cursor#99 } { print_line_cursor#0 = print_line_cursor#52 } { print_char_cursor#1 = print_char_cursor#87 } } test_sbytes:5::assert_sbyte:18::print_str:50::print_char:66 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#10 print_char_cursor#1 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:20::print_str:50::print_char:66 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#10 print_char_cursor#1 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:22::print_str:50::print_char:66 [ print_line_cursor#0 assert_sbyte::b#5 assert_sbyte::c#5 print_str::str#10 print_char_cursor#1 ] { { print_str::str#12 = print_str::str#5 assert_sbyte::msg#5 } { print_char_cursor#87 = print_char_cursor#92 } } test_sbytes:5::assert_sbyte:2
Potential registers zp[2]:9 [ memset::dst#2 memset::dst#1 ] : zp[2]:9 ,
Potential registers zp[2]:11 [ assert_byte::msg#3 ] : zp[2]:11 ,
Potential registers zp[1]:15 [ assert_byte::b#3 ] : zp[1]:15 , reg byte x ,
Potential registers zp[1]:16 [ assert_byte::c#3 ] : zp[1]:16 , reg byte x ,
Potential registers zp[2]:13 [ assert_sbyte::msg#5 ] : zp[2]:13 ,
Potential registers zp[1]:17 [ assert_sbyte::b#5 ] : zp[1]:17 , reg byte x ,
Potential registers zp[1]:18 [ assert_sbyte::c#5 ] : zp[1]:18 , reg byte x ,
Potential registers zp[2]:3 [ print_char_cursor#87 print_char_cursor#77 print_char_cursor#98 print_char_cursor#99 print_char_cursor#1 print_char_cursor#92 print_char_cursor#4 ] : zp[2]:3 ,
Potential registers zp[2]:5 [ print_str::str#10 print_str::str#12 print_str::str#1 print_str::str#5 print_str::str#0 ] : zp[2]:5 ,
Potential registers zp[2]:7 [ print_line_cursor#25 print_line_cursor#49 print_line_cursor#52 print_line_cursor#0 ] : zp[2]:7 ,
Potential registers zp[1]:2 [ print_char::ch#0 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [print_char] 110,002: zp[1]:2 [ print_char::ch#0 ]
Uplift Scope [] 37,824.81: zp[2]:3 [ print_char_cursor#87 print_char_cursor#77 print_char_cursor#98 print_char_cursor#99 print_char_cursor#1 print_char_cursor#92 print_char_cursor#4 ] 23,057.43: zp[2]:7 [ print_line_cursor#25 print_line_cursor#49 print_line_cursor#52 print_line_cursor#0 ]
Uplift Scope [print_str] 31,759.25: zp[2]:5 [ print_str::str#10 print_str::str#12 print_str::str#1 print_str::str#5 print_str::str#0 ]
Uplift Scope [memset] 3,336.67: zp[2]:9 [ memset::dst#2 memset::dst#1 ]
Uplift Scope [assert_byte] 101: zp[2]:11 [ assert_byte::msg#3 ] 20.2: zp[1]:15 [ assert_byte::b#3 ] 20.2: zp[1]:16 [ assert_byte::c#3 ]
Uplift Scope [assert_sbyte] 101: zp[2]:13 [ assert_sbyte::msg#5 ] 16.83: zp[1]:17 [ assert_sbyte::b#5 ] 16.83: zp[1]:18 [ assert_sbyte::c#5 ]
Uplift Scope [print_ln]
Uplift Scope [print_cls]
Uplift Scope [RADIX]
Uplift Scope [main]
Uplift Scope [test_bytes]
Uplift Scope [test_sbytes]
2020-06-27 19:18:00 +00:00
Uplifting [print_char] best 2116 combination reg byte a [ print_char::ch#0 ]
Uplifting [] best 2116 combination zp[2]:3 [ print_char_cursor#87 print_char_cursor#77 print_char_cursor#98 print_char_cursor#99 print_char_cursor#1 print_char_cursor#92 print_char_cursor#4 ] zp[2]:7 [ print_line_cursor#25 print_line_cursor#49 print_line_cursor#52 print_line_cursor#0 ]
Uplifting [print_str] best 2116 combination zp[2]:5 [ print_str::str#10 print_str::str#12 print_str::str#1 print_str::str#5 print_str::str#0 ]
Uplifting [memset] best 2116 combination zp[2]:9 [ memset::dst#2 memset::dst#1 ]
Uplifting [assert_byte] best 2104 combination zp[2]:11 [ assert_byte::msg#3 ] reg byte x [ assert_byte::b#3 ] zp[1]:16 [ assert_byte::c#3 ]
Uplifting [assert_sbyte] best 2086 combination zp[2]:13 [ assert_sbyte::msg#5 ] reg byte x [ assert_sbyte::b#5 ] zp[1]:18 [ assert_sbyte::c#5 ]
2020-06-27 19:18:00 +00:00
Uplifting [print_ln] best 2086 combination
Uplifting [print_cls] best 2086 combination
Uplifting [RADIX] best 2086 combination
2020-06-27 19:18:00 +00:00
Uplifting [main] best 2086 combination
Uplifting [test_bytes] best 2086 combination
Uplifting [test_sbytes] best 2086 combination
Attempting to uplift remaining variables inzp[1]:16 [ assert_byte::c#3 ]
Uplifting [assert_byte] best 2086 combination zp[1]:16 [ assert_byte::c#3 ]
Attempting to uplift remaining variables inzp[1]:18 [ assert_sbyte::c#5 ]
Uplifting [assert_sbyte] best 2086 combination zp[1]:18 [ assert_sbyte::c#5 ]
Coalescing zero page register [ zp[2]:11 [ assert_byte::msg#3 ] ] with [ zp[2]:5 [ print_str::str#10 print_str::str#12 print_str::str#1 print_str::str#5 print_str::str#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:11 [ assert_byte::msg#3 print_str::str#10 print_str::str#12 print_str::str#1 print_str::str#5 print_str::str#0 ] ] with [ zp[2]:13 [ assert_sbyte::msg#5 ] ] - score: 1
Coalescing zero page register [ zp[2]:11 [ assert_byte::msg#3 print_str::str#10 print_str::str#12 print_str::str#1 print_str::str#5 print_str::str#0 assert_sbyte::msg#5 ] ] with [ zp[2]:9 [ memset::dst#2 memset::dst#1 ] ]
Coalescing zero page register [ zp[1]:18 [ assert_sbyte::c#5 ] ] with [ zp[1]:16 [ assert_byte::c#3 ] ]
Allocated (was zp[2]:3) zp[2]:2 [ print_char_cursor#87 print_char_cursor#77 print_char_cursor#98 print_char_cursor#99 print_char_cursor#1 print_char_cursor#92 print_char_cursor#4 ]
Allocated (was zp[2]:11) zp[2]:4 [ assert_byte::msg#3 print_str::str#10 print_str::str#12 print_str::str#1 print_str::str#5 print_str::str#0 assert_sbyte::msg#5 memset::dst#2 memset::dst#1 ]
Allocated (was zp[2]:7) zp[2]:6 [ print_line_cursor#25 print_line_cursor#49 print_line_cursor#52 print_line_cursor#0 ]
Allocated (was zp[1]:18) zp[1]:8 [ assert_sbyte::c#5 assert_byte::c#3 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
2021-06-19 20:11:26 +00:00
/// @file
/// A lightweight library for printing on the C64.
2021-06-19 20:28:44 +00:00
///
/// Printing with this library is done by calling print_ function for each element
// Upstart
// Commodore 64 PRG executable file
.file [name="constants.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
// Global Constants & labels
.const GREEN = 5
.const RED = 2
2020-05-02 09:38:51 +00:00
.label BG_COLOR = $d021
2020-06-27 19:18:00 +00:00
.label print_screen = $400
.label print_char_cursor = 2
.label print_line_cursor = 6
.segment Code
// main
main: {
// [1] call print_cls
// [7] phi from main to print_cls [phi:main->print_cls]
print_cls_from_main:
jsr print_cls
jmp __b1
// main::@1
__b1:
2020-10-05 20:58:02 +00:00
// [2] *BG_COLOR = GREEN -- _deref_pbuc1=vbuc2
lda #GREEN
2020-05-02 09:38:51 +00:00
sta BG_COLOR
// [3] call test_bytes
// [10] phi from main::@1 to test_bytes [phi:main::@1->test_bytes]
test_bytes_from___b1:
jsr test_bytes
2020-06-27 19:18:00 +00:00
// [4] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
__b2_from___b1:
jmp __b2
// main::@2
__b2:
// [5] call test_sbytes
// [17] phi from main::@2 to test_sbytes [phi:main::@2->test_sbytes]
test_sbytes_from___b2:
jsr test_sbytes
jmp __breturn
// main::@return
__breturn:
2020-06-27 19:18:00 +00:00
// [6] return
rts
}
// print_cls
// Clear the screen. Also resets current line/char cursor.
print_cls: {
// [8] call memset
// [28] phi from print_cls to memset [phi:print_cls->memset]
memset_from_print_cls:
jsr memset
jmp __breturn
// print_cls::@return
__breturn:
// [9] return
rts
}
// test_bytes
// Test different byte constants
test_bytes: {
.const bb = 0
.const bc = 2
.const bd = bc-4
// [11] call assert_byte
// [34] phi from test_bytes to assert_byte [phi:test_bytes->assert_byte]
assert_byte_from_test_bytes:
2020-10-05 20:58:02 +00:00
// [34] phi print_line_cursor#52 = print_screen#0 [phi:test_bytes->assert_byte#0] -- pbuz1=pbuc1
lda #<print_screen
sta.z print_line_cursor
lda #>print_screen
sta.z print_line_cursor+1
2020-10-05 20:58:02 +00:00
// [34] phi assert_byte::c#3 = 0 [phi:test_bytes->assert_byte#1] -- vbuz1=vbuc1
lda #0
sta.z assert_byte.c
2020-10-05 20:58:02 +00:00
// [34] phi assert_byte::b#3 = test_bytes::bb [phi:test_bytes->assert_byte#2] -- vbuxx=vbuc1
ldx #bb
2020-10-05 20:58:02 +00:00
// [34] phi print_char_cursor#77 = print_screen#0 [phi:test_bytes->assert_byte#3] -- pbuz1=pbuc1
lda #<print_screen
sta.z print_char_cursor
lda #>print_screen
sta.z print_char_cursor+1
2020-10-05 20:58:02 +00:00
// [34] phi assert_byte::msg#3 = msg [phi:test_bytes->assert_byte#4] -- pbuz1=pbuc1
lda #<msg
sta.z assert_byte.msg
lda #>msg
sta.z assert_byte.msg+1
jsr assert_byte
jmp __b1
// test_bytes::@1
__b1:
2020-10-05 20:58:02 +00:00
// [12] print_char_cursor#98 = print_line_cursor#0 -- pbuz1=pbuz2
lda.z print_line_cursor
sta.z print_char_cursor
lda.z print_line_cursor+1
sta.z print_char_cursor+1
// [13] call assert_byte
// [34] phi from test_bytes::@1 to assert_byte [phi:test_bytes::@1->assert_byte]
assert_byte_from___b1:
2020-10-05 20:58:02 +00:00
// [34] phi print_line_cursor#52 = print_line_cursor#0 [phi:test_bytes::@1->assert_byte#0] -- register_copy
// [34] phi assert_byte::c#3 = 2 [phi:test_bytes::@1->assert_byte#1] -- vbuz1=vbuc1
lda #2
sta.z assert_byte.c
2020-10-05 20:58:02 +00:00
// [34] phi assert_byte::b#3 = test_bytes::bc#0 [phi:test_bytes::@1->assert_byte#2] -- vbuxx=vbuc1
ldx #bc
2020-10-05 20:58:02 +00:00
// [34] phi print_char_cursor#77 = print_char_cursor#98 [phi:test_bytes::@1->assert_byte#3] -- register_copy
// [34] phi assert_byte::msg#3 = msg1 [phi:test_bytes::@1->assert_byte#4] -- pbuz1=pbuc1
lda #<msg1
sta.z assert_byte.msg
lda #>msg1
sta.z assert_byte.msg+1
jsr assert_byte
jmp __b2
// test_bytes::@2
__b2:
2020-10-05 20:58:02 +00:00
// [14] print_char_cursor#99 = print_line_cursor#0 -- pbuz1=pbuz2
lda.z print_line_cursor
sta.z print_char_cursor
lda.z print_line_cursor+1
sta.z print_char_cursor+1
// [15] call assert_byte
// [34] phi from test_bytes::@2 to assert_byte [phi:test_bytes::@2->assert_byte]
assert_byte_from___b2:
2020-10-05 20:58:02 +00:00
// [34] phi print_line_cursor#52 = print_line_cursor#0 [phi:test_bytes::@2->assert_byte#0] -- register_copy
// [34] phi assert_byte::c#3 = $fe [phi:test_bytes::@2->assert_byte#1] -- vbuz1=vbuc1
lda #$fe
sta.z assert_byte.c
2020-10-05 20:58:02 +00:00
// [34] phi assert_byte::b#3 = test_bytes::bd#0 [phi:test_bytes::@2->assert_byte#2] -- vbuxx=vbuc1
ldx #bd
2020-10-05 20:58:02 +00:00
// [34] phi print_char_cursor#77 = print_char_cursor#99 [phi:test_bytes::@2->assert_byte#3] -- register_copy
// [34] phi assert_byte::msg#3 = test_bytes::msg2 [phi:test_bytes::@2->assert_byte#4] -- pbuz1=pbuc1
lda #<msg2
sta.z assert_byte.msg
lda #>msg2
sta.z assert_byte.msg+1
jsr assert_byte
jmp __breturn
// test_bytes::@return
__breturn:
// [16] return
rts
.segment Data
msg2: .text "0+2-4=254"
.byte 0
}
.segment Code
// test_sbytes
2019-02-17 23:12:29 +00:00
// Test different signed byte constants
test_sbytes: {
.const bb = 0
.const bf = -$7f-$7f
.const bc = 2
2019-05-30 20:29:04 +00:00
.const bd = bc-4
.const be = -bd
// [18] call assert_sbyte
// [47] phi from test_sbytes to assert_sbyte [phi:test_sbytes->assert_sbyte]
assert_sbyte_from_test_sbytes:
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::c#5 = 0 [phi:test_sbytes->assert_sbyte#0] -- vbsz1=vbsc1
lda #0
sta.z assert_sbyte.c
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::b#5 = test_sbytes::bb [phi:test_sbytes->assert_sbyte#1] -- vbsxx=vbsc1
ldx #bb
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::msg#5 = msg [phi:test_sbytes->assert_sbyte#2] -- pbuz1=pbuc1
lda #<msg
sta.z assert_sbyte.msg
lda #>msg
sta.z assert_sbyte.msg+1
jsr assert_sbyte
// [19] phi from test_sbytes to test_sbytes::@1 [phi:test_sbytes->test_sbytes::@1]
__b1_from_test_sbytes:
jmp __b1
// test_sbytes::@1
__b1:
// [20] call assert_sbyte
// [47] phi from test_sbytes::@1 to assert_sbyte [phi:test_sbytes::@1->assert_sbyte]
assert_sbyte_from___b1:
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::c#5 = 2 [phi:test_sbytes::@1->assert_sbyte#0] -- vbsz1=vbsc1
lda #2
sta.z assert_sbyte.c
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::b#5 = test_sbytes::bc#0 [phi:test_sbytes::@1->assert_sbyte#1] -- vbsxx=vbsc1
ldx #bc
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::msg#5 = msg1 [phi:test_sbytes::@1->assert_sbyte#2] -- pbuz1=pbuc1
lda #<msg1
sta.z assert_sbyte.msg
lda #>msg1
sta.z assert_sbyte.msg+1
jsr assert_sbyte
// [21] phi from test_sbytes::@1 to test_sbytes::@2 [phi:test_sbytes::@1->test_sbytes::@2]
__b2_from___b1:
jmp __b2
// test_sbytes::@2
__b2:
// [22] call assert_sbyte
// [47] phi from test_sbytes::@2 to assert_sbyte [phi:test_sbytes::@2->assert_sbyte]
assert_sbyte_from___b2:
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::c#5 = -2 [phi:test_sbytes::@2->assert_sbyte#0] -- vbsz1=vbsc1
lda #-2
sta.z assert_sbyte.c
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::b#5 = test_sbytes::bd#0 [phi:test_sbytes::@2->assert_sbyte#1] -- vbsxx=vbsc1
ldx #bd
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::msg#5 = test_sbytes::msg2 [phi:test_sbytes::@2->assert_sbyte#2] -- pbuz1=pbuc1
lda #<msg2
sta.z assert_sbyte.msg
lda #>msg2
sta.z assert_sbyte.msg+1
jsr assert_sbyte
// [23] phi from test_sbytes::@2 to test_sbytes::@3 [phi:test_sbytes::@2->test_sbytes::@3]
__b3_from___b2:
jmp __b3
// test_sbytes::@3
__b3:
// [24] call assert_sbyte
// [47] phi from test_sbytes::@3 to assert_sbyte [phi:test_sbytes::@3->assert_sbyte]
assert_sbyte_from___b3:
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::c#5 = 2 [phi:test_sbytes::@3->assert_sbyte#0] -- vbsz1=vbsc1
lda #2
sta.z assert_sbyte.c
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::b#5 = test_sbytes::be#0 [phi:test_sbytes::@3->assert_sbyte#1] -- vbsxx=vbsc1
ldx #be
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::msg#5 = test_sbytes::msg3 [phi:test_sbytes::@3->assert_sbyte#2] -- pbuz1=pbuc1
lda #<msg3
sta.z assert_sbyte.msg
lda #>msg3
sta.z assert_sbyte.msg+1
jsr assert_sbyte
// [25] phi from test_sbytes::@3 to test_sbytes::@4 [phi:test_sbytes::@3->test_sbytes::@4]
__b4_from___b3:
jmp __b4
// test_sbytes::@4
__b4:
// [26] call assert_sbyte
// [47] phi from test_sbytes::@4 to assert_sbyte [phi:test_sbytes::@4->assert_sbyte]
assert_sbyte_from___b4:
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::c#5 = 2 [phi:test_sbytes::@4->assert_sbyte#0] -- vbsz1=vbsc1
lda #2
sta.z assert_sbyte.c
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::b#5 = test_sbytes::bf [phi:test_sbytes::@4->assert_sbyte#1] -- vbsxx=vbsc1
ldx #bf
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::msg#5 = test_sbytes::msg4 [phi:test_sbytes::@4->assert_sbyte#2] -- pbuz1=pbuc1
lda #<msg4
sta.z assert_sbyte.msg
lda #>msg4
sta.z assert_sbyte.msg+1
jsr assert_sbyte
jmp __breturn
// test_sbytes::@return
__breturn:
// [27] return
rts
.segment Data
msg2: .text "0+2-4=-2"
.byte 0
msg3: .text "-(0+2-4)=2"
.byte 0
msg4: .text "-127-127=2"
.byte 0
}
.segment Code
// memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// void * memset(void *str, char c, unsigned int num)
memset: {
.const c = ' '
.const num = $3e8
.label str = print_screen
.label end = str+num
.label dst = 4
// [29] phi from memset to memset::@1 [phi:memset->memset::@1]
__b1_from_memset:
// [29] phi memset::dst#2 = (char *)memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
lda #<str
sta.z dst
lda #>str
sta.z dst+1
jmp __b1
// memset::@1
__b1:
2020-10-05 20:58:02 +00:00
// [30] if(memset::dst#2!=memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
lda.z dst+1
cmp #>end
bne __b2
lda.z dst
cmp #<end
bne __b2
jmp __breturn
// memset::@return
__breturn:
// [31] return
rts
// memset::@2
__b2:
2020-10-05 20:58:02 +00:00
// [32] *memset::dst#2 = memset::c#0 -- _deref_pbuz1=vbuc1
lda #c
ldy #0
sta (dst),y
2020-10-05 20:58:02 +00:00
// [33] memset::dst#1 = ++ memset::dst#2 -- pbuz1=_inc_pbuz1
inc.z dst
bne !+
inc.z dst+1
!:
// [29] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
__b1_from___b2:
2020-10-05 20:58:02 +00:00
// [29] phi memset::dst#2 = memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy
jmp __b1
}
// assert_byte
// void assert_byte(__zp(4) char *msg, __register(X) char b, __zp(8) char c)
assert_byte: {
.label msg = 4
.label c = 8
2020-10-05 20:58:02 +00:00
// [35] print_str::str#1 = assert_byte::msg#3
// [36] call print_str
// [61] phi from assert_byte to print_str [phi:assert_byte->print_str]
print_str_from_assert_byte:
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#77 [phi:assert_byte->print_str#0] -- register_copy
// [61] phi print_str::str#12 = print_str::str#1 [phi:assert_byte->print_str#1] -- register_copy
jsr print_str
// [37] phi from assert_byte to assert_byte::@4 [phi:assert_byte->assert_byte::@4]
__b4_from_assert_byte:
jmp __b4
// assert_byte::@4
__b4:
// [38] call print_str
// [61] phi from assert_byte::@4 to print_str [phi:assert_byte::@4->print_str]
print_str_from___b4:
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_byte::@4->print_str#0] -- register_copy
// [61] phi print_str::str#12 = str [phi:assert_byte::@4->print_str#1] -- pbuz1=pbuc1
lda #<str
sta.z print_str.str
lda #>str
sta.z print_str.str+1
jsr print_str
jmp __b5
// assert_byte::@5
__b5:
2020-10-05 20:58:02 +00:00
// [39] if(assert_byte::b#3!=assert_byte::c#3) goto assert_byte::@1 -- vbuxx_neq_vbuz1_then_la1
cpx.z c
bne __b1
// [40] phi from assert_byte::@5 to assert_byte::@3 [phi:assert_byte::@5->assert_byte::@3]
__b3_from___b5:
jmp __b3
// assert_byte::@3
__b3:
// [41] call print_str
// [61] phi from assert_byte::@3 to print_str [phi:assert_byte::@3->print_str]
print_str_from___b3:
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_byte::@3->print_str#0] -- register_copy
// [61] phi print_str::str#12 = str2 [phi:assert_byte::@3->print_str#1] -- pbuz1=pbuc1
lda #<str2
sta.z print_str.str
lda #>str2
sta.z print_str.str+1
jsr print_str
// [42] phi from assert_byte::@1 assert_byte::@3 to assert_byte::@2 [phi:assert_byte::@1/assert_byte::@3->assert_byte::@2]
__b2_from___b1:
__b2_from___b3:
jmp __b2
// assert_byte::@2
__b2:
// [43] call print_ln
// [68] phi from assert_byte::@2 to print_ln [phi:assert_byte::@2->print_ln]
print_ln_from___b2:
2020-10-05 20:58:02 +00:00
// [68] phi print_line_cursor#49 = print_line_cursor#52 [phi:assert_byte::@2->print_ln#0] -- register_copy
jsr print_ln
jmp __breturn
// assert_byte::@return
__breturn:
// [44] return
rts
// assert_byte::@1
__b1:
2020-10-05 20:58:02 +00:00
// [45] *BG_COLOR = RED -- _deref_pbuc1=vbuc2
lda #RED
2020-05-02 09:38:51 +00:00
sta BG_COLOR
// [46] call print_str
// [61] phi from assert_byte::@1 to print_str [phi:assert_byte::@1->print_str]
print_str_from___b1:
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_byte::@1->print_str#0] -- register_copy
// [61] phi print_str::str#12 = str1 [phi:assert_byte::@1->print_str#1] -- pbuz1=pbuc1
lda #<str1
sta.z print_str.str
lda #>str1
sta.z print_str.str+1
jsr print_str
jmp __b2_from___b1
}
// assert_sbyte
// void assert_sbyte(__zp(4) char *msg, __register(X) signed char b, __zp(8) signed char c)
assert_sbyte: {
.label msg = 4
.label c = 8
2020-10-05 20:58:02 +00:00
// [48] print_str::str#5 = assert_sbyte::msg#5
// [49] print_char_cursor#92 = print_line_cursor#0 -- pbuz1=pbuz2
lda.z print_line_cursor
sta.z print_char_cursor
lda.z print_line_cursor+1
sta.z print_char_cursor+1
// [50] call print_str
// [61] phi from assert_sbyte to print_str [phi:assert_sbyte->print_str]
print_str_from_assert_sbyte:
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#92 [phi:assert_sbyte->print_str#0] -- register_copy
// [61] phi print_str::str#12 = print_str::str#5 [phi:assert_sbyte->print_str#1] -- register_copy
jsr print_str
// [51] phi from assert_sbyte to assert_sbyte::@4 [phi:assert_sbyte->assert_sbyte::@4]
__b4_from_assert_sbyte:
jmp __b4
// assert_sbyte::@4
__b4:
// [52] call print_str
// [61] phi from assert_sbyte::@4 to print_str [phi:assert_sbyte::@4->print_str]
print_str_from___b4:
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_sbyte::@4->print_str#0] -- register_copy
// [61] phi print_str::str#12 = str [phi:assert_sbyte::@4->print_str#1] -- pbuz1=pbuc1
lda #<str
sta.z print_str.str
lda #>str
sta.z print_str.str+1
jsr print_str
jmp __b5
// assert_sbyte::@5
__b5:
2020-10-05 20:58:02 +00:00
// [53] if(assert_sbyte::b#5!=assert_sbyte::c#5) goto assert_sbyte::@1 -- vbsxx_neq_vbsz1_then_la1
cpx.z c
bne __b1
// [54] phi from assert_sbyte::@5 to assert_sbyte::@3 [phi:assert_sbyte::@5->assert_sbyte::@3]
__b3_from___b5:
jmp __b3
// assert_sbyte::@3
__b3:
// [55] call print_str
// [61] phi from assert_sbyte::@3 to print_str [phi:assert_sbyte::@3->print_str]
print_str_from___b3:
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_sbyte::@3->print_str#0] -- register_copy
// [61] phi print_str::str#12 = str2 [phi:assert_sbyte::@3->print_str#1] -- pbuz1=pbuc1
lda #<str2
sta.z print_str.str
lda #>str2
sta.z print_str.str+1
jsr print_str
// [56] phi from assert_sbyte::@1 assert_sbyte::@3 to assert_sbyte::@2 [phi:assert_sbyte::@1/assert_sbyte::@3->assert_sbyte::@2]
__b2_from___b1:
__b2_from___b3:
jmp __b2
// assert_sbyte::@2
__b2:
// [57] call print_ln
// [68] phi from assert_sbyte::@2 to print_ln [phi:assert_sbyte::@2->print_ln]
print_ln_from___b2:
2020-10-05 20:58:02 +00:00
// [68] phi print_line_cursor#49 = print_line_cursor#0 [phi:assert_sbyte::@2->print_ln#0] -- register_copy
jsr print_ln
jmp __breturn
// assert_sbyte::@return
__breturn:
// [58] return
rts
// assert_sbyte::@1
__b1:
2020-10-05 20:58:02 +00:00
// [59] *BG_COLOR = RED -- _deref_pbuc1=vbuc2
lda #RED
2020-05-02 09:38:51 +00:00
sta BG_COLOR
// [60] call print_str
// [61] phi from assert_sbyte::@1 to print_str [phi:assert_sbyte::@1->print_str]
print_str_from___b1:
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_sbyte::@1->print_str#0] -- register_copy
// [61] phi print_str::str#12 = str1 [phi:assert_sbyte::@1->print_str#1] -- pbuz1=pbuc1
lda #<str1
sta.z print_str.str
lda #>str1
sta.z print_str.str+1
jsr print_str
jmp __b2_from___b1
}
// print_str
// Print a zero-terminated string
// void print_str(__zp(4) char *str)
print_str: {
.label str = 4
// [62] phi from print_str print_str::@3 to print_str::@1 [phi:print_str/print_str::@3->print_str::@1]
__b1_from_print_str:
__b1_from___b3:
2020-10-05 20:58:02 +00:00
// [62] phi print_char_cursor#1 = print_char_cursor#87 [phi:print_str/print_str::@3->print_str::@1#0] -- register_copy
// [62] phi print_str::str#10 = print_str::str#12 [phi:print_str/print_str::@3->print_str::@1#1] -- register_copy
jmp __b1
// print_str::@1
__b1:
// [63] if(0!=*print_str::str#10) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
bne __b2
jmp __breturn
// print_str::@return
__breturn:
// [64] return
rts
// print_str::@2
__b2:
2020-10-05 20:58:02 +00:00
// [65] print_char::ch#0 = *print_str::str#10 -- vbuaa=_deref_pbuz1
ldy #0
lda (str),y
// [66] call print_char
jsr print_char
jmp __b3
// print_str::@3
__b3:
2020-10-05 20:58:02 +00:00
// [67] print_str::str#0 = ++ print_str::str#10 -- pbuz1=_inc_pbuz1
inc.z str
bne !+
inc.z str+1
!:
jmp __b1_from___b3
}
// print_ln
// Print a newline
print_ln: {
// [69] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1]
__b1_from_print_ln:
__b1_from___b1:
2020-10-05 20:58:02 +00:00
// [69] phi print_line_cursor#25 = print_line_cursor#49 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy
jmp __b1
// print_ln::@1
__b1:
2020-10-05 20:58:02 +00:00
// [70] print_line_cursor#0 = print_line_cursor#25 + $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc.z print_line_cursor
sta.z print_line_cursor
bcc !+
inc.z print_line_cursor+1
!:
2020-10-05 20:58:02 +00:00
// [71] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1 -- pbuz1_lt_pbuz2_then_la1
lda.z print_line_cursor+1
cmp.z print_char_cursor+1
bcc __b1_from___b1
bne !+
lda.z print_line_cursor
cmp.z print_char_cursor
bcc __b1_from___b1
!:
jmp __breturn
// print_ln::@return
__breturn:
// [72] return
rts
}
// print_char
// Print a single char
// void print_char(__register(A) char ch)
print_char: {
2020-10-05 20:58:02 +00:00
// [73] *print_char_cursor#1 = print_char::ch#0 -- _deref_pbuz1=vbuaa
ldy #0
sta (print_char_cursor),y
2020-10-05 20:58:02 +00:00
// [74] print_char_cursor#4 = ++ print_char_cursor#1 -- pbuz1=_inc_pbuz1
inc.z print_char_cursor
bne !+
inc.z print_char_cursor+1
!:
jmp __breturn
// print_char::@return
__breturn:
// [75] return
rts
}
// File Data
.segment Data
msg: .text "0=0"
.byte 0
msg1: .text "0+2=2"
.byte 0
str: .text " "
.byte 0
str1: .text "fail!"
.byte 0
str2: .text "ok"
.byte 0
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __breturn
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Removing instruction jmp __b4
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b4
Removing instruction jmp __b5
Removing instruction jmp __b3
Removing instruction jmp __b2
Removing instruction jmp __breturn
Removing instruction jmp __b4
Removing instruction jmp __b5
Removing instruction jmp __b3
Removing instruction jmp __b2
Removing instruction jmp __breturn
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __b3
Removing instruction jmp __b1
Removing instruction jmp __breturn
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __b2_from___b1 with __b2
Replacing label __b2_from___b1 with __b2
Replacing label __b1_from___b3 with __b1
Replacing label __b1_from___b1 with __b1
Replacing label __b1_from___b1 with __b1
Removing instruction __b2_from___b1:
Removing instruction test_sbytes_from___b2:
Removing instruction __b1_from_test_sbytes:
Removing instruction assert_sbyte_from___b1:
Removing instruction __b2_from___b1:
Removing instruction assert_sbyte_from___b2:
Removing instruction __b3_from___b2:
Removing instruction assert_sbyte_from___b3:
Removing instruction __b4_from___b3:
Removing instruction assert_sbyte_from___b4:
Removing instruction __b4_from_assert_byte:
Removing instruction print_str_from___b4:
Removing instruction __b3_from___b5:
Removing instruction print_str_from___b3:
Removing instruction __b2_from___b1:
Removing instruction __b2_from___b3:
Removing instruction print_ln_from___b2:
Removing instruction __b4_from_assert_sbyte:
Removing instruction print_str_from___b4:
Removing instruction __b3_from___b5:
Removing instruction print_str_from___b3:
Removing instruction __b2_from___b1:
Removing instruction __b2_from___b3:
Removing instruction print_ln_from___b2:
Removing instruction __b1_from_print_str:
Removing instruction __b1_from___b3:
Removing instruction __b1_from_print_ln:
Removing instruction __b1_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction print_cls_from_main:
Removing instruction __b1:
Removing instruction test_bytes_from___b1:
Removing instruction __b2:
Removing instruction __breturn:
Removing instruction memset_from_print_cls:
Removing instruction __breturn:
Removing instruction assert_byte_from_test_bytes:
Removing instruction __b1:
Removing instruction assert_byte_from___b1:
Removing instruction __b2:
Removing instruction assert_byte_from___b2:
Removing instruction __breturn:
Removing instruction assert_sbyte_from_test_sbytes:
Removing instruction __b1:
Removing instruction __b2:
Removing instruction __b3:
Removing instruction __b4:
Removing instruction __breturn:
Removing instruction __b1_from_memset:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
Removing instruction print_str_from_assert_byte:
Removing instruction __b4:
Removing instruction __b5:
Removing instruction __b3:
Removing instruction __breturn:
Removing instruction print_str_from___b1:
Removing instruction print_str_from_assert_sbyte:
Removing instruction __b4:
Removing instruction __b5:
Removing instruction __b3:
Removing instruction __breturn:
Removing instruction print_str_from___b1:
Removing instruction __breturn:
Removing instruction __b3:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
__constant char * const BG_COLOR = (char *) 53281
__constant const char GREEN = 5
__constant char RADIX::BINARY = 2
__constant char RADIX::DECIMAL = $a
__constant char RADIX::HEXADECIMAL = $10
__constant char RADIX::OCTAL = 8
__constant const char RED = 2
void assert_byte(char *msg , char b , char c)
char assert_byte::b
char assert_byte::b#3 // reg byte x 20.2
char assert_byte::c
char assert_byte::c#3 // c zp[1]:8 20.2
char *assert_byte::msg
char *assert_byte::msg#3 // msg zp[2]:4 101.0
void assert_sbyte(char *msg , signed char b , signed char c)
signed char assert_sbyte::b
signed char assert_sbyte::b#5 // reg byte x 16.833333333333332
signed char assert_sbyte::c
signed char assert_sbyte::c#5 // c zp[1]:8 16.833333333333332
char *assert_sbyte::msg
char *assert_sbyte::msg#5 // msg zp[2]:4 101.0
2020-10-05 20:58:02 +00:00
void main()
void * memset(void *str , char c , unsigned int num)
char memset::c
__constant char memset::c#0 = ' ' // c
char *memset::dst
char *memset::dst#1 // dst zp[2]:4 2002.0
char *memset::dst#2 // dst zp[2]:4 1334.6666666666667
char *memset::end
__constant char *memset::end#0 = (char *)memset::str#0+memset::num#0 // end
unsigned int memset::num
__constant unsigned int memset::num#0 = $3e8 // num
void *memset::return
void *memset::str
__constant void *memset::str#0 = (void *)print_screen#0 // str
__constant char msg[4] = "0=0"
__constant char msg1[6] = "0+2=2"
void print_char(char ch)
char print_char::ch
char print_char::ch#0 // reg byte a 110002.0
char *print_char_cursor
char *print_char_cursor#1 // print_char_cursor zp[2]:2 8207.814814814814
char *print_char_cursor#4 // print_char_cursor zp[2]:2 27500.5
char *print_char_cursor#77 // print_char_cursor zp[2]:2 61.5
char *print_char_cursor#87 // print_char_cursor zp[2]:2 1809.0
char *print_char_cursor#92 // print_char_cursor zp[2]:2 202.0
char *print_char_cursor#98 // print_char_cursor zp[2]:2 22.0
char *print_char_cursor#99 // print_char_cursor zp[2]:2 22.0
2020-10-05 20:58:02 +00:00
void print_cls()
char *print_line_cursor
char *print_line_cursor#0 // print_line_cursor zp[2]:6 840.2499999999999
char *print_line_cursor#25 // print_line_cursor zp[2]:6 21003.0
char *print_line_cursor#49 // print_line_cursor zp[2]:6 1203.0
char *print_line_cursor#52 // print_line_cursor zp[2]:6 11.181818181818182
2020-10-05 20:58:02 +00:00
void print_ln()
char *print_screen
__constant char *print_screen#0 = (char *) 1024 // print_screen
void print_str(char *str)
char *print_str::str
char *print_str::str#0 // str zp[2]:4 20002.0
char *print_str::str#1 // str zp[2]:4 202.0
char *print_str::str#10 // str zp[2]:4 10251.25
char *print_str::str#12 // str zp[2]:4 1203.0
char *print_str::str#5 // str zp[2]:4 101.0
__constant char str[2] = " "
__constant char str1[6] = "fail!"
__constant char str2[3] = "ok"
2020-10-05 20:58:02 +00:00
void test_bytes()
__constant char test_bytes::bb = 0
char test_bytes::bc
__constant char test_bytes::bc#0 = 2 // bc
char test_bytes::bd
__constant char test_bytes::bd#0 = (char)(signed char)test_bytes::bc#0-4 // bd
__constant char test_bytes::msg2[$a] = "0+2-4=254"
2020-10-05 20:58:02 +00:00
void test_sbytes()
__constant signed char test_sbytes::bb = 0
signed char test_sbytes::bc
__constant signed char test_sbytes::bc#0 = 2 // bc
signed char test_sbytes::bd
__constant signed char test_sbytes::bd#0 = test_sbytes::bc#0-4 // bd
signed char test_sbytes::be
__constant signed char test_sbytes::be#0 = -test_sbytes::bd#0 // be
__constant signed char test_sbytes::bf = (signed char)-$7f-$7f
__constant char test_sbytes::msg2[9] = "0+2-4=-2"
__constant char test_sbytes::msg3[$b] = "-(0+2-4)=2"
__constant char test_sbytes::msg4[$b] = "-127-127=2"
zp[2]:4 [ assert_byte::msg#3 print_str::str#10 print_str::str#12 print_str::str#1 print_str::str#5 print_str::str#0 assert_sbyte::msg#5 memset::dst#2 memset::dst#1 ]
reg byte x [ assert_byte::b#3 ]
reg byte x [ assert_sbyte::b#5 ]
zp[1]:8 [ assert_sbyte::c#5 assert_byte::c#3 ]
zp[2]:2 [ print_char_cursor#87 print_char_cursor#77 print_char_cursor#98 print_char_cursor#99 print_char_cursor#1 print_char_cursor#92 print_char_cursor#4 ]
zp[2]:6 [ print_line_cursor#25 print_line_cursor#49 print_line_cursor#52 print_line_cursor#0 ]
reg byte a [ print_char::ch#0 ]
2017-12-29 10:21:11 +00:00
FINAL ASSEMBLER
Score: 1783
2017-12-30 12:45:59 +00:00
// File Comments
2021-06-19 20:11:26 +00:00
/// @file
/// A lightweight library for printing on the C64.
2021-06-19 20:28:44 +00:00
///
/// Printing with this library is done by calling print_ function for each element
// Upstart
// Commodore 64 PRG executable file
.file [name="constants.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
// Global Constants & labels
.const GREEN = 5
.const RED = 2
2020-05-02 09:38:51 +00:00
.label BG_COLOR = $d021
2020-06-27 19:18:00 +00:00
.label print_screen = $400
.label print_char_cursor = 2
.label print_line_cursor = 6
.segment Code
// main
main: {
// print_cls()
// [1] call print_cls
// [7] phi from main to print_cls [phi:main->print_cls]
jsr print_cls
// main::@1
2020-05-02 09:38:51 +00:00
// *BG_COLOR = GREEN
2020-10-05 20:58:02 +00:00
// [2] *BG_COLOR = GREEN -- _deref_pbuc1=vbuc2
lda #GREEN
2020-05-02 09:38:51 +00:00
sta BG_COLOR
// test_bytes()
// [3] call test_bytes
// [10] phi from main::@1 to test_bytes [phi:main::@1->test_bytes]
jsr test_bytes
2020-06-27 19:18:00 +00:00
// [4] phi from main::@1 to main::@2 [phi:main::@1->main::@2]
// main::@2
// test_sbytes()
// [5] call test_sbytes
// [17] phi from main::@2 to test_sbytes [phi:main::@2->test_sbytes]
jsr test_sbytes
// main::@return
// }
// [6] return
rts
}
// print_cls
// Clear the screen. Also resets current line/char cursor.
print_cls: {
// memset(print_screen, ' ', 1000)
// [8] call memset
// [28] phi from print_cls to memset [phi:print_cls->memset]
jsr memset
// print_cls::@return
// }
// [9] return
rts
}
// test_bytes
// Test different byte constants
test_bytes: {
.const bb = 0
.const bc = 2
.const bd = bc-4
// assert_byte("0=0", bb, 0)
// [11] call assert_byte
// [34] phi from test_bytes to assert_byte [phi:test_bytes->assert_byte]
2020-10-05 20:58:02 +00:00
// [34] phi print_line_cursor#52 = print_screen#0 [phi:test_bytes->assert_byte#0] -- pbuz1=pbuc1
lda #<print_screen
sta.z print_line_cursor
lda #>print_screen
sta.z print_line_cursor+1
2020-10-05 20:58:02 +00:00
// [34] phi assert_byte::c#3 = 0 [phi:test_bytes->assert_byte#1] -- vbuz1=vbuc1
lda #0
sta.z assert_byte.c
2020-10-05 20:58:02 +00:00
// [34] phi assert_byte::b#3 = test_bytes::bb [phi:test_bytes->assert_byte#2] -- vbuxx=vbuc1
ldx #bb
2020-10-05 20:58:02 +00:00
// [34] phi print_char_cursor#77 = print_screen#0 [phi:test_bytes->assert_byte#3] -- pbuz1=pbuc1
lda #<print_screen
sta.z print_char_cursor
lda #>print_screen
sta.z print_char_cursor+1
2020-10-05 20:58:02 +00:00
// [34] phi assert_byte::msg#3 = msg [phi:test_bytes->assert_byte#4] -- pbuz1=pbuc1
lda #<msg
sta.z assert_byte.msg
lda #>msg
sta.z assert_byte.msg+1
jsr assert_byte
// test_bytes::@1
2020-10-05 20:58:02 +00:00
// [12] print_char_cursor#98 = print_line_cursor#0 -- pbuz1=pbuz2
lda.z print_line_cursor
sta.z print_char_cursor
lda.z print_line_cursor+1
sta.z print_char_cursor+1
// assert_byte("0+2=2", bc, 2)
// [13] call assert_byte
// [34] phi from test_bytes::@1 to assert_byte [phi:test_bytes::@1->assert_byte]
2020-10-05 20:58:02 +00:00
// [34] phi print_line_cursor#52 = print_line_cursor#0 [phi:test_bytes::@1->assert_byte#0] -- register_copy
// [34] phi assert_byte::c#3 = 2 [phi:test_bytes::@1->assert_byte#1] -- vbuz1=vbuc1
lda #2
sta.z assert_byte.c
2020-10-05 20:58:02 +00:00
// [34] phi assert_byte::b#3 = test_bytes::bc#0 [phi:test_bytes::@1->assert_byte#2] -- vbuxx=vbuc1
ldx #bc
2020-10-05 20:58:02 +00:00
// [34] phi print_char_cursor#77 = print_char_cursor#98 [phi:test_bytes::@1->assert_byte#3] -- register_copy
// [34] phi assert_byte::msg#3 = msg1 [phi:test_bytes::@1->assert_byte#4] -- pbuz1=pbuc1
lda #<msg1
sta.z assert_byte.msg
lda #>msg1
sta.z assert_byte.msg+1
jsr assert_byte
// test_bytes::@2
2020-10-05 20:58:02 +00:00
// [14] print_char_cursor#99 = print_line_cursor#0 -- pbuz1=pbuz2
lda.z print_line_cursor
sta.z print_char_cursor
lda.z print_line_cursor+1
sta.z print_char_cursor+1
// assert_byte("0+2-4=254", bd, 254)
// [15] call assert_byte
// [34] phi from test_bytes::@2 to assert_byte [phi:test_bytes::@2->assert_byte]
2020-10-05 20:58:02 +00:00
// [34] phi print_line_cursor#52 = print_line_cursor#0 [phi:test_bytes::@2->assert_byte#0] -- register_copy
// [34] phi assert_byte::c#3 = $fe [phi:test_bytes::@2->assert_byte#1] -- vbuz1=vbuc1
lda #$fe
sta.z assert_byte.c
2020-10-05 20:58:02 +00:00
// [34] phi assert_byte::b#3 = test_bytes::bd#0 [phi:test_bytes::@2->assert_byte#2] -- vbuxx=vbuc1
ldx #bd
2020-10-05 20:58:02 +00:00
// [34] phi print_char_cursor#77 = print_char_cursor#99 [phi:test_bytes::@2->assert_byte#3] -- register_copy
// [34] phi assert_byte::msg#3 = test_bytes::msg2 [phi:test_bytes::@2->assert_byte#4] -- pbuz1=pbuc1
lda #<msg2
sta.z assert_byte.msg
lda #>msg2
sta.z assert_byte.msg+1
jsr assert_byte
// test_bytes::@return
// }
// [16] return
rts
.segment Data
msg2: .text "0+2-4=254"
.byte 0
}
.segment Code
// test_sbytes
2019-02-17 23:12:29 +00:00
// Test different signed byte constants
test_sbytes: {
.const bb = 0
.const bf = -$7f-$7f
.const bc = 2
2019-05-30 20:29:04 +00:00
.const bd = bc-4
.const be = -bd
// assert_sbyte("0=0", bb, 0)
// [18] call assert_sbyte
// [47] phi from test_sbytes to assert_sbyte [phi:test_sbytes->assert_sbyte]
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::c#5 = 0 [phi:test_sbytes->assert_sbyte#0] -- vbsz1=vbsc1
lda #0
sta.z assert_sbyte.c
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::b#5 = test_sbytes::bb [phi:test_sbytes->assert_sbyte#1] -- vbsxx=vbsc1
ldx #bb
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::msg#5 = msg [phi:test_sbytes->assert_sbyte#2] -- pbuz1=pbuc1
lda #<msg
sta.z assert_sbyte.msg
lda #>msg
sta.z assert_sbyte.msg+1
jsr assert_sbyte
// [19] phi from test_sbytes to test_sbytes::@1 [phi:test_sbytes->test_sbytes::@1]
// test_sbytes::@1
// assert_sbyte("0+2=2", bc, 2)
// [20] call assert_sbyte
// [47] phi from test_sbytes::@1 to assert_sbyte [phi:test_sbytes::@1->assert_sbyte]
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::c#5 = 2 [phi:test_sbytes::@1->assert_sbyte#0] -- vbsz1=vbsc1
lda #2
sta.z assert_sbyte.c
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::b#5 = test_sbytes::bc#0 [phi:test_sbytes::@1->assert_sbyte#1] -- vbsxx=vbsc1
ldx #bc
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::msg#5 = msg1 [phi:test_sbytes::@1->assert_sbyte#2] -- pbuz1=pbuc1
lda #<msg1
sta.z assert_sbyte.msg
lda #>msg1
sta.z assert_sbyte.msg+1
jsr assert_sbyte
// [21] phi from test_sbytes::@1 to test_sbytes::@2 [phi:test_sbytes::@1->test_sbytes::@2]
// test_sbytes::@2
// assert_sbyte("0+2-4=-2", bd, -2)
// [22] call assert_sbyte
// [47] phi from test_sbytes::@2 to assert_sbyte [phi:test_sbytes::@2->assert_sbyte]
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::c#5 = -2 [phi:test_sbytes::@2->assert_sbyte#0] -- vbsz1=vbsc1
lda #-2
sta.z assert_sbyte.c
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::b#5 = test_sbytes::bd#0 [phi:test_sbytes::@2->assert_sbyte#1] -- vbsxx=vbsc1
ldx #bd
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::msg#5 = test_sbytes::msg2 [phi:test_sbytes::@2->assert_sbyte#2] -- pbuz1=pbuc1
lda #<msg2
sta.z assert_sbyte.msg
lda #>msg2
sta.z assert_sbyte.msg+1
jsr assert_sbyte
// [23] phi from test_sbytes::@2 to test_sbytes::@3 [phi:test_sbytes::@2->test_sbytes::@3]
// test_sbytes::@3
// assert_sbyte("-(0+2-4)=2", be, 2)
// [24] call assert_sbyte
// [47] phi from test_sbytes::@3 to assert_sbyte [phi:test_sbytes::@3->assert_sbyte]
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::c#5 = 2 [phi:test_sbytes::@3->assert_sbyte#0] -- vbsz1=vbsc1
lda #2
sta.z assert_sbyte.c
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::b#5 = test_sbytes::be#0 [phi:test_sbytes::@3->assert_sbyte#1] -- vbsxx=vbsc1
ldx #be
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::msg#5 = test_sbytes::msg3 [phi:test_sbytes::@3->assert_sbyte#2] -- pbuz1=pbuc1
lda #<msg3
sta.z assert_sbyte.msg
lda #>msg3
sta.z assert_sbyte.msg+1
jsr assert_sbyte
// [25] phi from test_sbytes::@3 to test_sbytes::@4 [phi:test_sbytes::@3->test_sbytes::@4]
// test_sbytes::@4
// assert_sbyte("-127-127=2", bf, 2)
// [26] call assert_sbyte
// [47] phi from test_sbytes::@4 to assert_sbyte [phi:test_sbytes::@4->assert_sbyte]
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::c#5 = 2 [phi:test_sbytes::@4->assert_sbyte#0] -- vbsz1=vbsc1
lda #2
sta.z assert_sbyte.c
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::b#5 = test_sbytes::bf [phi:test_sbytes::@4->assert_sbyte#1] -- vbsxx=vbsc1
ldx #bf
2020-10-05 20:58:02 +00:00
// [47] phi assert_sbyte::msg#5 = test_sbytes::msg4 [phi:test_sbytes::@4->assert_sbyte#2] -- pbuz1=pbuc1
lda #<msg4
sta.z assert_sbyte.msg
lda #>msg4
sta.z assert_sbyte.msg+1
jsr assert_sbyte
// test_sbytes::@return
// }
// [27] return
rts
.segment Data
msg2: .text "0+2-4=-2"
.byte 0
msg3: .text "-(0+2-4)=2"
.byte 0
msg4: .text "-127-127=2"
.byte 0
}
.segment Code
// memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// void * memset(void *str, char c, unsigned int num)
memset: {
.const c = ' '
.const num = $3e8
.label str = print_screen
.label end = str+num
.label dst = 4
// [29] phi from memset to memset::@1 [phi:memset->memset::@1]
// [29] phi memset::dst#2 = (char *)memset::str#0 [phi:memset->memset::@1#0] -- pbuz1=pbuc1
lda #<str
sta.z dst
lda #>str
sta.z dst+1
// memset::@1
__b1:
// for(char* dst = str; dst!=end; dst++)
2020-10-05 20:58:02 +00:00
// [30] if(memset::dst#2!=memset::end#0) goto memset::@2 -- pbuz1_neq_pbuc1_then_la1
lda.z dst+1
cmp #>end
bne __b2
lda.z dst
cmp #<end
bne __b2
// memset::@return
// }
// [31] return
rts
// memset::@2
__b2:
// *dst = c
2020-10-05 20:58:02 +00:00
// [32] *memset::dst#2 = memset::c#0 -- _deref_pbuz1=vbuc1
lda #c
ldy #0
sta (dst),y
// for(char* dst = str; dst!=end; dst++)
2020-10-05 20:58:02 +00:00
// [33] memset::dst#1 = ++ memset::dst#2 -- pbuz1=_inc_pbuz1
inc.z dst
bne !+
inc.z dst+1
!:
// [29] phi from memset::@2 to memset::@1 [phi:memset::@2->memset::@1]
2020-10-05 20:58:02 +00:00
// [29] phi memset::dst#2 = memset::dst#1 [phi:memset::@2->memset::@1#0] -- register_copy
jmp __b1
}
// assert_byte
// void assert_byte(__zp(4) char *msg, __register(X) char b, __zp(8) char c)
assert_byte: {
.label msg = 4
.label c = 8
// print_str(msg)
2020-10-05 20:58:02 +00:00
// [35] print_str::str#1 = assert_byte::msg#3
// [36] call print_str
// [61] phi from assert_byte to print_str [phi:assert_byte->print_str]
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#77 [phi:assert_byte->print_str#0] -- register_copy
// [61] phi print_str::str#12 = print_str::str#1 [phi:assert_byte->print_str#1] -- register_copy
jsr print_str
// [37] phi from assert_byte to assert_byte::@4 [phi:assert_byte->assert_byte::@4]
// assert_byte::@4
// print_str(" ")
// [38] call print_str
// [61] phi from assert_byte::@4 to print_str [phi:assert_byte::@4->print_str]
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_byte::@4->print_str#0] -- register_copy
// [61] phi print_str::str#12 = str [phi:assert_byte::@4->print_str#1] -- pbuz1=pbuc1
lda #<str
sta.z print_str.str
lda #>str
sta.z print_str.str+1
jsr print_str
// assert_byte::@5
// if(b!=c)
2020-10-05 20:58:02 +00:00
// [39] if(assert_byte::b#3!=assert_byte::c#3) goto assert_byte::@1 -- vbuxx_neq_vbuz1_then_la1
cpx.z c
bne __b1
// [40] phi from assert_byte::@5 to assert_byte::@3 [phi:assert_byte::@5->assert_byte::@3]
// assert_byte::@3
// print_str("ok")
// [41] call print_str
// [61] phi from assert_byte::@3 to print_str [phi:assert_byte::@3->print_str]
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_byte::@3->print_str#0] -- register_copy
// [61] phi print_str::str#12 = str2 [phi:assert_byte::@3->print_str#1] -- pbuz1=pbuc1
lda #<str2
sta.z print_str.str
lda #>str2
sta.z print_str.str+1
jsr print_str
// [42] phi from assert_byte::@1 assert_byte::@3 to assert_byte::@2 [phi:assert_byte::@1/assert_byte::@3->assert_byte::@2]
// assert_byte::@2
__b2:
// print_ln()
// [43] call print_ln
// [68] phi from assert_byte::@2 to print_ln [phi:assert_byte::@2->print_ln]
2020-10-05 20:58:02 +00:00
// [68] phi print_line_cursor#49 = print_line_cursor#52 [phi:assert_byte::@2->print_ln#0] -- register_copy
jsr print_ln
// assert_byte::@return
// }
// [44] return
rts
// assert_byte::@1
__b1:
// *BG_COLOR = RED
2020-10-05 20:58:02 +00:00
// [45] *BG_COLOR = RED -- _deref_pbuc1=vbuc2
lda #RED
sta BG_COLOR
// print_str("fail!")
// [46] call print_str
// [61] phi from assert_byte::@1 to print_str [phi:assert_byte::@1->print_str]
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_byte::@1->print_str#0] -- register_copy
// [61] phi print_str::str#12 = str1 [phi:assert_byte::@1->print_str#1] -- pbuz1=pbuc1
lda #<str1
sta.z print_str.str
lda #>str1
sta.z print_str.str+1
jsr print_str
jmp __b2
}
// assert_sbyte
// void assert_sbyte(__zp(4) char *msg, __register(X) signed char b, __zp(8) signed char c)
assert_sbyte: {
.label msg = 4
.label c = 8
// print_str(msg)
2020-10-05 20:58:02 +00:00
// [48] print_str::str#5 = assert_sbyte::msg#5
// [49] print_char_cursor#92 = print_line_cursor#0 -- pbuz1=pbuz2
lda.z print_line_cursor
sta.z print_char_cursor
lda.z print_line_cursor+1
sta.z print_char_cursor+1
// print_str(msg)
// [50] call print_str
// [61] phi from assert_sbyte to print_str [phi:assert_sbyte->print_str]
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#92 [phi:assert_sbyte->print_str#0] -- register_copy
// [61] phi print_str::str#12 = print_str::str#5 [phi:assert_sbyte->print_str#1] -- register_copy
jsr print_str
// [51] phi from assert_sbyte to assert_sbyte::@4 [phi:assert_sbyte->assert_sbyte::@4]
// assert_sbyte::@4
// print_str(" ")
// [52] call print_str
// [61] phi from assert_sbyte::@4 to print_str [phi:assert_sbyte::@4->print_str]
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_sbyte::@4->print_str#0] -- register_copy
// [61] phi print_str::str#12 = str [phi:assert_sbyte::@4->print_str#1] -- pbuz1=pbuc1
lda #<str
sta.z print_str.str
lda #>str
sta.z print_str.str+1
jsr print_str
// assert_sbyte::@5
// if(b!=c)
2020-10-05 20:58:02 +00:00
// [53] if(assert_sbyte::b#5!=assert_sbyte::c#5) goto assert_sbyte::@1 -- vbsxx_neq_vbsz1_then_la1
cpx.z c
bne __b1
// [54] phi from assert_sbyte::@5 to assert_sbyte::@3 [phi:assert_sbyte::@5->assert_sbyte::@3]
// assert_sbyte::@3
// print_str("ok")
// [55] call print_str
// [61] phi from assert_sbyte::@3 to print_str [phi:assert_sbyte::@3->print_str]
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_sbyte::@3->print_str#0] -- register_copy
// [61] phi print_str::str#12 = str2 [phi:assert_sbyte::@3->print_str#1] -- pbuz1=pbuc1
lda #<str2
sta.z print_str.str
lda #>str2
sta.z print_str.str+1
jsr print_str
// [56] phi from assert_sbyte::@1 assert_sbyte::@3 to assert_sbyte::@2 [phi:assert_sbyte::@1/assert_sbyte::@3->assert_sbyte::@2]
// assert_sbyte::@2
__b2:
// print_ln()
// [57] call print_ln
// [68] phi from assert_sbyte::@2 to print_ln [phi:assert_sbyte::@2->print_ln]
2020-10-05 20:58:02 +00:00
// [68] phi print_line_cursor#49 = print_line_cursor#0 [phi:assert_sbyte::@2->print_ln#0] -- register_copy
jsr print_ln
// assert_sbyte::@return
// }
// [58] return
rts
// assert_sbyte::@1
__b1:
2020-05-02 09:38:51 +00:00
// *BG_COLOR = RED
2020-10-05 20:58:02 +00:00
// [59] *BG_COLOR = RED -- _deref_pbuc1=vbuc2
lda #RED
2020-05-02 09:38:51 +00:00
sta BG_COLOR
// print_str("fail!")
// [60] call print_str
// [61] phi from assert_sbyte::@1 to print_str [phi:assert_sbyte::@1->print_str]
2020-10-05 20:58:02 +00:00
// [61] phi print_char_cursor#87 = print_char_cursor#1 [phi:assert_sbyte::@1->print_str#0] -- register_copy
// [61] phi print_str::str#12 = str1 [phi:assert_sbyte::@1->print_str#1] -- pbuz1=pbuc1
lda #<str1
sta.z print_str.str
lda #>str1
sta.z print_str.str+1
jsr print_str
jmp __b2
}
// print_str
2019-02-17 23:12:29 +00:00
// Print a zero-terminated string
// void print_str(__zp(4) char *str)
print_str: {
.label str = 4
// [62] phi from print_str print_str::@3 to print_str::@1 [phi:print_str/print_str::@3->print_str::@1]
2020-10-05 20:58:02 +00:00
// [62] phi print_char_cursor#1 = print_char_cursor#87 [phi:print_str/print_str::@3->print_str::@1#0] -- register_copy
// [62] phi print_str::str#10 = print_str::str#12 [phi:print_str/print_str::@3->print_str::@1#1] -- register_copy
// print_str::@1
__b1:
// while(*str)
// [63] if(0!=*print_str::str#10) goto print_str::@2 -- 0_neq__deref_pbuz1_then_la1
ldy #0
lda (str),y
cmp #0
bne __b2
// print_str::@return
// }
// [64] return
rts
// print_str::@2
__b2:
// print_char(*(str++))
2020-10-05 20:58:02 +00:00
// [65] print_char::ch#0 = *print_str::str#10 -- vbuaa=_deref_pbuz1
ldy #0
lda (str),y
// [66] call print_char
jsr print_char
// print_str::@3
// print_char(*(str++));
2020-10-05 20:58:02 +00:00
// [67] print_str::str#0 = ++ print_str::str#10 -- pbuz1=_inc_pbuz1
inc.z str
bne !+
inc.z str+1
!:
jmp __b1
}
// print_ln
2019-02-17 23:12:29 +00:00
// Print a newline
print_ln: {
// [69] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1]
2020-10-05 20:58:02 +00:00
// [69] phi print_line_cursor#25 = print_line_cursor#49 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy
// print_ln::@1
__b1:
2024-01-02 18:45:16 +00:00
// print_line_cursor + 0x28
2020-10-05 20:58:02 +00:00
// [70] print_line_cursor#0 = print_line_cursor#25 + $28 -- pbuz1=pbuz1_plus_vbuc1
2019-03-18 01:23:29 +00:00
lda #$28
clc
adc.z print_line_cursor
sta.z print_line_cursor
bcc !+
inc.z print_line_cursor+1
!:
// while (print_line_cursor<print_char_cursor)
2020-10-05 20:58:02 +00:00
// [71] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1 -- pbuz1_lt_pbuz2_then_la1
lda.z print_line_cursor+1
cmp.z print_char_cursor+1
bcc __b1
bne !+
lda.z print_line_cursor
cmp.z print_char_cursor
bcc __b1
!:
// print_ln::@return
// }
// [72] return
rts
}
// print_char
// Print a single char
// void print_char(__register(A) char ch)
print_char: {
// *(print_char_cursor++) = ch
2020-10-05 20:58:02 +00:00
// [73] *print_char_cursor#1 = print_char::ch#0 -- _deref_pbuz1=vbuaa
ldy #0
sta (print_char_cursor),y
// *(print_char_cursor++) = ch;
2020-10-05 20:58:02 +00:00
// [74] print_char_cursor#4 = ++ print_char_cursor#1 -- pbuz1=_inc_pbuz1
inc.z print_char_cursor
bne !+
inc.z print_char_cursor+1
!:
// print_char::@return
// }
// [75] return
rts
}
// File Data
.segment Data
msg: .text "0=0"
.byte 0
msg1: .text "0+2=2"
.byte 0
str: .text " "
.byte 0
str1: .text "fail!"
.byte 0
str2: .text "ok"
.byte 0