1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-20 02:32:36 +00:00

Fixed tests. Fixed struct-member modify-assignments.

This commit is contained in:
jespergravgaard 2019-06-15 19:17:55 +02:00
parent be7686c954
commit 8778b9a986
22 changed files with 677 additions and 38197 deletions

View File

@ -0,0 +1,9 @@
ldy #0
lda ({z1}),y
sec
sbc #<{c1}
sta ({z1}),y
iny
lda ({z1}),y
sbc #>{c1}
sta ({z1}),y

View File

@ -0,0 +1,8 @@
lda ({z1}),y
sec
sbc #<{c1}
sta ({z1}),y
iny
lda ({z1}),y
sbc #>{c1}
sta ({z1}),y

View File

@ -1313,9 +1313,11 @@ public class Pass0GenerateStatementSequence extends KickCBaseVisitor<Object> {
} else if(lValue instanceof LvalueIntermediate) {
return new LvalueIntermediate((VariableRef) copyLValue(((LvalueIntermediate) lValue).getVariable()));
} else if(lValue instanceof PointerDereferenceSimple) {
return new PointerDereferenceSimple(((PointerDereferenceSimple) lValue).getPointer());
return new PointerDereferenceSimple(copyLValue((LValue) ((PointerDereferenceSimple) lValue).getPointer()));
} else if(lValue instanceof PointerDereferenceIndexed) {
return new PointerDereferenceIndexed(((PointerDereferenceIndexed) lValue).getPointer(), ((PointerDereferenceIndexed) lValue).getIndex());
} else if(lValue instanceof StructMemberRef) {
return new StructMemberRef(copyLValue((LValue) ((StructMemberRef) lValue).getStruct()), ((StructMemberRef) lValue).getMemberName());
} else {
throw new CompileError("Unknown LValue type " + lValue);
}

View File

