mirror of
https://github.com/irmen/prog8.git
synced 2024-11-20 03:32:05 +00:00
fix mkword(@(ptr), 0) wrong asm
This commit is contained in:
parent
4d840c7db8
commit
d6b8936376
@ -865,9 +865,9 @@ internal class BuiltinFunctionsAsmGen(private val program: Program,
|
||||
val mr0 = fcall.args[0] as? DirectMemoryRead
|
||||
val mr1 = fcall.args[1] as? DirectMemoryRead
|
||||
if (mr0 != null)
|
||||
needAsave = mr0.addressExpression !is NumericLiteral && mr0.addressExpression !is IdentifierReference
|
||||
needAsave = mr0.addressExpression !is NumericLiteral
|
||||
if (mr1 != null)
|
||||
needAsave = needAsave or (mr1.addressExpression !is NumericLiteral && mr1.addressExpression !is IdentifierReference)
|
||||
needAsave = needAsave or (mr1.addressExpression !is NumericLiteral)
|
||||
}
|
||||
when(reg) {
|
||||
RegisterOrPair.AX -> {
|
||||
|
@ -3,8 +3,6 @@ TODO
|
||||
|
||||
For next release
|
||||
^^^^^^^^^^^^^^^^
|
||||
- crc ^= mkword(@(data), 0) produces faulty asm, as opposed to crc ^= mkword(variable, 0)
|
||||
|
||||
...
|
||||
|
||||
|
||||
|
@ -3,18 +3,16 @@
|
||||
|
||||
main {
|
||||
sub start() {
|
||||
ubyte left = $12
|
||||
ubyte right = $34
|
||||
uword ww
|
||||
ubyte[] buffer = [$11,$22,$33,$44]
|
||||
uword data = &buffer
|
||||
|
||||
ww = mkword(left, right)
|
||||
txt.print_uwhex(ww, true)
|
||||
ww = mkword(left, 0)
|
||||
txt.print_uwhex(ww, true)
|
||||
ww = mkword(0, right)
|
||||
txt.print_uwhex(ww, true)
|
||||
ww = right as uword
|
||||
txt.print_uwhex(ww, true)
|
||||
uword crc = $ffff
|
||||
crc ^= mkword(@(data), 0)
|
||||
txt.print_uwhex(crc, true)
|
||||
crc = $ffff
|
||||
ubyte variable = @(data)
|
||||
crc ^= mkword(variable, 0)
|
||||
txt.print_uwhex(crc, true)
|
||||
}
|
||||
|
||||
; sub start2() {
|
||||
|
Loading…
Reference in New Issue
Block a user