blob: b3f2c1c38818bdfd792079aab33c2703653f39e0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
;
page 60,132
;
title CP/DOS DosFreeSeg mapper
;
dosxxx segment byte public 'dos'
assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
;
; ************************************************************************* *
; *
; * MODULE: DosFreeSeg
; *
; * FILE NAME: dos023.asm
; *
; * FUNCTION: This module deallocates a segment
; *
; *
; * CALLING SEQUENCE:
; *
; * push selector ; selector of the segment
; * call dosfreeseg
; *
; * RETURN SEQUENCE:
; *
; * MODULES CALLED: DOS int 21h, ah=49h
; *
; *************************************************************************
public dosfreeseg
.sall
.xlist
include macros.inc
.list
invalid_selector equ 0006h
str struc
Old_bp dw ?
Return dd ?
Selector dw ? ; selector of the segment to be freed
str ends
dosfreeseg proc far
Enter dosfreeseg ; push registers
mov es,[bp].selector ; get selector in es
mov ah,49h
int 21h ; free memory segment
jc error ; jump if error
sub ax,ax ; zero return code
jmp exit ; go to exit
error: mov ax,invalid_selector ; put in error code
exit: Mexit ; pop registers
ret size str - 6 ; return
dosfreeseg endp
dosxxx ends
end
|