Rev 205 | Rev 485 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 205 | Rev 317 | ||
---|---|---|---|
Line 36... | Line 36... | ||
36 | div ebx |
36 | div ebx |
37 | add dl,48 |
37 | add dl,48 |
38 | mov [edi],dl |
38 | mov [edi],dl |
39 | sub edi,1 |
39 | sub edi,1 |
40 | loop newnum |
40 | loop newnum |
41 | 41 | red: |
|
42 | call draw_window ; at first, draw the window |
42 | call draw_window ; at first, draw the window |
Line 43... | Line 43... | ||
43 | 43 | ||
Line 44... | Line 44... | ||
44 | still: |
44 | still: |
Line 53... | Line 53... | ||
53 | cmp eax,3 ; button in buffer ? |
53 | cmp eax,3 ; button in buffer ? |
54 | jz button |
54 | jz button |
Line 55... | Line 55... | ||
55 | 55 | ||
Line 56... | Line -... | ||
56 | jmp still |
- | |
57 | - | ||
58 | red: ; redraw |
- | |
59 | call draw_window |
- | |
60 | jmp still |
56 | jmp still |
61 | 57 | ||
62 | key: ; key |
58 | key: ; key |
63 | mov eax,2 ; just read it and ignore |
59 | mov eax,2 ; just read it and ignore |
Line 68... | Line 64... | ||
68 | mov eax,17 ; get id |
64 | mov eax,17 ; get id |
69 | int 0x40 |
65 | int 0x40 |
Line 70... | Line 66... | ||
70 | 66 | ||
71 | cmp ah,1 ; button id=1 ? |
67 | cmp ah,1 ; button id=1 ? |
72 | jnz still |
68 | jnz still |
73 | mov eax,-1 ; close this program |
69 | or eax,-1 ; close this program |
Line 74... | Line 70... | ||
74 | int 0x40 |
70 | int 0x40 |
75 | 71 | ||
Line 94... | Line 90... | ||
94 | ; DRAW WINDOW |
90 | ; DRAW WINDOW |
95 | mov eax,0 ; function 0 : define and draw window |
91 | mov eax,0 ; function 0 : define and draw window |
96 | mov ebx,100*65536+200 ; [x start] *65536 + [x size] |
92 | mov ebx,100*65536+200 ; [x start] *65536 + [x size] |
97 | mov ecx,100*65536+65 ; [y start] *65536 + [y size] |
93 | mov ecx,100*65536+65 ; [y start] *65536 + [y size] |
98 | mov edx,[sc.work] ; color of work area RRGGBB,8->color glide |
94 | mov edx,[sc.work] ; color of work area RRGGBB,8->color glide |
99 | mov esi,[sc.grab] ; color of grab bar RRGGBB,8->color |
95 | or edx,0x33000000 ; color of grab bar RRGGBB,8->color |
100 | or esi,0x80000000 |
- | |
101 | mov edi,[sc.frame] ; color of frames RRGGBB |
- | |
102 | int 0x40 |
- | |
103 | - | ||
104 | ; WINDOW LABEL |
96 | mov edi,header ; WINDOW LABEL |
105 | mov eax,4 ; function 4 : write text to window |
- | |
106 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] |
- | |
107 | mov ecx,[sc.grab_text] ; color of text RRGGBB |
- | |
108 | or ecx,0x10000000 |
- | |
109 | mov edx,labelt ; pointer to text beginning |
- | |
110 | mov esi,labellen-labelt ; text length |
- | |
111 | int 0x40 |
- | |
112 | ; CLOSE BUTTON |
- | |
113 | mov eax,8 ; function 8 : define and draw button |
- | |
114 | mov ebx,(200-17)*65536+12 ; [x start] *65536 + [x size] |
- | |
115 | mov ecx,5*65536+12 ; [y start] *65536 + [y size] |
- | |
116 | mov edx,1 ; button id |
- | |
117 | mov esi,[sc.grab_button] ; button color RRGGBB |
- | |
118 | int 0x40 |
97 | int 0x40 |
Line -... | Line 98... | ||
- | 98 | ||
119 | 99 | ||
120 | mov ebx,25*65536+35 ; draw info text with function 4 |
100 | mov ebx,20*65536+14 ; draw info text with function 4 |
121 | mov ecx,[sc.work_text] |
101 | mov ecx,[sc.work_text] |
122 | mov edx,text |
102 | mov edx,text |
123 | mov esi,40 |
- | |
124 | newline: |
103 | mov esi,24 |
125 | mov eax,4 |
104 | mov eax,4 |
126 | int 0x40 |
- | |
127 | add ebx,10 |
- | |
128 | add edx,40 |
- | |
129 | cmp [edx],byte 'x' |
- | |
Line 130... | Line 105... | ||
130 | jnz newline |
105 | int 0x40 |
131 | 106 | ||
132 | mov eax,12 ; function 12:tell os about windowdraw |
107 | mov eax,12 ; function 12:tell os about windowdraw |
Line 139... | Line 114... | ||
139 | ; DATA AREA |
114 | ; DATA AREA |
Line 140... | Line 115... | ||
140 | 115 | ||
141 | 116 | ||
142 | text: |
- | |
Line 143... | Line -... | ||
143 | db 'CPU RUNNING AT MHZ ' |
- | |
144 | db 'x' ; <- END MARKER, DONT DELETE |
117 | text: |
145 | - | ||
Line 146... | Line 118... | ||
146 | labelt: |
118 | db 'CPU RUNNING AT MHZ' |
Line 147... | Line 119... | ||
147 | db 'CPU SPEED' |
119 |