3,22 → 3,25 |
; See f63 |
; Compile with FASM for KolibriOS |
;------------------------------------------------------------------------------ |
include 'lang.inc' |
WRITE_LOG equ 1 |
P_LEN equ 11 |
;------------------------------------------------------------------------------ |
use32 |
org 0 |
org 0x0 |
db 'MENUET01' |
dd 1 |
dd 0x01 |
dd START |
dd I_END |
dd mem |
dd mem |
dd filename |
dd 0 |
dd filename, 0x0 |
;------------------------------------------------------------------------------ |
include 'lang.inc' |
include '../../../macros.inc' |
include '../../../debug.inc' |
purge newline |
MAXSTRINGS = 45 |
TMP = 80*(MAXSTRINGS+1) |
;------------------------------------------------------------------------------ |
START: |
call CheckUnique |
32,18 → 35,14 |
test al,al |
jnz @b |
param: |
mov ecx, (MAXSTRINGS+1)*20 |
mov edi, text1 |
mov eax, ' ' |
rep stosd |
mov ecx, TMP |
xor eax, eax |
mov edi, [targ] |
rep stosb |
|
mov ecx, (MAXSTRINGS+1)*20 |
mov edi, text2 |
rep stosd |
mov [tmp1], 'x' |
mov [tmp2], 'x' |
|
mov byte [tmp1], 'x' |
mov byte [tmp2], 'x' |
|
mcall 14 |
and eax, 0xffff0000 |
sub eax, 399 shl 16 |
85,16 → 84,16 |
mov [ebx+tmp], al |
inc [buffer_length] |
mov ebp, [targ] |
cmp al, 10 |
jz new_line |
.no4: |
cmp al, 13 |
jz new_check |
jmp char |
jne no13 |
and [ebp-8], dword 0 |
jmp new_check |
;------------------------------------------ |
write_buffer: |
pusha |
mov edx, tmp |
movzx ecx, byte[buffer_length] |
movzx ecx, byte[buffer_length] ;1 |
mov esi, filename |
.write_to_logfile: |
call WriteToFile |
112,7 → 111,9 |
popa |
ret |
;------------------------------------------ |
new_line: |
no13: |
cmp al, 10 |
jne no10 |
and [ebp-8], dword 0 |
inc dword [ebp-4] |
cmp [ebp-4], dword MAXSTRINGS |
120,23 → 121,23 |
mov [ebp-4], dword MAXSTRINGS |
lea esi, [ebp+80] |
mov edi, ebp |
mov ecx, 20*(MAXSTRINGS) |
mov ecx, 80*(MAXSTRINGS) |
cld |
rep movsd |
rep movsb |
|
mov esi, [ebp-4] |
imul esi, 80 |
add esi, [ebp-8] |
add esi, ebp |
mov ecx, 20 |
mov eax, ' ' |
rep stosd |
mov ecx, 80 |
mov al ,' ' |
rep stosb |
.noypos: |
mov [targ],text2 |
and [krnl_cnt],0 |
jmp new_check |
;------------------------------------------ |
char: |
no10: |
cmp ebp, text1 |
je add2 |
mov ecx, [krnl_cnt] |
398,9 → 399,22 |
.leave_check: |
ret |
|
|
;------------------------------------------------------------------------------ |
; DATA |
|
;*********************************** DATA ************************************ |
;------------------------------------------------------------------------------ |
align 4 |
InfoStructure: |
dd 0x0 ; subfunction number |
dd 0x0 ; position in the file in bytes |
dd 0x0 ; upper part of the position address |
dd 0x0 ; number of bytes to read |
dd 0x0 ; pointer to the buffer to write data |
db 0x0 |
dd 0x0 ; pointer to the filename |
filepos dd 0x0 |
default_filename db '/sys/boardlog.txt',0 |
;------------------------------------------------------------------------------ |
if lang eq ru |
title db '®áª ®â« ¤ª¨ ¨ á®®¡é¥¨©',0 |
else if lang eq it |
410,46 → 424,40 |
else |
title db 'General debug & message board',0 |
end if |
|
default_filename db '/sys/boardlog.txt',0 |
;------------------------------------------------------------------------------ |
krnl_msg db 'K : ' |
duk db 'KernUser' |
krnl_cnt dd 0 |
vmode dd 1 |
targ dd text2 |
my_name db 'board',0 |
my_name_size = $-my_name |
|
align 4 |
vmode dd 1 |
targ dd text2 |
|
process_count dd 0x0 |
pid_tid dd 0x0 |
;------------------------------------------------------------------------------ |
I_END: |
|
InfoStructure: |
dd ? ; subfunction number |
dd ? ; position in the file in bytes |
dd ? ; upper part of the position address |
dd ? ; number of bytes to read |
dd ? ; pointer to the buffer to write data |
db ? |
dd ? ; pointer to the filename |
|
buffer_length rb 3 |
process_count dd ? |
krnl_cnt dd ? |
pid_tid dd ? |
filepos dd ? |
xstart dd ? |
sc sys_colors_new |
|
;------------------------------------------------------------------------------ |
offs dd ? |
flag rb 1 |
rd 2 |
text1 rb 80*(MAXSTRINGS+1) |
tmp1 dd ? |
|
tmp1 db ? |
rd 2 |
text2 rb 80*(MAXSTRINGS+1) |
tmp2 dd ? |
|
tmp2 db ? |
xstart dd ? |
sc sys_colors_new |
i_end: |
buffer_length rb 1 |
;------------------------------------------------------------------------------ |
tmp rb 256 |
filename rb 256 |
procinfo rb 1024 |
;------------------------------------------------------------------------------ |
align 4 |
procinfo: |
rb 1024 |
;------------------------------------------------------------------------------ |
align 4 |
stackbuf rb 2000h |
mem: |
;------------------------------------------------------------------------------ |
mem: |