1 @^ fix macro comment {
\r
4 ; --------------------------
\r
5 macro library [lname,fname]
\r
8 dd __#lname#_library_table__,__#lname#_library_name__
\r
13 __#lname#_library_name__ db fname,0
\r
16 macro import lname,[name,sname]
\r
20 __#lname#_library_table__:
\r
23 name dd __#name#_import_name__
\r
30 __#name#_import_name__ db sname,0
\r
34 macro export [name,sname]
\r
37 dd __#name#_export_name__,name
\r
42 __#name#_export_name__ db sname,0
\r
44 ; -------------------------
\r
46 macro m2m dest,src {
\r
53 IGlobals equ IGlobals,
\r
54 macro __IGlobalBlock { }
\r
57 UGlobals equ UGlobals,
\r
58 macro __UGlobalBlock { }
\r
60 endg fix } ; Use endg for ending iglobal and uglobal blocks.
\r
63 macro IncludeIGlobals{
\r
64 macro IGlobals dummy,[n] \{ __IGlobalBlock
\r
65 purge __IGlobalBlock \}
\r
66 match I, IGlobals \{ I \} }
\r
68 macro IncludeUGlobals{
\r
69 macro UGlobals dummy,[n] \{
\r
76 purge __UGlobalBlock
\r
82 match U, UGlobals \{ U \} }
\r
91 ; new application structure
\r
92 macro meos_app_start
\r
104 if used __params & ~defined __params
\r
112 MEOS_APP_START fix meos_app_start
\r
113 KOS_APP_START fix meos_app_start
\r
130 if used __params & ~defined __params
\r
150 MEOS_APP_END fix meos_app_end
\r
151 KOS_APP_END fix meos_app_end
\r
154 ; macro for defining multiline text data
\r
155 struc mstr [sstring]
\r
169 ; macro for defining multiline text data
\r
170 struc mls [sstring]
\r
187 macro sz name,[data] { ; [mike.dld]
\r
195 macro szZ name,[data] { ; same as sz, but for zero terminated string [dunkaist]
\r
204 macro lsz name,[lng,data] { ; [mike.dld]
\r
217 macro szc name,elsz,[data] { ; [mike.dld]
\r
239 macro lszc name,elsz,[lng,data] { ; [mike.dld]
\r
267 ; easy system call macro
\r
268 macro mpack dest, hsrc, lsrc
\r
270 if (hsrc eqtype 0) & (lsrc eqtype 0)
\r
271 mov dest, (hsrc) shl 16 + lsrc
\r
273 if (hsrc eqtype 0) & (~lsrc eqtype 0)
\r
274 mov dest, (hsrc) shl 16
\r
284 macro __mov reg,a,b { ; mike.dld
\r
287 else if (~a eq)&(b eq)
\r
293 ;include 'config.inc'
\r
297 macro mcall a,b,c,d,e,f,g { ; [mike.dld], [Ghost]
\r
307 if __CPU_type eq p5
\r
310 if __CPU_type eq p6
\r
313 push ..ret_point ; it may be 2 or 5 byte
\r
320 if __CPU_type eq k6
\r
325 display 'ERROR : unknown CPU type (set to p5)', 10, 13
\r
334 ; -------------------------
\r
335 macro __header a,[b] {
\r
348 macro __section name {
\r
353 macro __func name {
\r
355 display 'FUNC NOT USED: ',`name,13,10
\r
359 ;diff16 `name,0,name
\r
362 macro endf { end if }
\r
364 macro diff16 title,l1,l2
\r
368 display title,': 0x'
\r
370 d = '0' + s shr ((8-%) shl 2) and $0F
\r
379 macro diff10 title,l1,l2
\r
401 macro movi arg1,arg2
\r
403 if (arg1 in <eax,ebx,ecx,edx,esi,edi,ebp,esp>) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
\r
409 else if (arg2) = -1
\r
411 else if (arg2) >= -128 & (arg2) <= 127
\r
425 match (r=,g=,b),a \{
\r
426 \dd ((r) shl 16) or ((g) shl 8) or (b)
\r
431 struc POINT _t,_dx,_dy {
\r
436 ; structure definition helper
\r
437 include 'struct.inc'
\r
453 ; structures used in KolibriOS
\r
454 struct process_information
\r
455 cpu_usage dd ? ; +0
\r
456 window_stack_position dw ? ; +4
\r
457 window_stack_value dw ? ; +6
\r
459 process_name rb 12 ; +10
\r
460 memory_start dd ? ; +22
\r
461 used_memory dd ? ; +26
\r
464 slot_state dw ? ; +50
\r
466 client_box BOX ; +54
\r
467 wnd_state db ? ; +70
\r
468 event_mask dd ? ; +71
\r
469 keyboard_mode db ? ; +75
\r
473 struct system_colors
\r
474 frame dd ? ;nonset1
\r
478 grab_text dd ? ;window_title
\r
481 work_button_text dd ?
\r
500 DateCreate FILEDATE
\r
501 DateAccess FILEDATE
\r
502 DateModify FILEDATE
\r
508 macro cmovz reg1, reg2 {
\r
512 if __CPU_type eq p5 ; CMOVcc isnt supported on the P5
\r
524 macro cmovnz reg1, reg2 {
\r
528 if __CPU_type eq p5 ; CMOVcc isnt supported on the P5
\r
538 macro cmovg reg1, reg2 {
\r
542 if __CPU_type eq p5 ; CMOVcc isnt supported on the P5
\r
551 macro cmovl reg1, reg2 {
\r
555 if __CPU_type eq p5 ; CMOVcc isnt supported on the P5
\r
564 ; replaces /programs/cmp.inc
\r
565 irp cond, e, ne, g, ng, l, nl, ge, le {
\r
566 macro cmp#cond a, b, c\{
\r
575 BT_DEL = 0x80000000
\r
576 BT_HIDE = 0x40000000
\r
577 BT_NOFRAME = 0x20000000
\r
591 ; event mask bits for function 40
\r
596 EVM_BACKGROUND = 10000b
\r
597 EVM_MOUSE = 100000b
\r
599 EVM_STACK = 10000000b
\r
600 EVM_DEBUG = 100000000b
\r
601 EVM_STACK2 = 1000000000b
\r
603 EVM_MOUSE_FILTER = 0x80000000
\r
604 EVM_CURSOR_FILTER = 0x40000000
\r