Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Assembler help

Author
Message
Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 27th Aug 2004 08:54
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...
Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 27th Aug 2004 09:23
i forgot that COMs are offset 100 real addresses in the ram when loaded...sorry...

Formerly Eddie Gordo...
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 27th Aug 2004 10:17
I seem to remember this being a DBpro forum..

Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 27th Aug 2004 10:22
Quote: "I seem to remember this being a DBpro forum.."


And I seem to remember this is the general talk forum, so its perfectly OK to talk about ASM

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 27th Aug 2004 10:26
Then urm why did Rich lock a post I made about javascript ages ago?

Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 27th Aug 2004 10:29
Quote: "Then urm why did Rich lock a post I made about javascript ages ago?"



This is the general talk description:
This board is for all non game-making related talk. High volume and post-moderated!

So if you post questions about a language, that you arent using for making games, and are following the rules (no spamming, yelling, flamebaits, etc) it "should" be OK.

Powersoft
21
Years of Service
User Offline
Joined: 1st Aug 2003
Location: United Kingdom
Posted: 27th Aug 2004 19:15
where can i find a assembler for ASM and some simple tutorials?


Scorched Turf --> Project Thread
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 27th Aug 2004 20:55
http://www.nerdbrains.com

Sign-up and find the assembler forum, those guys can help you out.

Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 28th Aug 2004 06:17
Well well well...

Assemblers...lets see

FASM-Flat Assembler
fasm.sf.net/

NASM-Netwide Assembler
nasm.sourceforge.net/

and tutorials:
www.xs4all.nl/~smit/asm01001.htm
http://k2pts.home.comcast.net/gbaguy/x86asm.htm


Oh and look here, it gives you both those in a list of all sorts of tools assemblers and tutorials:
http://www.goosee.com/x86/

Formerly Eddie Gordo...
Powersoft
21
Years of Service
User Offline
Joined: 1st Aug 2003
Location: United Kingdom
Posted: 28th Aug 2004 16:26
merci


Scorched Turf --> Project Thread

Login to post a reply

Server time is: 2024-09-22 12:44:19
Your offset time is: 2024-09-22 12:44:19