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