16 bit Assembly Hello World

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Sean3
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 5
Joined: Fri Jun 25, 2010 6:36 pm

16 bit Assembly Hello World

Post by Sean3 »

Code: Select all

-a 100

XXXX:0100 mov ah,09             ;String Function

XXXX:0102 mov dx,0109         ;Address of 0109

XXXX:0105 int 21                   ;Do it

XXXX:0107 int 20                  ;exit the program

XXXX:0109 db "HelloWorld"   ;Charater to output

XXXX:0113                           ;<return>

-rcx                                    ;edit the cx register

CX 0000
:0113                                 ;File size of our program

-n hello.com                  ;Name of file with a .com extention

-w                                      ;Write the byte size

Writing 00113 bytes
-q                                    ;quit the program

You will get used to it someday. I had trouble first look
acerookie1
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 48
Joined: Fri Feb 12, 2010 12:46 pm
Favorite Gaming Platforms: PC, Wii, SNES, GameCube
Programming Language of Choice: C++

Re: 16 bit Assembly Hello World

Post by acerookie1 »

Sean3 wrote:

Code: Select all

-a 100

XXXX:0100 mov ah,09             ;String Function

XXXX:0102 mov dx,0109         ;Address of 0109

XXXX:0105 int 21                   ;Do it

XXXX:0107 int 20                  ;exit the program

XXXX:0109 db "HelloWorld"   ;Charater to output

XXXX:0113                           ;<return>

-rcx                                    ;edit the cx register

CX 0000
:0113                                 ;File size of our program

-n hello.com                  ;Name of file with a .com extention

-w                                      ;Write the byte size

Writing 00113 bytes
-q                                    ;quit the program

You will get used to it someday. I had trouble first look
any recomendations on a tut on asm?
Image
Sean3
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 5
Joined: Fri Jun 25, 2010 6:36 pm

Re: 16 bit Assembly Hello World

Post by Sean3 »

I can do a user input tut.
acerookie1
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 48
Joined: Fri Feb 12, 2010 12:46 pm
Favorite Gaming Platforms: PC, Wii, SNES, GameCube
Programming Language of Choice: C++

Re: 16 bit Assembly Hello World

Post by acerookie1 »

Sean3 wrote:I can do a user input tut.
yeah i meant a link to a completely noob friendly version of asm.
Image
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: 16 bit Assembly Hello World

Post by eatcomics »

google works well...
Image
acerookie1
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 48
Joined: Fri Feb 12, 2010 12:46 pm
Favorite Gaming Platforms: PC, Wii, SNES, GameCube
Programming Language of Choice: C++

Re: 16 bit Assembly Hello World

Post by acerookie1 »

eatcomics wrote:google works well...
yeah then i wouldnt be askin here... none of em make them as easy or well explained as i learned c++, c or c#. its really like posted source code.
Image
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: 16 bit Assembly Hello World

Post by dandymcgee »

@Sean3: Are you running XP? Might want to consider explaining the context of your snippet:

Typing those commands into debug.exe (an assembler/debugger included in Windows operating systems before Vista) will yield the executable "hello.com". This is a 16-bit console program that will only run natively on 32-bit operating systems (can be emulated rather easily using DOSBox on a 64-bit OS). ;)

I recommend you take a look at FASM. 8-)

@acerookie1: Assembly isn't easy. If you're interested in learning check this out: https://web.archive.org/web/20121025004 ... /~btketman
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: 16 bit Assembly Hello World

Post by avansc »

perhaps something a bit cleaner.

Code: Select all


.MODEL Small
.STACK 100h
.DATA
   db msg 'Hello, world!$'
.CODE
start:
   mov ah, 09h
   lea dx, msg ; or mov dx, offset msg
   int 21h
   mov ax,4C00h
   int 21h
end start

Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
acerookie1
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 48
Joined: Fri Feb 12, 2010 12:46 pm
Favorite Gaming Platforms: PC, Wii, SNES, GameCube
Programming Language of Choice: C++

Re: 16 bit Assembly Hello World

Post by acerookie1 »

dandymcgee wrote: @acerookie1: Assembly isn't easy. If you're interested in learning check this out: http://www.btinternet.com/~btketman/
thanx man. :bow:
Image
Sean3
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 5
Joined: Fri Jun 25, 2010 6:36 pm

Re: 16 bit Assembly Hello World

Post by Sean3 »

dandymcgee wrote:@Sean3: Are you running XP? Might want to consider explaining the context of your snippet:

Typing those commands into debug.exe (an assembler/debugger included in Windows operating systems before Vista) will yield the executable "hello.com". This is a 16-bit console program that will only run natively on 32-bit operating systems (can be emulated rather easily using DOSBox on a 64-bit OS). ;)

I recommend you take a look at FASM. 8-)

@acerookie1: Assembly isn't easy. If you're interested in learning check this out: http://www.btinternet.com/~btketman/
Yes I'm using winxp, but I'm more used to debug fasm says its a virus with norton so now I'm thinking of getting rid of AV.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: 16 bit Assembly Hello World

Post by dandymcgee »

Sean3 wrote:
dandymcgee wrote:@Sean3: Are you running XP? Might want to consider explaining the context of your snippet:

Typing those commands into debug.exe (an assembler/debugger included in Windows operating systems before Vista) will yield the executable "hello.com". This is a 16-bit console program that will only run natively on 32-bit operating systems (can be emulated rather easily using DOSBox on a 64-bit OS). ;)

I recommend you take a look at FASM. 8-)

@acerookie1: Assembly isn't easy. If you're interested in learning check this out: http://www.btinternet.com/~btketman/
Yes I'm using winxp, but I'm more used to debug fasm says its a virus with norton so now I'm thinking of getting rid of AV.
LOL.. it's Norton that's the virus. Good luck getting rid of it (I highly recommend a full backup before even considering attempting anything).
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: 16 bit Assembly Hello World

Post by LeonBlade »

Assembly?!?!?! Sounds like a virus!!
There's no place like ~/
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: 16 bit Assembly Hello World

Post by eatcomics »

leon I love how your pic changes every month :D and also... assembly... like legos right? is what you are thinking leon
Image
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: 16 bit Assembly Hello World

Post by LeonBlade »

eatcomics wrote:leon I love how your pic changes every month :D and also... assembly... like legos right? is what you are thinking leon
YEAH LEGOS THANKS http://www.landoverbaptist.net/showthread.php?t=27290
There's no place like ~/
User avatar
JaxDragon
Chaos Rift Junior
Chaos Rift Junior
Posts: 395
Joined: Mon Aug 04, 2008 2:03 pm
Current Project: Kanoba Engine
Favorite Gaming Platforms: PS3, PC
Programming Language of Choice: C++
Location: Northeast NC

Re: 16 bit Assembly Hello World

Post by JaxDragon »

LeonBlade wrote:
eatcomics wrote:leon I love how your pic changes every month :D and also... assembly... like legos right? is what you are thinking leon
YEAH LEGOS THANKS http://www.landoverbaptist.net/showthread.php?t=27290
Is that site a joke? Or are people THAT obsessive over things.

Ok, I know there are people who are, but is there really an entire website full of them? They think denmark is evil??

EDIT: Not stereotyping religious people, just people who analyze things to such extremes lol.
Post Reply