I am working on this 3d based program, I got stumped midway through this assembly script as to how I could assign a new value to a new Instance of an array's unassigned element.
.data
x DB 00000000b
y DB 00000000b
z DB 00000000b
Vector3 DT OFFSET x
DT OFFSET y
DT OFFSET z
bName DB "Brick"
TypeName DT ?
clickD DB 00000000b
checkV DB 00000001b
NOP
.code
main proc
returnD:
MOV AH, checkV
CMP AH, clickD
JNE returnD
CALL clickEvent
JMP returnD
main endp
clickEvent proc
makeB:
Brick DT OFFSET [Vector3]
DT OFFSET [TypeName]
RET
clickEvent endp
END
NOP
The Array I am trying to work with is the 'Brick' array, in which I am trying to assign its unassigned element 'TypeName' to the 'bName' value specified in .data. The real issue is the fact that the 'Brick' array must only be created when clickD is equal to 1. (1 meant as 'true' in this case to determine when a user clicks on a button to create a new Brick) I need to be able to change Brick's TypeName Value to the bName value on creation of a brick array, and I honestly have no clue how to do this. I have thought the solution may involve doing something like MOVing the value of bName into a register and MOVing the register's value into the brick's typeName Address, which may be able to be stored as a variable, but I am not sure how I could do this. Another possibility may involve pushing bName onto the data stack, and perhaps pushing Bricks typename element onto the stack and MOVing data from there, then poping the data back, but again, the type of array that brick is makes it seem more difficult to do so. I am using x86, masm Assembly, with an Athlon processor, if that helps. Thanks in advance.