| 1 |
;**************************************************************************** |
| 2 |
;* |
| 3 |
;* ======================================================================== |
| 4 |
;* |
| 5 |
;* The contents of this file are subject to the SciTech MGL Public |
| 6 |
;* License Version 1.0 (the "License"); you may not use this file |
| 7 |
;* except in compliance with the License. You may obtain a copy of |
| 8 |
;* the License at http://www.scitechsoft.com/mgl-license.txt |
| 9 |
;* |
| 10 |
;* Software distributed under the License is distributed on an |
| 11 |
;* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
| 12 |
;* implied. See the License for the specific language governing |
| 13 |
;* rights and limitations under the License. |
| 14 |
;* |
| 15 |
;* The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc. |
| 16 |
;* |
| 17 |
;* The Initial Developer of the Original Code is SciTech Software, Inc. |
| 18 |
;* All Rights Reserved. |
| 19 |
;* |
| 20 |
;* ======================================================================== |
| 21 |
;* |
| 22 |
;* Language: NetWide Assembler (NASM) or Turbo Assembler (TASM) |
| 23 |
;* Environment: Any Intel Environment |
| 24 |
;* |
| 25 |
;* Description: Macros to provide memory model independent assembly language |
| 26 |
;* module for C programming. Supports the large and flat memory |
| 27 |
;* models. |
| 28 |
;* |
| 29 |
;* The defines that you should use when assembling modules that |
| 30 |
;* use this macro package are: |
| 31 |
;* |
| 32 |
;* __LARGE__ Assemble for 16-bit large model |
| 33 |
;* __FLAT__ Assemble for 32-bit FLAT memory model |
| 34 |
;* __NOU__ No underscore for all external C labels |
| 35 |
;* __NOU_VAR__ No underscore for global variables only |
| 36 |
;* |
| 37 |
;* The default settings are for 16-bit large memory model with |
| 38 |
;* leading underscores for symbol names. |
| 39 |
;* |
| 40 |
;* The main intent of the macro file is to enable programmers |
| 41 |
;* to write _one_ set of source that can be assembled to run |
| 42 |
;* in either 16 bit real and protected modes or 32 bit |
| 43 |
;* protected mode without the need to riddle the code with |
| 44 |
;* 'if flatmodel' style conditional assembly (it is still there |
| 45 |
;* but nicely hidden by a macro layer that enhances the |
| 46 |
;* readability and understandability of the resulting code). |
| 47 |
;* |
| 48 |
;**************************************************************************** |
| 49 |
|
| 50 |
; Include the appropriate version in here depending on the assembler. NASM |
| 51 |
; appears to always try and parse code, even if it is in a non-compiling |
| 52 |
; block of a ifdef expression, and hence crashes if we include the TASM |
| 53 |
; macro package in the same header file. Hence we split the macros up into |
| 54 |
; two separate header files. |
| 55 |
|
| 56 |
ifdef __NASM_MAJOR__ |
| 57 |
|
| 58 |
;============================================================================ |
| 59 |
; Macro package when compiling with NASM. |
| 60 |
;============================================================================ |
| 61 |
|
| 62 |
; Turn off underscores for globals if disabled for all externals |
| 63 |
|
| 64 |
%ifdef __NOU__ |
| 65 |
%define __NOU_VAR__ |
| 66 |
%endif |
| 67 |
|
| 68 |
; Define the __WINDOWS__ symbol if we are compiling for any Windows |
| 69 |
; environment |
| 70 |
|
| 71 |
%ifdef __WINDOWS16__ |
| 72 |
%define __WINDOWS__ 1 |
| 73 |
%endif |
| 74 |
%ifdef __WINDOWS32__ |
| 75 |
%define __WINDOWS__ 1 |
| 76 |
%define __WINDOWS32_386__ 1 |
| 77 |
%endif |
| 78 |
|
| 79 |
; Macros for accessing 'generic' registers |
| 80 |
|
| 81 |
%ifdef __FLAT__ |
| 82 |
%idefine _ax eax |
| 83 |
%idefine _bx ebx |
| 84 |
%idefine _cx ecx |
| 85 |
%idefine _dx edx |
| 86 |
%idefine _si esi |
| 87 |
%idefine _di edi |
| 88 |
%idefine _bp ebp |
| 89 |
%idefine _sp esp |
| 90 |
%idefine _es |
| 91 |
%idefine UCHAR BYTE ; Size of a character |
| 92 |
%idefine USHORT WORD ; Size of a short |
| 93 |
%idefine UINT DWORD ; Size of an integer |
| 94 |
%idefine ULONG DWORD ; Size of a long |
| 95 |
%idefine BOOL DWORD ; Size of a boolean |
| 96 |
%idefine DPTR DWORD ; Size of a data pointer |
| 97 |
%idefine FDPTR FWORD ; Size of a far data pointer |
| 98 |
%idefine NDPTR DWORD ; Size of a near data pointer |
| 99 |
%idefine CPTR DWORD ; Size of a code pointer |
| 100 |
%idefine FCPTR FWORD ; Size of a far code pointer |
| 101 |
%idefine NCPTR DWORD ; Size of a near code pointer |
| 102 |
%idefine FPTR NEAR ; Distance for function pointers |
| 103 |
%idefine DUINT dd ; Declare a integer variable |
| 104 |
%idefine intsize 4 |
| 105 |
%idefine flatmodel 1 |
| 106 |
%else |
| 107 |
%idefine _ax ax |
| 108 |
%idefine _bx bx |
| 109 |
%idefine _cx cx |
| 110 |
%idefine _dx dx |
| 111 |
%idefine _si si |
| 112 |
%idefine _di di |
| 113 |
%idefine _bp bp |
| 114 |
%idefine _sp sp |
| 115 |
%idefine _es es: |
| 116 |
%idefine UCHAR BYTE ; Size of a character |
| 117 |
%idefine USHORT WORD ; Size of a short |
| 118 |
%idefine UINT WORD ; Size of an integer |
| 119 |
%idefine ULONG DWORD ; Size of a long |
| 120 |
%idefine BOOL WORD ; Size of a boolean |
| 121 |
%idefine DPTR DWORD ; Size of a data pointer |
| 122 |
%idefine FDPTR DWORD ; Size of a far data pointer |
| 123 |
%idefine NDPTR WORD ; Size of a near data pointer |
| 124 |
%idefine CPTR DWORD ; Size of a code pointer |
| 125 |
%idefine FCPTR DWORD ; Size of a far code pointer |
| 126 |
%idefine NCPTR WORD ; Size of a near code pointer |
| 127 |
%idefine FPTR FAR ; Distance for function pointers |
| 128 |
%idefine DUINT dw ; Declare a integer variable |
| 129 |
%idefine intsize 2 |
| 130 |
%endif |
| 131 |
%idefine invert ~ |
| 132 |
%idefine offset |
| 133 |
%idefine use_nasm |
| 134 |
|
| 135 |
; Convert all jumps to near jumps, since NASM does not so this automatically |
| 136 |
|
| 137 |
%idefine jo jo near |
| 138 |
%idefine jno jno near |
| 139 |
%idefine jz jz near |
| 140 |
%idefine jnz jnz near |
| 141 |
%idefine je je near |
| 142 |
%idefine jne jne near |
| 143 |
%idefine jb jb near |
| 144 |
%idefine jbe jbe near |
| 145 |
%idefine ja ja near |
| 146 |
%idefine jae jae near |
| 147 |
%idefine jl jl near |
| 148 |
%idefine jle jle near |
| 149 |
%idefine jg jg near |
| 150 |
%idefine jge jge near |
| 151 |
%idefine jc jc near |
| 152 |
%idefine jnc jnc near |
| 153 |
%idefine js js near |
| 154 |
%idefine jns jns near |
| 155 |
|
| 156 |
%ifdef DOUBLE |
| 157 |
%idefine REAL QWORD |
| 158 |
%idefine DREAL dq |
| 159 |
%else |
| 160 |
%idefine REAL DWORD |
| 161 |
%idefine DREAL dd |
| 162 |
%endif |
| 163 |
|
| 164 |
; Boolean truth values (same as those in debug.h) |
| 165 |
|
| 166 |
%idefine False 0 |
| 167 |
%idefine True 1 |
| 168 |
%idefine No 0 |
| 169 |
%idefine Yes 1 |
| 170 |
|
| 171 |
; Macro to be invoked at the start of all modules to set up segments for |
| 172 |
; later use. Does nothing for NASM. |
| 173 |
|
| 174 |
%imacro header 1 |
| 175 |
%endmacro |
| 176 |
|
| 177 |
; Macro to begin a data segment |
| 178 |
|
| 179 |
%imacro begdataseg 1 |
| 180 |
%ifdef __GNUC__ |
| 181 |
segment .data public class=DATA use32 flat |
| 182 |
%else |
| 183 |
%ifdef flatmodel |
| 184 |
segment _DATA public align=4 class=DATA use32 flat |
| 185 |
%else |
| 186 |
segment _DATA public align=4 class=DATA use16 |
| 187 |
%endif |
| 188 |
%endif |
| 189 |
%endmacro |
| 190 |
|
| 191 |
; Macro to end a data segment |
| 192 |
|
| 193 |
%imacro enddataseg 1 |
| 194 |
%endmacro |
| 195 |
|
| 196 |
; Macro to begin a code segment |
| 197 |
|
| 198 |
%imacro begcodeseg 1 |
| 199 |
%ifdef __GNUC__ |
| 200 |
segment .text public class=CODE use32 flat |
| 201 |
%else |
| 202 |
%ifdef flatmodel |
| 203 |
segment _TEXT public align=16 class=CODE use32 flat |
| 204 |
%else |
| 205 |
segment %1_TEXT public align=16 class=CODE use16 |
| 206 |
%endif |
| 207 |
%endif |
| 208 |
%endmacro |
| 209 |
|
| 210 |
; Macro to begin a near code segment |
| 211 |
|
| 212 |
%imacro begcodeseg_near 0 |
| 213 |
%ifdef __GNUC__ |
| 214 |
segment .text public class=CODE use32 flat |
| 215 |
%else |
| 216 |
%ifdef flatmodel |
| 217 |
segment _TEXT public align=16 class=CODE use32 flat |
| 218 |
%else |
| 219 |
segment _TEXT public align=16 class=CODE use16 |
| 220 |
%endif |
| 221 |
%endif |
| 222 |
%endmacro |
| 223 |
|
| 224 |
; Macro to end a code segment |
| 225 |
|
| 226 |
%imacro endcodeseg 1 |
| 227 |
%endmacro |
| 228 |
|
| 229 |
; Macro to end a near code segment |
| 230 |
|
| 231 |
%imacro endcodeseg_near 0 |
| 232 |
%endmacro |
| 233 |
|
| 234 |
; Macro for an extern C symbol. If the C compiler requires leading |
| 235 |
; underscores, then the underscores are added to the symbol names, otherwise |
| 236 |
; they are left off. The symbol name is referenced in the assembler code |
| 237 |
; using the non-underscored symbol name. |
| 238 |
|
| 239 |
%imacro cextern 2 |
| 240 |
%ifdef __NOU_VAR__ |
| 241 |
extern %1 |
| 242 |
%else |
| 243 |
extern _%1 |
| 244 |
%define %1 _%1 |
| 245 |
%endif |
| 246 |
%endmacro |
| 247 |
|
| 248 |
%imacro cexternfunc 2 |
| 249 |
%ifdef __NOU__ |
| 250 |
extern %1 |
| 251 |
%else |
| 252 |
extern _%1 |
| 253 |
%define %1 _%1 |
| 254 |
%endif |
| 255 |
%endmacro |
| 256 |
|
| 257 |
; Macro for a public C symbol. If the C compiler requires leading |
| 258 |
; underscores, then the underscores are added to the symbol names, otherwise |
| 259 |
; they are left off. The symbol name is referenced in the assembler code |
| 260 |
; using the non-underscored symbol name. |
| 261 |
|
| 262 |
%imacro cpublic 1 |
| 263 |
%ifdef __NOU_VAR__ |
| 264 |
global %1 |
| 265 |
%1: |
| 266 |
%else |
| 267 |
global _%1 |
| 268 |
_%1: |
| 269 |
%define %1 _%1 |
| 270 |
%endif |
| 271 |
%endmacro |
| 272 |
|
| 273 |
; Macro for an global C symbol. If the C compiler requires leading |
| 274 |
; underscores, then the underscores are added to the symbol names, otherwise |
| 275 |
; they are left off. The symbol name is referenced in the assembler code |
| 276 |
; using the non-underscored symbol name. |
| 277 |
|
| 278 |
%imacro cglobal 1 |
| 279 |
%ifdef __NOU_VAR__ |
| 280 |
global %1 |
| 281 |
%else |
| 282 |
global _%1 |
| 283 |
%define %1 _%1 |
| 284 |
%endif |
| 285 |
%endmacro |
| 286 |
|
| 287 |
; Macro for an global C function symbol. If the C compiler requires leading |
| 288 |
; underscores, then the underscores are added to the symbol names, otherwise |
| 289 |
; they are left off. The symbol name is referenced in the assembler code |
| 290 |
; using the non-underscored symbol name. |
| 291 |
|
| 292 |
%imacro cglobalfunc 1 |
| 293 |
%ifdef __NOU__ |
| 294 |
global %1 |
| 295 |
%else |
| 296 |
global _%1 |
| 297 |
%define %1 _%1 |
| 298 |
%endif |
| 299 |
%endmacro |
| 300 |
|
| 301 |
; Macro to start a C callable function. This will be a far function for |
| 302 |
; 16-bit code, and a near function for 32-bit code. |
| 303 |
|
| 304 |
%imacro cprocstatic 1 |
| 305 |
%push cproc |
| 306 |
%1: |
| 307 |
%ifdef flatmodel |
| 308 |
%stacksize flat |
| 309 |
%define ret retn |
| 310 |
%else |
| 311 |
%stacksize large |
| 312 |
%define ret retf |
| 313 |
%endif |
| 314 |
%assign %$localsize 0 |
| 315 |
%endmacro |
| 316 |
|
| 317 |
%imacro cprocstart 1 |
| 318 |
%push cproc |
| 319 |
cglobalfunc %1 |
| 320 |
%1: |
| 321 |
%ifdef flatmodel |
| 322 |
%stacksize flat |
| 323 |
%define ret retn |
| 324 |
%else |
| 325 |
%stacksize large |
| 326 |
%define ret retf |
| 327 |
%endif |
| 328 |
%assign %$localsize 0 |
| 329 |
%endmacro |
| 330 |
|
| 331 |
; This macro sets up a procedure to be exported from a 16 bit DLL. Since the |
| 332 |
; calling conventions are always _far _pascal for 16 bit DLL's, we actually |
| 333 |
; rename this routine with an extra underscore with 'C' calling conventions |
| 334 |
; and a small DLL stub will be provided by the high level code to call the |
| 335 |
; assembler routine. |
| 336 |
|
| 337 |
%imacro cprocstartdll16 1 |
| 338 |
%ifdef __WINDOWS16__ |
| 339 |
cprocstart _%1 |
| 340 |
%else |
| 341 |
cprocstart %1 |
| 342 |
%endif |
| 343 |
%endmacro |
| 344 |
|
| 345 |
; Macro to start a C callable near function. |
| 346 |
|
| 347 |
%imacro cprocnear 1 |
| 348 |
%push cproc |
| 349 |
cglobalfunc %1 |
| 350 |
%1: |
| 351 |
%define ret retn |
| 352 |
%ifdef flatmodel |
| 353 |
%stacksize flat |
| 354 |
%else |
| 355 |
%stacksize small |
| 356 |
%endif |
| 357 |
%assign %$localsize 0 |
| 358 |
%endmacro |
| 359 |
|
| 360 |
; Macro to start a C callable far function. |
| 361 |
|
| 362 |
%imacro cprocfar 1 |
| 363 |
%push cproc |
| 364 |
cglobalfunc %1 |
| 365 |
%1: |
| 366 |
%define ret retf |
| 367 |
%ifdef flatmodel |
| 368 |
%stacksize flat |
| 369 |
%else |
| 370 |
%stacksize large |
| 371 |
%endif |
| 372 |
%assign %$localsize 0 |
| 373 |
%endmacro |
| 374 |
|
| 375 |
; Macro to end a C function |
| 376 |
|
| 377 |
%imacro cprocend 0 |
| 378 |
%pop |
| 379 |
%endmacro |
| 380 |
|
| 381 |
; Macros for entering and exiting C callable functions. Note that we must |
| 382 |
; always save and restore the SI and DI registers for C functions, and for |
| 383 |
; 32 bit C functions we also need to save and restore EBX and clear the |
| 384 |
; direction flag. |
| 385 |
|
| 386 |
%imacro enter_c 0 |
| 387 |
push _bp |
| 388 |
mov _bp,_sp |
| 389 |
%ifnidn %$localsize,0 |
| 390 |
sub _sp,%$localsize |
| 391 |
%endif |
| 392 |
%ifdef flatmodel |
| 393 |
push ebx |
| 394 |
%endif |
| 395 |
push _si |
| 396 |
push _di |
| 397 |
%endmacro |
| 398 |
|
| 399 |
%imacro leave_c 0 |
| 400 |
pop _di |
| 401 |
pop _si |
| 402 |
%ifdef flatmodel |
| 403 |
pop ebx |
| 404 |
cld |
| 405 |
%endif |
| 406 |
%ifnidn %$localsize,0 |
| 407 |
mov _sp,_bp |
| 408 |
%endif |
| 409 |
pop _bp |
| 410 |
%endmacro |
| 411 |
|
| 412 |
%imacro use_ebx 0 |
| 413 |
%ifdef flatmodel |
| 414 |
push ebx |
| 415 |
%endif |
| 416 |
%endmacro |
| 417 |
|
| 418 |
%imacro unuse_ebx 0 |
| 419 |
%ifdef flatmodel |
| 420 |
pop ebx |
| 421 |
%endif |
| 422 |
%endmacro |
| 423 |
|
| 424 |
; Macros for saving and restoring the value of DS,ES,FS,GS when it is to |
| 425 |
; be used in assembly routines. This evaluates to nothing in the flat memory |
| 426 |
; model, but is saves and restores DS in the large memory model. |
| 427 |
|
| 428 |
%imacro use_ds 0 |
| 429 |
%ifndef flatmodel |
| 430 |
push ds |
| 431 |
%endif |
| 432 |
%endmacro |
| 433 |
|
| 434 |
%imacro unuse_ds 0 |
| 435 |
%ifndef flatmodel |
| 436 |
pop ds |
| 437 |
%endif |
| 438 |
%endmacro |
| 439 |
|
| 440 |
%imacro use_es 0 |
| 441 |
%ifndef flatmodel |
| 442 |
push es |
| 443 |
%endif |
| 444 |
%endmacro |
| 445 |
|
| 446 |
%imacro unuse_es 0 |
| 447 |
%ifndef flatmodel |
| 448 |
pop es |
| 449 |
%endif |
| 450 |
%endmacro |
| 451 |
|
| 452 |
; Macros for loading the address of a data pointer into a segment and |
| 453 |
; index register pair. The %imacro explicitly loads DS or ES in the 16 bit |
| 454 |
; memory model, or it simply loads the offset into the register in the flat |
| 455 |
; memory model since DS and ES always point to all addressable memory. You |
| 456 |
; must use the correct _REG (ie: _BX) %imacros for documentation purposes. |
| 457 |
|
| 458 |
%imacro _lds 2 |
| 459 |
%ifdef flatmodel |
| 460 |
mov %1,%2 |
| 461 |
%else |
| 462 |
lds %1,%2 |
| 463 |
%endif |
| 464 |
%endmacro |
| 465 |
|
| 466 |
%imacro _les 2 |
| 467 |
%ifdef flatmodel |
| 468 |
mov %1,%2 |
| 469 |
%else |
| 470 |
les %1,%2 |
| 471 |
%endif |
| 472 |
%endmacro |
| 473 |
|
| 474 |
; Macros for adding and subtracting a value from registers. Two value are |
| 475 |
; provided, one for 16 bit modes and another for 32 bit modes (the extended |
| 476 |
; register is used in 32 bit modes). |
| 477 |
|
| 478 |
%imacro _add 3 |
| 479 |
%ifdef flatmodel |
| 480 |
add e%1, %3 |
| 481 |
%else |
| 482 |
add %1, %2 |
| 483 |
%endif |
| 484 |
%endmacro |
| 485 |
|
| 486 |
%imacro _sub 3 |
| 487 |
%ifdef flatmodel |
| 488 |
sub e%1, %3 |
| 489 |
%else |
| 490 |
sub %1, %2 |
| 491 |
%endif |
| 492 |
%endmacro |
| 493 |
|
| 494 |
; Macro to clear the high order word for the 32 bit extended registers. |
| 495 |
; This is used to convert an unsigned 16 bit value to an unsigned 32 bit |
| 496 |
; value, and will evaluate to nothing in 16 bit modes. |
| 497 |
|
| 498 |
%imacro clrhi 1 |
| 499 |
%ifdef flatmodel |
| 500 |
movzx e%1,%1 |
| 501 |
%endif |
| 502 |
%endmacro |
| 503 |
|
| 504 |
%imacro sgnhi 1 |
| 505 |
%ifdef flatmodel |
| 506 |
movsx e%1,%1 |
| 507 |
%endif |
| 508 |
%endmacro |
| 509 |
|
| 510 |
; Macro to load an extended register with an integer value in either mode |
| 511 |
|
| 512 |
%imacro loadint 2 |
| 513 |
%ifdef flatmodel |
| 514 |
mov e%1,%2 |
| 515 |
%else |
| 516 |
xor e%1,e%1 |
| 517 |
mov %1,%2 |
| 518 |
%endif |
| 519 |
%endmacro |
| 520 |
|
| 521 |
; Macros to load and store integer values with string instructions |
| 522 |
|
| 523 |
%imacro LODSINT 0 |
| 524 |
%ifdef flatmodel |
| 525 |
lodsd |
| 526 |
%else |
| 527 |
lodsw |
| 528 |
%endif |
| 529 |
%endmacro |
| 530 |
|
| 531 |
%imacro STOSINT 0 |
| 532 |
%ifdef flatmodel |
| 533 |
stosd |
| 534 |
%else |
| 535 |
stosw |
| 536 |
%endif |
| 537 |
%endmacro |
| 538 |
|
| 539 |
; Macros to provide resb, resw, resd compatibility with NASM |
| 540 |
|
| 541 |
%imacro dclb 1 |
| 542 |
times %1 db 0 |
| 543 |
%endmacro |
| 544 |
|
| 545 |
%imacro dclw 1 |
| 546 |
times %1 dw 0 |
| 547 |
%endmacro |
| 548 |
|
| 549 |
%imacro dcld 1 |
| 550 |
times %1 dd 0 |
| 551 |
%endmacro |
| 552 |
|
| 553 |
; macros to declare assembler function stubs for function structures |
| 554 |
|
| 555 |
%imacro BEGIN_STUBS_DEF 2 |
| 556 |
begdataseg _STUBS |
| 557 |
%ifdef __NOU_VAR__ |
| 558 |
extern %1 |
| 559 |
%define STUBS_START %1 |
| 560 |
%else |
| 561 |
extern _%1 |
| 562 |
%define STUBS_START _%1 |
| 563 |
%endif |
| 564 |
enddataseg _STUBS |
| 565 |
begcodeseg _STUBS |
| 566 |
%assign off %2 |
| 567 |
%endmacro |
| 568 |
|
| 569 |
%imacro DECLARE_STUB 1 |
| 570 |
%ifdef __NOU__ |
| 571 |
global %1 |
| 572 |
%1: |
| 573 |
%else |
| 574 |
global _%1 |
| 575 |
_%1: |
| 576 |
%endif |
| 577 |
jmp [DWORD STUBS_START+off] |
| 578 |
%assign off off+4 |
| 579 |
%endmacro |
| 580 |
|
| 581 |
%imacro DECLARE_STDCALL 2 |
| 582 |
%ifdef STDCALL_MANGLE |
| 583 |
global _%1@%2 |
| 584 |
_%1@%2: |
| 585 |
%else |
| 586 |
%ifdef __GNUC__ |
| 587 |
global _%1 |
| 588 |
_%1: |
| 589 |
%else |
| 590 |
global %1 |
| 591 |
%1: |
| 592 |
%endif |
| 593 |
%endif |
| 594 |
jmp [DWORD STUBS_START+off] |
| 595 |
%assign off off+4 |
| 596 |
%endmacro |
| 597 |
|
| 598 |
%imacro END_STUBS_DEF 0 |
| 599 |
endcodeseg _STUBS |
| 600 |
%endmacro |
| 601 |
|
| 602 |
; macros to declare assembler import stubs for binary loadable drivers |
| 603 |
|
| 604 |
%imacro BEGIN_IMPORTS_DEF 1 |
| 605 |
BEGIN_STUBS_DEF %1,4 |
| 606 |
%endmacro |
| 607 |
|
| 608 |
%imacro DECLARE_IMP 1 |
| 609 |
DECLARE_STUB %1 |
| 610 |
%endmacro |
| 611 |
|
| 612 |
%imacro END_IMPORTS_DEF 0 |
| 613 |
END_STUBS_DEF |
| 614 |
%endmacro |
| 615 |
|
| 616 |
else ; __NASM_MAJOR__ |
| 617 |
|
| 618 |
;============================================================================ |
| 619 |
; Macro package when compiling with TASM. |
| 620 |
;============================================================================ |
| 621 |
|
| 622 |
; Turn off underscores for globals if disabled for all externals |
| 623 |
|
| 624 |
ifdef __NOU__ |
| 625 |
__NOU_VAR__ = 1 |
| 626 |
endif |
| 627 |
|
| 628 |
; Define the __WINDOWS__ symbol if we are compiling for any Windows |
| 629 |
; environment |
| 630 |
|
| 631 |
ifdef __WINDOWS16__ |
| 632 |
__WINDOWS__ = 1 |
| 633 |
endif |
| 634 |
ifdef __WINDOWS32__ |
| 635 |
__WINDOWS__ = 1 |
| 636 |
__WINDOWS32_386__ = 1 |
| 637 |
endif |
| 638 |
ifdef __WIN386__ |
| 639 |
__WINDOWS__ = 1 |
| 640 |
__WINDOWS32_386__ = 1 |
| 641 |
endif |
| 642 |
ifdef __VXD__ |
| 643 |
__WINDOWS__ = 1 |
| 644 |
__WINDOWS32_386__ = 1 |
| 645 |
MASM |
| 646 |
.386 |
| 647 |
NO_SEGMENTS = 1 |
| 648 |
include vmm.inc ; IGNORE DEPEND |
| 649 |
include vsegment.inc ; IGNORE DEPEND |
| 650 |
IDEAL |
| 651 |
endif |
| 652 |
|
| 653 |
; Macros for accessing 'generic' registers |
| 654 |
|
| 655 |
ifdef __FLAT__ |
| 656 |
_ax EQU eax ; EAX is used for accumulator |
| 657 |
_bx EQU ebx ; EBX is used for accumulator |
| 658 |
_cx EQU ecx ; ECX is used for looping |
| 659 |
_dx EQU edx ; EDX is used for data register |
| 660 |
_si EQU esi ; ESI is the source index register |
| 661 |
_di EQU edi ; EDI is the destination index register |
| 662 |
_bp EQU ebp ; EBP is used for base pointer register |
| 663 |
_sp EQU esp ; ESP is used for stack pointer register |
| 664 |
_es EQU ; ES and DS are the same in 32 bit PM |
| 665 |
typedef UCHAR BYTE ; Size of a character |
| 666 |
typedef USHORT WORD ; Size of a short |
| 667 |
typedef UINT DWORD ; Size of an integer |
| 668 |
typedef ULONG DWORD ; Size of a long |
| 669 |
typedef BOOL DWORD ; Size of a boolean |
| 670 |
typedef DPTR DWORD ; Size of a data pointer |
| 671 |
typedef FDPTR FWORD ; Size of a far data pointer |
| 672 |
typedef NDPTR DWORD ; Size of a near data pointer |
| 673 |
typedef CPTR DWORD ; Size of a code pointer |
| 674 |
typedef FCPTR FWORD ; Size of a far code pointer |
| 675 |
typedef NCPTR DWORD ; Size of a near code pointer |
| 676 |
typedef DUINT DWORD ; Declare a integer variable |
| 677 |
FPTR EQU NEAR ; Distance for function pointers |
| 678 |
intsize = 4 ; Size of an integer |
| 679 |
flatmodel = 1 ; This is a flat memory model |
| 680 |
P386 ; Turn on 386 code generation |
| 681 |
MODEL FLAT ; Set up for 32 bit simplified FLAT model |
| 682 |
else |
| 683 |
_ax EQU ax ; AX is used for accumulator |
| 684 |
_bx EQU bx ; BX is used for accumulator |
| 685 |
_cx EQU cx ; CX is used for looping |
| 686 |
_dx EQU dx ; DX is used for data register |
| 687 |
_si EQU si ; SI is the source index register |
| 688 |
_di EQU di ; DI is the destination index register |
| 689 |
_bp EQU bp ; BP is used for base pointer register |
| 690 |
_sp EQU sp ; SP is used for stack pointer register |
| 691 |
_es EQU es: ; ES is used for segment override |
| 692 |
typedef UCHAR BYTE ; Size of a character |
| 693 |
typedef USHORT WORD ; Size of a short |
| 694 |
typedef UINT WORD ; Size of an integer |
| 695 |
typedef ULONG DWORD ; Size of a long |
| 696 |
typedef BOOL WORD ; Size of a boolean |
| 697 |
typedef DPTR DWORD ; Size of a data pointer |
| 698 |
typedef FDPTR DWORD ; Size of a far data pointer |
| 699 |
typedef NDPTR WORD ; Size of a near data pointer |
| 700 |
typedef CPTR DWORD ; Size of a code pointer |
| 701 |
typedef FCPTR DWORD ; Size of a far code pointer |
| 702 |
typedef NCPTR WORD ; Size of a near code pointer |
| 703 |
typedef DUINT WORD ; Declare a integer variable |
| 704 |
FPTR EQU FAR ; Distance for function pointers |
| 705 |
intsize = 2 ; Size of an integer |
| 706 |
P386 ; Turn on 386 code generation |
| 707 |
endif |
| 708 |
invert EQU not |
| 709 |
|
| 710 |
; Provide a typedef for real floating point numbers |
| 711 |
|
| 712 |
ifdef DOUBLE |
| 713 |
typedef REAL QWORD |
| 714 |
typedef DREAL QWORD |
| 715 |
else |
| 716 |
typedef REAL DWORD |
| 717 |
typedef DREAL DWORD |
| 718 |
endif |
| 719 |
|
| 720 |
; Macros to access the floating point stack registers to convert them |
| 721 |
; from NASM style to TASM style |
| 722 |
|
| 723 |
st0 EQU st(0) |
| 724 |
st1 EQU st(1) |
| 725 |
st2 EQU st(2) |
| 726 |
st3 EQU st(3) |
| 727 |
st4 EQU st(4) |
| 728 |
st5 EQU st(5) |
| 729 |
st6 EQU st(6) |
| 730 |
st7 EQU st(7) |
| 731 |
st8 EQU st(8) |
| 732 |
|
| 733 |
; Boolean truth values (same as those in debug.h) |
| 734 |
|
| 735 |
ifndef __VXD__ |
| 736 |
False = 0 |
| 737 |
True = 1 |
| 738 |
No = 0 |
| 739 |
Yes = 1 |
| 740 |
Yes = 1 |
| 741 |
endif |
| 742 |
|
| 743 |
; Macros for the _DATA data segment. This segment contains initialised data. |
| 744 |
|
| 745 |
MACRO begdataseg name |
| 746 |
ifdef __VXD__ |
| 747 |
MASM |
| 748 |
VXD_LOCKED_DATA_SEG |
| 749 |
IDEAL |
| 750 |
else |
| 751 |
ifdef flatmodel |
| 752 |
DATASEG |
| 753 |
else |
| 754 |
SEGMENT _DATA DWORD PUBLIC USE16 'DATA' |
| 755 |
endif |
| 756 |
endif |
| 757 |
ENDM |
| 758 |
|
| 759 |
MACRO enddataseg name |
| 760 |
ifdef __VXD__ |
| 761 |
MASM |
| 762 |
VXD_LOCKED_DATA_ENDS |
| 763 |
IDEAL |
| 764 |
else |
| 765 |
ifndef flatmodel |
| 766 |
ENDS _DATA |
| 767 |
endif |
| 768 |
endif |
| 769 |
ENDM |
| 770 |
|
| 771 |
; Macro for the main code segment. |
| 772 |
|
| 773 |
MACRO begcodeseg name |
| 774 |
ifdef __VXD__ |
| 775 |
MASM |
| 776 |
VXD_LOCKED_CODE_SEG |
| 777 |
IDEAL |
| 778 |
else |
| 779 |
ifdef flatmodel |
| 780 |
CODESEG |
| 781 |
ASSUME CS:FLAT,DS:FLAT,SS:FLAT |
| 782 |
else |
| 783 |
SEGMENT &name&_TEXT PARA PUBLIC USE16 'CODE' |
| 784 |
ASSUME CS:&name&_TEXT,DS:_DATA |
| 785 |
endif |
| 786 |
endif |
| 787 |
ENDM |
| 788 |
|
| 789 |
; Macro for a near code segment |
| 790 |
|
| 791 |
MACRO begcodeseg_near |
| 792 |
ifdef flatmodel |
| 793 |
CODESEG |
| 794 |
ASSUME CS:FLAT,DS:FLAT,SS:FLAT |
| 795 |
else |
| 796 |
SEGMENT _TEXT PARA PUBLIC USE16 'CODE' |
| 797 |
ASSUME CS:_TEXT,DS:_DATA |
| 798 |
endif |
| 799 |
ENDM |
| 800 |
|
| 801 |
MACRO endcodeseg name |
| 802 |
ifdef __VXD__ |
| 803 |
MASM |
| 804 |
VXD_LOCKED_CODE_ENDS |
| 805 |
IDEAL |
| 806 |
else |
| 807 |
ifndef flatmodel |
| 808 |
ENDS &name&_TEXT |
| 809 |
endif |
| 810 |
endif |
| 811 |
ENDM |
| 812 |
|
| 813 |
MACRO endcodeseg_near |
| 814 |
ifndef flatmodel |
| 815 |
ENDS _TEXT |
| 816 |
endif |
| 817 |
ENDM |
| 818 |
|
| 819 |
; Macro to be invoked at the start of all modules to set up segments for |
| 820 |
; later use. |
| 821 |
|
| 822 |
MACRO header name |
| 823 |
begdataseg name |
| 824 |
enddataseg name |
| 825 |
ENDM |
| 826 |
|
| 827 |
; Macro for an extern C symbol. If the C compiler requires leading |
| 828 |
; underscores, then the underscores are added to the symbol names, otherwise |
| 829 |
; they are left off. The symbol name is referenced in the assembler code |
| 830 |
; using the non-underscored symbol name. |
| 831 |
|
| 832 |
MACRO cextern name,size |
| 833 |
ifdef __NOU_VAR__ |
| 834 |
EXTRN name:size |
| 835 |
else |
| 836 |
EXTRN _&name&:size |
| 837 |
name EQU _&name& |
| 838 |
endif |
| 839 |
ENDM |
| 840 |
|
| 841 |
MACRO cexternfunc name,size |
| 842 |
ifdef __NOU__ |
| 843 |
EXTRN name:size |
| 844 |
else |
| 845 |
EXTRN _&name&:size |
| 846 |
name EQU _&name& |
| 847 |
endif |
| 848 |
ENDM |
| 849 |
|
| 850 |
MACRO stdexternfunc name,args,size |
| 851 |
ifdef STDCALL_MANGLE |
| 852 |
EXTRN _&name&@&num_args&:size |
| 853 |
name EQU _&name&@&num_args |
| 854 |
else |
| 855 |
EXTRN name:size |
| 856 |
endif |
| 857 |
ENDM |
| 858 |
|
| 859 |
; Macro for a public C symbol. If the C compiler requires leading |
| 860 |
; underscores, then the underscores are added to the symbol names, otherwise |
| 861 |
; they are left off. The symbol name is referenced in the assembler code |
| 862 |
; using the non-underscored symbol name. |
| 863 |
|
| 864 |
MACRO cpublic name |
| 865 |
ifdef __NOU_VAR__ |
| 866 |
name: |
| 867 |
PUBLIC name |
| 868 |
else |
| 869 |
_&name&: |
| 870 |
PUBLIC _&name& |
| 871 |
name EQU _&name& |
| 872 |
endif |
| 873 |
ENDM |
| 874 |
|
| 875 |
; Macro for an global C symbol. If the C compiler requires leading |
| 876 |
; underscores, then the underscores are added to the symbol names, otherwise |
| 877 |
; they are left off. The symbol name is referenced in the assembler code |
| 878 |
; using the non-underscored symbol name. |
| 879 |
|
| 880 |
MACRO cglobal name |
| 881 |
ifdef __NOU_VAR__ |
| 882 |
PUBLIC name |
| 883 |
else |
| 884 |
PUBLIC _&name& |
| 885 |
name EQU _&name& |
| 886 |
endif |
| 887 |
ENDM |
| 888 |
|
| 889 |
; Macro for an global C function symbol. If the C compiler requires leading |
| 890 |
; underscores, then the underscores are added to the symbol names, otherwise |
| 891 |
; they are left off. The symbol name is referenced in the assembler code |
| 892 |
; using the non-underscored symbol name. |
| 893 |
|
| 894 |
MACRO cglobalfunc name |
| 895 |
ifdef __NOU__ |
| 896 |
PUBLIC name |
| 897 |
else |
| 898 |
PUBLIC _&name& |
| 899 |
name EQU _&name& |
| 900 |
endif |
| 901 |
ENDM |
| 902 |
|
| 903 |
; Macro to start a C callable function. This will be a far function for |
| 904 |
; 16-bit code, and a near function for 32-bit code. |
| 905 |
|
| 906 |
MACRO cprocstatic name ; Set up model independent private proc |
| 907 |
ifdef flatmodel |
| 908 |
PROC name NEAR |
| 909 |
else |
| 910 |
PROC name FAR |
| 911 |
endif |
| 912 |
LocalSize = 0 |
| 913 |
ENDM |
| 914 |
|
| 915 |
MACRO cprocstart name ; Set up model independent proc |
| 916 |
ifdef flatmodel |
| 917 |
ifdef __NOU__ |
| 918 |
PROC name NEAR |
| 919 |
else |
| 920 |
PROC _&name& NEAR |
| 921 |
endif |
| 922 |
else |
| 923 |
ifdef __NOU__ |
| 924 |
PROC name FAR |
| 925 |
else |
| 926 |
PROC _&name& FAR |
| 927 |
endif |
| 928 |
endif |
| 929 |
LocalSize = 0 |
| 930 |
cglobalfunc name |
| 931 |
ENDM |
| 932 |
|
| 933 |
MACRO cprocnear name ; Set up near proc |
| 934 |
ifdef __NOU__ |
| 935 |
PROC name NEAR |
| 936 |
else |
| 937 |
PROC _&name& NEAR |
| 938 |
endif |
| 939 |
LocalSize = 0 |
| 940 |
cglobalfunc name |
| 941 |
ENDM |
| 942 |
|
| 943 |
MACRO cprocfar name ; Set up far proc |
| 944 |
ifdef __NOU__ |
| 945 |
PROC name FAR |
| 946 |
else |
| 947 |
PROC _&name& FAR |
| 948 |
endif |
| 949 |
LocalSize = 0 |
| 950 |
cglobalfunc name |
| 951 |
ENDM |
| 952 |
|
| 953 |
MACRO cprocend ; End procedure macro |
| 954 |
ENDP |
| 955 |
ENDM |
| 956 |
|
| 957 |
; This macro sets up a procedure to be exported from a 16 bit DLL. Since the |
| 958 |
; calling conventions are always _far _pascal for 16 bit DLL's, we actually |
| 959 |
; rename this routine with an extra underscore with 'C' calling conventions |
| 960 |
; and a small DLL stub will be provided by the high level code to call the |
| 961 |
; assembler routine. |
| 962 |
|
| 963 |
MACRO cprocstartdll16 name |
| 964 |
ifdef __WINDOWS16__ |
| 965 |
cprocstart _&name& |
| 966 |
else |
| 967 |
cprocstart name |
| 968 |
endif |
| 969 |
ENDM |
| 970 |
|
| 971 |
; Macros for entering and exiting C callable functions. Note that we must |
| 972 |
; always save and restore the SI and DI registers for C functions, and for |
| 973 |
; 32 bit C functions we also need to save and restore EBX and clear the |
| 974 |
; direction flag. |
| 975 |
|
| 976 |
MACRO save_c_regs |
| 977 |
ifdef flatmodel |
| 978 |
push ebx |
| 979 |
endif |
| 980 |
push _si |
| 981 |
push _di |
| 982 |
ENDM |
| 983 |
|
| 984 |
MACRO enter_c |
| 985 |
push _bp |
| 986 |
mov _bp,_sp |
| 987 |
IFDIFI <LocalSize>,<0> |
| 988 |
sub _sp,LocalSize |
| 989 |
ENDIF |
| 990 |
save_c_regs |
| 991 |
ENDM |
| 992 |
|
| 993 |
MACRO restore_c_regs |
| 994 |
pop _di |
| 995 |
pop _si |
| 996 |
ifdef flatmodel |
| 997 |
pop ebx |
| 998 |
endif |
| 999 |
ENDM |
| 1000 |
|
| 1001 |
MACRO leave_c |
| 1002 |
restore_c_regs |
| 1003 |
cld |
| 1004 |
IFDIFI <LocalSize>,<0> |
| 1005 |
mov _sp,_bp |
| 1006 |
ENDIF |
| 1007 |
pop _bp |
| 1008 |
ENDM |
| 1009 |
|
| 1010 |
MACRO use_ebx |
| 1011 |
ifdef flatmodel |
| 1012 |
push ebx |
| 1013 |
endif |
| 1014 |
ENDM |
| 1015 |
|
| 1016 |
MACRO unuse_ebx |
| 1017 |
ifdef flatmodel |
| 1018 |
pop ebx |
| 1019 |
endif |
| 1020 |
ENDM |
| 1021 |
|
| 1022 |
; Macros for saving and restoring the value of DS,ES,FS,GS when it is to |
| 1023 |
; be used in assembly routines. This evaluates to nothing in the flat memory |
| 1024 |
; model, but is saves and restores DS in the large memory model. |
| 1025 |
|
| 1026 |
MACRO use_ds |
| 1027 |
ifndef flatmodel |
| 1028 |
push ds |
| 1029 |
endif |
| 1030 |
ENDM |
| 1031 |
|
| 1032 |
MACRO unuse_ds |
| 1033 |
ifndef flatmodel |
| 1034 |
pop ds |
| 1035 |
endif |
| 1036 |
ENDM |
| 1037 |
|
| 1038 |
MACRO use_es |
| 1039 |
ifndef flatmodel |
| 1040 |
push es |
| 1041 |
endif |
| 1042 |
ENDM |
| 1043 |
|
| 1044 |
MACRO unuse_es |
| 1045 |
ifndef flatmodel |
| 1046 |
pop es |
| 1047 |
endif |
| 1048 |
ENDM |
| 1049 |
|
| 1050 |
; Macros for loading the address of a data pointer into a segment and |
| 1051 |
; index register pair. The macro explicitly loads DS or ES in the 16 bit |
| 1052 |
; memory model, or it simply loads the offset into the register in the flat |
| 1053 |
; memory model since DS and ES always point to all addressable memory. You |
| 1054 |
; must use the correct _REG (ie: _BX) macros for documentation purposes. |
| 1055 |
|
| 1056 |
MACRO _lds reg, addr |
| 1057 |
ifdef flatmodel |
| 1058 |
mov reg,addr |
| 1059 |
else |
| 1060 |
lds reg,addr |
| 1061 |
endif |
| 1062 |
ENDM |
| 1063 |
|
| 1064 |
MACRO _les reg, addr |
| 1065 |
ifdef flatmodel |
| 1066 |
mov reg,addr |
| 1067 |
else |
| 1068 |
les reg,addr |
| 1069 |
endif |
| 1070 |
ENDM |
| 1071 |
|
| 1072 |
; Macros for adding and subtracting a value from registers. Two value are |
| 1073 |
; provided, one for 16 bit modes and another for 32 bit modes (the extended |
| 1074 |
; register is used in 32 bit modes). |
| 1075 |
|
| 1076 |
MACRO _add reg, val16, val32 |
| 1077 |
ifdef flatmodel |
| 1078 |
add e®&, val32 |
| 1079 |
else |
| 1080 |
add reg, val16 |
| 1081 |
endif |
| 1082 |
ENDM |
| 1083 |
|
| 1084 |
MACRO _sub reg, val16, val32 |
| 1085 |
ifdef flatmodel |
| 1086 |
sub e®&, val32 |
| 1087 |
else |
| 1088 |
sub reg, val16 |
| 1089 |
endif |
| 1090 |
ENDM |
| 1091 |
|
| 1092 |
; Macro to clear the high order word for the 32 bit extended registers. |
| 1093 |
; This is used to convert an unsigned 16 bit value to an unsigned 32 bit |
| 1094 |
; value, and will evaluate to nothing in 16 bit modes. |
| 1095 |
|
| 1096 |
MACRO clrhi reg |
| 1097 |
ifdef flatmodel |
| 1098 |
movzx e®&,reg |
| 1099 |
endif |
| 1100 |
ENDM |
| 1101 |
|
| 1102 |
MACRO sgnhi reg |
| 1103 |
ifdef flatmodel |
| 1104 |
movsx e®&,reg |
| 1105 |
endif |
| 1106 |
ENDM |
| 1107 |
|
| 1108 |
; Macro to load an extended register with an integer value in either mode |
| 1109 |
|
| 1110 |
MACRO loadint reg,val |
| 1111 |
ifdef flatmodel |
| 1112 |
mov e®&,val |
| 1113 |
else |
| 1114 |
xor e®&,e®& |
| 1115 |
mov reg,val |
| 1116 |
endif |
| 1117 |
ENDM |
| 1118 |
|
| 1119 |
; Macros to load and store integer values with string instructions |
| 1120 |
|
| 1121 |
MACRO LODSINT |
| 1122 |
ifdef flatmodel |
| 1123 |
lodsd |
| 1124 |
else |
| 1125 |
lodsw |
| 1126 |
endif |
| 1127 |
ENDM |
| 1128 |
|
| 1129 |
MACRO STOSINT |
| 1130 |
ifdef flatmodel |
| 1131 |
stosd |
| 1132 |
else |
| 1133 |
stosw |
| 1134 |
endif |
| 1135 |
ENDM |
| 1136 |
|
| 1137 |
; Macros to provide resb, resw, resd compatibility with NASM |
| 1138 |
|
| 1139 |
MACRO dclb count |
| 1140 |
db count dup (0) |
| 1141 |
ENDM |
| 1142 |
|
| 1143 |
MACRO dclw count |
| 1144 |
dw count dup (0) |
| 1145 |
ENDM |
| 1146 |
|
| 1147 |
MACRO dcld count |
| 1148 |
dd count dup (0) |
| 1149 |
ENDM |
| 1150 |
|
| 1151 |
; Macros to provide resb, resw, resd compatibility with NASM |
| 1152 |
|
| 1153 |
MACRO resb count |
| 1154 |
db count dup (?) |
| 1155 |
ENDM |
| 1156 |
|
| 1157 |
MACRO resw count |
| 1158 |
dw count dup (?) |
| 1159 |
ENDM |
| 1160 |
|
| 1161 |
MACRO resd count |
| 1162 |
dd count dup (?) |
| 1163 |
ENDM |
| 1164 |
|
| 1165 |
; Macros to declare assembler stubs for function structures |
| 1166 |
|
| 1167 |
MACRO BEGIN_STUBS_DEF name, firstOffset |
| 1168 |
begdataseg _STUBS |
| 1169 |
ifdef __NOU_VAR__ |
| 1170 |
EXTRN name:DWORD |
| 1171 |
STUBS_START = name |
| 1172 |
else |
| 1173 |
EXTRN _&name&:DWORD |
| 1174 |
name EQU _&name& |
| 1175 |
STUBS_START = _&name |
| 1176 |
endif |
| 1177 |
enddataseg _STUBS |
| 1178 |
begcodeseg _STUBS |
| 1179 |
off = firstOffset |
| 1180 |
ENDM |
| 1181 |
|
| 1182 |
MACRO DECLARE_STUB name |
| 1183 |
ifdef __NOU__ |
| 1184 |
name: |
| 1185 |
PUBLIC name |
| 1186 |
else |
| 1187 |
_&name: |
| 1188 |
PUBLIC _&name |
| 1189 |
endif |
| 1190 |
jmp [DWORD STUBS_START+off] |
| 1191 |
off = off + 4 |
| 1192 |
ENDM |
| 1193 |
|
| 1194 |
MACRO DECLARE_STDCALL name,num_args |
| 1195 |
ifdef STDCALL_MANGLE |
| 1196 |
_&name&@&num_args&: |
| 1197 |
PUBLIC _&name&@&num_args& |
| 1198 |
else |
| 1199 |
name: |
| 1200 |
PUBLIC name |
| 1201 |
endif |
| 1202 |
jmp [DWORD STUBS_START+off] |
| 1203 |
off = off + 4 |
| 1204 |
ENDM |
| 1205 |
|
| 1206 |
MACRO END_STUBS_DEF |
| 1207 |
endcodeseg _STUBS |
| 1208 |
ENDM |
| 1209 |
|
| 1210 |
MACRO BEGIN_IMPORTS_DEF name |
| 1211 |
BEGIN_STUBS_DEF name,4 |
| 1212 |
ENDM |
| 1213 |
|
| 1214 |
MACRO DECLARE_IMP name |
| 1215 |
DECLARE_STUB name |
| 1216 |
ENDM |
| 1217 |
|
| 1218 |
MACRO END_IMPORTS_DEF |
| 1219 |
END_STUBS_DEF |
| 1220 |
ENDM |
| 1221 |
|
| 1222 |
endif |