-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.inc
55 lines (49 loc) · 1.17 KB
/
parser.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
; AMDtemp -s/sd0/4/data/temp/log.grf -d"/sd0/4/data/äàò÷èê òåìïåðàòóðû com ïîðò/sensors.sys"
parse_cmd:
mov edi, PATH
mov ecx, 512
.still:
mov al, ' '
repz scasb
test ecx, ecx
jz .end_parser
dec edi
or word[edi], 0x2020 ; ïåðåâîäèì â íèæíèé ðåãèñòð
cmp word[edi], '-s'
jnz @f
add edi, 2
sub ecx, 2
call .get_str
mov [save_ptr],eax
jmp .still
@@:
cmp word[edi], '-d'
jnz @f
add edi, 2
sub ecx, 2
call .get_str
mov [drv_ptr],eax
jmp .still
@@:
cmp byte[edi], 0
jnz @f
.end_parser:
ret
@@:
inc edi
jmp .still
.get_str:
push edi
inc dword[esp]
mov al, '"'
cmp byte[edi], al
jz @f
dec dword[esp]
mov al, ' '
dec edi
@@:
inc edi
repne scasb
and byte[edi - 1], 0
pop eax
ret