2019-11-03 23:39:09 +00:00
|
|
|
Identified constant variable (byte*) SCREEN
|
2019-08-07 09:27:55 +00:00
|
|
|
Culled Empty Block (label) main::@4
|
|
|
|
Culled Empty Block (label) main::@3
|
|
|
|
Culled Empty Block (label) main::@5
|
|
|
|
Culled Empty Block (label) main::@6
|
2017-08-17 22:28:39 +00:00
|
|
|
|
2018-08-22 22:24:32 +00:00
|
|
|
CONTROL FLOW GRAPH SSA
|
2017-08-17 22:28:39 +00:00
|
|
|
@begin: scope:[] from
|
|
|
|
to:@1
|
2019-09-18 21:00:30 +00:00
|
|
|
|
|
|
|
(void()) main()
|
2017-08-17 22:28:39 +00:00
|
|
|
main: scope:[main] from @1
|
2020-01-01 17:27:53 +00:00
|
|
|
(byte) main::i#0 ← (byte) 0
|
2017-08-17 22:28:39 +00:00
|
|
|
to:main::@1
|
2019-08-07 09:27:55 +00:00
|
|
|
main::@1: scope:[main] from main main::@2
|
|
|
|
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#1 )
|
|
|
|
(bool~) main::$0 ← (byte) main::i#2 != (number) $64
|
|
|
|
if((bool~) main::$0) goto main::@2
|
2017-08-17 22:28:39 +00:00
|
|
|
to:main::@return
|
2019-08-07 09:27:55 +00:00
|
|
|
main::@2: scope:[main] from main::@1
|
|
|
|
(byte) main::i#3 ← phi( main::@1/(byte) main::i#2 )
|
2019-11-03 23:39:09 +00:00
|
|
|
*((const byte*) SCREEN + (byte) main::i#3) ← (byte) main::i#3
|
2019-08-07 09:27:55 +00:00
|
|
|
(byte) main::i#1 ← ++ (byte) main::i#3
|
|
|
|
to:main::@1
|
2017-08-17 22:28:39 +00:00
|
|
|
main::@return: scope:[main] from main::@1
|
|
|
|
return
|
|
|
|
to:@return
|
|
|
|
@1: scope:[] from @begin
|
2018-05-01 20:50:59 +00:00
|
|
|
call main
|
2017-08-17 22:28:39 +00:00
|
|
|
to:@2
|
|
|
|
@2: scope:[] from @1
|
|
|
|
to:@end
|
|
|
|
@end: scope:[] from @2
|
|
|
|
|
2017-12-29 10:21:11 +00:00
|
|
|
SYMBOL TABLE SSA
|
2017-08-20 19:09:03 +00:00
|
|
|
(label) @1
|
|
|
|
(label) @2
|
|
|
|
(label) @begin
|
|
|
|
(label) @end
|
2019-11-03 23:39:09 +00:00
|
|
|
(const byte*) SCREEN = (byte*)(number) $400
|
2017-08-20 19:09:03 +00:00
|
|
|
(void()) main()
|
2018-04-28 06:41:05 +00:00
|
|
|
(bool~) main::$0
|
2017-08-20 19:09:03 +00:00
|
|
|
(label) main::@1
|
2019-08-07 09:27:55 +00:00
|
|
|
(label) main::@2
|
2017-08-20 19:09:03 +00:00
|
|
|
(label) main::@return
|
|
|
|
(byte) main::i
|
|
|
|
(byte) main::i#0
|
|
|
|
(byte) main::i#1
|
|
|
|
(byte) main::i#2
|
2019-08-07 09:27:55 +00:00
|
|
|
(byte) main::i#3
|
2017-08-20 19:09:03 +00:00
|
|
|
|
2019-08-07 09:27:55 +00:00
|
|
|
Adding number conversion cast (unumber) $64 in (bool~) main::$0 ← (byte) main::i#2 != (number) $64
|
2019-05-30 20:29:04 +00:00
|
|
|
Successful SSA optimization PassNAddNumberTypeConversions
|
|
|
|
Simplifying constant pointer cast (byte*) 1024
|
|
|
|
Simplifying constant integer cast $64
|
|
|
|
Successful SSA optimization PassNCastSimplification
|
|
|
|
Finalized unsigned number type (byte) $64
|
|
|
|
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
2019-08-07 09:27:55 +00:00
|
|
|
Alias (byte) main::i#2 = (byte) main::i#3
|
2018-08-22 20:23:42 +00:00
|
|
|
Successful SSA optimization Pass2AliasElimination
|
2019-11-03 23:39:09 +00:00
|
|
|
Simple Condition (bool~) main::$0 [3] if((byte) main::i#2!=(byte) $64) goto main::@2
|
2018-08-22 20:23:42 +00:00
|
|
|
Successful SSA optimization Pass2ConditionalJumpSimplification
|
2017-11-03 06:58:02 +00:00
|
|
|
Constant (const byte) main::i#0 = 0
|
2018-08-22 20:23:42 +00:00
|
|
|
Successful SSA optimization Pass2ConstantIdentification
|
2017-11-03 06:58:02 +00:00
|
|
|
Inlining constant with var siblings (const byte) main::i#0
|
2019-05-30 20:29:04 +00:00
|
|
|
Constant inlined main::i#0 = (byte) 0
|
2018-08-22 20:23:42 +00:00
|
|
|
Successful SSA optimization Pass2ConstantInlining
|
2017-11-29 11:29:57 +00:00
|
|
|
Adding NOP phi() at start of @begin
|
|
|
|
Adding NOP phi() at start of @1
|
2019-05-30 20:29:04 +00:00
|
|
|
Adding NOP phi() at start of @2
|
2017-11-29 11:29:57 +00:00
|
|
|
Adding NOP phi() at start of @end
|
2017-09-06 16:59:53 +00:00
|
|
|
Adding NOP phi() at start of main
|
|
|
|
CALL GRAPH
|
2017-11-29 11:29:57 +00:00
|
|
|
Calls in [] to main:2
|
2017-09-06 16:59:53 +00:00
|
|
|
|
2017-08-17 22:28:39 +00:00
|
|
|
Created 1 initial phi equivalence classes
|
2019-08-25 20:21:56 +00:00
|
|
|
Coalesced [11] main::i#4 ← main::i#1
|
2017-08-17 22:28:39 +00:00
|
|
|
Coalesced down to 1 phi equivalence classes
|
2019-05-30 20:29:04 +00:00
|
|
|
Culled Empty Block (label) @2
|
2017-11-29 11:29:57 +00:00
|
|
|
Adding NOP phi() at start of @begin
|
|
|
|
Adding NOP phi() at start of @1
|
|
|
|
Adding NOP phi() at start of @end
|
2017-09-06 16:59:53 +00:00
|
|
|
Adding NOP phi() at start of main
|
2017-08-17 22:28:39 +00:00
|
|
|
|
2017-12-29 10:21:11 +00:00
|
|
|
FINAL CONTROL FLOW GRAPH
|
2017-11-09 20:34:13 +00:00
|
|
|
@begin: scope:[] from
|
2018-11-11 20:51:36 +00:00
|
|
|
[0] phi()
|
2017-11-09 20:34:13 +00:00
|
|
|
to:@1
|
|
|
|
@1: scope:[] from @begin
|
2018-11-11 20:51:36 +00:00
|
|
|
[1] phi()
|
|
|
|
[2] call main
|
2017-11-09 20:34:13 +00:00
|
|
|
to:@end
|
|
|
|
@end: scope:[] from @1
|
2018-11-11 20:51:36 +00:00
|
|
|
[3] phi()
|
2019-09-18 21:00:30 +00:00
|
|
|
|
|
|
|
(void()) main()
|
2017-11-09 20:34:13 +00:00
|
|
|
main: scope:[main] from @1
|
2018-11-11 20:51:36 +00:00
|
|
|
[4] phi()
|
2017-11-09 20:34:13 +00:00
|
|
|
to:main::@1
|
2019-08-25 20:21:56 +00:00
|
|
|
main::@1: scope:[main] from main main::@2
|
|
|
|
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 )
|
|
|
|
[6] if((byte) main::i#2!=(byte) $64) goto main::@2
|
2017-11-09 20:34:13 +00:00
|
|
|
to:main::@return
|
|
|
|
main::@return: scope:[main] from main::@1
|
2019-08-25 20:21:56 +00:00
|
|
|
[7] return
|
2017-11-09 20:34:13 +00:00
|
|
|
to:@return
|
2019-08-25 20:21:56 +00:00
|
|
|
main::@2: scope:[main] from main::@1
|
2019-11-03 23:39:09 +00:00
|
|
|
[8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2
|
2019-08-25 20:21:56 +00:00
|
|
|
[9] (byte) main::i#1 ← ++ (byte) main::i#2
|
|
|
|
to:main::@1
|
2017-11-09 20:34:13 +00:00
|
|
|
|
2017-08-17 22:28:39 +00:00
|
|
|
|
|
|
|
VARIABLE REGISTER WEIGHTS
|
|
|
|
(void()) main()
|
|
|
|
(byte) main::i
|
2019-08-25 20:21:56 +00:00
|
|
|
(byte) main::i#1 22.0
|
|
|
|
(byte) main::i#2 18.333333333333332
|
2017-08-17 22:28:39 +00:00
|
|
|
|
|
|
|
Initial phi equivalence classes
|
2019-08-25 20:21:56 +00:00
|
|
|
[ main::i#2 main::i#1 ]
|
2017-08-17 22:28:39 +00:00
|
|
|
Complete equivalence classes
|
2019-08-25 20:21:56 +00:00
|
|
|
[ main::i#2 main::i#1 ]
|
2019-10-12 09:40:36 +00:00
|
|
|
Allocated zp[1]:2 [ main::i#2 main::i#1 ]
|
2017-12-29 10:21:11 +00:00
|
|
|
|
2017-08-17 22:28:39 +00:00
|
|
|
INITIAL ASM
|
2019-09-08 00:29:17 +00:00
|
|
|
Target platform is c64basic / MOS6502X
|
2019-07-08 14:43:09 +00:00
|
|
|
// File Comments
|
2019-02-17 23:12:29 +00:00
|
|
|
// Minimal classic for() loop
|
2019-07-25 15:06:17 +00:00
|
|
|
// Upstart
|
2017-11-04 18:53:55 +00:00
|
|
|
.pc = $801 "Basic"
|
2019-09-29 21:13:37 +00:00
|
|
|
:BasicUpstart(__bbegin)
|
2017-11-04 18:53:55 +00:00
|
|
|
.pc = $80d "Program"
|
2019-07-08 14:43:09 +00:00
|
|
|
// Global Constants & labels
|
2018-01-31 20:27:22 +00:00
|
|
|
.label SCREEN = $400
|
2019-07-08 14:43:09 +00:00
|
|
|
// @begin
|
2019-09-29 21:13:37 +00:00
|
|
|
__bbegin:
|
2019-07-08 14:43:09 +00:00
|
|
|
// [1] phi from @begin to @1 [phi:@begin->@1]
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1_from___bbegin:
|
|
|
|
jmp __b1
|
2019-07-08 14:43:09 +00:00
|
|
|
// @1
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1:
|
2019-07-08 14:43:09 +00:00
|
|
|
// [2] call main
|
|
|
|
// [4] phi from @1 to main [phi:@1->main]
|
2019-09-29 21:13:37 +00:00
|
|
|
main_from___b1:
|
2017-08-17 22:28:39 +00:00
|
|
|
jsr main
|
2019-07-08 14:43:09 +00:00
|
|
|
// [3] phi from @1 to @end [phi:@1->@end]
|
2019-09-29 21:13:37 +00:00
|
|
|
__bend_from___b1:
|
|
|
|
jmp __bend
|
2019-07-08 14:43:09 +00:00
|
|
|
// @end
|
2019-09-29 21:13:37 +00:00
|
|
|
__bend:
|
2019-07-08 14:43:09 +00:00
|
|
|
// main
|
2017-08-17 22:28:39 +00:00
|
|
|
main: {
|
2017-08-20 23:19:43 +00:00
|
|
|
.label i = 2
|
2019-08-25 20:21:56 +00:00
|
|
|
// [5] phi from main to main::@1 [phi:main->main::@1]
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1_from_main:
|
2019-08-25 20:21:56 +00:00
|
|
|
// [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
|
2017-10-15 21:15:49 +00:00
|
|
|
lda #0
|
2019-08-07 19:00:19 +00:00
|
|
|
sta.z i
|
2019-09-29 21:13:37 +00:00
|
|
|
jmp __b1
|
2019-07-08 14:43:09 +00:00
|
|
|
// main::@1
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1:
|
2019-08-25 20:21:56 +00:00
|
|
|
// [6] if((byte) main::i#2!=(byte) $64) goto main::@2 -- vbuz1_neq_vbuc1_then_la1
|
2019-03-26 22:49:44 +00:00
|
|
|
lda #$64
|
2019-08-07 19:00:19 +00:00
|
|
|
cmp.z i
|
2019-09-29 21:13:37 +00:00
|
|
|
bne __b2
|
|
|
|
jmp __breturn
|
2019-07-08 14:43:09 +00:00
|
|
|
// main::@return
|
2019-09-29 21:13:37 +00:00
|
|
|
__breturn:
|
2019-08-25 20:21:56 +00:00
|
|
|
// [7] return
|
2017-08-17 22:28:39 +00:00
|
|
|
rts
|
2019-08-25 20:21:56 +00:00
|
|
|
// main::@2
|
2019-09-29 21:13:37 +00:00
|
|
|
__b2:
|
2019-11-03 23:39:09 +00:00
|
|
|
// [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuz1=vbuz1
|
2019-08-25 20:21:56 +00:00
|
|
|
ldy.z i
|
|
|
|
tya
|
|
|
|
sta SCREEN,y
|
|
|
|
// [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
|
|
|
|
inc.z i
|
|
|
|
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1_from___b2:
|
2019-08-25 20:21:56 +00:00
|
|
|
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#0] -- register_copy
|
2019-09-29 21:13:37 +00:00
|
|
|
jmp __b1
|
2017-08-17 22:28:39 +00:00
|
|
|
}
|
2019-07-08 14:43:09 +00:00
|
|
|
// File Data
|
2017-08-17 22:28:39 +00:00
|
|
|
|
|
|
|
REGISTER UPLIFT POTENTIAL REGISTERS
|
2019-10-12 09:40:36 +00:00
|
|
|
Potential registers zp[1]:2 [ main::i#2 main::i#1 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y ,
|
2017-08-17 22:28:39 +00:00
|
|
|
|
|
|
|
REGISTER UPLIFT SCOPES
|
2019-10-12 09:40:36 +00:00
|
|
|
Uplift Scope [main] 40.33: zp[1]:2 [ main::i#2 main::i#1 ]
|
2017-08-17 22:28:39 +00:00
|
|
|
Uplift Scope []
|
|
|
|
|
2019-08-25 20:21:56 +00:00
|
|
|
Uplifting [main] best 263 combination reg byte x [ main::i#2 main::i#1 ]
|
|
|
|
Uplifting [] best 263 combination
|
2017-12-26 08:15:10 +00:00
|
|
|
|
|
|
|
ASSEMBLER BEFORE OPTIMIZATION
|
2019-07-08 14:43:09 +00:00
|
|
|
// File Comments
|
2019-02-17 23:12:29 +00:00
|
|
|
// Minimal classic for() loop
|
2019-07-25 15:06:17 +00:00
|
|
|
// Upstart
|
2017-11-04 18:53:55 +00:00
|
|
|
.pc = $801 "Basic"
|
2019-09-29 21:13:37 +00:00
|
|
|
:BasicUpstart(__bbegin)
|
2017-11-04 18:53:55 +00:00
|
|
|
.pc = $80d "Program"
|
2019-07-08 14:43:09 +00:00
|
|
|
// Global Constants & labels
|
2018-01-31 20:27:22 +00:00
|
|
|
.label SCREEN = $400
|
2019-07-08 14:43:09 +00:00
|
|
|
// @begin
|
2019-09-29 21:13:37 +00:00
|
|
|
__bbegin:
|
2019-07-08 14:43:09 +00:00
|
|
|
// [1] phi from @begin to @1 [phi:@begin->@1]
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1_from___bbegin:
|
|
|
|
jmp __b1
|
2019-07-08 14:43:09 +00:00
|
|
|
// @1
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1:
|
2019-07-08 14:43:09 +00:00
|
|
|
// [2] call main
|
|
|
|
// [4] phi from @1 to main [phi:@1->main]
|
2019-09-29 21:13:37 +00:00
|
|
|
main_from___b1:
|
2017-08-17 22:28:39 +00:00
|
|
|
jsr main
|
2019-07-08 14:43:09 +00:00
|
|
|
// [3] phi from @1 to @end [phi:@1->@end]
|
2019-09-29 21:13:37 +00:00
|
|
|
__bend_from___b1:
|
|
|
|
jmp __bend
|
2019-07-08 14:43:09 +00:00
|
|
|
// @end
|
2019-09-29 21:13:37 +00:00
|
|
|
__bend:
|
2019-07-08 14:43:09 +00:00
|
|
|
// main
|
2017-08-17 22:28:39 +00:00
|
|
|
main: {
|
2019-08-25 20:21:56 +00:00
|
|
|
// [5] phi from main to main::@1 [phi:main->main::@1]
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1_from_main:
|
2019-08-25 20:21:56 +00:00
|
|
|
// [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
|
2017-10-15 21:15:49 +00:00
|
|
|
ldx #0
|
2019-09-29 21:13:37 +00:00
|
|
|
jmp __b1
|
2019-07-08 14:43:09 +00:00
|
|
|
// main::@1
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1:
|
2019-08-25 20:21:56 +00:00
|
|
|
// [6] if((byte) main::i#2!=(byte) $64) goto main::@2 -- vbuxx_neq_vbuc1_then_la1
|
2017-08-17 22:28:39 +00:00
|
|
|
cpx #$64
|
2019-09-29 21:13:37 +00:00
|
|
|
bne __b2
|
|
|
|
jmp __breturn
|
2019-07-08 14:43:09 +00:00
|
|
|
// main::@return
|
2019-09-29 21:13:37 +00:00
|
|
|
__breturn:
|
2019-08-25 20:21:56 +00:00
|
|
|
// [7] return
|
2017-08-17 22:28:39 +00:00
|
|
|
rts
|
2019-08-25 20:21:56 +00:00
|
|
|
// main::@2
|
2019-09-29 21:13:37 +00:00
|
|
|
__b2:
|
2019-11-03 23:39:09 +00:00
|
|
|
// [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx
|
2019-08-25 20:21:56 +00:00
|
|
|
txa
|
|
|
|
sta SCREEN,x
|
|
|
|
// [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
|
|
|
inx
|
|
|
|
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1_from___b2:
|
2019-08-25 20:21:56 +00:00
|
|
|
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#0] -- register_copy
|
2019-09-29 21:13:37 +00:00
|
|
|
jmp __b1
|
2017-08-17 22:28:39 +00:00
|
|
|
}
|
2019-07-08 14:43:09 +00:00
|
|
|
// File Data
|
2017-08-17 22:28:39 +00:00
|
|
|
|
2017-12-26 08:15:10 +00:00
|
|
|
ASSEMBLER OPTIMIZATIONS
|
2019-09-29 21:13:37 +00:00
|
|
|
Removing instruction jmp __b1
|
|
|
|
Removing instruction jmp __bend
|
|
|
|
Removing instruction jmp __b1
|
|
|
|
Removing instruction jmp __breturn
|
2017-12-26 08:15:10 +00:00
|
|
|
Succesful ASM optimization Pass5NextJumpElimination
|
2019-09-29 21:13:37 +00:00
|
|
|
Removing instruction __b1_from___bbegin:
|
2020-03-03 07:58:31 +00:00
|
|
|
Removing instruction __b1:
|
2019-09-29 21:13:37 +00:00
|
|
|
Removing instruction main_from___b1:
|
|
|
|
Removing instruction __bend_from___b1:
|
2017-08-17 22:28:39 +00:00
|
|
|
Succesful ASM optimization Pass5RedundantLabelElimination
|
2019-09-29 21:13:37 +00:00
|
|
|
Removing instruction __bend:
|
|
|
|
Removing instruction __b1_from_main:
|
|
|
|
Removing instruction __breturn:
|
|
|
|
Removing instruction __b1_from___b2:
|
2017-08-17 22:28:39 +00:00
|
|
|
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
|
2020-03-03 07:58:31 +00:00
|
|
|
Removing instruction __bbegin:
|
2018-12-25 16:04:50 +00:00
|
|
|
Succesful ASM optimization Pass5UnusedLabelElimination
|
2017-08-17 22:28:39 +00:00
|
|
|
|
|
|
|
FINAL SYMBOL TABLE
|
|
|
|
(label) @1
|
|
|
|
(label) @begin
|
|
|
|
(label) @end
|
2019-11-03 23:39:09 +00:00
|
|
|
(const byte*) SCREEN = (byte*) 1024
|
2017-08-17 22:28:39 +00:00
|
|
|
(void()) main()
|
|
|
|
(label) main::@1
|
2019-08-07 09:27:55 +00:00
|
|
|
(label) main::@2
|
2017-08-17 22:28:39 +00:00
|
|
|
(label) main::@return
|
|
|
|
(byte) main::i
|
2019-08-25 20:21:56 +00:00
|
|
|
(byte) main::i#1 reg byte x 22.0
|
|
|
|
(byte) main::i#2 reg byte x 18.333333333333332
|
2017-08-17 22:28:39 +00:00
|
|
|
|
2019-08-25 20:21:56 +00:00
|
|
|
reg byte x [ main::i#2 main::i#1 ]
|
2017-08-17 22:28:39 +00:00
|
|
|
|
2017-12-29 10:21:11 +00:00
|
|
|
|
|
|
|
FINAL ASSEMBLER
|
2019-08-25 20:21:56 +00:00
|
|
|
Score: 191
|
2017-12-30 12:45:59 +00:00
|
|
|
|
2019-07-08 14:43:09 +00:00
|
|
|
// File Comments
|
2019-02-17 23:12:29 +00:00
|
|
|
// Minimal classic for() loop
|
2019-07-25 15:06:17 +00:00
|
|
|
// Upstart
|
2017-11-04 18:53:55 +00:00
|
|
|
.pc = $801 "Basic"
|
|
|
|
:BasicUpstart(main)
|
|
|
|
.pc = $80d "Program"
|
2019-07-08 14:43:09 +00:00
|
|
|
// Global Constants & labels
|
2018-01-31 20:27:22 +00:00
|
|
|
.label SCREEN = $400
|
2019-07-08 14:43:09 +00:00
|
|
|
// @begin
|
|
|
|
// [1] phi from @begin to @1 [phi:@begin->@1]
|
|
|
|
// @1
|
|
|
|
// [2] call main
|
|
|
|
// [4] phi from @1 to main [phi:@1->main]
|
|
|
|
// [3] phi from @1 to @end [phi:@1->@end]
|
|
|
|
// @end
|
|
|
|
// main
|
2017-08-17 22:28:39 +00:00
|
|
|
main: {
|
2019-08-25 20:21:56 +00:00
|
|
|
// [5] phi from main to main::@1 [phi:main->main::@1]
|
|
|
|
// [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
|
2017-10-15 21:15:49 +00:00
|
|
|
ldx #0
|
2019-08-25 20:21:56 +00:00
|
|
|
// main::@1
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1:
|
2019-08-25 20:21:56 +00:00
|
|
|
// for(byte i=0; i!=100; i++)
|
|
|
|
// [6] if((byte) main::i#2!=(byte) $64) goto main::@2 -- vbuxx_neq_vbuc1_then_la1
|
|
|
|
cpx #$64
|
2019-09-29 21:13:37 +00:00
|
|
|
bne __b2
|
2019-08-25 20:21:56 +00:00
|
|
|
// main::@return
|
|
|
|
// }
|
|
|
|
// [7] return
|
|
|
|
rts
|
2019-08-07 09:27:55 +00:00
|
|
|
// main::@2
|
2019-09-29 21:13:37 +00:00
|
|
|
__b2:
|
2019-08-07 09:27:55 +00:00
|
|
|
// SCREEN[i] = i
|
2019-11-03 23:39:09 +00:00
|
|
|
// [8] *((const byte*) SCREEN + (byte) main::i#2) ← (byte) main::i#2 -- pbuc1_derefidx_vbuxx=vbuxx
|
2019-08-07 09:27:55 +00:00
|
|
|
txa
|
|
|
|
sta SCREEN,x
|
|
|
|
// for(byte i=0; i!=100; i++)
|
2019-08-25 20:21:56 +00:00
|
|
|
// [9] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
|
2019-08-07 09:27:55 +00:00
|
|
|
inx
|
2019-08-25 20:21:56 +00:00
|
|
|
// [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
|
|
|
|
// [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#0] -- register_copy
|
2019-09-29 21:13:37 +00:00
|
|
|
jmp __b1
|
2017-08-17 22:28:39 +00:00
|
|
|
}
|
2019-07-08 14:43:09 +00:00
|
|
|
// File Data
|
2017-08-17 22:28:39 +00:00
|
|
|
|