Code Snippets
LICENSE
mov | eax,101 | ;ioperm | |
mov | ebx,$37A | ;start port / parallelport | |
mov | ecx,1 | ;1port long | |
mov | edx,1 | ;allow | |
int | $80 | ||
cmp | eax,0 | ||
jz | continue | ||
call | error | ;your error procedure | |
jmp | end | ||
.continue: |
mov | eax,5 | ;open File | |
mov | ebx,datname | ;-> file name | |
mov | ecx,2 | ;read/write | |
int | $80 | ||
cmp | eax,0 | ||
jge | .continue | ||
call | error | ;your error procedure | |
jmp | end | ||
.continue: |
mov | eax,159 | ;SCHED_GET_PRIORITY_MAX | |
mov | ebx,1 | ;policy FIFO | |
int | $80 | ||
cmp | eax,0 | ;priority | |
jg | .continue | ||
call | error | ;your error procedure | |
jmp | end | ||
.continue: |
mov | eax,156 | ;SCHED_SETSCHEDULAR | |
mov | ebx,0 | ;pid = root | |
mov | ecx,1 | ;policy = SCHED_FIFO | |
mov | edx,priority | ;-> priority | |
int | $80 | ||
cmp | eax,0 | ||
jz | .continue | ||
call | error | ;your error procedure | |
jmp | end | ||
.continue: |
mov | eax,54 | ||
mov | ebx,0 | ||
mov | ecx,0x5401 | ;get terminal attributes | |
mov | edx,.buf1 | ; -> .buf1 resb 28 | |
int | $80h | ||
cmp | eax,0 | ||
jz | .continue | ||
call | error | ;your error procedure | |
jmp | end | ||
.continue: |
;buf2 is a copy of buf1. | |||
and | dword[.buf2+12],11111111111111111111111111110101b | ||
or | dword[.buf2+12],00000000000000000100000000000000b | ||
and | byte[.buf2+17],11011111b | ||
mov | eax,54 | ||
mov | ebx,0 | ||
mov | ecx,0x5402 | ;set terminal attributes | |
mov | edx,.buf2 | ; -> .buf2 resb 28 | |
int | 80h | ||
cmp | eax,0 | ||
jz | .continue | ||
call | error | ;your error procedure | |
jmp | end | ||
.continue: |
mov | eax,3 | ;Syscall read | |
mov | ebx,0 | ;file number | |
mov | ecx,buf+1 | ;-> buf db | |
mov | edx,1 | ;count bytes | |
int | 80h | ;read 1 byte | |
cmp | eax,1 | ;count bytes | |
je | .continue | ||
call | error | ;your error procedure | |
jmp | end | ||
.continue: |