Jump to content



Photo
- - - - -

DOS Reallocate memory


  • Please log in to reply
6 replies to this topic

#1 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 26 November 2003 - 04:16 PM

I just started a new project for the AFX, a simple mulithreading thing..

Due to the nature of implementation I need som dynamic memory allocation (or as dynamic as it gets in DOS :P)

Since DOS allocates all free memory for my program when it loads, as heap, I need to deallocate this first

Here's the code I'm using right now
mov ax,es    ; let AX = segment of PSP base
mov bx,ss    ; and BX = segment of stack base
sub bx,ax    ; reserve seg stack - seg psp
add bx,STKSIZE/16   ; plus paragraphs of stack
mov ah,4Ah   ; fxn 4ah = modify memory
int 21h

This however, crashes DOS on the calculator :/

#2 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 26 November 2003 - 04:26 PM

maybe you can't do this on the calc since romdos is not 100% compatible with ms-dos.
I contacted datalight and got a nice brochure sent to me (including the command com from romdos)
but when I requested a interrupt list or sth. usefull for a programmer they sent me
a standard reply with their 2 pdfs on describing the installation of a romdos with their SDK
and one explaining the great features and the commands (but no interrupt list.)

I requested a compatibility list ... standard answere. Since I have only a modem and am sick of downloading
these big pdf's I stopped mailing them.
Thats it.

#3 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 26 November 2003 - 04:31 PM

hmm

I think BradN did something like this in his asmtest program, but I can't find the sources anymore :(

--- EDIT ---
Even if rom-dos isn't 100% compatible witht ms-dos, it should at least have the basic memory management routines. And if it did not have them, it shouldn't crash when you request the use of them :/

#4 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 26 November 2003 - 04:52 PM

maybe you can do this manually

ask roeoender since he has the best knowledge of the routines of DOS.
He might know a way to write to a special memory adresse to do the same the
dos function does. Do you remember his
AFXPC? there was a programm that could resize the memory (take some memory from the basic area)

#5 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 26 November 2003 - 05:03 PM

I know afxpc yea, don't have the source for it though.
Anyways, that's not reallocating memory of a currently running program.. (Allthough I have no doubt roeoender could probably help)

I tried changing the exe header instead, to force dos not to give more memory than necessary, but that didn't seem to change anything (allocation still reports largest block to 0p)

#6 Mohamed

Mohamed

    UCF Police

  • [Legends]
  • PipPipPipPipPipPipPip
  • 519 posts
  • Gender:Male
  • Location:Egypt, Cairo

  • Calculators:
    AFX 2.0, PV-S660, fx-570MS

Posted 26 November 2003 - 10:14 PM

I think BradN did something like this in his asmtest program, but I can't find the sources anymore :(

You need that?
I have almost every peice of software done for the AFX, the oldest and very historical versions of TOUCHE, Brad's compilations, dscoshpe's beta AIPs, everything. :greengrin:

My CASIO folder is approximately 105 Megabytes. :thumbsup:
I'll look for it (better dig for it) then post here if I find it.


------EDIT------

There you go: http://algebrafx2.ea...er/asmtest2.zip
With the source code. :)

#7 BiTwhise

BiTwhise

    Casio Overgod

  • [Legends]
  • PipPipPipPipPipPipPip
  • 627 posts
  • Gender:Male
  • Location:Guildford, Surry, UK
  • Interests:Programming, games, consoles, martial arts

  • Calculators:
    FX9700WE, CFX9970G, AFX2.0, Classpad 300

Posted 27 November 2003 - 05:24 PM

Ok, thanks :)


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users