Subversion Repositories Kolibri OS

Rev

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

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