Rev 425 | Rev 431 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 425 | Rev 426 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | $Revision: 425 $ |
1 | $Revision: 426 $ |
2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3 | ;; ;; |
3 | ;; ;; |
4 | ;; KERNEL32.INC ;; |
4 | ;; KERNEL32.INC ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;; Included 32 bit kernel files for MenuetOS ;; |
6 | ;; Included 32 bit kernel files for MenuetOS ;; |
Line 9... | Line 9... | ||
9 | ;; maintain and compile with an automated SETUP program ;; |
9 | ;; maintain and compile with an automated SETUP program ;; |
10 | ;; in the future. ;; |
10 | ;; in the future. ;; |
11 | ;; ;; |
11 | ;; ;; |
12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 13... | Line -... | ||
13 | - | ||
14 | ; structure definition helper |
- | |
15 | macro struct name, [arg] |
- | |
16 | { |
- | |
17 | common |
- | |
18 | name@struct equ name |
- | |
19 | struc name arg { |
- | |
20 | } |
- | |
21 | - | ||
22 | macro struct_helper name |
- | |
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 | ends fix } struct_helper name@struct |
- | |
35 | - | ||
36 | ;// mike.dld, 2006-29-01 [ |
- | |
37 | - | ||
38 | ; macros definition |
- | |
39 | macro diff16 title,l1,l2 |
- | |
40 | { |
- | |
41 | local s,d |
- | |
42 | s = l2-l1 |
- | |
43 | display title,': 0x' |
- | |
44 | repeat 8 |
- | |
45 | d = 48 + s shr ((8-%) shl 2) and $0F |
- | |
46 | if d > 57 |
- | |
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 | ; \begin{diamond}[29.09.2006] |
- | |
75 | ; may be useful for kernel debugging |
- | |
76 | ; example 1: |
- | |
77 | ; dbgstr 'Hello, World!' |
- | |
78 | ; example 2: |
- | |
79 | ; dbgstr 'Hello, World!', save_flags |
- | |
80 | macro dbgstr string*, f |
- | |
81 | { |
- | |
82 | local a |
- | |
83 | iglobal_nested |
- | |
84 | a db 'K : ',string,13,10,0 |
- | |
85 | endg_nested |
- | |
86 | if ~ f eq |
- | |
87 | pushfd |
- | |
88 | end if |
- | |
89 | push esi |
- | |
90 | mov esi, a |
- | |
91 | call sys_msg_board_str |
- | |
92 | pop esi |
- | |
93 | if ~ f eq |
- | |
94 | popfd |
- | |
95 | end if |
- | |
96 | } |
- | |
97 | ; \end{diamond}[29.09.2006] |
- | |
98 | 13 | ||
99 | ;struc db [a] { common . db a |
14 | ;struc db [a] { common . db a |
100 | ; if ~used . |
15 | ; if ~used . |
101 | ; display 'not used db: ',`.,13,10 |
16 | ; display 'not used db: ',`.,13,10 |
102 | ; end if } |
17 | ; end if } |