C/Visual C - como puedo manejar la memoria en C

 
Vista:

como puedo manejar la memoria en C

Publicado por William Sanchez (3 intervenciones) el 17/10/2000 00:00:00
Necesito saber con que interrupciones puedo segmentar la memoria, y poder reasignar o volver a segmentarla; y ademas hacer otras operaciones con ella, todo esto (repito) necesito hacerlo mediante interrupciones.

Muchas gracias por su atencion....
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:como puedo manejar la memoria en C

Publicado por Endos (143 intervenciones) el 17/10/2000 00:00:00
INT 21 48-- - DOS 2+ - ALLOCATE MEMORY
Category: D - DOS kernel

Inp.:
AH = 48h
BX = number of paragraphs to allocate
Return: CF clear if successful
AX = segment of allocated block
CF set on error
AX = error code (07h,08h) (see #0885 at AH=59h)
BX = size of largest available block
Notes: DOS 2.1-6.0 coalesces free blocks while scanning for a block to
allocate
.COM programs are initially allocated the largest available memory
block, and should free some memory with AH=49h before attempting any
allocations
under the FlashTek X-32 DOS extender, EBX contains a protected-mode
near pointer to the allocated block on a successful return
---------
INT 21 49-- - DOS 2+ - FREE MEMORY
Category: D - DOS kernel

Inp.:
AH = 49h
ES = segment of block to free
Return: CF clear if successful
CF set on error
AX = error code (07h,09h) (see #0885 at AH=59h)
Notes: apparently never returns an error 07h, despite official docs; DOS 2.1+
code contains only an error 09h exit
DOS 2.1-6.0 does not coalesce adjacent free blocks when a block is
freed, only when a block is allocated or resized
the code for this function is identical in DOS 2.1-6.0 except for
calls to start/end a critical section in DOS 3.0+

Sigue....
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Sigue...

Publicado por Endos (143 intervenciones) el 17/10/2000 00:00:00
---------------
INT 21 4A-- - DOS 2+ - RESIZE MEMORY BLOCK
Category: D - DOS kernel

Inp.:
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 #0885 at AH=59h)
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
---------------------------
Table 0885
Values for DOS extended error code:
00h (0) no error
01h (1) function number invalid
02h (2) file not found
03h (3) path not found
04h (4) too many open files (no handles available)
05h (5) access denied
06h (6) invalid handle
07h (7) memory control block destroyed
08h (8) insufficient memory
09h (9) memory block address invalid
0Ah (10) environment invalid (usually >32K in length)
0Bh (11) format invalid
0Ch (12) access code invalid
0Dh (13) data invalid
0Eh (14) reserved
0Fh (15) invalid drive
10h (16) attempted to remove current directory
11h (17) not same device
12h (18) no more files
....

Hay mas errores pero no vienen a cuento...

Saludos,
Endos.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar