The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => 16 bit DOS Programming => Topic started by: bcddd214 on November 26, 2011, 06:57:00 PM

Title: making my own DOS
Post by: bcddd214 on November 26, 2011, 06:57:00 PM
Don't laugh to hard. I am really trying to figure this stuff out.

I am trying to start of with just a simple blue screen and already getting my first couple of issues.

error is:

mbling: newDOS1.asm
S1.asm(95) : error A2006: und
S1.asm(104) : warning A4023:
start address : main
any key to continue . . .



TITLE The New DOS

.model      small
.stack      100h

WINDESC      STRUCT
         upperRow      BYTE   ?
         leftCol         BYTE   ?
         lowerRow      BYTE   ?
         rightCol         BYTE   ?
         foreColor      BYTE   ?
         backColor      BYTE   ?
WINDESC      ENDS

exit      MACRO
         mov            ax, 4C00h
         int            21h
         ENDM
         
.data
application   WINDESC         <05h, 05h, 15h, 45h, 07h, 10h>

.code

curpos      PROC
         push         bp
         mov            bp, sp
         push         ax
         push         bx
         push         dx
         
         mov            ax, 0200h
         mov            bh, 0
         mov            dx, [bp+4]
; interrupt
         int            10h
         
         pop            dx
         pop            bx
         pop            ax
         pop            bp
         ret            2
curpos      ENDP

putchar      PROC
         push         bp
         mov            bp, sp
         push         ax
         push         bx
         push         cx
         push         dx
         
; missing something here
         pop            dx
         pop            cx
         pop            bx
         pop            ax
         pop            bp
         ret            2
putchar      ENDP

makewin      PROC
         push         bp
         mov            bp, sp
         push         ax
         push         bx
         push         cx
         push         dx
         push         si
         
         mov            si, [bp+4]
         
         mov            ax, 0600h
         mov            bh, (WINDESC PTR[si]) .backColor
         mov            ch, (WINDESC PTR[si]) .upperRow
         mov            cl, (WINDESC PTR[si]) .leftCol
         mov            dh, (WINDESC PTR[si]) .lowerRow
         mov            dl, (WINDESC PTR[si]) .rightCol
;interrupt
         int            10h
         
         push         cx
         call         curpos
         
         pop            si
         pop            dx
         pop            cx
         pop            bx
         pop            ax
         pop            bp
         ret            2
makewin      ENDP

main      PROC
         mov            ax, @data
         mov            ds, ax
         
         mov            ax, OFFSET application
         push         ax
         call         makewin
         exit
main      ENDP

         end            main
Title: Re: making my own DOS
Post by: MichaelW on November 26, 2011, 07:11:58 PM
Assembling with ML 6.14 I get no ML error message and no warning (even with /W3), and no problems linking. What version of ML are you using?
Title: Re: making my own DOS
Post by: bcddd214 on November 26, 2011, 07:58:20 PM
Quote from: MichaelW on November 26, 2011, 07:11:58 PM
Assembling with ML 6.14 I get no ML error message and no warning (even with /W3), and no problems linking. What version of ML are you using?

I have been using this Irvine32 crap
Title: Re: making my own DOS
Post by: bcddd214 on November 26, 2011, 08:03:07 PM
And since it is a 32 bit compiler and every aspect of the code is 16 bit I would imagine I am missing a switch on the compiler but irvine doesn't appear to have a basic /help switch....  :(
Quote from: bcddd214 on November 26, 2011, 07:58:20 PM
Quote from: MichaelW on November 26, 2011, 07:11:58 PM
Assembling with ML 6.14 I get no ML error message and no warning (even with /W3), and no problems linking. What version of ML are you using?

I have been using this Irvine32 crap
Title: Re: making my own DOS
Post by: bcddd214 on November 26, 2011, 08:05:04 PM
make16 worked. lucky guess.
Quote from: bcddd214 on November 26, 2011, 08:03:07 PM
And since it is a 32 bit compiler and every aspect of the code is 16 bit I would imagine I am missing a switch on the compiler but irvine doesn't appear to have a basic /help switch....  :(
Quote from: bcddd214 on November 26, 2011, 07:58:20 PM
Quote from: MichaelW on November 26, 2011, 07:11:58 PM
Assembling with ML 6.14 I get no ML error message and no warning (even with /W3), and no problems linking. What version of ML are you using?

I have been using this Irvine32 crap
Title: Re: making my own DOS
Post by: bcddd214 on November 26, 2011, 08:10:55 PM
 :cheekygreen: She worked!
now, this is a place I have wanted to be for a while because I am playing around with the basics of creating an 'environment'.
Now, I flashed a blue window that to me was a neat trick but you hit the enter key and of course it goes away. I used the msdos interrupt to initialized the blue screen but how to I make it stick?
Can someone explain a little bit about how to use the interrupt and holding the environment, or even just creating a basic one at this point?
Title: Re: making my own DOS
Post by: bcddd214 on November 26, 2011, 08:20:10 PM
I'l be honest, this is the first time I ever played around with the interrupts. I am hungry for knowledge about every aspect of them. I know that they are just system messages but holding onto the info they pass and holding it in memory and loading as a runtime process @ this level is a huge gap in my knowledge base I am trying to fill.
I can do it in java or C++ but it's just not the same as on the asm level.

Quote from: bcddd214 on November 26, 2011, 08:10:55 PM
:cheekygreen: She worked!
now, this is a place I have wanted to be for a while because I am playing around with the basics of creating an 'environment'.
Now, I flashed a blue window that to me was a neat trick but you hit the enter key and of course it goes away. I used the msdos interrupt to initialized the blue screen but how to I make it stick?
Can someone explain a little bit about how to use the interrupt and holding the environment, or even just creating a basic one at this point?
Title: Re: making my own DOS
Post by: MichaelW on November 26, 2011, 08:20:43 PM
I don't know what make16 is, but here is the batch file that I used, set up to provide a listing file and a map file:

set file="test"
set path=c:\masm32\bin
ml /W3 /Fl /Sa /c %file%.asm
pause
link16 /MAP %file%.obj;
pause

Title: Re: making my own DOS
Post by: Farabi on November 28, 2011, 06:19:41 AM
You'll need my research, thats for sure.  :green
Why dont you just use syslinux for your MBR? I'll give you the whole of my code on MASM compatible code, MASM did not like if you toying with OS, so just use JWASM one.
Title: Re: making my own DOS
Post by: bcddd214 on December 06, 2011, 10:11:24 PM
I just installed jwasm and getting errors already.

./jwasm -elf Samples/myDos.asm
JWasm v2.06e, Jul 22 2011, Masm-compatible assembler.
Portions Copyright (c) 1992-2002 Sybase, Inc. All Rights Reserved.
Source co de is available under the Sybase Open Watcom Public License.

myDos.asm(95) : Error A2102: Symbol not defined : DGROUP
myDos.asm: 104 lines, 2 passes, 0 ms, 0 warnings, 1 errors

on the exact same code that worked with Irvine.
I switch to my Linux box for coding and still working out the bugs... :)