
CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start
  SCREEN[0] = DATA[0]
  to:main::@return
main::@return: scope:[main]  from main
  return 
  to:@return

void __start()
__start: scope:[__start]  from
  call main
  to:__start::@1
__start::@1: scope:[__start]  from __start
  to:__start::@return
__start::@return: scope:[__start]  from __start::@1
  return 
  to:@return

SYMBOL TABLE SSA
__constant char DATA[$3e8] = { fill( $3e8, 0) }
__constant char * const SCREEN = (char *)$400
void __start()
void main()

Adding number conversion cast (unumber) 0 in SCREEN[0] = DATA[0]
Adding number conversion cast (unumber) 0 in SCREEN[0] = DATA[(unumber)0]
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simplifying expression containing zero DATA in [0] SCREEN[0] = DATA[0]
Simplifying expression containing zero SCREEN in [0] SCREEN[0] = *DATA
Successful SSA optimization PassNSimplifyExpressionWithZero
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Finalized unsigned number type (unsigned int) $3e8
Finalized unsigned number type (unsigned int) $3e8
Finalized unsigned number type (unsigned int) $1000
Successful SSA optimization PassNFinalizeNumberTypeConversions
CALL GRAPH

Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes

FINAL CONTROL FLOW GRAPH

void main()
main: scope:[main]  from
  [0] *SCREEN = *DATA
  to:main::@return
main::@return: scope:[main]  from main
  [1] return 
  to:@return


VARIABLE REGISTER WEIGHTS
void main()

Initial phi equivalence classes
Complete equivalence classes
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] *SCREEN = *DATA [ ] (  [ ] { }  ) always clobbers reg byte a 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 
Uplift Scope [] 

Uplifting [main] best 17 combination 
Uplifting [] best 17 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Test declaring an array variable as at a hard-coded address
  // Upstart
  // Commodore 64 PRG executable file
.file [name="address-8.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
  // The screen
  .label SCREEN = $400
.segment Code
  // main
main: {
    // [0] *SCREEN = *DATA -- _deref_pbuc1=_deref_pbuc2 
    lda DATA
    sta SCREEN
    jmp __breturn
    // main::@return
  __breturn:
    // [1] return 
    rts
}
  // File Data
.segment Data
.pc = $1000 "DATA"
  // Data to be put on the screen
  DATA: .fill $3e8, 0

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
__constant char DATA[$3e8] = { fill( $3e8, 0) }
__constant char * const SCREEN = (char *) 1024
void main()



FINAL ASSEMBLER
Score: 14

  // File Comments
// Test declaring an array variable as at a hard-coded address
  // Upstart
  // Commodore 64 PRG executable file
.file [name="address-8.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
  // The screen
  .label SCREEN = $400
.segment Code
  // main
main: {
    // SCREEN[0] = DATA[0]
    // [0] *SCREEN = *DATA -- _deref_pbuc1=_deref_pbuc2 
    lda DATA
    sta SCREEN
    // main::@return
    // }
    // [1] return 
    rts
}
  // File Data
.segment Data
.pc = $1000 "DATA"
  // Data to be put on the screen
  DATA: .fill $3e8, 0

