mirror of
https://github.com/irmen/prog8.git
synced 2024-12-25 23:29:55 +00:00
fix passing address of pass-by-reference assignment to a UWORD
This commit is contained in:
parent
8d0607ef58
commit
4825b4dc68
@ -48,7 +48,13 @@ internal class AssignmentAsmGen(private val program: Program, private val asmgen
|
||||
val variable = assign.source.asmVarname
|
||||
when (assign.target.datatype) {
|
||||
DataType.UBYTE, DataType.BYTE -> assignVariableByte(assign.target, variable)
|
||||
DataType.UWORD, DataType.WORD -> assignVariableWord(assign.target, variable)
|
||||
DataType.WORD -> assignVariableWord(assign.target, variable)
|
||||
DataType.UWORD -> {
|
||||
if(assign.source.datatype in PassByReferenceDatatypes)
|
||||
assignAddressOf(assign.target, variable)
|
||||
else
|
||||
assignVariableWord(assign.target, variable)
|
||||
}
|
||||
DataType.FLOAT -> assignVariableFloat(assign.target, variable)
|
||||
DataType.STR -> assignVariableString(assign.target, variable)
|
||||
else -> throw AssemblyError("unsupported assignment target type ${assign.target.datatype}")
|
||||
|
@ -3,7 +3,6 @@
|
||||
%import conv
|
||||
|
||||
; TODO add all other Elite's ships, show their name, advance to next ship on keypress
|
||||
; TODO doesn't draw anything on cx16 anymore...
|
||||
|
||||
main {
|
||||
|
||||
@ -37,7 +36,7 @@ main {
|
||||
|
||||
cx16.GRAPH_set_colors(1, 0, 0)
|
||||
draw_lines_hiddenremoval()
|
||||
;draw_lines()
|
||||
; draw_lines()
|
||||
|
||||
anglex += 217
|
||||
angley -= 505
|
||||
@ -225,6 +224,8 @@ main {
|
||||
|
||||
shipdata {
|
||||
|
||||
%option force_output
|
||||
|
||||
; Ship model data converted from BBC Elite's Cobra MK 3
|
||||
; downloaded from http://www.elitehomepage.org/archive/index.htm
|
||||
|
||||
|
@ -7,37 +7,17 @@ main {
|
||||
|
||||
sub start() {
|
||||
|
||||
; byte bb = 4
|
||||
; bb += sgn(bb+bb)
|
||||
; txt.print_b(bb)
|
||||
; txt.chrout('\n')
|
||||
;
|
||||
; word ww = 4
|
||||
; ww += sgn(ww+ww)
|
||||
; txt.print_w(ww)
|
||||
; txt.chrout('\n')
|
||||
ubyte[100] array
|
||||
|
||||
float x = 4
|
||||
x += abs(x+x)
|
||||
floats.print_f(x)
|
||||
memset(array, len(array)-1, 255)
|
||||
|
||||
ubyte xx
|
||||
for xx in array {
|
||||
txt.print_ubhex(xx, false)
|
||||
txt.chrout(',')
|
||||
}
|
||||
txt.chrout('\n')
|
||||
|
||||
x = 4
|
||||
x += sgn(x+x) ; TODO missing byte->float cast in assembly??? Also fucks up stack
|
||||
x += sgn(x+x) ; TODO missing byte->float cast in assembly??? Also fucks up stack
|
||||
x += sgn(x+x) ; TODO missing byte->float cast in assembly??? Also fucks up stack
|
||||
floats.print_f(x)
|
||||
txt.chrout('\n')
|
||||
|
||||
; repeat 10 {
|
||||
; float cosa = cos(t)
|
||||
; float sina = sin(t)
|
||||
; float cosb = cos(t*0.33)
|
||||
; float sinb = sin(t*0.33)
|
||||
; float cosc = cos(t*0.78)
|
||||
; float sinc = sin(t*0.78)
|
||||
; }
|
||||
|
||||
testX()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user