Hello All
About 3 years ago I did some reverse engineering on some V40 code, made some minor modifications then reassembled using NASM:
744 loc_F84A4:
745 000004A4 FA cli
746 000004A5 F7040100 test word [si], 1
747 000004A9 7528 jnz short loc_F84D3
748 000004AB FB sti
749 000004AC 810C0100 or word [si], 1
750 000004B0 8B5C08 mov bx, [si+8]
751 000004B3 8A400A mov al, [bx+si+0Ah]
752 000004B6 43 inc bx
753 000004B7 81E3FF00 and bx, 0FFh
754 000004BB 895C08 mov [si+8], bx
755 000004BE FF4C04 dec word [si+4]
756 000004C1 86C4 xchg al, ah
757
758 loc_F84C3:
759 000004C3 E4C1 in al, 0C1h
760
As can be seen in the above listing the loc_F8*** align with the generated address and the or word [si], 1 instruction gives a word for 1.
Now, I needed to do another minor mod, assembled with NASM again but noticed the loc_F8s were no longer aligned. I then noticed the or instruction only gave a byte for 1:
690 000004AC 830C01 or word [si], 1
I am not modding this code so I do not know, nor need to know what it does, but I do need to keep alignment, as I do not want to go through the whole code.
Can anbody see what I am doing wrong to get the different result? I assume it is some sort of optimisation, can I force NASM to use the first type of or listed above. There are many of these in the whole listing.
Many