]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/services/gfx/mw/v2_0/src/drivers/asmmsc.h
Initial revision
[karo-tx-redboot.git] / packages / services / gfx / mw / v2_0 / src / drivers / asmmsc.h
1 ; 30 Aug 92
2 ; Copyright (c) 1999 Greg Haerr <greg@censoft.com>
3 ; msc.h - asm.h include for MSC Compiler
4 ;
5 ; 8/30/92 changed small model to use _TEXT only for fixup overflows
6 ; 7/26/92 v6.3 .center/.cexit macros for TSC
7 ; 11/17/90 original version
8 ;
9 ; .header - start an assembly file
10 .header macro
11 ifdef __SMALL__
12 _TEXT   SEGMENT  WORD PUBLIC 'CODE'
13 _TEXT   ENDS
14 else
15 ASM_TEXT        SEGMENT  WORD PUBLIC 'CODE'
16 ASM_TEXT        ENDS
17 endif
18 _DATA   SEGMENT  WORD PUBLIC 'DATA'
19 _DATA   ENDS
20 CONST   SEGMENT  WORD PUBLIC 'CONST'
21 CONST   ENDS
22 _BSS    SEGMENT  WORD PUBLIC 'BSS'
23 _BSS    ENDS
24 DGROUP  GROUP   CONST, _BSS, _DATA
25 ifdef __LARGE__
26         ASSUME  CS: ASM_TEXT, DS: DGROUP, SS: DGROUP
27 endif
28 ifdef __MEDIUM__
29         ASSUME  CS: ASM_TEXT, DS: DGROUP                ; small data
30 endif
31 ifdef __SMALL__
32         ASSUME  CS: _TEXT, DS: DGROUP                   ; small data
33 endif
34 _BSS    SEGMENT
35 _BSS    ENDS
36         endm
37 ;
38 ; .cseg - start a code segment
39 .cseg   macro
40 ifdef __SMALL__
41 _TEXT      SEGMENT
42         ASSUME  CS: _TEXT
43 else
44 ASM_TEXT      SEGMENT
45         ASSUME  CS: ASM_TEXT
46 endif
47         endm
48 ;
49 ; .cend - end a code segment
50 .cend   macro
51 ifdef __SMALL__
52 _TEXT   ENDS
53 else
54 ASM_TEXT        ENDS
55 endif
56         endm
57 ;
58 ; .dseg - start a data segment
59 .dseg   macro
60 _DATA   segment word public 'DATA'
61         endm
62 ;
63 ; .dsym - define data
64 .dsym   macro   name,type
65         public  _&name
66 _&name  label   type
67         endm
68 ;
69 ; .dend - end a data segment
70 .dend   macro
71 _DATA   ends
72         endm
73 ;
74 ; .cextp name - declare an external procedure, use current model for near/far
75 .cextp  macro   name
76 if      LPROG
77         extrn _&name:far
78 else
79         extrn _&name:near
80 endif
81 name&@  equ     _&name
82         endm
83 ;
84 ; .cextrn name,type - declare external C variable and type
85 .cextrn macro   name,type
86         extrn   _&name:type
87 name&@  equ     DGROUP:_&name
88         endm
89 ;
90 ; .cproc name - used to start a C procedure
91 .cproc  macro   name
92         public _&name
93 if      LPROG
94         arg1    = 6
95         _&name  proc    far
96 else
97         arg1    = 4
98         _&name  proc    near
99 endif
100 name&@  equ     _&name
101         endm
102 ;
103 ; .cendp - end a C procedure
104 .cendp macro name
105 _&name  endp
106         endm
107 ;
108 ; .center - enter C procedure
109 .center macro
110         push    bp
111         mov     bp,sp
112         endm
113 ;
114 ; .cexit - exit C procedure
115 .cexit  macro
116         pop     bp
117         ret
118         endm
119