mirror of
https://github.com/irmen/prog8.git
synced 2024-08-31 17:29:04 +00:00
correct assignment type
This commit is contained in:
parent
26e66f046f
commit
18d820da94
@ -882,14 +882,14 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
|
|||||||
AsmAssignment(
|
AsmAssignment(
|
||||||
AsmAssignSource(SourceStorageKind.REGISTER, program, asmgen, datatype, register = RegisterOrPair.FAC1),
|
AsmAssignSource(SourceStorageKind.REGISTER, program, asmgen, datatype, register = RegisterOrPair.FAC1),
|
||||||
targetFromExpr(first, datatype),
|
targetFromExpr(first, datatype),
|
||||||
true, program.memsizer, first.position
|
false, program.memsizer, first.position
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
asmgen.translateNormalAssignment(
|
asmgen.translateNormalAssignment(
|
||||||
AsmAssignment(
|
AsmAssignment(
|
||||||
AsmAssignSource(SourceStorageKind.VARIABLE, program, asmgen, datatype, "floats.tempvar_swap_float"),
|
AsmAssignSource(SourceStorageKind.VARIABLE, program, asmgen, datatype, "floats.tempvar_swap_float"),
|
||||||
targetFromExpr(second, datatype),
|
targetFromExpr(second, datatype),
|
||||||
true, program.memsizer, second.position
|
false, program.memsizer, second.position
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -4,42 +4,23 @@
|
|||||||
|
|
||||||
main {
|
main {
|
||||||
sub start() {
|
sub start() {
|
||||||
ubyte xx=$20
|
uword xx= $2000
|
||||||
|
ubyte yy=$30
|
||||||
if not xx {
|
ubyte zz=9
|
||||||
xx++
|
sys.memset(xx+200, yy*2, ~yy)
|
||||||
}
|
|
||||||
|
|
||||||
if ~xx {
|
|
||||||
xx++
|
|
||||||
}
|
|
||||||
|
|
||||||
byte yy=3
|
|
||||||
|
|
||||||
if -yy {
|
|
||||||
xx++
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@($c030) = 10
|
||||||
@(~xx) *= 2
|
@(~xx) *= 2
|
||||||
|
txt.print_ub(@($c030))
|
||||||
|
|
||||||
; ubyte yy=$30
|
float f1 = 1111.11
|
||||||
; ubyte zz=9
|
float f2 = 2222.22
|
||||||
; sys.memset(xx+200, yy*2, ~yy)
|
float[] fa = [2222.22, 3333.33]
|
||||||
;
|
|
||||||
; @($c030) = 10
|
swap(f1, fa[1])
|
||||||
; @(~xx) *= 2
|
floats.print_f(f1)
|
||||||
; txt.print_ub(@($c030))
|
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])
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user