Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3497 | yogev_ezra | 1 | use32 |
2 | |||
3 | org 0x0 |
||
4 | |||
5 | db 'MENUET01' |
||
6 | dd 0x01 |
||
7 | dd START |
||
8 | dd I_END |
||
9 | dd 0x100000 |
||
10 | dd 0x7fff0 |
||
11 | dd I_PARAM ; указатель на параметры |
||
12 | |||
13 | include "CMDIPC.INC" ; Подключить файл CMDIPC.INC |
||
14 | |||
15 | START: |
||
16 | call initipc ; инициализировать для работы с CMD |
||
17 | |||
18 | mov eax,47 ; вывести сообщение |
||
19 | mov ebx,mess |
||
20 | call print |
||
21 | |||
22 | call eol ; пропустить строку |
||
23 | call eol |
||
24 | |||
25 | cmp [I_PARAM],byte 0 ; проверить, есть ли параметры |
||
26 | jz noparam |
||
27 | |||
28 | mov eax,43 |
||
29 | mov ebx,mess1 |
||
30 | call print |
||
31 | |||
32 | call eol |
||
33 | |||
34 | mov eax,30 ; вывести параметры |
||
35 | mov ebx,I_PARAM |
||
36 | call print |
||
37 | |||
38 | jmp end1 ; переход в конец программы |
||
39 | |||
40 | noparam: |
||
41 | mov eax,40 ; вывести сообщение о том, что нет параметров |
||
42 | mov ebx,mess2 |
||
43 | call print |
||
44 | |||
45 | end1: |
||
46 | jmp endipc ; завершить программу |
||
47 | |||
48 | mess db 'PARAM.ASM - Test params in IPC programs for CMD' |
||
49 | |||
50 | mess1 db 'This program was started with this params: ' |
||
51 | mess2 db 'This program was started without params!' |
||
52 | |||
53 | I_PARAM db 0 |
||
54 | |||
55 | I_END: |