Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,628 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,047 people online right now. Registration is fast and FREE... Join Now!




Assembly Programming - Hello World

 
Reply to this topicStart new topic

Assembly Programming - Hello World

Israel
post 10 Dec, 2005 - 01:46 AM
Post #1


D.I.C Addict

Group Icon
Joined: 21 Nov, 2004
Posts: 604



Dream Kudos: 175
My Contributions


I'm having trouble with this "Hello World" in Assembly. Does anyone know what's wrong with this?

CODE

Goto start
a100
JMP 112
;
;112
MoV DX 102
;
;
;
MoV AH 9
INT 21
RET

rcx
1A
w
q

:Start
DEBUG HELLO.CoM<%0.BAT
:This is HELLO.BAT. IT MAKES HELLO.CoM


I ran the BAT file and created the .COM file. Usually when I type "HELLO" at the DOS prompt nothing happens. But once I got an error message. Unfortunate I didn't write it down because I can't get it back up now. Anyone know what's wrong with this?
User is offlineProfile CardPM

Go to the top of the page

born2c0de
post 10 Dec, 2005 - 06:17 AM
Post #2


printf("I'm a %XR",195936478);

Group Icon
Joined: 26 Nov, 2004
Posts: 3,905



Thanked 34 times

Dream Kudos: 2800

Expert In: 80x86 Assembly, C/C++, VB6, VB.NET, C#, J2SE, Win32 API, Reversing

My Contributions


You specified 0x102 to the DX Register.This points to the address where the string begins.
Hence you should ensure that 0x102 contains the String Hello World.
User is offlineProfile CardPM

Go to the top of the page

Israel
post 10 Dec, 2005 - 10:52 PM
Post #3


D.I.C Addict

Group Icon
Joined: 21 Nov, 2004
Posts: 604



Dream Kudos: 175
My Contributions


Ok, I guess I left that part out when I first posted it. Did I think I already had something similar:

CODE
Goto start
a100
JMP 112
;
;102
DB 'HELLO WORLD!'0D 0A'$'
;
;112
MoV DX 102
;
;
;
MoV AH 9
INT 21
RET

rcx
1A
w
q

:Start
DEBUG HELLO.CoM<%0.BAT
:This is HELLO.BAT. IT MAKES HELLO.CoM


I tried moving it to the same line too, like:
CODE
;102 DB 'HELLO WORLD!'0D 0A'$'

By the way, those are zero's not the letter 'O' if that helps?
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 03:37AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month