flat assembler
Message board for the users of flat assembler.

Index > DOS > Hello World without interrupts ?

Author
Thread Post new topic Reply to topic
2



Joined: 26 Sep 2006
Posts: 92
2
Is it possible for somebody to make a Hello World without using any
interrupts? The idea would be to have a program that works the same in
DOS or Linux. I read something about the in and out instructions,but
I don't get the stuff about ports and all. How would I know which port?

_________________
There are 10 kinds of people in the world.
Those who know binary and those who haven't met me.
Post 04 Nov 2006, 23:09
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
You mean like this ?
For real mode.
Code:
mov ax,0xB800mov es,axmov si,msg0mov di,(80 * 1 + 2) * 2mov cx,25cldrep movsb;some more code heremsg0:              db " H E L L O   W O R L D ! "     

Needs to be a bit differant for pmode (linux).
NOTE: also linux exit its programs differant and users differant file formats.
Post 05 Nov 2006, 01:50
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
http://www.deater.net/weave/vmwprod/asm/

Quote:

dual is a quick hack that creates a Hello World binary that can run, withouth modification, on both Linux and MS-DOS/Windows systems. That is, it is both an ELF and DOS COM executable at the same time. get the source or the 150byte binary.


Last edited by rugxulo on 05 Nov 2006, 22:10; edited 2 times in total
Post 05 Nov 2006, 03:12
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
2: without OS calls, you must write to video memory yourself. and linux disallows you to do this, it forces you to use call to OS (or driver)
Post 05 Nov 2006, 16:47
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
2



Joined: 26 Sep 2006
Posts: 92
2
What I don't get is how they make booters that do stuff without an OS !
That's so cool.
Post 05 Nov 2006, 21:37
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
2 wrote:
What I don't get is how they make booters that do stuff without an OS !
That's so cool.

I have alway wondered how they do that, too.
Post 05 Nov 2006, 23:41
View user's profile Send private message Reply with quote
Maurício Pezzotta



Joined: 19 Oct 2006
Posts: 6
Maurício Pezzotta
What's the problem with that? You just have to move something from disc into RAM.
Post 06 Nov 2006, 10:14
View user's profile Send private message Reply with quote
eek



Joined: 21 Oct 2006
Posts: 24
eek
Code:
org cs:100
;hello world
HWORLD
nop ;ZRS
mov bp,B800       ; VIDEO segment i.e.the screen page
mov es,bp             ;to ES
mov di,722          ;page offset ie page position
mov si,HW           ;si to message position
mov cx,C             ;loop x 12 times
loop
mov bp,0                ;didn't need this actually.....
mov al,b[bp+HW]    ;or this.........doh
movsb                  ;copies DS:SI to ES:DI and increments
mov al,0F               ;black background
stosb                     ;prints al
loopnz loop



ret
HW ch10 HeLlo WoRlD
END
    


It wont upload executables here, just change the extension from txt to com


Description:
Download
Filename: HWORLD.txt
Filesize: 45 Bytes
Downloaded: 107 Time(s)

Post 06 Nov 2006, 12:34
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Maurício Pezzotta wrote:
What's the problem with that? You just have to move something from disc into RAM.

WOW, Your right Maurício Pezzotta, I tryed what you said and worked all night and made this http://www.dex4u.com/

Thanks Laughing .
Post 06 Nov 2006, 15:25
View user's profile Send private message Reply with quote
2



Joined: 26 Sep 2006
Posts: 92
2
How on earth would you load it before the OS starts?
It would be cool if I had some kind of ASCII decoration that shows up when I turn the PC on.

_________________
There are 10 kinds of people in the world.
Those who know binary and those who haven't met me.
Post 20 Nov 2006, 00:56
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
2 do you have a floppy drive on you pc ?.
Post 20 Nov 2006, 15:36
View user's profile Send private message Reply with quote
Octavio



Joined: 21 Jun 2003
Posts: 366
Location: Spain
Octavio
2 wrote:
How on earth would you load it before the OS starts?
It would be cool if I had some kind of ASCII decoration that shows up when I turn the PC on.

The Basic Input Output System is always loaded in memory, is like a very simple OS used to boot the computer and load another program (usually on the disk memory) wich loads the OS.
The BIOS services are explained on http://www.ctyme.com/rbrown.htm
For me it woult be cool if the PC booted so fast that i don´t have time to read any ASCII decoration Smile
Post 21 Nov 2006, 13:15
View user's profile Send private message Visit poster's website Reply with quote
2



Joined: 26 Sep 2006
Posts: 92
2
Quote:

2 do you have a floppy drive on you pc ?.


Yes,but most people don't these days from what I hear. They
don't make PCs with floppy drives much anymore.
I like floppies,but they get damaged easily.
but still,putting a program on a floppy disk wouldn't do anything unless
you had it boot DOS and run a COM file. That's pretty neat,but you're still depending on an OS to do that.
Post 10 Dec 2006, 05:51
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1171
Location: Overflow
Matrix
2 wrote:
Quote:

2 do you have a floppy drive on you pc ?.


Yes,but most people don't these days from what I hear. They
don't make PCs with floppy drives much anymore.
I like floppies,but they get damaged easily.
but still,putting a program on a floppy disk wouldn't do anything unless
you had it boot DOS and run a COM file. That's pretty neat,but you're still depending on an OS to do that.


hi 2

you might wanna try booting from cd/cd-rw?
you can burn a boot cd with 1.44MB emulation, and boot the floppy image.
Post 10 Dec 2006, 06:04
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
2 wrote:
Quote:

2 do you have a floppy drive on you pc ?.


Yes,but most people don't these days from what I hear. They
don't make PCs with floppy drives much anymore.
I like floppies,but they get damaged easily.
but still,putting a program on a floppy disk wouldn't do anything unless
you had it boot DOS and run a COM file. That's pretty neat,but you're still depending on an OS to do that.

There is no Dos, just your own OS, you code yourself, to run the file .
Post 10 Dec 2006, 17:53
View user's profile Send private message Reply with quote
2



Joined: 26 Sep 2006
Posts: 92
2
Quote:

you might wanna try booting from cd/cd-rw?
you can burn a boot cd with 1.44MB emulation, and boot the floppy image.


You mean it's possible to burn a floppy image to a CD and actually boot from it?! That does change things. I'll remember that.
Post 18 Dec 2006, 03:06
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
You open up your burn cd software, click on the make bootable, it will ask for a image. Point it to your bootable floppy image, it will add 2 files to the cd both .bin
You can add more stuff to the cd ( but you will not beable to get to it, with out a atapi driver from your boot code).
That all there is to it, you can also do the same with a hdd image (must be able to fit on the cd).
Post 18 Dec 2006, 03:15
View user's profile Send private message Reply with quote
2



Joined: 26 Sep 2006
Posts: 92
2
Of course,that assumes you're using the correct software to burn these CDs. Now booting a hard drive image from the CD sounds like an idea.
It's so cool!

BTW,I was looking at DexOS,I might try it sometime.
Always busy doing something.

I program the 6502 CPU as well as intel. I use a cool simulator to
do things. Right now I'm working on something really creepy in DOS.
Post 18 Dec 2006, 04:58
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.