I need help with this problem im having...
Im trying to decipher some small code i have here, its quite simple...it's a pure Binary DOS com file...im trying to figure out which hex codes stand for which opcodes and im doing quite well...
Heres the HEX of the program
e9 0d 00 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 24 ba 03 01 b4 09 cd 21 b4 4c cd 21
Heres the source code
[ORG 0x100]
jmp start
msg db "Hello World!$"
start:
mov dx,msg
mov ah,9
int 21h
mov ah,4Ch
int 21h
Heres the Disassembler resualts
[code;-----------------------------------------------------------------------
;segment : 1000h offset : 0h size : 1bh
;16-bit code
;-----------------------------------------------------------------------
start:
1000:0000 e90d00 jmp 10h
1000:0003 48 db 48 ;'h'
1000:0004 65 db 65 ;'e'
1000:0005 6c db 6c ;'l'
1000:0006 6c db 6c ;'l'
1000:0007 6f db 6f ;'o'
1000:0008 20 db 20 ;' '
1000:0009 57 db 57 ;'w'
1000:000a 6f db 6f ;'o'
1000:000b 72 db 72 ;'r'
1000:000c 6c db 6c ;'l'
1000:000d 64 db 64 ;'d'
1000:000e 21 db 21 ;'!'
1000:000f 24 db 24 ;'$'
; xrefs first: 1000:00000000 number : 1
1000:0010 ba0301 mov dx, 103h
1000:0013 b409 mov ah, 09h
1000:0015 cd21 int 21h
1000:0017 b44c mov ah, 4ch
1000:0019 cd21 int 21h
Now that looks good, but the DB segment for the Hello World string starts at HEX address 0003...yet when it jumps to HEX address 0010 the disassembler says it moves the string from the HEX address 103h (1000:0010 ba0301) to the DX register...which cant be right because theres no 103 HEX address in the program obviously...now the command is right and the program is too but thats apparently and extra 01 after the MOV dx,03h...what im not sure of is what the 01 is for...i think it might be the offset but im not totally sure if thats it...cause i didnt put the 01 offset in my code, empty did...and im not sure what the offset is code wise...i know it has something to do with identifying the code as DOS code but im not totaly sure if thats what the 01 is...can anyone help me?
Formerly Eddie Gordo...