diff options
Diffstat (limited to 'v4.0/src/CMD/DEBUG/DEBEMS.ASM')
| -rw-r--r-- | v4.0/src/CMD/DEBUG/DEBEMS.ASM | 1127 |
1 files changed, 1127 insertions, 0 deletions
diff --git a/v4.0/src/CMD/DEBUG/DEBEMS.ASM b/v4.0/src/CMD/DEBUG/DEBEMS.ASM new file mode 100644 index 0000000..12578f0 --- /dev/null +++ b/v4.0/src/CMD/DEBUG/DEBEMS.ASM | |||
| @@ -0,0 +1,1127 @@ | |||
| 1 | PAGE 60,132 ; | ||
| 2 | TITLE DEBEMS.SAL - EMS DEBUGGER COMMANDS PC DOS | ||
| 3 | ;======================= START OF SPECIFICATIONS ========================= | ||
| 4 | ; | ||
| 5 | ; MODULE NAME: DEBEMS.SAL | ||
| 6 | ; | ||
| 7 | ; DESCRIPTIVE NAME: DEBUGGING TOOL | ||
| 8 | ; | ||
| 9 | ; FUNCTION: PROVIDES USERS WITH ACCESS TO RUDIMENTARY EMS FACILITIES. | ||
| 10 | ; | ||
| 11 | ; ENTRY POINT: ANY CALLED ROUTINE | ||
| 12 | ; | ||
| 13 | ; INPUT: NA | ||
| 14 | ; | ||
| 15 | ; EXIT NORMAL: NA | ||
| 16 | ; | ||
| 17 | ; EXIT ERROR: NA | ||
| 18 | ; | ||
| 19 | ; INTERNAL REFERENCES: | ||
| 20 | ; | ||
| 21 | ; EXTERNAL REFERENCES: | ||
| 22 | ; | ||
| 23 | ; ROUTINE: DEBCOM2 - CONTAINS ROUTINES CALLED BY DEBUG | ||
| 24 | ; DEBCOM3 - CONTAINS ROUTINES CALLED BY DEBUG | ||
| 25 | ; DEBASM - CONTAINS ROUTINES CALLED BY DEBUG | ||
| 26 | ; DEBUASM - CONTAINS ROUTINES CALLED BY DEBUG | ||
| 27 | ; DEBMES - CONTAINS ROUTINES CALLED BY DEBUG | ||
| 28 | ; | ||
| 29 | ; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS. | ||
| 30 | ; LINK DEBUG+DEBCOM1+DEBCOM2+DEBCOM3+DEBASM+DEBUASM+DEBERR+ | ||
| 31 | ; DEBCONST+DEBDATA+DEBMES | ||
| 32 | ; | ||
| 33 | ; REVISION HISTORY: | ||
| 34 | ; | ||
| 35 | ; AN000 VERSION 4.00 - REVISIONS MADE RELATE TO THE FOLLOWING: | ||
| 36 | ; | ||
| 37 | ; - IMPLEMENT EMS FUNCTIONS DSM:6/24/87 | ||
| 38 | ; | ||
| 39 | ; COPYRIGHT: "MS DOS DEBUG UTILITY" | ||
| 40 | ; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft" | ||
| 41 | ; "LICENSED MATERIAL - PROPERTY OF Microsoft " | ||
| 42 | ; | ||
| 43 | ;======================= END OF SPECIFICATIONS =========================== | ||
| 44 | |||
| 45 | INCLUDE DOSSYM.INC | ||
| 46 | include debequ.asm | ||
| 47 | |||
| 48 | |||
| 49 | CODE SEGMENT PUBLIC BYTE | ||
| 50 | CODE ENDS | ||
| 51 | |||
| 52 | CONST SEGMENT PUBLIC BYTE | ||
| 53 | CONST ENDS | ||
| 54 | |||
| 55 | CSTACK SEGMENT STACK | ||
| 56 | CSTACK ENDS | ||
| 57 | |||
| 58 | DATA SEGMENT PUBLIC BYTE | ||
| 59 | |||
| 60 | extrn xm_page:byte ;an000;page count to allocate | ||
| 61 | extrn xm_log:byte ;an000;log. page to map | ||
| 62 | extrn xm_phy:byte ;an000;phy. page to map | ||
| 63 | extrn xm_handle:word ;an000;handle to map | ||
| 64 | extrn xm_handle_ret:word ;an000;handle created | ||
| 65 | |||
| 66 | extrn xm_page_cnt:word ;an000;page count | ||
| 67 | extrn xm_handle_pages_buf:byte ;an000;holds handles and pages | ||
| 68 | extrn xm_frame:word ;an000;EMS frame value | ||
| 69 | extrn xm_deall_han:word ;an000;handle to deallocate | ||
| 70 | extrn xm_alloc_pg:word ;an000;pages allocated | ||
| 71 | extrn xm_total_pg:word ;an000;total pages possible | ||
| 72 | extrn xm_han_alloc:word ;an000;handles allocated | ||
| 73 | extrn xm_han_total:word ;an000;total handles possible | ||
| 74 | |||
| 75 | extrn xm_han_ret_ptr:word ;an000;prints handle created | ||
| 76 | extrn xm_mapped_ptr:word ;an000;prints log/phy pages | ||
| 77 | extrn xm_page_seg_ptr:word ;an000;Frame seg status | ||
| 78 | extrn xm_deall_ptr:word ;an000;Handle deallocation | ||
| 79 | extrn xm_unall_ptr:word ;an000;prints page status | ||
| 80 | extrn xm_han_alloc_ptr:word ;an000;print handle status | ||
| 81 | |||
| 82 | extrn xm_err80_ptr:word ;an000;ems error message | ||
| 83 | extrn xm_err83_ptr:word ;an000;ems error message | ||
| 84 | extrn xm_err84_ptr:word ;an000;ems error message | ||
| 85 | extrn xm_err85_ptr:word ;an000;ems error message | ||
| 86 | extrn xm_err86_ptr:word ;an000;ems error message | ||
| 87 | extrn xm_err87_ptr:word ;an000;ems error message | ||
| 88 | extrn xm_err88_ptr:word ;an000;ems error message | ||
| 89 | extrn xm_err89_ptr:word ;an000;ems error message | ||
| 90 | extrn xm_err8a_ptr:word ;an000;ems error message | ||
| 91 | extrn xm_err8b_ptr:word ;an000;ems error message | ||
| 92 | extrn xm_err8d_ptr:word ;an000;ems error message | ||
| 93 | extrn xm_err8e_ptr:word ;an000;ems error message | ||
| 94 | extrn xm_errff_ptr:word ;an000;ems error message | ||
| 95 | extrn xm_err_gen_ptr:word ;an000;ems error message | ||
| 96 | extrn xm_parse_err_ptr:word ;an000;input error message | ||
| 97 | extrn xm_status_ptr:word ;an000;prints status of EMS | ||
| 98 | |||
| 99 | DATA ENDS | ||
| 100 | |||
| 101 | DG GROUP CODE,CONST,CSTACK,DATA | ||
| 102 | |||
| 103 | CODE SEGMENT PUBLIC BYTE | ||
| 104 | ASSUME CS:DG,DS:DG,ES:DG,SS:DG | ||
| 105 | |||
| 106 | public debems ;an000;entry point | ||
| 107 | extrn std_printf:near ;an000;message retriever | ||
| 108 | extrn gethx:near ;an000;ASCII to bin conversion | ||
| 109 | extrn inbuf:near ;an000;input command line | ||
| 110 | extrn scanb:near ;an000;scan off blanks | ||
| 111 | extrn scanp:near ;an000;scan for parm | ||
| 112 | extrn perr:near ;an000;print ^ error | ||
| 113 | extrn geteol:near | ||
| 114 | extrn crlf:near ;an000;prints a cr,lf | ||
| 115 | |||
| 116 | IF SYSVER | ||
| 117 | ENDIF | ||
| 118 | |||
| 119 | DEBEMS: ;an000;entry to module | ||
| 120 | |||
| 121 | call SCANP ;an000;scan for M or S parm | ||
| 122 | ; $if z ;an000;no parms found | ||
| 123 | JNZ $$IF1 | ||
| 124 | call XM_PARSE_ERROR ;an000;tell user of error | ||
| 125 | ; $else ;an000; | ||
| 126 | JMP SHORT $$EN1 | ||
| 127 | $$IF1: | ||
| 128 | mov al,[si] ;an000;grab parm | ||
| 129 | cmp al,"M" ;an000;is it MAP? | ||
| 130 | ; $if e ;an000;yes | ||
| 131 | JNE $$IF3 | ||
| 132 | inc si ;an000;point to next byte | ||
| 133 | call XM_EMS_MAP ;an000; | ||
| 134 | ; $else ;an000; | ||
| 135 | JMP SHORT $$EN3 | ||
| 136 | $$IF3: | ||
| 137 | cmp al,"S" ;an000;is it a status check? | ||
| 138 | ; $if e ;an000;yes | ||
| 139 | JNE $$IF5 | ||
| 140 | inc si ;an000;point to next byte | ||
| 141 | call XM_EMS_STATUS ;an000; | ||
| 142 | ; $else ;an000; | ||
| 143 | JMP SHORT $$EN5 | ||
| 144 | $$IF5: | ||
| 145 | cmp al,"D" ;an000;Deallocate pages? | ||
| 146 | ; $if e ;an000;yes | ||
| 147 | JNE $$IF7 | ||
| 148 | inc si ;an000;point to next byte | ||
| 149 | call XM_EMS_DEALL ;an000; | ||
| 150 | ; $else ;an000; | ||
| 151 | JMP SHORT $$EN7 | ||
| 152 | $$IF7: | ||
| 153 | cmp al,"A" ;an000;Allocate pages? | ||
| 154 | ; $if e ;an000;yes | ||
| 155 | JNE $$IF9 | ||
| 156 | inc si ;an000;point to next byte | ||
| 157 | call XM_EMS_ALLOC ;an000; | ||
| 158 | ; $else ;an000; | ||
| 159 | JMP SHORT $$EN9 | ||
| 160 | $$IF9: | ||
| 161 | call GETEOL ;an000;check out parm | ||
| 162 | ; $endif ;an000; | ||
| 163 | $$EN9: | ||
| 164 | ; $endif ;an000; | ||
| 165 | $$EN7: | ||
| 166 | ; $endif ;an000; | ||
| 167 | $$EN5: | ||
| 168 | ; $endif ;an000; | ||
| 169 | $$EN3: | ||
| 170 | ; $endif ;an000; | ||
| 171 | $$EN1: | ||
| 172 | |||
| 173 | ret ;an000;return to caller | ||
| 174 | |||
| 175 | |||
| 176 | |||
| 177 | ;========================================================================= | ||
| 178 | ; XM_EMS_ALLOC : This function will provide the user the | ||
| 179 | ; capability to set and change EMS logical and | ||
| 180 | ; physical pages within page frame 0. | ||
| 181 | ; | ||
| 182 | ; Inputs: none | ||
| 183 | ; | ||
| 184 | ; Outputs: EMS page frames set or altered | ||
| 185 | ; | ||
| 186 | ; Date: 6/24/87 | ||
| 187 | ;========================================================================= | ||
| 188 | |||
| 189 | XM_EMS_ALLOC proc near ;an000;XM functions | ||
| 190 | |||
| 191 | call XM_GET_MAN_STATUS ;an000;see if EMS active | ||
| 192 | ; $if nc ;an000;EMS active | ||
| 193 | JC $$IF16 | ||
| 194 | call XM_PAGE_PROMPT ;an000;get pages to allocate | ||
| 195 | call XM_GET_HAN_ALLOC ;an000;allocate pages | ||
| 196 | mov dg:XM_HANDLE_RET,dx ;an000;save handle returned | ||
| 197 | ; $if z ;an000;good return | ||
| 198 | JNZ $$IF17 | ||
| 199 | pushf ;an000;save our flags | ||
| 200 | call XM_DISP1 ;an000;tell user results | ||
| 201 | popf ;an000;restore our flags | ||
| 202 | ; $else ;an000; | ||
| 203 | JMP SHORT $$EN17 | ||
| 204 | $$IF17: | ||
| 205 | call XM_ERROR ;an000;print error message | ||
| 206 | ; $endif ;an000; | ||
| 207 | $$EN17: | ||
| 208 | ; $else ;an000;EMS not active | ||
| 209 | JMP SHORT $$EN16 | ||
| 210 | $$IF16: | ||
| 211 | call XM_ERROR ;an000;say why not active | ||
| 212 | ; $endif ;an000; | ||
| 213 | $$EN16: | ||
| 214 | |||
| 215 | ret ;an000;return to caller | ||
| 216 | |||
| 217 | XM_EMS_ALLOC endp ;an000; | ||
| 218 | |||
| 219 | |||
| 220 | ;========================================================================= | ||
| 221 | ; XM_EMS_MAP : This function will provide the user the | ||
| 222 | ; capability to set and change EMS logical and | ||
| 223 | ; physical pages within page frame 0. | ||
| 224 | ; | ||
| 225 | ; Inputs: none | ||
| 226 | ; | ||
| 227 | ; Outputs: EMS page frames set or altered | ||
| 228 | ; | ||
| 229 | ; Date: 6/24/87 | ||
| 230 | ;========================================================================= | ||
| 231 | |||
| 232 | XM_EMS_MAP proc near ;an000;XM functions | ||
| 233 | |||
| 234 | call XM_GET_MAN_STATUS ;an000;see if EMS active | ||
| 235 | ; $if nc ;an000;EMS active | ||
| 236 | JC $$IF22 | ||
| 237 | call XM_LOG_PROMPT ;an000;get logical page | ||
| 238 | call XM_PHY_PROMPT ;an000;get physical page | ||
| 239 | call XM_HAN_PROMPT ;an000;get handle | ||
| 240 | call XM_MAP_MEMORY ;an000;map the page | ||
| 241 | ; $if z ;an000;good return | ||
| 242 | JNZ $$IF23 | ||
| 243 | pushf ;an000;save our flags | ||
| 244 | call XM_DISP2 ;an000;tell user results | ||
| 245 | popf ;an000;restore our flags | ||
| 246 | ; $else ;an000; | ||
| 247 | JMP SHORT $$EN23 | ||
| 248 | $$IF23: | ||
| 249 | call XM_ERROR ;an000;tell error | ||
| 250 | ; $endif ;an000; | ||
| 251 | $$EN23: | ||
| 252 | ; $else ;an000;EMS not active | ||
| 253 | JMP SHORT $$EN22 | ||
| 254 | $$IF22: | ||
| 255 | call XM_ERROR ;an000;say why not active | ||
| 256 | ; $endif ;an000; | ||
| 257 | $$EN22: | ||
| 258 | |||
| 259 | ret ;an000;return to caller | ||
| 260 | |||
| 261 | XM_EMS_MAP endp ;an000; | ||
| 262 | |||
| 263 | ;========================================================================= | ||
| 264 | ; XM_GET_MAN_STATUS : This routine will determine if EMS is active for | ||
| 265 | ; this session. | ||
| 266 | ; | ||
| 267 | ; Called Procs: none | ||
| 268 | ; | ||
| 269 | ; Inputs: none | ||
| 270 | ; | ||
| 271 | ; Outputs: Z - no error | ||
| 272 | ; NZ - error | ||
| 273 | ; AH - error message number | ||
| 274 | ; | ||
| 275 | ; Date: 6/24/87 | ||
| 276 | ;========================================================================= | ||
| 277 | |||
| 278 | XM_GET_MAN_STATUS proc near ;an000;see if EMS active | ||
| 279 | |||
| 280 | push ds ;an000;save ds - we stomp it | ||
| 281 | mov ax,00h ;an000;set ax to 0 | ||
| 282 | mov ds,ax ;an000;set ds to 0 | ||
| 283 | cmp ds:word ptr[067h*4+0],0 ;an000;see if int 67h is there | ||
| 284 | pop ds ;an000;restore ds | ||
| 285 | ; $if e ;an000;EMS not installed | ||
| 286 | JNE $$IF28 | ||
| 287 | stc ;an000;flag no ems | ||
| 288 | mov ah,XM_NOT_INST ;an000;signal EMS not installed | ||
| 289 | ; $else ;an000; | ||
| 290 | JMP SHORT $$EN28 | ||
| 291 | $$IF28: | ||
| 292 | call XM_INSTALL_CHECK ;an000;see if EMS installed | ||
| 293 | ; $if z ;AN000;IS EMS INSTALLED | ||
| 294 | JNZ $$IF30 | ||
| 295 | clc ;AN000;EMS INSTALLED - FLAG IT | ||
| 296 | ; $else ;an000; | ||
| 297 | JMP SHORT $$EN30 | ||
| 298 | $$IF30: | ||
| 299 | stc ;AN000;FLAG EMS NOT INSTALLED | ||
| 300 | mov ah,XM_NOT_INST ;an000;signal EMS not installed | ||
| 301 | ; $endif ;an000; | ||
| 302 | $$EN30: | ||
| 303 | ; $endif ;an000; | ||
| 304 | $$EN28: | ||
| 305 | |||
| 306 | RET ;AN000;RETURN TO CALLER | ||
| 307 | |||
| 308 | |||
| 309 | XM_GET_MAN_STATUS endp ;an000; | ||
| 310 | |||
| 311 | |||
| 312 | |||
| 313 | ;========================================================================= | ||
| 314 | ; XM_PAGE_PROMPT : This routine prompts the user for the number of | ||
| 315 | ; pages to be allocated, if he desires a new handle. | ||
| 316 | ; This routine will determine whether or not the other | ||
| 317 | ; prompt messages will be displayed. | ||
| 318 | ; | ||
| 319 | ; Called Procs: STD_PRINTF | ||
| 320 | ; XM_PARSE | ||
| 321 | ; | ||
| 322 | ; Inputs: none | ||
| 323 | ; | ||
| 324 | ; Outputs: XM_PAGE_FLAG | ||
| 325 | ; XM_PAGE_BUF | ||
| 326 | ; XM_PAGE | ||
| 327 | ; | ||
| 328 | ; Date: 6/24/87 | ||
| 329 | ;========================================================================= | ||
| 330 | |||
| 331 | XM_PAGE_PROMPT proc near ;an000;prompt user for number | ||
| 332 | ; of pages to allocate | ||
| 333 | call SCANB ;an000;see if parm entered | ||
| 334 | ; $if nz ;an000;if parm found | ||
| 335 | JZ $$IF34 | ||
| 336 | mov cx,02 ;an000;bytes to parse | ||
| 337 | call GETHX ;an000;get hex value | ||
| 338 | ; $if c ;an000;no an error occurred | ||
| 339 | JNC $$IF35 | ||
| 340 | call PERR ;an000;display ^ error | ||
| 341 | ; $else ;an000; | ||
| 342 | JMP SHORT $$EN35 | ||
| 343 | $$IF35: | ||
| 344 | mov dg:XM_PAGE,dl ;an000;save page count | ||
| 345 | ; $endif ;an000; | ||
| 346 | $$EN35: | ||
| 347 | ; $else ;an000; | ||
| 348 | JMP SHORT $$EN34 | ||
| 349 | $$IF34: | ||
| 350 | call PERR ;an000;display ^ error | ||
| 351 | ; $endif ;an000; | ||
| 352 | $$EN34: | ||
| 353 | |||
| 354 | ret ;an000;return to caller | ||
| 355 | |||
| 356 | XM_PAGE_PROMPT endp ;an000; | ||
| 357 | |||
| 358 | |||
| 359 | ;========================================================================= | ||
| 360 | ; XM_LOG_PROMPT : This routine prompts the user for the number of the | ||
| 361 | ; logical page that is to be mapped in EMS. This | ||
| 362 | ; routine will not be performed if a page count | ||
| 363 | ; was specified. | ||
| 364 | ; | ||
| 365 | ; Called Procs: STD_PRINTF | ||
| 366 | ; XM_PARSE | ||
| 367 | ; | ||
| 368 | ; Inputs: none | ||
| 369 | ; | ||
| 370 | ; Outputs: XM_LOG_BUF | ||
| 371 | ; XM_LOG | ||
| 372 | ; | ||
| 373 | ; Date: 6/24/87 | ||
| 374 | ;========================================================================= | ||
| 375 | |||
| 376 | |||
| 377 | XM_LOG_PROMPT proc near ;an000;prompt user for the | ||
| 378 | ; logical page to be | ||
| 379 | ; mapped | ||
| 380 | call SCANB ;an000;see if parm entered | ||
| 381 | ; $if nz ;an000;parm entered | ||
| 382 | JZ $$IF40 | ||
| 383 | mov cx,02 ;an000;bytes to parse | ||
| 384 | call GETHX ;an000;get hex value | ||
| 385 | ; $if c ;an000;no an error occurred | ||
| 386 | JNC $$IF41 | ||
| 387 | call PERR ;an000;display ^ error | ||
| 388 | ; $else ;an000; | ||
| 389 | JMP SHORT $$EN41 | ||
| 390 | $$IF41: | ||
| 391 | mov dg:XM_LOG,dl ;an000;save logical page | ||
| 392 | ; $endif ;an000; | ||
| 393 | $$EN41: | ||
| 394 | ; $else ;an000; | ||
| 395 | JMP SHORT $$EN40 | ||
| 396 | $$IF40: | ||
| 397 | call PERR ;an000;display ^ error | ||
| 398 | ; $endif ;an000; | ||
| 399 | $$EN40: | ||
| 400 | |||
| 401 | ret ;an000;return to caller | ||
| 402 | |||
| 403 | XM_LOG_PROMPT endp ;an000; | ||
| 404 | |||
| 405 | |||
| 406 | ;========================================================================= | ||
| 407 | ; XM_PHY_PROMPT : This routine prompts the user for the number of the | ||
| 408 | ; physical page that is to be mapped in EMS. This | ||
| 409 | ; routine will not be performed if a page count | ||
| 410 | ; was specified. | ||
| 411 | ; | ||
| 412 | ; Called Procs: STD_PRINTF | ||
| 413 | ; XM_PARSE | ||
| 414 | ; | ||
| 415 | ; Inputs: none | ||
| 416 | ; | ||
| 417 | ; Outputs: XM_PHY_BUF | ||
| 418 | ; XM_PHY | ||
| 419 | ; | ||
| 420 | ; Date: 6/24/87 | ||
| 421 | ;========================================================================= | ||
| 422 | |||
| 423 | |||
| 424 | XM_PHY_PROMPT proc near ;an000;prompt user for the | ||
| 425 | ; physical page to be | ||
| 426 | ; mapped | ||
| 427 | call SCANB ;an000;see if parm entered | ||
| 428 | ; $if nz ;an000;parm found | ||
| 429 | JZ $$IF46 | ||
| 430 | mov cx,02 ;an000;bytes to parse | ||
| 431 | call GETHX ;an000;get hex value | ||
| 432 | ; $if c ;an000;no an error occurred | ||
| 433 | JNC $$IF47 | ||
| 434 | call PERR ;an000;display ^ error | ||
| 435 | ; $else ;an000; | ||
| 436 | JMP SHORT $$EN47 | ||
| 437 | $$IF47: | ||
| 438 | mov dg:XM_PHY,dl ;an000;save logical page | ||
| 439 | ; $endif ;an000; | ||
| 440 | $$EN47: | ||
| 441 | ; $else ;an000; | ||
| 442 | JMP SHORT $$EN46 | ||
| 443 | $$IF46: | ||
| 444 | call PERR ;an000; | ||
| 445 | ; $endif ;an000; | ||
| 446 | $$EN46: | ||
| 447 | |||
| 448 | ret ;an000;return to caller | ||
| 449 | |||
| 450 | XM_PHY_PROMPT endp ;an000; | ||
| 451 | |||
| 452 | |||
| 453 | ;========================================================================= | ||
| 454 | ; XM_HAN_PROMPT : This routine prompts the user for the number of the | ||
| 455 | ; handle that the mapping is to occur on. This | ||
| 456 | ; routine will not be performed if a page count | ||
| 457 | ; was specified. | ||
| 458 | ; | ||
| 459 | ; Called Procs: STD_PRINTF | ||
| 460 | ; XM_PARSE | ||
| 461 | ; | ||
| 462 | ; Inputs: none | ||
| 463 | ; | ||
| 464 | ; Outputs: XM_HAN_BUF | ||
| 465 | ; XM_HAN | ||
| 466 | ; | ||
| 467 | ; Date: 6/24/87 | ||
| 468 | ;========================================================================= | ||
| 469 | |||
| 470 | |||
| 471 | XM_HAN_PROMPT proc near ;an000;prompt user for the | ||
| 472 | ; handle to be mapped | ||
| 473 | call SCANB ;an000;see if parm entered | ||
| 474 | ; $if nz ;an000;prompt found | ||
| 475 | JZ $$IF52 | ||
| 476 | mov cx,04 ;an000;bytes to parse | ||
| 477 | call GETHX ;an000;get hex value | ||
| 478 | ; $if c ;an000;no an error occurred | ||
| 479 | JNC $$IF53 | ||
| 480 | call PERR ;an000;display ^ error | ||
| 481 | ; $else ;an000; | ||
| 482 | JMP SHORT $$EN53 | ||
| 483 | $$IF53: | ||
| 484 | mov dg:XM_HANDLE,dx ;an000;save logical page | ||
| 485 | ; $endif ;an000; | ||
| 486 | $$EN53: | ||
| 487 | ; $else ;an000; | ||
| 488 | JMP SHORT $$EN52 | ||
| 489 | $$IF52: | ||
| 490 | call PERR ;an000;display ^ error | ||
| 491 | ; $endif ;an000; | ||
| 492 | $$EN52: | ||
| 493 | |||
| 494 | ret ;an000;return to caller | ||
| 495 | |||
| 496 | XM_HAN_PROMPT endp ;an000; | ||
| 497 | |||
| 498 | |||
| 499 | |||
| 500 | ;========================================================================= | ||
| 501 | ; XM_GET_HAN_ALLOC : This routine will get a handle and allocate the | ||
| 502 | ; requested number of pages to that handle. | ||
| 503 | ; | ||
| 504 | ; Called Procs: none | ||
| 505 | ; | ||
| 506 | ; Inputs: XM_PAGE - number of pages to allocate to handle | ||
| 507 | ; | ||
| 508 | ; Outputs: Z - no error | ||
| 509 | ; NZ - error | ||
| 510 | ; DX - handle allocated | ||
| 511 | ; | ||
| 512 | ; Date: 6/24/87 | ||
| 513 | ;========================================================================= | ||
| 514 | |||
| 515 | XM_GET_HAN_ALLOC proc near ;an000;create handle and alloc. | ||
| 516 | ; requested pages. | ||
| 517 | push bx ;an000;save regs. | ||
| 518 | mov ah,EMS_HAN_ALLOC ;an000;function 43h | ||
| 519 | xor bh,bh ;an000;clear byte | ||
| 520 | mov bl,dg:XM_PAGE ;an000;number of pages to | ||
| 521 | ; allocate | ||
| 522 | int 67h ;an000;call EMS | ||
| 523 | or ah,ah ;an000;was there an error | ||
| 524 | pop bx ;an000;restore regs. | ||
| 525 | |||
| 526 | ret ;an000;return to caller | ||
| 527 | |||
| 528 | XM_GET_HAN_ALLOC endp ;an000; | ||
| 529 | |||
| 530 | ;========================================================================= | ||
| 531 | ; XM_MAP_MEMORY : This routine will map the requested logical page | ||
| 532 | ; to the requested physical page in EMS. | ||
| 533 | ; | ||
| 534 | ; Called Procs: none | ||
| 535 | ; | ||
| 536 | ; Inputs: XM_PHY - physical page to map to | ||
| 537 | ; XM_HAN - logical page to map | ||
| 538 | ; | ||
| 539 | ; Outputs: Z - no error | ||
| 540 | ; NZ - error | ||
| 541 | ; page mapped | ||
| 542 | ; | ||
| 543 | ; Date: 6/24/87 | ||
| 544 | ;========================================================================= | ||
| 545 | |||
| 546 | XM_MAP_MEMORY proc near ;an000;map a logical page to | ||
| 547 | ; a physical page in | ||
| 548 | ; EMS | ||
| 549 | push bx ;an000;save regs. | ||
| 550 | push dx ;an000; | ||
| 551 | mov ah,EMS_MAP_MEMORY ;an000;function 44h | ||
| 552 | mov al,dg:XM_PHY ;an000;physical page to map | ||
| 553 | xor bh,bh ;an000;zero byte | ||
| 554 | mov bl,dg:XM_LOG ;an000;logical page to map | ||
| 555 | mov dx,dg:XM_HANDLE ;an000;handle to map page to | ||
| 556 | int 67h ;an000;call EMS | ||
| 557 | or ah,ah ;an000;was there an error | ||
| 558 | pop dx ;an000;restore regs. | ||
| 559 | pop bx ;an000; | ||
| 560 | |||
| 561 | ret ;an000;return to caller | ||
| 562 | |||
| 563 | XM_MAP_MEMORY endp ;an000; | ||
| 564 | |||
| 565 | |||
| 566 | ;========================================================================= | ||
| 567 | ; XM_DISP1 : This routine displays the current page frame and | ||
| 568 | ; the handle created as a result of the allocate pages. | ||
| 569 | ; | ||
| 570 | ; Called Procs: STD_PRINTF | ||
| 571 | ; | ||
| 572 | ; Inputs: XM_FRAME_SEG - page frame segment | ||
| 573 | ; XM_HANDLE_RET - created handle | ||
| 574 | ; XM_PG_FRAME_PTR - pointer to message | ||
| 575 | ; XM_HAN_RET_PTR - pointer to message | ||
| 576 | ; | ||
| 577 | ; Outputs: "Page Frame Segment : %1",0d,0a | ||
| 578 | ; "Handle Created : %1",0d,0a | ||
| 579 | ; | ||
| 580 | ; Date: 6/24/87 | ||
| 581 | ;========================================================================= | ||
| 582 | |||
| 583 | XM_DISP1 proc near ;an000;display messages | ||
| 584 | |||
| 585 | mov dx,offset dg:XM_HAN_RET_PTR ;an000;"Handle Created : " | ||
| 586 | call STD_PRINTF ;an000;call message ret. | ||
| 587 | |||
| 588 | ret ;an000;return to caller | ||
| 589 | |||
| 590 | XM_DISP1 endp ;an000; | ||
| 591 | |||
| 592 | |||
| 593 | ;========================================================================= | ||
| 594 | ; XM_DISP2 : This routine displays the logical page mapped and | ||
| 595 | ; the physical page it was mapped to. | ||
| 596 | ; | ||
| 597 | ; Called Procs: STD_PRINTF | ||
| 598 | ; | ||
| 599 | ; Inputs: XM_MAPPED_PTR - pointer to message | ||
| 600 | ; XM_LOG - logical page mapped | ||
| 601 | ; XM_PHY - physical page mapped | ||
| 602 | ; | ||
| 603 | ; Outputs: "Logical page %1 mapped to physical page %2",0d0a | ||
| 604 | ; | ||
| 605 | ; Date: 6/24/87 | ||
| 606 | ;========================================================================= | ||
| 607 | |||
| 608 | XM_DISP2 proc near ;an000;display messages | ||
| 609 | |||
| 610 | mov dx,offset dg:XM_MAPPED_PTR ;an000;"Logical page %1 mapped | ||
| 611 | ; to physical page %2" | ||
| 612 | call STD_PRINTF ;an000;call message ret. | ||
| 613 | |||
| 614 | ret ;an000;return to caller | ||
| 615 | |||
| 616 | XM_DISP2 endp ;an000; | ||
| 617 | |||
| 618 | ;========================================================================= | ||
| 619 | ; XM_ERROR: This routine will determine what error we have by | ||
| 620 | ; querying the result in the AH register. It will then | ||
| 621 | ; report the error to the user through STD_PRINTF | ||
| 622 | ; | ||
| 623 | ; Called Procs: STD_PRINTF | ||
| 624 | ; | ||
| 625 | ; Inputs: AH - error code | ||
| 626 | ; | ||
| 627 | ; Outputs: error message | ||
| 628 | ; | ||
| 629 | ; Date: 6/24/87 | ||
| 630 | ;========================================================================= | ||
| 631 | |||
| 632 | XM_ERROR proc near ;an000;error message printer | ||
| 633 | |||
| 634 | cmp ah,XM_ERR80 ;an000;error message | ||
| 635 | ; $if e ;an000;found message | ||
| 636 | JNE $$IF58 | ||
| 637 | mov dx,offset dg:XM_ERR80_PTR ;an000;point to message | ||
| 638 | jmp XM_ERROR_CONT ;an000;print error | ||
| 639 | ; $endif | ||
| 640 | $$IF58: | ||
| 641 | |||
| 642 | cmp ah,XM_ERR83 ;an000;error message | ||
| 643 | ; $if e ;an000;found message | ||
| 644 | JNE $$IF60 | ||
| 645 | mov dx,offset dg:XM_ERR83_PTR ;an000;point to message | ||
| 646 | jmp XM_ERROR_CONT ;an000;print error | ||
| 647 | ; $endif | ||
| 648 | $$IF60: | ||
| 649 | |||
| 650 | cmp ah,XM_ERR84 ;an000;error message | ||
| 651 | ; $if e ;an000;found message | ||
| 652 | JNE $$IF62 | ||
| 653 | mov dx,offset dg:XM_ERR84_PTR ;an000;point to message | ||
| 654 | jmp XM_ERROR_CONT ;an000;print error | ||
| 655 | ; $endif | ||
| 656 | $$IF62: | ||
| 657 | |||
| 658 | cmp ah,XM_ERR85 ;an000;error message | ||
| 659 | ; $if e ;an000;found message | ||
| 660 | JNE $$IF64 | ||
| 661 | mov dx,offset dg:XM_ERR85_PTR ;an000;point to message | ||
| 662 | jmp XM_ERROR_CONT ;an000;print error | ||
| 663 | ; $endif | ||
| 664 | $$IF64: | ||
| 665 | |||
| 666 | |||
| 667 | cmp ah,XM_ERR86 ;an000;error message | ||
| 668 | ; $if e ;an000;found message | ||
| 669 | JNE $$IF66 | ||
| 670 | mov dx,offset dg:XM_ERR86_PTR ;an000;point to message | ||
| 671 | jmp XM_ERROR_CONT ;an000;print error | ||
| 672 | ; $endif | ||
| 673 | $$IF66: | ||
| 674 | |||
| 675 | cmp ah,XM_ERR87 ;an000;error message | ||
| 676 | ; $if e ;an000;found message | ||
| 677 | JNE $$IF68 | ||
| 678 | mov dx,offset dg:XM_ERR87_PTR ;an000;point to message | ||
| 679 | jmp XM_ERROR_CONT ;an000;print error | ||
| 680 | ; $endif | ||
| 681 | $$IF68: | ||
| 682 | |||
| 683 | cmp ah,XM_ERR88 ;an000;error message | ||
| 684 | ; $if e ;an000;found message | ||
| 685 | JNE $$IF70 | ||
| 686 | mov dx,offset dg:XM_ERR88_PTR ;an000;point to message | ||
| 687 | jmp XM_ERROR_CONT ;an000;print error | ||
| 688 | ; $endif | ||
| 689 | $$IF70: | ||
| 690 | |||
| 691 | cmp ah,XM_ERR89 ;an000;error message | ||
| 692 | ; $if e ;an000;found message | ||
| 693 | JNE $$IF72 | ||
| 694 | mov dx,offset dg:XM_ERR89_PTR ;an000;point to message | ||
| 695 | jmp XM_ERROR_CONT ;an000;print error | ||
| 696 | ; $endif | ||
| 697 | $$IF72: | ||
| 698 | |||
| 699 | cmp ah,XM_ERR8A ;an000;error message | ||
| 700 | ; $if e ;an000;found message | ||
| 701 | JNE $$IF74 | ||
| 702 | mov dx,offset dg:XM_ERR8A_PTR ;an000;point to message | ||
| 703 | jmp XM_ERROR_CONT ;an000;print error | ||
| 704 | ; $endif | ||
| 705 | $$IF74: | ||
| 706 | |||
| 707 | cmp ah,XM_ERR8B ;an000;error message | ||
| 708 | ; $if e ;an000;found message | ||
| 709 | JNE $$IF76 | ||
| 710 | mov dx,offset dg:XM_ERR8B_PTR ;an000;point to message | ||
| 711 | jmp XM_ERROR_CONT ;an000;print error | ||
| 712 | ; $endif | ||
| 713 | $$IF76: | ||
| 714 | |||
| 715 | cmp ah,XM_ERR8D ;an000;error message | ||
| 716 | ; $if e ;an000;found message | ||
| 717 | JNE $$IF78 | ||
| 718 | mov dx,offset dg:XM_ERR8D_PTR ;an000;point to message | ||
| 719 | jmp XM_ERROR_CONT ;an000;print error | ||
| 720 | ; $endif | ||
| 721 | $$IF78: | ||
| 722 | |||
| 723 | cmp ah,XM_ERR8E ;an000;error message | ||
| 724 | ; $if e ;an000;found message | ||
| 725 | JNE $$IF80 | ||
| 726 | mov dx,offset dg:XM_ERR8E_PTR ;an000;point to message | ||
| 727 | jmp XM_ERROR_CONT ;an000;print error | ||
| 728 | ; $endif | ||
| 729 | $$IF80: | ||
| 730 | |||
| 731 | cmp ah,XM_NOT_INST ;an000;EMS not installed | ||
| 732 | ; $if e ;an000;found message | ||
| 733 | JNE $$IF82 | ||
| 734 | mov dx,offset dg:XM_ERRFF_PTR ;an000;point to message | ||
| 735 | jmp XM_ERROR_CONT ;an000;print error | ||
| 736 | ; $endif ;an000; | ||
| 737 | $$IF82: | ||
| 738 | |||
| 739 | mov dx,offset dg:XM_ERR_GEN_PTR ;an000;general error message | ||
| 740 | |||
| 741 | XM_ERROR_CONT: | ||
| 742 | |||
| 743 | call STD_PRINTF ;an000;call message ret. | ||
| 744 | |||
| 745 | ret ;an000;return to caller | ||
| 746 | |||
| 747 | XM_ERROR endp ;an000; | ||
| 748 | |||
| 749 | ;========================================================================= | ||
| 750 | ; XM_PARSE_ERROR : This routine will display that an error has occurred | ||
| 751 | ; on the input of the requested data. | ||
| 752 | ; | ||
| 753 | ; Called Procs: STD_PRINTF | ||
| 754 | ; | ||
| 755 | ; Inputs: XM_PARSE_ERR_PTR - error message | ||
| 756 | ; | ||
| 757 | ; Outputs: "Invalid value for parameter",0d,0a | ||
| 758 | ; | ||
| 759 | ; Date: 6/24/87 | ||
| 760 | ;========================================================================= | ||
| 761 | |||
| 762 | XM_PARSE_ERROR proc near ;an000;input error message | ||
| 763 | |||
| 764 | mov dx,offset dg:XM_PARSE_ERR_PTR ;an000;error message | ||
| 765 | call STD_PRINTF ;an000;call message ret. | ||
| 766 | ret ;an000;return to caller | ||
| 767 | |||
| 768 | XM_PARSE_ERROR endp ;an000; | ||
| 769 | |||
| 770 | |||
| 771 | |||
| 772 | ;========================================================================= | ||
| 773 | ; XM_EMS_STATUS : This function will provide the user with | ||
| 774 | ; a report the the current status of EMS. | ||
| 775 | ; | ||
| 776 | ; Inputs: none | ||
| 777 | ; | ||
| 778 | ; Outputs: EMS page frames set or altered | ||
| 779 | ; | ||
| 780 | ; Date: 6/24/87 | ||
| 781 | ;========================================================================= | ||
| 782 | |||
| 783 | XM_EMS_STATUS proc near ;an000;XM functions | ||
| 784 | |||
| 785 | call XM_GET_MAN_STATUS ;an000;see if EMS active | ||
| 786 | ; $if nc ;an000;EMS active | ||
| 787 | JC $$IF84 | ||
| 788 | call XM_CURR_STATUS ;an000;current status of EMS | ||
| 789 | ; $else ;an000;EMS not active | ||
| 790 | JMP SHORT $$EN84 | ||
| 791 | $$IF84: | ||
| 792 | call XM_ERROR ;an000;say why not active | ||
| 793 | ; $endif ;an000; | ||
| 794 | $$EN84: | ||
| 795 | |||
| 796 | ret ;an000;return to caller | ||
| 797 | |||
| 798 | XM_EMS_STATUS endp ;an000; | ||
| 799 | |||
| 800 | |||
| 801 | ;========================================================================= | ||
| 802 | ; XM_CURR_STATUS : This routine will display the current status of | ||
| 803 | ; all active EMS handles. | ||
| 804 | ; | ||
| 805 | ; Inputs : none | ||
| 806 | ; | ||
| 807 | ; Outputs : Current status of all active EMS handles | ||
| 808 | ; "Handle %1 has %2 pages allocated" | ||
| 809 | ; | ||
| 810 | ; Physical page with it associated frame segment | ||
| 811 | ; "Physical page %1 = Frame segment %2" | ||
| 812 | ; | ||
| 813 | ; Date: 8/05/86 | ||
| 814 | ;========================================================================= | ||
| 815 | |||
| 816 | XM_CURR_STATUS proc near ;an000;current EMS status | ||
| 817 | |||
| 818 | mov ah,EMS_HANDLE_PAGES ;an000;get handle pages | ||
| 819 | mov di,offset dg:XM_HANDLE_PAGES_BUF ;an000;point to the buffer | ||
| 820 | int 67h ;an000; | ||
| 821 | |||
| 822 | or ah,ah ;an000;see if an error occurred | ||
| 823 | ; $if z ;an000;no error | ||
| 824 | JNZ $$IF87 | ||
| 825 | ; $do ;an000;do while data in buffer | ||
| 826 | $$DO88: | ||
| 827 | cmp bx,0 ;an000;end of buffer? | ||
| 828 | ; $leave e ;an000;yes | ||
| 829 | JE $$EN88 | ||
| 830 | mov ax,word ptr es:[di] ;an000;page handle | ||
| 831 | mov dg:XM_HANDLE_RET,ax ;an000;save in var | ||
| 832 | mov ax,word ptr es:[di+02];an000;page count | ||
| 833 | mov dg:XM_PAGE_CNT,ax ;an000;save in var | ||
| 834 | mov dx,offset dg:XM_STATUS_PTR ;an000;point to message | ||
| 835 | call STD_PRINTF ;an000;print it | ||
| 836 | add di,04h ;an000;next record | ||
| 837 | dec bx ;an000;decrement counter | ||
| 838 | ; $enddo ;an000; | ||
| 839 | JMP SHORT $$DO88 | ||
| 840 | $$EN88: | ||
| 841 | |||
| 842 | call CRLF ;an000;place a blank line | ||
| 843 | ; between reports | ||
| 844 | |||
| 845 | call XM_FRAME_BUFFER ;an000;get frame buffer | ||
| 846 | ;ES:DI points to frame buffer | ||
| 847 | ; $do ;an000;while cx not = 0 | ||
| 848 | $$DO91: | ||
| 849 | cmp cx,00 ;an000;at end? | ||
| 850 | ; $leave e ;an000;yes | ||
| 851 | JE $$EN91 | ||
| 852 | call XM_GET_FRAME_SEG ;an000;obtain page and seg | ||
| 853 | mov dx,offset dg:XM_PAGE_SEG_PTR ;an000;message | ||
| 854 | call STD_PRINTF ;an000;print it | ||
| 855 | dec cx ;an000;decrease counter | ||
| 856 | add di,04 ;an000;adjust pointer | ||
| 857 | ; $enddo ;an000; | ||
| 858 | JMP SHORT $$DO91 | ||
| 859 | $$EN91: | ||
| 860 | |||
| 861 | call XM_UNALL_COUNT ;an000;display page status | ||
| 862 | call XM_HANDLE_COUNT ;an000;display handle status | ||
| 863 | |||
| 864 | ; $else | ||
| 865 | JMP SHORT $$EN87 | ||
| 866 | $$IF87: | ||
| 867 | call XM_ERROR ;an000;display the error | ||
| 868 | ; $endif ;an000; | ||
| 869 | $$EN87: | ||
| 870 | ret ;an000; | ||
| 871 | |||
| 872 | XM_CURR_STATUS endp ;an000; | ||
| 873 | |||
| 874 | ;========================================================================= | ||
| 875 | ; XM_UNALL_COUNT : This routine generates a line of the status report | ||
| 876 | ; displaying the number of pages allocated out of | ||
| 877 | ; the total possible | ||
| 878 | ; | ||
| 879 | ; Inputs : none | ||
| 880 | ; | ||
| 881 | ; Outputs : Current status of allocated pages | ||
| 882 | ; "%1 of a total %2 EMS pages have been allocated" | ||
| 883 | ; | ||
| 884 | ; Date: 8/05/86 | ||
| 885 | ;========================================================================= | ||
| 886 | |||
| 887 | XM_UNALL_COUNT proc near ;an000; | ||
| 888 | |||
| 889 | mov ah,EMS_UNALL_PG_CNT ;an000;see how many pages | ||
| 890 | ; remaining | ||
| 891 | int 67h ;an000; | ||
| 892 | or ah,ah ;an000;see if error | ||
| 893 | |||
| 894 | ; $if z ;an000;no error | ||
| 895 | JNZ $$IF96 | ||
| 896 | push bx ;an000;save bx | ||
| 897 | push dx ;an000;save dx | ||
| 898 | call CRLF ;an000; | ||
| 899 | pop dx ;an000;restore dx | ||
| 900 | pop bx ;an000;restore bx | ||
| 901 | mov ax,dx ;an000;total page count | ||
| 902 | sub ax,bx ;an000;get pages allocated | ||
| 903 | mov dg:XM_ALLOC_PG,ax ;an000;save allocated pages | ||
| 904 | mov dg:XM_TOTAL_PG,dx ;an000;save total page count | ||
| 905 | mov dx,offset dg:XM_UNALL_PTR ;an000;"%1 of a total %2 EMS | ||
| 906 | ; pages have been allocated",cr,lf | ||
| 907 | call STD_PRINTF ;an000;print it | ||
| 908 | ; $endif ;an000; | ||
| 909 | $$IF96: | ||
| 910 | |||
| 911 | ret ;an000; | ||
| 912 | |||
| 913 | XM_UNALL_COUNT endp ;an000; | ||
| 914 | |||
| 915 | |||
| 916 | ;========================================================================= | ||
| 917 | ; XM_HANDLE_COUNT: This routine generates a line of the status report | ||
| 918 | ; displaying the number of handles allocated out of | ||
| 919 | ; the total possible. | ||
| 920 | ; | ||
| 921 | ; Inputs : none | ||
| 922 | ; | ||
| 923 | ; Outputs : Current status of allocated pages | ||
| 924 | ; "%1 of a total %2 EMS handles have been allocated" | ||
| 925 | ; | ||
| 926 | ; Date: 8/05/86 | ||
| 927 | ;========================================================================= | ||
| 928 | |||
| 929 | XM_HANDLE_COUNT proc near ;an000; | ||
| 930 | |||
| 931 | mov ah,EMS_HANDLE_CNT ;an000;see how many handles | ||
| 932 | ; possible | ||
| 933 | int 67h ;an000; | ||
| 934 | or ah,ah ;an000;see if error | ||
| 935 | |||
| 936 | ; $if z ;an000;no error | ||
| 937 | JNZ $$IF98 | ||
| 938 | mov ax,EMS_HANDLE_TOTAL ;an000;total possible handles | ||
| 939 | mov dg:XM_HAN_TOTAL,ax ;an000;save total page count | ||
| 940 | mov dg:XM_HAN_ALLOC,bx ;an000;save allocated pages | ||
| 941 | mov dx,offset dg:XM_HAN_ALLOC_PTR | ||
| 942 | ;an000;"%1 of a total %2 EMS | ||
| 943 | ; handles have been allocated",cr,lf | ||
| 944 | call STD_PRINTF ;an000;print it | ||
| 945 | ; $endif ;an000; | ||
| 946 | $$IF98: | ||
| 947 | |||
| 948 | ret ;an000; | ||
| 949 | |||
| 950 | XM_HANDLE_COUNT endp ;an000; | ||
| 951 | |||
| 952 | |||
| 953 | ;========================================================================= | ||
| 954 | ; XM_FRAME_SEG : This routine accesses the vector created by | ||
| 955 | ; function 58h, int 67h. It obtains a physical | ||
| 956 | ; page of EMS and its segment from this vector | ||
| 957 | ; | ||
| 958 | ; Inputs : ES:DI - points to frame buffer | ||
| 959 | ; | ||
| 960 | ; Outputs : XM_PHY - a physical page in EMS | ||
| 961 | ; XM_FRAME - segment corresponding to the physical page | ||
| 962 | ; | ||
| 963 | ; Date: 8/05/86 | ||
| 964 | ;========================================================================= | ||
| 965 | |||
| 966 | |||
| 967 | XM_GET_FRAME_SEG proc near ;an000;find the frame segment | ||
| 968 | |||
| 969 | mov al,byte ptr es:[di+2] ;an000;get physical page | ||
| 970 | mov dg:XM_PHY,al ;an000;place in print var | ||
| 971 | mov ax,word ptr es:[di] ;an000;get frame segment | ||
| 972 | mov dg:XM_FRAME,ax ;an000;place in print var | ||
| 973 | |||
| 974 | ret ;an000; | ||
| 975 | |||
| 976 | XM_GET_FRAME_SEG endp ;an000; | ||
| 977 | |||
| 978 | ;========================================================================= | ||
| 979 | ; XM_INSTALL_CHECK: This routine performs function 51h, int 67h to | ||
| 980 | ; determine if EMS is indeed active. | ||
| 981 | ; | ||
| 982 | ; Inputs : XM_FRAME_BUFFER - used to receive physical page | ||
| 983 | ; and segment data for EMS. | ||
| 984 | ; | ||
| 985 | ; Outputs : XM_FRAME_BUFFER - buffer holds physical page | ||
| 986 | ; and segment data for EMS. | ||
| 987 | ; | ||
| 988 | ; Date: 8/05/86 | ||
| 989 | ;========================================================================= | ||
| 990 | |||
| 991 | XM_INSTALL_CHECK proc near ;an000;see if EMS installed | ||
| 992 | |||
| 993 | MOV AH,EMS_GET_MAN_STAT ;AN000;GET EMS STATUS | ||
| 994 | XOR AL,AL ;an000;clear low byte | ||
| 995 | INT 67h ;an000; | ||
| 996 | OR AH,AH ;an000;check for error | ||
| 997 | ; $IF Z ;an000;no error | ||
| 998 | JNZ $$IF100 | ||
| 999 | MOV AH,EMS_VERSION ;an000;get version number | ||
| 1000 | INT 67h ;an000; | ||
| 1001 | CMP AL,EMS_LIM_40 ;an000;LIM 4.0 ? | ||
| 1002 | ; $IF AE ;an000;4.0 or greater | ||
| 1003 | JNAE $$IF101 | ||
| 1004 | MOV AH,00h ;an000;set up for flag pass | ||
| 1005 | OR AH,AH ;an000;set flag to ZR | ||
| 1006 | ; $ELSE ;an000;below 4.0 | ||
| 1007 | JMP SHORT $$EN101 | ||
| 1008 | $$IF101: | ||
| 1009 | MOV AH,01h ;an000;set up for flag pass | ||
| 1010 | OR AH,AH ;an000;set flag to NZ | ||
| 1011 | ; $ENDIF ;an000; | ||
| 1012 | $$EN101: | ||
| 1013 | ; $ENDIF ;an000; | ||
| 1014 | $$IF100: | ||
| 1015 | |||
| 1016 | ret ;an000; | ||
| 1017 | |||
| 1018 | XM_INSTALL_CHECK endp ;an000; | ||
| 1019 | |||
| 1020 | |||
| 1021 | |||
| 1022 | |||
| 1023 | ;========================================================================= | ||
| 1024 | ; XM_EMS_DEALL : This routine deallocates handles from EMS. | ||
| 1025 | ; | ||
| 1026 | ; Inputs : DX - Handle supplied by XM_DEALL_PROMPT | ||
| 1027 | ; | ||
| 1028 | ; Outputs : Good return - "Handle %1 deallocated" | ||
| 1029 | ; Bad return - message describing error | ||
| 1030 | ; | ||
| 1031 | ; Date: 8/05/86 | ||
| 1032 | ;========================================================================= | ||
| 1033 | |||
| 1034 | XM_EMS_DEALL proc near ;an000;deallocate EMS pages | ||
| 1035 | |||
| 1036 | call XM_GET_MAN_STATUS ;an000;see if EMS installed | ||
| 1037 | ; $if nc ;an000;error? | ||
| 1038 | JC $$IF105 | ||
| 1039 | call XM_DEALL_PROMPT ;an000;prompt user for handle | ||
| 1040 | mov ah,EMS_PAGE_DEALL ;an000;function 45h, int 67h | ||
| 1041 | int 67h ;an000; | ||
| 1042 | |||
| 1043 | or ah,ah ;an000;error? | ||
| 1044 | ; $if nz ;an000;yes | ||
| 1045 | JZ $$IF106 | ||
| 1046 | call XM_ERROR ;an000;say why | ||
| 1047 | ; $else ;an000; | ||
| 1048 | JMP SHORT $$EN106 | ||
| 1049 | $$IF106: | ||
| 1050 | mov dx,offset dg:XM_DEALL_PTR;an000;"Handle %1 deallocated" | ||
| 1051 | call STD_PRINTF ;an000;print message | ||
| 1052 | ; $endif ;an000; | ||
| 1053 | $$EN106: | ||
| 1054 | ; $else ;an000; | ||
| 1055 | JMP SHORT $$EN105 | ||
| 1056 | $$IF105: | ||
| 1057 | call XM_ERROR ;an000;print type of error | ||
| 1058 | ; $endif ;an000; | ||
| 1059 | $$EN105: | ||
| 1060 | |||
| 1061 | ret ;an000; | ||
| 1062 | |||
| 1063 | XM_EMS_DEALL endp ;an000; | ||
| 1064 | |||
| 1065 | ;========================================================================= | ||
| 1066 | ; XM_DEALL_PROMPT : This routine prompts the user for the handle to be | ||
| 1067 | ; deallocated. It converts the handle entered to | ||
| 1068 | ; binary and passes it back to the caller in DX. | ||
| 1069 | ; | ||
| 1070 | ; Inputs : none | ||
| 1071 | ; | ||
| 1072 | ; Outputs : DX - Handle to be deallocated. | ||
| 1073 | ; | ||
| 1074 | ; Date: 8/05/86 | ||
| 1075 | ;========================================================================= | ||
| 1076 | |||
| 1077 | XM_DEALL_PROMPT proc near ;an000;prompt user for handle | ||
| 1078 | ; to deallocate | ||
| 1079 | call SCANB ;an000;see if parm entered | ||
| 1080 | ; $if nz ;an000;parm found | ||
| 1081 | JZ $$IF111 | ||
| 1082 | mov cx,04 ;an000;bytes to parse | ||
| 1083 | call GETHX ;an000;get hex value | ||
| 1084 | ; $if c ;an000;no an error occurred | ||
| 1085 | JNC $$IF112 | ||
| 1086 | call PERR ;an000;display ^ error | ||
| 1087 | ; $else ;an000; | ||
| 1088 | JMP SHORT $$EN112 | ||
| 1089 | $$IF112: | ||
| 1090 | mov dg:XM_DEALL_HAN,dx ;an000;save handle to deallocate | ||
| 1091 | ; $endif ;an000; | ||
| 1092 | $$EN112: | ||
| 1093 | ; $else ;an000; | ||
| 1094 | JMP SHORT $$EN111 | ||
| 1095 | $$IF111: | ||
| 1096 | call PERR ;an000;display ^ error | ||
| 1097 | ; $endif ;an000; | ||
| 1098 | $$EN111: | ||
| 1099 | |||
| 1100 | ret ;an000;return to caller | ||
| 1101 | |||
| 1102 | XM_DEALL_PROMPT endp ;an000; | ||
| 1103 | |||
| 1104 | |||
| 1105 | ;========================================================================= | ||
| 1106 | ; XM_FRAME_BUFFER : This routine obtains the frame buffer | ||
| 1107 | ; of EMS pages. | ||
| 1108 | ; | ||
| 1109 | ; Inputs : none | ||
| 1110 | ; | ||
| 1111 | ; Outputs : ES:DI - Pointer to frame array | ||
| 1112 | ; CX - Number of elements in array | ||
| 1113 | ;========================================================================= | ||
| 1114 | |||
| 1115 | XM_FRAME_BUFFER proc near ;an000; | ||
| 1116 | |||
| 1117 | mov ax,EMS_PG_FRAME ;an000;get frame buffer | ||
| 1118 | int 67h ;an000; | ||
| 1119 | |||
| 1120 | ret ;an000; | ||
| 1121 | |||
| 1122 | XM_FRAME_BUFFER endp ;an000; | ||
| 1123 | |||
| 1124 | |||
| 1125 | CODE ENDS | ||
| 1126 | END DEBEMS | ||
| 1127 | \ No newline at end of file | ||