home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / uccs / root.14 / udk / usr / ccs / lib / cm4defs next >
Encoding:
Text File  |  1998-08-19  |  2.6 KB  |  85 lines

  1. .ident    "@(#)nas:i386/cm4defs    1.1"
  2. define(_SCR1,eax)dnl
  3. define(_SCRW1,ax)dnl
  4. define(_SCRB1,al)dnl
  5. define(_SCR2,edx)dnl
  6. define(_SCRW2,dx)dnl
  7. define(_SCRB2,dl)dnl
  8. define(_SCR3,ecx)dnl
  9. define(_SCRW3,cx)dnl
  10. define(_SCRB3,cl)dnl
  11. define(_1STREG,edi)dnl
  12. define(_1STREGW,di)dnl
  13. define(_2NDREG,esi)dnl
  14. define(_2NDREGW,si)dnl
  15. define(_3RDREG,ebx)dnl
  16. define(_3RDREGW,bx)dnl
  17. define(_3RDREGB,bl)dnl
  18. define(_1STARG,8(%ebp))dnl
  19. define(_2NDARG,12(%ebp))dnl
  20. define(_3RDARG,16(%ebp))dnl
  21. define(_4THARG,20(%ap))dnl
  22. define(_5THARG,24(%ap))dnl
  23. define(C_PROLOGUE,`define(`_RET_NO',incr(_RET_NO))define(`_F_NAME',$1)dnl
  24.     .text;dnl
  25.     .align    4;dnl
  26.     .globl    $1;dnl
  27.         .type   _F_NAME, @function;dnl
  28. $1:    pushl    %ebp;dnl
  29.     movl    %esp,%ebp`'dnl
  30. ifelse($2,1,`;    pushl    %edi')`'dnl
  31. ifelse($2,2,`;    pushl    %edi;    pushl    %esi')`'dnl
  32. ifelse($2,3,`;    pushl    %edi;    pushl    %esi;    pushl    %ebx')`'dnl
  33. ifelse($2,,`;    pushl    %edi;    pushl    %esi;    pushl    %ebx')`'dnl
  34. ')dnl
  35. define(PIC_PROLOGUE,`define(`_RET_NO',incr(_RET_NO))define(`_F_NAME',$1)define(`_TEMP_LABEL',.temp`'_RET_NO)dnl
  36.     .text;dnl
  37.     .align    4;dnl
  38.     .globl    $1;dnl
  39.         .type   _F_NAME, @function;dnl
  40. $1:    pushl    %ebp;dnl
  41.     movl    %esp,%ebp;
  42.     pushl    %ebx`'dnl
  43. ifelse($2,1,`;    pushl    %edi')`'dnl
  44. ifelse($2,2,`;    pushl    %edi;    pushl    %esi')`'dnl
  45. ifelse($2,,`;    pushl    %edi;    pushl    %esi');dnl
  46.     call _TEMP_LABEL;dnl
  47. _TEMP_LABEL:  popl %ebx;dnl
  48.     addl $_GLOBAL_OFFSET_TABLE_+[.-_TEMP_LABEL], %ebx`'dnl
  49. ')dnl
  50. define(A_PROLOGUE,`define(`_RET_NO',incr(_RET_NO))define(`_F_NAME',$1)dnl
  51.     .text;dnl
  52.     .align    4;dnl
  53.     .globl    $1;dnl
  54.         .type   _F_NAME, @function;dnl
  55. $1:    pushl    %ebp;dnl
  56.     movl    %esp,%ebp`'dnl
  57. ')dnl
  58. define(I_RETURN,`define(`_RET_LAB',.RET`'_RET_NO)    jmp    _RET_LAB;    .align    4')dnl
  59. define(C_RETURN,`ifelse(_RET_LAB,`_RET_LAB',,_RET_LAB:undefine(`_RET_LAB'))dnl
  60. ifelse($1,1,`    popl    %edi;')`'dnl
  61. ifelse($1,2,`    popl    %esi;    popl    %edi;')`'dnl
  62. ifelse($1,3,`    popl    %ebx;    popl    %esi;    popl    %edi;')`'dnl
  63. ifelse($1,,`    popl    %ebx;    popl    %esi;    popl    %edi;')`'dnl
  64.     leave;dnl
  65.     ret;dnl
  66.     .align    4;dnl
  67.         .size   _F_NAME, . - _F_NAME')dnl
  68. define(PIC_RETURN,`ifelse(_RET_LAB,`_RET_LAB',,_RET_LAB:undefine(`_RET_LAB'))dnl
  69. ifelse($1,1,`    popl    %edi;')`'dnl
  70. ifelse($1,2,`    popl    %esi;    popl    %edi;')`'dnl
  71. ifelse($1,,`    popl    %esi;    popl    %edi;')`'dnl
  72.     popl    %ebx
  73.     leave;dnl
  74.     ret;dnl
  75.     .align    4;dnl
  76.         .size   _F_NAME, . - _F_NAME')dnl
  77. define(A_EPILOGUE,`ifelse(_RET_LAB,`_RET_LAB',,_RET_LAB:undefine(`_RET_LAB'))dnl
  78.     leave;dnl
  79.     ret;dnl
  80.     .align    4;dnl
  81.         .size   _F_NAME, . - _F_NAME')dnl
  82. define(C_CALL,`ifelse($6,,,`    pushl    $6;')ifelse($5,,,`    pushl    $5;')ifelse($4,,,`    pushl    $4;')ifelse($3,,,`    pushl    $3;')ifelse($2,,,`    pushl    $2;')    call    $1')dnl
  83. define(A_CALL,`    call    $1')dnl
  84. define(_RESULT,eax)dnl
  85.