@ -47,7 +47,7 @@ public class TestPrograms {
@Test
public void testBlackhole() throws IOException, URISyntaxException {
compileAndCompare("complex/blackhole/blackhole", log().verboseFragmentLog());
compileAndCompare("complex/blackhole/blackhole", log());
}
// TODO: Optimize unused IRQ's away (and other unused funtions that reference each other circularly)
@ -68,6 +68,11 @@ public class TestPrograms {
compileAndCompare("textbox");
}
@Test
public void testStructPtr13() throws IOException, URISyntaxException {
compileAndCompare("struct-ptr-13");
}
/* TODO: Implement address-of (&) for struct values
@Test
public void testStructPtr12Ref() throws IOException, URISyntaxException {

View File

@ -172,8 +172,8 @@ void processChars() {
// Disable the sprite
*SPRITES_ENABLE &= 0xff ^ bitmask;
} else {
processing->y = processing->y - 16;
processing->x = processing->x - 16;
processing->y -= 16;
processing->x -= 16;
}
numActive++;
}

View File

@ -0,0 +1,17 @@
// Minimal struct - modifying pointer to struct in memory using arrow operator
struct Point {
byte x;
byte y;
};
struct Point* points = 0x1000;
void main() {
points->x += 5;
points->y += 5;
const byte* SCREEN = 0x0400;
SCREEN[0] = points->x;
SCREEN[1] = points->y;
}

View File

@ -758,8 +758,6 @@ irqBottom: {
// Process any chars in the PROCESSING array
processChars: {
.label _17 = $35
.label _22 = $37
.label _23 = $39
.label processing = $30
.label bitmask = $32
.label i = $1d
@ -903,31 +901,19 @@ processChars: {
lda (processing),y
sec
sbc #<$10
sta _22
sta (processing),y
iny
lda (processing),y
sbc #>$10
sta _22+1
ldy #OFFSET_STRUCT_PROCESSINGSPRITE_Y
lda _22
sta (processing),y
iny
lda _22+1
sta (processing),y
ldy #0
lda (processing),y
sec
sbc #<$10
sta _23
sta (processing),y
iny
lda (processing),y
sbc #>$10
sta _23+1
ldy #0
lda _23
sta (processing),y
iny
lda _23+1
sta (processing),y
b7:
inc numActive

View File

@ -352,9 +352,9 @@ processChars: scope:[processChars] from irqBottom::@2
processChars::@1: scope:[processChars] from processChars processChars::@2
[197] (byte) processChars::numActive#10 ← phi( processChars/(byte) 0 processChars::@2/(byte) processChars::numActive#3 )
[197] (byte) processChars::i#10 ← phi( processChars/(byte) 0 processChars::@2/(byte) processChars::i#1 )
[198] (byte) processChars::$44 ← (byte) processChars::i#10 << (byte) 3
[199] (byte~) processChars::$26 ← (byte) processChars::$44 + (byte) processChars::i#10
[200] (struct ProcessingSprite*) processChars::processing#0 ← (const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0 + (byte~) processChars::$26
[198] (byte) processChars::$42 ← (byte) processChars::i#10 << (byte) 3
[199] (byte~) processChars::$24 ← (byte) processChars::$42 + (byte) processChars::i#10
[200] (struct ProcessingSprite*) processChars::processing#0 ← (const struct ProcessingSprite[NUM_PROCESSING#0]) PROCESSING#0 + (byte~) processChars::$24
[201] (byte) processChars::bitmask#0 ← (byte) 1 << *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_ID)
[202] if(*((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS)==(const byte) STATUS_FREE#0) goto processChars::@2
to:processChars::@10
@ -389,58 +389,56 @@ processChars::@13: scope:[processChars] from processChars::@5
[220] if(*((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y)<(const word) YPOS_UPMOST#0) goto processChars::@6
to:processChars::@9
processChars::@9: scope:[processChars] from processChars::@13
[221] (word~) processChars::$22 ← *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y) - (byte) $10
[222] *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y) ← (word~) processChars::$22
[223] (word~) processChars::$23 ← *((word*)(struct ProcessingSprite*) processChars::processing#0) - (byte) $10
[224] *((word*)(struct ProcessingSprite*) processChars::processing#0) ← (word~) processChars::$23
[221] *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y) ← *((word*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y) - (byte) $10
[222] *((word*)(struct ProcessingSprite*) processChars::processing#0) ← *((word*)(struct ProcessingSprite*) processChars::processing#0) - (byte) $10
to:processChars::@7
processChars::@7: scope:[processChars] from processChars::@6 processChars::@9
[225] (byte) processChars::numActive#1 ← ++ (byte) processChars::numActive#10
[223] (byte) processChars::numActive#1 ← ++ (byte) processChars::numActive#10
to:processChars::@2
processChars::@2: scope:[processChars] from processChars::@1 processChars::@7
[226] (byte) processChars::numActive#3 ← phi( processChars::@1/(byte) processChars::numActive#10 processChars::@7/(byte) processChars::numActive#1 )
[227] (byte) processChars::i#1 ← ++ (byte) processChars::i#10
[228] if((byte) processChars::i#1!=(const byte) NUM_PROCESSING#0-(byte) 1+(byte) 1) goto processChars::@1
[224] (byte) processChars::numActive#3 ← phi( processChars::@1/(byte) processChars::numActive#10 processChars::@7/(byte) processChars::numActive#1 )
[225] (byte) processChars::i#1 ← ++ (byte) processChars::i#10
[226] if((byte) processChars::i#1!=(const byte) NUM_PROCESSING#0-(byte) 1+(byte) 1) goto processChars::@1
to:processChars::@12
processChars::@12: scope:[processChars] from processChars::@2
[229] (byte~) processChars::$1 ← (byte) '0' + (byte) processChars::numActive#3
[230] *((const byte*) SCREEN#0+(word) $3e7) ← (byte~) processChars::$1
[227] (byte~) processChars::$1 ← (byte) '0' + (byte) processChars::numActive#3
[228] *((const byte*) SCREEN#0+(word) $3e7) ← (byte~) processChars::$1
to:processChars::@return
processChars::@return: scope:[processChars] from processChars::@12
[231] return
[229] return
to:@return
processChars::@6: scope:[processChars] from processChars::@13 processChars::@5
[232] *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS) ← (const byte) STATUS_FREE#0
[233] (byte~) processChars::$24 ← (byte) $ff ^ (byte) processChars::bitmask#0
[234] *((const byte*) SPRITES_ENABLE#0) ← *((const byte*) SPRITES_ENABLE#0) & (byte~) processChars::$24
[230] *((byte*)(struct ProcessingSprite*) processChars::processing#0 + (const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS) ← (const byte) STATUS_FREE#0
[231] (byte~) processChars::$22 ← (byte) $ff ^ (byte) processChars::bitmask#0
[232] *((const byte*) SPRITES_ENABLE#0) ← *((const byte*) SPRITES_ENABLE#0) & (byte~) processChars::$22
to:processChars::@7
processChars::@4: scope:[processChars] from processChars::@3
[235] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) processChars::bitmask#0
[233] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) processChars::bitmask#0
to:processChars::@5
irqTop: scope:[irqTop] from
[236] phi()
[234] phi()
to:irqTop::@1
irqTop::@1: scope:[irqTop] from irqTop irqTop::@1
[237] (byte) irqTop::i#2 ← phi( irqTop/(byte) 0 irqTop::@1/(byte) irqTop::i#1 )
[238] (byte) irqTop::i#1 ← ++ (byte) irqTop::i#2
[239] if((byte) irqTop::i#1!=(byte) 5) goto irqTop::@1
[235] (byte) irqTop::i#2 ← phi( irqTop/(byte) 0 irqTop::@1/(byte) irqTop::i#1 )
[236] (byte) irqTop::i#1 ← ++ (byte) irqTop::i#2
[237] if((byte) irqTop::i#1!=(byte) 5) goto irqTop::@1
to:irqTop::@2
irqTop::@2: scope:[irqTop] from irqTop::@1
[240] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0
[241] *((const byte*) BGCOL#0) ← (const byte) WHITE#0
[238] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0
[239] *((const byte*) BGCOL#0) ← (const byte) WHITE#0
to:irqTop::@3
irqTop::@3: scope:[irqTop] from irqTop::@2 irqTop::@3
[242] (byte) irqTop::i1#2 ← phi( irqTop::@2/(byte) 0 irqTop::@3/(byte) irqTop::i1#1 )
[243] (byte) irqTop::i1#1 ← ++ (byte) irqTop::i1#2
[244] if((byte) irqTop::i1#1!=(byte) 8) goto irqTop::@3
[240] (byte) irqTop::i1#2 ← phi( irqTop::@2/(byte) 0 irqTop::@3/(byte) irqTop::i1#1 )
[241] (byte) irqTop::i1#1 ← ++ (byte) irqTop::i1#2
[242] if((byte) irqTop::i1#1!=(byte) 8) goto irqTop::@3
to:irqTop::@4
irqTop::@4: scope:[irqTop] from irqTop::@3
[245] *((const byte*) BORDERCOL#0) ← (const byte) LIGHT_BLUE#0
[246] *((const byte*) BGCOL#0) ← (const byte) BLUE#0
[247] *((const byte*) RASTER#0) ← (const byte) RASTER_IRQ_MIDDLE#0
[248] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_ALL)(void()) irqBottom()
[249] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
[243] *((const byte*) BORDERCOL#0) ← (const byte) LIGHT_BLUE#0
[244] *((const byte*) BGCOL#0) ← (const byte) BLUE#0
[245] *((const byte*) RASTER#0) ← (const byte) RASTER_IRQ_MIDDLE#0
[246] *((const void()**) HARDWARE_IRQ#0) ← &interrupt(HARDWARE_ALL)(void()) irqBottom()
[247] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0
to:irqTop::@return
irqTop::@return: scope:[irqTop] from irqTop::@4
[250] return
[248] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -289,11 +289,9 @@ interrupt(HARDWARE_ALL)(void()) irqTop()
(byte~) processChars::$16 reg byte x 6.6000000000000005
(word~) processChars::$17 $17 zp ZP_WORD:53 11.0
(byte~) processChars::$18 reg byte a 22.0
(word~) processChars::$22 $22 zp ZP_WORD:55 22.0
(word~) processChars::$23 $23 zp ZP_WORD:57 22.0
(byte~) processChars::$22 reg byte a 22.0
(byte~) processChars::$24 reg byte a 22.0
(byte~) processChars::$26 reg byte a 22.0
(byte) processChars::$44 reg byte a 22.0
(byte) processChars::$42 reg byte a 22.0
(label) processChars::@1
(label) processChars::@10
(label) processChars::@11
@ -312,13 +310,13 @@ interrupt(HARDWARE_ALL)(void()) irqTop()
(byte) processChars::bitmask#0 bitmask zp ZP_BYTE:50 2.5
(byte) processChars::i
(byte) processChars::i#1 i zp ZP_BYTE:29 16.5
(byte) processChars::i#10 i zp ZP_BYTE:29 1.6176470588235294
(byte) processChars::i#10 i zp ZP_BYTE:29 1.71875
(byte) processChars::numActive
(byte) processChars::numActive#1 numActive zp ZP_BYTE:30 22.0
(byte) processChars::numActive#10 numActive zp ZP_BYTE:30 1.03125
(byte) processChars::numActive#10 numActive zp ZP_BYTE:30 1.0999999999999999
(byte) processChars::numActive#3 numActive zp ZP_BYTE:30 11.666666666666666
(struct ProcessingSprite*) processChars::processing
(struct ProcessingSprite*) processChars::processing#0 processing zp ZP_WORD:48 0.44
(struct ProcessingSprite*) processChars::processing#0 processing zp ZP_WORD:48 0.4782608695652174
(word) processChars::xpos
(word) processChars::xpos#0 xpos zp ZP_WORD:51 3.142857142857143
(void()) setupRasterIrq((word) setupRasterIrq::raster , (void()*) setupRasterIrq::irqRoutine)
@ -452,8 +450,8 @@ zp ZP_WORD:46 [ getCharToProcess::$15 ]
reg byte a [ initSquareTables::$16 ]
reg byte a [ initSquareTables::$17 ]
reg byte a [ mul8u::$1 ]
reg byte a [ processChars::$44 ]
reg byte a [ processChars::$26 ]
reg byte a [ processChars::$42 ]
reg byte a [ processChars::$24 ]
zp ZP_WORD:48 [ processChars::processing#0 ]
zp ZP_BYTE:50 [ processChars::bitmask#0 ]
zp ZP_WORD:51 [ processChars::xpos#0 ]
@ -463,7 +461,5 @@ reg byte x [ processChars::$16 ]
reg byte a [ processChars::$15 ]
zp ZP_WORD:53 [ processChars::$17 ]
reg byte a [ processChars::$18 ]
zp ZP_WORD:55 [ processChars::$22 ]
zp ZP_WORD:57 [ processChars::$23 ]
reg byte x [ processChars::$1 ]
reg byte a [ processChars::$24 ]
reg byte a [ processChars::$22 ]

View File

@ -567,12 +567,14 @@ sin16s: {
sta mulu16_sel.v2+1
ldx #0
jsr mulu16_sel
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lda usinx
clc
adc x5_128

View File

@ -7483,12 +7483,14 @@ sin16s: {
b11:
//SEG327 [169] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
//SEG328 [170] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
//SEG329 [171] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0 -- vwuz1=vwuz1_plus_vwuz2
lda usinx
clc
@ -8501,7 +8503,7 @@ zp ZP_WORD:62 [ fill::end#0 ]
FINAL ASSEMBLER
Score: 44230
Score: 44254
//SEG0 File Comments
//SEG1 Basic Upstart
@ -9401,12 +9403,14 @@ sin16s: {
//SEG326 sin16s::@11
//SEG327 [169] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
//SEG328 [170] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
//SEG329 [171] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0 -- vwuz1=vwuz1_plus_vwuz2
lda usinx
clc

View File

@ -560,12 +560,14 @@ sin16s: {
sta mulu16_sel.v2+1
ldx #0
jsr mulu16_sel
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lda usinx
clc
adc x5_128

View File

@ -6972,12 +6972,14 @@ sin16s: {
b11:
//SEG271 [142] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
//SEG272 [143] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
//SEG273 [144] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0 -- vwuz1=vwuz1_plus_vwuz2
lda usinx
clc
@ -8213,7 +8215,7 @@ reg byte a [ bitmap_init::$6 ]
FINAL ASSEMBLER
Score: 28528
Score: 28552
//SEG0 File Comments
// Generate a big sinus and plot it on a bitmap
@ -9050,12 +9052,14 @@ sin16s: {
//SEG270 sin16s::@11
//SEG271 [142] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
//SEG272 [143] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
//SEG273 [144] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0 -- vwuz1=vwuz1_plus_vwuz2
lda usinx
clc

View File

@ -630,12 +630,14 @@ div10: {
lda val_3+1
adc val_2+1
sta val_3+1
ldy #4
!:
lsr return+1
ror return
dey
bne !-
lsr return+1
ror return
lsr return+1
ror return
lsr return+1
ror return
rts
}
// Performs division on two 16 bit unsigned words

View File

@ -7494,12 +7494,14 @@ div10: {
adc val_2+1
sta val_3+1
//SEG420 [190] (word) div10::return#0 ← (word) div10::val#3 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr return+1
ror return
dey
bne !-
lsr return+1
ror return
lsr return+1
ror return
lsr return+1
ror return
jmp breturn
//SEG421 div10::@return
breturn:
@ -8276,7 +8278,7 @@ reg byte a [ divr16u::$2 ]
FINAL ASSEMBLER
Score: 354913
Score: 354937
//SEG0 File Comments
//SEG1 Basic Upstart
@ -9331,12 +9333,14 @@ div10: {
adc val_2+1
sta val_3+1
//SEG420 [190] (word) div10::return#0 ← (word) div10::val#3 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr return+1
ror return
dey
bne !-
lsr return+1
ror return
lsr return+1
ror return
lsr return+1
ror return
//SEG421 div10::@return
//SEG422 [191] return
rts

View File

@ -395,12 +395,14 @@ sin16s: {
sta mulu16_sel.v2+1
ldx #0
jsr mulu16_sel
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lda usinx
clc
adc x5_128

View File

@ -4875,12 +4875,14 @@ sin16s: {
b11:
//SEG218 [105] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
//SEG219 [106] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
//SEG220 [107] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0 -- vwuz1=vwuz1_plus_vwuz2
lda usinx
clc
@ -5718,7 +5720,7 @@ reg byte a [ divr16u::$2 ]
FINAL ASSEMBLER
Score: 22841
Score: 22865
//SEG0 File Comments
// Generates a 16-bit signed sinus
@ -6337,12 +6339,14 @@ sin16s: {
//SEG217 sin16s::@11
//SEG218 [105] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
//SEG219 [106] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
//SEG220 [107] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0 -- vwuz1=vwuz1_plus_vwuz2
lda usinx
clc

View File

@ -375,12 +375,14 @@ sin16sb: {
sta mulu16_sel.v2+1
ldx #0
jsr mulu16_sel
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lda usinx
clc
adc x5_128
@ -802,12 +804,14 @@ sin16s: {
sta mulu16_sel.v2+1
ldx #0
jsr mulu16_sel
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lda usinx
clc
adc x5_128

View File

@ -6384,12 +6384,14 @@ sin16sb: {
b11:
//SEG227 [108] (word) sin16sb::x5#0 ← (word) mulu16_sel::return#11
//SEG228 [109] (word) sin16sb::x5_128#0 ← (word) sin16sb::x5#0 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
//SEG229 [110] (word) sin16sb::usinx#1 ← (word) sin16sb::usinx#0 + (word) sin16sb::x5_128#0 -- vwuz1=vwuz1_plus_vwuz2
lda usinx
clc
@ -7101,12 +7103,14 @@ sin16s: {
b11:
//SEG426 [210] (word) sin16s::x5#0 ← (word) mulu16_sel::return#16
//SEG427 [211] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
//SEG428 [212] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0 -- vwuz1=vwuz1_plus_vwuz2
lda usinx
clc
@ -7792,7 +7796,7 @@ zp ZP_WORD:71 [ sin16s::x1#0 ]
FINAL ASSEMBLER
Score: 25105
Score: 25153
//SEG0 File Comments
// Generates a 16-bit signed sinus
@ -8400,12 +8404,14 @@ sin16sb: {
//SEG226 sin16sb::@11
//SEG227 [108] (word) sin16sb::x5#0 ← (word) mulu16_sel::return#11
//SEG228 [109] (word) sin16sb::x5_128#0 ← (word) sin16sb::x5#0 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
//SEG229 [110] (word) sin16sb::usinx#1 ← (word) sin16sb::usinx#0 + (word) sin16sb::x5_128#0 -- vwuz1=vwuz1_plus_vwuz2
lda usinx
clc
@ -9026,12 +9032,14 @@ sin16s: {
//SEG425 sin16s::@11
//SEG426 [210] (word) sin16s::x5#0 ← (word) mulu16_sel::return#16
//SEG427 [211] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
//SEG428 [212] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0 -- vwuz1=vwuz1_plus_vwuz2
lda usinx
clc

View File

@ -391,12 +391,14 @@ sin16s: {
sta mulu16_sel.v2+1
ldx #0
jsr mulu16_sel
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lda usinx
clc
adc x5_128

View File

@ -6746,12 +6746,14 @@ sin16s: {
b11:
//SEG210 [105] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
//SEG211 [106] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
//SEG212 [107] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0 -- vwuz1=vwuz1_plus_vwuz2
lda usinx
clc
@ -8301,7 +8303,7 @@ reg byte a [ mul8u::$1 ]
FINAL ASSEMBLER
Score: 32054
Score: 32078
//SEG0 File Comments
//SEG1 Basic Upstart
@ -8908,12 +8910,14 @@ sin16s: {
//SEG209 sin16s::@11
//SEG210 [105] (word) sin16s::x5#0 ← (word) mulu16_sel::return#11
//SEG211 [106] (word) sin16s::x5_128#0 ← (word) sin16s::x5#0 >> (byte) 4 -- vwuz1=vwuz1_ror_4
ldy #4
!:
lsr x5_128+1
ror x5_128
dey
bne !-
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
lsr x5_128+1
ror x5_128
//SEG212 [107] (word) sin16s::usinx#1 ← (word) sin16s::usinx#0 + (word) sin16s::x5_128#0 -- vwuz1=vwuz1_plus_vwuz2
lda usinx
clc