I am trying to reassemble an IDA-generated assembly file back into a real mode 16bit MZ executable from which the disassembly was generated. I am using TASM:
tasm /m2 hello
tlink hello
This gives me a lot of warnings with the message "Segment alignment not strict enough" on the lines where IDA generated 'align' directives:
; HELLO.ASM
.8086
.model large
; Segment type: Pure code
seg000 segment byte public 'CODE'
assume cs:seg000
assume es:nothing, ss:nothing, ds:dseg
[...]
locret_10240: ; CODE XREF: sub_1022E+2j
retn
sub_1022E endp
align 2 ; generates the warning
; Attributes: library function bp-based frame
__FF_MSGBANNER proc near ; CODE XREF: start+28p start+A4p ...
push bp
mov bp, sp
mov ax, 0FCh
[...]
The program assembles, links and even runs, but crashes upon termination. The executable size is also a couple bytes different from what I originally started with.
Why does IDA generate these align directives?
How can I fix the alignment problem and recreate an identical executable?