Subversion Repositories Kolibri OS

Rev

Rev 109 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 109 Rev 485
Line 3... Line 3...
3
;
3
;
4
;    Compile with FASM for Menuet
4
;    Compile with FASM for Menuet
5
;
5
;
Line 6... Line 6...
6
   
6
   
7
use32
-
 
8
   
7
use32
9
                org     0x0
-
 
10
   
8
 org	0x0
11
                db      'MENUET00'              ; 8 byte id
9
 db	'MENUET01'    ; header
12
                dd      38                      ; required os
10
 dd	0x01	      ; header version
13
                dd      START                   ; program start
11
 dd	START	      ; entry point
14
                dd      I_END                   ; program image size
12
 dd	I_END	      ; image size
-
 
13
 dd	I_END+0x10000 ; required memory
15
                dd      0x100000                ; required amount of memory
14
 dd	I_END+0x10000 ; esp
Line 16... Line 15...
16
                dd      0x00000000              ; reserved=no extended header
15
 dd	0x0 , 0x0     ; I_Param , I_Path
17
   
16
   
Line 18... Line 17...
18
include 'lang.inc'
17
include 'lang.inc'
-
 
18
include '..\..\..\macros.inc'
19
include 'macros.inc'
19
   
Line 20... Line 20...
20
   
20
START:                          ; start of execution
21
START:                          ; start of execution
21
 
22
    call draw_window            ; at first, draw the window
22
    call draw_window            ; at first, draw the window
23
   
23
   
Line 24... Line 24...
24
still:
24
still:
25
    mov  eax,23                 ; wait here for event
25
    mov  eax,23                 ; wait here for event
26
    mov  ebx,200    ; Time out after 2s
26
    mov  ebx,200    ; Time out after 2s
27
    int  0x40
27
    mcall
Line 36... Line 36...
36
 ; read the stack status data, and write it to the screen buffer
36
 ; read the stack status data, and write it to the screen buffer
Line 37... Line 37...
37
   
37
   
38
 mov  eax, 53
38
 mov  eax, 53
39
 mov  ebx, 255
39
 mov  ebx, 255
40
 mov  ecx, 6
40
 mov  ecx, 6
Line 41... Line 41...
41
 int  0x40
41
 mcall
42
   
42
   
Line 43... Line 43...
43
 mov  ebx, text + 24
43
 mov  ebx, text + 24
44
 call printhex
44
 call printhex
45
   
45
   
46
 mov  eax, 53
46
 mov  eax, 53
Line 47... Line 47...
47
 mov  ebx, 255
47
 mov  ebx, 255
48
 mov  ecx, 2
48
 mov  ecx, 2
Line 49... Line 49...
49
 int  0x40
49
 mcall
50
   
50
   
51
 mov  ebx, text + 107
51
 mov  ebx, text + 107
52
 call printhex
52
 call printhex
Line 53... Line 53...
53
   
53
   
54
 mov  eax, 53
54
 mov  eax, 53
Line 55... Line 55...
55
 mov  ebx, 255
55
 mov  ebx, 255
56
 mov  ecx, 5
56
 mov  ecx, 5
57
 int  0x40
57
 mcall
58
   
58
   
Line 59... Line 59...
59
 mov  ebx, text + 107 + 40
59
 mov  ebx, text + 107 + 40
60
 call printhex
60
 call printhex
Line 61... Line 61...
61
   
61
   
62
 mov  eax, 53
62
 mov  eax, 53
63
 mov  ebx, 255
63
 mov  ebx, 255
64
 mov  ecx, 4
64
 mov  ecx, 4
Line 65... Line 65...
65
 int  0x40
65
 mcall
66
   
66
   
Line 67... Line 67...
67
 mov  ebx, text + 107 + 80
67
 mov  ebx, text + 107 + 80
68
 call printhex
68
 call printhex
69
   
69
   
70
 mov  eax, 53
70
 mov  eax, 53
Line 71... Line 71...
71
 mov  ebx, 255
71
 mov  ebx, 255
72
 mov  ecx, 100
72
 mov  ecx, 100
Line 73... Line 73...
73
 int  0x40
73
 mcall
74
   
74
   
75
 mov  ebx, text + 258
75
 mov  ebx, text + 258
76
 call printhex
76
 call printhex
Line 77... Line 77...
77
   
77
   
78
 mov  eax, 53
78
 mov  eax, 53
Line 79... Line 79...
79
 mov  ebx, 255
79
 mov  ebx, 255
80
 mov  ecx, 101
80
 mov  ecx, 101
81
 int  0x40
81
 mcall
82
   
82
   
Line 83... Line 83...
83
 mov  ebx, text + 258 + 40
