4,7 → 4,7 |
; Compile with FASM for Menuet |
; |
include 'lang.inc' |
include '..\..\..\macros.inc' |
include 'macros.inc' |
|
use32 |
org 0x0 |
24,16 → 24,15 |
mov ebx,1 ; define receive area |
mov ecx,received_messages ; pointer to start |
mov edx,1000 ; size of area |
mcall |
int 0x40 |
|
mov eax,40 ; WANTED EVENTS |
mov ebx,01000111b ; IPC 7 + defaults |
mcall |
int 0x40 |
|
mov [received_messages+8],dword 0*256+0 |
mov [received_messages+12],dword 0 |
|
red: |
call draw_window ; at first, draw the window |
|
still: |
40,7 → 39,7 |
|
mov eax,23 ; wait here for event |
mov ebx,50 |
mcall |
int 0x40 |
|
cmp eax,1 ; redraw request ? |
je red |
57,19 → 56,23 |
|
jmp still |
|
red: ; redraw |
call draw_window |
jmp still |
|
key: ; key |
mov eax,2 ; just read it and ignore |
mcall |
int 0x40 |
jmp still |
|
button: ; button |
mov eax,17 ; get id |
mcall |
int 0x40 |
|
cmp ah,1 ; button id=1 ? |
jne noclose |
mov eax,-1 ; close this program |
mcall |
int 0x40 |
noclose: |
|
cmp ah,2 |
98,7 → 101,7 |
mov ecx,[PID] |
mov edx,message+4 |
mov esi,20;[message_size] |
mcall |
int 0x40 |
|
jmp still |
no_read: |
158,7 → 161,7 |
mov ebx,25*65536+245 |
mov ecx,105*65536+90 |
mov edx,0xdddddd |
mcall |
int 0x40 |
|
cmp [received_messages+4],dword 8 ; empty list |
je ipma1 |
176,7 → 179,7 |
mov eax,47 |
mov ebx,4*65536 |
mov esi,0xff0000 |
mcall |
int 0x40 |
popa |
pusha |
mov esi,20 |
183,7 → 186,7 |
add edx,8 |
add ebx,30*65536 |
mov eax,4 |
mcall |
int 0x40 |
popa |
|
add ebx,10 |
219,21 → 222,27 |
|
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
mcall |
int 0x40 |
|
; DRAW WINDOW |
mov eax,0 ; function 0 : define and draw window |
mov ebx,100*65536+290 ; [x start] *65536 + [x size] |
mov ecx,100*65536+220 ; [y start] *65536 + [y size] |
mov edx,0x13ffffff ; color of work area RRGGBB,8->color gl |
mov edi,title ; WINDOW LABEL |
mcall |
mov edx,0x03ffffff ; color of work area RRGGBB,8->color gl |
int 0x40 |
|
; WINDOW LABEL |
mov eax,4 ; function 4 : write text to window |
mov ebx,8*65536+8 ; [x start] *65536 + [y start] |
mov ecx,0x10ffffff ; color of text RRGGBB |
mov edx,labelt ; pointer to text beginning |
mov esi,labellen-labelt ; text length |
int 0x40 |
|
mov eax,9 |
mov ebx,process_info |
mov ecx,-1 |
mcall |
int 0x40 |
|
mov eax,47 |
mov ebx,4*65536 |
240,7 → 249,7 |
mov ecx,[process_info+30] |
mov edx,180*65536+35 |
mov esi,0x000000 |
mcall |
int 0x40 |
|
mov eax,8 ; MESSAGE |
mov ebx,25*65536+87 |
247,21 → 256,22 |
mov ecx,50*65536+16 |
mov edx,2 |
mov esi,0x5588dd |
mcall |
int 0x40 |
|
;mov eax,8 ; POP |
mov eax,8 ; POP |
mov ebx,216*65536+53 |
mov ecx,80*65536+16 |
mov edx,3 |
mcall |
mov esi,0x5588dd |
int 0x40 |
|
mov eax,4 |
mov ebx,25*65536+35 ; draw info text with function 4 |
mov ecx,0x224466 |
mov edx,text |
mov esi,40 |
newline: |
mcall |
mov eax,4 |
int 0x40 |
add ebx,10 |
add edx,40 |
cmp [edx],byte 'x' |
271,7 → 281,7 |
|
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
mcall |
int 0x40 |
|
ret |
|
298,7 → 308,7 |
|
f11: |
mov eax,10 |
mcall |
int 0x40 |
cmp eax,2 |
jz fbu |
|
309,7 → 319,7 |
|
fbu: |
mov eax,2 |
mcall ; get key |
int 0x40 ; get key |
shr eax,8 |
|
cmp eax,13 |
356,7 → 366,7 |
shl ecx,16 |
mov cx,8 |
mov edx,0xffffff |
mcall |
int 0x40 |
|
mov eax,4 |
mov ebx,[xa] |
365,7 → 375,7 |
mov ecx,0x000000 |
mov edx,[addr] |
mov esi,25 |
mcall |
int 0x40 |
|
ret |
|
390,7 → 400,9 |
db 'x' ; <- END MARKER, DONT DELETE |
|
|
title db 'IPC - START AT LEAST 2',0 |
labelt: |
db 'IPC - START AT LEAST 2' |
labellen: |
|
I_END: |
|