Pausing The Build

By pausing the build before assembly, we can modify the ASM code before it is compiled into an OBJ file. Of course the original inline code in the VB module can be changed also, but if the code is finished and we just want to try a few changes, pausing the build can be quick without being permanent. To start open the Pausing.VBP project. This is just a simple little piece of code that returns a number. When run in the VBIDE it will always return 0.

The Inline code in the function "Testing" is as follows"
 

The #ASM tags are needed so the add-in can find the assembly code. The ASM block must be commented becuz
VB will give us syntax errors if not. The number to return is put into the EAX register and the function is returned.

Now, open the VbInline add-in interface and goto the "Change Settings" page.

To begin, make sure the "Pause Before Assembly" option is NOT checked.
We will do a compile without it first and check the EXE for proper operation.

So, check the "Keep Settings Up" option, then click the "Exit Settings" button.

Now do a compile of the project. You should not have received any error messages.

If you did, check the "VbInlineAsm.dbg" in the "AsmListings-Logs" folder which will be in any project folder that Inline is run.
Look at the Assembler Output for description of errors. (This is assuming the options are set for debugging...)

Now run the EXE. Clicking the cmd button should give a msgbox with the "12345678" return.

If we want to change that to "87654321", we could just change it in the Inline code or we can pause the build and modify the ASM file.

Open the Vb Inline interface and check the option "Pause Before Assembly".

Now build the EXE again. A msgbox will pop and notify that the "Breakpoint" has been hit.

It will ask if you want to open the ASM file with your editor. You can click yes to automatically open the file or just find the
file with Explorer and open it with NotePad. For the rest of this tutorial I'll assume NotePad is used.
The file is "Pausing.asm" in the "AsmListings-Logs" folder. If you manually opened it, don't click No yet.

Got it open? Good! This is the assembly code that MASM will compile when we resume the build.

Down near the bottom we will find our function. Change the "12345678" to "87654321".

Save the file. We just overwrote the current ASM with the open file in NotePad.

Go back to VB and select the No button (didn't open with ASM editor) or Yes to  finish the compile.
(The button will depend on how you opened the file).

Run the EXE... If all is well then the msgbox should have the reversed number in it.

If another change is desired, built the EXE again in VB. Breakpoint pops, goto NotePad, make the changes.
(Just leave Notepad or your editor open when making many changes and hit the "No" button when asked
if you want to open the file. This makes it quick to do changes.)

Save the file overwriting the current one.

Return to VB, click "No", and the compile finishes.
 

This could have been done in the VB module easier but I have found times (with more complex code) that it is a handy
option to have. Especially when swapping in large blocks of code.....JS