Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 20th, 2005, 11:26 PM   #1
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
compiler error

this is all i have so far and i get errors for BITS... i tried surrounding them in []'s but that created an error also... im using MASM32. Am i not aloud to write 16 bit in masm32.


BITS 16
ORG 0x7c00

main:


end main


btw: this is a start for a boot loader
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Nov 21st, 2005, 1:50 AM   #2
coldDeath
Expert Programmer
 
coldDeath's Avatar
 
Join Date: Aug 2005
Location: UK
Posts: 862
Rep Power: 4 coldDeath is on a distinguished road
Send a message via AIM to coldDeath Send a message via Yahoo to coldDeath
I'm sorry that i cannot help, but there are a few bootloaders out there to choose from, such as LILO or GRUB. Maybe you could investigate into using one of those.

But if all you want to do for a project is make a bootloader, then forget what i said
__________________
Join us at #programmingforums @ irc.freenode.net!

My software never has bugs. It just develops random features.
coldDeath is offline   Reply With Quote
Old Nov 21st, 2005, 9:14 AM   #3
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
Quote:
Originally Posted by coldDeath
I'm sorry that i cannot help, but there are a few bootloaders out there to choose from, such as LILO or GRUB. Maybe you could investigate into using one of those.

But if all you want to do for a project is make a bootloader, then forget what i said
for someone reason no matter what compiler i use or if i surround it with []'s [BITS 16] will create an error. Yes i do want to do this for my own project. Can someone explain how i would specify that im writing a 16 bit program?
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Nov 21st, 2005, 9:50 AM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Being naturally curious, I might Google it, but being naturally curious, I wonder a few things:

1) Why would one choose to write something that's obsolete before one starts?
2) Why would one choose a tool deliberately designed to move past that obsolescence?
3) Why would one choose a tool, which, if it could regress, would fail to document the procedure for doing that?

EDIT: Curiosity having gotten the best of me, I would suggest that you check out EXPR16/EXPR32, OPTION SEGMENT, .MODEL, and that portion of the documentation dealing with processors and memory models.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers

Last edited by DaWei; Nov 21st, 2005 at 10:05 AM.
DaWei is offline   Reply With Quote
Old Nov 21st, 2005, 2:02 PM   #5
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
im making this boot loader for the learning... im hungry for knowledge!

i thought OPTION SEGMENT and .MODEL were used in 32 bit only?
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Nov 21st, 2005, 7:46 PM   #6
Scorpions4ever
Programmer
 
Join Date: Jun 2005
Posts: 86
Rep Power: 4 Scorpions4ever is on a distinguished road
BITS is a NASM directive (not MASM ). What you want is USE16
http://courses.ece.uiuc.edu/ece390/b...ml#HEADING3-42
Scorpions4ever is offline   Reply With Quote
Old Nov 21st, 2005, 8:03 PM   #7
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
My MASM32 docs (just downloaded it) don't mention a USE16, like the MASM docs do. Better hope its there, anyway, or an equivalent amongst those other things.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 22nd, 2005, 12:46 AM   #8
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
using [USE16] or USE 16 does not work ... and the rest of the entire code says " must be in segment block "
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Nov 22nd, 2005, 12:46 AM   #9
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
USE16
ORG 0x7c00

main:

mov ax,0x0000
mov ds,ax
mov si,HellWorld
call PutStr

jmp $

PutStr:

mov ah,0x0E
mov bh,0x00
mov bl,0x07

.nextchar
lodsb
or al,al
jz .return
.return
ret

HelloWorld db "HelloWorld",0
dw 0xAA55
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:49 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC