Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 138 → Rev 139

/programs/other/archer/trunk/@RCHER.ASM
4,7 → 4,7
;
; Created: May 6, 2005
;
; Last changed: July 14, 2005
; Last changed: August 26, 2006
;
; Compile with FASM
 
13,7 → 13,7
png_imag = output+OUTBUF
PARAM_PTR = os_work;png_image
MEMINIT=next_code;output
DUMPFILE equ '/hd/1/out.txt'
DUMPFILE equ '/hd0/1/out.txt'
 
SHOW_RBLOCK equ 0;1
SHOW_PNG_SEC equ 0;1
62,7 → 62,7
dd start
dd I_END
dd MEMINIT
dd main_stack;MEMORY-2048
dd main_stack_top;MEMORY-2048
if PARAM_PTR eq param
dd 0
else
337,7 → 337,7
Msg 37
.nomsg:
mov [outfile.out],ebx
mcall 58,outfile
mcall 70,outfile
; dps 'Before Quit1'
; ud2
test [Flags],TAR_MODE
385,7 → 385,7
Msg 37
test [Flags],LIST_MODE
jne quit
mcall 58,outfile
mcall 70,outfile
.pad:
call StartPad
.notar:
/programs/other/archer/trunk/data.inc
10,22 → 10,30
if SYS eq win
db 'D:\Ivushkin\projects\zip\output.raw',0
end if
dd 1
dd 2
dd 0
dd 0
.size dd 0
.out dd output
dd os_work
if ~SYS eq win
dumpfile:
db DUMPFILE,0
dumpf_len=$-dumpfile
end if
attrinfo:
dd 5
dd 0
dd 0
dd 0
dd fileattr
db 0
dd filename
Finfo:
dd 0
.block dd 0
.count dd BUFSIZE*2
dd 0
.count dd BUFSIZE*1024
.ptr dd BUFPTR
dd os_work
 
filename:
if SYS eq win
84,6 → 92,10
Dheader rb 12
Dpassword rb PASSW_LEN
 
if ~SYS eq win
fileattr rd 40/4
end if
 
png_ dd ?
fat_ dd ?
fat_fnum dd ?
125,11 → 137,15
hclen db ?
max_len dw ?
 
align 4
fat:
rb 4096;512
child_stack:
rb 1024
child_stack_top:
main_stack:
rb 1024
main_stack_top:
area:
rb INBUF
os_work rb 4*1024
/programs/other/archer/trunk/dump.inc
18,7 → 18,7
if ~ run_new eq
test edx,edx
jne .exist
mcall 19,Board_seek.board_fn,0
mcall 70,Board_seek.board_fn,0
mov edx,eax
mcall 5,20
end if
51,5 → 51,11
.ok:
mov edx,[ebx+30]
ret
.board_fn db 'BOARD '
.board_fn:
dd 7
dd 0
dd 0
dd 0
dd 0
db '/RD/1/BOARD',0
end if
/programs/other/archer/trunk/macros.inc
143,11 → 143,6
 
 
 
; language for programs
lang fix ru ; ru en fr ge fi
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
179,7 → 174,7
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
/programs/other/archer/trunk/sys.inc
18,8 → 18,11
mov ebx,eax
mov [filesize],eax
else
mcall 58,Finfo
and dword [attrinfo+32], 0
mcall 70,attrinfo
mov eax,[attrinfo+32]
mov [filesize],ebx
mcall 70,Finfo
end if
ret
 
37,10 → 40,8
; esi - current pointer (in memory!)
; ebx - translation method: 0 - beginning, 1 - current, 2 - end
push eax ecx edx
mov edx,[Finfo.block]
imul edx,BSIZE
sub esi,BUFPTR
add esi,edx
add esi,[Finfo.block]
cmp ebx,1
je .cur
jb .begin
49,13 → 50,9
.cur:
add eax,esi
.begin:
mov ecx,BSIZE
xor edx,edx
div ecx
lea esi,[BUFPTR+edx]
mov esi,BUFPTR
mov [Finfo.block],eax
if SYS eq win
mul ecx
invoke SetFilePointer,[hnd],eax,NULL,FILE_BEGIN
invoke ReadFile,[hnd],area,INBUF, os_work, NULL
; add [byte_count],area
62,8 → 59,8
else
; pregs
; wait
mov [Finfo.count],BUFSIZE*2
mcall 58,Finfo
mov [Finfo.count],BUFSIZE*1024
mcall 70,Finfo
; mov [byte_count],area+INBUF
end if
pop edx ecx eax
105,7 → 102,7
else
test [Flags],THREAD_YES
jnz .ex
mcall 51,1,thread,child_stack;MEMORY
mcall 51,1,thread,child_stack_top;MEMORY
mov [child],eax
end if
.ex:
249,75 → 246,10
je .stay
cmp al,'/'
jne .yespar
mov ecx,255
dec esi
mov edi,filename
xor al,al
rep stosb
mov ecx,255
mov edi,filename
rep movsb
; test [Flags],LIST_MODE
; jz again
xor eax,eax
mov edi,filename
mov ecx,255
repne scasb
cmp byte[edi-2],'/'
je .slash
mov byte[edi-1],'/'
inc edi
.slash:
; Dump filename,255,os_work
; ud2
mov ecx,edi
; dec ecx
mov edx,ecx
mov dword[Finfo],13
; mov dword[Finfo.count],1
mov edi,filename+5
sub ecx,edi
.lp:
mov al,'/'
repne scasb
; jne .ex
; dpd ecx
and byte[edi-1],0
mcall 58,Finfo
mov byte[edi-1],'/'
test ebx,32
jz .lp
test [Flags],LIST_MODE
jne .listm
and byte[edi-1],0
; Dump filename,255,os_work
jmp .agg
; ud2
.listm:
lea esi,[edi-1+ecx]
lea edi,[esi+1]
std
rep movsb
and byte[edi],0
cld
; dpd filename
 
inc edi
dpd edi
cmp edx,edi
jne .slash2
; cmp byte[edi],'/'
; je .slash2
mov byte[edi],'/'
inc edx
.slash2:
sub edx,edi
mov [lpath],edi
mov [lpath_len],edx
dpd edx
.agg:
mov dword[Finfo],0
; ud2
jmp again;cmdl
.yespar:
cmp al,'N'
/programs/other/rtfread/trunk/bgifont.inc
4,7 → 4,7
;
; Created: December 16, 2004
;
; Last changed: February 2, 2005
; Last changed: August 27, 2006
;
; Compile with FASM
 
237,18 → 237,16
mov esi,edi ; esi->FontName
mov [.dest],edi ; ptr to load font
if ~ BGI_LEVEL eq KERNEL
mov [.fsize],1
mov eax,58
mov ebx,.fontinfo
mov eax, 70
mov ebx, .fontattr
int 0x40
test eax,eax
jnz .fail
dps2 '1'
shr ebx,9
inc ebx
mov [.fsize],ebx
mov eax, [.fileattr+32]
mov [.fsize], eax
mov ebx,.fontinfo
mov eax,58
mov eax,70
int 0x40 ; ebx - file size
else
push edi esi edx
340,11 → 338,22
.fontinfo:
dd 0
dd 0
dd 0
.fsize dd 0
.dest dd 0
dd 0x10000
.fontfullname:
db BGIFONT_PATH
.font db 'FONT.CHR',0
 
.fontattr:
dd 5
dd 0
dd 0
dd 0
dd .fileattr
db 0
dd .fontfullname
.fileattr rd 40/4
else
.dest dd 0
.font db 'FONT CHR'
/programs/other/rtfread/trunk/rtf_lite.inc
14,10 → 14,10
mov ecx,[cur_block]
mov ebx,fileinfo
mov eax,ecx
shl eax,7
shl eax,16
mov [ebx+4],eax
; mov [ebx+12],esi
mcall 58
mcall 70
if DEBUG_BLOCK eq 1
; dps 'B='
; dpd ecx
72,7 → 72,7
pop [RetroGroup]
and [mode],not RTF_BLIND
mov [listptr],save_stack
mov [fileinfo.size],128
mov [fileinfo.size],128*512
; test ebp,RTF_HELP
test [mode],RTF_HELP
jne .noread
/programs/other/rtfread/trunk/rtfread.asm
91,23 → 91,17
mov esi,fname_buf
rep movsd
load_file:
xor eax,eax
mov ebx,fileinfo
mov [ebx+4],eax
inc eax
mov [fileinfo.size],eax
mcall 58
dpd ebx
and [wSave],0
mov [HClick],-100
load_help:
mov eax, 70
and [fileattr+32], 0
mov ebx, attrinfo
int 0x40
mov ebx, [fileattr+32]
test eax,eax
jz .sizok
cmp eax,5
je .sizok
.nosizok:
mov dword[fileinfo.name],N_A
.sizok:
and [wSave],0
mov [HClick],-100
mov eax,ebx
and eax,RTFSIZE-1
add eax,I_END
500,13 → 494,22
db '< > L A C H'
btn_end:
 
attrinfo:
dd 5
dd 0
dd 0
dd 0
dd fileattr
db 0
dd fileinfo.name
 
fileinfo:
dd 0
.block:
dd 0
dd 0
.size dd 1
dd I_END
dd sys_mem
.name:
; db '//'
; db ' /HD/1/RTF/texts/FASM.TXT',0
549,6 → 552,7
I_END0:
fname_buf:
rb 1024+16
fileattr rd 40/4
if BENCH eq 1
bench dd ?
end if