News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Why it doesnt run ?

Started by RuiLoureiro, March 26, 2013, 07:00:12 AM

Previous topic - Next topic

RuiLoureiro

Hi,
    I wrote MatrixXY3.exe and it gives an error after SeeMatrixC

    ;...................................................................
    ;                           Operations
    ;...................................................................
    print   " See matrixR ", 13,10
    int 3                                       ; <----***** INT 3 is here
    invoke  SeeMatrixC, addr _matrixR

    invoke  MovMatrixDDXY, addr _matrixR, addr _matrixC

    invoke  SeeMatrixC, addr _matrixC
;------------------------------------------------------

    Well, i removed some code and i wrote MatrixXY_3.asm to test
    the problem with MovMatrixDDXY.

start:      finit
            print   "Show _matrixR",13,10
            invoke  SeeMatrixC, addr _matrixR           ; show _matrixR

            ; -------------------------
            ; move _matrixR to _matrixC
            ; -------------------------
            invoke  MovMatrixDDXY, addr _matrixR, addr _matrixC

            print   "Show _matrixC",13,10
            invoke  SeeMatrixC, addr _matrixC           ; show _matrixC

;------------------------------------------------------
    There is no problem with SeeMatrixC or MovMatrixDDXY.

    Why it gives error in MatrixXY3.exe ?

;------------------------------------------------------
note:
     MatrixXY3.zip  = MatrixXY3.exe (there is an int 3 there)
     MatrixXY_3.zip = MatrixXY_3.exe and MatrixXY_3.asm
     all is console assemble & link

qWord

The code of the executable is obviously not the code in the source file. It is a classical variant of stack corruption: pushfd->pushad->popfd->popad ;-)
MREAL macros - when you need floating point arithmetic while assembling!

RuiLoureiro

Thank you qWord, it was exactly the problem !
Now MatrixXY3.exe is correct. One day i will post the source code, test code, etc.
for all cases

more: SeeMatrixC is not the same in both .asm files
but now i dont why !

Now, i wrote this

PRINTIT MACRO
        pushad       
        push    eax
        print   "X Y= "
        print   str$(ebx)
        print   chr$(" ")
        print   str$(esi),32
        print   " value= "       
        pop     eax
        ;
        print   str$(eax),13,10
        inkey   " - ok?"
        popad

PRINTIT ENDM

and i got this:

Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: C:\MASM32\RCLArrays_5\MatrixXY3.asm
C:\MASM32\RCLArrays_5\MatrixXY3.asm(203) : fatal error A1008: unmatched macro nesting
_
Assembly Error
Prima qualquer tecla para continuar . . .

    So, i cannot use macros like print inside PRINTIT, no ?

qWord

The syntax is:
PRINTIT  macro
   ;...
endm

You should take a look in MASM's programmer's guide!
MREAL macros - when you need floating point arithmetic while assembling!

RuiLoureiro

Well, i am not well today !
Thanks, is it qWord !