Version 1.00.12 (Beta) - February 12, 2006

Started by PellesC, January 20, 2006, 03:02:35 PM

Previous topic - Next topic

PellesC

POASM version 1.00 (Beta) for testing. No new features will be added, but bugs will be fixed. (The packaging will be different in the future.)

Recent changes:
* Better "jump optimizer" (will shorten more forward jumps = smaller code ;-)).
* EQU can be redefined and mixed with TEXTEQU for the same name (affect SUBSTR too). This should be more consistent, but some useful warnings are gone (separating the "good" from the "bad" turned out to be difficult, so better shut up and try to do the "right thing" (TM)).
* Conditions inside STRUCT/UNION declarations are now allowed (limited to IF/IFE/IFDEF/IFNDEF/ELSE/ENDIF). Useful for Windows structures, for example.
* A RECORD definition may now appear inside a STRUCT/UNION declaration.
* Nesting of ( and ) is now handled for arguments in macro calls.
* Nesting of < and > is now handled in text literals.
* Added optional arguments to INCBIN: start and length.
* Better "stringify" handler for text items (TEXTEQU and friends).
* $ can be used as prefix-escape for "reserved" symbol names (for example $public will be seen as identifier public - not keyword public, or identifier '$public').
* .ECHO will now try to print expressions even if they don't evaluate to a "constant" value.
* OPATTR will now set a flag (8000h) for (quoted) strings. Should simplify tests in macros.
* Changed the not-so-helpful "syntax error" to the more helpful "invalid use of 'something'".
* Completely given up the idea of distinguishing text literals from STRUCT/UNION/RECORD initializers. If you feel an overwhelming need to initialize a STRUCT/UNION/RECORD from a macro, FOR loop, etc, use the alternate syntax { ... }, rather than < ... > (should work with MASM too). This is distinct, and can't possibly be confused for something else.
* Fixed bug when expansion wasn't always "on" when calling a macro.
* Fixed bug when type "PTR" (and nothing else) crashed debug output.
* Fixed bug when type "PTR" (and something) not always created debug output (too ambitious redundancy check).
* Fixed bug in IF* ... ENDIF handling (problem with nested macros, for example).
* Fixed bug when EXITM actually did something(!) when skipping false conditional code.
* Fixed bug when token pasting operator (#) got the silly idea of expanding tokens before the paste.
* Fixed bug when a line-break could get lost in the process (causing a three-day, hard-to-track, problem).

EDIT: POASM version 1.00.7 Beta - January 30, 2006:

* Will warn about attempts to use initialized (non-zero) data in BSS section (.data?).
* Using either "[address-expression].struct-or-union-type.member..." or "struct-or-union-variable[address-expression].member..." should work:
cmp [ebx].TESTSTR.Member1,1
cmp TestStructVar[ebx].Member1,1

* PUBLIC can be used on symbols defined through "symbol = expression" - to emit a COFF ABS symbol.
* Using "[ebp...]" or "[esp...]" directly, not only indirectly through a local variable name, will now be classified as "stack relative" by OPATTR.
* Increased identifier limit to 4095 characters.
* Bugfix: Anonymous sub-structs/unions wasn't handled correctly (like ITEMTYPE in TV_INSERTSTRUCT).
* Bugfix: Stack or register locals wasn't implemented in the "stringify" handler (TEXTEQU and friends).
* Bugfix: Problems using some identifier characters (like ?) with the /D command-line option.
* Bugfix: ALIAS would crash under some conditions.
* Bugfix: return instruction often wrong for "C" or "SYSCALL" procedures.

EDIT: POASM version 1.00.12 Beta - February 12, 2006:

* Added "verbose" option: /V{0|1|2}.
* Added attempt to issue an error if a register value is destroyed by INVOKE.
* Added text substitution support for structure part in a struct/union member reference (id1 in id1.id2.id3...).
* Bugfix: Problem assembling BKPT instruction (ARM - XScale).
* Bugfix: Will not eat current token on syntax errors.

Pelle

[attachment deleted by admin]

Vortex

Hello Pelle,

Many thanks for this is new release of Poasm.

Here is my dialog box demo modified to demonstrate the extended syntax of INCBIN, it uses the embedded rsrc.res attached to the object file :
.data
Resource:
INCBIN Rsrc.res,80 ; skip the first 80 bytes - the header of the rsrc.res file to point the bytes to raw binary data

[attachment deleted by admin]

PBrennick

The GeneSys Project is available from:
The Repository or My crappy website

PellesC


hutch--

Pelle,

My initial testing is looking good. When I have been awake a bit longer I will try and get some more work done but the results so far are very good. I think all of the work you have done over the last few weeks is paying off.  :U
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Vortex

Hi friends,

Thanks for your nice words.

Here is another example of using INCBIN, this demo displays a bitmap from memory without using the win32 resource management functions.

To replace Masm's ASSUME statement, Poasm offers a nice method to access structure members :

MASM code :

lea edx,[pBitmap+sizeof(BITMAPFILEHEADER)] ; start of BITMAPINFOHEADER header
ASSUME edx:ptr BITMAPINFOHEADER
invoke BitBlt,hdc,0,0,[edx].biWidth,[edx].biHeight,hMemDC,0,0,SRCCOPY


Translated to POASM :
lea edx,[pBitmap+sizeof BITMAPFILEHEADER] ; start of BITMAPINFOHEADER header
invoke BitBlt,hdc,0,0,BITMAPINFOHEADER.biWidth[edx],BITMAPINFOHEADER.biHeight[edx],hMemDC,0,0,SRCCOPY



[attachment deleted by admin]

PellesC

Hutch,

I think/hope it will be enough for version 1.0 - there are always room for improvement (in any software), but I need something to do in version "2.0" also...  :bg

Pelle

zooba

Quote from: PellesC on January 20, 2006, 03:02:35 PM
* OPATTR will now set a flag (8000h) for (quoted) strings. Should simplify tests in macros.

Excellent! I've spent ages crafting a MASM macro which would do this :bg :U

PellesC

Quote from: zooba on January 22, 2006, 09:59:51 AM
Quote from: PellesC on January 20, 2006, 03:02:35 PM
* OPATTR will now set a flag (8000h) for (quoted) strings. Should simplify tests in macros.

Excellent! I've spent ages crafting a MASM macro which would do this :bg :U
Thanks - nice to make someone happy...  :bg

Pelle

Gustav

Hello,

possibly a small bug:

?MYCONST   equ 1

is valid if it is found in the source file, but defining it in the cmdline:

poasm /D?MYCONST=1 test.asm

fails.


PellesC

Quote from: Gustav on January 23, 2006, 01:06:15 PM
Hello,

possibly a small bug:

?MYCONST   equ 1

is valid if it is found in the source file, but defining it in the cmdline:

poasm /D?MYCONST=1 test.asm

fails.

Yes, looks like it. Thanks for the report. (The command line is pre-parsed before I know which parser (IA32/AMD64 or ARM) to use (maybe, at least), but it should be possible to do the check in a different way...)

Pelle

Pelle

Vortex