mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-12-30 00:30:54 +00:00
Cleaned up pointer handling in ASM fragments and binding
This commit is contained in:
parent
5f1cf097a4
commit
3a14d2ef5b
@ -223,21 +223,10 @@ public class AsmFragment {
|
||||
value = symbols.getRegister((Variable) value);
|
||||
} else if (value instanceof PointerDereferenceSimple) {
|
||||
PointerDereferenceSimple deref = (PointerDereferenceSimple) value;
|
||||
RValue pointer = deref.getPointer();
|
||||
if(pointer instanceof VariableRef) {
|
||||
VariableRef pointerRef = (VariableRef) pointer;
|
||||
Variable pointerVar = symbols.getVariable(pointerRef);
|
||||
RegisterAllocation.Register register = symbols.getRegister(pointerVar);
|
||||
value = new PointerDereferenceRegisterZpByte((RegisterAllocation.RegisterZpPointerByte) register);
|
||||
}
|
||||
return "_star_" + bind(deref.getPointer());
|
||||
} else if (value instanceof PointerDereferenceIndexed) {
|
||||
PointerDereferenceIndexed deref = (PointerDereferenceIndexed) value;
|
||||
String compositeName =
|
||||
"ptr_"
|
||||
+ bind(deref.getPointer())
|
||||
+ "_"
|
||||
+ bind(deref.getIndex());
|
||||
return compositeName;
|
||||
return bind(deref.getPointer()) + "_staridx_" + bind(deref.getIndex());
|
||||
}
|
||||
|
||||
// Find value if it is already bound
|
||||
@ -277,24 +266,6 @@ public class AsmFragment {
|
||||
bindings.put(name, value);
|
||||
return name;
|
||||
}
|
||||
} else if (value instanceof PointerDereferenceRegisterZpByte) {
|
||||
RegisterAllocation.Register register = ((PointerDereferenceRegisterZpByte) value).getPointerRegister();
|
||||
if (RegisterAllocation.RegisterType.ZP_PTR_BYTE.equals(register.getType())) {
|
||||
String name = "zpiby" + nextZpPtrIdx++;
|
||||
bindings.put(name, value);
|
||||
return name;
|
||||
}
|
||||
} else if (value instanceof PointerDereferenceSimple) {
|
||||
PointerDereferenceSimple deref = (PointerDereferenceSimple) value;
|
||||
RValue pointer = deref.getPointer();
|
||||
if(pointer instanceof Constant) {
|
||||
Constant pointerConst = (Constant) pointer;
|
||||
if (pointerConst instanceof ConstantInteger) {
|
||||
String name = "coptr" + nextConstByteIdx++;
|
||||
bindings.put(name, value);
|
||||
return name;
|
||||
}
|
||||
}
|
||||
} else if (value instanceof ConstantInteger) {
|
||||
ConstantInteger intValue = (ConstantInteger) value;
|
||||
if (SymbolTypeBasic.BYTE.equals(intValue.getType())) {
|
||||
@ -339,10 +310,6 @@ public class AsmFragment {
|
||||
} else {
|
||||
throw new RuntimeException("Register Type not implemented " + register);
|
||||
}
|
||||
} else if (boundValue instanceof PointerDereferenceRegisterZpByte) {
|
||||
PointerDereferenceRegisterZpByte deref = (PointerDereferenceRegisterZpByte) boundValue;
|
||||
RegisterAllocation.RegisterZpPointerByte register = deref.getPointerRegister();
|
||||
bound = Integer.toString(register.getZp());
|
||||
} else if (boundValue instanceof PointerDereferenceSimple) {
|
||||
PointerDereferenceSimple deref = (PointerDereferenceSimple) boundValue;
|
||||
RValue pointer = deref.getPointer();
|
||||
|
@ -1,34 +0,0 @@
|
||||
package dk.camelot64.kickc.asm;
|
||||
|
||||
import dk.camelot64.kickc.icl.PointerDereference;
|
||||
import dk.camelot64.kickc.icl.ProgramScope;
|
||||
import dk.camelot64.kickc.icl.RegisterAllocation;
|
||||
|
||||
/** A dereferenced ZP pointer to a byte */
|
||||
public class PointerDereferenceRegisterZpByte implements PointerDereference {
|
||||
|
||||
private RegisterAllocation.RegisterZpPointerByte pointer;
|
||||
|
||||
public PointerDereferenceRegisterZpByte(RegisterAllocation.RegisterZpPointerByte pointer) {
|
||||
this.pointer = pointer;
|
||||
}
|
||||
|
||||
public RegisterAllocation.RegisterZpPointerByte getPointer() {
|
||||
return pointer;
|
||||
}
|
||||
|
||||
public RegisterAllocation.RegisterZpPointerByte getPointerRegister() {
|
||||
return pointer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return toString(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(ProgramScope scope) {
|
||||
return "*(" + pointer.toString(scope) + ')';
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1 @@
|
||||
sta {cowo1}
|
@ -1,2 +1,2 @@
|
||||
lda #{coby2}
|
||||
sta {coptr1}
|
||||
sta {cowo1}
|
@ -0,0 +1 @@
|
||||
stx {cowo1}
|
@ -1,2 +1,2 @@
|
||||
lda {zpby1}
|
||||
sta {coptr1}
|
||||
sta {cowo1}
|
@ -1,3 +1,3 @@
|
||||
ldy #0
|
||||
lda #{coby1}
|
||||
sta ({zpiby1}),y
|
||||
sta ({zpptrby1}),y
|
@ -0,0 +1,3 @@
|
||||
txa
|
||||
ldy #0
|
||||
sta ({zpptrby1}),y
|
@ -1,3 +1,3 @@
|
||||
ldy #0
|
||||
lda {zpby1}
|
||||
sta ({zpiby1}),y
|
||||
sta ({zpptrby1}),y
|
@ -1 +0,0 @@
|
||||
sta {coptr1}
|
@ -1 +0,0 @@
|
||||
stx {coptr1}
|
@ -1,3 +0,0 @@
|
||||
ldy #0
|
||||
lda ({zpiby1}),y
|
||||
sta {zpby1}
|
@ -1,3 +0,0 @@
|
||||
txa
|
||||
ldy #0
|
||||
sta ({zpiby1}),y
|
@ -1155,7 +1155,7 @@ B1_from_B3:
|
||||
// (byte*) cursor#3 = (byte*) cursor#5 // register copy zp ptr byte:2
|
||||
jmp B1
|
||||
B1:
|
||||
// [1] *((byte*) cursor#3) ← (byte) 81 [ cursor#3 x#2 e#3 y#2 ] // zpiby1=coby1
|
||||
// [1] *((byte*) cursor#3) ← (byte) 81 [ cursor#3 x#2 e#3 y#2 ] // _star_zpptrby1=coby1
|
||||
ldy #0
|
||||
lda #81
|
||||
sta (2),y
|
||||
@ -1237,7 +1237,7 @@ B1_from_B3:
|
||||
// (byte) x#2 = (byte) x#1 // register copy zp byte:4
|
||||
// (byte*) cursor#3 = (byte*) cursor#5 // register copy zp ptr byte:2
|
||||
B1:
|
||||
// [1] *((byte*) cursor#3) ← (byte) 81 [ cursor#3 x#2 e#3 y#2 ] // zpiby1=coby1
|
||||
// [1] *((byte*) cursor#3) ← (byte) 81 [ cursor#3 x#2 e#3 y#2 ] // _star_zpptrby1=coby1
|
||||
ldy #0
|
||||
lda #81
|
||||
sta (2),y
|
||||
@ -1314,7 +1314,7 @@ B1_from_B3:
|
||||
// (byte) x#2 = (byte) x#1 // register copy zp byte:4
|
||||
// (byte*) cursor#3 = (byte*) cursor#5 // register copy zp ptr byte:2
|
||||
B1:
|
||||
// [1] *((byte*) cursor#3) ← (byte) 81 [ cursor#3 x#2 e#3 y#2 ] // zpiby1=coby1
|
||||
// [1] *((byte*) cursor#3) ← (byte) 81 [ cursor#3 x#2 e#3 y#2 ] // _star_zpptrby1=coby1
|
||||
ldy #0
|
||||
lda #81
|
||||
sta (2),y
|
||||
@ -1426,7 +1426,7 @@ B1_from_B3:
|
||||
// (byte) x#2 = (byte) x#1 // register copy zp byte:4
|
||||
// (byte*) cursor#3 = (byte*) cursor#5 // register copy zp ptr byte:2
|
||||
B1:
|
||||
// [1] *((byte*) cursor#3) ← (byte) 81 [ cursor#3 x#2 e#3 y#2 ] // zpiby1=coby1
|
||||
// [1] *((byte*) cursor#3) ← (byte) 81 [ cursor#3 x#2 e#3 y#2 ] // _star_zpptrby1=coby1
|
||||
ldy #0
|
||||
lda #81
|
||||
sta (2),y
|
||||
|
@ -462,10 +462,10 @@ zp byte:4 [ $3 ]
|
||||
|
||||
INITIAL ASM
|
||||
BBEGIN:
|
||||
// [0] *((word) 4352) ← (byte) 0 [ ] // coptr1=coby2
|
||||
// [0] *((word) 4352) ← (byte) 0 [ ] // _star_cowo1=coby2
|
||||
lda #0
|
||||
sta 4352
|
||||
// [1] *((word) 4353) ← (byte) 1 [ ] // coptr1=coby2
|
||||
// [1] *((word) 4353) ← (byte) 1 [ ] // _star_cowo1=coby2
|
||||
lda #1
|
||||
sta 4353
|
||||
B1_from_BBEGIN:
|
||||
@ -488,7 +488,7 @@ B1:
|
||||
clc
|
||||
adc 3
|
||||
sta 3
|
||||
// [6] *((word) 4354 + (byte) i#2) ← (byte~) $4 [ i#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [6] *((word) 4354 + (byte) i#2) ← (byte~) $4 [ i#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 3
|
||||
ldx 2
|
||||
sta 4354,x
|
||||
@ -506,10 +506,10 @@ Removing instruction jmp BEND
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
ASSEMBLER
|
||||
BBEGIN:
|
||||
// [0] *((word) 4352) ← (byte) 0 [ ] // coptr1=coby2
|
||||
// [0] *((word) 4352) ← (byte) 0 [ ] // _star_cowo1=coby2
|
||||
lda #0
|
||||
sta 4352
|
||||
// [1] *((word) 4353) ← (byte) 1 [ ] // coptr1=coby2
|
||||
// [1] *((word) 4353) ← (byte) 1 [ ] // _star_cowo1=coby2
|
||||
lda #1
|
||||
sta 4353
|
||||
B1_from_BBEGIN:
|
||||
@ -531,7 +531,7 @@ B1:
|
||||
clc
|
||||
adc 3
|
||||
sta 3
|
||||
// [6] *((word) 4354 + (byte) i#2) ← (byte~) $4 [ i#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [6] *((word) 4354 + (byte) i#2) ← (byte~) $4 [ i#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 3
|
||||
ldx 2
|
||||
sta 4354,x
|
||||
@ -547,10 +547,10 @@ Removing instruction jmp B1
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
ASSEMBLER
|
||||
BBEGIN:
|
||||
// [0] *((word) 4352) ← (byte) 0 [ ] // coptr1=coby2
|
||||
// [0] *((word) 4352) ← (byte) 0 [ ] // _star_cowo1=coby2
|
||||
lda #0
|
||||
sta 4352
|
||||
// [1] *((word) 4353) ← (byte) 1 [ ] // coptr1=coby2
|
||||
// [1] *((word) 4353) ← (byte) 1 [ ] // _star_cowo1=coby2
|
||||
lda #1
|
||||
sta 4353
|
||||
B1_from_BBEGIN:
|
||||
@ -571,7 +571,7 @@ B1:
|
||||
clc
|
||||
adc 3
|
||||
sta 3
|
||||
// [6] *((word) 4354 + (byte) i#2) ← (byte~) $4 [ i#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [6] *((word) 4354 + (byte) i#2) ← (byte~) $4 [ i#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 3
|
||||
ldx 2
|
||||
sta 4354,x
|
||||
@ -601,10 +601,10 @@ zp byte:4 [ $3 ]
|
||||
|
||||
FINAL CODE
|
||||
BBEGIN:
|
||||
// [0] *((word) 4352) ← (byte) 0 [ ] // coptr1=coby2
|
||||
// [0] *((word) 4352) ← (byte) 0 [ ] // _star_cowo1=coby2
|
||||
lda #0
|
||||
sta 4352
|
||||
// [1] *((word) 4353) ← (byte) 1 [ ] // coptr1=coby2
|
||||
// [1] *((word) 4353) ← (byte) 1 [ ] // _star_cowo1=coby2
|
||||
lda #1
|
||||
sta 4353
|
||||
B1_from_BBEGIN:
|
||||
@ -625,7 +625,7 @@ B1:
|
||||
clc
|
||||
adc 3
|
||||
sta 3
|
||||
// [6] *((word) 4354 + (byte) i#2) ← (byte~) $4 [ i#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [6] *((word) 4354 + (byte) i#2) ← (byte~) $4 [ i#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 3
|
||||
ldx 2
|
||||
sta 4354,x
|
||||
|
@ -4336,7 +4336,7 @@ plot__B2:
|
||||
ldx 6
|
||||
lda 4096,x
|
||||
sta 16
|
||||
// [16] *((byte*) plot::line#2 + (byte) plot::x#2) ← (byte~) plot::$3 [ plot::i#2 plot::line#2 plot::x#2 plot::y#2 ] // ptr_zpptrby1_zpby1=zpby2
|
||||
// [16] *((byte*) plot::line#2 + (byte) plot::x#2) ← (byte~) plot::$3 [ plot::i#2 plot::line#2 plot::x#2 plot::y#2 ] // zpptrby1_staridx_zpby1=zpby2
|
||||
lda 16
|
||||
ldy 7
|
||||
sta (3),y
|
||||
@ -4401,7 +4401,7 @@ flip__B2:
|
||||
ldx 9
|
||||
lda 4096,x
|
||||
sta 17
|
||||
// [27] *((word) 4352 + (byte) flip::dstIdx#3) ← (byte~) flip::$0 [ flip::srcIdx#2 flip::dstIdx#3 flip::c#2 flip::r#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [27] *((word) 4352 + (byte) flip::dstIdx#3) ← (byte~) flip::$0 [ flip::srcIdx#2 flip::dstIdx#3 flip::c#2 flip::r#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 17
|
||||
ldx 10
|
||||
sta 4352,x
|
||||
@ -4439,7 +4439,7 @@ flip__B3:
|
||||
ldx 12
|
||||
lda 4352,x
|
||||
sta 18
|
||||
// [37] *((word) 4096 + (byte) flip::i#2) ← (byte~) flip::$4 [ flip::i#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [37] *((word) 4096 + (byte) flip::i#2) ← (byte~) flip::$4 [ flip::i#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 18
|
||||
ldx 12
|
||||
sta 4096,x
|
||||
@ -4461,7 +4461,7 @@ prepare__B1_from_B1:
|
||||
// (byte) prepare::i#2 = (byte) prepare::i#1 // register copy zp byte:13
|
||||
jmp prepare__B1
|
||||
prepare__B1:
|
||||
// [42] *((word) 4096 + (byte) prepare::i#2) ← (byte) prepare::i#2 [ prepare::i#2 ] // ptr_cowo1_zpby1=zpby1
|
||||
// [42] *((word) 4096 + (byte) prepare::i#2) ← (byte) prepare::i#2 [ prepare::i#2 ] // cowo1_staridx_zpby1=zpby1
|
||||
ldx 13
|
||||
txa
|
||||
sta 4096,x
|
||||
@ -4576,7 +4576,7 @@ plot__B2:
|
||||
ldx 6
|
||||
lda 4096,x
|
||||
sta 16
|
||||
// [16] *((byte*) plot::line#2 + (byte) plot::x#2) ← (byte~) plot::$3 [ plot::i#2 plot::line#2 plot::x#2 plot::y#2 ] // ptr_zpptrby1_zpby1=zpby2
|
||||
// [16] *((byte*) plot::line#2 + (byte) plot::x#2) ← (byte~) plot::$3 [ plot::i#2 plot::line#2 plot::x#2 plot::y#2 ] // zpptrby1_staridx_zpby1=zpby2
|
||||
lda 16
|
||||
ldy 7
|
||||
sta (3),y
|
||||
@ -4637,7 +4637,7 @@ flip__B2:
|
||||
ldx 9
|
||||
lda 4096,x
|
||||
sta 17
|
||||
// [27] *((word) 4352 + (byte) flip::dstIdx#3) ← (byte~) flip::$0 [ flip::srcIdx#2 flip::dstIdx#3 flip::c#2 flip::r#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [27] *((word) 4352 + (byte) flip::dstIdx#3) ← (byte~) flip::$0 [ flip::srcIdx#2 flip::dstIdx#3 flip::c#2 flip::r#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 17
|
||||
ldx 10
|
||||
sta 4352,x
|
||||
@ -4673,7 +4673,7 @@ flip__B3:
|
||||
ldx 12
|
||||
lda 4352,x
|
||||
sta 18
|
||||
// [37] *((word) 4096 + (byte) flip::i#2) ← (byte~) flip::$4 [ flip::i#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [37] *((word) 4096 + (byte) flip::i#2) ← (byte~) flip::$4 [ flip::i#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 18
|
||||
ldx 12
|
||||
sta 4096,x
|
||||
@ -4693,7 +4693,7 @@ prepare__B1_from_prepare:
|
||||
prepare__B1_from_B1:
|
||||
// (byte) prepare::i#2 = (byte) prepare::i#1 // register copy zp byte:13
|
||||
prepare__B1:
|
||||
// [42] *((word) 4096 + (byte) prepare::i#2) ← (byte) prepare::i#2 [ prepare::i#2 ] // ptr_cowo1_zpby1=zpby1
|
||||
// [42] *((word) 4096 + (byte) prepare::i#2) ← (byte) prepare::i#2 [ prepare::i#2 ] // cowo1_staridx_zpby1=zpby1
|
||||
ldx 13
|
||||
txa
|
||||
sta 4096,x
|
||||
@ -4792,7 +4792,7 @@ plot__B2:
|
||||
ldx 6
|
||||
lda 4096,x
|
||||
sta 16
|
||||
// [16] *((byte*) plot::line#2 + (byte) plot::x#2) ← (byte~) plot::$3 [ plot::i#2 plot::line#2 plot::x#2 plot::y#2 ] // ptr_zpptrby1_zpby1=zpby2
|
||||
// [16] *((byte*) plot::line#2 + (byte) plot::x#2) ← (byte~) plot::$3 [ plot::i#2 plot::line#2 plot::x#2 plot::y#2 ] // zpptrby1_staridx_zpby1=zpby2
|
||||
lda 16
|
||||
ldy 7
|
||||
sta (3),y
|
||||
@ -4851,7 +4851,7 @@ flip__B2:
|
||||
ldx 9
|
||||
lda 4096,x
|
||||
sta 17
|
||||
// [27] *((word) 4352 + (byte) flip::dstIdx#3) ← (byte~) flip::$0 [ flip::srcIdx#2 flip::dstIdx#3 flip::c#2 flip::r#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [27] *((word) 4352 + (byte) flip::dstIdx#3) ← (byte~) flip::$0 [ flip::srcIdx#2 flip::dstIdx#3 flip::c#2 flip::r#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 17
|
||||
ldx 10
|
||||
sta 4352,x
|
||||
@ -4886,7 +4886,7 @@ flip__B3:
|
||||
ldx 12
|
||||
lda 4352,x
|
||||
sta 18
|
||||
// [37] *((word) 4096 + (byte) flip::i#2) ← (byte~) flip::$4 [ flip::i#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [37] *((word) 4096 + (byte) flip::i#2) ← (byte~) flip::$4 [ flip::i#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 18
|
||||
ldx 12
|
||||
sta 4096,x
|
||||
@ -4905,7 +4905,7 @@ prepare__B1_from_prepare:
|
||||
prepare__B1_from_B1:
|
||||
// (byte) prepare::i#2 = (byte) prepare::i#1 // register copy zp byte:13
|
||||
prepare__B1:
|
||||
// [42] *((word) 4096 + (byte) prepare::i#2) ← (byte) prepare::i#2 [ prepare::i#2 ] // ptr_cowo1_zpby1=zpby1
|
||||
// [42] *((word) 4096 + (byte) prepare::i#2) ← (byte) prepare::i#2 [ prepare::i#2 ] // cowo1_staridx_zpby1=zpby1
|
||||
ldx 13
|
||||
txa
|
||||
sta 4096,x
|
||||
@ -4997,7 +4997,7 @@ plot__B2:
|
||||
ldx 6
|
||||
lda 4096,x
|
||||
sta 16
|
||||
// [16] *((byte*) plot::line#2 + (byte) plot::x#2) ← (byte~) plot::$3 [ plot::i#2 plot::line#2 plot::x#2 plot::y#2 ] // ptr_zpptrby1_zpby1=zpby2
|
||||
// [16] *((byte*) plot::line#2 + (byte) plot::x#2) ← (byte~) plot::$3 [ plot::i#2 plot::line#2 plot::x#2 plot::y#2 ] // zpptrby1_staridx_zpby1=zpby2
|
||||
lda 16
|
||||
ldy 7
|
||||
sta (3),y
|
||||
@ -5056,7 +5056,7 @@ flip__B2:
|
||||
ldx 9
|
||||
lda 4096,x
|
||||
sta 17
|
||||
// [27] *((word) 4352 + (byte) flip::dstIdx#3) ← (byte~) flip::$0 [ flip::srcIdx#2 flip::dstIdx#3 flip::c#2 flip::r#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [27] *((word) 4352 + (byte) flip::dstIdx#3) ← (byte~) flip::$0 [ flip::srcIdx#2 flip::dstIdx#3 flip::c#2 flip::r#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 17
|
||||
ldx 10
|
||||
sta 4352,x
|
||||
@ -5091,7 +5091,7 @@ flip__B3:
|
||||
ldx 12
|
||||
lda 4352,x
|
||||
sta 18
|
||||
// [37] *((word) 4096 + (byte) flip::i#2) ← (byte~) flip::$4 [ flip::i#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [37] *((word) 4096 + (byte) flip::i#2) ← (byte~) flip::$4 [ flip::i#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 18
|
||||
ldx 12
|
||||
sta 4096,x
|
||||
@ -5110,7 +5110,7 @@ prepare__B1_from_prepare:
|
||||
prepare__B1_from_B1:
|
||||
// (byte) prepare::i#2 = (byte) prepare::i#1 // register copy zp byte:13
|
||||
prepare__B1:
|
||||
// [42] *((word) 4096 + (byte) prepare::i#2) ← (byte) prepare::i#2 [ prepare::i#2 ] // ptr_cowo1_zpby1=zpby1
|
||||
// [42] *((word) 4096 + (byte) prepare::i#2) ← (byte) prepare::i#2 [ prepare::i#2 ] // cowo1_staridx_zpby1=zpby1
|
||||
ldx 13
|
||||
txa
|
||||
sta 4096,x
|
||||
@ -5279,7 +5279,7 @@ plot__B2:
|
||||
ldx 6
|
||||
lda 4096,x
|
||||
sta 16
|
||||
// [16] *((byte*) plot::line#2 + (byte) plot::x#2) ← (byte~) plot::$3 [ plot::i#2 plot::line#2 plot::x#2 plot::y#2 ] // ptr_zpptrby1_zpby1=zpby2
|
||||
// [16] *((byte*) plot::line#2 + (byte) plot::x#2) ← (byte~) plot::$3 [ plot::i#2 plot::line#2 plot::x#2 plot::y#2 ] // zpptrby1_staridx_zpby1=zpby2
|
||||
lda 16
|
||||
ldy 7
|
||||
sta (3),y
|
||||
@ -5338,7 +5338,7 @@ flip__B2:
|
||||
ldx 9
|
||||
lda 4096,x
|
||||
sta 17
|
||||
// [27] *((word) 4352 + (byte) flip::dstIdx#3) ← (byte~) flip::$0 [ flip::srcIdx#2 flip::dstIdx#3 flip::c#2 flip::r#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [27] *((word) 4352 + (byte) flip::dstIdx#3) ← (byte~) flip::$0 [ flip::srcIdx#2 flip::dstIdx#3 flip::c#2 flip::r#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 17
|
||||
ldx 10
|
||||
sta 4352,x
|
||||
@ -5373,7 +5373,7 @@ flip__B3:
|
||||
ldx 12
|
||||
lda 4352,x
|
||||
sta 18
|
||||
// [37] *((word) 4096 + (byte) flip::i#2) ← (byte~) flip::$4 [ flip::i#2 ] // ptr_cowo1_zpby1=zpby2
|
||||
// [37] *((word) 4096 + (byte) flip::i#2) ← (byte~) flip::$4 [ flip::i#2 ] // cowo1_staridx_zpby1=zpby2
|
||||
lda 18
|
||||
ldx 12
|
||||
sta 4096,x
|
||||
@ -5392,7 +5392,7 @@ prepare__B1_from_prepare:
|
||||
prepare__B1_from_B1:
|
||||
// (byte) prepare::i#2 = (byte) prepare::i#1 // register copy zp byte:13
|
||||
prepare__B1:
|
||||
// [42] *((word) 4096 + (byte) prepare::i#2) ← (byte) prepare::i#2 [ prepare::i#2 ] // ptr_cowo1_zpby1=zpby1
|
||||
// [42] *((word) 4096 + (byte) prepare::i#2) ← (byte) prepare::i#2 [ prepare::i#2 ] // cowo1_staridx_zpby1=zpby1
|
||||
ldx 13
|
||||
txa
|
||||
sta 4096,x
|
||||
|
@ -788,7 +788,7 @@ nest__B1_from_B1:
|
||||
sta 3
|
||||
jmp nest__B1
|
||||
nest__B1:
|
||||
// [7] *((word) 1024) ← (byte) nest::j#2 [ main::i#2 nest::j#2 ] // coptr1=zpby1
|
||||
// [7] *((word) 1024) ← (byte) nest::j#2 [ main::i#2 nest::j#2 ] // _star_cowo1=zpby1
|
||||
lda 3
|
||||
sta 1024
|
||||
// [8] (byte) nest::j#1 ← -- (byte) nest::j#2 [ main::i#2 nest::j#1 ] // aby=_dec_zpby1
|
||||
@ -841,7 +841,7 @@ nest__B1_from_B1:
|
||||
// (byte) nest::j#2 = (byte) nest::j#1 // zpby1=aby
|
||||
sta 3
|
||||
nest__B1:
|
||||
// [7] *((word) 1024) ← (byte) nest::j#2 [ main::i#2 nest::j#2 ] // coptr1=zpby1
|
||||
// [7] *((word) 1024) ← (byte) nest::j#2 [ main::i#2 nest::j#2 ] // _star_cowo1=zpby1
|
||||
lda 3
|
||||
sta 1024
|
||||
// [8] (byte) nest::j#1 ← -- (byte) nest::j#2 [ main::i#2 nest::j#1 ] // aby=_dec_zpby1
|
||||
@ -887,7 +887,7 @@ nest__B1_from_B1:
|
||||
// (byte) nest::j#2 = (byte) nest::j#1 // zpby1=aby
|
||||
sta 3
|
||||
nest__B1:
|
||||
// [7] *((word) 1024) ← (byte) nest::j#2 [ main::i#2 nest::j#2 ] // coptr1=zpby1
|
||||
// [7] *((word) 1024) ← (byte) nest::j#2 [ main::i#2 nest::j#2 ] // _star_cowo1=zpby1
|
||||
lda 3
|
||||
sta 1024
|
||||
// [8] (byte) nest::j#1 ← -- (byte) nest::j#2 [ main::i#2 nest::j#1 ] // aby=_dec_zpby1
|
||||
@ -952,7 +952,7 @@ nest__B1_from_B1:
|
||||
// (byte) nest::j#2 = (byte) nest::j#1 // zpby1=aby
|
||||
sta 3
|
||||
nest__B1:
|
||||
// [7] *((word) 1024) ← (byte) nest::j#2 [ main::i#2 nest::j#2 ] // coptr1=zpby1
|
||||
// [7] *((word) 1024) ← (byte) nest::j#2 [ main::i#2 nest::j#2 ] // _star_cowo1=zpby1
|
||||
lda 3
|
||||
sta 1024
|
||||
// [8] (byte) nest::j#1 ← -- (byte) nest::j#2 [ main::i#2 nest::j#1 ] // aby=_dec_zpby1
|
||||
|
@ -1986,7 +1986,7 @@ nest2__B2_from_B2:
|
||||
sta 7
|
||||
jmp nest2__B2
|
||||
nest2__B2:
|
||||
// [19] *((word) 1024) ← (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#2 nest2::i#2 ] // coptr1=zpby1
|
||||
// [19] *((word) 1024) ← (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#2 nest2::i#2 ] // _star_cowo1=zpby1
|
||||
lda 7
|
||||
sta 1024
|
||||
// [20] (byte) nest2::j#1 ← -- (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#1 nest2::i#2 ] // aby=_dec_zpby1
|
||||
@ -2109,7 +2109,7 @@ nest2__B2_from_B2:
|
||||
// (byte) nest2::j#2 = (byte) nest2::j#1 // zpby1=aby
|
||||
sta 7
|
||||
nest2__B2:
|
||||
// [19] *((word) 1024) ← (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#2 nest2::i#2 ] // coptr1=zpby1
|
||||
// [19] *((word) 1024) ← (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#2 nest2::i#2 ] // _star_cowo1=zpby1
|
||||
lda 7
|
||||
sta 1024
|
||||
// [20] (byte) nest2::j#1 ← -- (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#1 nest2::i#2 ] // aby=_dec_zpby1
|
||||
@ -2215,7 +2215,7 @@ nest2__B2_from_B2:
|
||||
// (byte) nest2::j#2 = (byte) nest2::j#1 // zpby1=aby
|
||||
sta 7
|
||||
nest2__B2:
|
||||
// [19] *((word) 1024) ← (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#2 nest2::i#2 ] // coptr1=zpby1
|
||||
// [19] *((word) 1024) ← (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#2 nest2::i#2 ] // _star_cowo1=zpby1
|
||||
lda 7
|
||||
sta 1024
|
||||
// [20] (byte) nest2::j#1 ← -- (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#1 nest2::i#2 ] // aby=_dec_zpby1
|
||||
@ -2362,7 +2362,7 @@ nest2__B2_from_B2:
|
||||
// (byte) nest2::j#2 = (byte) nest2::j#1 // zpby1=aby
|
||||
sta 7
|
||||
nest2__B2:
|
||||
// [19] *((word) 1024) ← (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#2 nest2::i#2 ] // coptr1=zpby1
|
||||
// [19] *((word) 1024) ← (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#2 nest2::i#2 ] // _star_cowo1=zpby1
|
||||
lda 7
|
||||
sta 1024
|
||||
// [20] (byte) nest2::j#1 ← -- (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#1 nest2::i#2 ] // aby=_dec_zpby1
|
||||
|
@ -339,7 +339,7 @@ B1:
|
||||
lda 2
|
||||
clc
|
||||
adc #4
|
||||
// [2] *((word) 4352 + (byte) i#2) ← (byte~) $1 [ i#2 ] // ptr_cowo1_zpby1=aby
|
||||
// [2] *((word) 4352 + (byte) i#2) ← (byte~) $1 [ i#2 ] // cowo1_staridx_zpby1=aby
|
||||
ldx 2
|
||||
sta 4352,x
|
||||
// [3] (byte) i#1 ← (byte) i#2 + (byte) 1 [ i#1 ] // zpby1=zpby1_plus_1
|
||||
@ -368,7 +368,7 @@ B1:
|
||||
lda 2
|
||||
clc
|
||||
adc #4
|
||||
// [2] *((word) 4352 + (byte) i#2) ← (byte~) $1 [ i#2 ] // ptr_cowo1_zpby1=aby
|
||||
// [2] *((word) 4352 + (byte) i#2) ← (byte~) $1 [ i#2 ] // cowo1_staridx_zpby1=aby
|
||||
ldx 2
|
||||
sta 4352,x
|
||||
// [3] (byte) i#1 ← (byte) i#2 + (byte) 1 [ i#1 ] // zpby1=zpby1_plus_1
|
||||
@ -394,7 +394,7 @@ B1:
|
||||
lda 2
|
||||
clc
|
||||
adc #4
|
||||
// [2] *((word) 4352 + (byte) i#2) ← (byte~) $1 [ i#2 ] // ptr_cowo1_zpby1=aby
|
||||
// [2] *((word) 4352 + (byte) i#2) ← (byte~) $1 [ i#2 ] // cowo1_staridx_zpby1=aby
|
||||
ldx 2
|
||||
sta 4352,x
|
||||
// [3] (byte) i#1 ← (byte) i#2 + (byte) 1 [ i#1 ] // zpby1=zpby1_plus_1
|
||||
@ -431,7 +431,7 @@ B1:
|
||||
lda 2
|
||||
clc
|
||||
adc #4
|
||||
// [2] *((word) 4352 + (byte) i#2) ← (byte~) $1 [ i#2 ] // ptr_cowo1_zpby1=aby
|
||||
// [2] *((word) 4352 + (byte) i#2) ← (byte~) $1 [ i#2 ] // cowo1_staridx_zpby1=aby
|
||||
ldx 2
|
||||
sta 4352,x
|
||||
// [3] (byte) i#1 ← (byte) i#2 + (byte) 1 [ i#1 ] // zpby1=zpby1_plus_1
|
||||
|
@ -1990,7 +1990,7 @@ lvaluevar__B1:
|
||||
lvaluevar__Breturn:
|
||||
rts
|
||||
lvaluevar__B2:
|
||||
// [9] *((byte*) lvaluevar::screen#2) ← (byte) 4 [ lvaluevar::i#2 lvaluevar::screen#2 ] // zpiby1=coby1
|
||||
// [9] *((byte*) lvaluevar::screen#2) ← (byte) 4 [ lvaluevar::i#2 lvaluevar::screen#2 ] // _star_zpptrby1=coby1
|
||||
ldy #0
|
||||
lda #4
|
||||
sta (3),y
|
||||
@ -2070,10 +2070,10 @@ rvalue__B1_from_B2:
|
||||
// (byte) rvalue::i#2 = (byte) rvalue::i#1 // register copy zp byte:8
|
||||
jmp rvalue__B1
|
||||
lvalue:
|
||||
// [25] *((word) 1024) ← (byte) 1 [ ] // coptr1=coby2
|
||||
// [25] *((word) 1024) ← (byte) 1 [ ] // _star_cowo1=coby2
|
||||
lda #1
|
||||
sta 1024
|
||||
// [26] *((word) 1025) ← (byte) 2 [ ] // coptr1=coby2
|
||||
// [26] *((word) 1025) ← (byte) 2 [ ] // _star_cowo1=coby2
|
||||
lda #2
|
||||
sta 1025
|
||||
lvalue__B1_from_lvalue:
|
||||
@ -2090,7 +2090,7 @@ lvalue__B1:
|
||||
lvalue__Breturn:
|
||||
rts
|
||||
lvalue__B2:
|
||||
// [30] *((word) 1024 + (byte) lvalue::i#2) ← (byte) 3 [ lvalue::i#2 ] // ptr_cowo1_zpby1=coby2
|
||||
// [30] *((word) 1024 + (byte) lvalue::i#2) ← (byte) 3 [ lvalue::i#2 ] // cowo1_staridx_zpby1=coby2
|
||||
lda #3
|
||||
ldx 9
|
||||
sta 1024,x
|
||||
@ -2146,7 +2146,7 @@ lvaluevar__B1:
|
||||
lvaluevar__Breturn:
|
||||
rts
|
||||
lvaluevar__B2:
|
||||
// [9] *((byte*) lvaluevar::screen#2) ← (byte) 4 [ lvaluevar::i#2 lvaluevar::screen#2 ] // zpiby1=coby1
|
||||
// [9] *((byte*) lvaluevar::screen#2) ← (byte) 4 [ lvaluevar::i#2 lvaluevar::screen#2 ] // _star_zpptrby1=coby1
|
||||
ldy #0
|
||||
lda #4
|
||||
sta (3),y
|
||||
@ -2222,10 +2222,10 @@ rvalue__B1_from_B2:
|
||||
// (byte) rvalue::i#2 = (byte) rvalue::i#1 // register copy zp byte:8
|
||||
jmp rvalue__B1
|
||||
lvalue:
|
||||
// [25] *((word) 1024) ← (byte) 1 [ ] // coptr1=coby2
|
||||
// [25] *((word) 1024) ← (byte) 1 [ ] // _star_cowo1=coby2
|
||||
lda #1
|
||||
sta 1024
|
||||
// [26] *((word) 1025) ← (byte) 2 [ ] // coptr1=coby2
|
||||
// [26] *((word) 1025) ← (byte) 2 [ ] // _star_cowo1=coby2
|
||||
lda #2
|
||||
sta 1025
|
||||
lvalue__B1_from_lvalue:
|
||||
@ -2240,7 +2240,7 @@ lvalue__B1:
|
||||
lvalue__Breturn:
|
||||
rts
|
||||
lvalue__B2:
|
||||
// [30] *((word) 1024 + (byte) lvalue::i#2) ← (byte) 3 [ lvalue::i#2 ] // ptr_cowo1_zpby1=coby2
|
||||
// [30] *((word) 1024 + (byte) lvalue::i#2) ← (byte) 3 [ lvalue::i#2 ] // cowo1_staridx_zpby1=coby2
|
||||
lda #3
|
||||
ldx 9
|
||||
sta 1024,x
|
||||
@ -2337,7 +2337,7 @@ lvaluevar__B1:
|
||||
lvaluevar__Breturn:
|
||||
rts
|
||||
lvaluevar__B2:
|
||||
// [9] *((byte*) lvaluevar::screen#2) ← (byte) 4 [ lvaluevar::i#2 lvaluevar::screen#2 ] // zpiby1=coby1
|
||||
// [9] *((byte*) lvaluevar::screen#2) ← (byte) 4 [ lvaluevar::i#2 lvaluevar::screen#2 ] // _star_zpptrby1=coby1
|
||||
ldy #0
|
||||
lda #4
|
||||
sta (3),y
|
||||
@ -2413,10 +2413,10 @@ rvalue__B1_from_B2:
|
||||
// (byte) rvalue::i#2 = (byte) rvalue::i#1 // register copy zp byte:8
|
||||
jmp rvalue__B1
|
||||
lvalue:
|
||||
// [25] *((word) 1024) ← (byte) 1 [ ] // coptr1=coby2
|
||||
// [25] *((word) 1024) ← (byte) 1 [ ] // _star_cowo1=coby2
|
||||
lda #1
|
||||
sta 1024
|
||||
// [26] *((word) 1025) ← (byte) 2 [ ] // coptr1=coby2
|
||||
// [26] *((word) 1025) ← (byte) 2 [ ] // _star_cowo1=coby2
|
||||
lda #2
|
||||
sta 1025
|
||||
lvalue__B1_from_lvalue:
|
||||
@ -2431,7 +2431,7 @@ lvalue__B1:
|
||||
lvalue__Breturn:
|
||||
rts
|
||||
lvalue__B2:
|
||||
// [30] *((word) 1024 + (byte) lvalue::i#2) ← (byte) 3 [ lvalue::i#2 ] // ptr_cowo1_zpby1=coby2
|
||||
// [30] *((word) 1024 + (byte) lvalue::i#2) ← (byte) 3 [ lvalue::i#2 ] // cowo1_staridx_zpby1=coby2
|
||||
lda #3
|
||||
ldx 9
|
||||
sta 1024,x
|
||||
|
Loading…
Reference in New Issue
Block a user