2010-10-01 13:21:55 +04:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
2012-03-15 16:41:29 +04:00
|
|
|
|
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
2010-10-01 13:21:55 +04:00
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
|
|
$Revision$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uglobal
|
|
|
|
|
cd_current_pointer_of_input dd 0
|
|
|
|
|
cd_current_pointer_of_input_2 dd 0
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cd_mem_location dd 0
|
|
|
|
|
cd_counter_block dd 0
|
|
|
|
|
IDE_Channel_1 db 0
|
|
|
|
|
IDE_Channel_2 db 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
endg
|
|
|
|
|
|
|
|
|
|
reserve_cd:
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cli
|
|
|
|
|
cmp [cd_status], 0
|
|
|
|
|
je reserve_ok2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
sti
|
|
|
|
|
call change_task
|
|
|
|
|
jmp reserve_cd
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
reserve_ok2:
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
push eax
|
|
|
|
|
mov eax, [CURRENT_TASK]
|
|
|
|
|
shl eax, 5
|
|
|
|
|
mov eax, [eax+CURRENT_TASK+TASKDATA.pid]
|
|
|
|
|
mov [cd_status], eax
|
|
|
|
|
pop eax
|
|
|
|
|
sti
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
reserve_cd_channel:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [ChannelNumber], 1
|
|
|
|
|
jne .IDE_Channel_2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.IDE_Channel_1:
|
2013-09-14 22:55:13 +04:00
|
|
|
|
pushad
|
|
|
|
|
mov ecx, ide_channel1_mutex
|
|
|
|
|
call mutex_lock
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [IDE_Channel_1], 1
|
2013-09-14 22:55:13 +04:00
|
|
|
|
popad
|
2012-03-08 12:33:38 +04:00
|
|
|
|
ret
|
2013-09-14 22:55:13 +04:00
|
|
|
|
.IDE_Channel_2:
|
|
|
|
|
pushad
|
|
|
|
|
mov ecx, ide_channel2_mutex
|
|
|
|
|
call mutex_lock
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [IDE_Channel_2], 1
|
2013-09-14 22:55:13 +04:00
|
|
|
|
popad
|
2012-03-08 12:33:38 +04:00
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
free_cd_channel:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [ChannelNumber], 1
|
|
|
|
|
jne .IDE_Channel_2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.IDE_Channel_1:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [IDE_Channel_1], 0
|
2013-09-14 22:55:13 +04:00
|
|
|
|
pushad
|
|
|
|
|
mov ecx, ide_channel1_mutex
|
|
|
|
|
call mutex_unlock
|
|
|
|
|
popad
|
2012-03-08 12:33:38 +04:00
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.IDE_Channel_2:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [IDE_Channel_2], 0
|
2013-09-14 22:55:13 +04:00
|
|
|
|
pushad
|
|
|
|
|
mov ecx, ide_channel2_mutex
|
|
|
|
|
call mutex_unlock
|
|
|
|
|
popad
|
2012-03-08 12:33:38 +04:00
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
uglobal
|
|
|
|
|
cd_status dd 0
|
|
|
|
|
endg
|
|
|
|
|
|
|
|
|
|
;----------------------------------------------------------------
|
|
|
|
|
;
|
|
|
|
|
; fs_CdRead - LFN variant for reading CD disk
|
|
|
|
|
;
|
|
|
|
|
; esi points to filename /dir1/dir2/.../dirn/file,0
|
|
|
|
|
; ebx pointer to 64-bit number = first wanted byte, 0+
|
|
|
|
|
; may be ebx=0 - start from first byte
|
|
|
|
|
; ecx number of bytes to read, 0+
|
|
|
|
|
; edx mem location to return data
|
|
|
|
|
;
|
|
|
|
|
; ret ebx = bytes read or 0xffffffff file not found
|
|
|
|
|
; eax = 0 ok read or other = errormsg
|
|
|
|
|
;
|
|
|
|
|
;--------------------------------------------------------------
|
|
|
|
|
fs_CdRead:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
push edi
|
|
|
|
|
cmp byte [esi], 0
|
|
|
|
|
jnz @f
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.noaccess:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
pop edi
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.noaccess_2:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
or ebx, -1
|
|
|
|
|
mov eax, ERROR_ACCESS_DENIED
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
.noaccess_3:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
pop eax edx ecx edi
|
|
|
|
|
jmp .noaccess_2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
@@:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
call cd_find_lfn
|
|
|
|
|
jnc .found
|
|
|
|
|
pop edi
|
|
|
|
|
cmp [DevErrorCode], 0
|
|
|
|
|
jne .noaccess_2
|
|
|
|
|
or ebx, -1
|
|
|
|
|
mov eax, ERROR_FILE_NOT_FOUND
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
.found:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov edi, [cd_current_pointer_of_input]
|
|
|
|
|
test byte [edi+25], 10b; do not allow read directories
|
|
|
|
|
jnz .noaccess
|
|
|
|
|
test ebx, ebx
|
|
|
|
|
jz .l1
|
|
|
|
|
cmp dword [ebx+4], 0
|
|
|
|
|
jz @f
|
|
|
|
|
xor ebx, ebx
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.reteof:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov eax, 6; end of file
|
|
|
|
|
pop edi
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov ebx, [ebx]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.l1:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
push ecx edx
|
|
|
|
|
push 0
|
2013-05-28 23:09:31 +04:00
|
|
|
|
mov eax, [edi+10] ; реальный размер файловой секции
|
2012-03-08 12:33:38 +04:00
|
|
|
|
sub eax, ebx
|
|
|
|
|
jb .eof
|
|
|
|
|
cmp eax, ecx
|
|
|
|
|
jae @f
|
|
|
|
|
mov ecx, eax
|
|
|
|
|
mov byte [esp], 6
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov eax, [edi+2]
|
|
|
|
|
mov [CDSectorAddress], eax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; now eax=cluster, ebx=position, ecx=count, edx=buffer for data
|
|
|
|
|
.new_sector:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
test ecx, ecx
|
|
|
|
|
jz .done
|
|
|
|
|
sub ebx, 2048
|
|
|
|
|
jae .next
|
|
|
|
|
add ebx, 2048
|
|
|
|
|
jnz .incomplete_sector
|
|
|
|
|
cmp ecx, 2048
|
|
|
|
|
jb .incomplete_sector
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; we may read and memmove complete sector
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [CDDataBuf_pointer], edx
|
2013-05-28 23:09:31 +04:00
|
|
|
|
call ReadCDWRetr; читаем сектор файла
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [DevErrorCode], 0
|
|
|
|
|
jne .noaccess_3
|
|
|
|
|
add edx, 2048
|
|
|
|
|
sub ecx, 2048
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.next:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
inc dword [CDSectorAddress]
|
|
|
|
|
jmp .new_sector
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.incomplete_sector:
|
|
|
|
|
; we must read and memmove incomplete sector
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [CDDataBuf_pointer], CDDataBuf
|
2013-05-28 23:09:31 +04:00
|
|
|
|
call ReadCDWRetr; читаем сектор файла
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [DevErrorCode], 0
|
|
|
|
|
jne .noaccess_3
|
|
|
|
|
push ecx
|
|
|
|
|
add ecx, ebx
|
|
|
|
|
cmp ecx, 2048
|
|
|
|
|
jbe @f
|
|
|
|
|
mov ecx, 2048
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
sub ecx, ebx
|
|
|
|
|
push edi esi ecx
|
|
|
|
|
mov edi, edx
|
|
|
|
|
lea esi, [CDDataBuf + ebx]
|
|
|
|
|
cld
|
|
|
|
|
rep movsb
|
|
|
|
|
pop ecx esi edi
|
|
|
|
|
add edx, ecx
|
|
|
|
|
sub [esp], ecx
|
|
|
|
|
pop ecx
|
|
|
|
|
xor ebx, ebx
|
|
|
|
|
jmp .next
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
.done:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov ebx, edx
|
|
|
|
|
pop eax edx ecx edi
|
|
|
|
|
sub ebx, edx
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.eof:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov ebx, edx
|
|
|
|
|
pop eax edx ecx
|
|
|
|
|
sub ebx, edx
|
|
|
|
|
jmp .reteof
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
;----------------------------------------------------------------
|
|
|
|
|
;
|
|
|
|
|
; fs_CdReadFolder - LFN variant for reading CD disk folder
|
|
|
|
|
;
|
|
|
|
|
; esi points to filename /dir1/dir2/.../dirn/file,0
|
|
|
|
|
; ebx pointer to structure 32-bit number = first wanted block, 0+
|
|
|
|
|
; & flags (bitfields)
|
|
|
|
|
; flags: bit 0: 0=ANSI names, 1=UNICODE names
|
|
|
|
|
; ecx number of blocks to read, 0+
|
|
|
|
|
; edx mem location to return data
|
|
|
|
|
;
|
|
|
|
|
; ret ebx = blocks read or 0xffffffff folder not found
|
|
|
|
|
; eax = 0 ok read or other = errormsg
|
|
|
|
|
;
|
|
|
|
|
;--------------------------------------------------------------
|
|
|
|
|
fs_CdReadFolder:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
push edi
|
|
|
|
|
call cd_find_lfn
|
|
|
|
|
jnc .found
|
|
|
|
|
pop edi
|
|
|
|
|
cmp [DevErrorCode], 0
|
|
|
|
|
jne .noaccess_1
|
|
|
|
|
or ebx, -1
|
|
|
|
|
mov eax, ERROR_FILE_NOT_FOUND
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.found:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov edi, [cd_current_pointer_of_input]
|
|
|
|
|
test byte [edi+25], 10b ; do not allow read directories
|
|
|
|
|
jnz .found_dir
|
|
|
|
|
pop edi
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.noaccess_1:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
or ebx, -1
|
|
|
|
|
mov eax, ERROR_ACCESS_DENIED
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.found_dir:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov eax, [edi+2] ; eax=cluster
|
|
|
|
|
mov [CDSectorAddress], eax
|
2013-05-28 23:09:31 +04:00
|
|
|
|
mov eax, [edi+10] ; размер директрории
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.doit:
|
|
|
|
|
; init header
|
2012-03-08 12:33:38 +04:00
|
|
|
|
push eax ecx
|
|
|
|
|
mov edi, edx
|
|
|
|
|
mov ecx, 32/4
|
|
|
|
|
xor eax, eax
|
|
|
|
|
rep stosd
|
|
|
|
|
pop ecx eax
|
|
|
|
|
mov byte [edx], 1 ; version
|
|
|
|
|
mov [cd_mem_location], edx
|
|
|
|
|
add [cd_mem_location], 32
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; начинаем переброску БДВК в УСВК
|
2010-10-01 13:21:55 +04:00
|
|
|
|
;.mainloop:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [cd_counter_block], dword 0
|
|
|
|
|
dec dword [CDSectorAddress]
|
|
|
|
|
push ecx
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.read_to_buffer:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
inc dword [CDSectorAddress]
|
|
|
|
|
mov [CDDataBuf_pointer], CDDataBuf
|
2013-05-28 23:09:31 +04:00
|
|
|
|
call ReadCDWRetr ; читаем сектор директории
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [DevErrorCode], 0
|
|
|
|
|
jne .noaccess_1
|
|
|
|
|
call .get_names_from_buffer
|
|
|
|
|
sub eax, 2048
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; директория закончилась?
|
2012-03-08 12:33:38 +04:00
|
|
|
|
ja .read_to_buffer
|
|
|
|
|
mov edi, [cd_counter_block]
|
|
|
|
|
mov [edx+8], edi
|
|
|
|
|
mov edi, [ebx]
|
|
|
|
|
sub [edx+4], edi
|
|
|
|
|
xor eax, eax
|
|
|
|
|
dec ecx
|
|
|
|
|
js @f
|
|
|
|
|
mov al, ERROR_END_OF_FILE
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
pop ecx edi
|
|
|
|
|
mov ebx, [edx+4]
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
.get_names_from_buffer:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [cd_current_pointer_of_input_2], CDDataBuf
|
|
|
|
|
push eax esi edi edx
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.get_names_from_buffer_1:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
call cd_get_name
|
|
|
|
|
jc .end_buffer
|
|
|
|
|
inc dword [cd_counter_block]
|
|
|
|
|
mov eax, [cd_counter_block]
|
|
|
|
|
cmp [ebx], eax
|
|
|
|
|
jae .get_names_from_buffer_1
|
|
|
|
|
test ecx, ecx
|
|
|
|
|
jz .get_names_from_buffer_1
|
|
|
|
|
mov edi, [cd_counter_block]
|
|
|
|
|
mov [edx+4], edi
|
|
|
|
|
dec ecx
|
|
|
|
|
mov esi, ebp
|
|
|
|
|
mov edi, [cd_mem_location]
|
|
|
|
|
add edi, 40
|
|
|
|
|
test dword [ebx+4], 1; 0=ANSI, 1=UNICODE
|
|
|
|
|
jnz .unicode
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; jmp .unicode
|
|
|
|
|
.ansi:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [cd_counter_block], 2
|
|
|
|
|
jbe .ansi_parent_directory
|
|
|
|
|
cld
|
|
|
|
|
lodsw
|
|
|
|
|
xchg ah, al
|
|
|
|
|
call uni2ansi_char
|
|
|
|
|
cld
|
|
|
|
|
stosb
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; проверка конца файла
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov ax, [esi]
|
2013-05-28 23:09:31 +04:00
|
|
|
|
cmp ax, word 3B00h; сепаратор конца файла ';'
|
2012-03-08 12:33:38 +04:00
|
|
|
|
je .cd_get_parameters_of_file_1
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; проверка для файлов не заканчивающихся сепаратором
|
2012-03-08 12:33:38 +04:00
|
|
|
|
movzx eax, byte [ebp-33]
|
|
|
|
|
add eax, ebp
|
|
|
|
|
sub eax, 34
|
|
|
|
|
cmp esi, eax
|
|
|
|
|
je .cd_get_parameters_of_file_1
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; проверка конца папки
|
2012-03-08 12:33:38 +04:00
|
|
|
|
movzx eax, byte [ebp-1]
|
|
|
|
|
add eax, ebp
|
|
|
|
|
cmp esi, eax
|
|
|
|
|
jb .ansi
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.cd_get_parameters_of_file_1:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [edi], byte 0
|
|
|
|
|
call cd_get_parameters_of_file
|
|
|
|
|
add [cd_mem_location], 304
|
|
|
|
|
jmp .get_names_from_buffer_1
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
.ansi_parent_directory:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [cd_counter_block], 2
|
|
|
|
|
je @f
|
|
|
|
|
mov [edi], byte '.'
|
|
|
|
|
inc edi
|
|
|
|
|
jmp .cd_get_parameters_of_file_1
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [edi], word '..'
|
|
|
|
|
add edi, 2
|
|
|
|
|
jmp .cd_get_parameters_of_file_1
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
.unicode:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [cd_counter_block], 2
|
|
|
|
|
jbe .unicode_parent_directory
|
|
|
|
|
cld
|
|
|
|
|
movsw
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; проверка конца файла
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov ax, [esi]
|
2013-05-28 23:09:31 +04:00
|
|
|
|
cmp ax, word 3B00h; сепаратор конца файла ';'
|
2012-03-08 12:33:38 +04:00
|
|
|
|
je .cd_get_parameters_of_file_2
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; проверка для файлов не заканчивающихся сепаратором
|
2012-03-08 12:33:38 +04:00
|
|
|
|
movzx eax, byte [ebp-33]
|
|
|
|
|
add eax, ebp
|
|
|
|
|
sub eax, 34
|
|
|
|
|
cmp esi, eax
|
|
|
|
|
je .cd_get_parameters_of_file_2
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; проверка конца папки
|
2012-03-08 12:33:38 +04:00
|
|
|
|
movzx eax, byte [ebp-1]
|
|
|
|
|
add eax, ebp
|
|
|
|
|
cmp esi, eax
|
|
|
|
|
jb .unicode
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.cd_get_parameters_of_file_2:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [edi], word 0
|
|
|
|
|
call cd_get_parameters_of_file
|
|
|
|
|
add [cd_mem_location], 560
|
|
|
|
|
jmp .get_names_from_buffer_1
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
.unicode_parent_directory:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [cd_counter_block], 2
|
|
|
|
|
je @f
|
|
|
|
|
mov [edi], word 2E00h; '.'
|
|
|
|
|
add edi, 2
|
|
|
|
|
jmp .cd_get_parameters_of_file_2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [edi], dword 2E002E00h; '..'
|
|
|
|
|
add edi, 4
|
|
|
|
|
jmp .cd_get_parameters_of_file_2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
.end_buffer:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
pop edx edi esi eax
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
cd_get_parameters_of_file:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov edi, [cd_mem_location]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
cd_get_parameters_of_file_1:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; получаем атрибуты файла
|
2012-03-08 12:33:38 +04:00
|
|
|
|
xor eax, eax
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; файл не архивировался
|
2012-03-08 12:33:38 +04:00
|
|
|
|
inc eax
|
|
|
|
|
shl eax, 1
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; это каталог?
|
2012-03-08 12:33:38 +04:00
|
|
|
|
test [ebp-8], byte 2
|
|
|
|
|
jz .file
|
|
|
|
|
inc eax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.file:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; метка тома не как в FAT, в этом виде отсутсвует
|
|
|
|
|
; файл не является системным
|
2012-03-08 12:33:38 +04:00
|
|
|
|
shl eax, 3
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; файл является скрытым? (атрибут существование)
|
2012-03-08 12:33:38 +04:00
|
|
|
|
test [ebp-8], byte 1
|
|
|
|
|
jz .hidden
|
|
|
|
|
inc eax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.hidden:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
shl eax, 1
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; файл всегда только для чтения, так как это CD
|
2012-03-08 12:33:38 +04:00
|
|
|
|
inc eax
|
|
|
|
|
mov [edi], eax
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; получаем время для файла
|
|
|
|
|
;час
|
2012-03-08 12:33:38 +04:00
|
|
|
|
movzx eax, byte [ebp-12]
|
|
|
|
|
shl eax, 8
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;минута
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov al, [ebp-11]
|
|
|
|
|
shl eax, 8
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;секунда
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov al, [ebp-10]
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;время создания файла
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [edi+8], eax
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;время последнего доступа
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [edi+16], eax
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;время последней записи
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [edi+24], eax
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; получаем дату для файла
|
|
|
|
|
;год
|
2012-03-08 12:33:38 +04:00
|
|
|
|
movzx eax, byte [ebp-15]
|
|
|
|
|
add eax, 1900
|
|
|
|
|
shl eax, 8
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;месяц
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov al, [ebp-14]
|
|
|
|
|
shl eax, 8
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;день
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov al, [ebp-13]
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;дата создания файла
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [edi+12], eax
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;время последнего доступа
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [edi+20], eax
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;время последней записи
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [edi+28], eax
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; получаем тип данных имени
|
2012-03-08 12:33:38 +04:00
|
|
|
|
xor eax, eax
|
|
|
|
|
test dword [ebx+4], 1; 0=ANSI, 1=UNICODE
|
|
|
|
|
jnz .unicode_1
|
|
|
|
|
mov [edi+4], eax
|
|
|
|
|
jmp @f
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.unicode_1:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
inc eax
|
|
|
|
|
mov [edi+4], eax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; получаем размер файла в байтах
|
2012-03-08 12:33:38 +04:00
|
|
|
|
xor eax, eax
|
|
|
|
|
mov [edi+32+4], eax
|
|
|
|
|
mov eax, [ebp-23]
|
|
|
|
|
mov [edi+32], eax
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
;----------------------------------------------------------------
|
|
|
|
|
;
|
|
|
|
|
; fs_CdGetFileInfo - LFN variant for CD
|
|
|
|
|
; get file/directory attributes structure
|
|
|
|
|
;
|
|
|
|
|
;----------------------------------------------------------------
|
|
|
|
|
fs_CdGetFileInfo:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp byte [esi], 0
|
|
|
|
|
jnz @f
|
|
|
|
|
mov eax, 2
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
push edi
|
|
|
|
|
call cd_find_lfn
|
|
|
|
|
pushfd
|
|
|
|
|
cmp [DevErrorCode], 0
|
|
|
|
|
jz @f
|
|
|
|
|
popfd
|
|
|
|
|
pop edi
|
|
|
|
|
mov eax, 11
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
popfd
|
|
|
|
|
jnc @f
|
|
|
|
|
pop edi
|
|
|
|
|
mov eax, ERROR_FILE_NOT_FOUND
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov edi, edx
|
|
|
|
|
push ebp
|
|
|
|
|
mov ebp, [cd_current_pointer_of_input]
|
|
|
|
|
add ebp, 33
|
|
|
|
|
call cd_get_parameters_of_file_1
|
|
|
|
|
pop ebp
|
|
|
|
|
and dword [edi+4], 0
|
|
|
|
|
pop edi
|
|
|
|
|
xor eax, eax
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
;----------------------------------------------------------------
|
|
|
|
|
cd_find_lfn:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [cd_appl_data], 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; in: esi+ebp -> name
|
|
|
|
|
; out: CF=1 - file not found
|
|
|
|
|
; else CF=0 and [cd_current_pointer_of_input] direntry
|
2012-03-08 12:33:38 +04:00
|
|
|
|
push eax esi
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; 16 сектор начало набора дескрипторов томов
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
call WaitUnitReady
|
|
|
|
|
cmp [DevErrorCode], 0
|
|
|
|
|
jne .access_denied
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
call prevent_medium_removal
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; тестовое чтение
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [CDSectorAddress], dword 16
|
|
|
|
|
mov [CDDataBuf_pointer], CDDataBuf
|
|
|
|
|
call ReadCDWRetr;_1
|
|
|
|
|
cmp [DevErrorCode], 0
|
|
|
|
|
jne .access_denied
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; вычисление последней сессии
|
2012-03-08 12:33:38 +04:00
|
|
|
|
call WaitUnitReady
|
|
|
|
|
cmp [DevErrorCode], 0
|
|
|
|
|
jne .access_denied
|
|
|
|
|
call Read_TOC
|
|
|
|
|
mov ah, [CDDataBuf+4+4]
|
|
|
|
|
mov al, [CDDataBuf+4+5]
|
|
|
|
|
shl eax, 16
|
|
|
|
|
mov ah, [CDDataBuf+4+6]
|
|
|
|
|
mov al, [CDDataBuf+4+7]
|
|
|
|
|
add eax, 15
|
|
|
|
|
mov [CDSectorAddress], eax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; mov [CDSectorAddress],dword 15
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [CDDataBuf_pointer], CDDataBuf
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
.start:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
inc dword [CDSectorAddress]
|
|
|
|
|
call ReadCDWRetr;_1
|
|
|
|
|
cmp [DevErrorCode], 0
|
|
|
|
|
jne .access_denied
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
.start_check:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; проверка на вшивость
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [CDDataBuf+1], dword 'CD00'
|
|
|
|
|
jne .access_denied
|
|
|
|
|
cmp [CDDataBuf+5], byte '1'
|
|
|
|
|
jne .access_denied
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; сектор является терминатором набор дескрипторов томов?
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [CDDataBuf], byte 0xff
|
|
|
|
|
je .access_denied
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; сектор является дополнительным и улучшенным дескриптором тома?
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [CDDataBuf], byte 0x2
|
|
|
|
|
jne .start
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; сектор является дополнительным дескриптором тома?
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [CDDataBuf+6], byte 0x1
|
|
|
|
|
jne .start
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; параметры root директрории
|
|
|
|
|
mov eax, [CDDataBuf+0x9c+2]; начало root директрории
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [CDSectorAddress], eax
|
2013-05-28 23:09:31 +04:00
|
|
|
|
mov eax, [CDDataBuf+0x9c+10]; размер root директрории
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp byte [esi], 0
|
|
|
|
|
jnz @f
|
|
|
|
|
mov [cd_current_pointer_of_input], CDDataBuf+0x9c
|
|
|
|
|
jmp .done
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; начинаем поиск
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.mainloop:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
dec dword [CDSectorAddress]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.read_to_buffer:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
inc dword [CDSectorAddress]
|
|
|
|
|
mov [CDDataBuf_pointer], CDDataBuf
|
2013-05-28 23:09:31 +04:00
|
|
|
|
call ReadCDWRetr ; читаем сектор директории
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp [DevErrorCode], 0
|
|
|
|
|
jne .access_denied
|
|
|
|
|
push ebp
|
|
|
|
|
call cd_find_name_in_buffer
|
|
|
|
|
pop ebp
|
|
|
|
|
jnc .found
|
|
|
|
|
sub eax, 2048
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; директория закончилась?
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp eax, 0
|
|
|
|
|
ja .read_to_buffer
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; нет искомого элемента цепочки
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.access_denied:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
pop esi eax
|
|
|
|
|
mov [cd_appl_data], 1
|
|
|
|
|
stc
|
|
|
|
|
ret
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; искомый элемент цепочки найден
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.found:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; конец пути файла
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp byte [esi-1], 0
|
|
|
|
|
jz .done
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.nested:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov eax, [cd_current_pointer_of_input]
|
|
|
|
|
push dword [eax+2]
|
2013-05-28 23:09:31 +04:00
|
|
|
|
pop dword [CDSectorAddress] ; начало директории
|
|
|
|
|
mov eax, [eax+2+8]; размер директории
|
2012-03-08 12:33:38 +04:00
|
|
|
|
jmp .mainloop
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; указатель файла найден
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.done:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
test ebp, ebp
|
|
|
|
|
jz @f
|
|
|
|
|
mov esi, ebp
|
|
|
|
|
xor ebp, ebp
|
|
|
|
|
jmp .nested
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
pop esi eax
|
|
|
|
|
mov [cd_appl_data], 1
|
|
|
|
|
clc
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
cd_find_name_in_buffer:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [cd_current_pointer_of_input_2], CDDataBuf
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.start:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
call cd_get_name
|
|
|
|
|
jc .not_found
|
|
|
|
|
call cd_compare_name
|
|
|
|
|
jc .start
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.found:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
clc
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.not_found:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
stc
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
cd_get_name:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
push eax
|
|
|
|
|
mov ebp, [cd_current_pointer_of_input_2]
|
|
|
|
|
mov [cd_current_pointer_of_input], ebp
|
|
|
|
|
mov eax, [ebp]
|
2013-05-28 23:09:31 +04:00
|
|
|
|
test eax, eax ; входы закончились?
|
2012-03-08 12:33:38 +04:00
|
|
|
|
jz .next_sector
|
2013-05-28 23:09:31 +04:00
|
|
|
|
cmp ebp, CDDataBuf+2048 ; буфер закончился?
|
2012-03-08 12:33:38 +04:00
|
|
|
|
jae .next_sector
|
|
|
|
|
movzx eax, byte [ebp]
|
2013-05-28 23:09:31 +04:00
|
|
|
|
add [cd_current_pointer_of_input_2], eax; следующий вход каталога
|
|
|
|
|
add ebp, 33; указатель установлен на начало имени
|
2012-03-08 12:33:38 +04:00
|
|
|
|
pop eax
|
|
|
|
|
clc
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.next_sector:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
pop eax
|
|
|
|
|
stc
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
cd_compare_name:
|
|
|
|
|
; compares ASCIIZ-names, case-insensitive (cp866 encoding)
|
|
|
|
|
; in: esi->name, ebp->name
|
|
|
|
|
; out: if names match: ZF=1 and esi->next component of name
|
|
|
|
|
; else: ZF=0, esi is not changed
|
|
|
|
|
; destroys eax
|
2012-03-08 12:33:38 +04:00
|
|
|
|
push esi eax edi
|
|
|
|
|
mov edi, ebp
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.loop:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cld
|
|
|
|
|
lodsb
|
|
|
|
|
push eax
|
|
|
|
|
call char_todown
|
|
|
|
|
call ansi2uni_char
|
|
|
|
|
xchg ah, al
|
|
|
|
|
scasw
|
|
|
|
|
pop eax
|
|
|
|
|
je .coincides
|
|
|
|
|
call char_toupper
|
|
|
|
|
call ansi2uni_char
|
|
|
|
|
xchg ah, al
|
|
|
|
|
sub edi, 2
|
|
|
|
|
scasw
|
|
|
|
|
jne .name_not_coincide
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.coincides:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
cmp [esi], byte '/'; разделитель пути, конец имени текущего элемента
|
2012-03-08 12:33:38 +04:00
|
|
|
|
je .done
|
2013-05-28 23:09:31 +04:00
|
|
|
|
cmp [esi], byte 0; разделитель пути, конец имени текущего элемента
|
2012-03-08 12:33:38 +04:00
|
|
|
|
je .done
|
|
|
|
|
jmp .loop
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.name_not_coincide:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
pop edi eax esi
|
|
|
|
|
stc
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.done:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; проверка конца файла
|
|
|
|
|
cmp [edi], word 3B00h; сепаратор конца файла ';'
|
2012-03-08 12:33:38 +04:00
|
|
|
|
je .done_1
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; проверка для файлов не заканчивающихся сепаратором
|
2012-03-08 12:33:38 +04:00
|
|
|
|
movzx eax, byte [ebp-33]
|
|
|
|
|
add eax, ebp
|
|
|
|
|
sub eax, 34
|
|
|
|
|
cmp edi, eax
|
|
|
|
|
je .done_1
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; проверка конца папки
|
2012-03-08 12:33:38 +04:00
|
|
|
|
movzx eax, byte [ebp-1]
|
|
|
|
|
add eax, ebp
|
|
|
|
|
cmp edi, eax
|
|
|
|
|
jne .name_not_coincide
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.done_1:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
pop edi eax
|
|
|
|
|
add esp, 4
|
|
|
|
|
inc esi
|
|
|
|
|
clc
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
char_todown:
|
|
|
|
|
; convert character to uppercase, using cp866 encoding
|
|
|
|
|
; in: al=symbol
|
|
|
|
|
; out: al=converted symbol
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp al, 'A'
|
|
|
|
|
jb .ret
|
|
|
|
|
cmp al, 'Z'
|
|
|
|
|
jbe .az
|
2013-05-28 23:09:31 +04:00
|
|
|
|
cmp al, 0x80 ; 'А'
|
2012-03-08 12:33:38 +04:00
|
|
|
|
jb .ret
|
2013-05-28 23:09:31 +04:00
|
|
|
|
cmp al, 0x90 ; 'Р'
|
2012-03-08 12:33:38 +04:00
|
|
|
|
jb .rus1
|
2013-05-28 23:09:31 +04:00
|
|
|
|
cmp al, 0x9F ; 'Я'
|
2012-03-08 12:33:38 +04:00
|
|
|
|
ja .ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; 0x90-0x9F -> 0xE0-0xEF
|
2013-05-28 23:09:31 +04:00
|
|
|
|
add al, 0xE0-0x90
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.ret:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.rus1:
|
|
|
|
|
; 0x80-0x8F -> 0xA0-0xAF
|
|
|
|
|
.az:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add al, 0x20
|
|
|
|
|
ret
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
uni2ansi_char:
|
|
|
|
|
; convert UNICODE character in al to ANSI character in ax, using cp866 encoding
|
|
|
|
|
; in: ax=UNICODE character
|
|
|
|
|
; out: al=converted ANSI character
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp ax, 0x80
|
|
|
|
|
jb .ascii
|
|
|
|
|
cmp ax, 0x401
|
|
|
|
|
jz .yo1
|
|
|
|
|
cmp ax, 0x451
|
|
|
|
|
jz .yo2
|
|
|
|
|
cmp ax, 0x410
|
|
|
|
|
jb .unk
|
|
|
|
|
cmp ax, 0x440
|
|
|
|
|
jb .rus1
|
|
|
|
|
cmp ax, 0x450
|
|
|
|
|
jb .rus2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.unk:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov al, '_'
|
|
|
|
|
jmp .doit
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.yo1:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
mov al, 0xF0 ; 'Ё' in cp866
|
2012-03-08 12:33:38 +04:00
|
|
|
|
jmp .doit
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.yo2:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
mov al, 0xF1 ; 'ё' in cp866
|
2012-03-08 12:33:38 +04:00
|
|
|
|
jmp .doit
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.rus1:
|
|
|
|
|
; 0x410-0x43F -> 0x80-0xAF
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add al, 0x70
|
|
|
|
|
jmp .doit
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.rus2:
|
|
|
|
|
; 0x440-0x44F -> 0xE0-0xEF
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add al, 0xA0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.ascii:
|
|
|
|
|
.doit:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
ret
|