kolibrios-fun/programs/system/amd_temp_view/parser.inc
Doczom 19cab98b13 AMDtemp: fix parser and code style. TODO: add function for device subsystem
git-svn-id: svn://kolibrios.org@9883 a494cfbc-eb01-0410-851d-a64ba20cac60
2022-10-16 21:00:24 +00:00

55 lines
1.2 KiB
PHP

; 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