次のようなコードからコンパイルされた古い.com実行可能ファイルを逆アセンブルする場合:
.model tiny ; com program
.code ; code segment
org 100h ; code starts at offset 100h
main proc near
mov ah,09h ; function to display a string
mov dx,offset message ; offset ofMessage string terminating with $
int 21h ; dos interrupt
mov ah,4ch ; function to terminate
mov al,00
int 21h ; Dos Interrupt
endp
message db "Hello World $" ; Message to be displayed terminating with a $
end main
16進数では、次のようになります。
B4 09 BA 0D 01 CD 21 B4 4C B0 00 CD 21 48 65 6C 6C 6F 20 57 6F 72 6C 64 20 24
逆アセンブラは、コードがどこで終わり、文字列「Helloworld」が始まるかをどのように知るのでしょうか。