2019-05-30 20:29:04 +00:00
|
|
|
Adding pointer type conversion cast (byte*) print_screen in (byte*) print_screen ← (number) $400
|
|
|
|
Culled Empty Block (label) @1
|
|
|
|
Culled Empty Block (label) @2
|
|
|
|
Culled Empty Block (label) print_str::@4
|
|
|
|
Culled Empty Block (label) print_str::@3
|
|
|
|
Culled Empty Block (label) print_str::@5
|
|
|
|
Culled Empty Block (label) print_str::@6
|
|
|
|
Culled Empty Block (label) @3
|
|
|
|
Culled Empty Block (label) @4
|
|
|
|
Culled Empty Block (label) @5
|
|
|
|
Culled Empty Block (label) @6
|
|
|
|
Culled Empty Block (label) @7
|
|
|
|
Culled Empty Block (label) @8
|
|
|
|
Culled Empty Block (label) @9
|
|
|
|
Culled Empty Block (label) @10
|
|
|
|
Culled Empty Block (label) @11
|
|
|
|
Culled Empty Block (label) @12
|
|
|
|
Culled Empty Block (label) @13
|
|
|
|
Culled Empty Block (label) @14
|
|
|
|
Culled Empty Block (label) @15
|
|
|
|
Culled Empty Block (label) @16
|
|
|
|
Culled Empty Block (label) @17
|
|
|
|
Culled Empty Block (label) @18
|
2017-11-29 11:29:57 +00:00
|
|
|
|
2018-08-22 22:24:32 +00:00
|
|
|
CONTROL FLOW GRAPH SSA
|
2017-12-03 21:57:54 +00:00
|
|
|
@begin: scope:[] from
|
2019-05-30 20:29:04 +00:00
|
|
|
(byte*) print_screen#0 ← ((byte*)) (number) $400
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
|
|
|
|
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
|
2019-04-15 12:03:50 +00:00
|
|
|
to:@19
|
2017-11-29 11:29:57 +00:00
|
|
|
print_str: scope:[print_str] from main main::@2 main::@4
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor#29 ← phi( main/(byte*) print_char_cursor#27 main::@2/(byte*) print_char_cursor#6 main::@4/(byte*) print_char_cursor#8 )
|
2017-12-03 21:57:54 +00:00
|
|
|
(byte*) print_str::str#6 ← phi( main/(byte*) print_str::str#1 main::@2/(byte*) print_str::str#2 main::@4/(byte*) print_str::str#3 )
|
2017-11-29 11:29:57 +00:00
|
|
|
to:print_str::@1
|
|
|
|
print_str::@1: scope:[print_str] from print_str print_str::@2
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor#25 ← phi( print_str/(byte*) print_char_cursor#29 print_str::@2/(byte*) print_char_cursor#1 )
|
2017-12-03 21:57:54 +00:00
|
|
|
(byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 )
|
2018-04-28 06:41:05 +00:00
|
|
|
(bool~) print_str::$0 ← *((byte*) print_str::str#4) != (byte) '@'
|
|
|
|
if((bool~) print_str::$0) goto print_str::@2
|
2017-11-29 11:29:57 +00:00
|
|
|
to:print_str::@return
|
|
|
|
print_str::@2: scope:[print_str] from print_str::@1
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor#13 ← phi( print_str::@1/(byte*) print_char_cursor#25 )
|
2017-11-29 11:29:57 +00:00
|
|
|
(byte*) print_str::str#5 ← phi( print_str::@1/(byte*) print_str::str#4 )
|
2018-03-25 21:40:38 +00:00
|
|
|
*((byte*) print_char_cursor#13) ← *((byte*) print_str::str#5)
|
|
|
|
(byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#13
|
2017-12-03 21:57:54 +00:00
|
|
|
(byte*) print_str::str#0 ← ++ (byte*) print_str::str#5
|
2017-11-29 11:29:57 +00:00
|
|
|
to:print_str::@1
|
|
|
|
print_str::@return: scope:[print_str] from print_str::@1
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor#14 ← phi( print_str::@1/(byte*) print_char_cursor#25 )
|
|
|
|
(byte*) print_char_cursor#2 ← (byte*) print_char_cursor#14
|
2017-11-29 11:29:57 +00:00
|
|
|
return
|
|
|
|
to:@return
|
|
|
|
print_ln: scope:[print_ln] from main::@1 main::@3 main::@5
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor#26 ← phi( main::@1/(byte*) print_char_cursor#5 main::@3/(byte*) print_char_cursor#7 main::@5/(byte*) print_char_cursor#9 )
|
|
|
|
(byte*) print_line_cursor#16 ← phi( main::@1/(byte*) print_line_cursor#17 main::@3/(byte*) print_line_cursor#18 main::@5/(byte*) print_line_cursor#19 )
|
2017-11-29 11:29:57 +00:00
|
|
|
to:print_ln::@1
|
|
|
|
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor#15 ← phi( print_ln/(byte*) print_char_cursor#26 print_ln::@1/(byte*) print_char_cursor#15 )
|
|
|
|
(byte*) print_line_cursor#8 ← phi( print_ln/(byte*) print_line_cursor#16 print_ln::@1/(byte*) print_line_cursor#1 )
|
2019-05-30 20:29:04 +00:00
|
|
|
(byte*~) print_ln::$0 ← (byte*) print_line_cursor#8 + (number) $28
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_line_cursor#1 ← (byte*~) print_ln::$0
|
2018-04-28 06:41:05 +00:00
|
|
|
(bool~) print_ln::$1 ← (byte*) print_line_cursor#1 < (byte*) print_char_cursor#15
|
|
|
|
if((bool~) print_ln::$1) goto print_ln::@1
|
2017-11-29 11:29:57 +00:00
|
|
|
to:print_ln::@2
|
|
|
|
print_ln::@2: scope:[print_ln] from print_ln::@1
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_line_cursor#9 ← phi( print_ln::@1/(byte*) print_line_cursor#1 )
|
|
|
|
(byte*) print_char_cursor#3 ← (byte*) print_line_cursor#9
|
2017-11-29 11:29:57 +00:00
|
|
|
to:print_ln::@return
|
|
|
|
print_ln::@return: scope:[print_ln] from print_ln::@2
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor#16 ← phi( print_ln::@2/(byte*) print_char_cursor#3 )
|
|
|
|
(byte*) print_line_cursor#10 ← phi( print_ln::@2/(byte*) print_line_cursor#9 )
|
|
|
|
(byte*) print_line_cursor#2 ← (byte*) print_line_cursor#10
|
|
|
|
(byte*) print_char_cursor#4 ← (byte*) print_char_cursor#16
|
2017-11-29 11:29:57 +00:00
|
|
|
return
|
|
|
|
to:@return
|
2019-04-15 12:03:50 +00:00
|
|
|
@19: scope:[] from @begin
|
|
|
|
(byte*) print_line_cursor#22 ← phi( @begin/(byte*) print_line_cursor#0 )
|
|
|
|
(byte*) print_char_cursor#30 ← phi( @begin/(byte*) print_char_cursor#0 )
|
|
|
|
(byte[]) msg#0 ← (const string) $0
|
|
|
|
(byte[]) msg2#0 ← (const string) $1
|
|
|
|
(byte[]) msg3#0 ← (const string) $2
|
2018-11-25 01:46:22 +00:00
|
|
|
to:@20
|
|
|
|
main: scope:[main] from @20
|
|
|
|
(byte*) print_line_cursor#21 ← phi( @20/(byte*) print_line_cursor#20 )
|
|
|
|
(byte*) print_char_cursor#27 ← phi( @20/(byte*) print_char_cursor#28 )
|
2017-12-27 21:08:15 +00:00
|
|
|
(byte*) print_str::str#1 ← (byte[]) msg#0
|
2018-05-01 20:50:59 +00:00
|
|
|
call print_str
|
2017-11-29 11:29:57 +00:00
|
|
|
to:main::@1
|
|
|
|
main::@1: scope:[main] from main
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_line_cursor#17 ← phi( main/(byte*) print_line_cursor#21 )
|
|
|
|
(byte*) print_char_cursor#17 ← phi( main/(byte*) print_char_cursor#2 )
|
|
|
|
(byte*) print_char_cursor#5 ← (byte*) print_char_cursor#17
|
2018-05-01 20:50:59 +00:00
|
|
|
call print_ln
|
2017-11-29 11:29:57 +00:00
|
|
|
to:main::@2
|
|
|
|
main::@2: scope:[main] from main::@1
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor#18 ← phi( main::@1/(byte*) print_char_cursor#4 )
|
|
|
|
(byte*) print_line_cursor#11 ← phi( main::@1/(byte*) print_line_cursor#2 )
|
|
|
|
(byte*) print_line_cursor#3 ← (byte*) print_line_cursor#11
|
|
|
|
(byte*) print_char_cursor#6 ← (byte*) print_char_cursor#18
|
2017-12-27 21:08:15 +00:00
|
|
|
(byte*) print_str::str#2 ← (byte[]) msg2#0
|
2018-05-01 20:50:59 +00:00
|
|
|
call print_str
|
2017-11-29 11:29:57 +00:00
|
|
|
to:main::@3
|
|
|
|
main::@3: scope:[main] from main::@2
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_line_cursor#18 ← phi( main::@2/(byte*) print_line_cursor#3 )
|
|
|
|
(byte*) print_char_cursor#19 ← phi( main::@2/(byte*) print_char_cursor#2 )
|
|
|
|
(byte*) print_char_cursor#7 ← (byte*) print_char_cursor#19
|
2018-05-01 20:50:59 +00:00
|
|
|
call print_ln
|
2017-11-29 11:29:57 +00:00
|
|
|
to:main::@4
|
|
|
|
main::@4: scope:[main] from main::@3
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor#20 ← phi( main::@3/(byte*) print_char_cursor#4 )
|
|
|
|
(byte*) print_line_cursor#12 ← phi( main::@3/(byte*) print_line_cursor#2 )
|
|
|
|
(byte*) print_line_cursor#4 ← (byte*) print_line_cursor#12
|
|
|
|
(byte*) print_char_cursor#8 ← (byte*) print_char_cursor#20
|
2017-12-27 21:08:15 +00:00
|
|
|
(byte*) print_str::str#3 ← (byte[]) msg3#0
|
2018-05-01 20:50:59 +00:00
|
|
|
call print_str
|
2017-11-29 11:29:57 +00:00
|
|
|
to:main::@5
|
|
|
|
main::@5: scope:[main] from main::@4
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_line_cursor#19 ← phi( main::@4/(byte*) print_line_cursor#4 )
|
|
|
|
(byte*) print_char_cursor#21 ← phi( main::@4/(byte*) print_char_cursor#2 )
|
|
|
|
(byte*) print_char_cursor#9 ← (byte*) print_char_cursor#21
|
2018-05-01 20:50:59 +00:00
|
|
|
call print_ln
|
2017-11-29 11:29:57 +00:00
|
|
|
to:main::@6
|
|
|
|
main::@6: scope:[main] from main::@5
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor#22 ← phi( main::@5/(byte*) print_char_cursor#4 )
|
|
|
|
(byte*) print_line_cursor#13 ← phi( main::@5/(byte*) print_line_cursor#2 )
|
|
|
|
(byte*) print_line_cursor#5 ← (byte*) print_line_cursor#13
|
|
|
|
(byte*) print_char_cursor#10 ← (byte*) print_char_cursor#22
|
2017-11-29 11:29:57 +00:00
|
|
|
to:main::@return
|
|
|
|
main::@return: scope:[main] from main::@6
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_line_cursor#14 ← phi( main::@6/(byte*) print_line_cursor#5 )
|
|
|
|
(byte*) print_char_cursor#23 ← phi( main::@6/(byte*) print_char_cursor#10 )
|
|
|
|
(byte*) print_char_cursor#11 ← (byte*) print_char_cursor#23
|
|
|
|
(byte*) print_line_cursor#6 ← (byte*) print_line_cursor#14
|
2017-11-29 11:29:57 +00:00
|
|
|
return
|
|
|
|
to:@return
|
2018-11-25 01:46:22 +00:00
|
|
|
@20: scope:[] from @19
|
|
|
|
(byte*) print_line_cursor#20 ← phi( @19/(byte*) print_line_cursor#22 )
|
|
|
|
(byte*) print_char_cursor#28 ← phi( @19/(byte*) print_char_cursor#30 )
|
2018-05-01 20:50:59 +00:00
|
|
|
call main
|
2018-11-25 01:46:22 +00:00
|
|
|
to:@21
|
|
|
|
@21: scope:[] from @20
|
|
|
|
(byte*) print_line_cursor#15 ← phi( @20/(byte*) print_line_cursor#6 )
|
|
|
|
(byte*) print_char_cursor#24 ← phi( @20/(byte*) print_char_cursor#11 )
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor#12 ← (byte*) print_char_cursor#24
|
|
|
|
(byte*) print_line_cursor#7 ← (byte*) print_line_cursor#15
|
2017-11-29 11:29:57 +00:00
|
|
|
to:@end
|
2018-11-25 01:46:22 +00:00
|
|
|
@end: scope:[] from @21
|
2017-11-29 11:29:57 +00:00
|
|
|
|
2017-12-29 10:21:11 +00:00
|
|
|
SYMBOL TABLE SSA
|
2019-04-15 12:03:50 +00:00
|
|
|
(const string) $0 = (string) "hello world! @"
|
|
|
|
(const string) $1 = (string) "hello c64! @"
|
|
|
|
(const string) $2 = (string) "hello 2017! @"
|
2018-11-03 18:02:59 +00:00
|
|
|
(label) @19
|
2018-11-25 01:46:22 +00:00
|
|
|
(label) @20
|
|
|
|
(label) @21
|
2017-11-29 11:29:57 +00:00
|
|
|
(label) @begin
|
|
|
|
(label) @end
|
|
|
|
(void()) main()
|
|
|
|
(label) main::@1
|
|
|
|
(label) main::@2
|
|
|
|
(label) main::@3
|
|
|
|
(label) main::@4
|
|
|
|
(label) main::@5
|
|
|
|
(label) main::@6
|
|
|
|
(label) main::@return
|
|
|
|
(byte[]) msg
|
|
|
|
(byte[]) msg#0
|
|
|
|
(byte[]) msg2
|
|
|
|
(byte[]) msg2#0
|
|
|
|
(byte[]) msg3
|
|
|
|
(byte[]) msg3#0
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor
|
|
|
|
(byte*) print_char_cursor#0
|
|
|
|
(byte*) print_char_cursor#1
|
|
|
|
(byte*) print_char_cursor#10
|
|
|
|
(byte*) print_char_cursor#11
|
|
|
|
(byte*) print_char_cursor#12
|
|
|
|
(byte*) print_char_cursor#13
|
|
|
|
(byte*) print_char_cursor#14
|
|
|
|
(byte*) print_char_cursor#15
|
|
|
|
(byte*) print_char_cursor#16
|
|
|
|
(byte*) print_char_cursor#17
|
|
|
|
(byte*) print_char_cursor#18
|
|
|
|
(byte*) print_char_cursor#19
|
|
|
|
(byte*) print_char_cursor#2
|
|
|
|
(byte*) print_char_cursor#20
|
|
|
|
(byte*) print_char_cursor#21
|
|
|
|
(byte*) print_char_cursor#22
|
|
|
|
(byte*) print_char_cursor#23
|
|
|
|
(byte*) print_char_cursor#24
|
|
|
|
(byte*) print_char_cursor#25
|
|
|
|
(byte*) print_char_cursor#26
|
|
|
|
(byte*) print_char_cursor#27
|
|
|
|
(byte*) print_char_cursor#28
|
|
|
|
(byte*) print_char_cursor#29
|
|
|
|
(byte*) print_char_cursor#3
|
|
|
|
(byte*) print_char_cursor#30
|
|
|
|
(byte*) print_char_cursor#4
|
|
|
|
(byte*) print_char_cursor#5
|
|
|
|
(byte*) print_char_cursor#6
|
|
|
|
(byte*) print_char_cursor#7
|
|
|
|
(byte*) print_char_cursor#8
|
|
|
|
(byte*) print_char_cursor#9
|
|
|
|
(byte*) print_line_cursor
|
|
|
|
(byte*) print_line_cursor#0
|
|
|
|
(byte*) print_line_cursor#1
|
|
|
|
(byte*) print_line_cursor#10
|
|
|
|
(byte*) print_line_cursor#11
|
|
|
|
(byte*) print_line_cursor#12
|
|
|
|
(byte*) print_line_cursor#13
|
|
|
|
(byte*) print_line_cursor#14
|
|
|
|
(byte*) print_line_cursor#15
|
|
|
|
(byte*) print_line_cursor#16
|
|
|
|
(byte*) print_line_cursor#17
|
|
|
|
(byte*) print_line_cursor#18
|
|
|
|
(byte*) print_line_cursor#19
|
|
|
|
(byte*) print_line_cursor#2
|
|
|
|
(byte*) print_line_cursor#20
|
|
|
|
(byte*) print_line_cursor#21
|
|
|
|
(byte*) print_line_cursor#22
|
|
|
|
(byte*) print_line_cursor#3
|
|
|
|
(byte*) print_line_cursor#4
|
|
|
|
(byte*) print_line_cursor#5
|
|
|
|
(byte*) print_line_cursor#6
|
|
|
|
(byte*) print_line_cursor#7
|
|
|
|
(byte*) print_line_cursor#8
|
|
|
|
(byte*) print_line_cursor#9
|
2017-11-29 11:29:57 +00:00
|
|
|
(void()) print_ln()
|
|
|
|
(byte*~) print_ln::$0
|
2018-04-28 06:41:05 +00:00
|
|
|
(bool~) print_ln::$1
|
2017-11-29 11:29:57 +00:00
|
|
|
(label) print_ln::@1
|
|
|
|
(label) print_ln::@2
|
|
|
|
(label) print_ln::@return
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_screen
|
|
|
|
(byte*) print_screen#0
|
2017-11-29 11:29:57 +00:00
|
|
|
(void()) print_str((byte*) print_str::str)
|
2018-04-28 06:41:05 +00:00
|
|
|
(bool~) print_str::$0
|
2017-11-29 11:29:57 +00:00
|
|
|
(label) print_str::@1
|
|
|
|
(label) print_str::@2
|
|
|
|
(label) print_str::@return
|
|
|
|
(byte*) print_str::str
|
|
|
|
(byte*) print_str::str#0
|
|
|
|
(byte*) print_str::str#1
|
|
|
|
(byte*) print_str::str#2
|
|
|
|
(byte*) print_str::str#3
|
|
|
|
(byte*) print_str::str#4
|
|
|
|
(byte*) print_str::str#5
|
|
|
|
(byte*) print_str::str#6
|
|
|
|
|
2019-05-30 20:29:04 +00:00
|
|
|
Adding number conversion cast (unumber) $28 in (byte*~) print_ln::$0 ← (byte*) print_line_cursor#8 + (number) $28
|
|
|
|
Successful SSA optimization PassNAddNumberTypeConversions
|
|
|
|
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
|
|
|
|
Successful SSA optimization Pass2InlineCast
|
|
|
|
Simplifying constant pointer cast (byte*) 1024
|
|
|
|
Simplifying constant integer cast $28
|
|
|
|
Successful SSA optimization PassNCastSimplification
|
|
|
|
Finalized unsigned number type (byte) $28
|
|
|
|
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
2019-04-15 12:03:50 +00:00
|
|
|
Alias (byte*) print_char_cursor#0 = (byte*) print_line_cursor#0 (byte*) print_screen#0 (byte*) print_char_cursor#30 (byte*) print_line_cursor#22 (byte*) print_char_cursor#28 (byte*) print_line_cursor#20
|
2017-12-03 21:57:54 +00:00
|
|
|
Alias (byte*) print_str::str#4 = (byte*) print_str::str#5
|
2018-03-25 21:40:38 +00:00
|
|
|
Alias (byte*) print_char_cursor#13 = (byte*) print_char_cursor#25 (byte*) print_char_cursor#14 (byte*) print_char_cursor#2
|
|
|
|
Alias (byte*) print_line_cursor#1 = (byte*~) print_ln::$0 (byte*) print_line_cursor#9 (byte*) print_char_cursor#3 (byte*) print_line_cursor#10 (byte*) print_char_cursor#16 (byte*) print_line_cursor#2 (byte*) print_char_cursor#4
|
|
|
|
Alias (byte*) print_line_cursor#17 = (byte*) print_line_cursor#21
|
|
|
|
Alias (byte*) print_char_cursor#17 = (byte*) print_char_cursor#5
|
|
|
|
Alias (byte*) print_line_cursor#11 = (byte*) print_line_cursor#3 (byte*) print_line_cursor#18
|
|
|
|
Alias (byte*) print_char_cursor#18 = (byte*) print_char_cursor#6
|
|
|
|
Alias (byte*) print_char_cursor#19 = (byte*) print_char_cursor#7
|
|
|
|
Alias (byte*) print_line_cursor#12 = (byte*) print_line_cursor#4 (byte*) print_line_cursor#19
|
|
|
|
Alias (byte*) print_char_cursor#20 = (byte*) print_char_cursor#8
|
|
|
|
Alias (byte*) print_char_cursor#21 = (byte*) print_char_cursor#9
|
|
|
|
Alias (byte*) print_line_cursor#13 = (byte*) print_line_cursor#5 (byte*) print_line_cursor#14 (byte*) print_line_cursor#6
|
|
|
|
Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#22 (byte*) print_char_cursor#23 (byte*) print_char_cursor#11
|
|
|
|
Alias (byte*) print_char_cursor#12 = (byte*) print_char_cursor#24
|
|
|
|
Alias (byte*) print_line_cursor#15 = (byte*) print_line_cursor#7
|
2018-08-22 20:23:42 +00:00
|
|
|
Successful SSA optimization Pass2AliasElimination
|
2018-03-25 21:40:38 +00:00
|
|
|
Self Phi Eliminated (byte*) print_char_cursor#15
|
2018-08-22 20:23:42 +00:00
|
|
|
Successful SSA optimization Pass2SelfPhiElimination
|
2019-05-30 20:29:04 +00:00
|
|
|
Identical Phi Values (byte*) print_char_cursor#15 (byte*) print_char_cursor#26
|
|
|
|
Identical Phi Values (byte*) print_char_cursor#27 (byte*) print_char_cursor#0
|
|
|
|
Identical Phi Values (byte*) print_line_cursor#17 (byte*) print_char_cursor#0
|
|
|
|
Identical Phi Values (byte*) print_char_cursor#17 (byte*) print_char_cursor#13
|
|
|
|
Identical Phi Values (byte*) print_line_cursor#11 (byte*) print_line_cursor#1
|
|
|
|
Identical Phi Values (byte*) print_char_cursor#18 (byte*) print_line_cursor#1
|
|
|
|
Identical Phi Values (byte*) print_char_cursor#19 (byte*) print_char_cursor#13
|
|
|
|
Identical Phi Values (byte*) print_line_cursor#12 (byte*) print_line_cursor#1
|
|
|
|
Identical Phi Values (byte*) print_char_cursor#20 (byte*) print_line_cursor#1
|
|
|
|
Identical Phi Values (byte*) print_char_cursor#21 (byte*) print_char_cursor#13
|
|
|
|
Identical Phi Values (byte*) print_line_cursor#13 (byte*) print_line_cursor#1
|
|
|
|
Identical Phi Values (byte*) print_char_cursor#10 (byte*) print_line_cursor#1
|
|
|
|
Identical Phi Values (byte*) print_char_cursor#12 (byte*) print_char_cursor#10
|
|
|
|
Identical Phi Values (byte*) print_line_cursor#15 (byte*) print_line_cursor#13
|
|
|
|
Successful SSA optimization Pass2IdenticalPhiElimination
|
|
|
|
Identical Phi Values (byte*) print_char_cursor#26 (byte*) print_char_cursor#13
|
|
|
|
Successful SSA optimization Pass2IdenticalPhiElimination
|
2019-01-07 20:58:40 +00:00
|
|
|
Simple Condition (bool~) print_str::$0 [6] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2
|
|
|
|
Simple Condition (bool~) print_ln::$1 [19] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#13) goto print_ln::@1
|
2018-08-22 20:23:42 +00:00
|
|
|
Successful SSA optimization Pass2ConditionalJumpSimplification
|
2019-05-30 20:29:04 +00:00
|
|
|
Constant (const byte*) print_char_cursor#0 = (byte*) 1024
|
2019-04-15 12:03:50 +00:00
|
|
|
Constant (const byte[]) msg#0 = $0
|
|
|
|
Constant (const byte[]) msg2#0 = $1
|
|
|
|
Constant (const byte[]) msg3#0 = $2
|
2018-08-22 20:23:42 +00:00
|
|
|
Successful SSA optimization Pass2ConstantIdentification
|
2018-07-21 09:13:32 +00:00
|
|
|
Constant (const byte*) print_str::str#1 = msg#0
|
|
|
|
Constant (const byte*) print_str::str#2 = msg2#0
|
|
|
|
Constant (const byte*) print_str::str#3 = msg3#0
|
2018-08-22 20:23:42 +00:00
|
|
|
Successful SSA optimization Pass2ConstantIdentification
|
2018-07-21 09:13:32 +00:00
|
|
|
Inlining constant with var siblings (const byte*) print_str::str#1
|
|
|
|
Inlining constant with var siblings (const byte*) print_str::str#2
|
|
|
|
Inlining constant with var siblings (const byte*) print_str::str#3
|
2018-03-25 21:40:38 +00:00
|
|
|
Inlining constant with var siblings (const byte*) print_char_cursor#0
|
2019-05-30 20:29:04 +00:00
|
|
|
Constant inlined print_char_cursor#0 = (byte*) 1024
|
2018-07-21 09:13:32 +00:00
|
|
|
Constant inlined print_str::str#3 = (const byte[]) msg3#0
|
|
|
|
Constant inlined print_str::str#2 = (const byte[]) msg2#0
|
|
|
|
Constant inlined print_str::str#1 = (const byte[]) msg#0
|
2019-04-15 12:03:50 +00:00
|
|
|
Constant inlined $0 = (const byte[]) msg#0
|
|
|
|
Constant inlined $1 = (const byte[]) msg2#0
|
|
|
|
Constant inlined $2 = (const byte[]) msg3#0
|
2018-08-22 20:23:42 +00:00
|
|
|
Successful SSA optimization Pass2ConstantInlining
|
2017-11-29 11:29:57 +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 @begin
|
2019-05-30 20:29:04 +00:00
|
|
|
Adding NOP phi() at start of @19
|
2018-11-25 01:46:22 +00:00
|
|
|
Adding NOP phi() at start of @20
|
2019-05-30 20:29:04 +00:00
|
|
|
Adding NOP phi() at start of @21
|
2017-11-29 11:29:57 +00:00
|
|
|
Adding NOP phi() at start of @end
|
|
|
|
Adding NOP phi() at start of main
|
|
|
|
Adding NOP phi() at start of main::@1
|
2019-05-30 20:29:04 +00:00
|
|
|
Adding NOP phi() at start of main::@6
|
|
|
|
Adding NOP phi() at start of print_ln::@2
|
2017-11-29 11:29:57 +00:00
|
|
|
CALL GRAPH
|
2019-05-30 20:29:04 +00:00
|
|
|
Calls in [] to main:3
|
|
|
|
Calls in [main] to print_str:7 print_ln:9 print_str:11 print_ln:13 print_str:15 print_ln:17
|
2017-11-29 11:29:57 +00:00
|
|
|
|
|
|
|
Created 6 initial phi equivalence classes
|
2019-05-30 20:29:04 +00:00
|
|
|
Not coalescing [10] print_char_cursor#31 ← print_line_cursor#1
|
|
|
|
Coalesced [12] print_line_cursor#23 ← print_line_cursor#1
|
|
|
|
Not coalescing [14] print_char_cursor#32 ← print_line_cursor#1
|
|
|
|
Coalesced (already) [16] print_line_cursor#24 ← print_line_cursor#1
|
|
|
|
Coalesced [21] print_line_cursor#25 ← print_line_cursor#16
|
|
|
|
Coalesced (already) [27] print_line_cursor#26 ← print_line_cursor#1
|
|
|
|
Coalesced [29] print_str::str#7 ← print_str::str#6
|
|
|
|
Coalesced [30] print_char_cursor#33 ← print_char_cursor#29
|
|
|
|
Coalesced [37] print_str::str#8 ← print_str::str#0
|
|
|
|
Coalesced [38] print_char_cursor#34 ← print_char_cursor#1
|
2017-11-29 11:29:57 +00:00
|
|
|
Coalesced down to 3 phi equivalence classes
|
2019-05-30 20:29:04 +00:00
|
|
|
Culled Empty Block (label) @19
|
|
|
|
Culled Empty Block (label) @21
|
|
|
|
Culled Empty Block (label) main::@6
|
|
|
|
Culled Empty Block (label) print_ln::@2
|
2017-11-29 11:29:57 +00:00
|
|
|
Culled Empty Block (label) print_ln::@3
|
2019-03-31 15:10:41 +00:00
|
|
|
Renumbering block @20 to @1
|
2017-11-29 11:29:57 +00:00
|
|
|
Adding NOP phi() at start of @begin
|
2019-03-31 15:10:41 +00:00
|
|
|
Adding NOP phi() at start of @1
|
2017-11-29 11:29:57 +00:00
|
|
|
Adding NOP phi() at start of @end
|
|
|
|
Adding NOP phi() at start of main
|
|
|
|
Adding NOP phi() at start of main::@1
|
|
|
|
Adding NOP phi() at start of main::@3
|
|
|
|
Adding NOP phi() at start of main::@5
|
|
|
|
|
2017-12-29 10:21:11 +00:00
|
|
|
FINAL CONTROL FLOW GRAPH
|
2017-11-29 11:29:57 +00:00
|
|
|
@begin: scope:[] from
|
2018-11-11 20:51:36 +00:00
|
|
|
[0] phi()
|
2019-03-31 15:10:41 +00:00
|
|
|
to:@1
|
|
|
|
@1: scope:[] from @begin
|
2018-11-11 20:51:36 +00:00
|
|
|
[1] phi()
|
|
|
|
[2] call main
|
2017-11-29 11:29:57 +00:00
|
|
|
to:@end
|
2019-03-31 15:10:41 +00:00
|
|
|
@end: scope:[] from @1
|
2018-11-11 20:51:36 +00:00
|
|
|
[3] phi()
|
2019-03-31 15:10:41 +00:00
|
|
|
main: scope:[main] from @1
|
2018-11-11 20:51:36 +00:00
|
|
|
[4] phi()
|
|
|
|
[5] call print_str
|
2017-11-29 11:29:57 +00:00
|
|
|
to:main::@1
|
|
|
|
main::@1: scope:[main] from main
|
2018-11-11 20:51:36 +00:00
|
|
|
[6] phi()
|
|
|
|
[7] call print_ln
|
2017-11-29 11:29:57 +00:00
|
|
|
to:main::@2
|
|
|
|
main::@2: scope:[main] from main::@1
|
2019-04-15 12:03:50 +00:00
|
|
|
[8] (byte*~) print_char_cursor#31 ← (byte*) print_line_cursor#1
|
2018-11-11 20:51:36 +00:00
|
|
|
[9] call print_str
|
2017-11-29 11:29:57 +00:00
|
|
|
to:main::@3
|
|
|
|
main::@3: scope:[main] from main::@2
|
2018-11-11 20:51:36 +00:00
|
|
|
[10] phi()
|
|
|
|
[11] call print_ln
|
2017-11-29 11:29:57 +00:00
|
|
|
to:main::@4
|
|
|
|
main::@4: scope:[main] from main::@3
|
2019-04-15 12:03:50 +00:00
|
|
|
[12] (byte*~) print_char_cursor#32 ← (byte*) print_line_cursor#1
|
2018-11-11 20:51:36 +00:00
|
|
|
[13] call print_str
|
2017-11-29 11:29:57 +00:00
|
|
|
to:main::@5
|
|
|
|
main::@5: scope:[main] from main::@4
|
2018-11-11 20:51:36 +00:00
|
|
|
[14] phi()
|
|
|
|
[15] call print_ln
|
2017-11-29 11:29:57 +00:00
|
|
|
to:main::@return
|
|
|
|
main::@return: scope:[main] from main::@5
|
2018-11-11 20:51:36 +00:00
|
|
|
[16] return
|
2017-11-29 11:29:57 +00:00
|
|
|
to:@return
|
|
|
|
print_ln: scope:[print_ln] from main::@1 main::@3 main::@5
|
2019-05-30 20:29:04 +00:00
|
|
|
[17] (byte*) print_line_cursor#16 ← phi( main::@1/(byte*) 1024 main::@3/(byte*) print_line_cursor#1 main::@5/(byte*) print_line_cursor#1 )
|
2017-11-29 11:29:57 +00:00
|
|
|
to:print_ln::@1
|
|
|
|
print_ln::@1: scope:[print_ln] from print_ln print_ln::@1
|
2018-11-11 20:51:36 +00:00
|
|
|
[18] (byte*) print_line_cursor#8 ← phi( print_ln/(byte*) print_line_cursor#16 print_ln::@1/(byte*) print_line_cursor#1 )
|
2019-05-30 20:29:04 +00:00
|
|
|
[19] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28
|
2018-11-11 20:51:36 +00:00
|
|
|
[20] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#13) goto print_ln::@1
|
2017-11-29 11:29:57 +00:00
|
|
|
to:print_ln::@return
|
|
|
|
print_ln::@return: scope:[print_ln] from print_ln::@1
|
2018-11-11 20:51:36 +00:00
|
|
|
[21] return
|
2017-11-29 11:29:57 +00:00
|
|
|
to:@return
|
|
|
|
print_str: scope:[print_str] from main main::@2 main::@4
|
2019-05-30 20:29:04 +00:00
|
|
|
[22] (byte*) print_char_cursor#29 ← phi( main/(byte*) 1024 main::@2/(byte*~) print_char_cursor#31 main::@4/(byte*~) print_char_cursor#32 )
|
2018-11-11 20:51:36 +00:00
|
|
|
[22] (byte*) print_str::str#6 ← phi( main/(const byte[]) msg#0 main::@2/(const byte[]) msg2#0 main::@4/(const byte[]) msg3#0 )
|
2017-11-29 11:29:57 +00:00
|
|
|
to:print_str::@1
|
|
|
|
print_str::@1: scope:[print_str] from print_str print_str::@2
|
2018-11-11 20:51:36 +00:00
|
|
|
[23] (byte*) print_char_cursor#13 ← phi( print_str/(byte*) print_char_cursor#29 print_str::@2/(byte*) print_char_cursor#1 )
|
|
|
|
[23] (byte*) print_str::str#4 ← phi( print_str/(byte*) print_str::str#6 print_str::@2/(byte*) print_str::str#0 )
|
|
|
|
[24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2
|
2017-11-29 11:29:57 +00:00
|
|
|
to:print_str::@return
|
|
|
|
print_str::@return: scope:[print_str] from print_str::@1
|
2018-11-11 20:51:36 +00:00
|
|
|
[25] return
|
2017-11-29 11:29:57 +00:00
|
|
|
to:@return
|
|
|
|
print_str::@2: scope:[print_str] from print_str::@1
|
2018-11-11 20:51:36 +00:00
|
|
|
[26] *((byte*) print_char_cursor#13) ← *((byte*) print_str::str#4)
|
|
|
|
[27] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#13
|
|
|
|
[28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4
|
2017-11-29 11:29:57 +00:00
|
|
|
to:print_str::@1
|
|
|
|
|
|
|
|
|
|
|
|
VARIABLE REGISTER WEIGHTS
|
|
|
|
(void()) main()
|
|
|
|
(byte[]) msg
|
|
|
|
(byte[]) msg2
|
|
|
|
(byte[]) msg3
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor
|
|
|
|
(byte*) print_char_cursor#1 11.0
|
|
|
|
(byte*) print_char_cursor#13 3.2857142857142856
|
|
|
|
(byte*) print_char_cursor#29 6.0
|
2019-04-15 12:03:50 +00:00
|
|
|
(byte*~) print_char_cursor#31 4.0
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*~) print_char_cursor#32 4.0
|
|
|
|
(byte*) print_line_cursor
|
|
|
|
(byte*) print_line_cursor#1 3.7272727272727275
|
|
|
|
(byte*) print_line_cursor#16 6.0
|
|
|
|
(byte*) print_line_cursor#8 24.0
|
2017-11-29 11:29:57 +00:00
|
|
|
(void()) print_ln()
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_screen
|
2017-11-29 11:29:57 +00:00
|
|
|
(void()) print_str((byte*) print_str::str)
|
|
|
|
(byte*) print_str::str
|
2017-12-03 21:57:54 +00:00
|
|
|
(byte*) print_str::str#0 22.0
|
2017-11-29 11:29:57 +00:00
|
|
|
(byte*) print_str::str#4 11.5
|
|
|
|
(byte*) print_str::str#6 2.0
|
|
|
|
|
|
|
|
Initial phi equivalence classes
|
2018-03-25 21:40:38 +00:00
|
|
|
[ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ]
|
2017-12-03 21:57:54 +00:00
|
|
|
[ print_str::str#4 print_str::str#6 print_str::str#0 ]
|
2019-04-15 12:03:50 +00:00
|
|
|
[ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ]
|
2017-11-29 11:29:57 +00:00
|
|
|
Complete equivalence classes
|
2018-03-25 21:40:38 +00:00
|
|
|
[ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ]
|
2017-12-03 21:57:54 +00:00
|
|
|
[ print_str::str#4 print_str::str#6 print_str::str#0 ]
|
2019-04-15 12:03:50 +00:00
|
|
|
[ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ]
|
2018-03-25 21:40:38 +00:00
|
|
|
Allocated zp ZP_WORD:2 [ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ]
|
2017-12-12 23:29:47 +00:00
|
|
|
Allocated zp ZP_WORD:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ]
|
2019-04-15 12:03:50 +00:00
|
|
|
Allocated zp ZP_WORD:6 [ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ]
|
2017-12-29 10:21:11 +00:00
|
|
|
|
2017-11-29 11:29:57 +00:00
|
|
|
INITIAL ASM
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG0 File Comments
|
|
|
|
//SEG1 Basic Upstart
|
2017-11-29 11:29:57 +00:00
|
|
|
.pc = $801 "Basic"
|
2018-12-25 16:04:50 +00:00
|
|
|
:BasicUpstart(bbegin)
|
2017-11-29 11:29:57 +00:00
|
|
|
.pc = $80d "Program"
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG2 Global Constants & labels
|
2018-03-25 21:40:38 +00:00
|
|
|
.label print_char_cursor = 6
|
|
|
|
.label print_line_cursor = 2
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG3 @begin
|
2017-11-29 11:29:57 +00:00
|
|
|
bbegin:
|
2019-03-31 15:10:41 +00:00
|
|
|
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
|
|
|
|
b1_from_bbegin:
|
|
|
|
jmp b1
|
|
|
|
//SEG5 @1
|
|
|
|
b1:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG6 [2] call main
|
2019-03-31 15:10:41 +00:00
|
|
|
//SEG7 [4] phi from @1 to main [phi:@1->main]
|
|
|
|
main_from_b1:
|
2017-11-29 11:29:57 +00:00
|
|
|
jsr main
|
2019-03-31 15:10:41 +00:00
|
|
|
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
|
|
|
|
bend_from_b1:
|
2017-11-29 11:29:57 +00:00
|
|
|
jmp bend
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG9 @end
|
2017-11-29 11:29:57 +00:00
|
|
|
bend:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG10 main
|
2017-11-29 11:29:57 +00:00
|
|
|
main: {
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG11 [5] call print_str
|
|
|
|
//SEG12 [22] phi from main to print_str [phi:main->print_str]
|
2017-11-29 11:29:57 +00:00
|
|
|
print_str_from_main:
|
2019-05-30 20:29:04 +00:00
|
|
|
//SEG13 [22] phi (byte*) print_char_cursor#29 = (byte*) 1024 [phi:main->print_str#0] -- pbuz1=pbuc1
|
2018-03-25 21:40:38 +00:00
|
|
|
lda #<$400
|
|
|
|
sta print_char_cursor
|
|
|
|
lda #>$400
|
|
|
|
sta print_char_cursor+1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG14 [22] phi (byte*) print_str::str#6 = (const byte[]) msg#0 [phi:main->print_str#1] -- pbuz1=pbuc1
|
2017-11-29 11:29:57 +00:00
|
|
|
lda #<msg
|
|
|
|
sta print_str.str
|
|
|
|
lda #>msg
|
|
|
|
sta print_str.str+1
|
|
|
|
jsr print_str
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG15 [6] phi from main to main::@1 [phi:main->main::@1]
|
2017-11-29 11:29:57 +00:00
|
|
|
b1_from_main:
|
|
|
|
jmp b1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG16 main::@1
|
2017-11-29 11:29:57 +00:00
|
|
|
b1:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG17 [7] call print_ln
|
|
|
|
//SEG18 [17] phi from main::@1 to print_ln [phi:main::@1->print_ln]
|
2017-11-29 11:29:57 +00:00
|
|
|
print_ln_from_b1:
|
2019-05-30 20:29:04 +00:00
|
|
|
//SEG19 [17] phi (byte*) print_line_cursor#16 = (byte*) 1024 [phi:main::@1->print_ln#0] -- pbuz1=pbuc1
|
2018-03-25 21:40:38 +00:00
|
|
|
lda #<$400
|
|
|
|
sta print_line_cursor
|
|
|
|
lda #>$400
|
|
|
|
sta print_line_cursor+1
|
2017-11-29 11:29:57 +00:00
|
|
|
jsr print_ln
|
|
|
|
jmp b2
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG20 main::@2
|
2017-11-29 11:29:57 +00:00
|
|
|
b2:
|
2019-04-15 12:03:50 +00:00
|
|
|
//SEG21 [8] (byte*~) print_char_cursor#31 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2
|
2018-03-25 21:40:38 +00:00
|
|
|
lda print_line_cursor
|
|
|
|
sta print_char_cursor
|
|
|
|
lda print_line_cursor+1
|
|
|
|
sta print_char_cursor+1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG22 [9] call print_str
|
|
|
|
//SEG23 [22] phi from main::@2 to print_str [phi:main::@2->print_str]
|
2017-11-29 11:29:57 +00:00
|
|
|
print_str_from_b2:
|
2019-04-15 12:03:50 +00:00
|
|
|
//SEG24 [22] phi (byte*) print_char_cursor#29 = (byte*~) print_char_cursor#31 [phi:main::@2->print_str#0] -- register_copy
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG25 [22] phi (byte*) print_str::str#6 = (const byte[]) msg2#0 [phi:main::@2->print_str#1] -- pbuz1=pbuc1
|
2017-11-29 11:29:57 +00:00
|
|
|
lda #<msg2
|
|
|
|
sta print_str.str
|
|
|
|
lda #>msg2
|
|
|
|
sta print_str.str+1
|
|
|
|
jsr print_str
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG26 [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
|
2017-11-29 11:29:57 +00:00
|
|
|
b3_from_b2:
|
|
|
|
jmp b3
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG27 main::@3
|
2017-11-29 11:29:57 +00:00
|
|
|
b3:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG28 [11] call print_ln
|
|
|
|
//SEG29 [17] phi from main::@3 to print_ln [phi:main::@3->print_ln]
|
2017-11-29 11:29:57 +00:00
|
|
|
print_ln_from_b3:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG30 [17] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#1 [phi:main::@3->print_ln#0] -- register_copy
|
2017-11-29 11:29:57 +00:00
|
|
|
jsr print_ln
|
|
|
|
jmp b4
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG31 main::@4
|
2017-11-29 11:29:57 +00:00
|
|
|
b4:
|
2019-04-15 12:03:50 +00:00
|
|
|
//SEG32 [12] (byte*~) print_char_cursor#32 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2
|
2018-03-25 21:40:38 +00:00
|
|
|
lda print_line_cursor
|
|
|
|
sta print_char_cursor
|
|
|
|
lda print_line_cursor+1
|
|
|
|
sta print_char_cursor+1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG33 [13] call print_str
|
|
|
|
//SEG34 [22] phi from main::@4 to print_str [phi:main::@4->print_str]
|
2017-11-29 11:29:57 +00:00
|
|
|
print_str_from_b4:
|
2019-04-15 12:03:50 +00:00
|
|
|
//SEG35 [22] phi (byte*) print_char_cursor#29 = (byte*~) print_char_cursor#32 [phi:main::@4->print_str#0] -- register_copy
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG36 [22] phi (byte*) print_str::str#6 = (const byte[]) msg3#0 [phi:main::@4->print_str#1] -- pbuz1=pbuc1
|
2017-11-29 11:29:57 +00:00
|
|
|
lda #<msg3
|
|
|
|
sta print_str.str
|
|
|
|
lda #>msg3
|
|
|
|
sta print_str.str+1
|
|
|
|
jsr print_str
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG37 [14] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
|
2017-11-29 11:29:57 +00:00
|
|
|
b5_from_b4:
|
|
|
|
jmp b5
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG38 main::@5
|
2017-11-29 11:29:57 +00:00
|
|
|
b5:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG39 [15] call print_ln
|
|
|
|
//SEG40 [17] phi from main::@5 to print_ln [phi:main::@5->print_ln]
|
2017-11-29 11:29:57 +00:00
|
|
|
print_ln_from_b5:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG41 [17] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#1 [phi:main::@5->print_ln#0] -- register_copy
|
2017-11-29 11:29:57 +00:00
|
|
|
jsr print_ln
|
|
|
|
jmp breturn
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG42 main::@return
|
2017-11-29 11:29:57 +00:00
|
|
|
breturn:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG43 [16] return
|
2017-11-29 11:29:57 +00:00
|
|
|
rts
|
|
|
|
}
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG44 print_ln
|
2019-02-17 23:12:29 +00:00
|
|
|
// Print a newline
|
2017-11-29 11:29:57 +00:00
|
|
|
print_ln: {
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG45 [18] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1]
|
2017-11-29 11:29:57 +00:00
|
|
|
b1_from_print_ln:
|
|
|
|
b1_from_b1:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG46 [18] phi (byte*) print_line_cursor#8 = (byte*) print_line_cursor#16 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy
|
2017-11-29 11:29:57 +00:00
|
|
|
jmp b1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG47 print_ln::@1
|
2017-11-29 11:29:57 +00:00
|
|
|
b1:
|
2019-05-30 20:29:04 +00:00
|
|
|
//SEG48 [19] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
|
2019-03-18 01:23:29 +00:00
|
|
|
lda #$28
|
2017-11-29 11:29:57 +00:00
|
|
|
clc
|
2019-03-18 01:23:29 +00:00
|
|
|
adc print_line_cursor
|
2018-03-25 21:40:38 +00:00
|
|
|
sta print_line_cursor
|
2017-11-29 11:29:57 +00:00
|
|
|
bcc !+
|
2018-03-25 21:40:38 +00:00
|
|
|
inc print_line_cursor+1
|
2017-11-29 11:29:57 +00:00
|
|
|
!:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG49 [20] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#13) goto print_ln::@1 -- pbuz1_lt_pbuz2_then_la1
|
2018-03-25 21:40:38 +00:00
|
|
|
lda print_line_cursor+1
|
|
|
|
cmp print_char_cursor+1
|
2017-11-29 11:29:57 +00:00
|
|
|
bcc b1_from_b1
|
|
|
|
bne !+
|
2018-03-25 21:40:38 +00:00
|
|
|
lda print_line_cursor
|
|
|
|
cmp print_char_cursor
|
2017-11-29 11:29:57 +00:00
|
|
|
bcc b1_from_b1
|
|
|
|
!:
|
|
|
|
jmp breturn
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG50 print_ln::@return
|
2017-11-29 11:29:57 +00:00
|
|
|
breturn:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG51 [21] return
|
2017-11-29 11:29:57 +00:00
|
|
|
rts
|
|
|
|
}
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG52 print_str
|
2019-02-17 23:12:29 +00:00
|
|
|
// Print a zero-terminated string
|
2019-02-19 19:51:48 +00:00
|
|
|
// print_str(byte* zeropage(4) str)
|
2017-11-29 11:29:57 +00:00
|
|
|
print_str: {
|
|
|
|
.label str = 4
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG53 [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
|
2017-11-29 11:29:57 +00:00
|
|
|
b1_from_print_str:
|
|
|
|
b1_from_b2:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG54 [23] phi (byte*) print_char_cursor#13 = (byte*) print_char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy
|
|
|
|
//SEG55 [23] phi (byte*) print_str::str#4 = (byte*) print_str::str#6 [phi:print_str/print_str::@2->print_str::@1#1] -- register_copy
|
2017-11-29 11:29:57 +00:00
|
|
|
jmp b1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG56 print_str::@1
|
2017-11-29 11:29:57 +00:00
|
|
|
b1:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG57 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 -- _deref_pbuz1_neq_vbuc1_then_la1
|
2017-11-29 11:29:57 +00:00
|
|
|
ldy #0
|
|
|
|
lda (str),y
|
|
|
|
cmp #'@'
|
|
|
|
bne b2
|
|
|
|
jmp breturn
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG58 print_str::@return
|
2017-11-29 11:29:57 +00:00
|
|
|
breturn:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG59 [25] return
|
2017-11-29 11:29:57 +00:00
|
|
|
rts
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG60 print_str::@2
|
2017-11-29 11:29:57 +00:00
|
|
|
b2:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG61 [26] *((byte*) print_char_cursor#13) ← *((byte*) print_str::str#4) -- _deref_pbuz1=_deref_pbuz2
|
2017-11-29 11:29:57 +00:00
|
|
|
ldy #0
|
|
|
|
lda (str),y
|
|
|
|
ldy #0
|
2018-03-25 21:40:38 +00:00
|
|
|
sta (print_char_cursor),y
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG62 [27] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#13 -- pbuz1=_inc_pbuz1
|
2018-03-25 21:40:38 +00:00
|
|
|
inc print_char_cursor
|
2017-11-29 11:29:57 +00:00
|
|
|
bne !+
|
2018-03-25 21:40:38 +00:00
|
|
|
inc print_char_cursor+1
|
2017-11-29 11:29:57 +00:00
|
|
|
!:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG63 [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 -- pbuz1=_inc_pbuz1
|
2017-11-29 11:29:57 +00:00
|
|
|
inc str
|
|
|
|
bne !+
|
|
|
|
inc str+1
|
|
|
|
!:
|
|
|
|
jmp b1_from_b2
|
|
|
|
}
|
2017-12-29 17:20:11 +00:00
|
|
|
msg: .text "hello world! @"
|
|
|
|
msg2: .text "hello c64! @"
|
|
|
|
msg3: .text "hello 2017! @"
|
2017-11-29 11:29:57 +00:00
|
|
|
|
|
|
|
REGISTER UPLIFT POTENTIAL REGISTERS
|
2019-04-15 12:03:50 +00:00
|
|
|
Statement [8] (byte*~) print_char_cursor#31 ← (byte*) print_line_cursor#1 [ print_char_cursor#31 print_line_cursor#1 ] ( main:2 [ print_char_cursor#31 print_line_cursor#1 ] ) always clobbers reg byte a
|
|
|
|
Statement [12] (byte*~) print_char_cursor#32 ← (byte*) print_line_cursor#1 [ print_line_cursor#1 print_char_cursor#32 ] ( main:2 [ print_line_cursor#1 print_char_cursor#32 ] ) always clobbers reg byte a
|
2019-05-30 20:29:04 +00:00
|
|
|
Statement [19] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28 [ print_line_cursor#1 print_char_cursor#13 ] ( main:2::print_ln:7 [ print_line_cursor#1 print_char_cursor#13 ] main:2::print_ln:11 [ print_line_cursor#1 print_char_cursor#13 ] main:2::print_ln:15 [ print_line_cursor#1 print_char_cursor#13 ] ) always clobbers reg byte a
|
2018-03-25 21:40:38 +00:00
|
|
|
Statement [20] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#13) goto print_ln::@1 [ print_line_cursor#1 print_char_cursor#13 ] ( main:2::print_ln:7 [ print_line_cursor#1 print_char_cursor#13 ] main:2::print_ln:11 [ print_line_cursor#1 print_char_cursor#13 ] main:2::print_ln:15 [ print_line_cursor#1 print_char_cursor#13 ] ) always clobbers reg byte a
|
|
|
|
Statement [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 [ print_char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ print_char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_line_cursor#1 print_char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_line_cursor#1 print_char_cursor#13 print_str::str#4 ] ) always clobbers reg byte a reg byte y
|
|
|
|
Statement [26] *((byte*) print_char_cursor#13) ← *((byte*) print_str::str#4) [ print_char_cursor#13 print_str::str#4 ] ( main:2::print_str:5 [ print_char_cursor#13 print_str::str#4 ] main:2::print_str:9 [ print_line_cursor#1 print_char_cursor#13 print_str::str#4 ] main:2::print_str:13 [ print_line_cursor#1 print_char_cursor#13 print_str::str#4 ] ) always clobbers reg byte a reg byte y
|
|
|
|
Potential registers zp ZP_WORD:2 [ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ] : zp ZP_WORD:2 ,
|
2017-12-12 23:29:47 +00:00
|
|
|
Potential registers zp ZP_WORD:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ] : zp ZP_WORD:4 ,
|
2019-04-15 12:03:50 +00:00
|
|
|
Potential registers zp ZP_WORD:6 [ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ] : zp ZP_WORD:6 ,
|
2017-11-29 11:29:57 +00:00
|
|
|
|
|
|
|
REGISTER UPLIFT SCOPES
|
2019-04-15 12:03:50 +00:00
|
|
|
Uplift Scope [] 33.73: zp ZP_WORD:2 [ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ] 28.29: zp ZP_WORD:6 [ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ]
|
2017-12-12 23:29:47 +00:00
|
|
|
Uplift Scope [print_str] 35.5: zp ZP_WORD:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ]
|
2017-11-29 11:29:57 +00:00
|
|
|
Uplift Scope [print_ln]
|
2017-12-03 21:57:54 +00:00
|
|
|
Uplift Scope [main]
|
2017-11-29 11:29:57 +00:00
|
|
|
|
2019-04-15 12:03:50 +00:00
|
|
|
Uplifting [] best 1203 combination zp ZP_WORD:2 [ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ] zp ZP_WORD:6 [ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ]
|
2017-12-30 13:18:57 +00:00
|
|
|
Uplifting [print_str] best 1203 combination zp ZP_WORD:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ]
|
|
|
|
Uplifting [print_ln] best 1203 combination
|
|
|
|
Uplifting [main] best 1203 combination
|
2017-12-26 08:15:10 +00:00
|
|
|
|
|
|
|
ASSEMBLER BEFORE OPTIMIZATION
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG0 File Comments
|
|
|
|
//SEG1 Basic Upstart
|
2017-11-29 11:29:57 +00:00
|
|
|
.pc = $801 "Basic"
|
2018-12-25 16:04:50 +00:00
|
|
|
:BasicUpstart(bbegin)
|
2017-11-29 11:29:57 +00:00
|
|
|
.pc = $80d "Program"
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG2 Global Constants & labels
|
2018-03-25 21:40:38 +00:00
|
|
|
.label print_char_cursor = 6
|
|
|
|
.label print_line_cursor = 2
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG3 @begin
|
2017-11-29 11:29:57 +00:00
|
|
|
bbegin:
|
2019-03-31 15:10:41 +00:00
|
|
|
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
|
|
|
|
b1_from_bbegin:
|
|
|
|
jmp b1
|
|
|
|
//SEG5 @1
|
|
|
|
b1:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG6 [2] call main
|
2019-03-31 15:10:41 +00:00
|
|
|
//SEG7 [4] phi from @1 to main [phi:@1->main]
|
|
|
|
main_from_b1:
|
2017-11-29 11:29:57 +00:00
|
|
|
jsr main
|
2019-03-31 15:10:41 +00:00
|
|
|
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
|
|
|
|
bend_from_b1:
|
2017-12-26 08:15:10 +00:00
|
|
|
jmp bend
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG9 @end
|
2017-11-29 11:29:57 +00:00
|
|
|
bend:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG10 main
|
2017-11-29 11:29:57 +00:00
|
|
|
main: {
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG11 [5] call print_str
|
|
|
|
//SEG12 [22] phi from main to print_str [phi:main->print_str]
|
2017-11-29 11:29:57 +00:00
|
|
|
print_str_from_main:
|
2019-05-30 20:29:04 +00:00
|
|
|
//SEG13 [22] phi (byte*) print_char_cursor#29 = (byte*) 1024 [phi:main->print_str#0] -- pbuz1=pbuc1
|
2018-03-25 21:40:38 +00:00
|
|
|
lda #<$400
|
|
|
|
sta print_char_cursor
|
|
|
|
lda #>$400
|
|
|
|
sta print_char_cursor+1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG14 [22] phi (byte*) print_str::str#6 = (const byte[]) msg#0 [phi:main->print_str#1] -- pbuz1=pbuc1
|
2017-11-29 11:29:57 +00:00
|
|
|
lda #<msg
|
|
|
|
sta print_str.str
|
|
|
|
lda #>msg
|
|
|
|
sta print_str.str+1
|
|
|
|
jsr print_str
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG15 [6] phi from main to main::@1 [phi:main->main::@1]
|
2017-11-29 11:29:57 +00:00
|
|
|
b1_from_main:
|
2017-12-26 08:15:10 +00:00
|
|
|
jmp b1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG16 main::@1
|
2017-11-29 11:29:57 +00:00
|
|
|
b1:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG17 [7] call print_ln
|
|
|
|
//SEG18 [17] phi from main::@1 to print_ln [phi:main::@1->print_ln]
|
2017-11-29 11:29:57 +00:00
|
|
|
print_ln_from_b1:
|
2019-05-30 20:29:04 +00:00
|
|
|
//SEG19 [17] phi (byte*) print_line_cursor#16 = (byte*) 1024 [phi:main::@1->print_ln#0] -- pbuz1=pbuc1
|
2018-03-25 21:40:38 +00:00
|
|
|
lda #<$400
|
|
|
|
sta print_line_cursor
|
|
|
|
lda #>$400
|
|
|
|
sta print_line_cursor+1
|
2017-11-29 11:29:57 +00:00
|
|
|
jsr print_ln
|
2017-12-26 08:15:10 +00:00
|
|
|
jmp b2
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG20 main::@2
|
2017-11-29 11:29:57 +00:00
|
|
|
b2:
|
2019-04-15 12:03:50 +00:00
|
|
|
//SEG21 [8] (byte*~) print_char_cursor#31 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2
|
2018-03-25 21:40:38 +00:00
|
|
|
lda print_line_cursor
|
|
|
|
sta print_char_cursor
|
|
|
|
lda print_line_cursor+1
|
|
|
|
sta print_char_cursor+1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG22 [9] call print_str
|
|
|
|
//SEG23 [22] phi from main::@2 to print_str [phi:main::@2->print_str]
|
2017-11-29 11:29:57 +00:00
|
|
|
print_str_from_b2:
|
2019-04-15 12:03:50 +00:00
|
|
|
//SEG24 [22] phi (byte*) print_char_cursor#29 = (byte*~) print_char_cursor#31 [phi:main::@2->print_str#0] -- register_copy
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG25 [22] phi (byte*) print_str::str#6 = (const byte[]) msg2#0 [phi:main::@2->print_str#1] -- pbuz1=pbuc1
|
2017-11-29 11:29:57 +00:00
|
|
|
lda #<msg2
|
|
|
|
sta print_str.str
|
|
|
|
lda #>msg2
|
|
|
|
sta print_str.str+1
|
|
|
|
jsr print_str
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG26 [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
|
2017-11-29 11:29:57 +00:00
|
|
|
b3_from_b2:
|
2017-12-26 08:15:10 +00:00
|
|
|
jmp b3
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG27 main::@3
|
2017-11-29 11:29:57 +00:00
|
|
|
b3:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG28 [11] call print_ln
|
|
|
|
//SEG29 [17] phi from main::@3 to print_ln [phi:main::@3->print_ln]
|
2017-11-29 11:29:57 +00:00
|
|
|
print_ln_from_b3:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG30 [17] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#1 [phi:main::@3->print_ln#0] -- register_copy
|
2017-11-29 11:29:57 +00:00
|
|
|
jsr print_ln
|
2017-12-26 08:15:10 +00:00
|
|
|
jmp b4
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG31 main::@4
|
2017-11-29 11:29:57 +00:00
|
|
|
b4:
|
2019-04-15 12:03:50 +00:00
|
|
|
//SEG32 [12] (byte*~) print_char_cursor#32 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2
|
2018-03-25 21:40:38 +00:00
|
|
|
lda print_line_cursor
|
|
|
|
sta print_char_cursor
|
|
|
|
lda print_line_cursor+1
|
|
|
|
sta print_char_cursor+1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG33 [13] call print_str
|
|
|
|
//SEG34 [22] phi from main::@4 to print_str [phi:main::@4->print_str]
|
2017-11-29 11:29:57 +00:00
|
|
|
print_str_from_b4:
|
2019-04-15 12:03:50 +00:00
|
|
|
//SEG35 [22] phi (byte*) print_char_cursor#29 = (byte*~) print_char_cursor#32 [phi:main::@4->print_str#0] -- register_copy
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG36 [22] phi (byte*) print_str::str#6 = (const byte[]) msg3#0 [phi:main::@4->print_str#1] -- pbuz1=pbuc1
|
2017-11-29 11:29:57 +00:00
|
|
|
lda #<msg3
|
|
|
|
sta print_str.str
|
|
|
|
lda #>msg3
|
|
|
|
sta print_str.str+1
|
|
|
|
jsr print_str
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG37 [14] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
|
2017-11-29 11:29:57 +00:00
|
|
|
b5_from_b4:
|
2017-12-26 08:15:10 +00:00
|
|
|
jmp b5
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG38 main::@5
|
2017-11-29 11:29:57 +00:00
|
|
|
b5:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG39 [15] call print_ln
|
|
|
|
//SEG40 [17] phi from main::@5 to print_ln [phi:main::@5->print_ln]
|
2017-11-29 11:29:57 +00:00
|
|
|
print_ln_from_b5:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG41 [17] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#1 [phi:main::@5->print_ln#0] -- register_copy
|
2017-11-29 11:29:57 +00:00
|
|
|
jsr print_ln
|
2017-12-26 08:15:10 +00:00
|
|
|
jmp breturn
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG42 main::@return
|
2017-11-29 11:29:57 +00:00
|
|
|
breturn:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG43 [16] return
|
2017-11-29 11:29:57 +00:00
|
|
|
rts
|
|
|
|
}
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG44 print_ln
|
2019-02-17 23:12:29 +00:00
|
|
|
// Print a newline
|
2017-11-29 11:29:57 +00:00
|
|
|
print_ln: {
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG45 [18] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1]
|
2017-11-29 11:29:57 +00:00
|
|
|
b1_from_print_ln:
|
|
|
|
b1_from_b1:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG46 [18] phi (byte*) print_line_cursor#8 = (byte*) print_line_cursor#16 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy
|
2017-12-26 08:15:10 +00:00
|
|
|
jmp b1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG47 print_ln::@1
|
2017-11-29 11:29:57 +00:00
|
|
|
b1:
|
2019-05-30 20:29:04 +00:00
|
|
|
//SEG48 [19] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
|
2019-03-18 01:23:29 +00:00
|
|
|
lda #$28
|
2017-11-29 11:29:57 +00:00
|
|
|
clc
|
2019-03-18 01:23:29 +00:00
|
|
|
adc print_line_cursor
|
2018-03-25 21:40:38 +00:00
|
|
|
sta print_line_cursor
|
2017-11-29 11:29:57 +00:00
|
|
|
bcc !+
|
2018-03-25 21:40:38 +00:00
|
|
|
inc print_line_cursor+1
|
2017-11-29 11:29:57 +00:00
|
|
|
!:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG49 [20] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#13) goto print_ln::@1 -- pbuz1_lt_pbuz2_then_la1
|
2018-03-25 21:40:38 +00:00
|
|
|
lda print_line_cursor+1
|
|
|
|
cmp print_char_cursor+1
|
2017-11-29 11:29:57 +00:00
|
|
|
bcc b1_from_b1
|
|
|
|
bne !+
|
2018-03-25 21:40:38 +00:00
|
|
|
lda print_line_cursor
|
|
|
|
cmp print_char_cursor
|
2017-11-29 11:29:57 +00:00
|
|
|
bcc b1_from_b1
|
|
|
|
!:
|
2017-12-26 08:15:10 +00:00
|
|
|
jmp breturn
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG50 print_ln::@return
|
2017-11-29 11:29:57 +00:00
|
|
|
breturn:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG51 [21] return
|
2017-11-29 11:29:57 +00:00
|
|
|
rts
|
|
|
|
}
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG52 print_str
|
2019-02-17 23:12:29 +00:00
|
|
|
// Print a zero-terminated string
|
2019-02-19 19:51:48 +00:00
|
|
|
// print_str(byte* zeropage(4) str)
|
2017-11-29 11:29:57 +00:00
|
|
|
print_str: {
|
|
|
|
.label str = 4
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG53 [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
|
2017-11-29 11:29:57 +00:00
|
|
|
b1_from_print_str:
|
|
|
|
b1_from_b2:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG54 [23] phi (byte*) print_char_cursor#13 = (byte*) print_char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy
|
|
|
|
//SEG55 [23] phi (byte*) print_str::str#4 = (byte*) print_str::str#6 [phi:print_str/print_str::@2->print_str::@1#1] -- register_copy
|
2017-12-26 08:15:10 +00:00
|
|
|
jmp b1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG56 print_str::@1
|
2017-11-29 11:29:57 +00:00
|
|
|
b1:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG57 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 -- _deref_pbuz1_neq_vbuc1_then_la1
|
2017-11-29 11:29:57 +00:00
|
|
|
ldy #0
|
|
|
|
lda (str),y
|
|
|
|
cmp #'@'
|
|
|
|
bne b2
|
2017-12-26 08:15:10 +00:00
|
|
|
jmp breturn
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG58 print_str::@return
|
2017-11-29 11:29:57 +00:00
|
|
|
breturn:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG59 [25] return
|
2017-11-29 11:29:57 +00:00
|
|
|
rts
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG60 print_str::@2
|
2017-11-29 11:29:57 +00:00
|
|
|
b2:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG61 [26] *((byte*) print_char_cursor#13) ← *((byte*) print_str::str#4) -- _deref_pbuz1=_deref_pbuz2
|
2017-11-29 11:29:57 +00:00
|
|
|
ldy #0
|
|
|
|
lda (str),y
|
|
|
|
ldy #0
|
2018-03-25 21:40:38 +00:00
|
|
|
sta (print_char_cursor),y
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG62 [27] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#13 -- pbuz1=_inc_pbuz1
|
2018-03-25 21:40:38 +00:00
|
|
|
inc print_char_cursor
|
2017-11-29 11:29:57 +00:00
|
|
|
bne !+
|
2018-03-25 21:40:38 +00:00
|
|
|
inc print_char_cursor+1
|
2017-11-29 11:29:57 +00:00
|
|
|
!:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG63 [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 -- pbuz1=_inc_pbuz1
|
2017-11-29 11:29:57 +00:00
|
|
|
inc str
|
|
|
|
bne !+
|
|
|
|
inc str+1
|
|
|
|
!:
|
|
|
|
jmp b1_from_b2
|
|
|
|
}
|
2017-12-29 17:20:11 +00:00
|
|
|
msg: .text "hello world! @"
|
|
|
|
msg2: .text "hello c64! @"
|
|
|
|
msg3: .text "hello 2017! @"
|
2017-11-29 11:29:57 +00:00
|
|
|
|
2017-12-26 08:15:10 +00:00
|
|
|
ASSEMBLER OPTIMIZATIONS
|
2019-03-31 15:10:41 +00:00
|
|
|
Removing instruction jmp b1
|
2017-12-26 08:15:10 +00:00
|
|
|
Removing instruction jmp bend
|
|
|
|
Removing instruction jmp b1
|
|
|
|
Removing instruction jmp b2
|
|
|
|
Removing instruction jmp b3
|
|
|
|
Removing instruction jmp b4
|
|
|
|
Removing instruction jmp b5
|
|
|
|
Removing instruction jmp breturn
|
|
|
|
Removing instruction jmp b1
|
|
|
|
Removing instruction jmp breturn
|
|
|
|
Removing instruction jmp b1
|
|
|
|
Removing instruction jmp breturn
|
|
|
|
Succesful ASM optimization Pass5NextJumpElimination
|
2017-11-29 11:29:57 +00:00
|
|
|
Removing instruction ldy #0
|
|
|
|
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
|
|
|
Replacing label b1_from_b1 with b1
|
|
|
|
Replacing label b1_from_b1 with b1
|
|
|
|
Replacing label b1_from_b2 with b1
|
2019-03-31 15:10:41 +00:00
|
|
|
Removing instruction b1_from_bbegin:
|
|
|
|
Removing instruction b1:
|
|
|
|
Removing instruction main_from_b1:
|
|
|
|
Removing instruction bend_from_b1:
|
2017-11-29 11:29:57 +00:00
|
|
|
Removing instruction b1_from_main:
|
|
|
|
Removing instruction print_ln_from_b1:
|
|
|
|
Removing instruction b3_from_b2:
|
|
|
|
Removing instruction print_ln_from_b3:
|
|
|
|
Removing instruction b5_from_b4:
|
|
|
|
Removing instruction print_ln_from_b5:
|
|
|
|
Removing instruction b1_from_print_ln:
|
|
|
|
Removing instruction b1_from_b1:
|
|
|
|
Removing instruction b1_from_print_str:
|
|
|
|
Removing instruction b1_from_b2:
|
|
|
|
Succesful ASM optimization Pass5RedundantLabelElimination
|
|
|
|
Removing instruction bend:
|
|
|
|
Removing instruction print_str_from_main:
|
|
|
|
Removing instruction b1:
|
|
|
|
Removing instruction b2:
|
|
|
|
Removing instruction print_str_from_b2:
|
|
|
|
Removing instruction b3:
|
|
|
|
Removing instruction b4:
|
|
|
|
Removing instruction print_str_from_b4:
|
|
|
|
Removing instruction b5:
|
|
|
|
Removing instruction breturn:
|
|
|
|
Removing instruction breturn:
|
|
|
|
Removing instruction breturn:
|
|
|
|
Succesful ASM optimization Pass5UnusedLabelElimination
|
2018-12-25 16:04:50 +00:00
|
|
|
Updating BasicUpstart to call main directly
|
|
|
|
Removing instruction jsr main
|
|
|
|
Succesful ASM optimization Pass5SkipBegin
|
|
|
|
Removing instruction bbegin:
|
|
|
|
Succesful ASM optimization Pass5UnusedLabelElimination
|
2017-11-29 11:29:57 +00:00
|
|
|
|
|
|
|
FINAL SYMBOL TABLE
|
2019-03-31 15:10:41 +00:00
|
|
|
(label) @1
|
2017-11-29 11:29:57 +00:00
|
|
|
(label) @begin
|
|
|
|
(label) @end
|
|
|
|
(void()) main()
|
|
|
|
(label) main::@1
|
|
|
|
(label) main::@2
|
|
|
|
(label) main::@3
|
|
|
|
(label) main::@4
|
|
|
|
(label) main::@5
|
|
|
|
(label) main::@return
|
|
|
|
(byte[]) msg
|
2018-07-21 09:13:32 +00:00
|
|
|
(const byte[]) msg#0 msg = (string) "hello world! @"
|
2017-11-29 11:29:57 +00:00
|
|
|
(byte[]) msg2
|
2018-07-21 09:13:32 +00:00
|
|
|
(const byte[]) msg2#0 msg2 = (string) "hello c64! @"
|
2017-11-29 11:29:57 +00:00
|
|
|
(byte[]) msg3
|
2018-07-21 09:13:32 +00:00
|
|
|
(const byte[]) msg3#0 msg3 = (string) "hello 2017! @"
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_char_cursor
|
|
|
|
(byte*) print_char_cursor#1 print_char_cursor zp ZP_WORD:6 11.0
|
|
|
|
(byte*) print_char_cursor#13 print_char_cursor zp ZP_WORD:6 3.2857142857142856
|
|
|
|
(byte*) print_char_cursor#29 print_char_cursor zp ZP_WORD:6 6.0
|
2019-04-15 12:03:50 +00:00
|
|
|
(byte*~) print_char_cursor#31 print_char_cursor zp ZP_WORD:6 4.0
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*~) print_char_cursor#32 print_char_cursor zp ZP_WORD:6 4.0
|
|
|
|
(byte*) print_line_cursor
|
|
|
|
(byte*) print_line_cursor#1 print_line_cursor zp ZP_WORD:2 3.7272727272727275
|
|
|
|
(byte*) print_line_cursor#16 print_line_cursor zp ZP_WORD:2 6.0
|
|
|
|
(byte*) print_line_cursor#8 print_line_cursor zp ZP_WORD:2 24.0
|
2017-11-29 11:29:57 +00:00
|
|
|
(void()) print_ln()
|
|
|
|
(label) print_ln::@1
|
|
|
|
(label) print_ln::@return
|
2018-03-25 21:40:38 +00:00
|
|
|
(byte*) print_screen
|
2017-11-29 11:29:57 +00:00
|
|
|
(void()) print_str((byte*) print_str::str)
|
|
|
|
(label) print_str::@1
|
|
|
|
(label) print_str::@2
|
|
|
|
(label) print_str::@return
|
|
|
|
(byte*) print_str::str
|
2017-12-12 23:29:47 +00:00
|
|
|
(byte*) print_str::str#0 str zp ZP_WORD:4 22.0
|
|
|
|
(byte*) print_str::str#4 str zp ZP_WORD:4 11.5
|
|
|
|
(byte*) print_str::str#6 str zp ZP_WORD:4 2.0
|
2017-11-29 11:29:57 +00:00
|
|
|
|
2018-03-25 21:40:38 +00:00
|
|
|
zp ZP_WORD:2 [ print_line_cursor#8 print_line_cursor#16 print_line_cursor#1 ]
|
2017-12-12 23:29:47 +00:00
|
|
|
zp ZP_WORD:4 [ print_str::str#4 print_str::str#6 print_str::str#0 ]
|
2019-04-15 12:03:50 +00:00
|
|
|
zp ZP_WORD:6 [ print_char_cursor#13 print_char_cursor#29 print_char_cursor#31 print_char_cursor#32 print_char_cursor#1 ]
|
2017-11-29 11:29:57 +00:00
|
|
|
|
2017-12-29 10:21:11 +00:00
|
|
|
|
|
|
|
FINAL ASSEMBLER
|
2018-12-25 16:04:50 +00:00
|
|
|
Score: 1033
|
2017-12-30 12:45:59 +00:00
|
|
|
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG0 File Comments
|
|
|
|
//SEG1 Basic Upstart
|
2017-11-29 11:29:57 +00:00
|
|
|
.pc = $801 "Basic"
|
|
|
|
:BasicUpstart(main)
|
|
|
|
.pc = $80d "Program"
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG2 Global Constants & labels
|
2018-03-25 21:40:38 +00:00
|
|
|
.label print_char_cursor = 6
|
|
|
|
.label print_line_cursor = 2
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG3 @begin
|
2019-03-31 15:10:41 +00:00
|
|
|
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
|
|
|
|
//SEG5 @1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG6 [2] call main
|
2019-03-31 15:10:41 +00:00
|
|
|
//SEG7 [4] phi from @1 to main [phi:@1->main]
|
|
|
|
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG9 @end
|
|
|
|
//SEG10 main
|
2017-11-29 11:29:57 +00:00
|
|
|
main: {
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG11 [5] call print_str
|
|
|
|
//SEG12 [22] phi from main to print_str [phi:main->print_str]
|
2019-05-30 20:29:04 +00:00
|
|
|
//SEG13 [22] phi (byte*) print_char_cursor#29 = (byte*) 1024 [phi:main->print_str#0] -- pbuz1=pbuc1
|
2018-03-25 21:40:38 +00:00
|
|
|
lda #<$400
|
|
|
|
sta print_char_cursor
|
|
|
|
lda #>$400
|
|
|
|
sta print_char_cursor+1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG14 [22] phi (byte*) print_str::str#6 = (const byte[]) msg#0 [phi:main->print_str#1] -- pbuz1=pbuc1
|
2017-11-29 11:29:57 +00:00
|
|
|
lda #<msg
|
|
|
|
sta print_str.str
|
|
|
|
lda #>msg
|
|
|
|
sta print_str.str+1
|
|
|
|
jsr print_str
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG15 [6] phi from main to main::@1 [phi:main->main::@1]
|
|
|
|
//SEG16 main::@1
|
|
|
|
//SEG17 [7] call print_ln
|
|
|
|
//SEG18 [17] phi from main::@1 to print_ln [phi:main::@1->print_ln]
|
2019-05-30 20:29:04 +00:00
|
|
|
//SEG19 [17] phi (byte*) print_line_cursor#16 = (byte*) 1024 [phi:main::@1->print_ln#0] -- pbuz1=pbuc1
|
2018-03-25 21:40:38 +00:00
|
|
|
lda #<$400
|
|
|
|
sta print_line_cursor
|
|
|
|
lda #>$400
|
|
|
|
sta print_line_cursor+1
|
2017-11-29 11:29:57 +00:00
|
|
|
jsr print_ln
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG20 main::@2
|
2019-04-15 12:03:50 +00:00
|
|
|
//SEG21 [8] (byte*~) print_char_cursor#31 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2
|
2018-03-25 21:40:38 +00:00
|
|
|
lda print_line_cursor
|
|
|
|
sta print_char_cursor
|
|
|
|
lda print_line_cursor+1
|
|
|
|
sta print_char_cursor+1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG22 [9] call print_str
|
|
|
|
//SEG23 [22] phi from main::@2 to print_str [phi:main::@2->print_str]
|
2019-04-15 12:03:50 +00:00
|
|
|
//SEG24 [22] phi (byte*) print_char_cursor#29 = (byte*~) print_char_cursor#31 [phi:main::@2->print_str#0] -- register_copy
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG25 [22] phi (byte*) print_str::str#6 = (const byte[]) msg2#0 [phi:main::@2->print_str#1] -- pbuz1=pbuc1
|
2017-11-29 11:29:57 +00:00
|
|
|
lda #<msg2
|
|
|
|
sta print_str.str
|
|
|
|
lda #>msg2
|
|
|
|
sta print_str.str+1
|
|
|
|
jsr print_str
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG26 [10] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
|
|
|
|
//SEG27 main::@3
|
|
|
|
//SEG28 [11] call print_ln
|
|
|
|
//SEG29 [17] phi from main::@3 to print_ln [phi:main::@3->print_ln]
|
|
|
|
//SEG30 [17] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#1 [phi:main::@3->print_ln#0] -- register_copy
|
2017-11-29 11:29:57 +00:00
|
|
|
jsr print_ln
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG31 main::@4
|
2019-04-15 12:03:50 +00:00
|
|
|
//SEG32 [12] (byte*~) print_char_cursor#32 ← (byte*) print_line_cursor#1 -- pbuz1=pbuz2
|
2018-03-25 21:40:38 +00:00
|
|
|
lda print_line_cursor
|
|
|
|
sta print_char_cursor
|
|
|
|
lda print_line_cursor+1
|
|
|
|
sta print_char_cursor+1
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG33 [13] call print_str
|
|
|
|
//SEG34 [22] phi from main::@4 to print_str [phi:main::@4->print_str]
|
2019-04-15 12:03:50 +00:00
|
|
|
//SEG35 [22] phi (byte*) print_char_cursor#29 = (byte*~) print_char_cursor#32 [phi:main::@4->print_str#0] -- register_copy
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG36 [22] phi (byte*) print_str::str#6 = (const byte[]) msg3#0 [phi:main::@4->print_str#1] -- pbuz1=pbuc1
|
2017-11-29 11:29:57 +00:00
|
|
|
lda #<msg3
|
|
|
|
sta print_str.str
|
|
|
|
lda #>msg3
|
|
|
|
sta print_str.str+1
|
|
|
|
jsr print_str
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG37 [14] phi from main::@4 to main::@5 [phi:main::@4->main::@5]
|
|
|
|
//SEG38 main::@5
|
|
|
|
//SEG39 [15] call print_ln
|
|
|
|
//SEG40 [17] phi from main::@5 to print_ln [phi:main::@5->print_ln]
|
|
|
|
//SEG41 [17] phi (byte*) print_line_cursor#16 = (byte*) print_line_cursor#1 [phi:main::@5->print_ln#0] -- register_copy
|
2017-11-29 11:29:57 +00:00
|
|
|
jsr print_ln
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG42 main::@return
|
|
|
|
//SEG43 [16] return
|
2017-11-29 11:29:57 +00:00
|
|
|
rts
|
|
|
|
}
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG44 print_ln
|
2019-02-17 23:12:29 +00:00
|
|
|
// Print a newline
|
2017-11-29 11:29:57 +00:00
|
|
|
print_ln: {
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG45 [18] phi from print_ln print_ln::@1 to print_ln::@1 [phi:print_ln/print_ln::@1->print_ln::@1]
|
|
|
|
//SEG46 [18] phi (byte*) print_line_cursor#8 = (byte*) print_line_cursor#16 [phi:print_ln/print_ln::@1->print_ln::@1#0] -- register_copy
|
|
|
|
//SEG47 print_ln::@1
|
2017-11-29 11:29:57 +00:00
|
|
|
b1:
|
2019-05-30 20:29:04 +00:00
|
|
|
//SEG48 [19] (byte*) print_line_cursor#1 ← (byte*) print_line_cursor#8 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
|
2019-03-18 01:23:29 +00:00
|
|
|
lda #$28
|
2017-11-29 11:29:57 +00:00
|
|
|
clc
|
2019-03-18 01:23:29 +00:00
|
|
|
adc print_line_cursor
|
2018-03-25 21:40:38 +00:00
|
|
|
sta print_line_cursor
|
2017-11-29 11:29:57 +00:00
|
|
|
bcc !+
|
2018-03-25 21:40:38 +00:00
|
|
|
inc print_line_cursor+1
|
2017-11-29 11:29:57 +00:00
|
|
|
!:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG49 [20] if((byte*) print_line_cursor#1<(byte*) print_char_cursor#13) goto print_ln::@1 -- pbuz1_lt_pbuz2_then_la1
|
2018-03-25 21:40:38 +00:00
|
|
|
lda print_line_cursor+1
|
|
|
|
cmp print_char_cursor+1
|
2017-11-29 11:29:57 +00:00
|
|
|
bcc b1
|
|
|
|
bne !+
|
2018-03-25 21:40:38 +00:00
|
|
|
lda print_line_cursor
|
|
|
|
cmp print_char_cursor
|
2017-11-29 11:29:57 +00:00
|
|
|
bcc b1
|
|
|
|
!:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG50 print_ln::@return
|
|
|
|
//SEG51 [21] return
|
2017-11-29 11:29:57 +00:00
|
|
|
rts
|
|
|
|
}
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG52 print_str
|
2019-02-17 23:12:29 +00:00
|
|
|
// Print a zero-terminated string
|
2019-02-19 19:51:48 +00:00
|
|
|
// print_str(byte* zeropage(4) str)
|
2017-11-29 11:29:57 +00:00
|
|
|
print_str: {
|
|
|
|
.label str = 4
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG53 [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
|
|
|
|
//SEG54 [23] phi (byte*) print_char_cursor#13 = (byte*) print_char_cursor#29 [phi:print_str/print_str::@2->print_str::@1#0] -- register_copy
|
|
|
|
//SEG55 [23] phi (byte*) print_str::str#4 = (byte*) print_str::str#6 [phi:print_str/print_str::@2->print_str::@1#1] -- register_copy
|
|
|
|
//SEG56 print_str::@1
|
2017-11-29 11:29:57 +00:00
|
|
|
b1:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG57 [24] if(*((byte*) print_str::str#4)!=(byte) '@') goto print_str::@2 -- _deref_pbuz1_neq_vbuc1_then_la1
|
2017-11-29 11:29:57 +00:00
|
|
|
ldy #0
|
|
|
|
lda (str),y
|
|
|
|
cmp #'@'
|
|
|
|
bne b2
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG58 print_str::@return
|
|
|
|
//SEG59 [25] return
|
2017-11-29 11:29:57 +00:00
|
|
|
rts
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG60 print_str::@2
|
2017-11-29 11:29:57 +00:00
|
|
|
b2:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG61 [26] *((byte*) print_char_cursor#13) ← *((byte*) print_str::str#4) -- _deref_pbuz1=_deref_pbuz2
|
2017-11-29 11:29:57 +00:00
|
|
|
ldy #0
|
|
|
|
lda (str),y
|
2018-03-25 21:40:38 +00:00
|
|
|
sta (print_char_cursor),y
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG62 [27] (byte*) print_char_cursor#1 ← ++ (byte*) print_char_cursor#13 -- pbuz1=_inc_pbuz1
|
2018-03-25 21:40:38 +00:00
|
|
|
inc print_char_cursor
|
2017-11-29 11:29:57 +00:00
|
|
|
bne !+
|
2018-03-25 21:40:38 +00:00
|
|
|
inc print_char_cursor+1
|
2017-11-29 11:29:57 +00:00
|
|
|
!:
|
2019-02-17 10:03:55 +00:00
|
|
|
//SEG63 [28] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#4 -- pbuz1=_inc_pbuz1
|
2017-11-29 11:29:57 +00:00
|
|
|
inc str
|
|
|
|
bne !+
|
|
|
|
inc str+1
|
|
|
|
!:
|
|
|
|
jmp b1
|
|
|
|
}
|
2017-12-29 17:20:11 +00:00
|
|
|
msg: .text "hello world! @"
|
|
|
|
msg2: .text "hello c64! @"
|
|
|
|
msg3: .text "hello 2017! @"
|
2017-11-29 11:29:57 +00:00
|
|
|
|