News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

.BREAK and SIZEOF

Started by RedXVII, January 08, 2007, 07:34:27 PM

Previous topic - Next topic

RedXVII

2 questions;

1)

.while 1
xor eax, eax...
  .while 1
  xor ecx, ecx
  .break .if(!ecx)
  add eax, ecx
  .endw
  ;point a
.endw
;point b


where does the .break go to? point a or point b and how can I make it go to the other one?

2)

Is it posible to get the SIZEOF in different units, it seems wierd
eg.
when i do SIZEOF RECT, i get 16       ie. bytes
when i do SIZEOF DWORD, i get 32   ie. bits
so can i do something like;

SIZEOF RECT, bits


Cheers for all your help :U
RedXVII

u

sizeof DWORD returns 4, no oddities here.

The .break will go to point 'a'. Instead of using .break , do it with cmp/test and jz/jnz, to go to point 'b'.
Please use a smaller graphic in your signature.

RedXVII

cant you do something like

.break (.break)  ?

I just checked a program. You are correct about SIZEOF DWORD returning 4, but i did it the other day and it returned 32.  :red

Ok that sorts that out. Cheers Ultrano.  :U

TNick

Nop, .break (.break)  won't work

jmp  Loop1_Cond
Loop1_Entry:
  jmp  Loop2_Cond
  Loop2_Entry:
    ;normal .BREAK statement
    cmp  eax, SomethingX
    je     Loop2_Exit

    ; .break (.break) statement:)
    cmp  eax, SomethingY
    je     Loop1_Exit

    Loop2_Cond:
      cmp   Something1, Something2
      jb      Loop2_Entry
  Loop2_Exit:
 
  Loop1_Cond:
    cmp Something3, Something4
    jae  Loop1_Entry
Loop1_Exit:


... just like Ultrano said.

Regards,
Nick