1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-01-14 09:30:57 +00:00

Fixed test data with ASM optimization.

This commit is contained in:
jespergravgaard 2019-12-08 15:21:23 +01:00
parent ad28ad18f9
commit cd62004812
6 changed files with 35 additions and 35 deletions

View File

@ -501,8 +501,8 @@ getCharToProcess: {
__b1:
ldy #0
__b2:
lda (screen_line),y
cmp #' '
lda #' '
cmp (screen_line),y
bne !__b11+
jmp __b11
!__b11:
@ -1027,9 +1027,9 @@ processChars: {
bne !-
!e:
sta.z bitmask
lda #STATUS_FREE
ldy #OFFSET_STRUCT_PROCESSINGSPRITE_STATUS
lda (processing),y
cmp #STATUS_FREE
cmp (processing),y
bne !__b2+
jmp __b2
!__b2:

View File

@ -5641,9 +5641,9 @@ getCharToProcess: {
// getCharToProcess::@2
__b2:
// [122] if(*((byte*) getCharToProcess::screen_line#4 + (byte) getCharToProcess::x#2)==(byte) ' ') goto getCharToProcess::@11 -- pbuz1_derefidx_vbuz2_eq_vbuc1_then_la1
lda #' '
ldy.z x
lda (screen_line),y
cmp #' '
cmp (screen_line),y
beq __b11
jmp __b4
// getCharToProcess::@4
@ -6622,9 +6622,9 @@ processChars: {
!e:
sta.z bitmask
// [263] if(*((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS)==(const byte) STATUS_FREE) goto processChars::@2 -- pbuz1_derefidx_vbuc1_eq_vbuc2_then_la1
lda #STATUS_FREE
ldy #OFFSET_STRUCT_PROCESSINGSPRITE_STATUS
lda (processing),y
cmp #STATUS_FREE
cmp (processing),y
beq __b2_from___b1
jmp __b10
// processChars::@10
@ -8567,8 +8567,8 @@ getCharToProcess: {
// getCharToProcess::@2
__b2:
// [122] if(*((byte*) getCharToProcess::screen_line#4 + (byte) getCharToProcess::x#2)==(byte) ' ') goto getCharToProcess::@11 -- pbuz1_derefidx_vbuyy_eq_vbuc1_then_la1
lda (screen_line),y
cmp #' '
lda #' '
cmp (screen_line),y
beq __b11
jmp __b4
// getCharToProcess::@4
@ -9456,9 +9456,9 @@ processChars: {
!e:
sta.z bitmask
// [263] if(*((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS)==(const byte) STATUS_FREE) goto processChars::@2 -- pbuz1_derefidx_vbuc1_eq_vbuc2_then_la1
lda #STATUS_FREE
ldy #OFFSET_STRUCT_PROCESSINGSPRITE_STATUS
lda (processing),y
cmp #STATUS_FREE
cmp (processing),y
beq __b2_from___b1
jmp __b10
// processChars::@10
@ -11394,8 +11394,8 @@ getCharToProcess: {
__b2:
// if(screen_line[x]!=' ')
// [122] if(*((byte*) getCharToProcess::screen_line#4 + (byte) getCharToProcess::x#2)==(byte) ' ') goto getCharToProcess::@11 -- pbuz1_derefidx_vbuyy_eq_vbuc1_then_la1
lda (screen_line),y
cmp #' '
lda #' '
cmp (screen_line),y
bne !__b11+
jmp __b11
!__b11:
@ -12269,9 +12269,9 @@ processChars: {
sta.z bitmask
// if(processing->status!=STATUS_FREE)
// [263] if(*((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS)==(const byte) STATUS_FREE) goto processChars::@2 -- pbuz1_derefidx_vbuc1_eq_vbuc2_then_la1
lda #STATUS_FREE
ldy #OFFSET_STRUCT_PROCESSINGSPRITE_STATUS
lda (processing),y
cmp #STATUS_FREE
cmp (processing),y
bne !__b2+
jmp __b2
!__b2:

View File

@ -26,10 +26,9 @@ main: {
b1:
ldy #0
__b3:
lda (line),y
cmp #'a'
beq __b5
lda #'a'
cmp (line),y
beq __b5
sta (line),y
iny
cpy #$28

View File

@ -296,9 +296,9 @@ main: {
// main::@3
__b3:
// [10] if(*((byte*) main::line#2 + (byte) main::i#2)==(byte) 'a') goto main::@5 -- pbuz1_derefidx_vbuz2_eq_vbuc1_then_la1
lda #'a'
ldy.z i
lda (line),y
cmp #'a'
cmp (line),y
beq __b5
jmp __b4
// main::@4
@ -424,8 +424,8 @@ main: {
// main::@3
__b3:
// [10] if(*((byte*) main::line#2 + (byte) main::i#2)==(byte) 'a') goto main::@5 -- pbuz1_derefidx_vbuyy_eq_vbuc1_then_la1
lda (line),y
cmp #'a'
lda #'a'
cmp (line),y
beq __b5
jmp __b4
// main::@4
@ -487,6 +487,8 @@ Relabelling long label __b3_from___b2 to b1
Succesful ASM optimization Pass5RelabelLongLabels
Removing instruction jmp __b3
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction lda #'a'
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination
@ -513,7 +515,7 @@ reg byte y [ main::i#2 main::i#1 ]
FINAL ASSEMBLER
Score: 3256
Score: 3056
// File Comments
// Tests break statement in a simple loop
@ -572,13 +574,12 @@ main: {
__b3:
// if(line[i]=='a')
// [10] if(*((byte*) main::line#2 + (byte) main::i#2)==(byte) 'a') goto main::@5 -- pbuz1_derefidx_vbuyy_eq_vbuc1_then_la1
lda (line),y
cmp #'a'
lda #'a'
cmp (line),y
beq __b5
// main::@4
// line[i] = 'a'
// [11] *((byte*) main::line#2 + (byte) main::i#2) ← (byte) 'a' -- pbuz1_derefidx_vbuyy=vbuc1
lda #'a'
sta (line),y
// for( byte i: 0..39)
// [12] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuyy=_inc_vbuyy

View File

@ -159,8 +159,8 @@ textbox: {
iny
ldx #0
__b3:
lda (text),y
cmp #$20
lda #$20
cmp (text),y
beq __b5
lda (text),y
cmp #0

View File

@ -2336,9 +2336,9 @@ textbox: {
// textbox::@3
__b3:
// [44] if(*((byte*) textbox::text#12 + (byte) textbox::ls#2)==(byte) $20) goto textbox::@5 -- pbuz1_derefidx_vbuz2_eq_vbuc1_then_la1
lda #$20
ldy.z ls
lda (text),y
cmp #$20
cmp (text),y
beq __b5
jmp __b14
// textbox::@14
@ -3652,8 +3652,8 @@ textbox: {
// textbox::@3
__b3:
// [44] if(*((byte*) textbox::text#12 + (byte) textbox::ls#2)==(byte) $20) goto textbox::@5 -- pbuz1_derefidx_vbuyy_eq_vbuc1_then_la1
lda (text),y
cmp #$20
lda #$20
cmp (text),y
beq __b5
jmp __b14
// textbox::@14
@ -4825,8 +4825,8 @@ textbox: {
__b3:
// while (text[ls] != $20 && text[ls] != $00)
// [44] if(*((byte*) textbox::text#12 + (byte) textbox::ls#2)==(byte) $20) goto textbox::@5 -- pbuz1_derefidx_vbuyy_eq_vbuc1_then_la1
lda (text),y
cmp #$20
lda #$20
cmp (text),y
beq __b5
// textbox::@14
// [45] if(*((byte*) textbox::text#12 + (byte) textbox::ls#2)!=(byte) 0) goto textbox::@4 -- pbuz1_derefidx_vbuyy_neq_0_then_la1