83
 mov  ebx, text + 258 + 40
84
 call printhex
84
 call printhex
Line 85... Line 85...
85
   
85
   
86
 mov  eax, 53
86
 mov  eax, 53
87
 mov  ebx, 255
87
 mov  ebx, 255
Line 88... Line 88...
88
 mov  ecx, 102
88
 mov  ecx, 102
89
 int  0x40
89
 mcall
90
   
90
   
91
 mov  ebx, text + 258 + 80
91
 mov  ebx, text + 258 + 80
Line 92... Line 92...
92
 call printhex
92
 call printhex
93
   
93
   
94
 mov  eax, 53
94
 mov  eax, 53
Line 95... Line 95...
95
 mov  ebx, 255
95
 mov  ebx, 255
96
 mov  ecx, 103
96
 mov  ecx, 103
Line 97... Line 97...
97
 int  0x40
97
 mcall
98
   
98
   
Line 99... Line 99...
99
 mov  ebx, text + 258 + 120
99
 mov  ebx, text + 258 + 120
Line 130... Line 130...
130
   
130
   
Line 131... Line 131...
131
draw_window:
131
draw_window:
132
   
132
   
133
    mov  eax,12                    ; function 12:tell os about windowdraw
133
    mov  eax,12                    ; function 12:tell os about windowdraw
Line 134... Line 134...
134
    mov  ebx,1                     ; 1, start of draw
134
    mov  ebx,1                     ; 1, start of draw
135
    int  0x40
135
    mcall
136
   
136
   
137
                                   ; DRAW WINDOW
137
                                   ; DRAW WINDOW
138
    mov  eax,0                     ; function 0 : define and draw window
138
    xor  eax,eax                   ; function 0 : define and draw window
139
    mov  ebx,100*65536+260         ; [x start] *65536 + [x size]
-
 
140
    mov  ecx,100*65536+205         ; [y start] *65536 + [y size]
139
    mov  ebx,100*65536+260         ; [x start] *65536 + [x size]
141
    mov  edx,0x03224466            ; color of work area RRGGBB
140
    mov  ecx,100*65536+205         ; [y start] *65536 + [y size]
142
    mov  esi,0x00334455            ; color of grab bar  RRGGBB,8->color gl
141
    mov  edx,0x13224466            ; color of work area RRGGBB
143
    mov  edi,0x00ddeeff            ; color of frames    RRGGBB
-
 
144
    int  0x40
-
 
145
   
-
 
146
                                   ; WINDOW LABEL
-
 
147
    mov  eax,4                     ; function 4 : write text to window
-
 
148
    mov  ebx,8*65536+8             ; [x start] *65536 + [y start]
-
 
149
    mov  ecx,0x00ffffff            ; color of text RRGGBB
-
 
Line 150... Line 142...
150
    mov  edx,labelt                ; pointer to text beginning
142
    mov  edi,title                 ; WINDOW LABEL
151
    mov  esi,labellen-labelt       ; text length
143
    mcall
-
 
144
   
152
    int  0x40
145
                                  
153
   
146
    ; Re-draw the screen text
154
    ; Re-draw the screen text
147
    cld
155
    cld
148
    mov  eax,4
156
    mov  ebx,25*65536+35           ; draw info text with function 4
149
    mov  ebx,25*65536+35           ; draw info text with function 4
157
    mov  ecx,0xffffff
150
    mov  ecx,0xffffff
158
    mov  edx,text
-
 
159
    mov  esi,40
151
    mov  edx,text
160
  newline:
152
    mov  esi,40
161
    mov  eax,4
153
  newline:
162
    int  0x40
154
    mcall
Line 163... Line 155...
163
    add  ebx,16
155
    add  ebx,16
164
    add  edx,40
156
    add  edx,40
165
    cmp  [edx],byte 'x'
157
    cmp  [edx],byte 'x'
Line 166... Line 158...
166
    jnz  newline
158
    jnz  newline
Line 167... Line 159...
167
   
159
   
168
   
160
   
Line 209... Line 201...
209
    db ' IPIN  QUEUE    : xxxxxxxx              '
201
    db ' IPIN  QUEUE    : xxxxxxxx              '
210
    db ' NET1OUT QUEUE  : xxxxxxxx              '
202
    db ' NET1OUT QUEUE  : xxxxxxxx              '
211
    db 'x <- END MARKER, DONT DELETE            '
203
    db 'x <- END MARKER, DONT DELETE            '
Line 212... Line -...
212
   
-
 
213
   
204
   
214
labelt:
-
 
Line 215... Line 205...
215
    db   'Stack Status'
205
   
Line 216... Line 206...
216
labellen:
206
title    db   'Stack Status',0