Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7859 → Rev 7858

/programs/develop/fasm/1.73/core/formats.inc
3805,7 → 3805,7
add eax,ebp
adc ecx,0
mov [edx+18h],eax
mov [edx+18h+4],ecx
mov [edx+18h+8],ecx
jmp elf_exe_addressing_setup
setup_elf_exe_labels_type:
mov eax,[code_start]
/programs/develop/fasm/1.73/core/tables.inc
2153,8 → 2153,6
dw insertq_instruction-instruction_handler
db 'invlpga',0DFh
dw invlpga_instruction-instruction_handler
db 'invlpgb',0FEh
dw simple_instruction_0f_01-instruction_handler
db 'invpcid',82h
dw vmx_inv_instruction-instruction_handler
db 'invvpid',81h
2287,8 → 2285,6
dw simple_extended_instruction-instruction_handler
db 'sysretq',07h
dw simple_extended_instruction_64bit-instruction_handler
db 'tlbsync',0FFh
dw simple_instruction_0f_01-instruction_handler
db 'ucomisd',2Eh
dw comisd_instruction-instruction_handler
db 'ucomiss',2Eh
/programs/develop/fasm/1.73/core/version.inc
33,7 → 33,7
; cannot simply be copied and put under another distribution licence
; (including the GNU Public Licence).
 
VERSION_STRING equ "1.73.24"
VERSION_STRING equ "1.73.23"
 
VERSION_MAJOR = 1
VERSION_MINOR = 73
/programs/develop/fasm/1.73/fasm.asm
26,8 → 26,15
;-------------------------------------------------
; INCLUDES
;-------------------------------------------------
lang equ ru
include 'kolibria.inc'
include 'fasm.inc'
 
MAX_PATH = 100
struc path name:?& {
.:
db name
rb MAX_PATH-$+. }
;-------------------------------------------------
; CODE
;-------------------------------------------------
112,8 → 119,8
ret
;-------------------------------------------------
START: ; Start of execution
mov edi, file_IO_slots
mov ecx, (file_IO_end-file_IO_slots)/4
mov edi, fileinfos
mov ecx, (fileinfos_end-fileinfos)/4
or eax, -1
rep stosd
mcall SF_SYS_MISC,SSF_HEAP_INIT
215,12 → 222,12
draw_window:
cmp dword[PROCESS_INFO.client_box.width],WIN_MIN_W
jge @f
mcall SF_CHANGE_WINDOW,-1,-1,WIN_MIN_W+20,-1
mcall 67,-1,-1,WIN_MIN_W+20,-1
ret
@@:
cmp dword[PROCESS_INFO.client_box.height],WIN_MIN_H
jge @f
mcall SF_CHANGE_WINDOW,-1,-1,-1,WIN_MIN_H+50
mcall 67,-1,-1,-1,WIN_MIN_H+50
ret
@@:
mpack ebx,[PROCESS_INFO.client_box.width],RIGHT_BTN_W
546,6 → 553,9
;---------------------------------------------------------------------
; INITIALIZED DATA
;---------------------------------------------------------------------
;match =en,lang {include 'lang/en.inc'}
;match =ru,lang {include 'lang/ru.inc'}
 
include 'traslations.inc'
 
edit1 EDIT_BOX 153, 72, 3, 0xffffff, 0xA4C4E4, 0x80ff, 0, 0x10000000,(outfile-infile-1), infile, mouse_dd, 0, 11,11
663,8 → 673,8
sc system_colors
sc_prev system_colors
max_handles = 8
file_IO_slots rb (4+sizeof.FILEIO+MAX_PATH)*max_handles;(4+20+MAX_PATH)*max_handles
file_IO_end:
fileinfos rb (4+20+MAX_PATH)*max_handles
fileinfos_end:
PROCESS_INFO process_information
 
bytes_count dd ?
/programs/develop/fasm/1.73/fasm.inc
7,16 → 7,16
NORMAL_MODE = 8
CONSOLE_MODE = 32
 
APP_MEMORY = 0x00800000
 
DEFAULT_WIN_W = 450
DEFAULT_WIN_H = 350
WIN_MIN_W = 400
WIN_MIN_H = 350
 
WIN_MIN_W = 350
WIN_MIN_H = 300
 
LINE_H = 25
RIGHT_BTN_W = 80
 
MAX_PATH = 100
APP_MEMORY = 0x00800000
 
macro mmov reg,a1,a2 {
mov reg,(a1) shl 16 + (a2)
30,7 → 30,4
sub reg,(a1) shl 16 + (a2)
}
 
struc path name:?& {
.:
db name
rb MAX_PATH-$+. }
 
/programs/develop/fasm/1.73/kolibri/structs/coords.inc
File deleted
\ No newline at end of file
/programs/develop/fasm/1.73/kolibri/structs/aces.inc
File deleted
\ No newline at end of file
/programs/develop/fasm/1.73/kolibri/structs/kernel.inc
40,24 → 40,13
struct FILEIO
cmd dd ?
offset dd ?
union
flags dd ?
offshigh dd ?
ends
count dd ?
buffer dd ?
; db ?
;name dd ?
ends
label FILEIO.filesize dword at -4
 
struct namedFILEIO FILEIO
name db MAX_PATH dup (?)
ends
 
struct fullFILEIO FILEIO
name db ?
lpname dd ?
ends
 
struct FILEDATE
Second db ?
Minute db ?
/programs/develop/fasm/1.73/kolibria.inc
52,5 → 52,3
include 'kolibri/structs/kernel.inc'
include 'kolibri/structs/box_lib.inc'
include 'kolibri/structs/proc_lib.inc'
include 'kolibri/structs/coords.inc'
include 'kolibri/structs/aces.inc'
/programs/develop/fasm/1.73/system.inc
2,6 → 2,10
; Copyright (c) 1999-2020, Tomasz Grysztar
; All rights reserved.
 
 
 
 
 
init_memory:
 
; mov ecx, 16*1024*1024
27,7 → 31,7
add eax,[additional_memory]
mov [additional_memory_end],eax
mov [memory_start],eax
retn
ret
 
exit_program:
cmp [_mode],NORMAL_MODE
44,7 → 48,7
mcall SF_SYSTEM_GET,SSF_TIME_COUNT
imul eax,10
pop ebx
retn
ret
 
symbol_dump:
 
155,7 → 159,7
call close
pop edi
 
retn
ret
 
get_environment_variable:
mov ecx,[memory_end]
170,128 → 174,144
rep movsb
.finish:
; stc
retn
ret
 
alloc_handle:
; in:
; out: ebx = file handle
; on error: return to caller of caller with cf set
; preserves: esi, edi
call make_fullpaths
mov ebx, file_IO_slots+4
jmp check_file_IO_slot
next_file_IO_slot:
mov ebx, fileinfos+4
@@:
cmp dword [ebx], -1
jz .found
add ebx, 4+20+MAX_PATH
cmp ebx, file_IO_end
jae send_error_to_caller_of_caller
check_file_IO_slot:
cmp [ebx+FILEIO.cmd], -1
jnz next_file_IO_slot
and [ebx+FILEIO.offset], 0
and [ebx+FILEIO.flags], 0
adapt_path:
cmp ebx, fileinfos_end
jb @b
stc
ret
.found:
and dword [ebx+4], 0
and dword [ebx+8], 0
push esi edi ecx
mov esi, fullpath_open
lea edi, [ebx+namedFILEIO.name]
lea edi, [ebx+20]
mov ecx, MAX_PATH
copy_path:
lodsb
cmp al,'\'
jne path_char_ok
mov al,'/'
path_char_ok:
stosb
or al,al
loopnz copy_path
rep movsb
pop ecx edi esi
jz adapt_path.done
send_error_to_caller_of_caller:
stc
pop eax
adapt_path.done:
ret
ret ; CF=0
 
create:
; in:
; out: ebx = file handle, cf set on error
; preserves: esi, edi
call alloc_handle
and [ebx+FILEIO.filesize], 0
mov [ebx+FILEIO.cmd], SSF_CREATE_FILE
retn
jc .ret
and dword [ebx-4], 0
mov dword [ebx], 2
.ret:
ret
 
 
open:
; in:
; out: ebx = file handle, cf set on error
; preserves: esi, edi
; call make_fullpaths
 
;; mov eax,fullpath_open
;; DEBUGF '"%s"\n',eax
 
; mov dword[file_info_open+8],-1
; mcall 58,file_info_open
; or eax,eax ; found
; jz @f
; cmp eax,6
; jne file_error
;@@: mov [filesize],ebx
; clc
; ret
;file_error:
; stc
; ret
 
call alloc_handle
mov [ebx+FILEIO.cmd], SSF_GET_INFO
and [ebx+FILEIO.count], 0
mov [ebx+FILEIO.buffer], fileinfo
jc .ret
mov dword [ebx], SSF_GET_INFO
and dword [ebx+12], 0
mov dword [ebx+16], fileinfo
mov eax, SF_FILE
push ebx
mcall SF_FILE
mcall
pop ebx
test eax, eax
jnz fail_close
jnz .fail
mov eax, dword[fileinfo.size]
mov [ebx+FILEIO.filesize], eax
and [ebx+FILEIO.cmd], SSF_READ_FILE
retn
mov [ebx-4], eax
and dword [ebx], 0
.ret:
ret
.fail:
or dword [ebx], -1 ; close handle
stc
ret
 
fail_close:
read:
; pusha
; mov edi,edx
; mov esi,[filepos]
; add esi,0x20000
; cld
; rep movsb
; popa
;; ret
 
mov [ebx+12], ecx
mov [ebx+16], edx
push ebx
mov eax, SF_FILE
mcall
xchg eax, [esp]
add [eax+4], ebx
adc [eax+8], dword 0
mov ebx, eax
pop eax
test eax, eax
jz .ok
cmp eax, 6
jz .ok
stc
.ok:
ret
 
close:
; in: ebx = file handle
; preserves: ebx, esi, edi, cf
mov [ebx+FILEIO.cmd], -1 ; close handle
retn
or dword [ebx], -1
ret
 
 
; ebx file handle
; ecx count of bytes to write
; edx pointer to buffer
write:
; in: ebx = file handle, edx - data, ecx = number of bytes
; out: cf set on error
; preserves: ebx, esi, edi
call read_write
mov [ebx+FILEIO.cmd], SSF_WRITE_FILE
jmp read_write_check_S_OK
read:
; in: ebx = file handle, edx - buffer, ecx = number of bytes
; out: cf set on error
; preserves: ebx, esi, edi
call read_write
cmp eax, 6
jz read_write_OK
read_write_check_S_OK:
test eax, eax
jz read_write_OK
stc
retn
read_write:
mov [ebx+FILEIO.count], ecx
mov [ebx+FILEIO.buffer], edx
; pusha
; mov [file_info_write+8],ecx
; mov [file_info_write+12],edx
; mov [filesize],edx
; mov eax,58
; mov ebx,file_info_write
; mcall
; popa
; ret
 
mov [ebx+12], ecx
mov [ebx+16], edx
push ebx
mcall SF_FILE
mov eax, SF_FILE
mcall
xchg eax, [esp]
add [eax+FILEIO.offset], ebx
adc [eax+FILEIO.offshigh], 0
add [eax+4], ebx
adc [eax+8], dword 0
mov ebx, eax
pop eax
read_write_OK:
retn
mov byte [ebx], 3
cmp eax, 1
cmc
ret
 
 
make_fullpaths:
pusha
push edx
mov esi,edx
mov ecx, MAX_PATH
copy_edxpath:
lodsb
cmp al,'\'
jne edxpath_char_ok
mov byte[esi-1],'/'
edxpath_char_ok:
or al,al
loopnz copy_edxpath
 
mov esi,path ; open
; DEBUGF " '%s'",esi
305,8 → 325,6
 
cmp byte[esi],'/'
jne @f
cmp byte[esi],'\'
jne @f
mov edi,fullpath_open
 
@@:
314,6 → 332,10
stosb
cmp al,0
jne @b
; mov ecx,12
; cld
; rep movsb
; mov byte[edi],0
 
mov esi,path ; write
mov edi,fullpath_write
326,8 → 348,6
 
cmp byte[esi],'/'
jne @f
cmp byte[esi],'\'
jne @f
mov edi,fullpath_write
 
@@:
335,6 → 355,10
stosb
cmp al,0
jne @b
; mov ecx,12
; cld
; rep movsb
; mov byte[edi],0
 
mov esi,path ; start
mov edi,file_io_start.path
343,12 → 367,11
movsb
cmp byte[esi],0;' '
jne newc3
; mov esi,[esp]
pop esi
 
