home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / i386 / asm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-22  |  2.7 KB  |  113 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1992 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon 
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    asm.h,v $
  29.  * Revision 2.1  92/04/21  17:18:59  rwd
  30.  * BSDSS
  31.  * 
  32.  *
  33.  */
  34.  
  35. #define S_ARG0     4(%esp)
  36. #define S_ARG1     8(%esp)
  37. #define S_ARG2    12(%esp)
  38. #define S_ARG3    16(%esp)
  39.  
  40. #define FRAME    pushl %ebp; movl %esp, %ebp
  41. #define EMARF    leave
  42.  
  43. #define B_ARG0     8(%ebp)
  44. #define B_ARG1    12(%ebp)
  45. #define B_ARG2    16(%ebp)
  46. #define B_ARG3    20(%ebp)
  47.  
  48. #ifdef    wheeze
  49.  
  50. #define ALIGN 4
  51. #define EXT(x) x
  52. #define LCL(x) ./**/x
  53.  
  54. #define LB(x,n) ./**/x
  55. #define LBb(x,n) ./**/x
  56. #define LBf(x,n) ./**/x
  57.  
  58. #define    SVC lcall $7,$0
  59.  
  60. #define String .string
  61. #define Value  .value
  62. #define Times(a,b) [a\*b]
  63. #define Divide(a,b) [a\\b]
  64.  
  65. #define INB    inb    (%dx)
  66. #define OUTB    outb    (%dx)
  67. #define INL    inl    (%dx)
  68. #define OUTL    outl    (%dx)
  69.  
  70. #else    wheeze
  71.  
  72. #define ALIGN 2
  73. #define EXT(x) _/**/x
  74. #define    LCL(x)    x
  75.  
  76. #define LB(x,n) n
  77. #define LBb(x,n) n/**/b
  78. #define LBf(x,n) n/**/f
  79.  
  80. #define SVC .byte 0x9a; .long 0; .word 0x7
  81.  
  82. #define String    .ascii
  83. #define Value    .word
  84. #define Times(a,b) (a*b)
  85. #define Divide(a,b) (a/b)
  86.  
  87. #define INB    inb    %dx, %al
  88. #define OUTB    outb    %al, %dx
  89. #define INL    inl    %dx, %eax
  90. #define OUTL    outl    %eax, %dx
  91.  
  92. #endif    wheeze
  93.  
  94. #define data16    .byte 0x66
  95. #define addr16    .byte 0x67
  96.  
  97.  
  98.  
  99. #ifdef GPROF
  100. #define MCOUNT        .data; LB(x, 9): .long 0; .text; lea LBb(x, 9),%edx; call mcount
  101. #define    ENTRY(x)    .globl EXT(x); .align ALIGN; EXT(x): ; \
  102.             pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
  103. #define    ASENTRY(x)     .globl x; .align ALIGN; x: ; \
  104.             pushl %ebp; movl %esp, %ebp; MCOUNT; popl %ebp;
  105. #else    GPROF
  106. #define MCOUNT
  107. #define    ENTRY(x)    .globl EXT(x); .align ALIGN; EXT(x):
  108. #define    ASENTRY(x)    .globl x; .align ALIGN; x:
  109. #endif    GPROF
  110.  
  111. #define    Entry(x)    .globl EXT(x); .align ALIGN; EXT(x):
  112. #define    DATA(x)        .globl EXT(x); .align ALIGN; EXT(x):
  113.