correct assignment type

This commit is contained in:
Irmen de Jong 2021-11-06 18:52:54 +01:00
parent 26e66f046f
commit 18d820da94
2 changed files with 16 additions and 35 deletions

View File

@ -882,14 +882,14 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
AsmAssignment(
AsmAssignSource(SourceStorageKind.REGISTER, program, asmgen, datatype, register = RegisterOrPair.FAC1),
targetFromExpr(first, datatype),
true, program.memsizer, first.position
false, program.memsizer, first.position
)
)
asmgen.translateNormalAssignment(
AsmAssignment(
AsmAssignSource(SourceStorageKind.VARIABLE, program, asmgen, datatype, "floats.tempvar_swap_float"),
targetFromExpr(second, datatype),
true, program.memsizer, second.position
false, program.memsizer, second.position
)
)
}

View File

@ -4,42 +4,23 @@
main {
sub start() {
ubyte xx=$20
if not xx {
xx++
}
if ~xx {
xx++
}
byte yy=3
if -yy {
xx++
}
uword xx= $2000
ubyte yy=$30
ubyte zz=9
sys.memset(xx+200, yy*2, ~yy)
@($c030) = 10
@(~xx) *= 2
txt.print_ub(@($c030))
; ubyte yy=$30
; ubyte zz=9
; sys.memset(xx+200, yy*2, ~yy)
;
; @($c030) = 10
; @(~xx) *= 2
; txt.print_ub(@($c030))
;
; float f1 = 1111.11
; float f2 = 2222.22
; float[] fa = [2222.22, 3333.33]
;
; swap(f1, fa[1])
; floats.print_f(f1)
; txt.nl()
; floats.print_f(fa[1])
float f1 = 1111.11
float f2 = 2222.22
float[] fa = [2222.22, 3333.33]
swap(f1, fa[1])
floats.print_f(f1)
txt.nl()
floats.print_f(fa[1])
}
}