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