Hello everyone. I'm working on my project (a rubik's cube game) in assembler. I'm using TASM. Now, I want to do a record table - order by name, moves, random, time, ect. This data (name moves ect.) is saved in an array of structures at the end of each game (solved cube/giving up), like this -


game struc
GamePlayerName db 9, 11 dup('$')  ; Name - dollars for display
Gamemoves dw ?                    ; Moves till solve
RandomMoves db ?                    ; Moves of scramble
game ends


DATA Segment
thisGame game 30d dup(< , , >)
thisGameLength = ($-thisGame)/(type game)
...
DATA ends


Now, this worked all fine and dandy. But every time I wanted to check whether the array is ordered, displayed, reset - basically every time I wanted to see if an action including the array worked, I had to play the game and fill the array with information. Obviously this is not a way to work (takes AGES), so I wanted to define the array with the information already included, like so -


game struc
GamePlayerName db 9, 11 dup('$')  ; Name
Gamemoves dw ?                    ; Moves till solve
RandomMoves db ?                    ; Moves of scramble
game ends


DATA Segment
thisGame game                <"Shay", 18d, 5d>, <"MojoJojo", 11d, 6d>, <"Kobi", 2d, 1d>, <"Rocko", 54d, 21d>,
<"Zakk", 69d, 69d>, <"Paul", 85d, 14d>, <"Steve", 8d, 5d>, <"Angus", 223d, 12d>,
<"Ziv", 75d, 75d>, <"Bob", 181d, 51d>, <"Bobo", 180d, 50d>, <"Nick", 11d, 1d>
thisGameLength = ($-thisGame)/(type game)
...
DATA ends


This gives me many errors and warnings upon running the code, which are -
**Error** a.ASM(11) Illegal override in structure
*Warning* a.ASM(11) Location counter overflow
*Warning* a.ASM(11) Location counter overflow
*Warning* a.ASM(11) Missing operand - trailing ? assumed
**Error** a.ASM(12) Unknown character
**Error** a.ASM(13) Unknown character


Any ideas on what I'm doing wrong?

TL;DNR -
How to define an array of structurs with the data inside them, no DUP, in the DATA segment?
Posted on 2011-04-20 06:32:23 by TheCoreMan