News:

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

conveting MAKEWORD c macro

Started by ecube, November 01, 2006, 11:41:50 PM

Previous topic - Next topic

GregL

#define MAKEWORD(a,b)   ((WORD)(((BYTE)(a))|(((WORD)((BYTE)(b)))<<8)))

Here's my quick shot at it.


MAKEWORD MACRO a:REQ, b:REQ
    mov al, a
    mov ah, b
    EXITM <ax>
ENDM   

ecube

Wow that simple, great! thanks again.

u

Also, if you're going to use only numbers as the "a" and "b" parameters:

MAKEWORD macro a,b
    exitm <((a)+((b) shl 8)) >
endm


invoke func1,MAKEWORD(7,2)
mov cx,MAKEWORD(7,2)
mov eax,MAKEWORD(7,2)
push MAKEWORD(7,2)
Please use a smaller graphic in your signature.