Actually, if DisASM had complete mnemonic breakouts of all x86 instructions, I would use it without Drag and Drop. In fact I would modify the interface to work
through the COMMAND$, which would allow me to shell to it from my own program.
That way, I could call it to create an .ASM output of any given EXE, then use my own program to take the ASM output and present it for immediate viewing - at least the part that would be of interest to me.
There are many times when you want to be able to reposition back to a place in your code easily. In PowerBasic, I often use a statement like "A=A", which effectively does nothing, but which I can search for easily. Some people prefer to use as dpecial type of comment, or even a line label.
In Assembly Language, Theo has suggested using the NOP (No OPeration) operand. This works well, but what if you want some variety in the inline tags that you used? A comment does not transition from PowerBasic into the final ASM code, nor does a line label. You really need to use an instruction that can be implemented via the inline assembler capabilities of PowerBasic.
Actually, there are many, many instruction constructs that effectively act as NOP instructions. MOV instructions, for instance, do not change flag states, so if you move a register to itself, nothing is changed. So you could use statements like these and get the NOP effect:
! NOP
! MOV eax, eax
! MOV al, al
! MOV ah, ah
! MOV ax, ax
! MOV ebx, ebx
...
! MOV ecx, ecx
...
Anyway, you get the idea. This provides you with many options for setting flags in the code you want to examine. Now I suggested previously that you could use a leading ! NOP and trailing ! NOP to mark off any section of code to examine, but with so many options, you could mark different parts of your code
to be examined with separate leading and trailing instructions, such as:
! MOV al, al 'marks the leading part of a sequence to examine
... 'the sequence to examine
! MOV ah, ah 'ends the sequence to be examined.
Now the neat thing here is that you could write a simple program that would
open both the source code file and the produced ASM file and use the same
search method to display the comparative sequences in parallel to each other,
So if you wanted to see how PowerBasic's LEN() function is implemented, you
could do something like this:
! MOV al, al
a=LEN(aa$)
! MOV ah, ah
And when you use a Dissassembler to procude an ASM (or LST) file output, your
search tool could then show you what lies between the paired ! MOV statements.
By using different pairs of ineffectual ! MOV statements, you could examine different parts of the source and ASM files together, and be sure that each part was a match to the other, somehow.
My impression of the resulting code is that PowerBasic employs a large number
of CALL statements with appended called routines to perform some operations,
and that understanding what is going on gets a bit involved. But by knowing where each group of statements both begin and end, you should be able to determine quite a bit from this process.