News:

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

Iterative .IF parser

Started by hutch--, November 18, 2005, 04:22:15 AM

Previous topic - Next topic

hutch--

This is the first more or less reliable .IF block parser. It currently does 2 optimisations, it does not write an exit jump directly after an unconditional branch and where it can determine a .IF/.ELSEIF REG ==/!= 0 it will replace it with TEST REG, REG. It is currently only suitable for a closed test piece such as the supplied example and it has no error checking for invalid .IF block problems, else placement, closing endif etc ...

The next 2 tasks is exit jump short circuiting to prevent exit jump chains and then unused label removal. I still have to test the idea properly but I think the exit jump short circuiting can be done directly to the final jump in the IF block as long as it is not followed by a normal instruction and this involves a one instruction look ahead.

[attachment deleted by admin]
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

hutch--

mutter,

I have already found one problem with it, if there is no .ELSEIF, the labels go out od synch.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php