0

the assignment is:
Create a macro named mWriteNumber that writes a signed integer to the console output.
Use the WriteInt procedure in the Irvine32 library. The argument passed to the macro can
be a byte, word, or doubleword. Use conditional oeprators so that the macro adapts to
the different sizes of the argument. Write the main code to test the macro, passing
arguments of different sizes.
i'm not asking for codes but just ideas on how to approach it. any suggestions? thanks.

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by kermitaner
0

hi,

check the macros that come with the masm package: /macros/macros.asm,

there is one named 'issize' that does something similar...

0

strange, don't u have the latest package of masm32 ?
anyway:

;---------------------------------------------------

    issize MACRO var:req, bytes:req
        LOCAL rv
        rv = regsize(var) 
        IFE rv ; if not a register use SIZE 
            IF SIZE var EQ bytes
                EXITM <1>
            ELSE
                EXITM <0>
            ENDIF
        ELSE   ; it's a register       
            IF rv EQ bytes
                EXITM <1>        
            ELSE
                EXITM <0>
            ENDIF    
        ENDIF
    ENDM
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.