Hi,
I have a problem about nested .while loop in masm32
Does masm32 support nested while loop?

my code is described as below:


mov cl, 0
.while (cl < ebeCurrent_Flash_Part_Block.Block_Num)
PrintHex cl
PrintHex edi

push cx

mov cl, 0

.WHILE (cl < ProgramTimesForOneBlock)

PrintHex cl
PrintHex edi
PrintHex pb4KBufferAddr

;invoke Program_4K_BYTE, pb4KBufferAddr, edi

add pb4KBufferAddr, 1000H ; 4K
add edi, 1000H ; 4K
inc cl
.ENDW ;<- error

pop cx
inc cl
.endw

assembler told me that error is "invalid instruction operand"

Best regards,
Harvey.
Posted on 2003-03-20 21:28:24 by harvey.lin
Hrmm, not completely sure, but what size is "ProgramTimesForOneBlock". If the operands in your while statement aren't the same size, MASM will point you to the .ENDW line as the error...

-----
Domain
Posted on 2003-03-20 22:26:46 by Domain
You are right, Domain

the type of ProgramTimesForOneBlock is conflict with cl.
when I change cl to ecx, it will work correctly.

Thanks Domain.


Best Regards,
Harvey
Posted on 2003-03-21 02:06:15 by harvey.lin
Why fool with 8bit registers? Do you know they take extra clocks?
Posted on 2003-03-21 06:30:19 by roticv