I define a Matrix with

.DATA?
bMatrix db 80 * 80 dup(?)

after that when I put about 3200 values into this matrix, my program become very slow. It seem that it causes a lot of memory problem.

But, when i use

.DATA
bMatrix db 80 * 80 dup(?)

everything is ok.

Could anybody tell me why it works like that?
Posted on 2004-04-16 08:57:38 by IRET
It's a just a masm bug.
Posted on 2004-04-16 08:58:55 by roticv
Hrm, you say your program becomes slow at runtime when using ".data?" but not ".data" ? That sounds pretty weird. If anything, the .data version should be a bit slower, as it will require paging in data from your EXE file (well, if it isn't paged in already).

Do you have an example that shows the speed problem, that you can zip up and post here?
Posted on 2004-04-16 09:07:05 by f0dder
Maybe it's an aligning problem.
If you have a very big matrix and it's not page aligned (or other alignment) you need more r/w operation to access the whole memory and meybe your matrix may use 2 cache lines instead of one.

You have to check if your matrix falls on a page boundary

Try ALIGN statement
Posted on 2004-04-16 14:42:05 by greenant