I have not done much with my site or the projects listed on it. I have been busy
with many other things.
However, I have fixed a bug in my assembler
and released a new version of the compiler.
The bug in the assembler had to do with the BP register always needing an immediate value
as an offset. For example, the following code requires an offset:
mov ax,[bp]
The above should technically be written as:
mov ax,[bp+0]
However, if you do not put the '+0', the assembler will add it for you. The bug was that the assembler would treat the zero as a 16-bit value instead of an 8-bit value. Here is an example:
LOC line object code SOURCE
0000 11 EB07 jmp short there0
0002 12 8B4600 mov ax,[bp]
0005 13 B83412 mov ax,1234h
0009 14 there0:
Before the bug was fixed, the assembler, on the first pass, would calculate the offset of the jump thinking that the [bp+0] would require a 16-bit offset, but then use an 8-bit offset on the last pass. Notice that at location (LOC) 0005, there are three bytes of instruction, yet the next offset is four bytes away.
After the bug was fixed, the correctly assembled code now looks like:
LOC line object code SOURCE
0000 11 EB06 jmp short there0
0002 12 8B4600 mov ax,[bp]
0005 13 B83412 mov ax,1234h
0008 14 there0:
I have always used an offset in my source code, even if it is the '+0' as in the second line of source above. Therefore, I never noticed the error until just the other day when I left the '+0' off.
If you ever find a bug in the assembled output, please let me know. Thanks.