]>
wirehaze git hosting - MS-DOS.git/blob - v4.0/src/MAPPER/REALLSEG.ASM
4 title CP
/DOS DosReallocSeg mapper
6 dosxxx
segment byte public 'dos'
7 assume
cs:dosxxx
,ds:nothing
,es:nothing
,ss:nothing
9 ; ************************************************************************* *
11 ; * MODULE: DosReallocSeg
13 ; * FILE NAME: dos043.asm
15 ; * FUNCTION: This module changes the size of a segment already
20 ; * push size ; new segment size requested in bytes
21 ; * push selector ; selector
22 ; * call dosreallocseg
28 ; * MODULES CALLED: DOS Int 21, AH=4A
32 ; *************************************************************************
43 Selector dw ?
; segment selector
44 SegmentSize dw ?
; new segment size in bytes
47 dosreallocseg proc
far
48 Enter dosreallocseg
; save registers
50 mov bx,[bp].SegmentSize
; Get new segment size
51 cmp bx,0 ; check for 0
52 je AllocateMax
; jmp to full seg
54 shr bx,1 ; else convert segment in bytes
61 mov bx,4096 ; default segment size in paragraph
64 mov es,[bp].Selector
; set up segment for new size
66 mov ah,4
ah ; set up for DOS realloc call
67 int 21h
; realloc segment
68 jc ErrorExit
; jump if error
70 sub ax,ax ; else set good return code
73 Mexit
; restore registers
75 ret size
str - 6 ; return