PowerBASIC MACRO substitute for MASM macro?

Started by noman9607, April 05, 2006, 11:24:34 PM

Previous topic - Next topic

noman9607

I have been typing in the exercises from the book "Assembly Language for Intel-based Computers", 4th ed., by Kip Irvine and
so far I have been able to duplicate the little learning mneumonic code programs for Masm in PowerBasic inline code. Actually it is pretty easy
except that now I am running into macros and procs from the link library for the book.

The question is, can I duplicate the funtionality of the masm macros with PowerBasic macros? It looks doable but I don't know and I hope somebody reading this does. The macros seem to break down to smaller macros and calls to Windows dll's.
In other words, I plan that each pb macro would consist ONLY of inline asm code. In that  case am I not duplicating the masm macro?

hutch--

noman,

Sorry,

I missed this one. you need to understand that a compiler and an assembler are different animals and this shows when you try and translate non-mnemonic code from masm to PB. While some macros will translate OK, the macro capacity in masm is far more complex and much of it cannot be converted as a PB macro. Think of a PB macro as mainly text expansion where masm does its own conditional testing, lop code and many more things.

There is no reasonable translation of masm's .IF syntax either because the normal runtime IF block syntax in PB is higher level and it will not accept registers as arguments where in masm its normal.

The safest way when you have a masm macro is to build the code, disassemble it to get what the macro does and reconstruct it as mnemonic code.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php