Subversion Repositories Kolibri OS

Rev

Rev 593 | Rev 1055 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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