flat assembler
Message board for the users of flat assembler.

Index > DOS > memory management in DOS

Author
Thread Post new topic Reply to topic
michalll



Joined: 01 Mar 2007
Posts: 7
michalll
Well, i got this problem, i write a program that uses about 100B memory
to store results of calculating pi for very long decimal places in ascii and then writes them. And i wanted to acquire this memory using

Code:
mov ah,48h 
mov bx,50
int 21h
mov ds,ax    


but i never got that far because it always writes insufficient memory errror into ax, but i go 60kB free conventional memory

and doing this without it also doesnt work because in the end ir reads only about first 10 bytes of valid data and then only garbage
no matter what i do i just cant ger acess to a larger amount of clean memory
Post 06 Mar 2007, 09:53
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
What format, DOS .COM? You have to resize memory required or it uses it all up.

Quote:

http://www.ctyme.com/intr/rb-2936.htm

DOS 2+ - RESIZE MEMORY BLOCK
AH = 4Ah
BX = new size in paragraphs
ES = segment of block to resize


Return:
CF clear if successful
CF set on error
AX = error code (07h,08h,09h) (see #01680 at AH=59h/BX=0000h)
BX = maximum paragraphs available for specified memory block

Notes: Under DOS 2.1-6.0, if there is insufficient memory to expand the block as much as requested, the block will be made as large as possible. DOS 2.1-6.0 coalesces any free blocks immediately following the block to be resized

See Also: AH=48h - AH=49h - AH=83h

Category: DOS Kernel - Int 21h - D
Post 07 Mar 2007, 02:37
View user's profile Send private message Visit poster's website Reply with quote
michalll



Joined: 01 Mar 2007
Posts: 7
michalll
Yay, thanks thats true, and in es i should put cs probably?
Post 07 Mar 2007, 08:49
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 GitHub, YouTube, Twitter.

Website powered by rwasa.