mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-09-08 17:54:40 +00:00
Fixed high-byteoperator problem with constants.
This commit is contained in:
parent
b122ac8af3
commit
39a6b0493f
@ -106,7 +106,7 @@ public class AsmFormat {
|
||||
} else if(Operators.HIBYTE.equals(operator)) {
|
||||
SymbolType operandType = SymbolTypeInference.inferType(program.getScope(), operand);
|
||||
if(SymbolType.isByte(operandType) || SymbolType.isSByte(operandType)) {
|
||||
return getAsmConstant(program, operand, outerPrecedence, codeScope);
|
||||
return getAsmConstant(program, new ConstantInteger(0l), outerPrecedence, codeScope);
|
||||
} else if(SymbolType.isWord(operandType) || SymbolType.isSWord(operandType) || operandType instanceof SymbolTypePointer) {
|
||||
return ">" + getAsmConstant(program, operand, outerPrecedence, codeScope);
|
||||
} else if(SymbolType.isDWord(operandType) || SymbolType.isSDWord(operandType)) {
|
||||
|
@ -43,7 +43,7 @@ void menu() {
|
||||
*DTV_GRAPHICS_VIC_BANK = (byte)((dword)MENU_CHARSET/$10000);
|
||||
// DTV Color Bank
|
||||
*DTV_COLOR_BANK_LO = <((word)(DTV_COLOR_BANK_DEFAULT/$400));
|
||||
*DTV_COLOR_BANK_HI = 0; // >((word)(DTV_COLOR_BANK_DEFAULT/$400)) - fails currently because the high operator can't see the word type of the operand;
|
||||
*DTV_COLOR_BANK_HI = >((word)(DTV_COLOR_BANK_DEFAULT/$400));
|
||||
// DTV Graphics Mode
|
||||
*DTV_CONTROL = 0;
|
||||
// VIC Graphics Bank
|
||||
|
@ -7,6 +7,7 @@
|
||||
main: {
|
||||
lda #DVAL/$400
|
||||
sta SCREEN+0
|
||||
lda #0
|
||||
sta SCREEN+1
|
||||
rts
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ main: {
|
||||
lda #DVAL/$400
|
||||
sta SCREEN+0
|
||||
//SEG10 [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← >((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2
|
||||
lda #DVAL/$400
|
||||
lda #0
|
||||
sta SCREEN+1
|
||||
jmp breturn
|
||||
//SEG11 main::@return
|
||||
@ -272,7 +272,7 @@ main: {
|
||||
lda #DVAL/$400
|
||||
sta SCREEN+0
|
||||
//SEG10 [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← >((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2
|
||||
lda #DVAL/$400
|
||||
lda #0
|
||||
sta SCREEN+1
|
||||
jmp breturn
|
||||
//SEG11 main::@return
|
||||
@ -286,8 +286,6 @@ Removing instruction jmp b1
|
||||
Removing instruction jmp bend
|
||||
Removing instruction jmp breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction lda #DVAL/$400
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Removing instruction bbegin:
|
||||
Removing instruction b1_from_bbegin:
|
||||
Removing instruction bend_from_b1:
|
||||
@ -311,7 +309,7 @@ FINAL SYMBOL TABLE
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 22
|
||||
Score: 24
|
||||
|
||||
//SEG0 Basic Upstart
|
||||
.pc = $801 "Basic"
|
||||
@ -333,6 +331,7 @@ main: {
|
||||
lda #DVAL/$400
|
||||
sta SCREEN+0
|
||||
//SEG10 [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← >((word))(const dword) DVAL#0/(word/signed word/dword/signed dword) 1024 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2
|
||||
lda #0
|
||||
sta SCREEN+1
|
||||
//SEG11 main::@return
|
||||
//SEG12 [6] return [ ] ( main:2 [ ] )
|
||||
|
Loading…
Reference in New Issue
Block a user