Subversion Repositories Kolibri OS

Rev

Rev 426 | Rev 521 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
426 mikedld 1
 
2
3
 
4
  match =: Num =$,a \{
5
    if __REV < Num
6
      __REV = Num
7
    end if
8
  \}
9
}
10
11
 
12
13
 
14
macro struct name, [arg]
15
 {
16
  common
17
   name@struct equ name
18
   struc name arg {
19
 }
20
21
 
22
 {
23
  match xname,name
24
  \{
25
   virtual at 0
26
   xname xname
27
   sizeof.#xname = $ - xname
28
   name equ sizeof.#xname
29
   end virtual
30
  \}
31
 }
32
33
 
34
35
 
36
37
 
38
macro diff16 title,l1,l2
39
{
40
  local s,d
41
  s = l2-l1
42
  display title,': 0x'
43
  repeat 16
506 mikedld 44
    d = 48 + s shr ((16-%) shl 2) and $0F
45
    if d > 57
426 mikedld 46
      d = d + 65-57-1
47
    end if
48
    display d
49
  end repeat
50
  display 13,10
51
}
52
macro diff10 title,l1,l2
53
 {
54
  local s,d,z,m
55
  s = l2-l1
56
  z = 0
57
  m = 1000000000
58
  display title,': '
59
  repeat 10
60
   d = '0' + s / m
61
   s = s - (s/m)*m
62
   m = m / 10
63
   if d <> '0'
64
    z = 1
65
   end if
66
   if z <> 0
67
    display d
68
   end if
69
  end repeat
70
  display 13,10
71
 }
72
73
 
74
; may be useful for kernel debugging
75
; example 1:
76
;       dbgstr 'Hello, World!'
77
; example 2:
78
;       dbgstr 'Hello, World!', save_flags
79
macro dbgstr string*, f
80
{
81
local a
82
iglobal_nested
83
a db 'K : ',string,13,10,0
84
endg_nested
85
if ~ f eq
86
	pushfd
87
end if
88
	push	esi
89
	mov	esi, a
90
	call	sys_msg_board_str
91
	pop	esi
92
if ~ f eq
93
	popfd
94
end if
95
}
96
; \end{diamond}[29.09.2006]
97