cmp byte[esi],'/'
jne @f
cmp byte[esi],'\'
jne @f
mov edi,file_io_start.path
 
@@:
356,40 → 379,45
stosb
cmp al,0
jne @b
; mov ecx,12
; cld
; rep movsb
; mov byte[edi],0
 
; add esp,4
popa
retn
ret
 
 
 
lseek:
; in: ebx = file handle, al = method, edx = delta offset
; out: cf set on error
; preserves: ebx, esi, edi
cmp al,FILE_BEGIN
cmp al,0
jnz @f
and [ebx+FILEIO.offset], 0
jmp .common
@@: cmp al,FILE_END
and dword [ebx+4], 0
and dword [ebx+8], 0
@@: cmp al,2
jnz @f
mov eax, [ebx+FILEIO.filesize]
mov [ebx+FILEIO.offset], eax
jmp .common
@@:
.common:
add [ebx+FILEIO.offset], edx
retn
mov eax, [ebx-4]
mov [ebx+4], eax
and dword [ebx+8], 0
@@: add dword [ebx+4], edx
adc dword [ebx+8], 0
ret
 
display_character:
pusha
cmp [_mode],NORMAL_MODE
jne @f
cmp al,$D
cmp dl,13
jz dc2
cmp al,$A
cmp dl,0xa
jnz dc1
and [textxy],0x0000FFFF
add [textxy], 8 shl 16 and 0xFFFF0000 + 18
dc2:
popa
retn
ret
dc1:
mov [dc],al
mov eax,[textxy]
cmp ax,word[bottom_right]
ja dc2
396,33 → 424,32
shr eax,16
cmp ax,word[bottom_right+2]
ja dc2
mov ecx,[sc.work_text]
or ecx,$10000000
mcall SF_DRAW_TEXT,[textxy],,dc,1
mov [dc],dl
mcall SF_DRAW_TEXT,[textxy],0x10000000,dc,1
add [textxy],0x00080000
dc2:
popa
retn
ret
@@:
mov cl,al
mcall SF_BOARD,SSF_DEBUG_WRITE
mov eax,SF_BOARD
mov ebx,1
mov cl,dl
mcall
popa
retn
ret
 
 
display_string:
; in:
; esi - ASCIIZ string
; preserves: ebx, esi
push esi
@@: lodsb
test al,al
pusha
@@:
cmp byte[esi],0
je @f
mov dl,[esi]
call display_character
add esi,1
jmp @b
@@:
pop esi
retn
popa
ret
 
display_number:
push ebx
440,7 → 467,8
jz digit_ok
not bl
display_digit:
add al,'0'
mov dl,al
add dl,30h
push ebx ecx
call display_character
pop ecx ebx
454,7 → 482,7
or ecx,ecx
jnz display_loop
pop ebx
retn
ret
 
display_user_messages:
; push [skinh]
474,22 → 502,18
mov esi,crlf
call display_string
line_break_ok:
retn
ret
 
display_block:
; in:
; esi - string
; ecx = string length
push esi
@@: lodsb
pusha
@@: mov dl,[esi]
call display_character
inc esi
loop @b
pop esi
retn
popa
ret
 
fatal_error:
; no return, trashes stack
 
mov esi,error_prefix
call display_string
pop esi
503,7 → 527,7
 
assembler_error:
call display_user_messages
push 0
push dword 0
mov ebx,[current_line]
get_error_lines:
push ebx
525,12 → 549,12
mov eax,[ebx+4]
and eax,7FFFFFFFh
call display_number
mov al,']'
mov dl,']'
call display_character
pop esi
cmp ebx,esi
je line_number_ok
mov al,' '
mov dl,20h
call display_character
push esi
mov esi,[esi]
543,7 → 567,7
mov eax,[esi+4]
and eax,7FFFFFFFh
call display_number
mov al,']'
mov dl,']'
call display_character
line_number_ok:
mov esi,line_data_start
570,11 → 594,11
mov esi,[additional_memory]
get_line_data:
mov al,[esi]
cmp al,$A
cmp al,0Ah
je display_line_data
cmp al,$D
cmp al,0Dh
je display_line_data
cmp al,$1A
cmp al,1Ah
je display_line_data
or al,al
jz display_line_data