News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Stack warning

Started by zak100, August 01, 2009, 01:50:10 PM

Previous topic - Next topic

zak100

Hi,
I am trying to work on the code posted by dedndave. Its good. I was able to access drive  'A'.
A:\>dir
Volume in drive A has no label.
Volume Serial Number is 8EB8-00B8

Directory of A:\

File Not Found

A:\>d:

I have two questions:
1. Can I create files  in my floppy?
2. At link time, I am getting stack warning. How can I get rid of it?D:\masm prog>link bpb.obj

Microsoft (R) Segmented Executable Linker  Version 5.60.339 Dec  5 1994
Copyright (C) Microsoft Corp 1984-1993.  All rights reserved.

Run File [bpb.exe]:
List File [nul.map]:
Libraries [.lib]:
Definitions File [nul.def]:
LINK : warning L4021: no stack segment
D:\masm prog>


Can somebody plz help me with this??

Zulfi.


dedndave

you should be able to use the floppy for files, so long as you formatted the disk first
it just won't boot up to DOS without reformatting
the link warning is normal for all tiny model binaries - you may ignore it
the best way to make it go away is to create a stack, but that won't make the binary for you
the other way would be to modify the linker to get rid of the message - lol
just view the message as correct
it is actually telling you that you did the right thing

zak100

Hi,
Thanks for your time. I checked:
.Stack 2048
and it worked. I got it from the following link

http://webster.cs.ucr.edu/Page_TechDocs/MASMDoc/ProgrammersGuide/Chap_02.htm

Actually I want to call 'C' function from my prog and I have heard that they require a larger stack.

Zulfi.

dedndave

well - during the boot process, using library functions is a bit beyond what is available
keep in mind that the only real "function calls" you can make are BIOS functions, or ones you write yourself
you can't even use INT 21h, because that is part of the DOS kernel and has not been loaded
if the C lib function you want to use calls any kernel stuff at all, you can't use it
on the bright side, you are not restricted to any ms conventions - you can do as you like  :bg

zak100

My objective is to let the bootloader jmp to kernel code. In the kernel I would have 'C' functions. I have got a link. I am working on it and would discuss it in my next prob. thread.

Zulfi.