Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Ignore whitespace Rev 147 → Rev 148

/kernel/tags/kolibri0.6.0.0/core/newproce.inc
0,0 → 1,1076
if ~defined newprocess_inc
newprocess_inc_fix:
newprocess_inc fix newprocess_inc_fix
include "mem.inc"
include "memmanag.inc"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Working with new types of processes.
;;Author: Khalyavin Andrey halyavin@land.ru
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
iglobal
new_process_loading db 'K : New Process - loading',13,10,0
new_process_running db 'K : New Process - done',13,10,0
start_not_enough_memory db 'K : New Process - not enough memory',13,10,0
endg
;-----------------------------------------------------------------------------
find_new_process_place:
;input:
; none
;result:
; eax=[new_process_place]<>0 - ok
; 0 - failed.
;This function find least empty slot.
;It doesn't increase [0x3004]!
mov eax,0x3000+second_base_address
push ebx
mov ebx,[0x3004]
inc ebx
shl ebx,5
add ebx,eax ;ebx - address of process information for (last+1) slot
.newprocessplace:
;eax = address of process information for current slot
cmp eax,ebx
jz .endnewprocessplace ;empty slot after high boundary
add eax,0x20
cmp word [eax+TASKDATA.state],9 ;check process state, 9 means that process slot is empty
jnz .newprocessplace
.endnewprocessplace:
mov ebx,eax
sub eax,0x3000+second_base_address
shr eax,5 ;calculate slot index
cmp eax,256
jge .failed ;it should be <256
mov word [ebx+TASKDATA.state],9 ;set process state to 9 (for slot after hight boundary)
mov [new_process_place],eax ;save process slot
pop ebx
ret
.failed:
xor eax,eax
pop ebx
ret
;-----------------------------------------------------------------------------
safe_sti:
cmp byte [0xe000], 1
jne @f
sti
@@:ret
;-----------------------------------------------------------------------------
new_sys_threads:
;eax=1 - create thread
; ebx=thread start
; ecx=thread stack value
;result:
; eax=pid
xor edx,edx ; flags=0
pushad
cmp eax,1
jnz .ret ;other subfunctions
mov esi,new_process_loading
call sys_msg_board_str
;lock application_table_status mutex
.table_status:
cli
cmp [application_table_status],0
je .stf
sti
call change_task
jmp .table_status
.stf:
call set_application_table_status
;find free process slot
 
call find_new_process_place
test eax,eax
jz .failed
;set parameters for thread
xor eax,eax
mov [app_i_param],eax
mov [app_i_icon],eax
mov [app_start],ebx
mov [app_esp],ecx
 
mov esi,[0x3000]
shl esi,8
add esi,0x80000+APPDATA.app_name
mov ebx,esi ;ebx=esi - pointer to extended information about current thread
mov edi,[new_process_place]
shl edi,8
add edi,0x80000
lea edx, [edi+APPDATA.app_name] ;edx=edi - pointer to extended infomation about new thread
mov ecx,256/4
rep stosd ;clean extended information about new thread
mov edi,edx
mov ecx,11
rep movsb ;copy process name
mov eax,[ebx+APPDATA.mem_size]
mov [app_mem],eax ;set memory size
mov eax,[ebx+APPDATA.dir_table]
mov dword [edx-APPDATA.app_name+APPDATA.dir_table],eax ;copy page directory
; mov eax,[new_process_place]
; mov ebx,[0x3000]
; call addreference_app_cr3_table
 
push 0 ;no parameters
call fs_execute.add_app_parameters ;start thread
mov [esp+28],eax
popad
ret
.failed:
sti
popad
mov eax,-1
ret
.ret:
popad
ret
;-----------------------------------------------------------------------------
new_mem_resize:
;input:
; ebx - new size
;result:
; [esp+36]:=0 - normal
; [esp+36]:=1 - error
;This function set new application memory size.
mov esi,ebx ;save new size
add ebx,4095
and ebx,not (4096-1) ;round up size
mov ecx,[0x3000]
shl ecx,8
mov edx,[0x80000 + APPDATA.mem_size +ecx]
add edx,4095
and edx,not (4096-1) ;old size
mov eax,[0x80000 + APPDATA.dir_table+ecx]
call MEM_Get_Linear_Address
;eax - linear address of page directory
call MEM_Heap_Lock ;guarantee that two threads willn't
;change memory size simultaneously
cmp ebx,edx
; mov esi,ebx ;save new size
jg .expand
.free:
sub edx,ebx
jz .unlock ;do nothing
mov ecx,edx
shr ecx,12
add ebx,std_application_base_address
call mem_free_specified_region ;free unnecessary pages
jmp .unlock
 
.expand:
sub ebx,edx
mov ecx,ebx
shr ecx,12
mov ebx,edx
add ebx,std_application_base_address
call mem_alloc_specified_region ;alloc necessary pages
test eax,eax
jz .failed ;not enough memory
.unlock:
mov ebx,esi
mov eax,[0x3000]
shl eax,8
mov [eax+0x80000 + APPDATA.mem_size],ebx ;write new memory size
;search threads and update
;application memory size infomation
mov ecx,[eax+0x80000 + APPDATA.dir_table]
mov eax,2
.search_threads:
;eax = current slot
;ebx = new memory size
;ecx = page directory
cmp eax,[0x3004]
jg .search_threads_end
mov edx,eax
shl edx,5
cmp word [0x3000+edx+TASKDATA.state],9 ;if slot empty?
jz .search_threads_next
shl edx,3
cmp [edx+0x80000+APPDATA.dir_table],ecx ;if it is our thread?
jnz .search_threads_next
mov [edx+0x80000+APPDATA.mem_size],ebx ;update memory size
.search_threads_next:
inc eax
jmp .search_threads
.search_threads_end:
 
call MEM_Heap_UnLock
mov dword [esp+36],0
ret
.failed:
call MEM_Heap_UnLock
mov dword [esp+36],1
ret
;-----------------------------------------------------------------------------
pid_to_slot:
;Input:
; eax - pid of process
;Output:
; eax - slot of process or 0 if process don't exists
;Search process by PID.
push ebx
push ecx
mov ebx,[0x3004]
shl ebx,5
mov ecx,2*32
.loop:
;ecx=offset of current process info entry
;ebx=maximum permitted offset
cmp byte [second_base_address+0x3000+ecx+TASKDATA.state],9
jz .endloop ;skip empty slots
cmp [second_base_address+0x3000+ecx+TASKDATA.pid],eax ;check PID
jz .pid_found
.endloop:
add ecx,32
cmp ecx,ebx
jle .loop
pop ecx
pop ebx
xor eax,eax
ret
.pid_found:
shr ecx,5
mov eax,ecx ;convert offset to index of slot
pop ecx
pop ebx
ret
;-----------------------------------------------------------------------------
is_new_process:
;Input:
; eax - process slot
;Output:
; eax=1 - it is new process
; eax=0 - it is old process
; shl eax,5
; mov eax,[second_base_address+0x3000+eax+0x10]
; cmp eax,std_application_base_address ;check base address of application
; jz .new_process
; xor eax,eax
; ret
;.new_process:
mov eax,1
ret
;-----------------------------------------------------------------------------
write_process_memory:
;Input:
; eax - process slot
; ebx - buffer address
; ecx - buffer size
; edx - start address in other process
;Output:
; eax - number of bytes written
pushad
shl eax,8
mov eax,[0x80000+eax+APPDATA.dir_table]
call MEM_Get_Linear_Address
mov ebp,eax
;ebp=linear address of page directory of other process.
add edx,std_application_base_address ;convert to linear address
test ecx,ecx
jle .ret
.write_loop:
;ebx = current buffer address
;ecx>0 = current size
;edx = current address in other process
;ebp = linear address of page directory
 
call MEM_Heap_Lock ;cli
mov esi,edx
shr esi,22
mov eax,[ebp+4*esi] ;find page directory entry
and eax,not (4096-1) ;clear flags
test eax,eax
jz .page_not_found
call MEM_Get_Linear_Address ;calculate linear address of page table
test eax,eax
jz .page_not_found
mov esi,edx
shr esi,12
and esi,1023
mov eax,[eax+4*esi] ;find page table entry
and eax,not (4096-1)
test eax,eax
jz .page_not_found
call MEM_Get_Linear_Address ;calculate linear address of page
test eax,eax
jz .page_not_found
mov edi,eax
call MEM_Add_Reference_Linear;guarantee that page willn't disappear
call MEM_Heap_UnLock ;sti
mov esi,edx
and esi,4095
add edi,esi ;add offset in page
;edi = linear address corresponding edx in other process
sub esi,4096
neg esi ;esi - number of remaining bytes in page
cmp esi,ecx
jl .min_ecx
mov esi,ecx
.min_ecx: ;esi=min(ecx,esi) - number of bytes to write
sub ecx,esi
push ecx
mov ecx,esi ;ecx - number of bytes to write
mov esi,ebx ;esi - source, edi - destination
add edx,ecx ;move pointer in address space of other process
push edi
;move ecx bytes
test ecx,3
jnz .not_aligned
shr ecx,2
rep movsd
jmp .next_iter
.not_aligned:
rep movsb
.next_iter:
 
pop eax
and eax,not (4096-1) ;eax - linear address of current page
call MEM_Free_Page_Linear ;free reference
mov ebx,esi ;new pointer to buffer - movsb automaticaly advance it.
pop ecx ;restore number of remaining bytes
test ecx,ecx
jnz .write_loop
.ret:
popad
mov eax,ecx
ret
.page_not_found:
call MEM_Heap_UnLock ;error has appeared in critical region
sub ecx,[esp+24] ;[esp+24]<-->ecx
neg ecx ;ecx=number_of_written_bytes
mov [esp+28],ecx ;[esp+28]<-->eax
popad
ret
;-----------------------------------------------------------------------------
syscall_test:
;for testing memory manager from applications.
mov edx,ecx
mov ecx,ebx
call trans_address
mov ebx,eax
mov eax,[0x3000]
call read_process_memory
ret
;-----------------------------------------------------------------------------
read_process_memory:
;Input:
; eax - process slot
; ebx - buffer address
; ecx - buffer size
; edx - start address in other process
;Output:
; eax - number of bytes read.
pushad
shl eax,8
mov eax,[0x80000+eax+APPDATA.dir_table]
call MEM_Get_Linear_Address
mov ebp,eax
add edx,std_application_base_address
.read_loop:
;ebx = current buffer address
;ecx>0 = current size
;edx = current address in other process
;ebp = linear address of page directory
 
call MEM_Heap_Lock ;cli
mov esi,edx
shr esi,22
mov eax,[ebp+4*esi] ;find page directory entry
and eax,not (4096-1)
test eax,eax
jz .page_not_found
call MEM_Get_Linear_Address
test eax,eax
jz .page_not_found
mov esi,edx
shr esi,12
and esi,1023
mov eax,[eax+4*esi] ;find page table entry
and eax,not (4096-1)
test eax,eax
jz .page_not_found
call MEM_Get_Linear_Address ;calculate linear address of page
test eax,eax
jz .page_not_found
mov esi,eax
call MEM_Add_Reference_Linear;guarantee that page willn't disappear
call MEM_Heap_UnLock ;sti
mov edi,edx
and edi,4095
add esi,edi ;add offset in page
;esi = linear address corresponding edx in other process
sub edi,4096
neg edi
;edi=min(edi,ecx) - number of bytes to copy
cmp edi,ecx
jl .min_ecx
mov edi,ecx
.min_ecx:
 
sub ecx,edi ;update size of remaining bytes
add edx,edi ;update current pointer in other address space.
push ecx
mov ecx,edi ;ecx - number of bytes to read
mov edi,ebx ;esi - source, edi - destination
push esi
;move ecx bytes
test ecx,3
jnz .not_aligned
shr ecx,2
rep movsd
jmp .next_iter
.not_aligned:
rep movsb
.next_iter:
pop eax
and eax,not (4096-1) ;eax - linear address of current page
call MEM_Free_Page_Linear ;free reference
mov ebx,edi ;new pointer to buffer - movsb automaticaly advance it.
pop ecx ;restore number of remaining bytes
test ecx,ecx
jnz .read_loop
popad
mov eax,ecx
ret
.page_not_found:
call MEM_Heap_UnLock ;error has appeared in critical region
sub ecx,[esp+24] ;[esp+24]<-->ecx
neg ecx ;ecx=number_of_read_bytes
mov [esp+28],ecx ;[esp+28]<-->eax
popad
ret
;-----------------------------------------------------------------------------
check_region:
;input:
; ebx - start of buffer
; ecx - size of buffer
;result:
; eax = 1 region lays in app memory
; eax = 0 region don't lays in app memory
mov eax,[0x3000]
jmp check_process_region
;-----------------------------------------------------------------------------
check_process_region:
;input:
; eax - slot
; ebx - start of buffer
; ecx - size of buffer
;result:
; eax = 1 region lays in app memory
; eax = 0 region don't lays in app memory
test ecx,ecx
jle .ok
shl eax,5
cmp word [0x3000+eax+TASKDATA.state],0
jnz .failed
shl eax,3
mov eax,[0x80000+eax+APPDATA.dir_table]
test eax,eax
jz .failed
call MEM_Get_Linear_Address
push ebx
push ecx
push edx
mov edx,ebx
and edx,not (4096-1)
sub ebx,edx
add ecx,ebx
mov ebx,edx
add ecx,(4096-1)
and ecx,not (4096-1)
.loop:
;eax - linear address of page directory
;ebx - current page
;ecx - current size
mov edx,ebx
shr edx,22
mov edx,[eax+4*edx]
and edx,not (4096-1)
test edx,edx
jz .failed1
push eax
mov eax,edx
call MEM_Get_Linear_Address
mov edx,ebx
shr edx,12
and edx,(1024-1)
mov eax,[eax+4*edx]
and eax,not (4096-1)
test eax,eax
pop eax
jz .failed1
add ebx,4096
sub ecx,4096
jg .loop
pop edx
pop ecx
pop ebx
.ok:
mov eax,1
ret
.failed1:
pop edx
pop ecx
pop ebx
.failed:
xor eax,eax
ret
;-----------------------------------------------------------------------------
new_sys_ipc:
;input:
; eax=1 - set ipc buffer area
; ebx=address of buffer
; ecx=size of buffer
; eax=2 - send message
; ebx=PID
; ecx=address of message
; edx=size of message
cmp eax,1
jnz .no_ipc_def
;set ipc buffer area
mov edi,[0x3000]
shl edi,8
add edi,0x80000
cli
mov [edi+APPDATA.ipc_start],ebx ;set fields in extended information area
mov [edi+APPDATA.ipc_size],ecx
sti
mov [esp+36],dword 0 ;success
ret
.no_ipc_def:
cmp eax,2
jnz .no_ipc_send
;send message
cli
;obtain slot from PID
mov eax,ebx
call pid_to_slot
test eax,eax
jz .no_pid
mov ebp,eax
;ebp = slot of other process
shl eax,8
mov edi,[eax+0x80000+APPDATA.ipc_start] ;is ipc area defined?
test edi,edi
jz .no_ipc_area
mov esi,[eax+0x80000+APPDATA.ipc_size] ;esi - size of buffer
push dword -1 ;temp variable for read_process_memory
mov ebx,esp
push ecx
push edx
mov ecx,4 ;read 4 bytes
mov eax,ebp
mov edx,edi ;from beginning of buffer.
call read_process_memory
mov eax,[esp+8]
test eax,eax
jnz .ipc_blocked ;if dword [buffer]<>0 - ipc blocked now
add edx,4 ;move to next 4 bytes
mov eax,ebp
call read_process_memory ;read size of occupied space in buffer
sub esi,8
sub esi,[esp]
sub esi,[esp+8] ;esi=(buffer size)-(occupied size)-(message size)-(header of message size)
js .buffer_overflow ;esi<0 - not enough memory in buffer
mov esi,[esp+8] ;previous offset
add dword [esp+8],8
mov edi,[esp]
add [esp+8],edi ;add (size of message)+(size of header of message) to [buffer+4]
mov eax,ebp
call write_process_memory
add edx,esi
sub edx,4 ;move to beginning of place for our message
mov eax,[second_base_address+0x3010]
mov eax,[eax+TASKDATA.pid] ;eax - our PID
mov [esp+8],eax
mov eax,ebp
call write_process_memory ;write PID
mov ebx,esp ;address of size of message
mov eax,ebp
add edx,4
call write_process_memory ;write size of message
add edx,4
pop ecx ;ecx - size of message
pop eax
call trans_address
mov ebx,eax ;ebx - linear address of message
add esp,4 ;pop temporary variable
mov eax,ebp
call write_process_memory ;write message
sti
;awake other process
shl ebp,8
mov eax,ebp
or [eax+0x80000+APPDATA.event_mask],dword 0x40
cmp dword [check_idle_semaphore],20
jge .ipc_no_cis
mov dword [check_idle_semaphore],5
.ipc_no_cis:
mov dword [esp+36],0
ret
.no_ipc_send:
mov dword [esp+36],-1
ret
.no_pid:
sti
mov dword [esp+36],4
ret
.no_ipc_area:
sti
mov dword [esp+36],1
ret
.ipc_blocked:
sti
add esp,12
mov dword [esp+36],2
ret
.buffer_overflow:
sti
add esp,12
mov dword [esp+36],3
ret
;-----------------------------------------------------------------------------
trans_address:
;Input
; eax - application address
;Output
; eax - linear address for kernel
add eax,std_application_base_address
ret
;-----------------------------------------------------------------------------
 
; \begin{diamond}
include 'debug.inc'
 
fs_execute:
; ebx - cmdline
; edx - flags
; ebp - full filename
; [esp+4] = procedure DoRead, [esp+8] = filesize & [esp+12]... - arguments for it
pushad
; check filename length - with terminating NULL must be no more than 1024 symbols
mov edi, ebp
mov ecx, 1024
xor eax, eax
repnz scasb
jz @f
popad
mov eax, -ERROR_FILE_NOT_FOUND
ret
@@:
 
mov esi, new_process_loading
call sys_msg_board_str ; write message to message board
 
; lock application_table_status mutex
.table_status:
cli
cmp [application_table_status], 0
jz .stf
sti
call change_task
jmp .table_status
.stf:
call set_application_table_status
push ebx ; save command line pointer for add_app_parameters
 
call find_new_process_place ; find new process slot
call safe_sti
test eax, eax
mov ecx, -0x20 ; too many processes
jz .failed
 
; write application name
push edi
mov ecx, edi
sub ecx, ebp
mov [appl_path], ebp
mov [appl_path_size], ecx
dec edi
std
mov al, '/'
repnz scasb
cld
jnz @f
inc edi
@@:
inc edi
; now edi points to name without path
mov esi, edi
mov ecx, 8 ; 8 chars for name
mov edi, [new_process_place]
shl edi, cl
add edi, 0x80000+APPDATA.app_name
.copy_process_name_loop:
lodsb
cmp al, '.'
jz .copy_process_name_done
test al, al
jz .copy_process_name_done
stosb
loop .copy_process_name_loop
.copy_process_name_done:
mov al, ' '
rep stosb
pop eax
mov cl, 3 ; 3 chars for extension
dec esi
@@:
dec eax
cmp eax, esi
jbe .copy_process_ext_done
cmp byte [eax], '.'
jnz @b
lea esi, [eax+1]
.copy_process_ext_loop:
lodsb
test al, al
jz .copy_process_ext_done
stosb
loop .copy_process_ext_loop
.copy_process_ext_done:
mov al, ' '
rep stosb
 
; read header
lea eax, [esp+8+36]
mov edi, 0x90000
call dword [eax-4]
mov ecx, eax
neg ecx
jnz .cleanfailed
; check menuet signature
mov ecx, -0x1F
cmp dword [0x90000], 'MENU'
jnz .cleanfailed
cmp word [0x90004], 'ET'
jnz .cleanfailed
call get_app_params
mov ecx, -0x1F
jc .cleanfailed
; sanity check - because we will load all file,
; file size must be not greater than memory size
mov eax, [esp+8+36]
cmp [app_mem], eax
jb .cleanfailed
 
mov eax, [new_process_place]
inc ecx ; -0x1E = no memory
call create_app_cr3_table
test eax, eax
jz .cleanfailed_mem
 
call MEM_Get_Linear_Address
 
mov ebx, std_application_base_address
mov ecx, [app_mem]
add ecx, 4095
shr ecx, 12
mov edx, eax ; edx - linear address of page directory
call mem_alloc_specified_region
mov ecx, -0x1E ; no memory
test eax, eax
jz .cleanfailed_mem1
 
add edx, std_application_base_address shr 20
mov eax, [edx]
and eax, not 4095
call MEM_Get_Linear_Address
push edx ; save pointer to first page table
mov edx, eax
; read file
; first block is already read to 0x90000
mov eax, [edx]
and eax, not 0xFFF
call MEM_Get_Linear_Address
mov esi, 0x90000
mov edi, eax
mov ecx, 512/4
rep movsd
sub edi, eax
.loop1:
; [esp] = pointer to current page directory entry
; edx = pointer to current page table
; edi = offset in page
mov eax, [edx]
and eax, not 0xFFF
call MEM_Get_Linear_Address
push edi
add edi, eax
lea eax, [esp+8+36+8]
call dword [eax-4]
pop edi
test eax, eax
jnz .endloop1
add edi, 512 ; new offset
cmp edi, 4096
jb .loop1
xor edi, edi
add edx, 4 ; go to next page
test edx, 4096-1
jnz .loop1
pop eax
add eax, 4 ; go to next directory entry
push eax
mov eax, [eax]
and eax, not 0xFFF
call MEM_Get_Linear_Address
mov edx, eax
jmp .loop1
.endloop1:
pop edx
cmp eax, 6
jnz .cleanfailed_mem2
call .add_app_parameters
mov [esp+28], eax
popad
ret
 
.cleanfailed_mem2:
; file read error; free all allocated mem
mov ecx, eax
neg ecx
mov eax, [new_process_place]
call dispose_app_cr3_table
jmp .cleanfailed
.cleanfailed_mem1:
; there is mem for directory entry, but there is no mem for pages
; so free directory entry
mov eax, [new_process_place]
shl eax, 8
mov eax, [0x80000+eax+0xB8]
call MEM_Free_Page
.cleanfailed_mem:
; there is no mem for directory entry, display message
mov esi, start_not_enough_memory
call sys_msg_board_str
.cleanfailed:
push ecx
; clean process name, this avoid problems with @panel
mov edi, [new_process_place]
shl edi, 8
add edi, 0x80000+APPDATA.app_name
mov ecx, 11
mov al, ' '
rep stosb
pop eax
.failed:
pop ebx
mov [esp+28], eax
popad
mov [application_table_status], 0
call safe_sti
ret
; \end{diamond}
.add_app_parameters:
;input:
; [esp] - pointer to parameters
; [esp+4]-[esp+36] pushad registers.
;result
; eax - pid of new process
; or zero if failed
cli
mov ebx,[new_process_place]
cmp ebx,[0x3004]
jle .noinc
inc dword [0x3004] ;update number of processes
.noinc:
 
; mov ebx,[new_process_place]
;set 0x8c field of extended information about process
;(size of application memory)
shl ebx,8
mov eax,[app_mem]
mov [second_base_address+0x80000+APPDATA.mem_size+ebx],eax
;set 0x10 field of information about process
;(application base address)
; mov ebx,[new_process_place]
; shl ebx,5
shr ebx,3
mov dword [second_base_address+0x3000+ebx+TASKDATA.mem_start],std_application_base_address
 
;add command line parameters
.add_command_line:
mov edx,[app_i_param]
test edx,edx
jz .no_command_line ;application don't need parameters
mov eax,[esp+4]
test eax,eax
jz .no_command_line ;no parameters specified
;calculate parameter length
mov esi,eax
xor ecx,ecx
inc ecx ; include terminating null
.command_line_len:
cmp byte [esi],0
jz .command_line_len_end
inc esi
inc ecx
cmp ecx,256
jl .command_line_len
.command_line_len_end:
;ecx - parameter length
;edx - address of parameters in new process address space
mov ebx,eax ;ebx - address of parameters in our address space
mov eax,[new_process_place]
call write_process_memory ;copy parameters to new process address space
.no_command_line:
;******************************************************************
mov edx,[app_i_icon]
test edx,edx
jz .no_command_line_1 ;application don't need path of file
mov ebx,[appl_path]
mov ecx,[appl_path_size]
mov eax,[new_process_place]
call write_process_memory ;copy path of file to new process address space
.no_command_line_1:
;******************************************************************
mov ebx,[new_process_place]
mov eax,ebx
shl ebx,5
mov [ebx+window_data+WDATA.fl_wstate],WSTATE_NORMAL
mov [ebx+window_data+WDATA.fl_redraw],1
add ebx,0x3000 ;ebx - pointer to information about process
mov [ebx+TASKDATA.wnd_number],al ;set window number on screen = process slot
mov [ebx+TASKDATA.event_mask],dword 1+2+4 ;set default event flags (see 40 function)
inc dword [process_number]
mov eax,[process_number]
mov [ebx+TASKDATA.pid],eax ;set PID
mov ecx,ebx
add ecx,draw_data-0x3000 ;ecx - pointer to draw data
;set draw data to full screen
mov [ecx+RECT.left],dword 0
mov [ecx+RECT.top],dword 0
mov eax,[0xfe00]
mov [ecx+RECT.right],eax
mov eax,[0xfe04]
mov [ecx+RECT.bottom],eax
;set cr3 register in TSS of application
mov ecx,[new_process_place]
shl ecx,8
mov eax,[0x80000+APPDATA.dir_table+ecx]
add eax,8+16 ;add flags
mov [l.cr3],eax
mov eax,[app_start]
mov [l.eip],eax ;set eip in TSS
mov eax,[app_esp]
mov [l.esp],eax ;set stack in TSS
;gdt
;mov ebx,[new_process_place]
;shl ebx,3
mov ax,app_code ;ax - selector of code segment
;add ax,bx
mov [l.cs],ax
mov ax,app_data
;add ax,bx ;ax - selector of data segment
mov [l.ss],ax
mov [l.ds],ax
mov [l.es],ax
mov [l.fs],ax
mov ax,graph_data ;ax - selector of graphic segment
mov [l.gs],ax
mov [l.io],word 128
mov [l.eflags],dword 0x11202
mov [l.ss0],os_data
mov ebx,[new_process_place]
shl ebx,12
add ebx,sysint_stack_data+4096
mov [l.esp0],ebx
 
;copy tss to it place
mov eax,tss_sceleton
mov ebx,[new_process_place]
imul ebx,tss_step
add ebx,tss_data ;ebx - address of application TSS
mov ecx,120
call memmove
;Add IO access table - bit array of permitted ports
or eax,-1
mov edi,[new_process_place]
imul edi,tss_step
add edi,tss_data+128
mov ecx,2048
cld
rep stosd ;full access to 2048*8=16384 ports
mov ecx,ebx ;ecx - address of application TSS
mov edi,[new_process_place]
shl edi,3
;set TSS descriptor
mov [edi+gdts+tss0+0],word tss_step ;limit (size)
mov [edi+gdts+tss0+2],cx ;part of offset
mov eax,ecx
shr eax,16
mov [edi+gdts+tss0+4],al ;part of offset
mov [edi+gdts+tss0+7],ah ;part of offset
mov [edi+gdts+tss0+5],word 01010000b*256+11101001b ;system flags
 
;flush keyboard and buttons queue
mov [0xf400],byte 0
mov [0xf500],byte 0
 
mov edi,[new_process_place]
shl edi,5
add edi,window_data
mov ebx,[new_process_place]
movzx esi,word [0xC000+ebx*2]
lea esi,[0xC400+esi*2]
call windowactivate ;gui initialization
 
mov ebx,[new_process_place]
shl ebx,5
; set if debuggee
test byte [esp+28], 1
jz .no_debug
mov [0x3000+ebx+TASKDATA.state], 1 ; set process state - suspended
mov eax, [0x3000]
mov [0x80000+ebx*8+APPDATA.debugger_slot], eax ;set debugger PID - current
jmp .debug
.no_debug:
mov [0x3000+ebx+TASKDATA.state], 0 ; set process state - running
.debug:
mov esi,new_process_running
call sys_msg_board_str ;output information about succefull startup
; add esp,4 ;pop pointer to parameters
; popad
mov eax,[process_number] ;set result
mov [application_table_status],0 ;unlock application_table_status mutex
call safe_sti
ret 4
 
end if
/kernel/tags/kolibri0.6.0.0/core/sys32.inc
0,0 → 1,1006
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; MenuetOS process management, protected ring3 ;;
;; ;;
;; Distributed under GPL. See file COPYING for details. ;;
;; Copyright 2003 Ville Turjanmaa ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
align 32
 
; GDT TABLE
 
gdts:
 
dw gdte-$-1
dd gdts
dw 0
 
int_code_l:
os_code_l:
 
dw 0xffff
dw 0x0000
db 0x00
dw 11011111b *256 +10011010b
db 0x00
 
int_data_l:
os_data_l:
 
dw 0xffff
dw 0x0000
db 0x00
dw 11011111b *256 +10010010b
db 0x00
 
; --------------- APM ---------------------
apm_code_32:
dw 0x10 ; limit 64kb
db 0, 0, 0
dw 11011111b *256 +10011010b
db 0x00
apm_code_16:
dw 0x10
db 0, 0, 0
dw 10011111b *256 +10011010b
db 0x00
apm_data_16:
dw 0x10
db 0, 0, 0
dw 10011111b *256 +10010010b
db 0x00
; -----------------------------------------
 
app_code_l:
dw ((0x80000000-std_application_base_address) shr 12) and 0xffff
dw 0
db 0
dw 11010000b*256+11111010b+256*((0x80000000-std_application_base_address) shr 28)
db std_application_base_address shr 24
 
app_data_l:
dw (0x80000000-std_application_base_address) shr 12 and 0xffff
dw 0
db 0
dw 11010000b*256+11110010b+256*((0x80000000-std_application_base_address) shr 28)
db std_application_base_address shr 24
 
graph_data_l:
 
dw 0x3ff
dw 0x0000
db 0x00
dw 11010000b *256 +11110010b
db 0x00
 
tss0_l:
times (max_processes+10) dd 0,0
 
gdte:
 
 
 
idtreg:
dw 8*0x41-1
dd idts+8
label idts at 0xB100-8
 
 
 
uglobal
tss_sceleton:
l.back dw 0,0
l.esp0 dd 0
l.ss0 dw 0,0
l.esp1 dd 0
l.ss1 dw 0,0
l.esp2 dd 0
l.ss2 dw 0,0
l.cr3 dd 0
l.eip dd 0
l.eflags dd 0
l.eax dd 0
l.ecx dd 0
l.edx dd 0
l.ebx dd 0
l.esp dd 0
l.ebp dd 0
l.esi dd 0
l.edi dd 0
l.es dw 0,0
l.cs dw 0,0
l.ss dw 0,0
l.ds dw 0,0
l.fs dw 0,0
l.gs dw 0,0
l.ldt dw 0,0
l.trap dw 0
l.io dw 0
endg
 
 
build_process_gdt_tss_pointer:
 
mov ecx,tss_data
mov edi,0
setgdtl2:
mov [edi+gdts+ tss0 +0], word tss_step
mov [edi+gdts+ tss0 +2], cx
mov eax,ecx
shr eax,16
mov [edi+gdts+ tss0 +4], al
mov [edi+gdts+ tss0 +7], ah
mov [edi+gdts+ tss0 +5], word 01010000b *256 +11101001b
add ecx,tss_step
add edi,8
cmp edi,8*(max_processes+5)
jbe setgdtl2
 
ret
 
 
build_interrupt_table:
 
mov edi, idts+8
mov esi, sys_int
mov ecx, 0x40
@@:
mov eax, [esi]
mov [edi], ax ; lower part of offset
mov [edi+2], word os_code ; segment selector
shr eax, 16
mov [edi+4], word 10001110b shl 8 ; interrupt descriptor
mov [edi+6], ax
add esi, 4
add edi, 8
dec ecx
jnz @b
;mov edi,8*0x40+idts+8
mov [edi + 0], word (i40 and ((1 shl 16)-1))
mov [edi + 2], word os_code
mov [edi + 4], word 11101110b*256
mov [edi + 6], word (i40 shr 16)
 
ret
 
 
 
iglobal
sys_int:
dd e0,debug_exc,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15
dd e16,e17
times 14 dd unknown_interrupt
 
dd irq0 ,irq1 ,p_irq2 ,p_irq3 ,p_irq4 ,p_irq5,p_irq6 ,p_irq7
dd p_irq8,p_irq9,p_irq10,p_irq11,p_irq12,irqD ,p_irq14,p_irq15
 
times 16 dd unknown_interrupt
 
dd i40
endg
 
macro save_ring3_context
{
push ds es
pushad
}
macro restore_ring3_context
{
popad
pop es ds
}
 
; simply return control to interrupted process
unknown_interrupt:
iret
 
macro exc_wo_code [num]
{
forward
e#num :
save_ring3_context
mov bl, num
jmp exc_c
}
 
macro exc_w_code [num]
{
forward
e#num :
add esp, 4
save_ring3_context
mov bl, num
jmp exc_c
}
 
exc_wo_code 0, 1, 2, 3, 4, 5, 6, 9, 15, 16 ; 18, 19
exc_w_code 8, 10, 11, 12, 13, 14, 17
 
exc_c:
mov ax, os_data
mov ds, ax
mov es, ax
 
; test if debugging
cli
mov eax, [0x3000]
shl eax, 8
mov eax, [0x80000+eax+APPDATA.debugger_slot]
test eax, eax
jnz .debug
sti
; not debuggee => say error and terminate
add esp, 28h
movzx eax, bl
mov [error_interrupt], eax
call show_error_parameters
mov edx, [0x3010]
mov [edx + TASKDATA.state], byte 4
jmp change_task
 
.debug:
; we are debugged process, notify debugger and suspend ourself
; eax=debugger PID
cld
movzx ecx, bl
push ecx
mov ecx, [0x3010]
push dword [ecx+TASKDATA.pid] ; PID of current process
push 12
pop ecx
push 1 ; 1=exception
call debugger_notify
pop ecx
pop ecx
pop ecx
mov edx, [0x3010]
mov byte [edx+TASKDATA.state], 1 ; suspended
call change_task
restore_ring3_context
iretd
 
;;;;;;;;;;;;;;;;;;;;;;;
;; FPU ERROR HANDLER ;;
;;;;;;;;;;;;;;;;;;;;;;;
 
align 4
e7:
save_ring3_context
clts
mov ax, os_data
mov ds, ax
mov es, ax
mov eax, [prev_user_of_fpu]
shl eax, 8
add eax, 0x80000 + APPDATA.fpu_save_area
fsave [eax]
mov eax, [0x3000]
mov [prev_user_of_fpu], eax
shl eax, 8
add eax, 0x80000
cmp [eax + APPDATA.is_fpu_saved], 0
je @f
frstor [eax+APPDATA.fpu_save_area]
@@:
mov [eax + APPDATA.is_fpu_saved], 1
restore_ring3_context
iret
iglobal
prev_user_of_fpu dd 1
endg
 
 
writehex:
pusha
mov edi, [write_error_to]
mov esi, 8
@@:
mov ecx, eax
and ecx, 0xf
 
mov cl,[ecx+hexletters]
mov [edi],cl
dec edi
 
shr eax,4
dec esi
jnz @b
 
popa
ret
 
iglobal
hexletters db '0123456789ABCDEF'
 
error_interrupt dd -1
 
process_error db 'K : Process - forced terminate INT: 00000000',13,10,0
process_pid db 'K : Process - forced terminate PID: 00000000',13,10,0
process_eip db 'K : Process - forced terminate EIP: 00000000',13,10,0
system_error db 'K : Kernel error',13,10,0
endg
 
uglobal
write_error_to dd 0x0
endg
 
show_error_parameters:
mov [write_error_to],process_pid+43
mov eax,[0x3000]
shl eax, 5
mov eax,[0x3000+TASKDATA.pid+eax]
call writehex
mov [write_error_to],process_error+43
mov eax,[error_interrupt]
call writehex
 
cmp dword [esp+4+4], os_code ; CS
jnz @f
mov esi,system_error
call sys_msg_board_str
@@:
mov eax, [esp+4] ; EIP
 
mov [write_error_to],process_eip+43
call writehex
 
mov esi,process_error
call sys_msg_board_str
 
mov esi,process_pid
call sys_msg_board_str
 
mov esi,process_eip
call sys_msg_board_str
 
ret
 
 
 
; irq1 -> hid/keyboard.inc
 
 
macro irqh [num]
{
forward
p_irq#num :
save_ring3_context
mov edi, num
jmp irq_c
}
 
irqh 2,5,7,8,9,10,11,14,15
 
irq_c:
mov ax, os_data
mov ds, ax
mov es, ax
call irqhandler
restore_ring3_context
iret
 
p_irq6:
save_ring3_context
mov ax, os_data
mov ds, ax
mov es, ax
call fdc_irq
call ready_for_next_irq
restore_ring3_context
iret
 
p_irq3:
save_ring3_context
mov ax, os_data
mov ds, ax
mov es, ax
cmp [com2_mouse_detected],0
je old_irq3_handler
call check_mouse_data_com2
jmp p_irq3_1
old_irq3_handler:
mov edi,3
call irqhandler
p_irq3_1:
restore_ring3_context
iret
 
p_irq4:
save_ring3_context
mov ax, os_data
mov ds, ax
mov es, ax
cmp [com1_mouse_detected],0
je old_irq4_handler
call check_mouse_data_com1
jmp p_irq4_1
old_irq4_handler:
mov edi,4
call irqhandler
p_irq4_1:
restore_ring3_context
iret
 
p_irq12:
save_ring3_context
mov ax, os_data
mov ds, ax
mov es, ax
call check_mouse_data_ps2
restore_ring3_context
iret
 
ready_for_next_irq:
mov [check_idle_semaphore],5
mov al, 0x20
out 0x20, al
ret
 
ready_for_next_irq_1:
mov [check_idle_semaphore],5
mov al, 0x20
out 0xa0,al
out 0x20, al
ret
 
irqD:
save_ring3_context
mov ax, os_data
mov ds, ax
mov es, ax
mov dx,0xf0
mov al,0
out dx,al
 
mov dx,0xa0
mov al,0x20
out dx,al
mov dx,0x20
out dx,al
 
restore_ring3_context
iret
 
 
irqhandler:
 
push edi
 
mov esi,edi ; 1
shl esi,6 ; 1
add esi,irq00read ; 1
shl edi,12 ; 1
add edi,0x2E0000
mov ecx,16
 
mov [check_idle_semaphore],5
 
irqnewread:
dec ecx
js irqover
 
mov dx,[esi] ; 2+
 
cmp dx,0 ; 1
jz irqover
cmp [esi+3],byte 1 ; 2 ; byte read
jne noirqbyte ; 4-11
 
in al,dx
 
mov edx,[edi]
cmp edx,4000
je irqfull
mov ebx,edi
add ebx,0x10
add ebx,edx
mov [ebx],al
inc edx
mov [edi],edx
 
add esi,4
jmp irqnewread
 
noirqbyte:
 
 
cmp [esi+3],byte 2 ; word read
jne noirqword
 
in ax,dx
 
mov edx,[edi]
cmp edx,4000
je irqfull
mov ebx,edi
add ebx,0x10
add ebx,edx
mov [ebx],ax
add edx,2
mov [edi],edx
add esi,4
jmp irqnewread
 
noirqword:
irqfull:
irqover:
 
mov al,0x20 ; ready for next irq
out 0x20,al
 
pop ebx
cmp ebx,7
jbe noa0
out 0xa0,al
noa0:
 
ret
 
 
 
set_application_table_status:
push eax
 
mov eax,[0x3000]
shl eax, 5
add eax,0x3000+TASKDATA.pid
mov eax,[eax]
 
mov [application_table_status],eax
 
pop eax
 
ret
 
 
clear_application_table_status:
push eax
 
mov eax,[0x3000]
shl eax, 5
add eax,0x3000+TASKDATA.pid
mov eax,[eax]
 
cmp eax,[application_table_status]
jne apptsl1
mov [application_table_status],0
apptsl1:
 
pop eax
 
ret
 
 
 
sys_resize_app_memory:
; eax = 1 - resize
; ebx = new amount of memory
 
cmp eax,1
jne .no_application_mem_resize
jmp new_mem_resize ;resize for new type of processes
 
 
.no_application_mem_resize:
 
ret
 
 
 
get_app_params:
 
push eax
 
cmp [0x90000+6],word '00'
jne no_00_header
 
mov eax,[0x90000+12]
mov [app_start],eax
mov eax,[0x90000+16]
mov [app_i_end],eax
mov eax,[0x90000+20]
mov [app_mem],eax
; \begin{diamond}[20.08.2006]
; sanity check (functions 19,58 load app_i_end bytes and that must
; fit in allocated memory to prevent kernel faults)
cmp eax,[app_i_end]
jb no_01_header
; \end{diamond}[20.08.2006]
shr eax,1
sub eax,0x10
mov [app_esp],eax
mov eax,[0x90000+24]
mov [app_i_param],eax
mov [app_i_icon],dword 0
 
pop eax
clc
ret
 
no_00_header:
 
 
cmp [0x90000+6],word '01'
jne no_01_header
 
mov eax,[0x90000+12]
mov [app_start],eax
mov eax,[0x90000+16]
mov [app_i_end],eax
mov eax,[0x90000+20]
mov [app_mem],eax
; \begin{diamond}[20.08.2006]
cmp eax,[app_i_end]
jb no_01_header
; \end{diamond}[20.08.2006]
mov eax,[0x90000+24]
mov [app_esp],eax
mov eax,[0x90000+28]
mov [app_i_param],eax
mov eax,[0x90000+32]
mov [app_i_icon],eax
 
pop eax
clc
ret
 
no_01_header:
 
pop eax
stc
ret
 
 
uglobal
new_process_place dd 0x0
app_start dd 0x0
app_i_end dd 0x0
app_mem dd 0x0
app_esp dd 0x0
app_i_param dd 0x0
app_i_icon dd 0x0
;app_mem_pos dd 0x0
appl_path dd 0x0
appl_path_size dd 0x0
endg
 
 
sys_threads:
 
; eax=1 create thread
;
; ebx=thread start
; ecx=thread stack value
;
; on return : eax = pid
jmp new_sys_threads
 
iglobal
process_terminating db 'K : Process - terminating',13,10,0
process_terminated db 'K : Process - done',13,10,0
endg
 
 
terminate: ; terminate application
push esi
mov esi,process_terminating
call sys_msg_board_str
pop esi
 
@@:
cli
cmp [application_table_status],0
je term9
sti
call change_task
jmp @b
term9:
 
call set_application_table_status
mov eax,esi
call dispose_app_cr3_table
 
cmp [prev_user_of_fpu],esi ; if user fpu last -> fpu user = 1
jne fpu_ok_1
mov [prev_user_of_fpu],1
fpu_ok_1:
 
mov [0xf400],byte 0 ; empty keyboard buffer
mov [0xf500],byte 0 ; empty button buffer
 
 
; remove defined hotkeys
mov eax, hotkey_list
.loop:
cmp [eax+8], esi
jnz .cont
mov ecx, [eax]
jecxz @f
push dword [eax+12]
pop dword [ecx+12]
@@:
mov ecx, [eax+12]
push dword [eax]
pop dword [ecx]
xor ecx, ecx
mov [eax], ecx
mov [eax+4], ecx
mov [eax+8], ecx
mov [eax+12], ecx
.cont:
add eax, 16
cmp eax, hotkey_list+256*16
jb .loop
; remove hotkeys in buffer
mov eax, hotkey_buffer
.loop2:
cmp [eax], esi
jnz .cont2
and dword [eax+4], 0
and dword [eax], 0
.cont2:
add eax, 8
cmp eax, hotkey_buffer+120*8
jb .loop2
 
mov ecx,esi ; remove buttons
bnewba2:
mov edi,[0xfe88]
mov eax,edi
cld
movzx ebx,word [edi]
inc bx
bnewba:
dec bx
jz bnmba
add eax,0x10
cmp cx,[eax]
jnz bnewba
pusha
mov ecx,ebx
inc ecx
shl ecx,4
mov ebx,eax
add eax,0x10
call memmove
dec dword [edi]
popa
jmp bnewba2
bnmba:
 
pusha ; save window coordinates for window restoring
cld
shl esi,5
add esi,window_data
mov eax,[esi+WDATA.box.left]
mov [dlx],eax
add eax,[esi+WDATA.box.width]
mov [dlxe],eax
mov eax,[esi+WDATA.box.top]
mov [dly],eax
add eax,[esi+WDATA.box.height]
mov [dlye],eax
 
xor eax, eax
mov [esi+WDATA.box.left],eax
mov [esi+WDATA.box.width],eax
mov [esi+WDATA.box.top],eax
mov [esi+WDATA.box.height],eax
mov [esi+WDATA.cl_workarea],eax
mov [esi+WDATA.cl_titlebar],eax
mov [esi+WDATA.cl_frames],eax
mov dword [esi+WDATA.reserved],eax ; clear all flags: wstate, redraw, wdrawn
lea edi, [esi-window_data+draw_data]
mov ecx,32/4
rep stosd
popa
 
; debuggee test
pushad
mov edi, esi
shl edi, 5
mov eax, [0x80000+edi*8+APPDATA.debugger_slot]
test eax, eax
jz .nodebug
push 8
pop ecx
push dword [0x3000+edi+TASKDATA.pid] ; PID
push 2
call debugger_notify
pop ecx
pop ecx
.nodebug:
popad
 
pusha ; at 0x80000+
mov edi,esi
shl edi,8
add edi,0x80000
mov ecx,256/4
xor eax, eax
rep stosd
popa
 
pusha ; name to spaces
mov edi,esi
shl edi,8
add edi,0x80000+APPDATA.app_name
mov ecx,11
mov eax,' '
rep stosb
popa
 
 
; activate window
movzx eax, word [0xC000 + esi*2]
cmp eax, [0x3004]
jne .dont_activate
pushad
.check_next_window:
dec eax
cmp eax, 1
jbe .nothing_to_activate
lea esi, [0xc400+eax*2]
movzx edi, word [esi] ; edi = process
shl edi, 5
cmp [0x3000 + edi + TASKDATA.state], byte 9 ; skip dead slots
je .check_next_window
add edi, window_data
call waredraw
.nothing_to_activate:
popad
.dont_activate:
 
push esi ; remove hd1 & cd & flp reservation
shl esi, 5
mov esi, [esi+0x3000+TASKDATA.pid]
cmp [hd1_status], esi
jnz @f
mov [hd1_status], 0
@@:
cmp [cd_status], esi
jnz @f
mov [cd_status], 0
@@:
cmp [flp_status], esi
jnz @f
mov [flp_status], 0
@@:
pop esi
 
pusha ; remove all irq reservations
mov eax,esi
shl eax, 5
mov eax,[eax+0x3000+TASKDATA.pid]
mov edi,irq_owner
mov ecx,16
newirqfree:
scasd
jne nofreeirq
mov [edi-4],dword 0
nofreeirq:
loop newirqfree
popa
 
 
pusha ; remove all port reservations
mov edx,esi
shl edx, 5
add edx,0x3000
mov edx,[edx+TASKDATA.pid]
 
rmpr0:
 
mov esi,[0x2d0000]
 
cmp esi,0
je rmpr9
 
rmpr3:
 
mov edi,esi
shl edi,4
add edi,0x2d0000
 
cmp edx,[edi]
je rmpr4
 
dec esi
jnz rmpr3
 
jmp rmpr9
 
rmpr4:
 
mov ecx,256
sub ecx,esi
shl ecx,4
 
mov esi,edi
add esi,16
cld
rep movsb
 
dec dword [0x2d0000]
 
jmp rmpr0
 
rmpr9:
 
popa
mov edi,esi ; do not run this process slot
shl edi, 5
mov [edi+0x3000 + TASKDATA.state],byte 9
; debugger test - terminate all debuggees
mov eax, 2
mov ecx, 0x80000+2*0x100+APPDATA.debugger_slot
.xd0:
cmp eax, [0x3004]
ja .xd1
cmp dword [ecx], esi
jnz @f
and dword [ecx], 0
pushad
xchg eax, ebx
mov eax, 2
call sys_system
popad
@@:
inc eax
add ecx, 0x100
jmp .xd0
.xd1:
; call systest
sti ; .. and life goes on
 
mov eax, [dlx]
mov ebx, [dly]
mov ecx, [dlxe]
mov edx, [dlye]
call calculatescreen
xor eax, eax
xor esi, esi
call redrawscreen
 
mov [0xfff4],byte 0 ; no mouse background
mov [0xfff5],byte 0 ; draw mouse
 
mov [application_table_status],0
mov esi,process_terminated
call sys_msg_board_str
 
ret
 
iglobal
boot_sched_1 db 'Building gdt tss pointer',0
boot_sched_2 db 'Building IDT table',0
endg
 
 
build_scheduler:
 
mov esi,boot_sched_1
call boot_log
call build_process_gdt_tss_pointer
 
mov esi,boot_sched_2
call boot_log
call build_interrupt_table
 
ret
 
/kernel/tags/kolibri0.6.0.0/core/syscall.inc
0,0 → 1,151
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; SYSTEM CALL ENTRY ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
align 32
i40:
push ds es
pushad
cld
 
mov ax,word os_data
mov ds,ax
mov es,ax
 
; for syscall trace function
call save_registers
 
; load all registers in crossed order
mov edi,[esp+28] ; eax
mov eax,[esp+16] ; ebx
mov ebx,[esp+24] ; ecx
mov ecx,[esp+20] ; edx
mov edx,[esp+4] ; esi
mov esi,[esp+0] ; edi
 
; enable interupts - a task switch or an IRQ _CAN_ interrupt i40 handler
sti
push eax
and edi,0xff
call dword [servetable+edi*4]
pop eax
cli
popad
pop es ds
iretd
 
align 4
save_registers:
mov esi, [0x3010]
mov eax, [esi+TASKDATA.pid] ; load PID
lea esi, [esp+4]
inc [save_syscall_count]
mov edi,[save_syscall_count]
and edi,0xF
shl edi,6
add edi,save_syscall_data+32
mov [edi-32],eax
mov ecx,32 / 4
cld
rep movsd
ret
 
uglobal
save_syscall_count dd 0x0
endg
 
label save_syscall_data dword at 0x5000
 
 
iglobal
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SYSTEM FUNCTIONS TABLE ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
align 4
servetable:
 
dd sys_drawwindow ; 0-DrawWindow
dd syscall_setpixel ; 1-SetPixel
dd sys_getkey ; 2-GetKey
dd sys_clock ; 3-GetTime
dd syscall_writetext ; 4-WriteText
dd delay_hs ; 5-DelayHs
dd syscall_openramdiskfile ; 6-OpenRamdiskFile
dd syscall_putimage ; 7-PutImage
dd sys_button ; 8-DefineButton
dd sys_cpuusage ; 9-GetProcessInfo
dd sys_waitforevent ; 10-WaitForEvent
dd sys_getevent ; 11-CheckForEvent
dd sys_redrawstat ; 12-BeginDraw and EndDraw
dd syscall_drawrect ; 13-DrawRect
dd syscall_getscreensize ; 14-GetScreenSize
dd sys_background ; 15-bgr
dd sys_cachetodiskette ; 16-FlushFloppyCache
dd sys_getbutton ; 17-GetButton
dd sys_system ; 18-System Services
dd undefined_syscall ; 19-reserved
dd sys_midi ; 20-ResetMidi and OutputMidi
dd sys_setup ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,.
dd sys_settime ; 22-setting date,time,clock and alarm-clock
dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent
dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist
dd sys_sb16 ; 25-SetSb16
dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,.
dd sys_wss ; 27-SetWssMainVol and SetWssCdVol
dd sys_sb16II ; 28-SetSb16
dd sys_date ; 29-GetDate
; dd syscall_readhd ; 30-ReadHd - obsolete <diamond>
dd undefined_syscall ; 30-reserved
; dd syscall_starthdapp ; 31-StartHdApp - obsolete <diamond>
dd undefined_syscall ; 31-reserved
dd syscall_delramdiskfile ; 32-DelRamdiskFile
dd syscall_writeramdiskfile; 33-WriteRamdiskFile
; dd read_floppy_file ; 34-ReadFloppyDrive - obsolete <diamond>
dd undefined_syscall ; 34-reserved
dd syscall_getpixel ; 35-GetPixel
dd syscall_readstring ; 36-ReadString (not yet ready)
dd readmousepos ; 37-GetMousePosition_ScreenRelative,.
dd syscall_drawline ; 38-DrawLine
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,.
dd set_app_param ; 40-WantEvents
dd syscall_getirqowner ; 41-GetIrqOwner
dd get_irq_data ; 42-ReadIrqData
dd sys_outport ; 43-SendDeviceData
dd sys_programirq ; 44-ProgramIrqs
dd reserve_free_irq ; 45-ReserveIrq and FreeIrq
dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea
dd display_number ; 47-WriteNum
dd display_settings ; 48-SetRedrawType and SetButtonType
dd sys_apm ; 49-Advanced Power Management (APM)
dd random_shaped_window ; 50-Window shape & scale
dd syscall_threads ; 51-Threads
dd stack_driver_stat ; 52-Stack driver status
dd socket ; 53-Socket interface
dd user_events ; 54-User events
dd sound_interface ; 55-Sound interface
dd write_to_hd ; 56-Write a file to hd
; dd delete_from_hd ; 57-Delete a file from hd - obsolete <diamond>
dd undefined_syscall ; 57-reserved
dd file_system ; 58-Common file system interface
dd sys_trace ; 59-System call trace
dd new_sys_ipc ; 60-Inter Process Communication
dd sys_gs ; 61-Direct graphics access
dd sys_pci ; 62-PCI functions
dd sys_msg_board ; 63-System message board
dd sys_resize_app_memory ; 64-Resize application memory usage
dd undefined_syscall ; 65-UTF
dd sys_process_def ; 66-Process definitions - keyboard
dd sys_window_move ; 67-Window move or resize
dd sys_internal_services ; 68-Some internal services
dd sys_debug_services ; 69-Debug
dd file_system_lfn ; 70-Common file system interface, version 2
dd syscall_windowsettings ; 71-Window settings
 
times 255 - ( ($-servetable) /4 ) dd undefined_syscall
 
dd sys_end ; -1-end application
endg
/kernel/tags/kolibri0.6.0.0/core/debug.inc
0,0 → 1,499
; diamond, 2006
sys_debug_services:
cmp eax, 9
ja @f
jmp dword [sys_debug_services_table+eax*4]
@@: ret
sys_debug_services_table:
dd debug_set_event_data
dd debug_getcontext
dd debug_setcontext
dd debug_detach
dd debug_suspend
dd debug_resume
dd debug_read_process_memory
dd debug_write_process_memory
dd debug_terminate
dd debug_set_drx
 
debug_set_event_data:
; in: ebx = pointer
; destroys eax
mov eax, [0x3000]
shl eax, 8
mov [eax+0x80000+APPDATA.dbg_event_mem], ebx
ret
 
get_debuggee_slot:
; in: ebx=PID
; out: CF=1 if error
; CF=0 and eax=slot*0x20 if ok
; out: interrupts disabled
cli
mov eax, ebx
call pid_to_slot
test eax, eax
jz .ret_bad
shl eax, 5
push ebx
mov ebx, [0x3000]
cmp [0x80000+eax*8+APPDATA.debugger_slot], ebx
pop ebx
jnz .ret_bad
; clc ; automatically
ret
.ret_bad:
stc
ret
 
debug_detach:
; in: ebx=pid
; destroys eax,ebx
call get_debuggee_slot
jc .ret
and dword [eax*8+0x80000+APPDATA.debugger_slot], 0
call do_resume
.ret:
sti
ret
 
debug_terminate:
; in: ebx=pid
call get_debuggee_slot
jc debug_detach.ret
mov ebx, eax
shr ebx, 5
push 2
pop eax
jmp sys_system
 
debug_suspend:
; in: ebx=pid
; destroys eax,ebx
call get_debuggee_slot
jc .ret
mov bl, [0x3000+eax+TASKDATA.state] ; process state
test bl, bl
jz .1
cmp bl, 5
jnz .ret
mov bl, 2
.2: mov [0x3000+eax+TASKDATA.state], bl
.ret:
sti
ret
.1:
inc ebx
jmp .2
 
do_resume:
mov bl, [0x3000+eax+TASKDATA.state]
cmp bl, 1
jz .1
cmp bl, 2
jnz .ret
mov bl, 5
.2: mov [0x3000+eax+TASKDATA.state], bl
.ret: ret
.1: dec ebx
jmp .2
 
debug_resume:
; in: ebx=pid
; destroys eax,ebx
call get_debuggee_slot
jc .ret
call do_resume
.ret: sti
ret
 
debug_getcontext:
; in:
; ebx=pid
; ecx=sizeof(CONTEXT)
; edx->CONTEXT
; destroys eax,ecx,edx,esi,edi
cmp ecx, 28h
jnz .ret
add edx, std_application_base_address
push ebx
mov ebx, edx
call check_region
pop ebx
dec eax
jnz .ret
call get_debuggee_slot
jc .ret
imul eax, tss_step/32
add eax, tss_data
mov edi, edx
cmp [l.cs - tss_sceleton + eax], app_code
jnz .ring0
lea esi, [l.eip - tss_sceleton + eax]
shr ecx, 2
rep movsd
jmp .ret
.ring0:
; note that following code assumes that all interrupt/exception handlers
; saves ring-3 context by push ds es, pushad in this order
mov esi, [l.esp0 - tss_sceleton + eax]
; top of ring0 stack: ring3 stack ptr (ss+esp), iret data (cs+eip+eflags), ds, es, pushad
sub esi, 8+12+8+20h
lodsd
mov [edi+24h], eax
lodsd
mov [edi+20h], eax
lodsd
mov [edi+1Ch], eax
lodsd
lodsd
mov [edi+14h], eax
lodsd
mov [edi+10h], eax
lodsd
mov [edi+0Ch], eax
lodsd
mov [edi+8], eax
add esi, 8
lodsd
mov [edi], eax
lodsd
lodsd
mov [edi+4], eax
lodsd
mov [edi+18h], eax
.ret:
sti
ret
 
debug_setcontext:
; in:
; ebx=pid
; ecx=sizeof(CONTEXT)
; edx->CONTEXT
; destroys eax,ecx,edx,esi,edi
cmp ecx, 28h
jnz .ret
add edx, std_application_base_address
push ebx
mov ebx, edx
call check_region
pop ebx
dec eax
jnz .ret
call get_debuggee_slot
jc .stiret
imul eax, tss_step/32
add eax, tss_data
mov esi, edx
cmp [l.cs - tss_sceleton + eax], app_code
jnz .ring0
lea edi, [l.eip - tss_sceleton + eax]
shr ecx, 2
rep movsd
jmp .stiret
.ring0:
mov edi, [l.esp0 - tss_sceleton + eax]
sub edi, 8+12+8+20h
mov eax, [esi+24h]
stosd
mov eax, [esi+20h]
stosd
mov eax, [esi+1Ch]
stosd
scasd
mov eax, [esi+14h]
stosd
mov eax, [esi+10h]
stosd
mov eax, [esi+0Ch]
stosd
mov eax, [esi+8]
stosd
add edi, 8
mov eax, [esi]
stosd
scasd
mov eax, [esi+4]
stosd
mov eax, [esi+18h]
stosd
.stiret:
sti
.ret:
ret
 
debug_set_drx:
call get_debuggee_slot
jc .errret
mov ebp, eax
lea eax, [eax*8+0x80000+APPDATA.dbg_regs]
; [eax]=dr0, [eax+4]=dr1, [eax+8]=dr2, [eax+C]=dr3
; [eax+10]=dr7
add edx, std_application_base_address
jc .errret
cmp cl, 3
ja .errret
mov ebx, dr7
shr ebx, cl
shr ebx, cl
test ebx, 2 ; bit 1+2*index = G0..G3, global break enable
jnz .errret2
test ch, ch
jns .new
; clear breakpoint
movzx ecx, cl
add ecx, ecx
and dword [eax+ecx*2], 0 ; clear DR<i>
btr dword [eax+10h], ecx ; clear L<i> bit
test byte [eax+10h], 55h
jnz .okret
imul eax, ebp, tss_step/32
and byte [eax + tss_data + l.trap - tss_sceleton], not 1
.okret:
and dword [esp+36], 0
sti
ret
.errret:
sti
mov dword [esp+36], 1
ret
.errret2:
sti
mov dword [esp+36], 2
ret
.new:
; add new breakpoint
; cl=index; ch=flags; edx=address
test ch, 0xF0
jnz .errret
mov bl, ch
and bl, 3
cmp bl, 2
jz .errret
mov bl, ch
shr bl, 2
cmp bl, 2
jz .errret
test dl, bl
jnz .errret
or byte [eax+10h+1], 3 ; set GE and LE flags
movzx ebx, ch
movzx ecx, cl
add ecx, ecx
bts dword [eax+10h], ecx ; set L<i> flag
add ecx, ecx
mov [eax+ecx], edx ; set DR<i>
shl ebx, cl
mov edx, 0xF
shl edx, cl
not edx
and [eax+10h+2], dx
or [eax+10h+2], bx ; set R/W and LEN fields
imul eax, ebp, tss_step/32
or byte [eax + tss_data + l.trap - tss_sceleton], 1
jmp .okret
 
debug_read_process_memory:
; in:
; ebx=pid
; ecx=length
; esi->buffer in debugger
; edx=address in debuggee
; out: [esp+36]=sizeof(read)
; destroys all
add esi, std_application_base_address
push ebx
mov ebx, esi
call check_region
pop ebx
dec eax
jnz .err
call get_debuggee_slot
jc .err
shr eax, 5
mov ebx, esi
call read_process_memory
sti
mov dword [esp+36], eax
ret
.err:
or dword [esp+36], -1
ret
 
debug_write_process_memory:
; in:
; ebx=pid
; ecx=length
; esi->buffer in debugger
; edx=address in debuggee
; out: [esp+36]=sizeof(write)
; destroys all
add esi, std_application_base_address
push ebx
mov ebx, esi
call check_region
pop ebx
dec eax
jnz debug_read_process_memory.err
call get_debuggee_slot
jc debug_read_process_memory.err
shr eax, 5
mov ebx, esi
call write_process_memory
sti
mov [esp+36], eax
ret
 
debugger_notify:
; in: eax=debugger slot
; ecx=size of debug message
; [esp+4]..[esp+4+ecx]=message
; interrupts must be disabled!
; destroys all general registers
; interrupts remain disabled
xchg ebp, eax
mov edi, [timer_ticks]
add edi, 500 ; 5 sec timeout
.1:
mov eax, ebp
shl eax, 8
mov edx, [0x80000+eax+APPDATA.dbg_event_mem]
test edx, edx
jz .ret
; read buffer header
push ecx
push eax
push eax
mov eax, ebp
mov ebx, esp
mov ecx, 8
call read_process_memory
cmp eax, ecx
jz @f
add esp, 12
jmp .ret
@@:
cmp dword [ebx], 0
jg @f
.2:
pop ecx
pop ecx
pop ecx
cmp dword [0x3000], 1
jnz .notos
cmp [timer_ticks], edi
jae .ret
.notos:
sti
call change_task
cli
jmp .1
@@:
mov ecx, [ebx+8]
add ecx, [ebx+4]
cmp ecx, [ebx]
ja .2
; advance buffer position
push ecx
mov ecx, 4
sub ebx, ecx
mov eax, ebp
add edx, ecx
call write_process_memory
pop eax
; write message
mov eax, ebp
add edx, ecx
add edx, [ebx+8]
add ebx, 20
pop ecx
pop ecx
pop ecx
call write_process_memory
; new debug event
mov eax, ebp
shl eax, 8
or byte [0x80000+eax+APPDATA.event_mask+1], 1 ; set flag 100h
.ret:
ret
 
debug_exc:
; int 1 = #DB
save_ring3_context
cld
mov ax, os_data
mov ds, ax
mov es, ax
mov eax, dr6
test ax, ax
jns @f
; this is exception from task switch
; set DRx registers for task and continue
mov eax, [0x3000]
shl eax, 8
add eax, 0x80000+APPDATA.dbg_regs
mov ecx, [eax+0]
mov dr0, ecx
mov ecx, [eax+4]
mov dr1, ecx
mov ecx, [eax+8]
mov dr2, ecx
mov ecx, [eax+0Ch]
mov dr3, ecx
xor ecx, ecx
mov dr6, ecx
mov ecx, [eax+10h]
mov dr7, ecx
restore_ring3_context
iretd
@@:
push eax
xor eax, eax
mov dr6, eax
; test if debugging
cli
mov eax, [0x3000]
shl eax, 8
mov eax, [0x80000+eax+APPDATA.debugger_slot]
test eax, eax
jnz .debug
sti
; not debuggee => say error and terminate
add esp, 28h+4
mov [error_interrupt], 1
call show_error_parameters
mov edx, [0x3010]
mov byte [edx+TASKDATA.state], 4
jmp change_task
.debug:
; we are debugged process, notify debugger and suspend ourself
; eax=debugger PID
pop edx
mov ebx, dr7
mov cl, not 1
.l1:
test bl, 1
jnz @f
and dl, cl
@@:
shr ebx, 2
add cl, cl
inc ecx
cmp cl, not 10h
jnz .l1
push edx ; DR6 image
mov ecx, [0x3010]
push dword [ecx+TASKDATA.pid] ; PID
push 12
pop ecx
push 3 ; 3 = debug exception
call debugger_notify
pop ecx
pop ecx
pop ecx
mov edx, [0x3010]
mov byte [edx+TASKDATA.state], 1 ; suspended
call change_task
restore_ring3_context
iretd
/kernel/tags/kolibri0.6.0.0/core/mem.inc
0,0 → 1,469
if ~defined mem_inc
mem_inc_fix:
mem_inc fix mem_inc_fix
;include "memmanag.inc"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;High-level memory management in MenuetOS.
;;It uses memory manager in memmanager.inc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
second_base_address=0xC0000000
std_application_base_address=0x10000000
general_page_table_ dd 0
general_page_table=general_page_table_+second_base_address
;-----------------------------------------------------------------------------
create_general_page_table:
;input
; none
;output
; none
;Procedure create general page directory and write
;it address to [general_page_table].
pushad
mov eax,1 ;alloc 1 page
mov ebx,general_page_table ;write address to [general_page_table]
call MEM_Alloc_Pages ;allocate page directory
mov eax,[general_page_table]
call MEM_Get_Linear_Address ;eax - linear address of page directory
mov edi,eax
mov ebx,eax ;copy address of page directory to safe place
xor eax,eax
mov ecx,4096/4
cld
rep stosd ;clear page directory
mov eax,4
mov edx,eax
call MEM_Alloc_Pages ;alloc page tables for 0x0-0x1000000 region
cmp eax,edx
jnz $ ;hang if not enough memory
;fill page tables
xor esi,esi
mov ebp,7
.loop:
;esi - number of page in page directory
;ebp - current page address
;ebx - linear address of page directory
mov eax,[ebx+4*esi]
add dword [ebx+4*esi],7 ;add flags to address of page table
call MEM_Get_Linear_Address
;eax - linear address of page table
mov ecx,4096/4
;ecx (counter) - number of pages in page table
;current address=4Mb*esi
.loop1:
mov [eax],ebp ;write page address (with flags) in page table
add eax,4
add ebp,4096 ;size of page=4096 bytes
loop .loop1
inc esi ;next page directory entry
cmp esi,edx
jnz .loop
;map region 0x80000000-0x807fffff to LFB
mov eax,2 ;size of the region is 4Mb so only 1 page table needed
mov edx,ebx ;ebx still contains linear address of the page directory
add ebx,0x800
call MEM_Alloc_Pages ;alloc page table for the region
mov eax,[ebx]
add dword [ebx],7 ;add flags
call MEM_Get_Linear_Address ;get linear address of the page table
mov ecx,4096/4 ;number of pages in page table
mov edi,[0xfe80]
add edi,7
.loop3:
;eax - linear address of page table
;edi - current linear address with flags
mov [eax],edi
add eax,4
add edi,4096
loop .loop3
mov eax,[ebx+4]
call MEM_Get_Linear_Address
add dword [ebx+4],7
mov ecx,4096/4
.loop31:
mov [eax],edi
add eax,4
add edi,4096
loop .loop31
;map region 0xC0000000-* to 0x0-*
mov esi,edx ;esi=linear address of the page directory
lea edi,[esi+(second_base_address shr 20)];add offset of entry (0xC00)
mov ecx,4
rep movsd ;first 16Mb of the region mapped as 0x0-0x1000000 block
mov eax,[0xfe8c] ;eax=memory size
add eax,0x3fffff
shr eax,22
mov esi,eax ;calculate number of entries in page directory
sub esi,4 ;subtract entries for first 16Mb.
mov ebp,0x1000000+7 ;start physical address with flags
;mapping memory higher than 16Mb
.loop4:
;esi (counter) - number of entries in page directory
;edi - address of entry
test esi,esi
jle .loop4end
call MEM_Alloc_Page ;alloc page table for entry in page directory
mov [edi],eax
add dword [edi],7 ;write physical address of page table in page directory
add edi,4 ;move entry pointer
call MEM_Get_Linear_Address
mov ecx,eax
xor edx,edx
.loop5:
;ecx - linear address of page table
;edx - index of page in page table
;ebp - current mapped physical address with flags
mov [ecx+4*edx],ebp ;write address of page in page table
add ebp,0x1000 ;move to next page
inc edx
cmp edx,4096/4
jl .loop5
dec esi
jmp .loop4
.loop4end:
.set_cr3:
;set value of cr3 register to the address of page directory
mov eax,[general_page_table]
add eax,8+16 ;add flags
mov cr3,eax ;now we have full access paging
popad
ret
;-----------------------------------------------------------------------------
simple_clone_cr3_table:
;Parameters:
; eax - physical address of cr3 table (page directory)
;result:
; eax - physical address of clone of cr3 table.
;Function copy only page directory.
push ecx
push edx
push esi
push edi
call MEM_Get_Linear_Address
;eax - linear address of cr3 table
mov esi,eax
call MEM_Alloc_Page
test eax,eax
jz .failed
;eax - physical address of new page diretory
mov edx,eax
call MEM_Get_Linear_Address
mov edi,eax
mov ecx,4096/4
cld
;esi - address of old page directory
;edi - address of new page directory
rep movsd ;copy page directory
mov eax,edx
.failed:
pop edi
pop esi
pop edx
pop ecx
ret
;-----------------------------------------------------------------------------
create_app_cr3_table:
;Parameters:
; eax - slot of process (index in 0x3000 table)
;result:
; eax - physical address of table.
;This function create page directory for new process and
;write it physical address to offset 0xB8 of extended
;process information.
push ebx
 
mov ebx,eax
mov eax,[general_page_table]
call simple_clone_cr3_table ;clone general page table
shl ebx,8
mov [second_base_address+0x80000+ebx+APPDATA.dir_table],eax ;save address of page directory
pop ebx
ret
;-----------------------------------------------------------------------------
get_cr3_table:
;Input:
; eax - slot of process
;result:
; eax - physical address of page directory
shl eax,8 ;size of process extended information=256 bytes
mov eax,[second_base_address+0x80000+eax+APPDATA.dir_table]
ret
;-----------------------------------------------------------------------------
dispose_app_cr3_table:
;Input:
; eax - slot of process
;result:
; none
;This procedure frees page directory,
;page tables and all memory of process.
pushad
mov ebp,eax
;ebp = process slot in the procedure.
shl eax,8
mov eax,[second_base_address+0x80000+eax+APPDATA.dir_table]
mov ebx,eax
;ebx = physical address of page directory
call MEM_Get_Linear_Address
mov edi,eax
;edi = linear address of page directory
mov eax,[edi+(std_application_base_address shr 20)]
and eax,not (4096-1)
call MEM_Get_Linear_Address
mov esi,eax
;esi = linear address of first page table
 
;search threads
; mov ecx,0x200
xor edx,edx
mov eax,0x2
.loop:
;eax = current slot of process
mov ecx,eax
shl ecx,5
cmp byte [second_base_address+0x3000+ecx+TASKDATA.state],9 ;if process running?
jz .next ;skip empty slots
shl ecx,3
cmp [second_base_address+0x80000+ecx+APPDATA.dir_table],ebx ;compare page directory addresses
jnz .next
inc edx ;thread found
.next:
inc eax
cmp eax,[0x3004] ;exit loop if we look through all processes
jle .loop
;edx = number of threads
;our process is zombi so it isn't counted
cmp edx,1
jg .threadsexists
;if there isn't threads then clear memory.
add edi,std_application_base_address shr 20
.loop1:
;edi = linear address of current directory entry
;esi = linear address of current page table
test esi,esi
jz .loop1end
xor ecx,ecx
.loop2:
;ecx = index of page
mov eax,[esi+4*ecx]
test eax,eax
jz .loopend ;skip empty entries
and eax,not (4096-1) ;clear flags
push ecx
call MEM_Free_Page ;free page
pop ecx
.loopend:
inc ecx
cmp ecx,1024 ;there are 1024 pages in page table
jl .loop2
mov eax,esi
call MEM_Free_Page_Linear ;free page table
.loop1end:
add edi,4 ;move to next directory entry
mov eax,[edi]
and eax,not (4096-1)
call MEM_Get_Linear_Address
mov esi,eax ;calculate linear address of new page table
test edi,0x800
jz .loop1 ;test if we at 0x80000000 address?
and edi,not (4096-1) ;clear offset of page directory entry
mov eax,edi
call MEM_Free_Page_Linear ;free page directory
popad
ret
.threadsexists: ;do nothing
popad ;last thread will free memory
ret
;-----------------------------------------------------------------------------
mem_alloc_specified_region:
;eax - linear directory address
;ebx - start address (aligned to 4096 bytes)
;ecx - size in pages
;result:
; eax=1 - ok
; eax=0 - failed
;Try to alloc and map ecx pages to [ebx;ebx+4096*ecx) interval.
pushad
mov ebp,ebx ;save start address for recoil
mov esi,eax
.gen_loop:
;esi = linear directory address
;ebx = current address
;ecx = remaining size in pages
mov edx,ebx
shr edx,22
mov edi,[esi+4*edx] ;find directory entry for current address
test edi,edi
jnz .table_exists ;check if page table allocated
call MEM_Alloc_Page ;alloc page table
test eax,eax
jz .failed
mov [esi+4*edx],eax
add dword [esi+4*edx],7 ;write it address with flags
call MEM_Get_Linear_Address
call mem_fill_page ;clear page table
jmp .table_linear
.table_exists:
;calculate linear address of page table
mov eax,edi
and eax,not (4096-1) ;clear flags
call MEM_Get_Linear_Address
.table_linear:
;eax = linear address of page table
mov edx,ebx
shr edx,12
and edx,(1024-1) ;calculate index in page table
mov edi,eax
.loop:
;edi = linear address of page table
;edx = current page table index
;ecx = remaining size in pages
;ebx = current address
test ecx,ecx
jle .endloop1 ;all requested pages allocated
call MEM_Alloc_Page ;alloc new page
test eax,eax
jz .failed
mov [edi+4*edx],eax
add dword [edi+4*edx],7 ;write it address with flags
call MEM_Get_Linear_Address
call mem_fill_page ;clear new page
;go to next page table entry
dec ecx
add ebx,4096
inc edx
test edx,(1024-1)
jnz .loop
jmp .gen_loop
.endloop1:
popad
mov eax,1 ;ok
ret
.failed:
;calculate data for recoil
sub ebx,ebp
shr ebx,12
mov ecx,ebx ;calculate number of allocated pages
mov eax,esi ;restore linear address of page directory
mov ebx,ebp ;restore initial address
call mem_free_specified_region ;free all allocated pages
popad
xor eax,eax ;fail
ret
;-----------------------------------------------------------------------------
mem_fill_page:
;Input:
; eax - address
;result:
; none
;set to zero 4096 bytes at eax address.
push ecx
push edi
mov edi,eax
mov ecx,4096/4
xor eax,eax
rep stosd
lea eax,[edi-4096]
pop edi
pop ecx
ret
;-----------------------------------------------------------------------------
mem_free_specified_region:
;eax - linear page directory address
;ebx - start address (aligned to 4096 bytes)
;ecx - size in pages
;result - none
;Free pages in [ebx;ebx+4096*ecx) region.
pushad
mov esi,eax
xor ebp,ebp
.gen_loop:
;esi = linear page directory address
;ebx = current address
;ecx = remaining pages
;ebp = 0 for first page table
; 1 otherwise
mov edx,ebx
shr edx,22
mov eax,[esi+4*edx] ;find directory entry for current address
and eax,not (4096-1)
test eax,eax
jnz .table_exists
;skip absent page tables
mov edx,ebx
shr edx,12
and edx,(1024-1) ;edx - index of current page
add ebx,1 shl 22
add ecx,edx
and ebx,not ((1 shl 22)-1)
mov ebp,1 ;set flag
sub ecx,1024 ;ecx=ecx-(1024-edx)
jg .gen_loop
popad
ret
.table_exists:
call MEM_Get_Linear_Address
;eax - linear address of table
mov edx,ebx
shr edx,12
and edx,(1024-1) ;edx - index of current page
mov edi,eax
.loop:
;edi = linear address of page table entry
;edx = index of page table entry
;ecx = remaining pages
test ecx,ecx
jle .endloop1
mov eax,[edi+4*edx]
and eax,not (4096-1)
call MEM_Free_Page ;free page
mov dword [edi+4*edx],0 ;and clear page table entry
dec ecx
inc edx
cmp edx,1024
jl .loop
test ebp,ebp
jz .first_page
mov eax,edi
call MEM_Free_Page_Linear ;free page table
mov edx,ebx
shr edx,22
mov dword [esi+4*edx],0 ;and clear page directory entry
.first_page:
add ebx,1 shl 22
and ebx,not ((1 shl 22)-1) ;calculate new current address
mov ebp,1 ;set flag
jmp .gen_loop
.endloop1:
popad
ret
end if
/kernel/tags/kolibri0.6.0.0/core/physmem.inc
0,0 → 1,220
virtual at 0
physical_mem_block:
.start rd 1
.size rd 1
.flags rd 1 ;0-free, pid-used.
.sizeof:
end virtual
max_physical_mem_blocks = 24
uglobal
num_physical_mem_blocks rd 1
physical_mem_blocks rd 3*max_physical_mem_blocks
endg
Init_Physical_Memory_Manager:
pushad
mov edi,physical_mem_blocks
mov ecx,3*max_physical_mem_blocks
xor eax,eax
cld
rep stosd
mov dword [num_physical_mem_blocks],2
mov [physical_mem_blocks+physical_mem_block.start],0x60000
mov [physical_mem_blocks+physical_mem_block.size],0x20000 ;128Kb
mov [physical_mem_blocks+physical_mem_block.sizeof+physical_mem_block.start],0x780000
mov [physical_mem_blocks+physical_mem_block.sizeof+physical_mem_block.size],0x80000 ;512Kb
popad
ret
Insert_Block:
;input:
; eax - handle
;output:
; none
push eax ecx esi edi
sub eax,[num_physical_mem_blocks]
neg eax
mov edi,physical_mem_block.sizeof
imul eax,edi
shr eax,2
mov ecx,eax
mov esi,[num_physical_mem_blocks]
imul esi,edi
add esi,physical_mem_blocks
lea edi,[esi+physical_mem_block.sizeof]
std
rep movsd
pop edi esi ecx eax
ret
Delete_Block:
;input:
; eax - handle
;output:
; none
pushad
mov edi,eax
sub eax,[num_physical_mem_blocks]
neg eax
dec eax
mov esi,physical_mem_block.sizeof
imul eax,esi
imul edi,esi
add edi,physical_mem_blocks
lea esi,[edi+physical_mem_block.sizeof]
mov ecx,eax
shr ecx,2
cld
rep movsd
popad
ret
Allocate_Physical_Block:
;input:
; eax - size
;output:
; eax - address or 0 if not enough memory.
pushad
cmp [num_physical_mem_blocks],max_physical_mem_blocks
jge .error
mov ebx,eax
xor eax,eax
mov esi,physical_mem_blocks
.loop:
cmp dword [esi+physical_mem_block.flags],0
jnz .next
cmp [esi+physical_mem_block.size],ebx
jg .addblock
jz .noaddblock
.next:
inc eax
add esi,physical_mem_block.sizeof
cmp eax,[num_physical_mem_blocks]
jl .loop
.error:
popad
xor eax,eax
ret
.noaddblock:
mov eax,[esi+physical_mem_block.start]
mov [esp+28],eax
mov eax,[0x3010]
mov eax,[eax+TASKDATA.pid]
mov [esi+physical_mem_block.flags],eax
popad
ret
.addblock:
call Insert_Block
inc dword [num_physical_mem_blocks]
mov eax,[esi+physical_mem_block.start]
mov [esp+28],eax
mov ecx,[0x3010]
mov ecx,[ecx+TASKDATA.pid]
mov [esi+physical_mem_block.flags],ecx
mov ecx,[esi+physical_mem_block.size]
mov [esi+physical_mem_block.size],ebx
sub ecx,ebx
mov [esi+physical_mem_block.sizeof+physical_mem_block.size],ecx
add ebx,[esi+physical_mem_block.start]
mov [esi+physical_mem_block.sizeof+physical_mem_block.start],ebx
mov dword [esi+physical_mem_block.sizeof+physical_mem_block.flags],0
popad
ret
Free_Physical_Block:
;input:
; eax - address
;output:
; none
pushad
test eax,eax
jz .ret
mov ebx,eax
xor eax,eax
mov esi,physical_mem_blocks
.loop:
cmp ebx,[esi+physical_mem_block.start]
jz .endloop
inc eax
add esi,physical_mem_block.sizeof
cmp eax,[num_physical_mem_blocks]
jl .loop
jmp .ret
.endloop:
mov dword [esi+physical_mem_block.flags],0
test eax,eax
jz .no_union_previous
cmp dword [esi-physical_mem_block.sizeof+physical_mem_block.flags],0
jnz .no_union_previous
mov ebx,[esi-physical_mem_block.sizeof+physical_mem_block.start]
add ebx,[esi-physical_mem_block.sizeof+physical_mem_block.size]
cmp ebx,[esi+physical_mem_block.start]
jnz .no_union_previous
mov ebx,[esi+physical_mem_block.size]
add [esi-physical_mem_block.sizeof+physical_mem_block.size],ebx
call Delete_Block
dec eax
dec [num_physical_mem_blocks]
.no_union_previous:
inc eax
cmp eax,[num_physical_mem_blocks]
jge .no_union_next
cmp dword [esi+physical_mem_block.sizeof+physical_mem_block.flags],0
jnz .no_union_next
mov ebx,[esi+physical_mem_block.start]
add ebx,[esi+physical_mem_block.size]
cmp ebx,[esi+physical_mem_block.sizeof+physical_mem_block.start]
jnz .no_union_next
mov ebx,[esi+physical_mem_block.sizeof+physical_mem_block.size]
add [esi+physical_mem_block.size],ebx
call Delete_Block
dec [num_physical_mem_blocks]
.no_union_next:
.ret:
popad
ret
sys_allocate_physical_block:
;eax - subfunction number
mov eax,ebx
call Allocate_Physical_Block
mov [esp+36],eax
ret
sys_free_physical_block:
;eax - subfunction number
mov eax,ebx
call Free_Physical_Block
ret
sys_set_buffer:
add ecx,std_application_base_address
isys_set_buffer: ;for using in kernel
;eax - subfunction number
;ebx - physical address
;ecx - buffer start
;edx - buffer size
lea edi,[ebx+second_base_address]
mov esi,ecx
mov ecx,edx
cld
rep movsb
ret
sys_get_buffer:
add ecx,std_application_base_address
isys_get_buffer: ;for using in kernel
;eax - subfunction number
;ebx - physical address
;ecx - buffer start
;edx - buffer size
mov edi,ecx
lea esi,[ebx+second_base_address]
mov ecx,edx
cld
rep movsb
ret
sys_internal_services:
cmp eax,4
jle sys_sheduler
cmp eax,5
jz sys_allocate_physical_block
cmp eax,6
jz sys_free_physical_block
cmp eax,7
jz sys_set_buffer
cmp eax,8
jz sys_get_buffer
ret
/kernel/tags/kolibri0.6.0.0/core/sched.inc
0,0 → 1,191
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; IRQ0 HANDLER (TIMER INTERRUPT) ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
align 32
irq0:
save_ring3_context
mov ax, os_data
mov ds, ax
mov es, ax
 
inc dword [timer_ticks]
 
mov eax, [timer_ticks]
call playNote ; <<<--- Speaker driver
 
cmp eax,[next_usage_update]
jb .nocounter
add eax,100
mov [next_usage_update],eax
call updatecputimes
.nocounter:
 
cmp [0xffff], byte 1
jne .change_task
 
mov al,0x20 ; send End Of Interrupt signal
mov dx,0x20
out dx,al
 
mov [0xffff], byte 0
 
restore_ring3_context
iret
 
.change_task:
call update_counters
 
call find_next_task
mov ecx, eax
 
mov al,0x20 ; send End Of Interrupt signal
mov dx,0x20
out dx,al
 
test ecx, ecx ; if there is only one running process
jnz .return
 
call do_change_task
.return:
restore_ring3_context
iret
 
 
align 4
change_task:
 
pushfd
cli
pushad
 
call update_counters
call find_next_task
test eax, eax ; the same task -> skip switch
jnz .return
 
mov [0xffff],byte 1
call do_change_task
 
.return:
popad
popfd
 
ret
 
 
uglobal
align 4
far_jump:
.offs dd ?
.sel dw ?
context_counter dd ? ;noname & halyavin
next_usage_update dd ?
timer_ticks dd ?
prev_slot dd ?
event_sched dd ?
endg
 
 
update_counters:
mov edi, [0x3010]
mov ebx, [edi+TASKDATA.counter_add] ; time stamp counter add
call _rdtsc
sub eax, ebx
add eax, [edi+TASKDATA.counter_sum] ; counter sum
mov [edi+TASKDATA.counter_sum], eax
ret
 
 
; Find next task to execute
; result: ebx = number of the selected task
; eax = 1 if the task is the same
; edi = address of the data for the task in ebx
; [0x3000] = ebx and [0x3010] = edi
; corrupts other regs
find_next_task:
mov ebx, [0x3000]
mov edi, [0x3010]
mov [prev_slot], ebx
 
.waiting_for_termination:
.waiting_for_reuse:
.waiting_for_event:
.suspended:
cmp ebx, [0x3004]
jb @f
mov edi, 0x3000
xor ebx, ebx
@@:
 
add edi,0x20
inc ebx
 
mov al, byte [edi+TASKDATA.state]
test al, al
jz .found
cmp al, 1
jz .suspended
cmp al, 2
jz .suspended
cmp al, 3
je .waiting_for_termination
cmp al, 4
je .waiting_for_termination
cmp al, 9
je .waiting_for_reuse
 
mov [0x3000],ebx
mov [0x3010],edi
 
cmp al, 5
jne .noevents
call get_event_for_app
test eax, eax
jz .waiting_for_event
mov [event_sched], eax
mov [edi+TASKDATA.state], byte 0
.noevents:
.found:
mov [0x3000],ebx
mov [0x3010],edi
call _rdtsc
mov [edi+TASKDATA.counter_add],eax
 
xor eax, eax
cmp ebx, [prev_slot]
sete al
ret
 
; in: ebx = TSS selector index
do_change_task:
shl ebx, 3
xor eax, eax
add ebx, tss0
mov [far_jump.sel], bx ; selector
mov [far_jump.offs], eax ; offset
jmp pword [far_jump]
inc [context_counter] ;noname & halyavin
ret
 
 
 
align 4
updatecputimes:
 
mov eax,[idleuse]
mov [idleusesec],eax
mov [idleuse],dword 0
mov ecx, [0x3004]
mov edi, 0x3020
.newupdate:
mov ebx,[edi+TASKDATA.counter_sum]
mov [edi+TASKDATA.cpu_usage],ebx
mov [edi+TASKDATA.counter_sum],dword 0
add edi,0x20
dec ecx
jnz .newupdate
 
ret
/kernel/tags/kolibri0.6.0.0/core/sync.inc
0,0 → 1,111
if ~defined sync_inc
sync_inc_fix:
sync_inc fix sync_inc_fix
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Synhronization for MenuetOS. ;;
;;Author: Halyavin Andrey, halyavin@land.ru ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
;simplest mutex.
macro SimpleMutex name
{
; iglobal
name dd 0
name#.type = 1
; endg
}
macro WaitSimpleMutex name
{
local start_wait,ok
start_wait=$
cli
cmp [name],dword 0
jz ok
sti
call change_task
jmp start_wait
ok=$
push eax
mov eax,dword [0x3010+second_base_address]
mov eax,[eax+TASKDATA.pid]
mov [name],eax
pop eax
sti
}
macro ReleaseSimpleMutex name
{
mov [name],dword 0
}
macro TryWaitSimpleMutex name ;result in eax and in flags
{
local ok,try_end
cmp [name],dword 0
jz ok
xor eax,eax
jmp try_end
ok=$
xor eax,eax
inc eax
try_end=$
}
macro SimpleCriticalSection name
{
; iglobal
name dd 0
dd 0
name#.type=2
; endg
}
macro WaitSimpleCriticalSection name
{
local start_wait,first_wait,inc_counter,end_wait
push eax
mov eax,[0x3010+second_base_address]
mov eax,[eax+TASKDATA.pid]
start_wait=$
cli
cmp [name],dword 0
jz first_wait
cmp [name],eax
jz inc_counter
sti
call change_task
jmp start_wait
first_wait=$
mov [name],eax
mov [name+4],dword 1
jmp end_wait
inc_counter=$
inc dword [name+4]
end_wait=$
sti
pop eax
}
macro ReleaseSimpleCriticalSection name
{
local release_end
dec dword [name+4]
jnz release_end
mov [name],dword 0
release_end=$
}
macro TryWaitSimpleCriticalSection name ;result in eax and in flags
{
local ok,try_end
mov eax,[0x3000+second_base_address]
mov eax,[eax+TASKDATA.pid]
cmp [name],eax
jz ok
cmp [name],0
jz ok
xor eax,eax
jmp try_end
ok=$
xor eax,eax
inc eax
try_end=$
}
_cli equ call MEM_HeapLock
_sti equ call MEM_HeapUnLock
end if
 
/kernel/tags/kolibri0.6.0.0/core/memmanag.inc
0,0 → 1,833
if ~defined memmanager_inc
memmanager_inc_fix:
memmanager_inc fix memmanager_inc_fix
;for testing in applications
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Memory allocator for MenuetOS kernel
;; Andrey Halyavin, halyavin@land.ru 2005
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; heap block structure -
;; you can handle several ranges of
;; pages simultaneosly.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.heap_linear_address equ 0
.heap_block_size equ 4
.heap_physical_address equ 8
.heap_reserved equ 12
.heap_block_info equ 16
max_heaps equ 8
.range_info equ 36
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; memory manager data
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
uglobal
MEM_heap_block rd .heap_block_info*max_heaps/4
MEM_heap_count rd 1
MEM_cli_count rd 1
MEM_cli_prev rd 1
MEM_FreeSpace rd 1
; MEM_AllSpace rd 1
endg
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Init
;;Initialize memory manager structures.
;;Must be called first.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MEM_Init:
push eax
xor eax,eax
mov [MEM_cli_prev],eax ;init value = 0
dec eax
mov [MEM_cli_count],eax ;init value = -1
pop eax
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Heap_Lock
;;Wait until all operations with heap will be finished.
;;Between MEM_Heap_Lock and MEM_Heap_UnLock operations
;;with heap are forbidden.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MEM_Heap_Lock:
pushfd
cli
inc dword [MEM_cli_count]
jz MEM_Heap_First_Lock
add esp,4
ret
MEM_Heap_First_Lock: ;save interrupt flag
shr dword [esp],9
and dword [esp],1
pop dword [MEM_cli_prev]
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Heap_UnLock
;;After this routine operations with heap are allowed.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MEM_Heap_UnLock:
dec dword [MEM_cli_count]
js MEM_Heap_UnLock_last
ret
MEM_Heap_UnLock_last:
cmp dword [MEM_cli_prev],0 ;restore saved interrupt flag
jz MEM_Heap_UnLock_No_sti
sti
MEM_Heap_UnLock_No_sti:
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Add_Heap
;;Add new range to memory manager.
;;eax - linear address
;;ebx - size in pages
;;ecx - physical address
;;Result:
;; eax=1 - success
;; eax=0 - failed
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MEM_Add_Heap:
push edx
call MEM_Heap_Lock
mov edx,[MEM_heap_count]
cmp edx,max_heaps
jz MEM_Add_Heap_Error
inc dword [MEM_heap_count]
shl edx,4
mov [MEM_heap_block+edx+.heap_linear_address],eax
mov [MEM_heap_block+edx+.heap_block_size],ebx
shl dword [MEM_heap_block+edx+.heap_block_size],12
mov [MEM_heap_block+edx+.heap_physical_address],ecx
lea edx,[4*ebx+.range_info+4095] ;calculate space for page info table
and edx,0xFFFFF000
 
push edi
mov edi,edx
shr edi,12
sub edi,ebx ;edi=-free space
sub [MEM_FreeSpace],edi
; sub [MEM_AllSpace],edi
 
mov [eax],eax
add [eax],edx ;first 4 bytes - pointer to first free page
;clean page info area
lea edi,[eax+4]
mov ecx,edx
shr ecx,2
push eax
xor eax,eax
rep stosd
pop eax
pop edi
;create free pages list.
mov ecx,[eax]
shl ebx,12
add eax,ebx ;eax - address after block
MEM_Add_Heap_loop:
add ecx,4096
mov [ecx-4096],ecx ;set forward pointer
cmp ecx,eax
jnz MEM_Add_Heap_loop
mov dword [ecx-4096],0 ;set end of list
MEM_Add_Heap_ret:
call MEM_Heap_UnLock
pop edx
ret
MEM_Add_Heap_Error:
xor eax,eax
jmp MEM_Add_Heap_ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Get_Physical_Address
;;Translate linear address to physical address
;;Parameters:
;; eax - linear address
;;Result:
;; eax - physical address
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Get_Physical_Address
MEM_Get_Physical_Address:
push ecx
call MEM_Heap_Lock
mov ecx,[MEM_heap_count]
dec ecx
shl ecx,4
MEM_Get_Physical_Address_loop:
sub eax,[MEM_heap_block+ecx+.heap_linear_address]
jl MEM_Get_Physical_Address_next
cmp eax,[MEM_heap_block+ecx+.heap_block_size]
jge MEM_Get_Physical_Address_next
add eax,[MEM_heap_block+ecx+.heap_physical_address]
jmp MEM_Get_Physical_Address_loopend
MEM_Get_Physical_Address_next:
add eax,[MEM_heap_block+ecx+.heap_linear_address]
sub ecx,16
jns MEM_Get_Physical_Address_loop
xor eax,eax ;address not found
MEM_Get_Physical_Address_loopend:
call MEM_Heap_UnLock
pop ecx
ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Get_Linear_Address
;;Translate physical address to linear address.
;;Parameters:
;; eax - physical address
;;Result:
;; eax - linear address
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Get_Linear_Address
MEM_Get_Linear_Address:
push ecx
call MEM_Heap_Lock
mov ecx,[MEM_heap_count]
dec ecx
shl ecx,4
MEM_Get_Linear_Address_loop:
sub eax,[MEM_heap_block+ecx+.heap_physical_address]
jl MEM_Get_Linear_Address_Next
cmp eax,[MEM_heap_block+ecx+.heap_block_size]
jge MEM_Get_Linear_Address_Next
add eax,[MEM_heap_block+ecx+.heap_linear_address]
call MEM_Heap_UnLock
pop ecx
ret
MEM_Get_Linear_Address_Next:
add eax,[MEM_heap_block+ecx+.heap_physical_address]
sub ecx,16
jns MEM_Get_Linear_Address_loop
call MEM_Heap_UnLock
pop ecx
xor eax,eax ;address not found
ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Alloc_Page
;;Allocate and add reference to page
;;Result:
;; eax<>0 - physical address of page
;; eax=0 - not enough memory
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Alloc_Page
MEM_Alloc_Page:
push ecx
call MEM_Heap_Lock
mov ecx,[MEM_heap_count]
dec ecx
shl ecx,4
MEM_Alloc_Page_loop:
push ecx
mov ecx,[MEM_heap_block+ecx+.heap_linear_address]
cmp dword [ecx],0
jz MEM_Alloc_Page_loopend
mov eax,[ecx]
push dword [eax]
pop dword [ecx]
sub eax,ecx
push eax
shr eax,10
mov word [ecx+.range_info+eax],1
pop eax
pop ecx
add eax,[MEM_heap_block+ecx+.heap_physical_address]
dec [MEM_FreeSpace]
jmp MEM_Alloc_Page_ret
MEM_Alloc_Page_loopend:
pop ecx
sub ecx,16
jns MEM_Alloc_Page_loop
xor eax,eax
MEM_Alloc_Page_ret:
call MEM_Heap_UnLock
pop ecx
ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Alloc_Page_Linear
;;Allocate and add reference to page
;;Result:
;; eax<>0 - linear address of page
;; eax=0 - not enough memory
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Alloc_Page_Linear
MEM_Alloc_Page_Linear:
push ecx
call MEM_Heap_Lock
mov ecx,[MEM_heap_count]
dec ecx
shl ecx,4
MEM_Alloc_Page_Linear_loop:
push ecx
mov ecx,[MEM_heap_block+ecx+.heap_linear_address]
cmp dword [ecx],0
jz MEM_Alloc_Page_Linear_loopend
mov eax,[ecx]
push dword [eax]
pop dword [ecx]
push eax
sub eax,ecx
shr eax,10
mov word [ecx+.range_info+eax],1
pop eax
pop ecx
dec [MEM_FreeSpace]
jmp MEM_Alloc_Page_Linear_ret
MEM_Alloc_Page_Linear_loopend:
pop ecx
sub ecx,16
jns MEM_Alloc_Page_Linear_loop
xor eax,eax
MEM_Alloc_Page_Linear_ret:
call MEM_Heap_UnLock
pop ecx
ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Free_Page
;;Remove reference and free page if number of
;;references is equal to 0
;;Parameters:
;; eax - physical address of page
;;Result:
;; eax - 1 success
;; eax - 0 failed
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if (used MEM_Free_Page) | (used MEM_Free_Page_Linear)
MEM_Free_Page:
test eax,eax
jz MEM_Free_Page_Zero
test eax,0xFFF
jnz MEM_Free_Page_Not_Aligned
push ebx
push ecx
push edx
call MEM_Heap_Lock
mov ecx,[MEM_heap_count]
dec ecx
shl ecx,4
MEM_Free_Page_Heap_loop:
sub eax,[MEM_heap_block+ecx+.heap_physical_address]
js MEM_Free_Page_Heap_loopnext
cmp eax,[MEM_heap_block+ecx+.heap_block_size]
jl MEM_Free_Page_Heap_loopend
MEM_Free_Page_Heap_loopnext:
add eax,[MEM_heap_block+ecx+.heap_physical_address]
sub ecx,16
jns MEM_Free_Page_Heap_loop
xor eax,eax
inc eax
jmp MEM_Free_Page_ret
MEM_Free_Page_Heap_loopend:
mov ecx,[MEM_heap_block+ecx+.heap_linear_address]
mov ebx,eax
add eax,ecx
shr ebx,10
mov edx,[ecx+.range_info+ebx]
test edx,0x80000000
jnz MEM_Free_Page_Bucket
test dx,dx
jz MEM_Free_Page_Error
dec word [ecx+.range_info+ebx]
jnz MEM_Free_Page_OK
MEM_Free_Page_Bucket:
push dword [ecx]
mov [ecx],eax
pop dword [eax]
mov dword [ecx+.range_info+ebx],0
inc [MEM_FreeSpace]
MEM_Free_Page_OK:
mov eax,1
MEM_Free_Page_ret:
call MEM_Heap_UnLock
pop edx
pop ecx
pop ebx
ret
MEM_Free_Page_Error:
xor eax,eax
jmp MEM_Free_Page_ret
MEM_Free_Page_Zero:
inc eax
ret
MEM_Free_Page_Not_Aligned:
xor eax,eax
ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Free_Page_Linear
;;Remove reference and free page if number of
;;references is equal to 0
;;Parameters:
;; eax - linear address of page
;;Result:
;; eax - 1 success
;; eax - 0 failed
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Free_Page_Linear
MEM_Free_Page_Linear:
test eax,eax
jz MEM_Free_Page_Zero
test eax,0xFFF
jnz MEM_Free_Page_Not_Aligned
push ebx
push ecx
push edx
call MEM_Heap_Lock
mov ecx,[MEM_heap_count]
dec ecx
shl ecx,4
MEM_Free_Page_Linear_Heap_loop:
sub eax,[MEM_heap_block+ecx+.heap_linear_address]
js MEM_Free_Page_Linear_Heap_loopnext
cmp eax,[MEM_heap_block+ecx+.heap_block_size]
jl MEM_Free_Page_Heap_loopend
MEM_Free_Page_Linear_Heap_loopnext:
add eax,[MEM_heap_block+ecx+.heap_linear_address]
sub ecx,16
jns MEM_Free_Page_Linear_Heap_loop
xor eax,eax
inc eax
jmp MEM_Free_Page_ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Alloc_Pages
;;Allocates set of pages.
;;Parameters:
;; eax - number of pages
;; ebx - buffer for physical addresses
;;Result:
;; eax - number of allocated pages
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Alloc_Pages
MEM_Alloc_Pages:
push eax
push ebx
push ecx
mov ecx,eax
test ecx,ecx
jz MEM_Alloc_Pages_ret
MEM_Alloc_Pages_loop:
call MEM_Alloc_Page
test eax,eax
jz MEM_Alloc_Pages_ret
mov [ebx],eax
add ebx,4
dec ecx
jnz MEM_Alloc_Pages_loop
MEM_Alloc_Pages_ret:
sub [esp+8],ecx
pop ecx
pop ebx
pop eax
ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Alloc_Pages_Linear
;;Allocates set of pages.
;;Parameters:
;; eax - number of pages
;; ebx - buffer for linear addresses
;;Result:
;; eax - number of allocated pages
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Alloc_Pages_Linear
MEM_Alloc_Pages_Linear:
push eax
push ebx
push ecx
mov ecx,eax
test ecx,ecx
jz MEM_Alloc_Pages_Linear_ret
MEM_Alloc_Pages_Linear_loop:
call MEM_Alloc_Page_Linear
test eax,eax
jz MEM_Alloc_Pages_Linear_ret
mov [ebx],eax
add ebx,4
dec ecx
jnz MEM_Alloc_Pages_Linear_loop
MEM_Alloc_Pages_Linear_ret:
sub [esp+8],ecx
pop ecx
pop ebx
pop eax
ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Free_Pages
;;Parameters:
;; eax - number of pages
;; ebx - array of addresses
;;Result:
;; eax=1 - succcess
;; eax=0 - failed
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Free_Pages
MEM_Free_Pages:
push ebx
push ecx
mov ecx,eax
test ecx,ecx
jz MEM_Free_Pages_ret
MEM_Free_Pages_loop:
mov eax,[ebx]
call MEM_Free_Page
add ebx,4
test eax,eax
jz MEM_Free_Pages_ret
dec ecx
jnz MEM_Free_Pages_loop
MEM_Free_Pages_ret:
pop ecx
pop ebx
ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Free_Pages_Linear
;;Parameters:
;; eax - number of pages
;; ebx - array of addresses
;;Result:
;; eax=1 - succcess
;; eax=0 - failed
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Free_Pages_Linear
MEM_Free_Pages_Linear:
push ebx
push ecx
mov ecx,eax
test ecx,ecx
jz MEM_Free_Pages_Linear_ret
MEM_Free_Pages_Linear_loop:
mov eax,[ebx]
call MEM_Free_Page_Linear
add ebx,4
test eax,eax
jz MEM_Free_Pages_Linear_ret
dec ecx
jnz MEM_Free_Pages_Linear_loop
MEM_Free_Pages_Linear_ret:
pop ecx
pop ebx
ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Get_Heap_Number
;;Calculate number of heap which pointer belongs to.
;;Parameter:
;; eax - address
;;Result:
;; ecx - number of heap*16.
;; eax=0 if address not found.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Get_Heap_Number
MEM_Get_Heap_Number:
call MEM_Heap_Lock
mov ecx,[MEM_heap_count]
dec ecx
shl ecx,4
MEM_Get_Heap_loop:
sub eax,[MEM_heap_block+ecx+.heap_physical_address]
jl MEM_Get_Heap_loopnext
cmp eax,[MEM_heap_block+ecx+.heap_block_size]
jl MEM_Get_Heap_loopend
MEM_Get_Heap_loopnext:
add eax,[MEM_heap_block+ecx+.heap_physical_address]
sub ecx,16
jns MEM_Get_Heap_loop
call MEM_Heap_UnLock
xor eax,eax
ret
MEM_Get_Heap_loopend:
add eax,[MEM_heap_block+ecx+.heap_physical_address]
call MEM_Heap_UnLock
ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Get_Heap_Number_Linear
;;Calculate number of heap which pointer belongs to.
;;Parameter:
;; eax - address
;;Result:
;; ecx - number of heap*16.
;; eax=0 if address not found.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Get_Heap_Number_Linear
MEM_Get_Heap_Number_Linear:
call MEM_Heap_Lock
mov ecx,[MEM_heap_count]
dec ecx
shl ecx,4
MEM_Get_Heap_Linear_loop:
sub eax,[MEM_heap_block+ecx+.heap_linear_address]
jl MEM_Get_Heap_Linear_loopnext
cmp eax,[MEM_heap_block+ecx+.heap_block_size]
jl MEM_Get_Heap_Linear_loopend
MEM_Get_Heap_Linear_loopnext:
add eax,[MEM_heap_block+ecx+.heap_linear_address]
sub ecx,16
jns MEM_Get_Heap_Linear_loop
call MEM_Heap_UnLock
xor eax,eax
ret
MEM_Get_Heap_Linear_loopend:
add eax,[MEM_heap_block+ecx+.heap_linear_address]
call MEM_Heap_UnLock
ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Alloc
;;Allocate small region.
;;Parameters:
;; eax - size (0<eax<=4096)
;;Result:
;; eax - linear address
;; eax=0 - not enough memory
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Alloc
MEM_Alloc:
;find chain
test eax,eax
jng MEM_Alloc_Wrong_Size
cmp eax,4096
jg MEM_Alloc_Wrong_Size
push ebx
push ecx
push edx
push esi
dec eax
shr eax,4
xor edx,edx
MEM_Alloc_Find_Size:
add edx,4
shr eax,1
jnz MEM_Alloc_Find_Size
MEM_Alloc_Size_Found:
mov ecx,edx
shr ecx,2
add ecx,4
mov eax,1
shl eax,cl
mov esi,eax
;esi - block size
;edx - offset
call MEM_Heap_Lock
mov ecx,[MEM_heap_count]
dec ecx
shl ecx,4
MEM_Alloc_Find_Heap:
mov eax,[MEM_heap_block+ecx+.heap_linear_address]
cmp dword [eax+edx],0
jnz MEM_Alloc_Use_Existing
sub ecx,16
jns MEM_Alloc_Find_Heap
;create new bucket page
call MEM_Alloc_Page_Linear
call MEM_Get_Heap_Number_Linear
mov ecx,[MEM_heap_block+ecx+.heap_linear_address]
mov [ecx+edx],eax
lea ebx,[eax+4096]
MEM_Alloc_List_loop:
mov [eax],eax
mov [eax+4],eax
add [eax],esi
sub [eax+4],esi
add eax,esi
cmp eax,ebx
jnz MEM_Alloc_List_loop
sub ebx,esi
mov dword [ebx],0
sub eax,4096
mov dword [eax+4],0
mov eax,ecx
MEM_Alloc_Use_Existing:
mov ebx,eax
mov eax,[eax+edx]
mov ecx,[eax]
mov [ebx+edx],ecx
test ecx,ecx
jz MEM_Alloc_Became_Empty
mov dword [ecx+4],0
MEM_Alloc_Became_Empty:
mov ecx,eax
sub ecx,ebx
shr ecx,10
and ecx,0xFFFFFFFC
inc byte [ebx+.range_info+ecx+2]
shr edx,2
add edx,128
dec edx
mov [ebx+.range_info+ecx+3],dl
MEM_Alloc_ret:
call MEM_Heap_UnLock
pop esi
pop edx
pop ecx
pop ebx
ret
MEM_Alloc_Wrong_Size:
xor eax,eax
ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Free
;;Parameters:
;; eax - linear address
;;Result:
;; eax=1 - success
;; eax=0 - failed
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Free
MEM_Free:
test eax,eax
jz MEM_Free_Zero
push ebx
push ecx
push edx
push esi
push edi
push ebp
call MEM_Heap_Lock
call MEM_Get_Heap_Number_Linear
test eax,eax
jz MEM_Free_ret
mov edx,eax
mov ecx,[MEM_heap_block+ecx+.heap_linear_address]
sub edx,ecx
shr edx,10
and edx,0xFFFFFFFC
mov ebx,[ecx+.range_info+edx]
mov esi,ebx
shr esi,24
sub esi,128
mov edi,[ecx+4+4*esi]
mov [eax],edi
mov dword [eax+4],0
test edi,edi
jz MEM_Free_Empty_List
mov [edi+4],eax
MEM_Free_Empty_List:
mov [ecx+4+4*esi],eax
sub ebx,0x10000
mov [ecx+.range_info+edx],ebx
test ebx,0xFF0000
jnz MEM_Free_ret
;delete empty blocks on the page
lea edx,[esi+5]
and eax,0xFFFFF000
mov edi,eax
mov eax,1
xchg ecx,edx
shl eax,cl
mov ecx,edx
mov edx,eax
;edx - size of block
;edi - start of page
mov eax,edi
lea ebx,[eax+4096]
MEM_Free_Block_loop:
cmp dword [eax+4],0
jnz MEM_Free_Block_Not_First
mov ebp,dword [eax]
mov [ecx+4+4*esi],ebp
test ebp,ebp
jz MEM_Free_Block_Last
mov dword [ebp+4],0
MEM_Free_Block_Last:
jmp MEM_Free_Block_loop_end
MEM_Free_Block_Not_First:
mov ebp,dword [eax]
push ebp
mov ebp,dword [eax+4]
pop dword [ebp]
mov ebp,dword [eax]
test ebp,ebp
jz MEM_Free_Block_loop_end
push dword [eax+4]
pop dword [ebp+4]
; jmp MEM_Free_Block_loop_end
MEM_Free_Block_loop_end:
add eax,edx
cmp eax,ebx
jnz MEM_Free_Block_loop
mov eax,edi
call MEM_Free_Page_Linear
MEM_Free_ret:
call MEM_Heap_UnLock
pop ebp
pop edi
pop esi
pop edx
pop ecx
pop ebx
ret
MEM_Free_Zero:
inc eax
ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Add_Reference
;; eax - physical address of page
;;Result:
;; eax=1 - success
;; eax=0 - failed
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Add_Reference
MEM_Add_Reference:
push ebx
push ecx
call MEM_Heap_Lock
call MEM_Get_Heap_Number
test eax,eax
jz MEM_Add_Reference_ret
sub eax,[MEM_heap_block+ecx+.heap_physical_address]
mov ecx,[MEM_heap_block+ecx+.heap_linear_address]
shr eax,10
and eax,0xFFFFFFFC
test dword [ecx+eax+.range_info],0x80000000
jnz MEM_Add_Reference_failed
inc dword [ecx+eax+.range_info]
MEM_Add_Reference_ret:
call MEM_Heap_UnLock
pop ecx
pop ebx
ret
MEM_Add_Reference_failed:
xor eax,eax
jmp MEM_Add_Reference_ret
end if
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;MEM_Add_Reference_Linear
;; eax - linear address of page
;;Result:
;; eax=1 - success
;; eax=0 - failed
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if used MEM_Add_Reference_Linear
MEM_Add_Reference_Linear:
push ebx
push ecx
call MEM_Heap_Lock
call MEM_Get_Heap_Number_Linear
test eax,eax
jz MEM_Add_Reference_Linear_ret
mov ecx,[MEM_heap_block+ecx+.heap_linear_address]
sub eax,ecx
shr eax,10
and eax,0xFFFFFFFC
test dword [ecx+eax+.range_info],0x80000000
jnz MEM_Add_Reference_Linear_failed
inc dword [ecx+eax+.range_info]
mov eax,1
MEM_Add_Reference_Linear_ret:
call MEM_Heap_UnLock
pop ecx
pop ebx
ret
MEM_Add_Reference_Linear_failed:
xor eax,eax
jmp MEM_Add_Reference_Linear_ret
end if
end if ;memmanager.inc
/kernel/tags/kolibri0.6.0.0/docs/sysfuncr.txt
0,0 → 1,4484
‘ˆ‘’…Œ›… ”“Š–ˆˆ Ž…€–ˆŽŽ‰ ‘ˆ‘’…Œ› Kolibri 0.6.0.0
 
®¬¥à ä㭪樨 ¯®¬¥é ¥âáï ¢ ॣ¨áâà eax.
‚맮¢ á¨á⥬­®© ä㭪樨 ®áãé¥á⢫ï¥âáï ª®¬ ­¤®© "int 0x40".
‚ᥠॣ¨áâàë, ªà®¬¥ ® 㪠§ ­­ëå ¢ ¢®§¢à é ¥¬®¬ §­ ç¥­¨¨,
¢ª«îç ï ॣ¨áâà ä« £®¢ eflags, á®åà ­ïîâáï.
 
 
======================================================================
============== ”ã­ªæ¨ï 0 - ®¯à¥¤¥«¨âì ¨ ­ à¨á®¢ âì ®ª­®. =============
======================================================================
Ž¯à¥¤¥«ï¥â ®ª­® ¯à¨«®¦¥­¨ï. ¨áã¥â à ¬ªã ®ª­ , § £®«®¢®ª ¨ à ¡®çãî
®¡« áâì. „«ï ®ª®­ ᮠ᪨­®¬ ®¯à¥¤¥«ï¥â áâ ­¤ àâ­ë¥ ª­®¯ª¨ § ªàëâ¨ï ¨
¬¨­¨¬¨§ æ¨¨.
 à ¬¥âàë:
* eax = 0 - ­®¬¥à ä㭪樨
* ebx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [à §¬¥à ¯® ®á¨ x]
* ecx = [ª®®à¤¨­ â  ¯® ®á¨ y]*65536 + [à §¬¥à ¯® ®á¨ y]
* edx = 0xXYRRGGBB, £¤¥:
* Y = áâ¨«ì ®ª­ :
* Y=0 - ⨯ I - ®ª­® 䨪á¨à®¢ ­­ëå à §¬¥à®¢
* Y=1 - ⮫쪮 ®¯à¥¤¥«¨âì ®¡« áâì ®ª­ , ­¨ç¥£® ­¥ à¨á®¢ âì
* Y=2 - ⨯ II - ®ª­® ¨§¬¥­ï¥¬ëå à §¬¥à®¢
* Y=3 - ®ª­® ᮠ᪨­®¬
* ®áâ «ì­ë¥ ¢®§¬®¦­ë¥ §­ ç¥­¨ï (®â 4 ¤® 15) § à¥§¥à¢¨à®¢ ­ë,
¢ë§®¢ ä㭪樨 á â ª¨¬¨ Y ¨£­®à¨àã¥âáï
* RR, GG, BB = ᮮ⢥âá⢥­­® ªà á­ ï, §¥«¥­ ï, ᨭïï
á®áâ ¢«ïî騥 æ¢¥â  à ¡®ç¥© ®¡« á⨠®ª­ 
(¨£­®à¨àã¥âáï ¤«ï á⨫ï Y=2)
* X = DCBA (¡¨âë)
* A = 1 - ã ®ª­  ¥áâì § £®«®¢®ª; ¤«ï á⨫ï Y=3  ¤à¥á áâப¨
§ £®«®¢ª  § ¤ ñâáï ¢ edi, ¤«ï ¯à®ç¨å á⨫¥©
¨á¯®«ì§ã¥âáï ¯®¤äã­ªæ¨ï 1 ä㭪樨 71
* B = 1 - ª®®à¤¨­ âë ¢á¥å £à ä¨ç¥áª¨å ¯à¨¬¨â¨¢®¢ § ¤ îâáï
®â­®á¨â¥«ì­® ª«¨¥­â᪮© ®¡« á⨠®ª­ 
* C § à¥§¥à¢¨à®¢ ­ (ãáâ ­ ¢«¨¢ ©â¥ ¢ 0)
* D = 0 - ­®à¬ «ì­ ï § «¨¢ª  à ¡®ç¥© ®¡« áâ¨, 1 - £à ¤¨¥­â­ ï
‘«¥¤ãî騥 ¯ à ¬¥âàë ¯à¥¤­ §­ ç¥­ë ¤«ï ®ª®­ ⨯  I ¨ II ¨
¨£­®à¨àãîâáï ¤«ï á⨫¥© Y=1,3:
* esi = 0xXYRRGGBB - 梥⠧ £®«®¢ª 
* RR, GG, BB ®¯à¥¤¥«ïîâ á ¬ 梥â
* Y=0 - ®¡ëç­®¥ ®ª­®, Y=1 - ­¥¯¥à¥¬¥é ¥¬®¥ ®ª­®
* X ®¯à¥¤¥«ï¥â £à ¤¨¥­â § £®«®¢ª : X=0 - ­¥â £à ¤¨¥­â ,
X=8 - ®¡ëç­ë© £à ¤¨¥­â,
¤«ï ®ª®­ ⨯  II X=4 - ­¥£ â¨¢­ë© £à ¤¨¥­â
* ¯à®ç¨¥ §­ ç¥­¨ï X ¨ Y § à¥§¥à¢¨à®¢ ­ë
* edi = 0x00RRGGBB - 梥â à ¬ª¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ®«®¦¥­¨¥ ¨ à §¬¥àë ®ª­  ãáâ ­ ¢«¨¢ îâáï ¯à¨ ¯¥à¢®¬ ¢ë§®¢¥
í⮩ ä㭪樨 ¨ ¨£­®à¨àãîâáï ¯à¨ ¯®á«¥¤ãîé¨å; ¤«ï ¨§¬¥­¥­¨ï
¯®«®¦¥­¨ï ¨/¨«¨ à §¬¥à®¢ 㦥 ᮧ¤ ­­®£® ®ª­  ¨á¯®«ì§ã©â¥
67-î äã­ªæ¨î.
* „«ï ®ª®­ á⨫ï Y=3 á § £®«®¢ª®¬ (A=1) áâப  § £®«®¢ª 
ãáâ ­ ¢«¨¢ ¥âáï ¯à¨ ¯¥à¢®¬ ¢ë§®¢¥ í⮩ ä㭪樨 ¨ ¨£­®à¨àã¥âáï ¯à¨
¯®á«¥¤ãîé¨å (â®ç­¥¥ £®¢®àï, ¨£­®à¨àã¥âáï ¯®á«¥ ¢ë§®¢ 
¯®¤ä㭪樨 2 ä㭪樨 12 - ª®­æ  ¯¥à¥à¨á®¢ª¨);
¤«ï ¨§¬¥­¥­¨ï áâப¨ § £®«®¢ª  㦥 ᮧ¤ ­­®£® ®ª­  ¨á¯®«ì§ã©â¥
¯®¤äã­ªæ¨î 1 ä㭪樨 71.
* …᫨ ¨á¯®«ì§®¢ âì ®ª­  ᮮ⢥âáâ¢ãîé¨å á⨫¥©, â® ¯®«®¦¥­¨¥
¨/¨«¨ à §¬¥àë ®ª­  ¬®£ãâ ¬¥­ïâìáï ¯®«ì§®¢ â¥«¥¬.
’¥ªã騥 ¯®«®¦¥­¨¥ ¨ à §¬¥àë ¬®£ãâ ¡ëâì ¯®«ãç¥­ë ¢ë§®¢®¬ ä㭪樨 9.
* Žª­® ¤®«¦­® 㬥é âìáï ­  íªà ­¥. …᫨ ¯¥à¥¤ ­­ë¥ ª®®à¤¨­ âë
¨ à §¬¥àë ­¥ 㤮¢«¥â¢®àïîâ í⮬ã ãá«®¢¨î, ⮠ᮮ⢥âáâ¢ãîé ï
ª®®à¤¨­ â  (¨«¨, ¢®§¬®¦­®, ®¡¥) áç¨â ¥âáï ­ã«¥¬,   ¥á«¨ ¨ íâ®
­¥ ¯®¬®£ ¥â, ⮠ᮮ⢥âáâ¢ãî騩 à §¬¥à (¨«¨, ¢®§¬®¦­®, ®¡ )
ãáâ ­ ¢«¨¢ ¥âáï ¢ à §¬¥à íªà ­ .
„ «¥¥ ®¡®§­ ç¨¬ xpos,ypos,xsize,ysize - §­ ç¥­¨ï, ¯¥à¥¤ ¢ ¥¬ë¥
¢ ebx,ecx. Š®®à¤¨­ âë ¯à¨¢®¤ïâáï ®â­®á¨â¥«ì­® «¥¢®£® ¢¥àå­¥£®
㣫  ®ª­ , ª®â®àë©, â ª¨¬ ®¡à §®¬, § ¤ ¥âáï ª ª (0,0), ª®®à¤¨­ âë
¯à ¢®£® ­¨¦­¥£® 㣫  áãâì (xsize,ysize).
*  §¬¥àë ®ª­  ¯®­¨¬ îâáï ¢ á¬ëá«¥ ª®®à¤¨­ â ¯à ¢®£® ­¨¦­¥£® 㣫 .
â® ¦¥ ®â­®á¨âáï ¨ ª® ¢á¥¬ ®áâ «ì­ë¬ äã­ªæ¨ï¬.
â® ®§­ ç ¥â, ç⮠ॠ«ì­ë¥ à §¬¥àë ­  1 ¯¨ªá¥«ì ¡®«ìè¥.
* ‚¨¤ ®ª­  ⨯  I:
* à¨áã¥âáï ¢­¥è­ïï à ¬ª  梥â , 㪠§ ­­®£® ¢ edi,
è¨à¨­®© 1 ¯¨ªá¥«ì
* à¨áã¥âáï § £®«®¢®ª - ¯àאַ㣮«ì­¨ª á «¥¢ë¬ ¢¥àå­¨¬ 㣫®¬ (1,1)
¨ ¯à ¢ë¬ ­¨¦­¨¬ (xsize-1,min(25,ysize)) 梥â , 㪠§ ­­®£® ¢ esi
(á ãç¥â®¬ £à ¤¨¥­â )
* ¥á«¨ ysize>=26, â® § ªà è¨¢ ¥âáï à ¡®ç ï ®¡« áâì ®ª­  -
¯àאַ㣮«ì­¨ª á «¥¢ë¬ ¢¥àå­¨¬ 㣫®¬ (1,21) ¨ ¯à ¢ë¬ ­¨¦­¨¬
(xsize-1,ysize-1) (à §¬¥à ¬¨ (xsize-1)*(ysize-21)) - 梥⮬,
㪠§ ­­ë¬ ¢ edx (á ãç¥â®¬ £à ¤¨¥­â )
* ¥á«¨ A=1 ¨ áâப  § £®«®¢ª  ãáâ ­®¢«¥­  ¯®¤ä㭪樥© 1
ä㭪樨 71, â® ®­  ¢ë¢®¤¨âáï ¢ ᮮ⢥âáâ¢ãî饬 ¬¥á⥠§ £®«®¢ª 
* ‚¨¤ ®ª­  á⨫ï Y=1:
* ¯®«­®áâìî ®¯à¥¤¥«ï¥âáï ¯à¨«®¦¥­¨¥¬
* ‚¨¤ ®ª­  ⨯  II:
* à¨áã¥âáï ¢­¥è­ïï à ¬ª  è¨à¨­®© 1 ¯¨ªá¥«ì "§ â¥­ñ­­®£®" 梥â 
edi (¢á¥ á®áâ ¢«ïî騥 æ¢¥â  ã¬¥­ìè îâáï ¢ ¤¢  à § )
* à¨áã¥âáï ¯à®¬¥¦ãâ®ç­ ï à ¬ª  è¨à¨­®© 3 ¯¨ªá¥«ï æ¢¥â  edi
* à¨áã¥âáï ¢­ãâ७­ïï à ¬ª  è¨à¨­®© 1 ¯¨ªá¥«ì
"§ â¥­ñ­­®£®" æ¢¥â  edi
* à¨áã¥âáï § £®«®¢®ª - ¯àאַ㣮«ì­¨ª á «¥¢ë¬ ¢¥àå­¨¬ 㣫®¬ (4,4)
¨ ¯à ¢ë¬ ­¨¦­¨¬ (xsize-4,min(20,ysize)) 梥â , 㪠§ ­­®£® ¢ esi
(á ãç¥â®¬ £à ¤¨¥­â )
* ¥á«¨ ysize>=26, â® § ªà è¨¢ ¥âáï à ¡®ç ï ®¡« áâì ®ª­  -
¯àאַ㣮«ì­¨ª á «¥¢ë¬ ¢¥àå­¨¬ 㣫®¬ (5,20) ¨ ¯à ¢ë¬ ­¨¦­¨¬
(xsize-5,ysize-5) - 梥⮬, 㪠§ ­­ë¬ ¢ edx (á ãç¥â®¬ £à ¤¨¥­â )
* ¥á«¨ A=1 ¨ áâப  § £®«®¢ª  ãáâ ­®¢«¥­  ¯®¤ä㭪樥© 1
ä㭪樨 71, â® ®­  ¢ë¢®¤¨âáï ¢ ᮮ⢥âáâ¢ãî饬 ¬¥á⥠§ £®«®¢ª 
* ‚¨¤ ®ª­  ᮠ᪨­®¬:
* à¨áã¥âáï ¢­¥è­ïï à ¬ª  è¨à¨­®© 1 ¯¨ªá¥«ì
æ¢¥â  'outer' ¨§ ᪨­ 
* à¨áã¥âáï ¯à®¬¥¦ãâ®ç­ ï à ¬ª  è¨à¨­®© 3 ¯¨ªá¥«ï
æ¢¥â  'frame' ¨§ ᪨­ 
* à¨áã¥âáï ¢­ãâ७­ïï à ¬ª  è¨à¨­®© 1 ¯¨ªá¥«ì
æ¢¥â  'inner' ¨§ ᪨­ 
* à¨áã¥âáï § £®«®¢®ª (¯® ª à⨭ª ¬ ¨§ ᪨­ ) ¢ ¯àאַ㣮«ì­¨ª¥
(0,0) - (xsize,_skinh-1)
* ¥á«¨ ysize>=26, â® § ªà è¨¢ ¥âáï à ¡®ç ï ®¡« áâì ®ª­  -
¯àאַ㣮«ì­¨ª á «¥¢ë¬ ¢¥àå­¨¬ 㣫®¬ (5,_skinh) ¨ ¯à ¢ë¬ ­¨¦­¨¬
(xsize-5,ysize-5) - 梥⮬, 㪠§ ­­ë¬ ¢ edx (á ãç¥â®¬ £à ¤¨¥­â )
* ®¯à¥¤¥«ïîâáï ¤¢¥ áâ ­¤ àâ­ë¥ ª­®¯ª¨: § ªàëâ¨ï ¨ ¬¨­¨¬¨§ æ¨¨
(ᬮâਠäã­ªæ¨î 8)
* ¥á«¨ A=1 ¨ ¢ edi (­¥­ã«¥¢®©) 㪠§ â¥«ì ­  áâப㠧 £®«®¢ª ,
â® ®­  ¢ë¢®¤¨âáï ¢ § £®«®¢ª¥ ¢ ¬¥áâ¥, ®¯à¥¤¥«ï¥¬®¬ ᪨­®¬
* ‡­ ç¥­¨¥ ¯¥à¥¬¥­­®© _skinh ¤®áâ㯭® ª ª १ã«ìâ â ¢ë§®¢ 
¯®¤ä㭪樨 4 ä㭪樨 48
 
======================================================================
================= ”ã­ªæ¨ï 1 - ¯®áâ ¢¨âì â®çªã ¢ ®ª­¥. ================
======================================================================
 à ¬¥âàë:
* eax = 1 - ­®¬¥à ä㭪樨
* ebx = x-ª®®à¤¨­ â  (®â­®á¨â¥«ì­® ®ª­ )
* ecx = y-ª®®à¤¨­ â  (®â­®á¨â¥«ì­® ®ª­ )
* edx = 0x00RRGGBB - 梥â â®çª¨
edx = 0x01xxxxxx - ¨­¢¥àâ¨à®¢ âì 梥â â®çª¨
(¬« ¤è¨¥ 24 ¡¨â  ¨£­®à¨àãîâáï)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
 
======================================================================
============== ”ã­ªæ¨ï 2 - ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª« ¢¨è¨. =============
======================================================================
‡ ¡¨à ¥â ª®¤ ­ ¦ â®© ª« ¢¨è¨ ¨§ ¡ãä¥à .
 à ¬¥âàë:
* eax = 2 - ­®¬¥à ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ¥á«¨ ¡ãä¥à ¯ãáâ, ¢®§¢à é ¥âáï eax=1
* ¥á«¨ ¡ãä¥à ­¥¯ãáâ, â® ¢®§¢à é ¥âáï al=0, ah=ª®¤ ­ ¦ â®© ª« ¢¨è¨,
áâ à襥 á«®¢® ॣ¨áâà  eax ®¡­ã«¥­®
* ¥á«¨ ¥áâì "£®àïç ï ª« ¢¨è ", â® ¢®§¢à é ¥âáï
al=2, ah=᪠­ª®¤ ­ ¦ â®© ª« ¢¨è¨ (0 ¤«ï ã¯à ¢«ïîé¨å ª« ¢¨è),
áâ à襥 á«®¢® ॣ¨áâà  eax ᮤ¥à¦¨â á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
¢ ¬®¬¥­â ­ ¦ â¨ï £®àï祩 ª« ¢¨è¨
‡ ¬¥ç ­¨ï:
* ‘ãé¥áâ¢ã¥â ®¡é¥á¨á⥬­ë© ¡ãä¥à ­ ¦ âëå ª« ¢¨è à §¬¥à®¬ 120 ¡ ©â,
®à£ ­¨§®¢ ­­ë© ª ª ®ç¥à¥¤ì.
* ‘ãé¥áâ¢ã¥â ¥éñ ®¤¨­ ®¡é¥á¨á⥬­ë© ¡ãä¥à ­  120 "£®àïç¨å ª« ¢¨è".
* à¨ ¢ë§®¢¥ í⮩ ä㭪樨 ¯à¨«®¦¥­¨¥¬ á ­¥ ªâ¨¢­ë¬ ®ª­®¬
áç¨â ¥âáï, çâ® ¡ãä¥à ­ ¦ âëå ª« ¢¨è ¯ãáâ.
* ® 㬮«ç ­¨î íâ  äã­ªæ¨ï ¢®§¢à é ¥â ASCII-ª®¤ë; ¯¥à¥ª«îç¨âìáï ­ 
०¨¬ ᪠­ª®¤®¢ (¨ ­ § ¤) ¬®¦­® á ¨á¯®«ì§®¢ ­¨¥¬ ä㭪樨 66.
Ž¤­ ª®, £®àï稥 ª« ¢¨è¨ ¢á¥£¤  ¢®§¢à é îâáï ª ª ᪠­ª®¤ë.
* “§­ âì, ª ª¨¥ ª®¬¡¨­ æ¨¨ ª« ¢¨è ᮮ⢥âáâ¢ãîâ ª ª¨¬ ª®¤ ¬, ¬®¦­®,
§ ¯ãá⨢ ¯à¨«®¦¥­¨ï keyascii ¨ scancode.
* ‘ª ­ª®¤ë ¢®§¢à é îâáï ­¥¯®á।á⢥­­® ª« ¢¨ âãன ¨ 䨪á¨à®¢ ­ë;
ASCII-ª®¤ë ¯®«ãç îâáï á ¨á¯®«ì§®¢ ­¨¥¬ â ¡«¨æ ¯à¥®¡à §®¢ ­¨ï,
ª®â®àë¥ ¬®¦­® ãáâ ­®¢¨âì ¯®¤ä㭪樥© 2 ä㭪樨 21 ¨ ¯à®ç¨â âì
¯®¤ä㭪樥© 2 ä㭪樨 26.
* Š ª á«¥¤á⢨¥, ASCII-ª®¤ë ãç¨â뢠îâ ⥪ãéãî à áª« ¤ªã ª« ¢¨ âãàë
(rus/en) ¢ ®â«¨ç¨¥ ®â ᪠­ª®¤®¢.
* ®áâ㯠¥â ¨­ä®à¬ æ¨ï ⮫쪮 ® â¥å £®àïç¨å ª« ¢¨è å, ª®â®àë¥ ¡ë«¨
®¯à¥¤¥«¥­ë í⨬ ¯®â®ª®¬ ¯®¤ä㭪樥© 4 ä㭪樨 66.
 
======================================================================
================ ”ã­ªæ¨ï 3 - ¯®«ãç¨âì á¨á⥬­®¥ ¢à¥¬ï. ===============
======================================================================
 à ¬¥âàë:
* eax = 3 - ­®¬¥à ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0x00SSMMHH, £¤¥ HH:MM:SS = ç áë:¬¨­ãâë:ᥪ㭤ë
* ª ¦¤ë© í«¥¬¥­â ¢®§¢à é ¥âáï ª ª BCD-ç¨á«®, ­ ¯à¨¬¥à,
¤«ï ¢à¥¬¥­¨ 23:59:59 १ã«ìâ â ¡ã¤¥â 0x00595923
‡ ¬¥ç ­¨ï:
* ‘¬®âਠ⠪¦¥ ¯®¤äã­ªæ¨î 9 ä㭪樨 26 - ¯®«ã祭¨¥ ¢à¥¬¥­¨
á ¬®¬¥­â  § ¯ã᪠ á¨á⥬ë; ®­  ¢® ¬­®£¨å á«ãç ïå 㤮¡­¥¥,
¯®áª®«ìªã ¢®§¢à é ¥â ¯à®áâ® DWORD-§­ ç¥­¨¥ áç¥â稪  ¢à¥¬¥­¨.
* ‘¨á⥬­®¥ ¢à¥¬ï ¬®¦­® ãáâ ­®¢¨âì ä㭪樥© 22.
 
======================================================================
============== ”ã­ªæ¨ï 4 - ¢ë¢¥á⨠áâபã ⥪áâ  ¢ ®ª­®. =============
======================================================================
 à ¬¥âàë:
* eax = 4 - ­®¬¥à ä㭪樨
* ebx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [ª®®à¤¨­ â  ¯® ®á¨ y]
* ecx = 0xX0RRGGBB, £¤¥
* RR, GG, BB § ¤ îâ 梥â ⥪áâ 
* X=ABnn (¡¨âë):
* nn § ¤ ¥â ¨á¯®«ì§ã¥¬ë© èà¨äâ: 0=á¨á⥬­ë© ¬®­®è¨à¨­­ë©,
1=á¨á⥬­ë© èà¨äâ ¯¥à¥¬¥­­®© è¨à¨­ë
* A=0 - ¢ë¢®¤¨âì esi ᨬ¢®«®¢, A=1 - ¢ë¢®¤¨âì ASCIIZ-áâபã
* B=1 - § ªà è¨¢ âì ä®­ 梥⮬ edi
* edx = 㪠§ â¥«ì ­  ­ ç «® áâப¨
* esi = ¤«ï A=0 ¤«¨­  áâப¨, ¤®«¦­  ¡ëâì ­¥ ¡®«ìè¥ 255;
¤«ï A=1 ¨£­®à¨àã¥âáï
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ¥à¢ë© á¨á⥬­ë© èà¨äâ áç¨â뢠¥âáï ¯à¨ § £à㧪¥ ¨§ ä ©«  char.mt,
¢â®à®© - ¨§ char2.mt.
* Ž¡  èà¨äâ  ¨¬¥îâ ¢ëá®âã 9 ¯¨ªá¥«¥©, è¨à¨­  ¬®­®è¨à¨­­®£® èà¨äâ 
à ¢­  6 ¯¨ªá¥«¥©.
 
======================================================================
========================= ”ã­ªæ¨ï 5 - ¯ ã§ . =========================
======================================================================
‡ ¤¥à¦¨¢ ¥â ¢ë¯®«­¥­¨¥ ¯à®£à ¬¬ë ­  § ¤ ­­®¥ ¢à¥¬ï.
 à ¬¥âàë:
* eax = 5 - ­®¬¥à ä㭪樨
* ebx = ¢à¥¬ï ¢ á®âëå ¤®«ïå ᥪ㭤ë
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ¥à¥¤ ç  ebx=0 ­¥ ¯¥à¥¤ ¥â ã¯à ¢«¥­¨¥ á«¥¤ãî饬㠯à®æ¥ááã ¨
¢®®¡é¥ ­¥ ¯à®¨§¢®¤¨â ­¨ª ª¨å ¤¥©á⢨©. …᫨ ¤¥©á⢨⥫쭮
âॡã¥âáï ¯¥à¥¤ âì ã¯à ¢«¥­¨¥ á«¥¤ãî饬㠯à®æ¥ááã
(§ ª®­ç¨âì ⥪ã騩 ª¢ ­â ¢à¥¬¥­¨), ¨á¯®«ì§ã©â¥ ¯®¤äã­ªæ¨î 1
ä㭪樨 68.
* à¨ ⥪ã饩 ॠ«¨§ æ¨¨ ¯à®¨§®©¤¥â ­¥¬¥¤«¥­­ë© ¢®§¢à â ¨§ ä㭪樨,
¥á«¨ á«®¦¥­¨¥ ebx á ⥪ã騬 §­ ç¥­¨¥¬ áç¥â稪  ¢à¥¬¥­¨ ¢ë§®¢¥â
32-¡¨â­®¥ ¯¥à¥¯®«­¥­¨¥.
 
======================================================================
=============== ”ã­ªæ¨ï 6 - ¯à®ç¨â âì ä ©« á à ¬¤¨áª . ===============
======================================================================
 à ¬¥âàë:
* eax = 6 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨¬ï ä ©« 
* ecx = ­®¬¥à áâ à⮢®£® ¡«®ª , áç¨â ï á 1;
ecx=0 - ç¨â âì á ­ ç «  ä ©«  (â® ¦¥ á ¬®¥, çâ® ¨ ecx=1)
* edx = ç¨á«® ¡«®ª®¢ ¤«ï ç⥭¨ï;
edx=0 - ç¨â âì ®¤¨­ ¡«®ª (â® ¦¥ á ¬®¥, çâ® ¨ edx=1)
* esi = 㪠§ â¥«ì ­  ®¡« áâì ¯ ¬ïâ¨, ªã¤  ¡ã¤ãâ § ¯¨á ­ë ¤ ­­ë¥
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ¤«¨­  ä ©«  ¢ ¡ ©â å, ¥á«¨ ä ©« ãᯥ譮 ¯à®ç¨â ­
* eax = -1, ¥á«¨ ä ©« ­¥ ­ ©¤¥­
‡ ¬¥ç ­¨ï:
* „ ­­ ï äã­ªæ¨ï ï¥âáï ãáâ à¥¢è¥©; äã­ªæ¨ï 70
¯®§¢®«ï¥â ¢ë¯®«­ïâì ⥠¦¥ ¤¥©á⢨ï á à áè¨à¥­­ë¬¨ ¢®§¬®¦­®áâﬨ.
* «®ª = 512 ¡ ©â.
* „«ï ç⥭¨ï ¢á¥£® ä ©«  ¬®¦­® 㪠§ âì § ¢¥¤®¬® ¡®«ì讥 §­ ç¥­¨¥
¢ edx, ­ ¯à¨¬¥à, edx = -1; ­® ¢ í⮬ á«ãç ¥ ¡ã¤ì⥠£®â®¢ë ª ⮬ã,
çâ® ¯à®£à ¬¬  "㯠¤¥â", ¥á«¨ ä ©« ®ª ¦¥âáï ᫨誮¬ ¡®«ì訬
¨ "­¥ ¢«¥§¥â" ¢ ¯ ¬ïâì ¯à®£à ¬¬ë.
* ˆ¬ï ä ©«  ¤®«¦­® ¡ëâì «¨¡® ¢ ä®à¬ â¥ 8+3 ᨬ¢®«®¢
(¯¥à¢ë¥ 8 ᨬ¢®«®¢ - ᮡá⢥­­® ¨¬ï, ¯®á«¥¤­¨¥ 3 - à áè¨à¥­¨¥,
ª®à®âª¨¥ ¨¬¥­  ¨ à áè¨à¥­¨ï ¤®¯®«­ïîâáï ¯à®¡¥« ¬¨),
«¨¡® ¢ ä®à¬ â¥ 8.3 ᨬ¢®«®¢ "FILE.EXT"/"FILE.EX "
(¨¬ï ­¥ ¡®«¥¥ 8 ᨬ¢®«®¢, â®çª , à áè¨à¥­¨¥ 3 ᨬ¢®« ,
¤®¯®«­¥­­®¥ ¯à¨ ­¥®¡å®¤¨¬®á⨠¯à®¡¥« ¬¨).
ˆ¬ï ä ©«  ¤®«¦­® ¡ëâì § ¯¨á ­® § £« ¢­ë¬¨ ¡ãª¢ ¬¨.
‡ ¢¥àè î騩 ᨬ¢®« á ª®¤®¬ 0 ­¥ ­ã¦¥­ (­¥ ASCIIZ-áâப ).
* â  äã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥â ¯ ¯ª¨ ­  à ¬¤¨áª¥.
 
======================================================================
=============== ”ã­ªæ¨ï 7 - ¢ë¢¥á⨠¨§®¡à ¦¥­¨¥ ¢ ®ª­®. ==============
======================================================================
 à ¬¥âàë:
* eax = 7 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨§®¡à ¦¥­¨¥ ¢ ä®à¬ â¥ BBGGRRBBGGRR...
* ecx = [à §¬¥à ¯® ®á¨ x]*65536 + [à §¬¥à ¯® ®á¨ y]
* edx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [ª®®à¤¨­ â  ¯® ®á¨ y]
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* Š®®à¤¨­ âë ¨§®¡à ¦¥­¨ï - íâ® ª®®à¤¨­ âë ¢¥àå­¥£® «¥¢®£® 㣫 
¨§®¡à ¦¥­¨ï ®â­®á¨â¥«ì­® ®ª­ .
*  §¬¥à ¨§®¡à ¦¥­¨ï ¢ ¡ ©â å ¥áâì 3*xsize*ysize.
 
======================================================================
=============== ”ã­ªæ¨ï 8 - ®¯à¥¤¥«¨âì/㤠«¨âì ª­®¯ªã. ===============
======================================================================
 à ¬¥âàë ¤«ï ®¯à¥¤¥«¥­¨ï ª­®¯ª¨:
* eax = 8 - ­®¬¥à ä㭪樨
* ebx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [à §¬¥à ¯® ®á¨ x]
* ecx = [ª®®à¤¨­ â  ¯® ®á¨ y]*65536 + [à §¬¥à ¯® ®á¨ y]
* edx = 0xXYnnnnnn, £¤¥:
* nnnnnn = ¨¤¥­â¨ä¨ª â®à ª­®¯ª¨
* áâ à訩 (31-©) ¡¨â edx á¡à®è¥­
* ¥á«¨ 30-© ¡¨â edx ãáâ ­®¢«¥­ - ­¥ ¯à®à¨á®¢ë¢ âì ª­®¯ªã
* ¥á«¨ 29-© ¡¨â edx ãáâ ­®¢«¥­ - ­¥ à¨á®¢ âì à ¬ªã
¯à¨ ­ ¦ â¨¨ ­  ª­®¯ªã
* esi = 0x00RRGGBB - 梥⠪­®¯ª¨
 à ¬¥âàë ¤«ï 㤠«¥­¨ï ª­®¯ª¨:
* eax = 8 - ­®¬¥à ä㭪樨
* edx = 0x80nnnnnn, £¤¥ nnnnnn - ¨¤¥­â¨ä¨ª â®à ª­®¯ª¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
*  §¬¥àë ª­®¯ª¨ ¤®«¦­ë ¡ëâì ¡®«ìè¥ 0 ¨ ¬¥­ìè¥ 0x8000.
* „«ï ®ª®­ ᮠ᪨­®¬ ¯à¨ ®¯à¥¤¥«¥­¨¨ ®ª­  (¢ë§®¢¥ 0-© ä㭪樨)
ᮧ¤ îâáï ¤¢¥ áâ ­¤ àâ­ë¥ ª­®¯ª¨ - § ªàëâ¨ï ®ª­ 
á ¨¤¥­â¨ä¨ª â®à®¬ 1 ¨ ¬¨­¨¬¨§ æ¨¨ ®ª­  á ¨¤¥­â¨ä¨ª â®à®¬ 0xffff.
* ‘®§¤ ­¨¥ ¤¢ãå ª­®¯®ª á ®¤¨­ ª®¢ë¬¨ ¨¤¥­â¨ä¨ª â®à ¬¨
¢¯®«­¥ ¤®¯ãá⨬®.
* Š­®¯ª  á ¨¤¥­â¨ä¨ª â®à®¬ 0xffff ¯à¨ ­ ¦ â¨¨ ¨­â¥à¯à¥â¨àã¥âáï
á¨á⥬®© ª ª ª­®¯ª  ¬¨­¨¬¨§ æ¨¨, á¨á⥬  ®¡à ¡ â뢠¥â â ª®¥
­ ¦ â¨¥ á ¬®áâ®ï⥫쭮, ­¥ ®¡à é ïáì ª ¯à¨«®¦¥­¨î.
‚ ®áâ «ì­®¬ íâ® ®¡ëç­ ï ª­®¯ª .
* Ž¡é¥¥ ª®«¨ç¥á⢮ ª­®¯®ª ¤«ï ¢á¥å ¯à¨«®¦¥­¨© ®£à ­¨ç¥­®
ç¨á«®¬ 4095.
 
======================================================================
============= ”ã­ªæ¨ï 9 - ¨­ä®à¬ æ¨ï ® ¯®â®ª¥ ¢ë¯®«­¥­¨ï. ============
======================================================================
 à ¬¥âàë:
* eax = 9 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¡ãä¥à à §¬¥à  1 Š¡
* ecx = ­®¬¥à á«®â  ¯®â®ª 
ecx = -1 - ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ⥪ã饬 ¯®â®ª¥
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ¬ ªá¨¬ «ì­ë© ­®¬¥à á«®â  ¯®â®ª 
* ¡ãä¥à, ­  ª®â®àë© ãª §ë¢ ¥â ebx, ᮤ¥à¦¨â á«¥¤ãîéãî ¨­ä®à¬ æ¨î:
* +0: dword: ¨á¯®«ì§®¢ ­¨¥ ¯à®æ¥áá®à  (᪮«ìª® ⠪⮢ ¢ ᥪ㭤ã
ã室¨â ­  ¨á¯®«­¥­¨¥ ¨¬¥­­® í⮣® ¯®â®ª )
* +4: word: ¯®§¨æ¨ï ®ª­  ¯®â®ª  ¢ ®ª®­­®¬ áâíª¥
* +6: word: (­¥ ¨¬¥¥â ®â­®è¥­¨ï ª § ¯à®è¥­­®¬ã ¯®â®ªã)
­®¬¥à á«®â  ¯®â®ª , ®ª­® ª®â®à®£® ­ å®¤¨âáï ¢ ®ª®­­®¬ áâíª¥
¢ ¯®§¨æ¨¨ ecx
* +8: word: § à¥§¥à¢¨à®¢ ­®
* +10 = +0xA: 11 ¡ ©â: ¨¬ï ¯à®æ¥áá 
(¨¬ï ᮮ⢥âáâ¢ãî饣® ¨á¯®«­ï¥¬®£® ä ©«  ¢ ä®à¬ â¥ 8+3)
* +21 = +0x15: byte: § à¥§¥à¢¨à®¢ ­®, íâ®â ¡ ©â ­¥ ¨§¬¥­ï¥âáï
* +22 = +0x16: dword:  ¤à¥á ¯à®æ¥áá  ¢ ¯ ¬ïâ¨
* +26 = +0x1A: dword: à §¬¥à ¨á¯®«ì§ã¥¬®© ¯ ¬ï⨠- 1
* +30 = +0x1E: dword: ¨¤¥­â¨ä¨ª â®à (PID/TID)
* +34 = +0x22: dword: ª®®à¤¨­ â  ®ª­  ¯®â®ª  ¯® ®á¨ x
* +38 = +0x26: dword: ª®®à¤¨­ â  ®ª­  ¯®â®ª  ¯® ®á¨ y
* +42 = +0x2A: dword: à §¬¥à ®ª­  ¯®â®ª  ¯® ®á¨ x
* +46 = +0x2E: dword: à §¬¥à ®ª­  ¯®â®ª  ¯® ®á¨ y
* +50 = +0x32: word: á®áâ®ï­¨¥ á«®â  ¯®â®ª :
* 0 = ¯®â®ª ¢ë¯®«­ï¥âáï
* 1 = ¯®â®ª ¯à¨®áâ ­®¢«¥­
* 2 = ¯®â®ª ¯à¨®áâ ­®¢«¥­ ¢ ¬®¬¥­â ®¦¨¤ ­¨ï ᮡëâ¨ï
* 3 = ¯®â®ª § ¢¥àè ¥âáï ¢ १ã«ìâ â¥ ¢ë§®¢  ä㭪樨 -1 ¨«¨
­ á¨«ìá⢥­­® ª ª á«¥¤á⢨¥ ¢ë§®¢  ¯®¤ä㭪樨 2 ä㭪樨 18
¨«¨ § ¢¥à襭¨ï à ¡®âë á¨á⥬ë
* 4 = ¯®â®ª § ¢¥àè ¥âáï ¢ १ã«ìâ â¥ ¨áª«î祭¨ï
* 5 = ¯®â®ª ®¦¨¤ ¥â ᮡëâ¨ï
* 9 = § ¯à®è¥­­ë© á«®â ᢮¡®¤¥­, ¢áï ®áâ «ì­ ï ¨­ä®à¬ æ¨ï ®
᫮⥠­¥ ¨¬¥¥â á¬ëá« 
* +52 = +0x34: word: § à¥§¥à¢¨à®¢ ­®, íâ® á«®¢® ­¥ ¨§¬¥­ï¥âáï
* +54 = +0x36: dword: ª®®à¤¨­ â  ­ ç «  ª«¨¥­â᪮© ®¡« áâ¨
¯® ®á¨ x
* +58 = +0x3A: dword: ª®®à¤¨­ â  ­ ç «  ª«¨¥­â᪮© ®¡« áâ¨
¯® ®á¨ y
* +62 = +0x3E: dword: è¨à¨­  ª«¨¥­â᪮© ®¡« áâ¨
* +66 = +0x42: dword: ¢ëá®â  ª«¨¥­â᪮© ®¡« áâ¨
* +70 = +0x46: byte: á®áâ®ï­¨¥ ®ª­  - ¡¨â®¢®¥ ¯®«¥
* ¡¨â 0 (¬ áª  1): ®ª­® ¬ ªá¨¬¨§¨à®¢ ­®
* ¡¨â 1 (¬ áª  2): ®ª­® ¬¨­¨¬¨§¨à®¢ ­® ¢ ¯ ­¥«ì § ¤ ç
* ¡¨â 2 (¬ áª  4): ®ª­® á¢ñà­ãâ® ¢ § £®«®¢®ª
‡ ¬¥ç ­¨ï:
* ‘«®âë ­ã¬¥àãîâáï á 1.
* ‚®§¢à é ¥¬®¥ §­ ç¥­¨¥ ­¥ ¥áâì ®¡é¥¥ ç¨á«® ¯®â®ª®¢, ¯®áª®«ìªã
¡ë¢ îâ ᢮¡®¤­ë¥ á«®âë.
* à¨ ᮧ¤ ­¨¨ ¯à®æ¥áá   ¢â®¬ â¨ç¥áª¨ ᮧ¤ ¥âáï ¯®â®ª ¢ë¯®«­¥­¨ï.
* ”ã­ªæ¨ï ¢ë¤ ¥â ¨­ä®à¬ æ¨î ® ¯®â®ª¥. Š ¦¤ë© ¯à®æ¥áá ¨¬¥¥â
å®âï ¡ë ®¤¨­ ¯®â®ª. Ž¤¨­ ¯à®æ¥áá ¬®¦¥â ᮧ¤ âì ­¥áª®«ìª® ¯®â®ª®¢,
¢ í⮬ á«ãç ¥ ª ¦¤ë© ¯®â®ª ¯®«ãç ¥â ᢮© á«®â, ¯à¨ç¥¬ ¯®«ï
+10, +22, +26 ¢ íâ¨å á«®â å ᮢ¯ ¤ îâ.
„«ï ¯à¨«®¦¥­¨© ­¥ áãé¥áâ¢ã¥â ®¡é¥£® ᯮᮡ  ®¯à¥¤¥«¨âì,
¯à¨­ ¤«¥¦ â «¨ ¤¢  ¯®â®ª  ®¤­®¬ã ¯à®æ¥ááã.
* €ªâ¨¢­®¥ ®ª­® - ®ª­®, ­ å®¤ï饥áï ­  ¢¥à設¥ ®ª®­­®£® áâíª ,
®­® ¯®«ãç ¥â á®®¡é¥­¨ï ® ¢¢®¤¥ á ª« ¢¨ âãàë. „«ï ­¥£® ¯®§¨æ¨ï ¢
®ª®­­®¬ áâíª¥ ᮢ¯ ¤ ¥â á ¢®§¢à é ¥¬ë¬ §­ ç¥­¨¥¬.
* ‘«®â 1 ᮮ⢥âáâ¢ã¥â ᯥ樠«ì­®¬ã ¯®â®ªã ®¯¥à æ¨®­­®© á¨á⥬ë,
¤«ï ª®â®à®£®:
* ®ª­® ­ å®¤¨âáï ¢­¨§ã ®ª®­­®£® áâíª , ¯®«ï +4 ¨ +6 ᮤ¥à¦ â
§­ ç¥­¨¥ 1
* ¨¬ï ¯à®æ¥áá  - "OS/IDLE" (¤®¯®«­¥­­®¥ ¯à®¡¥« ¬¨)
*  ¤à¥á ¯à®æ¥áá  ¢ ¯ ¬ï⨠ࠢ¥­ 0, à §¬¥à ¨á¯®«ì§ã¥¬®© ¯ ¬ïâ¨
16 Mb (0x1000000)
* PID=1
* ª®®à¤¨­ âë ¨ à §¬¥àë ®ª­ , à ¢­® ª ª ¨ ª«¨¥­â᪮© ®¡« áâ¨,
ãá«®¢­® ¯®« £ îâáï à ¢­ë¬¨ 0
* á®áâ®ï­¨¥ á«®â  - ¢á¥£¤  0 (¢ë¯®«­ï¥âáï)
* ¢à¥¬ï ¢ë¯®«­¥­¨ï ᪫ ¤ë¢ ¥âáï ¨§ ¢à¥¬¥­¨, ã室ï饣® ­ 
ᮡá⢥­­® à ¡®âã, ¨ ¢à¥¬¥­¨ ¯à®áâ®ï ¢ ®¦¨¤ ­¨¨ ¯à¥à뢠­¨ï
(ª®â®à®¥ ¬®¦­® ¯®«ãç¨âì ¢ë§®¢®¬ ¯®¤ä㭪樨 4 ä㭪樨 18).
*  ç¨­ ï á® á«®â  2, à §¬¥é îâáï ®¡ëç­ë¥ ¯à¨«®¦¥­¨ï.
* Ž¡ëç­ë¥ ¯à¨«®¦¥­¨ï à §¬¥é îâáï ¢ ¯ ¬ï⨠¯®  ¤à¥áã 0x10000000
(ª®­áâ ­â  ï¤à  std_application_base_address).
 «®¦¥­¨ï ­¥ ¯à®¨á室¨â, ¯®áª®«ìªã ã ª ¦¤®£® ¯à®æ¥áá  á¢®ï
â ¡«¨æ  áâà ­¨æ.
* à¨ ᮧ¤ ­¨¨ ¯®â®ª  ¥¬ã ­ §­ ç îâáï ᫮⠢ á¨á⥬­®© â ¡«¨æ¥ ¨
¨¤¥­â¨ä¨ª â®à (Process/Thread IDentifier = PID/TID), ª®â®àë¥ ¤«ï
§ ¤ ­­®£® ¯®â®ª  ­¥ ¨§¬¥­ïîâáï á® ¢à¥¬¥­¥¬.
®á«¥ § ¢¥à襭¨ï ¯®â®ª  ¥£® ᫮⠬®¦¥â ¡ëâì § ­®¢® ¨á¯®«ì§®¢ ­
¤«ï ¤à㣮£® ¯®â®ª . ˆ¤¥­â¨ä¨ª â®à ¯®â®ª  ­¥ ¬®¦¥â ¡ëâì ­ §­ ç¥­
¤à㣮¬ã ¯®â®ªã ¤ ¦¥ ¯®á«¥ § ¢¥à襭¨ï ¯¥à¢®£®.
 §­ ç ¥¬ë¥ ­®¢ë¬ ¯®â®ª ¬ ¨¤¥­â¨ä¨ª â®àë ¬®­®â®­­® à áâãâ.
* …᫨ ¯®â®ª ¥é¥ ­¥ ®¯à¥¤¥«¨« ᢮¥ ®ª­® ¢ë§®¢®¬ ä㭪樨 0, â®
¯®«®¦¥­¨¥ ¨ à §¬¥àë í⮣® ®ª­  ¯®« £ îâáï ­ã«ï¬¨.
* Š®®à¤¨­ âë ª«¨¥­â᪮© ®¡« á⨠®ª­  ¡¥àãâáï ®â­®á¨â¥«ì­® ®ª­ .
* ‚ ¤ ­­ë© ¬®¬¥­â ¨á¯®«ì§ã¥âáï ⮫쪮 ç áâì ¡ãä¥à  à §¬¥à®¬
71 = 0x47 ¡ ©â . ’¥¬ ­¥ ¬¥­¥¥ ४®¬¥­¤ã¥âáï ¨á¯®«ì§®¢ âì ¡ãä¥à
à §¬¥à®¬ 1 Š¡ ¤«ï ¡ã¤ã饩 ᮢ¬¥á⨬®áâ¨, ¢ ¡ã¤ã饬 ¬®£ãâ ¡ëâì
¤®¡ ¢«¥­ë ­¥ª®â®àë¥ ¯®«ï.
 
======================================================================
==================== ”ã­ªæ¨ï 10 - ®¦¨¤ âì ᮡëâ¨ï. ===================
======================================================================
…᫨ ®ç¥à¥¤ì á®®¡é¥­¨© ¯ãáâ , â® ¦¤¥â ¯®ï¢«¥­¨ï á®®¡é¥­¨ï ¢ ®ç¥à¥¤¨.
‚ â ª®¬ á®áâ®ï­¨¨ ¯®â®ª ­¥ ¯®«ã砥⠯à®æ¥áá®à­®£® ¢à¥¬¥­¨.
‡ â¥¬ áç¨â뢠¥â á®®¡é¥­¨¥ ¨§ ®ç¥à¥¤¨.
 
 à ¬¥âàë:
* eax = 10 - ­®¬¥à ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ᮡë⨥ (ᬮâਠᯨ᮪ ᮡë⨩)
‡ ¬¥ç ­¨ï:
* “ç¨â뢠îâáï ⮫쪮 ⥠ᮡëâ¨ï, ª®â®àë¥ ¢å®¤ïâ ¢ ¬ áªã,
ãáâ ­ ¢«¨¢ ¥¬ãî ä㭪樥© 40. ® 㬮«ç ­¨î í⮠ᮡëâ¨ï
¯¥à¥à¨á®¢ª¨, ­ ¦ â¨ï ­  ª« ¢¨è¨ ¨ ­  ª­®¯ª¨.
* „«ï ¯à®¢¥àª¨, ¥áâì «¨ á®®¡é¥­¨¥ ¢ ®ç¥à¥¤¨, ¨á¯®«ì§ã©â¥ äã­ªæ¨î 11.
—â®¡ë ¦¤ âì ­¥ ¡®«¥¥ ®¯à¥¤¥«¥­­®£® ¢à¥¬¥­¨, ¨á¯®«ì§ã©â¥
äã­ªæ¨î 23.
 
======================================================================
======= ”ã­ªæ¨ï 11 - ¯à®¢¥à¨âì, ¥áâì «¨ ᮡë⨥, ¡¥§ ®¦¨¤ ­¨ï. =======
======================================================================
…᫨ ¢ ®ç¥à¥¤¨ á®®¡é¥­¨© ¥áâì ª ª®¥-⮠ᮡë⨥, â® áç¨â뢠¥â ¨
¢®§¢à é ¥â ¥£®. …᫨ ®ç¥à¥¤ì ¯ãáâ , ¢®§¢à é ¥â ­ã«ì.
 à ¬¥âàë:
* eax = 11 - ­®¬¥à ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ®ç¥à¥¤ì á®®¡é¥­¨© ¯ãáâ 
* ¨­ ç¥ eax = ᮡë⨥ (ᬮâਠᯨ᮪ ᮡë⨩)
‡ ¬¥ç ­¨ï:
* “ç¨â뢠îâáï ⮫쪮 ⥠ᮡëâ¨ï, ª®â®àë¥ ¢å®¤ïâ ¢ ¬ áªã,
ãáâ ­ ¢«¨¢ ¥¬ãî ä㭪樥© 40. ® 㬮«ç ­¨î í⮠ᮡëâ¨ï
¯¥à¥à¨á®¢ª¨, ­ ¦ â¨ï ­  ª« ¢¨è¨ ¨ ­  ª­®¯ª¨.
* „«ï ®¦¨¤ ­¨ï ¯®ï¢«¥­¨ï ᮡëâ¨ï ¢ ®ç¥à¥¤¨, ¨á¯®«ì§ã©â¥ äã­ªæ¨î 10.
—â®¡ë ¦¤ âì ­¥ ¡®«¥¥ ®¯à¥¤¥«¥­­®£® ¢à¥¬¥­¨, ¨á¯®«ì§ã©â¥
äã­ªæ¨î 23.
 
======================================================================
=========== ”ã­ªæ¨ï 12 - ­ ç âì/§ ª®­ç¨âì ¯¥à¥à¨á®¢ªã ®ª­ . ==========
======================================================================
 
-------------- ®¤äã­ªæ¨ï 1 - ­ ç âì ¯¥à¥à¨á®¢ªã ®ª­ . ---------------
 à ¬¥âàë:
* eax = 12 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
 
------------- ®¤äã­ªæ¨ï 2 - § ª®­ç¨âì ¯¥à¥à¨á®¢ªã ®ª­ . -------------
 à ¬¥âàë:
* eax = 12 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ”ã­ªæ¨ï ­ ç «  ¯¥à¥à¨á®¢ª¨ 㤠«ï¥â ¢á¥ ®¯à¥¤¥«ñ­­ë¥
ä㭪樥© 8 ª­®¯ª¨, ¨å á«¥¤ã¥â ®¯à¥¤¥«¨âì ¯®¢â®à­®.
 
======================================================================
============ ”ã­ªæ¨ï 13 - ­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª ¢ ®ª­¥. ===========
======================================================================
 à ¬¥âàë:
* eax = 13 - ­®¬¥à ä㭪樨
* ebx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [à §¬¥à ¯® ®á¨ x]
* ecx = [ª®®à¤¨­ â  ¯® ®á¨ y]*65536 + [à §¬¥à ¯® ®á¨ y]
* edx = 梥â 0xRRGGBB ¨«¨ 0x80RRGGBB ¤«ï £à ¤¨¥­â­®© § «¨¢ª¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ®¤ ª®®à¤¨­ â ¬¨ ¯®­¨¬ îâáï ª®®à¤¨­ âë «¥¢®£® ¢¥àå­¥£® 㣫 
¯àאַ㣮«ì­¨ª  ®â­®á¨â¥«ì­® ®ª­ .
 
======================================================================
================ ”ã­ªæ¨ï 14 - ¯®«ãç¨âì à §¬¥àë íªà ­ . ===============
======================================================================
 à ¬¥âàë:
* eax = 14 - ­®¬¥à ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = [xsize]*65536 + [ysize], £¤¥
* xsize = x-ª®®à¤¨­ â  ¯à ¢®£® ­¨¦­¥£® 㣫  íªà ­  =
à §¬¥à ¯® £®à¨§®­â «¨ - 1
* ysize = y-ª®®à¤¨­ â  ¯à ¢®£® ­¨¦­¥£® 㣫  íªà ­  =
à §¬¥à ¯® ¢¥à⨪ «¨ - 1
‡ ¬¥ç ­¨ï:
* ‘¬®âਠ⠪¦¥ ¯®¤äã­ªæ¨î 5 ä㭪樨 48 - ¯®«ãç¨âì à §¬¥àë à ¡®ç¥©
®¡« á⨠íªà ­ .
 
======================================================================
= ”ã­ªæ¨ï 15, ¯®¤äã­ªæ¨ï 1 - ãáâ ­®¢¨âì à §¬¥à ä®­®¢®£® ¨§®¡à ¦¥­¨ï. =
======================================================================
 à ¬¥âàë:
* eax = 15 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
* ecx = è¨à¨­  ¨§®¡à ¦¥­¨ï
* edx = ¢ëá®â  ¨§®¡à ¦¥­¨ï
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* à®¢¥à®ª ­  ª®à४⭮áâì ­¥ ¤¥« ¥âáï. “áâ ­®¢ª  ᫨誮¬ ¡®«ìè¨å
§­ ç¥­¨© ¯à¨¢¥¤ñâ ª ⮬ã, çâ® ¢ ä®­ ¢®©¤ãâ ¤ ­­ë¥ §  £à ­¨æ¥©
¡ãä¥à  ä®­®¢®£® ¨§®¡à ¦¥­¨ï.  §¬¥à ¡ãä¥à  = 0x160000-0x10, çâ®
ᮮ⢥âáâ¢ã¥â ¬ ªá¨¬ «ì­ë¬ à §¬¥à ¬ 800*600. (800*600*3=0x15F900)
* „«ï ®¡­®¢«¥­¨ï íªà ­  (¯®á«¥ § ¢¥à襭¨ï á¥à¨¨ ª®¬ ­¤, à ¡®â îé¨å á
ä®­®¬) ¢ë§ë¢ ©â¥ ¯®¤äã­ªæ¨î 3 ¯¥à¥à¨á®¢ª¨ ä®­ .
* …áâì ¯ à­ ï äã­ªæ¨ï ¯®«ã祭¨ï à §¬¥à®¢ ä®­®¢®£® ¨§®¡à ¦¥­¨ï -
¯®¤äã­ªæ¨ï 1 ä㭪樨 39.
 
======================================================================
= ”ã­ªæ¨ï 15, ¯®¤äã­ªæ¨ï 2 - ¯®áâ ¢¨âì â®çªã ­  ä®­®¢®¬ ¨§®¡à ¦¥­¨¨. =
======================================================================
 à ¬¥âàë:
* eax = 15 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ᬥ饭¨¥
* edx = 梥â â®çª¨ 0xRRGGBB
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ‘¬¥é¥­¨¥ ¤«ï â®çª¨ á ª®®à¤¨­ â ¬¨ (x,y) ¢ëç¨á«ï¥âáï ª ª
(x+y*xsize)*3.
* …᫨ 㪠§ ­­®¥ ᬥ饭¨¥ ¯à¥¢ëè ¥â 0x160000-16 =
1.375 Mb - 16 bytes, ¢ë§®¢ ¨£­®à¨àã¥âáï.
* „«ï ®¡­®¢«¥­¨ï íªà ­  (¯®á«¥ § ¢¥à襭¨ï á¥à¨¨ ª®¬ ­¤, à ¡®â îé¨å á
ä®­®¬) ¢ë§ë¢ ©â¥ ¯®¤äã­ªæ¨î 3 ¯¥à¥à¨á®¢ª¨ ä®­ .
* …áâì ¯ à­ ï äã­ªæ¨ï ¯®«ã祭¨ï â®çª¨ á ä®­®¢®£® ¨§®¡à ¦¥­¨ï -
¯®¤äã­ªæ¨ï 2 ä㭪樨 39.
 
======================================================================
============ ”ã­ªæ¨ï 15, ¯®¤äã­ªæ¨ï 3 - ¯¥à¥à¨á®¢ âì ä®­. ============
======================================================================
 à ¬¥âàë:
* eax = 15 - ­®¬¥à ä㭪樨
* ebx = 3 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
 
======================================================================
===== ”ã­ªæ¨ï 15, ¯®¤äã­ªæ¨ï 4 - ãáâ ­®¢¨âì ०¨¬ ®âà¨á®¢ª¨ ä®­ . ====
======================================================================
 à ¬¥âàë:
* eax = 15 - ­®¬¥à ä㭪樨
* ebx = 4 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ०¨¬ ®âà¨á®¢ª¨:
* 1 = § ¬®áâ¨âì
* 2 = à áâï­ãâì
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* „«ï ®¡­®¢«¥­¨ï íªà ­  (¯®á«¥ § ¢¥à襭¨ï á¥à¨¨ ª®¬ ­¤, à ¡®â îé¨å á
ä®­®¬) ¢ë§ë¢ ©â¥ ¯®¤äã­ªæ¨î 3 ¯¥à¥à¨á®¢ª¨ ä®­ .
* …áâì ¯ à­ ï ª®¬ ­¤  ¯®«ã祭¨ï ०¨¬  ®âà¨á®¢ª¨ ä®­  -
¯®¤äã­ªæ¨ï 4 ä㭪樨 39.
 
======================================================================
===== ”ã­ªæ¨ï 15, ¯®¤äã­ªæ¨ï 5 - ¯®¬¥áâ¨âì ¡«®ª ¯¨ªá¥«¥© ­  ä®­. =====
======================================================================
 à ¬¥âàë:
* eax = 15 - ­®¬¥à ä㭪樨
* ebx = 5 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢ ä®à¬ â¥ BBGGRRBBGGRR...
* edx = ᬥ饭¨¥ ¢ ¤ ­­ëå ä®­®¢®£® ¨§®¡à ¦¥­¨ï
* esi = à §¬¥à ¤ ­­ëå ¢ ¡ ©â å = 3 * ç¨á«® ¯¨ªá¥«¥©
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* …᫨ ¡«®ª ¢ë«¥§ ¥â §  £à ­¨æã 0x160000-16 = 1.375 Mb - 16 bytes,
â® ¢ë§®¢ ¨£­®à¨àã¥âáï.
* –¢¥â ª ¦¤®£® ¯¨ªá¥«ï åà ­¨âáï ª ª 3-¡ ©â­ ï ¢¥«¨ç¨­  BBGGRR.
* ¨ªá¥«¨ ä®­®¢®£® ¨§®¡à ¦¥­¨ï § ¯¨á뢠îâáï ¯®á«¥¤®¢ â¥«ì­®
á«¥¢  ­ ¯à ¢®, ᢥàåã ¢­¨§.
* ‘¬¥é¥­¨¥ ¯¨ªá¥«ï á ª®®à¤¨­ â ¬¨ (x,y) ¥áâì (x+y*xsize)*3.
* „«ï ®¡­®¢«¥­¨ï íªà ­  (¯®á«¥ § ¢¥à襭¨ï á¥à¨¨ ª®¬ ­¤, à ¡®â îé¨å á
ä®­®¬) ¢ë§ë¢ ©â¥ ¯®¤äã­ªæ¨î 3 ¯¥à¥à¨á®¢ª¨ ä®­ .
 
======================================================================
============= ”ã­ªæ¨ï 16 - á®åà ­¨âì à ¬¤¨áª ­  ¤¨áª¥âã. =============
======================================================================
 à ¬¥âàë:
* eax = 16 - ­®¬¥à ä㭪樨
* ebx = 1 ¨«¨ ebx = 2 - ­  ª ªãî ¤¨áª¥âã á®åà ­ïâì
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ®è¨¡ª 
 
======================================================================
============== ”ã­ªæ¨ï 17 - ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨. =============
======================================================================
‡ ¡¨à ¥â ª®¤ ­ ¦ â®© ª­®¯ª¨ ¨§ ¡ãä¥à .
 à ¬¥âàë:
* eax = 17 - ­®¬¥à ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ¥á«¨ ¡ãä¥à ¯ãáâ, ¢®§¢à é ¥âáï eax=1
* ¥á«¨ ¡ãä¥à ­¥¯ãáâ, â® ¢®§¢à é ¥âáï al=0, áâ à訥 24 ¡¨â  eax
ᮤ¥à¦ â ¨¤¥­â¨ä¨ª â®à ª­®¯ª¨ (¢ ç áâ­®áâ¨, ¢ ah ®ª §ë¢ ¥âáï
¬« ¤è¨© ¡ ©â ¨¤¥­â¨ä¨ª â®à ; ¥á«¨ ¢á¥ ª­®¯ª¨ ¨¬¥îâ ¨¤¥­â¨ä¨ª â®à,
¬¥­ì訩 256, â® ¤«ï à §«¨ç¥­¨ï ¤®áâ â®ç­® ah)
‡ ¬¥ç ­¨ï:
* "ãä¥à" åà ­¨â ⮫쪮 ®¤­ã ª­®¯ªã, ¯à¨ ­ ¦ â¨¨ ­®¢®© ª­®¯ª¨
¨­ä®à¬ æ¨ï ® áâ à®© â¥àï¥âáï.
* à¨ ¢ë§®¢¥ í⮩ ä㭪樨 ¯à¨«®¦¥­¨¥¬ á ­¥ ªâ¨¢­ë¬ ®ª­®¬
¢®§¢à é ¥âáï ®â¢¥â "¡ãä¥à ¯ãáâ".
 
======================================================================
======== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 1 - § ¢¥àè¨âì à ¡®âã á¨á⥬ë. ========
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ¢á¥£¤  ¢®§¢à é ¥âáï eax = 0 ª ª ¯à¨§­ ª ãᯥå 
‡ ¬¥ç ­¨ï:
*   ¯®á«¥¤­¥¬ è £¥ ¯®ï¢«ï¥âáï ¬¥­î ¢ë室  ¨§ á¨á⥬ë, ®¦¨¤ î饥
ॠªæ¨¨ ¯®«ì§®¢ â¥«ï.
* ‘¬®âਠ⠪¦¥ ¯®¤äã­ªæ¨î 9, § ¢¥à襭¨¥ à ¡®âë á¨á⥬ë á ¯ à ¬¥â஬,
ç⮡ë ä®àá¨à®¢ âì ¢ë¡®à ¢ ¬¥­î ¢ë室 .
 
======================================================================
==== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 2 - § ¢¥àè¨âì ¯à®æ¥áá/¯®â®ª ¯® á«®âã. ====
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ­®¬¥à á«®â  ¯à®æ¥áá /¯®â®ª 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ¥«ì§ï § ¢¥àè¨âì ¯®â®ª ®¯¥à æ¨®­­®© á¨á⥬ë OS/IDLE (­®¬¥à á«®â 
1), ¬®¦­® § ¢¥àè¨âì «î¡®© ®¡ëç­ë© ¯®â®ª/¯à®æ¥áá.
* ‘¬®âਠ⠪¦¥ ¯®¤äã­ªæ¨î 18 - § ¢¥à襭¨¥
¯à®æ¥áá /¯®â®ª  á § ¤ ­­ë¬ ¨¤¥­â¨ä¨ª â®à®¬.
 
======================================================================
= ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 3 - ᤥ« âì  ªâ¨¢­ë¬ ®ª­® § ¤ ­­®£® ¯®â®ª . =
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 3 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ­®¬¥à á«®â  ¯®â®ª 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* à¨ 㪠§ ­¨¨ ª®à४⭮£®, ­® ­¥áãé¥áâ¢ãî饣® á«®â   ªâ¨¢¨§¨àã¥âáï
ª ª®¥-â® ®ª­®.
* “§­ âì, ª ª®¥ ®ª­® ï¥âáï  ªâ¨¢­ë¬, ¬®¦­® ¢ë§®¢®¬ ¯®¤ä㭪樨 7.
 
======================================================================
”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 4 - ¯®«ãç¨âì áçñâ稪 ¯ãáâëå ⠪⮢ ¢ ᥪ㭤ã.
======================================================================
®¤ ¯ãáâ묨 ⠪⠬¨ ¯®­¨¬ ¥âáï ¢à¥¬ï, ¢ ª®â®à®¥ ¯à®æ¥áá®à ¯à®áâ ¨¢ ¥â
¢ ®¦¨¤ ­¨¨ ¯à¥à뢠­¨ï (¢ ¨­áâàãªæ¨¨ hlt).
 
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 4 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = §­ ç¥­¨¥ áçñâ稪  ¯ãáâëå ⠪⮢ ¢ ᥪ㭤ã
 
======================================================================
======== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 5 - ¯®«ãç¨âì ⠪⮢ãî ç áâ®âã. =======
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 5 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ⠪⮢ ï ç áâ®â  (¯® ¬®¤ã«î 2^32 ⠪⮢ = 4ƒƒæ)
 
======================================================================
”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 6 - á®åà ­¨âì à ¬¤¨áª ¢ ä ©« ­  ¦ñá⪮¬ ¤¨áª¥.
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 6 - ­®¬¥à ¯®¤ä㭪樨
* ecx ®¯à¥¤¥«ï¥â ¯ãâì ª ä ©«ã:
* 1 = ¢ ¯ ¯ª¥ "/KOLIBRI"
* 2 = ¢ ª®à­¥¢®¬ ª â «®£¥
* 3 = edx 㪠§ë¢ ¥â ­  ¯ãâì (¨¬¥­  ¯ ¯®ª ¢ ä®à¬ â¥ 8+3,
à §¤¥«ñ­­ë¥ '/')
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* ¨­ ç¥ eax = ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
‡ ¬¥ç ­¨ï:
* ˆ¬ï ä ©«  䨪á¨à®¢ ­®, "menuet.img" (£«®¡ «ì­ ï ¯¥à¥¬¥­­ ï ï¤à 
image_save ¨§ preboot.inc)
*   ª ª®¬ à §¤¥«¥ ª ª®£® ¤¨áª  ä ©« ¡ã¤¥â á®åà ­ñ­, ®¯à¥¤¥«ï¥âáï
¯®¤ä㭪樥© 7 ¨ ¯®¤ä㭪樥© 8 ä㭪樨 21.
* ‚ᥠ¯ ¯ª¨ ¢ 㪠§ ­­®¬ ¯ã⨠¤®«¦­ë áãé¥á⢮¢ âì, ¨­ ç¥ ¢¥à­ñâáï
§­ ç¥­¨¥ 5, "ä ©« ­¥ ­ ©¤¥­".
 
======================================================================
====== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 7 - ¯®«ãç¨âì ­®¬¥à  ªâ¨¢­®£® ®ª­ . =====
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 7 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ­®¬¥à  ªâ¨¢­®£® ®ª­  (­®¬¥à á«®â  ¯®â®ª , ®ª­® ª®â®à®£®
 ªâ¨¢­®)
‡ ¬¥ç ­¨ï:
* €ªâ¨¢­®¥ ®ª­® ­ å®¤¨âáï ¢¢¥àåã ®ª®­­®£® áâíª  ¨ ¯®«ãç ¥â
á®®¡é¥­¨ï ®¡® ¢áñ¬ ¢¢®¤¥ á ª« ¢¨ âãàë.
* ‘¤¥« âì ®ª­®  ªâ¨¢­ë¬ ¬®¦­® ¢ë§®¢®¬ ¯®¤ä㭪樨 3.
 
======================================================================
==== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 8 - ®âª«îç¨âì/à §à¥è¨âì §¢ãª ᯨª¥à . ====
======================================================================
à¨ ®âª«îçñ­­®¬ §¢ãª¥ ¢ë§®¢ë ¯®¤ä㭪樨 55 ä㭪樨 55 ¨£­®à¨àãîâáï.
à¨ ¢ª«îçñ­­®¬ - ­ ¯à ¢«ïîâáï ­  ¢áâ஥­­ë© ᯨª¥à.
 
--------------- ®¤¯®¤äã­ªæ¨ï 1 - ¯®«ãç¨âì á®áâ®ï­¨¥. ----------------
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 8 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 1 - ­®¬¥à ¯®¤¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - §¢ãª ᯨª¥à  à §à¥èñ­; 1 - § ¯à¥éñ­
 
-------------- ®¤¯®¤äã­ªæ¨ï 2 - ¯¥à¥ª«îç¨âì á®áâ®ï­¨¥. --------------
¥à¥ª«îç ¥â á®áâ®ï­¨ï à §à¥è¥­¨ï/§ ¯à¥é¥­¨ï.
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 8 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 2 - ­®¬¥à ¯®¤¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
 
======================================================================
= ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 9 - § ¢¥à襭¨¥ à ¡®âë á¨á⥬ë á ¯ à ¬¥â஬. =
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 9 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¯ à ¬¥âà:
* 1 = ­  ¯®á«¥¤­¥¬ è £¥ § ¢¥à襭¨ï à ¡®âë á®åà ­¨âì à ¬¤¨áª ­ 
¤¨áª¥âã, ¯®á«¥ 祣® ¢ë¢¥á⨠¬¥­î ¢ë室  ¨ § ¯à®á¨âì ã
¯®«ì§®¢ â¥«ï ¤ «ì­¥©è¨¥ ¤¥©á⢨ï
* 2 = ¢ëª«îç¨âì ª®¬¯ìîâ¥à
* 3 = ¯¥à¥§ £à㧨âì ª®¬¯ìîâ¥à
* 4 = ¯¥à¥§ ¯ãáâ¨âì ï¤à® ¨§ ä ©«  kernel.mnt ­  à ¬¤¨áª¥
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ¯à¨ ­¥¢¥à­®¬ ecx ॣ¨áâàë ­¥ ¬¥­ïîâáï (â.¥. eax=18)
* ¯à¨ ¯à ¢¨«ì­®¬ ¢ë§®¢¥ ¢á¥£¤  ¢®§¢à é ¥âáï ¯à¨§­ ª ãá¯¥å  eax=0
‡ ¬¥ç ­¨ï:
* ¥ á«¥¤ã¥â ¯®« £ âìáï ­  ¢®§¢à é ¥¬®¥ §­ ç¥­¨¥ ¯à¨ ­¥¢¥à­®¬
¢ë§®¢¥, ®­® ¬®¦¥â ¨§¬¥­¨âìáï ¢ ¯®á«¥¤ãîé¨å ¢¥àá¨ïå ï¤à .
* Œ®¦­® ¨á¯®«ì§®¢ âì ¯®¤äã­ªæ¨î 1, çâ®¡ë ­  ¯®á«¥¤­¥¬ è £¥
§ ¢¥à襭¨ï à ¡®âë ¯®«ì§®¢ â¥«ì á ¬ à¥è «, çâ® ¥¬ã ­ã¦­®.
* ¥ ४®¬¥­¤ã¥âáï ¨á¯®«ì§®¢ âì §­ ç¥­¨¥ ecx=1 (çâ®¡ë ­¥ à §¤à ¦ âì
¯®«ì§®¢ â¥«ï ¨§«¨è­¨¬¨ ¢®¯à®á ¬¨); á®åà ­¨âì à ¬¤¨áª ­  ¤¨áª¥âã
¬®¦­® ä㭪樥© 16 (ª®â®à ï ¤®¯ã᪠¥â ãâ®ç­¥­¨¥, ­  ª ªãî ¨¬¥­­®
¤¨áª¥âã ¯¨á âì),   § ¢¥àè¨âì à ¡®âã á ¬¥­î ¢ë室  ¬®¦­® 㦥
㯮¬ï­ã⮩ ¯®¤ä㭪樥© 1.
 
======================================================================
======== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 10 - ᢥà­ãâì ®ª­® ¯à¨«®¦¥­¨ï. =======
======================================================================
‘¢®à ç¨¢ ¥â ᮡá⢥­­®¥ ®ª­®.
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 10 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* Œ¨­¨¬¨§¨à®¢ ­­®¥ ®ª­® á â®çª¨ §à¥­¨ï ä㭪樨 9 á®åà ­ï¥â ¯®«®¦¥­¨¥
¨ à §¬¥àë.
* ‚®ááâ ­®¢«¥­¨¥ ®ª­  ¯à¨«®¦¥­¨ï ¯à®¨á室¨â ¯à¨  ªâ¨¢¨§¨à®¢ ­¨¨
¯®¤ä㭪樥© 3.
* Ž¡ëç­® ­¥â ­¥®¡å®¤¨¬®á⨠® ᢮à ç¨¢ âì/à §¢®à ç¨¢ âì ᢮ñ ®ª­®:
᢮à ç¨¢ ­¨¥ ®ª­  ®áãé¥á⢫ï¥âáï á¨á⥬®© ¯à¨ ­ ¦ â¨¨ ­  ª­®¯ªã
¬¨­¨¬¨§ æ¨¨ (ª®â®à ï ¤«ï ®ª®­ ᮠ᪨­®¬ ®¯à¥¤¥«ï¥âáï  ¢â®¬ â¨ç¥áª¨
ä㭪樥© 0, ¤«ï ®ª®­ ¡¥§ ᪨­  ¥ñ ¬®¦­® ®¯à¥¤¥«¨âì ä㭪樥© 8),
¢®ááâ ­®¢«¥­¨¥ - ¯à¨«®¦¥­¨¥¬ @panel.
 
======================================================================
====================== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 11 =====================
============= ®«ãç¨âì ¨­ä®à¬ æ¨î ® ¤¨áª®¢®© ¯®¤á¨á⥬¥. =============
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 11 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ⨯ â ¡«¨æë:
* 1 = ª®à®âª ï ¢¥àá¨ï, 10 ¡ ©â
* 2 = ¯®«­ ï ¢¥àá¨ï, 65536 ¡ ©â
* edx = 㪠§ â¥«ì ­  ¡ãä¥à (¢ ¯à¨«®¦¥­¨¨) ¤«ï â ¡«¨æë
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
”®à¬ â â ¡«¨æë: ª®à®âª ï ¢¥àá¨ï:
* +0: byte: ¨­ä®à¬ æ¨ï ® ƒŒ„ (¤¨áª®¢®¤ å ¤«ï ¤¨áª¥â), AAAABBBB,
£¤¥ AAAA § ¤ ñâ ⨯ ¯¥à¢®£® ¤¨áª®¢®¤ , BBBB - ¢â®à®£® ᮣ« á­®
á«¥¤ãî饬ã ᯨáªã:
* 0 = ­¥â ¤¨áª®¢®¤ 
* 1 = 360Kb, 5.25''
* 2 = 1.2Mb, 5.25''
* 3 = 720Kb, 3.5''
* 4 = 1.44Mb, 3.5''
* 5 = 2.88Mb, 3.5'' (â ª¨¥ ¤¨áª¥âë ᥩç á 㦥 ­¥ ¨á¯®«ì§ãîâáï)
 ¯à¨¬¥à, ¤«ï áâ ­¤ àâ­®© ª®­ä¨£ãà æ¨¨ ¨§ ®¤­®£® 1.44-¤¨áª®¢®¤ 
§¤¥áì ¡ã¤¥â 40h,   ¤«ï á«ãç ï 1.2Mb ­  A: ¨ 1.44Mb ­  B:
§­ ç¥­¨¥ ®ª §ë¢ ¥âáï 24h.
* +1: byte: ¨­ä®à¬ æ¨ï ® ¦ñáâª¨å ¤¨áª å ¨ CD-¯à¨¢®¤ å, AABBCCDD,
£¤¥ AA ᮮ⢥âáâ¢ã¥â ª®­â஫«¥àã IDE0, ..., DD - IDE3:
* 0 = ãáâனá⢮ ®âáãâáâ¢ã¥â
* 1 = ¦ñá⪨© ¤¨áª
* 2 = CD-¯à¨¢®¤
 ¯à¨¬¥à, ¢ á«ãç ¥ HD ­  IDE0 ¨ CD ­  IDE2 §¤¥áì ¡ã¤¥â 48h.
* +2: 4 db: ç¨á«® ­ ©¤¥­­ëå à §¤¥«®¢ ­  ¦ñáâª¨å ¤¨áª å á
ᮮ⢥âá⢥­­® IDE0,...,IDE3.
à¨ ®âáãâá⢨¨ ¦ñá⪮£® ¤¨áª  ­  IDEx ᮮ⢥âáâ¢ãî騩 ¡ ©â
­ã«¥¢®©, ¯à¨ ­ «¨ç¨¨ ¯®ª §ë¢ ¥â ç¨á«® à á¯®§­ ­­ëå à §¤¥«®¢,
ª®â®àëå ¬®¦¥â ¨ ­¥ ¡ëâì (¥á«¨ ­®á¨â¥«ì ­¥ ®âä®à¬ â¨à®¢ ­ ¨«¨
¥á«¨ ä ©«®¢ ï á¨á⥬  ­¥ ¯®¤¤¥à¦¨¢ ¥âáï). ‚ ⥪ã饩 ¢¥àᨨ ï¤à 
¤«ï ¦ñáâª¨å ¤¨áª®¢ ¯®¤¤¥à¦¨¢ îâáï ⮫쪮 FAT16 ¨ FAT32.
* +6: 4 db: § à¥§¥à¢¨à®¢ ­®
”®à¬ â â ¡«¨æë: ¯®«­ ï ¢¥àá¨ï:
* +0: 10 db: â ª¨¥ ¦¥, ª ª ¨ ¢ ª®à®âª®© ¢¥àᨨ
* +10: 100 db: ¤ ­­ë¥ ¤«ï ¯¥à¢®£® à §¤¥« 
* +110: 100 db: ¤ ­­ë¥ ¤«ï ¢â®à®£® à §¤¥« 
* ...
* +10+100*(n-1): 100 db: ¤ ­­ë¥ ¤«ï ¯®á«¥¤­¥£® à §¤¥« 
 §¤¥«ë à á¯®«®¦¥­ë ¢ á«¥¤ãî饬 ¯®à浪¥: á­ ç «  ¯®á«¥¤®¢ â¥«ì­® ¢á¥
à á¯®§­ ­­ë¥ à §¤¥«ë ­  HD ­  IDE0 (¥á«¨ ¥áâì),
§ â¥¬ ­  HD ­  IDE1 (¥á«¨ ¥áâì) ¨ â.¤. ¤® IDE3.
”®à¬ â ¨­ä®à¬ æ¨¨ ® à §¤¥«¥ (¯®ª  ¯®¤¤¥à¦¨¢ ¥âáï ⮫쪮 FAT):
* +0: dword: ­ ç «ì­ë© 䨧¨ç¥áª¨© ᥪâ®à à §¤¥« 
* +4: dword: ¯®á«¥¤­¨© 䨧¨ç¥áª¨© ᥪâ®à à §¤¥« 
(¯à¨­ ¤«¥¦¨â à §¤¥«ã)
* +8: dword: ᥪâ®à®¢ ¢ ®¤­®© ª®¯¨¨ FAT
* +12 = +0xC: dword: ç¨á«® ª®¯¨© FAT
* +16 = +0x10: dword: ç¨á«® ᥪâ®à®¢ ¢ ª« áâ¥à¥
* +20 = +0x14: dword: ¡ ©â ¢ ᥪâ®à¥; ⥪ãé ï ॠ«¨§ æ¨ï ®¦¨¤ ¥â,
çâ® §¤¥áì 0x200 = 512
* +24 = +0x18: dword: ¯¥à¢ë© ª« áâ¥à ª®à­¥¢®£® ª â «®£  ¢ FAT32,
0 ¤«ï FAT16
* +28 = +0x1C: dword: ­ ç «ì­ë© 䨧¨ç¥áª¨© ᥪâ®à FAT
* +32 = +0x20: dword: ¯¥à¢ë© 䨧¨ç¥áª¨© ᥪâ®à ª®à­¥¢®£® ª â «®£ 
¤«ï FAT16, ¨£­®à¨àã¥âáï ¤«ï FAT32
* +36 = +0x24: dword: ç¨á«® ᥪâ®à®¢ ¢ ª®à­¥¢®¬ ª â «®£¥ ¤«ï FAT16,
0 ¤«ï FAT32
* +40 = +0x28: dword: 䨧¨ç¥áª¨© ᥪâ®à ­ ç «  ®¡« á⨠¤ ­­ëå
* +44 = +0x2C: dword: ¬ ªá¨¬ «ì­ë© ­®¬¥à ª« áâ¥à 
* +48 = +0x30: dword: 䨧¨ç¥áª¨© ᥪâ®à ¨­ä®à¬ æ¨¨ ®
ä ©«®¢®© á¨á⥬¥ ¤«ï FAT32, ¨£­®à¨àã¥âáï ¤«ï FAT16
* +52 = +0x34: dword: §­ ç¥­¨¥, ¨á¯®«ì§ã¥¬®¥ ª ª £à ­¨æ 
ᯥ樠«ì­ëå §­ ç¥­¨© ¢ FAT
* +56 = +0x38: dword: §­ ç¥­¨¥, ¨á¯®«ì§ã¥¬®¥ ¤«ï ¯«®å¨å ª« áâ¥à®¢
¢ FAT
* +60 = +0x3C: dword: §­ ç¥­¨¥, ¨á¯®«ì§ã¥¬®¥ ª ª ¬ àª¥à ª®­æ 
¯à¨ § ¯¨á¨ 楯®çª¨ ¢ FAT
* +64 = +0x40: dword: ¬ áª , ­ ª« ¤ë¢ ¥¬ ï ­  í«¥¬¥­â FAT
* +68 = +0x44: byte: ⨯ ä ©«®¢®© á¨á⥬ë: 16 ¨«¨ 32
* +69 = +0x45: 31 db: § à¥§¥à¢¨à®¢ ­®
‡ ¬¥ç ­¨ï:
* Š®à®âª ï â ¡«¨æ  ¬®¦¥â ¡ëâì ¨á¯®«ì§®¢ ­  ¤«ï ¯®«ã祭¨ï ¨­ä®à¬ æ¨¨
®¡ ¨¬¥îé¨åáï ãáâனá⢠å.
* ¥à¢ë¥ ¤¢  ¯®«ï ¨­ä®à¬ æ¨¨ ® à §¤¥«¥ ¢ ¯®«­®© ¢¥àᨨ â ¡«¨æë
á®®¡é îâ ¯ à ¬¥âàë à §¤¥« , ®á⠢訥áï - ¯ à ¬¥âàë ä ©«®¢®©
á¨á⥬ë FAT. „«ï ¤à㣨å ä ©«®¢ëå á¨á⥬ (ª®£¤  ®­¨ ¡ã¤ãâ
¯®¤¤¥à¦¨¢ âìáï) ᯥæ¨ä¨ç¥áª ï ¤«ï ä ©«®¢®© á¨áâ¥¬ë ¨­ä®à¬ æ¨ï,
¥áâ¥á⢥­­®, ¡ã¤¥â ¤à㣮©, ­® ¯¥à¢ë¥ ¤¢  ¯®«ï
á®åà ­ïâáï ­¥¨§¬¥­­ë¬¨.
 
======================================================================
========== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 13 - ¯®«ãç¨âì ¢¥àá¨î ï¤à . =========
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 13 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 㪠§ â¥«ì ­  ¡ãä¥à (­¥ ¬¥­¥¥ 16 ¡ ©â), ªã¤  ¡ã¤¥â ¯®¬¥é¥­ 
¨­ä®à¬ æ¨ï
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‘âàãªâãà  ¡ãä¥à :
db a,b,c,d ¤«ï ¢¥àᨨ a.b.c.d
db UID_xxx: ®¤­® ¨§ UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2
db 'name',0 - ASCIIZ-áâப  á ¨¬¥­¥¬
„«ï ï¤à  Kolibri 0.6.0.0:
db 0,6,0,0
db 2
db 'Kolibri',0
 
======================================================================
====================== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 14 =====================
======= Ž¦¨¤ âì ­ ç «  ®¡à â­®£® 室  «ãç  à §¢ñà⪨ ¬®­¨â®à . =======
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 14 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 ª ª ¯à¨§­ ª ãᯥå 
‡ ¬¥ç ­¨ï:
* ”ã­ªæ¨ï ¯à¥¤­ §­ ç¥­  ¨áª«îç¨â¥«ì­® ¤«ï  ªâ¨¢­ëå
¢ë᮪®¯à®¨§¢®¤¨â¥«ì­ëå £à ä¨ç¥áª¨å ¯à¨«®¦¥­¨©; ¨á¯®«ì§ã¥âáï ¤«ï
¯« ¢­®£® ¢ë¢®¤  £à ä¨ª¨.
 
======================================================================
== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 15 - ¯®¬¥áâ¨âì ªãàá®à ¬ëè¨ ¢ 業âà íªà ­ . =
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 15 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 ª ª ¯à¨§­ ª ãᯥå 
 
======================================================================
====================== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 16 =====================
============ ®«ãç¨âì à §¬¥à ᢮¡®¤­®© ®¯¥à â¨¢­®© ¯ ¬ïâ¨. ===========
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 16 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = à §¬¥à ᢮¡®¤­®© ¯ ¬ï⨠¢ ª¨«®¡ ©â å
 
======================================================================
====================== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 17 =====================
============ ®«ãç¨âì à §¬¥à ¨¬¥î饩áï ®¯¥à â¨¢­®© ¯ ¬ïâ¨. ===========
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 17 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ®¡é¨© à §¬¥à ¨¬¥î饩áï ¯ ¬ï⨠¢ ª¨«®¡ ©â å
 
======================================================================
====================== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 18 =====================
============= ‡ ¢¥àè¨âì ¯à®æ¥áá/¯®â®ª ¯® ¨¤¥­â¨ä¨ª â®àã. =============
======================================================================
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 18 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¨¤¥­â¨ä¨ª â®à ¯à®æ¥áá /¯®â®ª  (PID/TID)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = -1 - ®è¨¡ª  (¯à®æ¥áá ­¥ ­ ©¤¥­ ¨«¨ ï¥âáï á¨á⥬­ë¬)
‡ ¬¥ç ­¨ï:
* ¥«ì§ï § ¢¥àè¨âì ¯®â®ª ®¯¥à æ¨®­­®© á¨á⥬ë OS/IDLE (­®¬¥à á«®â 
1), ¬®¦­® § ¢¥àè¨âì «î¡®© ®¡ëç­ë© ¯®â®ª/¯à®æ¥áá.
* ‘¬®âਠ⠪¦¥ ¯®¤äã­ªæ¨î 2 - § ¢¥à襭¨¥
¯à®æ¥áá /¯®â®ª  ¯® § ¤ ­­®¬ã á«®âã.
 
======================================================================
=== ”ã­ªæ¨ï 18, ¯®¤äã­ªæ¨ï 19 - ¯®«ãç¨âì/ãáâ ­®¢¨âì ­ áâனª¨ ¬ëè¨. ==
======================================================================
 
------------- ®¤¯®¤äã­ªæ¨ï 0 - ¯®«ãç¨âì ᪮à®áâì ¬ëè¨. --------------
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 19 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 0 - ­®¬¥à ¯®¤¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ⥪ãé ï ᪮à®áâì ¬ëè¨
 
------------ ®¤¯®¤äã­ªæ¨ï 1 - ãáâ ­®¢¨âì ᪮à®áâì ¬ëè¨. -------------
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 19 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 1 - ­®¬¥à ¯®¤¯®¤ä㭪樨
* edx = ­®¢®¥ §­ ç¥­¨¥ ᪮à®áâ¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
 
------------- ®¤¯®¤äã­ªæ¨ï 2 - ¯®«ãç¨âì § ¤¥à¦ªã ¬ëè¨. --------------
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 19 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 2 - ­®¬¥à ¯®¤¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ⥪ãé ï § ¤¥à¦ª  ¬ëè¨
 
------------ ®¤¯®¤äã­ªæ¨ï 3 - ãáâ ­®¢¨âì § ¤¥à¦ªã ¬ëè¨. -------------
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 19 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 3 - ­®¬¥à ¯®¤¯®¤ä㭪樨
* edx = ­®¢®¥ §­ ç¥­¨¥ § ¤¥à¦ª¨ ¬ëè¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
 
-------- ®¤¯®¤äã­ªæ¨ï 4 - ãáâ ­®¢¨âì ¯®«®¦¥­¨¥ ªãàá®à  ¬ëè¨. --------
 à ¬¥âàë:
* eax = 18 - ­®¬¥à ä㭪樨
* ebx = 19 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 4 - ­®¬¥à ¯®¤¯®¤ä㭪樨
* edx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [ª®®à¤¨­ â  ¯® ®á¨ y]
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ¥ª®¬¥­¤ã¥¬ ï ᪮à®áâì ¬ëè¨ (¢ ¯®¤¯®¤ä㭪樨 1) ®â 1 ¤® 9.
“áâ ­ ¢«¨¢ ¥¬ ï ¢¥«¨ç¨­  ­¥ ¯à®¢¥àï¥âáï ª®¤®¬ ï¤à , ¯®í⮬ã
¨á¯®«ì§ã©â¥ ®áâ®à®¦­®, ¯à¨ ­¥ª®à४⭮¬ §­ ç¥­¨¨ ªãàá®à ¬®¦¥â
"§ ¬ñ৭ãâì". ‘ª®à®áâì ¬ëè¨ ¬®¦­® ॣ㫨஢ âì ¢ ¯à¨«®¦¥­¨¨ SETUP.
* ¥ª®¬¥­¤ã¥¬ ï ¢¥«¨ç¨­  § ¤¥à¦ª¨ (¢ ¯®¤¯®¤ä㭪樨 3) = 10.
Œ¥­ì訥 §­ ç¥­¨ï ­¥ ®¡à ¡ â뢠îâáï COM-¬ëè ¬¨. à¨ ®ç¥­ì ¡®«ìè¨å
§­ ç¥­¨ïå ­¥¢®§¬®¦­® ¯¥à¥¤¢¨¦¥­¨¥ ¬ëè¨ ­  1 ¯¨ªá¥«ì ¨ ªãàá®à ¡ã¤¥â
¯à룠âì ­  ¢¥«¨ç¨­ã ãáâ ­®¢«¥­­®© ᪮à®á⨠(¯®¤¯®¤äã­ªæ¨ï 1).
“áâ ­ ¢«¨¢ ¥¬ ï ¢¥«¨ç¨­  ­¥ ¯à®¢¥àï¥âáï ª®¤®¬ ï¤à .
‚¥«¨ç¨­ã § ¤¥à¦ª¨ ¬®¦­® ¬¥­ïâì ¢ ¯à¨«®¦¥­¨¨ SETUP.
* ®¤¯®¤äã­ªæ¨ï 4 ­¥ ¯à®¢¥àï¥â ¯¥à¥¤ ­­®¥ §­ ç¥­¨¥. ¥à¥¤ ¢ë§®¢®¬
­¥®¡å®¤¨¬® 㧭 âì ⥪ã饥 à §à¥è¥­¨¥ íªà ­  (¯®¤ä㭪樥© 14)
¨ ¯à®¢¥à¨âì, çâ® ãáâ ­ ¢«¨¢ ¥¬®¥ ¯®«®¦¥­¨¥ ­¥ ¢ë室¨â §  ¯à¥¤¥«ë
íªà ­ .
 
======================================================================
==================== ”ã­ªæ¨ï 20 - ¨­â¥à䥩á MIDI. ====================
======================================================================
 
------------------------ ®¤äã­ªæ¨ï 1 - á¡à®á ------------------------
 à ¬¥âàë:
* eax = 20 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
 
-------------------- ®¤äã­ªæ¨ï 2 - ¢ë¢¥á⨠¡ ©â ---------------------
 à ¬¥âàë:
* eax = 20 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* cl = ¡ ©â ¤«ï ¢ë¢®¤ 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥ (®¤¨­ ª®¢® ¤«ï ®¡¥¨å ¯®¤ä㭪権):
* eax = 0 - ãᯥ譮
* eax = 1 - ­¥ ®¯à¥¤¥«ñ­ ¡ §®¢ë© ¯®àâ
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ¤®«¦¥­ ¡ëâì ®¯à¥¤¥«ñ­ ¡ §®¢ë© ¯®à⠢맮¢®¬
¯®¤ä㭪樨 1 ä㭪樨 21.
 
======================================================================
==== ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 1 - ãáâ ­®¢¨âì ¡ §®¢ë© ¯®àâ MPU MIDI. ====
======================================================================
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ­®¬¥à ¡ §®¢®£® ¯®àâ 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = -1 - ®è¨¡®ç­ë© ­®¬¥à ¯®àâ 
‡ ¬¥ç ­¨ï:
* ®¬¥à ¯®àâ  ¤®«¦¥­ 㤮¢«¥â¢®àïâì ãá«®¢¨ï¬ 0x100<=ecx<=0xFFFF.
* “áâ ­®¢ª  ¡ §ë ­ã¦­  ¤«ï à ¡®âë ä㭪樨 20.
* ®«ãç¨âì ãáâ ­®¢«¥­­ë© ¡ §®¢ë© ¯®àâ ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樨 1 ä㭪樨 26.
 
======================================================================
===== ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 2 - ãáâ ­®¢¨âì à áª« ¤ªã ª« ¢¨ âãàë. ====
======================================================================
 áª« ¤ª  ª« ¢¨ âãàë ¨á¯®«ì§ã¥âáï ¤«ï ¯à¥®¡à §®¢ ­¨ï ᪠­ª®¤®¢,
¯®áâ㯠îé¨å ®â ª« ¢¨ âãàë, ¢ ASCII-ª®¤ë, áç¨â뢠¥¬ë¥ ä㭪樥© 2.
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ª ªãî à áª« ¤ªã ãáâ ­ ¢«¨¢ âì:
* 1 = ­®à¬ «ì­ãî
* 2 = à áª« ¤ªã ¯à¨ ­ ¦ â®¬ Shift
* 3 = à áª« ¤ªã ¯à¨ ­ ¦ â®¬ Alt
* edx = 㪠§ â¥«ì ­  à áª« ¤ªã - â ¡«¨æã ¤«¨­®© 128 ¡ ©â
ˆ«¨:
* ecx = 9
* dx = ¨¤¥­â¨ä¨ª â®à áâà ­ë (1=eng, 2=fi, 3=ger, 4=rus)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ¯ à ¬¥âà § ¤ ­ ­¥¢¥à­®
‡ ¬¥ç ­¨ï:
* …᫨ ­ ¦ â Alt, â® ¨á¯®«ì§ã¥âáï à áª« ¤ª  á Alt;
¥á«¨ ­¥ ­ ¦ â Alt, ­® ­ ¦ â Shift, â®
¨á¯®«ì§ã¥âáï à áª« ¤ª  á Shift;
¥á«¨ ­¥ ­ ¦ âë Alt ¨ Shift, ­® ­ ¦ â Ctrl, â® ¨á¯®«ì§ã¥âáï
­®à¬ «ì­ ï à áª« ¤ª , ¯®á«¥ 祣® ¨§ ª®¤  ¢ëç¨â ¥âáï 0x60;
¥á«¨ ­¥ ­ ¦ â  ­¨ ®¤­  ¨§ ã¯à ¢«ïîé¨å ª« ¢¨è, â® ¨á¯®«ì§ã¥âáï
­®à¬ «ì­ ï à áª« ¤ª .
* ®«ãç¨âì à áª« ¤ª¨ ¨ ¨¤¥­â¨ä¨ª â®à áâà ­ë ¬®¦­® á ¯®¬®éìî
¯®¤ä㭪樨 2 ä㭪樨 26.
* ˆ¤¥­â¨ä¨ª â®à áâà ­ë - £«®¡ «ì­ ï á¨á⥬­ ï ¯¥à¥¬¥­­ ï, ª®â®à ï
á ¬¨¬ ï¤à®¬ ­¥ ¨á¯®«ì§ã¥âáï; ®¤­ ª® ¯à¨«®¦¥­¨¥ @panel ®â®¡à ¦ ¥â
ᮮ⢥âáâ¢ãîéãî ⥪ã饩 áâà ­¥ ¨ª®­ªã.
* à¨«®¦¥­¨¥ @panel ¯¥à¥ª«îç ¥â à áª« ¤ª¨ ¯® § ¯à®áã ¯®«ì§®¢ â¥«ï.
 
======================================================================
=========== ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 3 - ãáâ ­®¢¨âì ¡ §ã CD. ===========
======================================================================
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 3 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¡ §  CD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0
‡ ¬¥ç ­¨ï:
*  §  CD ¨á¯®«ì§ã¥âáï ä㭪樥© 24.
* ®«ãç¨âì ãáâ ­®¢«¥­­ãî ¡ §ã CD ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樨 3 ä㭪樨 26.
 
======================================================================
== ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 4 - ãáâ ­®¢¨âì ¡ §®¢ë© ¯®àâ Sound Blaster. =
======================================================================
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 4 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ­®¬¥à ¡ §®¢®£® ¯®àâ 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = -1 - ®è¨¡®ç­ë© ­®¬¥à ¯®àâ 
‡ ¬¥ç ­¨ï:
* ®¬¥à ¯®àâ  ¤®«¦¥­ 㤮¢«¥â¢®àïâì ãá«®¢¨ï¬ 0x100<=ecx<=0xFFFF.
* “áâ ­®¢ª  ¡ §ë ­ã¦­  ¤«ï à ¡®âë ä㭪権 25, 28, 55.
* ®«ãç¨âì ãáâ ­®¢«¥­­ë© ¡ §®¢ë© ¯®àâ ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樨 4 ä㭪樨 26.
 
======================================================================
========= ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 5 - ãáâ ­®¢¨âì ï§ëª á¨á⥬ë. ========
======================================================================
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 5 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ï§ëª á¨á⥬ë (1=eng, 2=fi, 3=ger, 4=rus)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0
‡ ¬¥ç ­¨ï:
* Ÿ§ëª á¨á⥬ë - £«®¡ «ì­ ï á¨á⥬­ ï ¯¥à¥¬¥­­ ï, ­¨ª ª
­¥ ¨á¯®«ì§ã¥¬ ï á ¬¨¬ ï¤à®¬, ®¤­ ª® ¯à¨«®¦¥­¨¥ @panel à¨áã¥â
ᮮ⢥âáâ¢ãîéãî ¨ª®­ªã.
* à®¢¥à®ª ­  ª®à४⭮áâì ­¥ ¤¥« ¥âáï, ¯®áª®«ìªã ï¤à® íâã
¯¥à¥¬¥­­ãî ­¥ ¨á¯®«ì§ã¥â.
* ®«ãç¨âì ï§ëª á¨áâ¥¬ë ¬®¦­® ¢ë§®¢®¬ ¯®¤ä㭪樨 5 ä㭪樨 26.
 
======================================================================
======= ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 6 - ãáâ ­®¢¨âì ¡ §®¢ë© ¯®àâ WSS. ======
======================================================================
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 6 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¡ §®¢ë© ¯®àâ
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = -1 - ®è¨¡®ç­ë© ­®¬¥à ¯®àâ 
‡ ¬¥ç ­¨ï:
* ®¬¥à ¯®àâ  ¤®«¦¥­ 㤮¢«¥â¢®àïâì ãá«®¢¨î 0x100<=ecx.
*  §  WSS ¨á¯®«ì§ã¥âáï ä㭪樥© 27.
* ®«ãç¨âì ãáâ ­®¢«¥­­ë© ¡ §®¢ë© ¯®àâ WSS ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樨 6 ä㭪樨 26.
 
======================================================================
=========== ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 7 - ãáâ ­®¢¨âì ¡ §ã HD. ===========
======================================================================
 §  HD ­ã¦­  ¤«ï ®¯à¥¤¥«¥­¨ï, ­  ª ª®© ¦ñá⪨© ¤¨áª ¯¨á âì, ¯à¨
¨á¯®«ì§®¢ ­¨¨ ãáâ à¥¢è¨å ä㭪権 à ¡®âë á ä ©«®¢®© á¨á⥬®© ¨ ä㭪権,
­¥ï¢­® ¨á¯®«ì§ãîé¨å ¦ñá⪨© ¤¨áª (⨯  ¯®¤ä㭪樨 6 ä㭪樨 18);
¯à¨ ¨á¯®«ì§®¢ ­¨¨ ä㭪権 58 ¨ 70 ¨ ᮢ६¥­­®£® ᨭ⠪á¨á 
/HD0,/HD1,/HD2,/HD3 í⨠ä㭪樨 á ¬¨ ãáâ ­ ¢«¨¢ îâ ¡ §ã.
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 7 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¡ §  HD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0
‡ ¬¥ç ­¨ï:
* ‹î¡®¥ ¯à¨«®¦¥­¨¥ ¢ «î¡®© ¬®¬¥­â ¢à¥¬¥­¨ ¬®¦¥â ¨§¬¥­¨âì ¡ §ã.
* ¥ á«¥¤ã¥â ¨§¬¥­ïâì ¡ §ã, ª®£¤  ª ª®¥-­¨¡ã¤ì ¯à¨«®¦¥­¨¥ à ¡®â ¥â
á ¦ñá⪨¬ ¤¨áª®¬. …᫨ ­¥ å®â¨â¥ £«îª®¢ á¨á⥬ë.
* ®«ãç¨âì ãáâ ­®¢«¥­­ãî ¡ §ã ¬®¦­® ¢ë§®¢®¬ ¯®¤ä㭪樨 7 ä㭪樨 26.
* ‘«¥¤ã¥â â ª¦¥ ®¯à¥¤¥«¨âì ¨á¯®«ì§ã¥¬ë© à §¤¥« ¦ñá⪮£® ¤¨áª 
¯®¤ä㭪樥© 8.
 
======================================================================
========== ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 8 - ãáâ ­®¢¨âì à §¤¥« HD. ==========
======================================================================
 §¤¥« HD ­ã¦¥­ ¤«ï ®¯à¥¤¥«¥­¨ï, ­  ª ª®© à §¤¥« ¦ñá⪮£® ¤¨áª 
¯¨á âì, ¯à¨ ¨á¯®«ì§®¢ ­¨¨ ãáâ à¥¢è¨å ä㭪権 à ¡®âë á ä ©«®¢®©
á¨á⥬®© ¨ ä㭪権, ­¥ï¢­® ¨á¯®«ì§ãîé¨å ¦ñá⪨© ¤¨áª (⨯ 
¯®¤ä㭪樨 6 ä㭪樨 18); ¯à¨ ¨á¯®«ì§®¢ ­¨¨ ä㭪権 58 ¨ 70
¨ ᮢ६¥­­®£® ᨭ⠪á¨á  /HD0,/HD1,/HD2,/HD3 í⨠ä㭪樨 á ¬¨
ãáâ ­ ¢«¨¢ îâ ¡ §ã ¨ à §¤¥«.
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 8 - ­®¬¥à ¯®¤ä㭪樨
* ecx = à §¤¥« HD (áç¨â ï á 1)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0
‡ ¬¥ç ­¨ï:
* ‹î¡®¥ ¯à¨«®¦¥­¨¥ ¢ «î¡®© ¬®¬¥­â ¢à¥¬¥­¨ ¬®¦¥â ¨§¬¥­¨âì à §¤¥«.
* ¥ á«¥¤ã¥â ¨§¬¥­ïâì à §¤¥«, ª®£¤  ª ª®¥-­¨¡ã¤ì ¯à¨«®¦¥­¨¥ à ¡®â ¥â
á ¦ñá⪨¬ ¤¨áª®¬. …᫨ ­¥ å®â¨â¥ £«îª®¢ á¨á⥬ë.
* ®«ãç¨âì ãáâ ­®¢«¥­­ë© à §¤¥« ¬®¦­® ¢ë§®¢®¬ ¯®¤ä㭪樨 8
ä㭪樨 26.
* à®¢¥à®ª ­  ª®à४⭮áâì ­¥ ¤¥« ¥âáï.
* “§­ âì ç¨á«® à §¤¥«®¢ ­  ¦ñá⪮¬ ¤¨áª¥ ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樨 11 ä㭪樨 18.
* ‘«¥¤ã¥â â ª¦¥ ®¯à¥¤¥«¨âì ¨á¯®«ì§ã¥¬ãî ¡ §ã ¦ñá⪮£® ¤¨áª 
¯®¤ä㭪樥© 7.
 
======================================================================
===== ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 10 - ãáâ ­®¢¨âì ª ­ « DMA ¤«ï §¢ãª . ====
======================================================================
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 10 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ­®¬¥à ª ­ «  (®â 0 ¤® 3 ¢ª«îç¨â¥«ì­®)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = -1 - ­¥¢¥à­ë© ­®¬¥à ª ­ « 
‡ ¬¥ç ­¨ï:
* ®¬¥à ª ­ «  DMA ¨á¯®«ì§ã¥âáï ¢
¯®¤ä㭪樨 1 ä㭪樨 55.
* ®«ãç¨âì ª ­ « DMA ¤«ï §¢ãª  ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樨 10 ä㭪樨 26.
 
======================================================================
====================== ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 11 =====================
===========  §à¥è¨âì/§ ¯à¥â¨âì ­¨§ª®ã஢­¥¢ë© ¤®áâ㯠ª HD. ==========
======================================================================
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 11 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 0/1 - § ¯à¥â¨âì/à §à¥è¨âì
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0
‡ ¬¥ç ­¨ï:
* ˆá¯®«ì§ã¥âáï ¯à¨ LBA-ç⥭¨¨ (¯®¤äã­ªæ¨ï 8 ä㭪樨 58).
* ’¥ªãé ï ॠ«¨§ æ¨ï ¨á¯®«ì§ã¥â ⮫쪮 ¬« ¤è¨© ¡¨â ecx.
* ®«ãç¨âì ⥪ã饥 á®áâ®ï­¨¥ ¬®¦­® ¢ë§®¢®¬ ¯®¤ä㭪樨 11 ä㭪樨 26.
 
======================================================================
====================== ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 12 =====================
==========  §à¥è¨âì/§ ¯à¥â¨âì ­¨§ª®ã஢­¥¢ë© ¤®áâ㯠ª PCI. ==========
======================================================================
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 12 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 0/1 - § ¯à¥â¨âì/à §à¥è¨âì
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0
‡ ¬¥ç ­¨ï:
* ˆá¯®«ì§ã¥âáï ¯à¨ à ¡®â¥ á 設®© PCI (äã­ªæ¨ï 62).
* ’¥ªãé ï ॠ«¨§ æ¨ï ¨á¯®«ì§ã¥â ⮫쪮 ¬« ¤è¨© ¡¨â ecx.
* ®«ãç¨âì ⥪ã饥 á®áâ®ï­¨¥ ¬®¦­® ¢ë§®¢®¬ ¯®¤ä㭪樨 12 ä㭪樨 26.
 
======================================================================
============= ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 13, ¯®¤¯®¤äã­ªæ¨ï 1 =============
==== ˆ­¨æ¨ «¨§¨à®¢ âì + ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ¤à ©¢¥à¥ vmode.mdr. ====
======================================================================
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 13 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 1 - ­®¬¥à ä㭪樨 ¤à ©¢¥à 
* edx = 㪠§ â¥«ì ­  ¡ãä¥à à §¬¥à  512 ¡ ©â
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ¥á«¨ ¤à ©¢¥à ­¥ § £à㦥­ (­¨ª®£¤  ­¥ ¡ë¢ ¥â ¢ ⥪ã饩 ॠ«¨§ æ¨¨):
* eax = -1
* ebx, ecx à §àãè îâáï
* ¥á«¨ ¤à ©¢¥à § £à㦥­:
* eax = 'MDAZ' (¢ á⨫¥ fasm' , â.¥. 'M' - ¬« ¤è¨© ¡ ©â,
'Z' - áâ à訩) - ᨣ­ âãà 
* ebx = ⥪ãé ï ç áâ®â  à §¢ñà⪨ (¢ ƒæ)
* ecx à §àãè ¥âáï
* ¡ãä¥à, ­  ª®â®àë© ãª §ë¢ ¥â edx, § ¯®«­¥­
”®à¬ â ¡ãä¥à :
* +0: 32*byte: ¨¬ï ¤à ©¢¥à , "Trans VideoDriver" (¡¥§ ª ¢ë祪,
¤®¯®«­¥­® ¯à®¡¥« ¬¨)
* +32 = +0x20: dword: ¢¥àá¨ï ¤à ©¢¥à  (¢¥àá¨ï x.y ª®¤¨àã¥âáï ª ª
y*65536+x), ¤«ï ⥪ã饩 ॠ«¨§ æ¨¨ 1 (1.0)
* +36 = +0x24: 7*dword: § à¥§¥à¢¨à®¢ ­® (0 ¢ ⥪ã饩 ॠ«¨§ æ¨¨)
* +64 = +0x40: 32*word: ᯨ᮪ ¯®¤¤¥à¦¨¢ ¥¬ëå ¢¨¤¥®à¥¦¨¬®¢ (ª ¦¤®¥
á«®¢® - ­®¬¥à ¢¨¤¥®à¥¦¨¬ , ¯®á«¥ ᮡá⢥­­® ᯨ᪠ ¨¤ã⠭㫨)
* +128 = +0x80: 32*(5*word): ᯨ᮪ ¯®¤¤¥à¦¨¢ ¥¬ëå ç áâ®â à §¢ñà⮪
¤«ï ¢¨¤¥®à¥¦¨¬®¢: ¤«ï ª ¦¤®£® ¢¨¤¥®à¥¦¨¬ , 㪠§ ­­®£® ¢ ¯à¥¤ë¤ã饬
¯®«¥, 㪠§ ­® ¤® 5 ¯®¤¤¥à¦¨¢ ¥¬ëå ç áâ®â
(¢ ­¥¨á¯®«ì§ã¥¬ëå ¯®§¨æ¨ïå § ¯¨á ­ë ­ã«¨)
‡ ¬¥ç ­¨ï:
* ”ã­ªæ¨ï ¨­¨æ¨ «¨§¨àã¥â ¤à ©¢¥à (¥á«¨ ®­ ¥éñ ­¥ ¨­¨æ¨ «¨§¨à®¢ ­)
¨ ¤®«¦­  ¢ë§ë¢ âìáï ¯¥à¢®©, ¯¥à¥¤ ®áâ «ì­ë¬¨ (¨­ ç¥ ®­¨ ¡ã¤ãâ
¢®§¢à é âì -1, ­¨ç¥£® ­¥ ¤¥« ï).
* ‚ ⥪ã饩 ॠ«¨§ æ¨¨ ¯®¤¤¥à¦¨¢ ¥âáï ⮫쪮 ®¤­  ç áâ®â  à §¢ñà⪨
­  ¢¨¤¥®à¥¦¨¬.
 
======================================================================
============= ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 13, ¯®¤¯®¤äã­ªæ¨ï 2 =============
============= ®«ãç¨âì ¨­ä®à¬ æ¨î ® ⥪ã饬 ¢¨¤¥®à¥¦¨¬¥. =============
======================================================================
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 13 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 2 - ­®¬¥à ä㭪樨 ¤à ©¢¥à 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ¤à ©¢¥à ­¥ § £à㦥­ ¨«¨ ­¥ ¨­¨æ¨ «¨§¨à®¢ ­;
ebx,ecx à §àãè îâáï
* eax = [è¨à¨­ ]*65536 + [¢ëá®â ]
* ebx = ç áâ®â  ¢¥à⨪ «ì­®© à §¢ñà⪨ (¢ ƒæ)
* ecx = ­®¬¥à ⥪ã饣® ¢¨¤¥®à¥¦¨¬ 
‡ ¬¥ç ­¨ï:
* „à ©¢¥à ¯à¥¤¢ à¨â¥«ì­® ¤®«¦¥­ ¡ëâì ¨­¨æ¨ «¨§¨à®¢ ­ ¢ë§®¢®¬
ä㭪樨 ¤à ©¢¥à  1.
* …᫨ ­ã¦­ë ⮫쪮 à §¬¥àë íªà ­ , 楫¥á®®¡à §­¥© ¨á¯®«ì§®¢ âì
äã­ªæ¨î 14 á ãçñ⮬ ⮣®, çâ® ®­  ¢®§¢à é ¥â à §¬¥àë ­  1 ¬¥­ìè¥.
 
======================================================================
= ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 13, ¯®¤¯®¤äã­ªæ¨ï 3 - ãáâ ­®¢¨âì ¢¨¤¥®à¥¦¨¬.
======================================================================
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 13 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 3 - ­®¬¥à ä㭪樨 ¤à ©¢¥à 
* edx = [ç áâ®â  à §¢ñà⪨]*65536 + [­®¬¥à ¢¨¤¥®à¥¦¨¬ ]
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ¤à ©¢¥à ­¥ § £à㦥­, ­¥ ¨­¨æ¨ «¨§¨à®¢ ­ ¨«¨
¯à®¨§®è«  ®è¨¡ª 
* eax = 0 - ãᯥ譮
* ebx, ecx à §àãè îâáï
‡ ¬¥ç ­¨ï:
* „à ©¢¥à ¯à¥¤¢ à¨â¥«ì­® ¤®«¦¥­ ¡ëâì ¨­¨æ¨ «¨§¨à®¢ ­ ¢ë§®¢®¬
ä㭪樨 ¤à ©¢¥à  1.
* ®¬¥à ¢¨¤¥®à¥¦¨¬  ¨ ç áâ®â  ¤®«¦­ë ¡ëâì ¢ â ¡«¨æ¥, ¢®§¢à é ¥¬®©
ä㭪樥© ¤à ©¢¥à  1.
 
======================================================================
============= ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 13, ¯®¤¯®¤äã­ªæ¨ï 4 =============
================= ‚¥à­ãâìáï ª ­ ç «ì­®¬ã ¢¨¤¥®à¥¦¨¬ã. ================
======================================================================
‚®§¢à é ¥â íªà ­ ¢ ¢¨¤¥®à¥¦¨¬, ãáâ ­®¢«¥­­ë© ¯à¨ § £à㧪¥ á¨á⥬ë.
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 13 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 4 - ­®¬¥à ä㭪樨 ¤à ©¢¥à 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ¤à ©¢¥à ­¥ § £à㦥­ ¨«¨ ­¥ ¨­¨æ¨ «¨§¨à®¢ ­
* eax = 0 - ãᯥ譮
* ebx, ecx à §àãè îâáï
‡ ¬¥ç ­¨ï:
* „à ©¢¥à ¯à¥¤¢ à¨â¥«ì­® ¤®«¦¥­ ¡ëâì ¨­¨æ¨ «¨§¨à®¢ ­ ¢ë§®¢®¬
ä㭪樨 ¤à ©¢¥à  1.
 
======================================================================
============= ”ã­ªæ¨ï 21, ¯®¤äã­ªæ¨ï 13, ¯®¤¯®¤äã­ªæ¨ï 5 =============
======== “¢¥«¨ç¨âì/㬥­ìè¨âì à §¬¥à ¢¨¤¨¬®© ®¡« á⨠¬®­¨â®à . ========
======================================================================
 à ¬¥âàë:
* eax = 21 - ­®¬¥à ä㭪樨
* ebx = 13 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 5 - ­®¬¥à ä㭪樨 ¤à ©¢¥à 
* edx = 0/1 - 㬥­ìè¨âì/㢥«¨ç¨âì à §¬¥à ¯® £®à¨§®­â «¨
­  ®¤­ã ¯®§¨æ¨î
* edx = 2/3 - ¢ ⥪ã饩 ॠ«¨§ æ¨¨ ­¥ ¯®¤¤¥à¦¨¢ ¥âáï; ¯« ­¨àã¥âáï
ª ª 㬥­ì襭¨¥/㢥«¨ç¥­¨¥ à §¬¥à  ¯® ¢¥à⨪ «¨ ­  ®¤­ã ¯®§¨æ¨î
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ¤à ©¢¥à ­¥ § £à㦥­ ¨«¨ ­¥ ¨­¨æ¨ «¨§¨à®¢ ­
* eax = 0 - ãᯥ譮
* ebx, ecx à §àãè îâáï
‡ ¬¥ç ­¨ï:
* „à ©¢¥à ¯à¥¤¢ à¨â¥«ì­® ¤®«¦¥­ ¡ëâì ¨­¨æ¨ «¨§¨à®¢ ­ ¢ë§®¢®¬
ä㭪樨 ¤à ©¢¥à  1.
* ”ã­ªæ¨ï ¢«¨ï¥â ⮫쪮 ­  䨧¨ç¥áª¨© à §¬¥à ¨§®¡à ¦¥­¨ï
­  ¬®­¨â®à¥; «®£¨ç¥áª¨© à §¬¥à (ç¨á«® ¯¨ªá¥«¥©) ­¥ ¬¥­ï¥âáï.
 
======================================================================
============ ”ã­ªæ¨ï 22 - ãáâ ­®¢¨âì á¨á⥬­ãî ¤ âã/¢à¥¬ï. ===========
======================================================================
 à ¬¥âàë:
* eax = 22 - ­®¬¥à ä㭪樨
* ebx = 0 - ãáâ ­®¢¨âì ¢à¥¬ï
* ecx = 0x00SSMMHH - ¢à¥¬ï ¢ ¤¢®¨ç­®-¤¥áïâ¨ç­®¬ ª®¤¥ (BCD):
* HH=ç á 00..23
* MM=¬¨­ãâ  00..59
* SS=ᥪ㭤  00..59
* ebx = 1 - ãáâ ­®¢¨âì ¤ âã
* ecx = 0x00DDMMYY - ¤ â  ¢ ¤¢®¨ç­®-¤¥áïâ¨ç­®¬ ª®¤¥ (BCD):
* DD=¤¥­ì 01..31
* MM=¬¥áïæ 01..12
* YY=£®¤ 00..99
* ebx = 2 - ãáâ ­®¢¨âì ¤¥­ì ­¥¤¥«¨
* ecx = 1 ¤«ï ¢®áªà¥á¥­ìï, ..., 7 ¤«ï áã¡¡®âë
* ebx = 3 - ãáâ ­®¢¨âì ¡ã¤¨«ì­¨ª
* ecx = 0x00SSMMHH
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ¯ à ¬¥âà § ¤ ­ ­¥¢¥à­®
* eax = 2 - CMOS-¡ â à¥©ª¨ à §à廊«¨áì
‡ ¬¥ç ­¨ï:
* –¥­­®áâì ãáâ ­®¢ª¨ ¤­ï ­¥¤¥«¨ ¯à¥¤áâ ¢«ï¥âáï ᮬ­¨â¥«ì­®©,
¯®áª®«ìªã ®­ ¬ «® £¤¥ ¨á¯®«ì§ã¥âáï
(¤¥­ì ­¥¤¥«¨ ¬®¦­® à ááç¨â âì ¯® ¤ â¥).
* ã¤¨«ì­¨ª ¬®¦­® ãáâ ­®¢¨âì ­  áà ¡ â뢠­¨¥ ¢ § ¤ ­­®¥ ¢à¥¬ï
ª ¦¤ë¥ áã⪨. à¨ í⮬ ®âª«îç¨âì ¥£® áãé¥áâ¢ãî騬¨ á¨á⥬­ë¬¨
äã­ªæ¨ï¬¨ ­¥«ì§ï.
* ‘à ¡ â뢠­¨¥ ¡ã¤¨«ì­¨ª  § ª«îç ¥âáï ¢ £¥­¥à æ¨¨ IRQ8.
* ‚®®¡é¥-â® CMOS ¯®¤¤¥à¦¨¢ ¥â ¤«ï ¡ã¤¨«ì­¨ª  ãáâ ­®¢ªã §­ ç¥­¨ï
0xFF ¢ ª ç¥á⢥ ®¤­®£® ¨§ ¯ à ¬¥â஢ ¨ ®§­ ç ¥â íâ®, çâ®
ᮮ⢥âáâ¢ãî騩 ¯ à ¬¥âà ¨£­®à¨àã¥âáï. ® ¢ ⥪ã饩 ॠ«¨§ æ¨¨
íâ® ­¥ ¯à®©¤ñâ (¢¥à­ñâáï §­ ç¥­¨¥ 1).
* ã¤¨«ì­¨ª - £«®¡ «ì­ë© á¨á⥬­ë© à¥áãàá; ãáâ ­®¢ª  ¡ã¤¨«ì­¨ª 
 ¢â®¬ â¨ç¥áª¨ ®â¬¥­ï¥â ¯à¥¤ë¤ãéãî ãáâ ­®¢ªã. ‚¯à®ç¥¬, ­  ¤ ­­ë©
¬®¬¥­â ­¨ ®¤­  ¯à®£à ¬¬  ¥£® ­¥ ¨á¯®«ì§ã¥â.
 
======================================================================
============== ”ã­ªæ¨ï 23 - ®¦¨¤ âì ᮡëâ¨ï á â ©¬ ã⮬. =============
======================================================================
…᫨ ®ç¥à¥¤ì á®®¡é¥­¨© ¯ãáâ , ¦¤ñâ ¯®ï¢«¥­¨ï á®®¡é¥­¨ï ¢ ®ç¥à¥¤¨,
­® ­¥ ¡®«¥¥ 㪠§ ­­®£® ¢à¥¬¥­¨. ‡ â¥¬ áç¨â뢠¥â á®®¡é¥­¨¥ ¨§ ®ç¥à¥¤¨.
 
 à ¬¥âàë:
* eax = 23 - ­®¬¥à ä㭪樨
* ebx = â ©¬ ãâ (¢ á®âëå ¤®«ïå ᥪ㭤ë)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ®ç¥à¥¤ì á®®¡é¥­¨© ¯ãáâ 
* ¨­ ç¥ eax = ᮡë⨥ (ᬮâਠᯨ᮪ ᮡë⨩)
‡ ¬¥ç ­¨ï:
* “ç¨â뢠îâáï ⮫쪮 ⥠ᮡëâ¨ï, ª®â®àë¥ ¢å®¤ïâ ¢ ¬ áªã,
ãáâ ­ ¢«¨¢ ¥¬ãî ä㭪樥© 40. ® 㬮«ç ­¨î í⮠ᮡëâ¨ï
¯¥à¥à¨á®¢ª¨, ­ ¦ â¨ï ­  ª« ¢¨è¨ ¨ ­  ª­®¯ª¨.
* „«ï ¯à®¢¥àª¨, ¥áâì «¨ á®®¡é¥­¨¥ ¢ ®ç¥à¥¤¨, ¨á¯®«ì§ã©â¥ äã­ªæ¨î 11.
—â®¡ë ¦¤ âì ᪮«ì 㣮¤­® ¤®«£®, ¨á¯®«ì§ã©â¥ äã­ªæ¨î 10.
* ¥à¥¤ ç  ebx=0 ¯à¨¢®¤¨â ª ¬®¬¥­â «ì­®¬ã ¢®§¢à é¥­¨î eax=0.
* à¨ ⥪ã饩 ॠ«¨§ æ¨¨ ¯à®¨§®©¤ñâ ­¥¬¥¤«¥­­ë© ¢®§¢à â ¨§ ä㭪樨
á eax=0, ¥á«¨ á«®¦¥­¨¥ ebx á ⥪ã騬 §­ ç¥­¨¥¬ áçñâ稪  ¢à¥¬¥­¨
¢ë§®¢¥â 32-¡¨â­®¥ ¯¥à¥¯®«­¥­¨¥.
 
======================================================================
======= ”ã­ªæ¨ï 24, ¯®¤äã­ªæ¨ï 1 - ­ ç âì ¯à®¨£à뢠âì CD-audio. ======
======================================================================
 à ¬¥âàë:
* eax = 24 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 0x00FRSSMM, £¤¥
* MM = ­ ç «ì­ ï ¬¨­ãâ 
* SS = ­ ç «ì­ ï ᥪ㭤 
* FR = ­ ç «ì­ë© ä३¬
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ­¥ ®¯à¥¤¥«¥­  ¡ §  CD
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ­ã¦­® ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ CD ¢ë§®¢®¬
¯®¤ä㭪樨 3 ä㭪樨 21.
* ‚ ᥪ㭤¥ 75 ä३¬®¢, ¢ ¬¨­ã⥠60 ᥪ㭤.
* ”ã­ªæ¨ï  á¨­åà®­­  (¢®§¢à é ¥â ã¯à ¢«¥­¨¥, ª®£¤  ­ ç «®áì
¯à®¨£à뢠­¨¥).
 
======================================================================
===== ”ã­ªæ¨ï 24, ¯®¤äã­ªæ¨ï 2 - ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ¤®à®¦ª å. =====
======================================================================
 à ¬¥âàë:
* eax = 24 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 㪠§ â¥«ì ­  ¡ãä¥à ¤«ï â ¡«¨æë
(¬ ªá¨¬ã¬ 8*64h+4 ¡ ©â=100 ¤®à®¦¥ª)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ­¥ ®¯à¥¤¥«¥­  ¡ §  CD
‡ ¬¥ç ­¨ï:
* ”®à¬ â â ¡«¨æë á ¨­ä®à¬ æ¨¥© ® ¤®à®¦ª å â ª®© ¦¥, ª ª ¨ ¤«ï
ATAPI-CD ª®¬ ­¤ë 43h (READ TOC), ®¡ëç­®© â ¡«¨æë (¯®¤ª®¬ ­¤  00h).
€¤à¥á  ¢®§¢à é îâáï ¢ ä®à¬ â¥ MSF.
* à¥¤¢ à¨â¥«ì­® ­ã¦­® ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ CD ¢ë§®¢®¬
¯®¤ä㭪樨 3 ä㭪樨 21.
* ”ã­ªæ¨ï ¢®§¢à é ¥â ¨­ä®à¬ æ¨î ⮫쪮 ® ­¥ ¡®«¥¥ 祬 100
¯¥à¢ëå ¤®à®¦ª å. ‚ ¡®«ì設á⢥ á«ãç ¥¢ í⮣® ¤®áâ â®ç­®.
 
======================================================================
==== ”ã­ªæ¨ï 24, ¯®¤äã­ªæ¨ï 3 - ®áâ ­®¢¨âì ¯à®¨£à뢠¥¬®¥ CD-audio. ===
======================================================================
 à ¬¥âàë:
* eax = 24 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ­¥ ®¯à¥¤¥«¥­  ¡ §  CD
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ­ã¦­® ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ CD ¢ë§®¢®¬
¯®¤ä㭪樨 3 ä㭪樨 21.
 
======================================================================
============== ”ã­ªæ¨ï 25 - ãáâ ­®¢¨âì £à®¬ª®áâì SBPro. ==============
======================================================================
 à ¬¥âàë:
* eax = 25 - ­®¬¥à ä㭪樨
* ebx = çâ® ãáâ ­ ¢«¨¢ âì:
* 1 - ãáâ ­®¢¨âì ®¡éãî £à®¬ª®áâì
* 2 - ãáâ ­®¢¨âì £à®¬ª®áâì CD-audio
* cl = ã஢¥­ì £à®¬ª®áâ¨: áâ à訥 4 ¡¨â  ¤«ï «¥¢®© ª®«®­ª¨,
¬« ¤è¨¥ 4 - ¤«ï ¯à ¢®©
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ­¥ ®¯à¥¤¥«¥­  ¡ §  SB
* eax = 2 - ­¥¢¥à­ ï ¯®¤äã­ªæ¨ï
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ­ã¦­® ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ SB ¢ë§®¢®¬
¯®¤ä㭪樨 4 ä㭪樨 21.
* ‘¬®âਠ⠪¦¥ äã­ªæ¨î 28
ãáâ ­®¢ª¨ §¢ãª  ¤«ï ¡®«¥¥ ¯®§¤­¥£® áâ ­¤ àâ  SB16.
 
======================================================================
===== ”ã­ªæ¨ï 26, ¯®¤äã­ªæ¨ï 1 - ¯®«ãç¨âì ¡ §®¢ë© ¯®àâ MPU MIDI. =====
======================================================================
 à ¬¥âàë:
* eax = 26 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ­®¬¥à ¯®àâ 
‡ ¬¥ç ­¨ï:
* “áâ ­®¢¨âì ¡ §®¢ë© ¯®àâ ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樨 1 ä㭪樨 21.
 
======================================================================
====== ”ã­ªæ¨ï 26, ¯®¤äã­ªæ¨ï 2 - ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë. =====
======================================================================
 áª« ¤ª  ª« ¢¨ âãàë ¨á¯®«ì§ã¥âáï ¤«ï ¯à¥®¡à §®¢ ­¨ï ᪠­ª®¤®¢,
¯®áâ㯠îé¨å ®â ª« ¢¨ âãàë, ¢ ASCII-ª®¤ë, áç¨â뢠¥¬ë¥ ä㭪樥© 2.
 à ¬¥âàë:
* eax = 26 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ª ªãî à áª« ¤ªã ¯®«ãç âì:
* 1 = ­®à¬ «ì­ãî
* 2 = à áª« ¤ªã ¯à¨ ­ ¦ â®¬ Shift
* 3 = à áª« ¤ªã ¯à¨ ­ ¦ â®¬ Alt
* edx = 㪠§ â¥«ì ­  ¡ãä¥à ¤«¨­®© 128 ¡ ©â, ªã¤  ¡ã¤¥â ᪮¯¨à®¢ ­ 
à áª« ¤ª 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
ˆ«¨:
* eax = 26 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 9
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ¨¤¥­â¨ä¨ª â®à áâà ­ë (1=eng, 2=fi, 3=ger, 4=rus)
‡ ¬¥ç ­¨ï:
* …᫨ ­ ¦ â Alt, â® ¨á¯®«ì§ã¥âáï à áª« ¤ª  á Alt;
¥á«¨ ­¥ ­ ¦ â Alt, ­® ­ ¦ â Shift, â® ¨á¯®«ì§ã¥âáï
à áª« ¤ª  á Shift;
¥á«¨ ­¥ ­ ¦ âë Alt ¨ Shift, ­® ­ ¦ â Ctrl, â® ¨á¯®«ì§ã¥âáï
­®à¬ «ì­ ï à áª« ¤ª , ¯®á«¥ 祣® ¨§ ª®¤  ¢ëç¨â ¥âáï 0x60;
¥á«¨ ­¥ ­ ¦ â  ­¨ ®¤­  ¨§ ã¯à ¢«ïîé¨å ª« ¢¨è, â® ¨á¯®«ì§ã¥âáï
­®à¬ «ì­ ï à áª« ¤ª .
* “áâ ­®¢¨âì à áª« ¤ª¨ ¨ ¨¤¥­â¨ä¨ª â®à áâà ­ë ¬®¦­® á ¯®¬®éìî
¯®¤ä㭪樨 2 ä㭪樨 21.
* ˆ¤¥­â¨ä¨ª â®à áâà ­ë - £«®¡ «ì­ ï á¨á⥬­ ï ¯¥à¥¬¥­­ ï, ª®â®à ï
á ¬¨¬ ï¤à®¬ ­¥ ¨á¯®«ì§ã¥âáï; ®¤­ ª® ¯à¨«®¦¥­¨¥ @panel ®â®¡à ¦ ¥â
ᮮ⢥âáâ¢ãîéãî ⥪ã饩 áâà ­¥ ¨ª®­ªã
(¨á¯®«ì§ãï ®¯¨á뢠¥¬ãî äã­ªæ¨î).
* à¨«®¦¥­¨¥ @panel ¯¥à¥ª«îç ¥â à áª« ¤ª¨ ¯® § ¯à®áã ¯®«ì§®¢ â¥«ï.
 
======================================================================
============ ”ã­ªæ¨ï 26, ¯®¤äã­ªæ¨ï 3 - ¯®«ãç¨âì ¡ §ã CD. ============
======================================================================
 à ¬¥âàë:
* eax = 26 - ­®¬¥à ä㭪樨
* ebx = 3 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ¡ §  CD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
‡ ¬¥ç ­¨ï:
*  §  CD ¨á¯®«ì§ã¥âáï ä㭪樥© 24.
* “áâ ­®¢¨âì ¡ §ã CD ¬®¦­® ¢ë§®¢®¬ ¯®¤ä㭪樨 3 ä㭪樨 21.
 
======================================================================
=== ”ã­ªæ¨ï 26, ¯®¤äã­ªæ¨ï 4 - ¯®«ãç¨âì ¡ §®¢ë© ¯®àâ Sound Blaster. ==
======================================================================
 à ¬¥âàë:
* eax = 26 - ­®¬¥à ä㭪樨
* ebx = 4 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ­®¬¥à ¡ §®¢®£® ¯®àâ 
‡ ¬¥ç ­¨ï:
* “áâ ­®¢ª  ¡ §ë ­ã¦­  ¤«ï à ¡®âë ä㭪権 25, 55.
* “áâ ­®¢¨âì ¡ §®¢ë© ¯®àâ ¬®¦­® ¢ë§®¢®¬ ¯®¤ä㭪樨 4 ä㭪樨 21.
 
======================================================================
========== ”ã­ªæ¨ï 26, ¯®¤äã­ªæ¨ï 5 - ¯®«ãç¨âì ï§ëª á¨á⥬ë. =========
======================================================================
 à ¬¥âàë:
* eax = 26 - ­®¬¥à ä㭪樨
* ebx = 5 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ï§ëª á¨á⥬ë (1=eng, 2=fi, 3=ger, 4=rus)
‡ ¬¥ç ­¨ï:
* Ÿ§ëª á¨á⥬ë - £«®¡ «ì­ ï á¨á⥬­ ï ¯¥à¥¬¥­­ ï, ­¨ª ª
­¥ ¨á¯®«ì§ã¥¬ ï á ¬¨¬ ï¤à®¬, ®¤­ ª® ¯à¨«®¦¥­¨¥ @panel à¨áã¥â
ᮮ⢥âáâ¢ãîéãî ¨ª®­ªã (¨á¯®«ì§ãï ®¯¨á뢠¥¬ãî äã­ªæ¨î).
* “áâ ­®¢¨âì ï§ëª á¨áâ¥¬ë ¬®¦­® ¢ë§®¢®¬ ¯®¤ä㭪樨 5 ä㭪樨 21.
 
======================================================================
======== ”ã­ªæ¨ï 26, ¯®¤äã­ªæ¨ï 6 - ¯®«ãç¨âì ¡ §®¢ë© ¯®àâ WSS. =======
======================================================================
 à ¬¥âàë:
* eax = 26 - ­®¬¥à ä㭪樨
* ebx = 6 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ¡ §®¢ë© ¯®àâ
‡ ¬¥ç ­¨ï:
*  §  WSS ¨á¯®«ì§ã¥âáï ä㭪樥© 27.
* “áâ ­®¢¨âì ¡ §®¢ë© ¯®àâ WSS ¬®¦­® ¢ë§®¢®¬ ¯®¤ä㭪樨 6 ä㭪樨 21.
 
======================================================================
============ ”ã­ªæ¨ï 26, ¯®¤äã­ªæ¨ï 7 - ¯®«ãç¨âì ¡ §ã HD. ============
======================================================================
 §  HD ­ã¦­  ¤«ï ®¯à¥¤¥«¥­¨ï, ­  ª ª®© ¦ñá⪨© ¤¨áª ¯¨á âì, ¯à¨
¨á¯®«ì§®¢ ­¨¨ ãáâ à¥¢è¨å ä㭪権 à ¡®âë á ä ©«®¢®© á¨á⥬®© ¨ ä㭪権,
­¥ï¢­® ¨á¯®«ì§ãîé¨å ¦ñá⪨© ¤¨áª (⨯  ¯®¤ä㭪樨 6 ä㭪樨 18);
¯à¨ ¨á¯®«ì§®¢ ­¨¨ ä㭪権 58 ¨ 70 ¨ ᮢ६¥­­®£® ᨭ⠪á¨á 
/HD0,/HD1,/HD2,/HD3 í⨠ä㭪樨 á ¬¨ ãáâ ­ ¢«¨¢ îâ ¡ §ã.
 à ¬¥âàë:
* eax = 26 - ­®¬¥à ä㭪樨
* ebx = 7 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ¡ §  HD: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
‡ ¬¥ç ­¨ï:
* ‹î¡®¥ ¯à¨«®¦¥­¨¥ ¢ «î¡®© ¬®¬¥­â ¢à¥¬¥­¨ ¬®¦¥â ¨§¬¥­¨âì ¡ §ã.
* “áâ ­®¢¨âì ¡ §ã ¬®¦­® ¢ë§®¢®¬ ¯®¤ä㭪樨 7 ä㭪樨 21.
* ®«ãç¨âì ¨á¯®«ì§ã¥¬ë© à §¤¥« ¦ñá⪮£® ¤¨áª  ¬®¦­® ¯®¤ä㭪樥© 8.
 
======================================================================
=========== ”ã­ªæ¨ï 26, ¯®¤äã­ªæ¨ï 8 - ¯®«ãç¨âì à §¤¥« HD. ===========
======================================================================
 §¤¥« HD ­ã¦¥­ ¤«ï ®¯à¥¤¥«¥­¨ï, ­  ª ª®© à §¤¥« ¦ñá⪮£® ¤¨áª 
¯¨á âì, ¯à¨ ¨á¯®«ì§®¢ ­¨¨ ãáâ à¥¢è¨å ä㭪権 à ¡®âë á ä ©«®¢®©
á¨á⥬®© ¨ ä㭪権, ­¥ï¢­® ¨á¯®«ì§ãîé¨å ¦ñá⪨© ¤¨áª (⨯ 
¯®¤ä㭪樨 6 ä㭪樨 18); ¯à¨ ¨á¯®«ì§®¢ ­¨¨ ä㭪権 58 ¨ 70 ¨
ᮢ६¥­­®£® ᨭ⠪á¨á  /HD0,/HD1,/HD2,/HD3 í⨠ä㭪樨 á ¬¨
ãáâ ­ ¢«¨¢ îâ ¡ §ã ¨ à §¤¥«.
 à ¬¥âàë:
* eax = 26 - ­®¬¥à ä㭪樨
* ebx = 8 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = à §¤¥« HD (áç¨â ï á 1)
‡ ¬¥ç ­¨ï:
* ‹î¡®¥ ¯à¨«®¦¥­¨¥ ¢ «î¡®© ¬®¬¥­â ¢à¥¬¥­¨ ¬®¦¥â ¨§¬¥­¨âì à §¤¥«.
* “áâ ­®¢¨âì à §¤¥« ¬®¦­® ¢ë§®¢®¬ ¯®¤ä㭪樨 8 ä㭪樨 21.
* “§­ âì ç¨á«® à §¤¥«®¢ ­  ¦ñá⪮¬ ¤¨áª¥ ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樨 11 ä㭪樨 18.
* ®«ãç¨âì ¨á¯®«ì§ã¥¬ãî ¡ §ã ¦ñá⪮£® ¤¨áª  ¬®¦­® ¯®¤ä㭪樥© 7.
 
======================================================================
=== ”ã­ªæ¨ï 26, ¯®¤äã­ªæ¨ï 9 - ¯®«ãç¨âì §­ ç¥­¨¥ áçñâ稪  ¢à¥¬¥­¨. ===
======================================================================
 à ¬¥âàë:
* eax = 26 - ­®¬¥à ä㭪樨
* ebx = 9 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ç¨á«® á®âëå ¤®«¥© ᥪ㭤ë, ¯à®è¥¤è¨å á ¬®¬¥­â 
§ ¯ã᪠ á¨á⥬ë
‡ ¬¥ç ­¨ï:
* ‘çñâ稪 ¡¥àñâáï ¯® ¬®¤ã«î 2^32, ç⮠ᮮ⢥âáâ¢ã¥â ­¥¬­®£¨¬ ¡®«¥¥
497 áã⮪.
* ‘¨á⥬­®¥ ¢à¥¬ï ¬®¦­® ¯®«ãç¨âì ä㭪樥© 3.
 
======================================================================
====== ”ã­ªæ¨ï 26, ¯®¤äã­ªæ¨ï 10 - ¯®«ãç¨âì ª ­ « DMA ¤«ï §¢ãª . =====
======================================================================
 à ¬¥âàë:
* eax = 26 - ­®¬¥à ä㭪樨
* ebx = 10 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ­®¬¥à ª ­ «  (®â 0 ¤® 3 ¢ª«îç¨â¥«ì­®)
‡ ¬¥ç ­¨ï:
* ®¬¥à ª ­ «  DMA ¨á¯®«ì§ã¥âáï ¢ ¯®¤ä㭪樨 1 ä㭪樨 55.
* “áâ ­®¢¨âì ª ­ « DMA ¤«ï §¢ãª  ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樨 10 ä㭪樨 21.
 
======================================================================
====================== ”ã­ªæ¨ï 26, ¯®¤äã­ªæ¨ï 11 =====================
=========== “§­ âì, à §à¥èñ­ «¨ ­¨§ª®ã஢­¥¢ë© ¤®áâ㯠ª HD. ==========
======================================================================
 à ¬¥âàë:
* eax = 26 - ­®¬¥à ä㭪樨
* ebx = 11 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0/1 - § ¯à¥éñ­/à §à¥èñ­
‡ ¬¥ç ­¨ï:
* ˆá¯®«ì§ã¥âáï ¯à¨ LBA-ç⥭¨¨ (¯®¤äã­ªæ¨ï 8 ä㭪樨 58).
* “áâ ­®¢¨âì ⥪ã饥 á®áâ®ï­¨¥ ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樨 11 ä㭪樨 21.
 
======================================================================
====================== ”ã­ªæ¨ï 26, ¯®¤äã­ªæ¨ï 12 =====================
========== “§­ âì, à §à¥èñ­ «¨ ­¨§ª®ã஢­¥¢ë© ¤®áâ㯠ª PCI. ==========
======================================================================
 à ¬¥âàë:
* eax = 26 - ­®¬¥à ä㭪樨
* ebx = 12 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0/1 - § ¯à¥éñ­/à §à¥èñ­
‡ ¬¥ç ­¨ï:
* ˆá¯®«ì§ã¥âáï ¯à¨ à ¡®â¥ á 設®© PCI (äã­ªæ¨ï 62).
* ’¥ªãé ï ॠ«¨§ æ¨ï ¨á¯®«ì§ã¥â ⮫쪮 ¬« ¤è¨© ¡¨â ecx.
* “áâ ­®¢¨âì ⥪ã饥 á®áâ®ï­¨¥ ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樨 12 ä㭪樨 21.
 
======================================================================
==== ”ã­ªæ¨ï 27 - ãáâ ­®¢¨âì £à®¬ª®áâì Windows Sound System (WSS). ===
======================================================================
 à ¬¥âàë:
* eax = 27 - ­®¬¥à ä㭪樨
* ebx = çâ® ãáâ ­ ¢«¨¢ âì:
* 1 - ãáâ ­®¢¨âì ®¡éãî £à®¬ª®áâì
* 2 - ãáâ ­®¢¨âì £à®¬ª®áâì Line In
* cl = ã஢¥­ì £à®¬ª®á⨠(0x0=á ¬ë© ¢ë᮪¨©, 0x1F=á ¬ë© ­¨§ª¨©,
ãáâ ­®¢«¥­­ë© ¡¨â 0x80=®âª«îç¨âì)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ­¥ ®¯à¥¤¥«¥­  ¡ §  WSS
* eax = 2 - ­¥¢¥à­ ï ¯®¤äã­ªæ¨ï
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ­ã¦­® ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ WSS ¢ë§®¢®¬
¯®¤ä㭪樨 6 ä㭪樨 21.
* “áâ ­®¢ª  ®¡é¥© £à®¬ª®á⨠䠪â¨ç¥áª¨ ¨£­®à¨àã¥âáï
(¢®§¢à é ¥âáï eax=0).
* ‚ áâ à®© ¤®ªã¬¥­â æ¨¨ ¨ ¢ ¨á室­¨ª å ï¤à  ¯®¤äã­ªæ¨ï 2
®è¨¡®ç­® ­ §¢ ­  £à®¬ª®áâìî CD-audio.
 
======================================================================
=============== ”ã­ªæ¨ï 28 - ãáâ ­®¢¨âì £à®¬ª®áâì SB16. ==============
======================================================================
 à ¬¥âàë:
* eax = 28 - ­®¬¥à ä㭪樨
* ebx = çâ® ãáâ ­ ¢«¨¢ âì:
* 1 - ãáâ ­®¢¨âì ®¡éãî £à®¬ª®áâì
* 2 - ãáâ ­®¢¨âì £à®¬ª®áâì CD-audio
* cl = ã஢¥­ì £à®¬ª®á⨠(0=off, 0xFF=max)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ­¥ ®¯à¥¤¥«¥­  ¡ §  SB
* eax = 2 - ­¥¢¥à­ ï ¯®¤äã­ªæ¨ï
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ­ã¦­® ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ SB ¢ë§®¢®¬
¯®¤ä㭪樨 4 ä㭪樨 21.
* â  äã­ªæ¨ï ¯à¥¤®áâ ¢«ï¥â ¡®«ìè¥ ¢ à¨ ­â®¢ ¤«ï £à®¬ª®áâ¨,
祬 äã­ªæ¨ï 25.
 
======================================================================
================ ”ã­ªæ¨ï 29 - ¯®«ãç¨âì á¨á⥬­ãî ¤ âã. ===============
======================================================================
 à ¬¥âàë:
* eax = 29 - ­®¬¥à ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0x00DDMMYY, £¤¥
(¨á¯®«ì§ã¥âáï ¤¢®¨ç­®-¤¥áïâ¨ç­®¥ ª®¤¨à®¢ ­¨¥, BCD)
* YY = ¤¢¥ ¬« ¤è¨¥ æ¨äàë £®¤  (00..99)
* MM = ¬¥áïæ (01..12)
* DD = ¤¥­ì (01..31)
‡ ¬¥ç ­¨ï:
* ‘¨á⥬­ãî ¤ âã ¬®¦­® ãáâ ­®¢¨âì ä㭪樥© 22.
 
======================================================================
================ ”ã­ªæ¨ï 32 - 㤠«¨âì ä ©« á à ¬¤¨áª . ===============
======================================================================
 à ¬¥âàë:
* eax = 32 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨¬ï ä ©« 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮; ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
‡ ¬¥ç ­¨ï:
* â  äã­ªæ¨ï ãáâ à¥« ; äã­ªæ¨ï 58 ¯®§¢®«ï¥â ¢ë¯®«­ïâì
⥠¦¥ ¤¥©á⢨ï á à áè¨à¥­­ë¬¨ ¢®§¬®¦­®áâﬨ.
* ’¥ªãé ï ॠ«¨§ æ¨ï ¢®§¢à é ¥â ⮫쪮 §­ ç¥­¨ï 0(ãᯥå) ¨
5(ä ©« ­¥ ­ ©¤¥­).
* ˆ¬ï ä ©«  ¤®«¦­® ¡ëâì «¨¡® ¢ ä®à¬ â¥ 8+3 ᨬ¢®«®¢ (¯¥à¢ë¥
8 ᨬ¢®«®¢ - ᮡá⢥­­® ¨¬ï, ¯®á«¥¤­¨¥ 3 - à áè¨à¥­¨¥,
ª®à®âª¨¥ ¨¬¥­  ¨ à áè¨à¥­¨ï ¤®¯®«­ïîâáï ¯à®¡¥« ¬¨),
«¨¡® ¢ ä®à¬ â¥ 8.3 ᨬ¢®«®¢ "FILE.EXT"/"FILE.EX "
(¨¬ï ­¥ ¡®«¥¥ 8 ᨬ¢®«®¢, â®çª , à áè¨à¥­¨¥ 3 ᨬ¢®« ,
¤®¯®«­¥­­®¥ ¯à¨ ­¥®¡å®¤¨¬®á⨠¯à®¡¥« ¬¨).
ˆ¬ï ä ©«  ¤®«¦­® ¡ëâì § ¯¨á ­® § £« ¢­ë¬¨ ¡ãª¢ ¬¨.
‡ ¢¥àè î騩 ᨬ¢®« á ª®¤®¬ 0 ­¥ ­ã¦¥­ (­¥ ASCIIZ-áâப ).
* â  äã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥â ¯ ¯®ª ­  à ¬¤¨áª¥.
 
======================================================================
=============== ”ã­ªæ¨ï 33 - § ¯¨á âì ä ©« ­  à ¬¤¨áª. ===============
======================================================================
 à ¬¥âàë:
* eax = 33 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨¬ï ä ©« 
* ecx = 㪠§ â¥«ì ­  ¤ ­­ë¥ ¤«ï § ¯¨á¨
* edx = ç¨á«® ¡ ©â ¤«ï § ¯¨á¨
* á«¥¤ã¥â ãáâ ­ ¢«¨¢ âì esi=0
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
‡ ¬¥ç ­¨ï:
* â  äã­ªæ¨ï ãáâ à¥« ; äã­ªæ¨ï 70 ¯®§¢®«ï¥â ¢ë¯®«­ïâì
⥠¦¥ ¤¥©á⢨ï á à áè¨à¥­­ë¬¨ ¢®§¬®¦­®áâﬨ.
* …᫨ 㪠§ âì ­¥­ã«¥¢®¥ §­ ç¥­¨¥ ¢ esi ¨ ­  à ¬¤¨áª¥ 㦥 ¥áâì
㪠§ ­­ë© ä ©«, â® ¡ã¤¥â ᮧ¤ ­ ¥éñ ®¤¨­ ä ©« á ⥬ ¦¥ ¨¬¥­¥¬.
* ‚ ¯à®â¨¢­®¬ á«ãç ¥ ä ©« ¯¥à¥§ ¯¨á뢠¥âáï.
* ˆ¬ï ä ©«  ¤®«¦­® ¡ëâì «¨¡® ¢ ä®à¬ â¥ 8+3 ᨬ¢®«®¢
(¯¥à¢ë¥ 8 ᨬ¢®«®¢ - ᮡá⢥­­® ¨¬ï, ¯®á«¥¤­¨¥ 3 - à áè¨à¥­¨¥,
ª®à®âª¨¥ ¨¬¥­  ¨ à áè¨à¥­¨ï ¤®¯®«­ïîâáï ¯à®¡¥« ¬¨),
«¨¡® ¢ ä®à¬ â¥ 8.3 ᨬ¢®«®¢ "FILE.EXT"/"FILE.EX "
(¨¬ï ­¥ ¡®«¥¥ 8 ᨬ¢®«®¢, â®çª , à áè¨à¥­¨¥ 3 ᨬ¢®« ,
¤®¯®«­¥­­®¥ ¯à¨ ­¥®¡å®¤¨¬®á⨠¯à®¡¥« ¬¨).
ˆ¬ï ä ©«  ¤®«¦­® ¡ëâì § ¯¨á ­® § £« ¢­ë¬¨ ¡ãª¢ ¬¨.
‡ ¢¥àè î騩 ᨬ¢®« á ª®¤®¬ 0 ­¥ ­ã¦¥­ (­¥ ASCIIZ-áâப ).
* â  äã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥â ¯ ¯®ª ­  à ¬¤¨áª¥.
 
======================================================================
============ ”ã­ªæ¨ï 35 - ¯à®ç¨â âì 梥â â®çª¨ ­  íªà ­¥. ============
======================================================================
 à ¬¥âàë:
* eax = 35
* ebx = y*xsize+x, £¤¥
* (x,y) = ª®®à¤¨­ âë â®çª¨ (áç¨â ï ®â 0)
* xsize = à §¬¥à íªà ­  ¯® £®à¨§®­â «¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 梥â 0x00RRGGBB
‡ ¬¥ç ­¨ï:
* “§­ âì à §¬¥àë íªà ­  ¬®¦­® ¢ë§®¢®¬ ä㭪樨 14. Ž¡à â¨â¥ ¢­¨¬ ­¨¥,
çâ® ®­  ¢ëç¨â ¥â 1 ¨§ ®¡®¨å à §¬¥à®¢.
* Š ¢¨¤¥®¯ ¬ï⨠¥áâì â ª¦¥ ¯àאַ© ¤®áâ㯠(¡¥§ ¢ë§®¢®¢ á¨á⥬­ëå
ä㭪権) ç¥à¥§ ᥫ¥ªâ®à gs.  à ¬¥âàë ⥪ã饣® ¢¨¤¥®à¥¦¨¬ 
¬®¦­® ¯®«ãç¨âì ä㭪樥© 61.
 
======================================================================
========== ”ã­ªæ¨ï 37 - ¯®«ãç¨âì ª®®à¤¨­ âë/á®áâ®ï­¨¥ ¬ëè¨. ==========
======================================================================
 
-------------- ®¤äã­ªæ¨ï 0 - íªà ­­ë¥ ª®®à¤¨­ âë ¬ëè¨ ---------------
 à ¬¥âàë:
* eax = 37 - ­®¬¥à ä㭪樨
* ebx = 0 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = x*65536 + y, (x,y)=ª®®à¤¨­ âë ªãàá®à  ¬ëè¨ (áç¨â ï ®â 0)
 
---------- ®¤äã­ªæ¨ï 1 - ª®®à¤¨­ âë ¬ëè¨ ®â­®á¨â¥«ì­® ®ª­  ----------
 à ¬¥âàë:
* eax = 37 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = x*65536 + y, (x,y)=ª®®à¤¨­ âë ªãàá®à  ¬ëè¨ ®â­®á¨â¥«ì­®
®ª­  ¯à¨«®¦¥­¨ï (áç¨â ï ®â 0)
‡ ¬¥ç ­¨ï:
* ‡­ ç¥­¨¥ ¢ëç¨á«ï¥âáï ¯® ä®à¬ã«¥ (x-xwnd)*65536 + (y-ywnd).
…᫨ y>=ywnd, â® ¬« ¤è¥¥ á«®¢® ­¥®âà¨æ â¥«ì­® ¨ ᮤ¥à¦¨â
®â­®á¨â¥«ì­ãî y-ª®®à¤¨­ âã,   áâ à襥 - ®â­®á¨â¥«ì­ãî x-ª®®à¤¨­ âã
(¯à ¢¨«ì­®£® §­ ª ). ‚ ¯à®â¨¢­®¬ á«ãç ¥ ¬« ¤è¥¥ á«®¢® ®âà¨æ â¥«ì­®
¨ ¢áñ à ¢­® ᮤ¥à¦¨â ®â­®á¨â¥«ì­ãî y-ª®®à¤¨­ âã,
  ª áâ à襬ã á«®¢ã á«¥¤ã¥â ¯à¨¡ ¢¨âì 1.
 
----------------- ®¤äã­ªæ¨ï 2 - ­ ¦ âë¥ ª­®¯ª¨ ¬ëè¨ -----------------
 à ¬¥âàë:
* eax = 37 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax ᮤ¥à¦¨â ¨­ä®à¬ æ¨î ® ­ ¦ âëå ª­®¯ª å ¬ëè¨:
* ¡¨â 0 ãáâ ­®¢«¥­ = «¥¢ ï ª­®¯ª  ­ ¦ â 
* ¡¨â 1 ãáâ ­®¢«¥­ = ¯à ¢ ï ª­®¯ª  ­ ¦ â 
* ¯à®ç¨¥ ¡¨âë á¡à®è¥­ë
 
======================================================================
================== ”ã­ªæ¨ï 38 - ­ à¨á®¢ âì ®â१®ª. ==================
======================================================================
 à ¬¥âàë:
* eax = 38 - ­®¬¥à ä㭪樨
* ebx = [ª®®à¤¨­ â  ­ ç «  ¯® ®á¨ x]*65536 +
[ª®®à¤¨­ â  ª®­æ  ¯® ®á¨ x]
* ecx = [ª®®à¤¨­ â  ­ ç «  ¯® ®á¨ y]*65536 +
[ª®®à¤¨­ â  ª®­æ  ¯® ®á¨ y]
* edx = 0x00RRGGBB - 梥â
edx = 0x01xxxxxx - à¨á®¢ âì ¨­¢¥àá­ë© ®â१®ª
(¬« ¤è¨¥ 24 ¡¨â  ¨£­®à¨àãîâáï)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* Š®®à¤¨­ âë ¡¥àãâáï ®â­®á¨â¥«ì­® ®ª­ .
* Š®­¥ç­ ï â®çª  â ª¦¥ à¨áã¥âáï.
 
======================================================================
== ”ã­ªæ¨ï 39, ¯®¤äã­ªæ¨ï 1 - ¯®«ãç¨âì à §¬¥à ä®­®¢®£® ¨§®¡à ¦¥­¨ï. ==
======================================================================
 à ¬¥âàë:
* eax = 39 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = [è¨à¨­ ]*65536 + [¢ëá®â ]
‡ ¬¥ç ­¨ï:
* …áâì ¯ à­ ï ª®¬ ­¤  ãáâ ­®¢ª¨ à §¬¥à®¢ ä®­®¢®£® ¨§®¡à ¦¥­¨ï -
¯®¤äã­ªæ¨ï 1 ä㭪樨 15. ®á«¥ ª®â®à®©, ࠧ㬥¥âáï, á«¥¤ã¥â
§ ­®¢® ®¯à¥¤¥«¨âì á ¬® ¨§®¡à ¦¥­¨¥.
 
======================================================================
= ”ã­ªæ¨ï 39, ¯®¤äã­ªæ¨ï 2 - ¯à®ç¨â âì â®çªã á ä®­®¢®£® ¨§®¡à ¦¥­¨ï. =
======================================================================
 à ¬¥âàë:
* eax = 39 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ᬥ饭¨¥
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0x00RRGGBB - 梥â â®çª¨, ¥á«¨ ᬥ饭¨¥ ¤®¯ãá⨬®
(¬¥­ìè¥ 0x160000-16)
* eax = 2 - ¨­ ç¥
‡ ¬¥ç ­¨ï:
* ¥ á«¥¤ã¥â ¯®« £ âìáï ­  ¢®§¢à é ¥¬®¥ §­ ç¥­¨¥ ¢ á«ãç ¥ ­¥¢¥à­®£®
ᬥ饭¨ï, ®­® ¬®¦¥â ¨§¬¥­¨âìáï ¢ á«¥¤ãîé¨å ¢¥àá¨ïå ï¤à .
* ‘¬¥é¥­¨¥ â®çª¨ á ª®®à¤¨­ â ¬¨ (x,y) ¢ëç¨á«ï¥âáï ª ª (x+y*xsize)*3.
* …áâì ¯ à­ ï äã­ªæ¨ï ãáâ ­®¢ª¨ â®çª¨ ­  ä®­®¢®¬ ¨§®¡à ¦¥­¨¨ -
¯®¤äã­ªæ¨ï 2 ä㭪樨 15.
 
======================================================================
====== ”ã­ªæ¨ï 39, ¯®¤äã­ªæ¨ï 4 - ¯®«ãç¨âì ०¨¬ ®âà¨á®¢ª¨ ä®­ . =====
======================================================================
 à ¬¥âàë:
* eax = 39 - ­®¬¥à ä㭪樨
* ebx = 4 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 1 - § ¬®áâ¨âì
* eax = 2 - à áâï­ãâì
‡ ¬¥ç ­¨ï:
* …áâì ¯ à­ ï äã­ªæ¨ï ãáâ ­®¢ª¨ ०¨¬  ®âà¨á®¢ª¨ ä®­  -
¯®¤äã­ªæ¨ï 4 ä㭪樨 15.
 
======================================================================
======== ”ã­ªæ¨ï 40 - ãáâ ­®¢¨âì ¬ áªã ¤«ï ®¦¨¤ ¥¬ëå ᮡë⨩. ========
======================================================================
Œ áª  ¤«ï ®¦¨¤ ¥¬ëå ᮡë⨩ ¢«¨ï¥â ­  ä㭪樨 à ¡®âë á ᮡëâ¨ï¬¨ 10,
11, 23 - ®­¨ á®®¡é îâ ⮫쪮 ® ᮡëâ¨ïå, à §à¥èñ­­ëå í⮩ ¬ áª®©.
 à ¬¥âàë:
* eax = 40 - ­®¬¥à ä㭪樨
* ebx = ¬ áª : ¡¨â i ᮮ⢥âáâ¢ã¥â ᮡëâ¨î i+1 (á¬. ᯨ᮪ ᮡë⨩)
(ãáâ ­®¢«¥­­ë© ¡¨â à §à¥è ¥â ¨§¢¥é¥­¨¥ ® ᮡë⨨)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* Œ áª  ¯® 㬮«ç ­¨î (7=111b) à §à¥è ¥â ¨§¢¥é¥­¨ï ® ¯¥à¥à¨á®¢ª¥
¨ ­ ¦ â¨ïå ª« ¢¨è ¨ ª­®¯®ª.
â®£® ¤®áâ â®ç­® ¤«ï ¡®«ì設á⢠ ¯à¨«®¦¥­¨©.
* ‘®¡ëâ¨ï, § ¯à¥éñ­­ë¥ ¢ ¬ áª¥, ¢áñ à ¢­® á®åà ­ïîâáï, ¥á«¨
¯à¨å®¤ïâ; ® ­¨å ¯à®áâ® ­¥ ¨§¢¥é îâ ä㭪樨 à ¡®âë á ᮡëâ¨ï¬¨.
* ”㭪樨 à ¡®âë á ᮡëâ¨ï¬¨ ãç¨â뢠îâ ¬ áªã ­  ¬®¬¥­â
¢ë§®¢  ä㭪樨,   ­¥ ­  ¬®¬¥­â ¯®áâ㯫¥­¨ï á®®¡é¥­¨ï.
 
======================================================================
================= ”ã­ªæ¨ï 41 - 㧭 âì ¢« ¤¥«ìæ  IRQ. =================
======================================================================
 à ¬¥âàë:
* eax = 41 - ­®¬¥à ä㭪樨
* ebx = ­®¬¥à IRQ, 0..15
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = PID ¢« ¤¥«ìæ 
* eax = 0, ¥á«¨ ¢« ¤¥«ìæ  ­¥â
* eax = -1 ¤«ï ­¥ª®à४⭮£® ebx
 
======================================================================
========== ”ã­ªæ¨ï 42 - ¯à®ç¨â âì ¤ ­­ë¥, ¯®«ã祭­ë¥ ¯® IRQ. =========
======================================================================
à¨ ¢®§­¨ª­®¢¥­¨¨ IRQ á¨á⥬  ¬®¦¥â áç¨â뢠âì ¤ ­­ë¥ ¨§ 㪠§ ­­ëå
à ­¥¥ ä㭪樥© 44 ¯®à⮢ ¨ § ¯¨á뢠âì í⨠¤ ­­ë¥ ¢ ¡ãä¥à.
Ž¯¨á뢠¥¬ ï äã­ªæ¨ï áç¨â뢠¥â ¯®¡ ©â­® ¤ ­­ë¥ ¨§ í⮣® ¡ãä¥à .
 à ¬¥âàë:
* eax = 42 - ­®¬¥à ä㭪樨
* ebx = ­®¬¥à IRQ, 0..15
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥: (á¨âã æ¨î ¬®¦­® à §«¨ç¨âì ¯® §­ ç¥­¨î ecx)
* ¥á«¨ ¯®â®ª ­¥ ï¥âáï ¢« ¤¥«ì楬 IRQ
(¨«¨ ­®¬¥à IRQ § ¤ ­ ­¥¢¥à­®):
* ecx = 2
* ¥á«¨ ¤ ­­ëå ­¥â:
* eax = 0
* ecx = 1
* ebx à §àãè ¥âáï
* ¥á«¨ ¢áñ ¢ ¯®à浪¥ ¨ ¤ ­­ë¥ ¡ë«¨:
* eax = à §¬¥à ¤ ­­ëå, ¥éñ ­¥ ¯à®ç¨â ­­ëå ¨§ ¡ãä¥à  (¢ ¡ ©â å)
* ecx = 0
* ebx = ®ç¥à¥¤­®© ¡ ©â
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ¯®â®ª ¤®«¦¥­ § à¥§¥à¢¨à®¢ âì ¤«ï ᥡï 㪠§ ­­ë© IRQ
ä㭪樥© 45.
*  §¬¥à ¡ãä¥à  ¤«ï ¤ ­­ëå - 4000 ¡ ©â, ¯à¨ ¯¥à¥¯®«­¥­¨¨
"ᢥ¦¨¥" ¤ ­­ë¥ ¯¥à¥áâ îâ § ¯¨á뢠âìáï ¢ ¡ãä¥à.
 
======================================================================
=================== ”ã­ªæ¨ï 43 - ¢¢®¤/¢ë¢®¤ ¢ ¯®àâ. ==================
======================================================================
 
------------------------ ‚뢮¤ ¤ ­­ëå ¢ ¯®àâ -------------------------
 à ¬¥âàë:
* eax = 43 - ­®¬¥à ä㭪樨
* bl = ¡ ©â ¤«ï ¢ë¢®¤ 
* ecx = ­®¬¥à ¯®àâ  0xnnnn (®â 0 ¤® 0xFFFF)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ¯®â®ª ­¥ § à¥§¥à¢¨à®¢ « 㪠§ ­­ë© ¯®àâ
 
------------------------ ‚¢®¤ ¤ ­­ëå ¨§ ¯®àâ  ------------------------
 à ¬¥âàë:
* eax = 43 - ­®¬¥à ä㭪樨
* ebx ¨£­®à¨àã¥âáï
* ecx = 0x8000nnnn, £¤¥ nnnn = ­®¬¥à ¯®àâ  (®â 0 ¤® 0xFFFF)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¯à¨ í⮬ ebx = ¢¢¥¤ñ­­ë© ¡ ©â
* eax = 1 - ¯®â®ª ­¥ § à¥§¥à¢¨à®¢ « ¤ ­­ë© ¯®àâ
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ¯®â®ª ¤®«¦¥­ § à¥§¥à¢¨à®¢ âì §  ᮡ®©
㪠§ ­­ë© ¯®àâ ä㭪樥© 46.
* „«ï § à¥§¥à¢¨à®¢ ­­ëå ¯®à⮢ ¢¬¥áâ® ¢ë§®¢  íâ¨å ä㭪権
«ãçè¥ ¨á¯®«ì§®¢ âì ª®¬ ­¤ë ¯à®æ¥áá®à  in/out - íâ® §­ ç¨â¥«ì­®
¡ëáâ॥ ¨ ­¥áª®«ìª® ª®à®ç¥ ¨ ¯à®é¥. ˆ§ ­¥§ à¥§¥à¢¨à®¢ ­­ëå
¯®à⮢ ç¨â âì ¢áñ à ¢­® ­¥«ì§ï.
 
======================================================================
======== ”ã­ªæ¨ï 44 - ®¯à¥¤¥«¨âì ¤¥©áâ¢¨ï ¯à¨ ¯®áâ㯫¥­¨¨ IRQ. =======
======================================================================
à¨ ¢®§­¨ª­®¢¥­¨¨ IRQ á¨á⥬  ¬®¦¥â áç¨â뢠âì ¤ ­­ë¥ ¨§ 㪠§ ­­ëå í⮩
ä㭪樥© ¯®à⮢ ¨ § ¯¨á뢠âì í⨠¤ ­­ë¥ ¢ ¡ãä¥à, ®âªã¤  ¨å ¬®¦­®
¯à®ç¨â âì ä㭪樥© 42.
 à ¬¥âàë:
* eax = 44 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¬ áᨢ áâàãªâãà, ®¯¨á뢠îé¨å ¯® ®¤­®¬ã ¯®àâã:
* +0: word: 0 ®§­ ç ¥â ª®­¥æ ¬ áᨢ , ¨­ ç¥ ­®¬¥à ¯®àâ 
* +2: byte: § à¥§¥à¢¨à®¢ ­® (¨£­®à¨àã¥âáï)
* +3: byte: 1=áç¨â뢠âì ¡ ©â ¨§ í⮣® ¯®àâ , 2=áç¨â뢠âì á«®¢®
* ecx = ­®¬¥à IRQ, 0..15
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ¯®â®ª ­¥ ï¥âáï ¢« ¤¥«ì楬 㪠§ ­­®£® IRQ
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ¯®â®ª ¤®«¦¥­ § à¥§¥à¢¨à®¢ âì §  ᮡ®©
㪠§ë¢ ¥¬ë© IRQ ä㭪樥© 45.
* à¨­¨¬ îâáï ¢® ¢­¨¬ ­¨¥ ⮫쪮 ¯¥à¢ë¥ 16 ¯®à⮢.
* ’¥ªãé ï ॠ«¨§ æ¨ï à áᬠâਢ ¥â ­¥¯à ¢¨«ì­®¥ §­ ç¥­¨¥ ¯®«ï +3
ª ª ᨣ­ « ¯à¥ªà é¥­¨ï ®¡à ¡®âª¨ IRQ.
 
======================================================================
============ ”ã­ªæ¨ï 45 - § à¥§¥à¢¨à®¢ âì/®á¢®¡®¤¨âì IRQ. ============
======================================================================
 à ¬¥âàë:
* eax = 45 - ­®¬¥à ä㭪樨
* ebx = 0 - § à¥§¥à¢¨à®¢ âì, 1 = ®á¢®¡®¤¨âì
* ecx = ­®¬¥à IRQ, 0..15
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ®è¨¡ª  (­¥¢¥à­ë© ­®¬¥à IRQ ¨«¨
¯®¯ë⪠ § à¥§¥à¢¨à®¢ âì ­¥á¢®¡®¤­ë© IRQ ¨«¨ ®á¢®¡®¤¨âì IRQ, ­¥
§ à¥§¥à¢¨à®¢ ­­ë© ⥪ã騬 ¯®â®ª®¬)
‡ ¬¥ç ­¨ï:
* ¥§¥à¢¨à®¢ ­¨¥ IRQ ­ã¦­® ¤«ï à ¡®âë ä㭪権 42 ¨ 44.
* ’®«ìª® ®¤¨­ ¯®â®ª ¬®¦¥â § à¥§¥à¢¨à®¢ âì ª®­ªà¥â­ë© IRQ.
* IRQ, ®¡à ¡ â뢠¥¬ë¥ á¨á⥬®© á ¬®áâ®ï⥫쭮, १¥à¢¨àãîâáï
á¨á⥬®© (¯®â®ª®¬ 1) ¯à¨ § £à㧪¥.
* à¨ § ¢¥à襭¨¨ ¯®â®ª   ¢â®¬ â¨ç¥áª¨ ®á¢®¡®¦¤ îâáï
¢á¥ § à¥§¥à¢¨à®¢ ­­ë¥ ¨¬ IRQ.
 
======================================================================
= ”ã­ªæ¨ï 46 - § à¥§¥à¢¨à®¢ âì/®á¢®¡®¤¨âì £à㯯㠯®à⮢ ¢¢®¤ /¢ë¢®¤ .
======================================================================
Š § à¥§¥à¢¨à®¢ ­­ë¬ ¯®àâ ¬ ¬®¦­® ®¡à é âìáï ­ ¯àï¬ãî ¨§ ¯à¨«®¦¥­¨ï
ª®¬ ­¤ ¬¨ in/out (४®¬¥­¤ã¥¬ë© ᯮᮡ) ¨ ¢ë§®¢®¬ ä㭪樨 43
(­¥à¥ª®¬¥­¤ã¥¬ë© ᯮᮡ).
 à ¬¥âàë:
* eax = 46 - ­®¬¥à ä㭪樨
* ebx = 0 - § à¥§¥à¢¨à®¢ âì, 1 - ®á¢®¡®¤¨âì
* ecx = ­®¬¥à ­ ç «  ¤¨ ¯ §®­  ¯®à⮢
* edx = ­®¬¥à ª®­æ  ¤¨ ¯ §®­  ¯®à⮢ (¢ª«îç¨â¥«ì­®)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ®è¨¡ª 
‡ ¬¥ç ­¨ï:
* ‚ á«ãç ¥ १¥à¢¨à®¢ ­¨ï ¯®à⮢ ®è¨¡ª®© áç¨â ¥âáï ¢ë¯®«­¥­¨¥
®¤­®£® ¨§ ãá«®¢¨©:
* ­ ç «ì­ë©  ¤à¥á ¡®«ìè¥ ª®­¥ç­®£®;
* 㪠§ ­­ë© ¤¨ ¯ §®­ ᮤ¥à¦¨â ­¥ª®à४â­ë© ­®¬¥à ¯®àâ 
(ª®à४â­ë¥ - ®â 0 ¤® 0xFFFF);
* ¯à¥¢ë襭® ®£à ­¨ç¥­¨¥ ­  ®¡é¥¥ ç¨á«® § à¥§¥à¢¨à®¢ ­­ëå ®¡« á⥩
- ¤®¯ã᪠¥âáï ¬ ªá¨¬ã¬ 255;
* 㪠§ ­­ë© ¤¨ ¯ §®­ ¯¥à¥á¥ª ¥âáï á ®¤­¨¬ ¨§
à ­¥¥ § à¥§¥à¢¨à®¢ ­­ëå
* ‚ á«ãç ¥ ®á¢®¡®¦¤¥­¨ï ¯®à⮢ ®è¨¡ª®© áç¨â ¥âáï ¯®¯ë⪠
®á¢®¡®¦¤¥­¨ï ¤¨ ¯ §®­ , ª®â®àë© à ­¥¥ ­¥ ¡ë« 楫¨ª®¬
§ à¥§¥à¢¨à®¢ ­ í⮩ ¦¥ ä㭪樥© (á â ª¨¬¨ ¦¥ §­ ç¥­¨ï¬¨ ecx,edx).
* à¨ ®¡­ à㦥­¨¨ ®è¨¡ª¨ (¢ ®¡®¨å á«ãç ïå) ­¨ª ª¨å ¤¥©á⢨©
­¥ ¯à®¨§¢®¤¨âáï.
* à¨ § £à㧪¥ á¨á⥬  १¥à¢¨àã¥â §  ᮡ®© ¯®àâë 0..0xff,   ¯à¨
®¡­ à㦥­¨¨ COM-¬ëè¨ - ¤®¯®«­¨â¥«ì­® ¤¨ ¯ §®­ COM-¯®à⮢
0x3f0..0x3ff ¨/¨«¨ 0x2f0..0x2ff.
* à¨ § ¢¥à襭¨¨ ¯®â®ª   ¢â®¬ â¨ç¥áª¨ ®á¢®¡®¦¤ îâáï ¢á¥
§ à¥§¥à¢¨à®¢ ­­ë¥ ¨¬ ¯®àâë.
 
======================================================================
================= ”ã­ªæ¨ï 47 - ¢ë¢¥á⨠ç¨á«® ¢ ®ª­®. =================
======================================================================
 à ¬¥âàë:
* eax = 47 - ­®¬¥à ä㭪樨
* ebx = ¯ à ¬¥âàë ¯à¥®¡à §®¢ ­¨ï ç¨á«  ¢ ⥪áâ:
* bl = 0 - ecx ᮤ¥à¦¨â ç¨á«®
* bl = 1 - ecx ᮤ¥à¦¨â 㪠§ â¥«ì ­  dword-ç¨á«®
* bh = 0 - ®â®¡à ¦ âì ¢ ¤¥áïâ¨ç­®© á¨á⥬¥ áç¨á«¥­¨ï
* bh = 1 - ®â®¡à ¦ âì ¢ è¥áâ­ ¤æ â¥à¨ç­®© á¨á⥬¥
* bh = 2 - ®â®¡à ¦ âì ¢ ¤¢®¨ç­®© á¨á⥬¥
* ¡¨âë 16-21 = ᪮«ìª® æ¨äà ®â®¡à ¦ âì
* ¡¨âë 22-31 § à¥§¥à¢¨à®¢ ­ë ¨ ¤®«¦­ë ¡ëâì ãáâ ­®¢«¥­ë ¢ 0
* ecx = ç¨á«® (¯à¨ bl=0) ¨«¨ 㪠§ â¥«ì (¯à¨ bl=1)
* edx = [ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [ª®®à¤¨­ â  ¯® ®á¨ y]
* esi = 0xX0RRGGBB:
* RR, GG, BB § ¤ îâ 梥â
* X = ABnn (¡¨âë)
* nn = èà¨äâ (0/1)
* A ¨£­®à¨àã¥âáï
* B=1 - § ªà è¨¢ âì ä®­ 梥⮬ edi
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* “ª § ­­ ï ¤«¨­  ­¥ ¤®«¦­  ¯à¥¢®á室¨âì 60.
* ‚뢮¤¨âáï ஢­® 㪠§ ­­®¥ ª®«¨ç¥á⢮ æ¨äà. …᫨ ç¨á«® ¬ «® ¨
¬®¦¥â ¡ëâì § ¯¨á ­® ¬¥­ì訬 ª®«¨ç¥á⢮¬ æ¨äà, ®­® ¤®¯®«­ï¥âáï
¢¥¤ã騬¨ ­ã«ï¬¨; ¥á«¨ ç¨á«® ¢¥«¨ª® ¨ ­¥ ¬®¦¥â ¡ëâì § ¯¨á ­®
â ª¨¬ ª®«¨ç¥á⢮¬ æ¨äà, "«¨è­¨¥" ¢¥¤ã騥 æ¨äàë ®¡à¥§ îâáï.
*  à ¬¥âàë èà¨ä⮢ 㪠§ ­ë ¢ ®¯¨á ­¨¨ ä㭪樨 4 (¢ë¢®¤  ⥪áâ ).
 
======================================================================
======= ”ã­ªæ¨ï 48, ¯®¤äã­ªæ¨ï 0 - ¯à¨¬¥­¨âì ­ áâனª¨ íªà ­ . =======
======================================================================
 à ¬¥âàë:
* eax = 48 - ­®¬¥à ä㭪樨
* ebx = 0 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 0 - § à¥§¥à¢¨à®¢ ­®
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ”ã­ªæ¨ï ¯¥à¥à¨á®¢ë¢ ¥â íªà ­ ¯®á«¥ ¨§¬¥­¥­¨ï ¯ à ¬¥â஢
¯®¤äã­ªæ¨ï¬¨ 1 ¨ 2.
* ‚맮¢ ä㭪樨 ¡¥§ ¯à¥¤è¥áâ¢ãîé¨å ¢ë§®¢®¢ 㪠§ ­­ëå ¯®¤ä㭪権
¨£­®à¨àã¥âáï.
* ‚맮¢ ä㭪樨 á ­¥­ã«¥¢ë¬ ecx ¨£­®à¨àã¥âáï.
 
======================================================================
========= ”ã­ªæ¨ï 48, ¯®¤äã­ªæ¨ï 1 - ãáâ ­®¢¨âì áâ¨«ì ª­®¯®ª. ========
======================================================================
 à ¬¥âàë:
* eax = 48 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ⨯ ª­®¯®ª:
* 0 = ¯«®áª¨¥
* 1 = ®¡êñ¬­ë¥
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ®á«¥ ¢ë§®¢  ®¯¨á뢠¥¬®© ä㭪樨 á«¥¤ã¥â ¯¥à¥à¨á®¢ âì íªà ­
¯®¤ä㭪樥© 0.
* ’¨¯ ª­®¯®ª ¢«¨ï¥â ⮫쪮 ­  ¨å ¯à®à¨á®¢ªã ä㭪樥© 8.
 
======================================================================
==== ”ã­ªæ¨ï 48, ¯®¤äã­ªæ¨ï 2 - ãáâ ­®¢¨âì áâ ­¤ àâ­ë¥ æ¢¥â  ®ª®­. ===
======================================================================
 à ¬¥âàë:
* eax = 48 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 㪠§ â¥«ì ­  â ¡«¨æã 梥⮢
* edx = à §¬¥à â ¡«¨æë 梥⮢
(¤®«¦¥­ ¡ëâì 40 ¡ ©â ¤«ï ¡ã¤ã饩 ᮢ¬¥á⨬®áâ¨)
”®à¬ â â ¡«¨æë 梥⮢ 㪠§ ­ ¢ ®¯¨á ­¨¨ ¯®¤ä㭪樨 3.
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ®á«¥ ¢ë§®¢  ®¯¨á뢠¥¬®© ä㭪樨 á«¥¤ã¥â ¯¥à¥à¨á®¢ âì íªà ­
¯®¤ä㭪樥© 0.
* ’ ¡«¨æ  áâ ­¤ àâ­ëå 梥⮢ ¢«¨ï¥â ⮫쪮 ­  ¯à¨«®¦¥­¨ï,
ª®â®àë¥ íâã â ¡«¨æã ï¢­ë¬ ®¡à §®¬ ¯®«ãç îâ (¯®¤ä㭪樥© 3) ¨
¨á¯®«ì§ãîâ (㪠§ë¢ ï æ¢¥â  ¨§ ­¥ñ ¯à¨ ¢ë§®¢ å ä㭪権 à¨á®¢ ­¨ï).
* ’ ¡«¨æ  áâ ­¤ àâ­ëå 梥⮢ ¢å®¤¨â ¢ ᪨­ ¨ ãáâ ­ ¢«¨¢ ¥âáï § ­®¢®
¯à¨ ãáâ ­®¢ª¥ ᪨­  (¯®¤ä㭪樨 8).
* ’ ¡«¨æã 梥⮢ ¬®¦­® ¯à®á¬ âਢ âì/¨§¬¥­ïâì ¨­â¥à ªâ¨¢­® á ¯®¬®éìî
¯à¨«®¦¥­¨ï desktop.
 
======================================================================
===== ”ã­ªæ¨ï 48, ¯®¤äã­ªæ¨ï 3 - ¯®«ãç¨âì áâ ­¤ àâ­ë¥ æ¢¥â  ®ª®­. ====
======================================================================
 à ¬¥âàë:
* eax = 48 - ­®¬¥à ä㭪樨
* ebx = 3 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 㪠§ â¥«ì ­  ¡ãä¥à à §¬¥à®¬ edx ¡ ©â,
ªã¤  ¡ã¤¥â § ¯¨á ­  â ¡«¨æ 
* edx = à §¬¥à â ¡«¨æë 梥⮢
(¤®«¦¥­ ¡ëâì 40 ¡ ©â ¤«ï ¡ã¤ã饩 ᮢ¬¥á⨬®áâ¨)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
”®à¬ â â ¡«¨æë 梥⮢: ª ¦¤ë© í«¥¬¥­â -
dword-§­ ç¥­¨¥ æ¢¥â  0x00RRGGBB
* +0: dword: frames - 梥â à ¬ª¨
* +4: dword: grab - 梥⠧ £®«®¢ª 
* +8: dword: grab_button - 梥⠪­®¯ª¨ ­  ¯®«®á¥ § £®«®¢ª 
* +12 = +0xC: dword: grab_button_text - 梥â ⥪áâ  ­  ª­®¯ª¥
­  ¯®«®á¥ § £®«®¢ª 
* +16 = +0x10: dword: grab_text - 梥â ⥪áâ  ­  § £®«®¢ª¥
* +20 = +0x14: dword: work - 梥â à ¡®ç¥© ®¡« áâ¨
* +24 = +0x18: dword: work_button - 梥⠪­®¯ª¨ ¢ à ¡®ç¥© ®¡« áâ¨
* +28 = +0x1C: dword: work_button_text - 梥â ⥪áâ  ­  ª­®¯ª¥
¢ à ¡®ç¥© ®¡« áâ¨
* +32 = +0x20: dword: work_text - 梥â ⥪áâ  ¢ à ¡®ç¥© ®¡« áâ¨
* +36 = +0x24: dword: work_graph - 梥⠣à ä¨ª¨ ¢ à ¡®ç¥© ®¡« áâ¨
‡ ¬¥ç ­¨ï:
* ‘âàãªâãà  â ¡«¨æë 梥⮢ ®¯¨á ­  ¢ áâ ­¤ àâ­®¬ ¢ª«îç ¥¬®¬ ä ©«¥
macros.inc ¯®¤ ­ §¢ ­¨¥¬ system_colors; ­ ¯à¨¬¥à, ¬®¦­® ¯¨á âì:
sc system_colors ; ®¡ê¥­¨¥ ¯¥à¥¬¥­­®©
... ; £¤¥-â® ­ ¤® ¢ë§¢ âì
; ®¯¨á뢠¥¬ãî äã­ªæ¨î á ecx=sc
mov ecx, [sc.work_button_text] ; ç¨â ¥¬ 梥â ⥪áâ 
; ­  ª­®¯ª¥ ¢ à ¡®ç¥© ®¡« áâ¨
* ˆá¯®«ì§®¢ ­¨¥/­¥¨á¯®«ì§®¢ ­¨¥ íâ¨å 梥⮢ - ¤¥«® ¨áª«îç¨â¥«ì­®
á ¬®© ¯à®£à ¬¬ë. „«ï ¨á¯®«ì§®¢ ­¨ï ­ã¦­® ¯à®áâ® ¯à¨ ¢ë§®¢¥ ä㭪権
à¨á®¢ ­¨ï 㪠§ë¢ âì 梥â, ¢§ïâë© ¨§ í⮩ â ¡«¨æë.
* à¨ ¨§¬¥­¥­¨¨ â ¡«¨æë áâ ­¤ àâ­ëå 梥⮢ (¯®¤ä㭪樥© 2 á
¯®á«¥¤ãî騬 ¯à¨¬¥­¥­¨¥¬ ¨§¬¥­¥­¨© ¯®¤ä㭪樥© 0 ¨«¨
¯à¨ ãáâ ­®¢ª¥ ᪨­  ¯®¤ä㭪樥© 8) ¢á¥¬ ®ª­ ¬ ¯®áë« ¥âáï á®®¡é¥­¨¥
® ­¥®¡å®¤¨¬®á⨠¯¥à¥à¨á®¢ª¨ (ᮡë⨥ á ª®¤®¬ 1).
* ‘â ­¤ àâ­ë¥ æ¢¥â  ¬®¦­® ¯à®á¬ âਢ âì/¨§¬¥­ïâì ¨­â¥à ªâ¨¢­®
á ¯®¬®éìî ¯à¨«®¦¥­¨ï desktop.
 
======================================================================
========== ”ã­ªæ¨ï 48, ¯®¤äã­ªæ¨ï 4 - ¯®«ãç¨âì ¢ëá®âã ᪨­ . =========
======================================================================
 à ¬¥âàë:
* eax = 48 - ­®¬¥à ä㭪樨
* ebx = 4 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ¢ëá®â  ᪨­ 
‡ ¬¥ç ­¨ï:
* ‚ëá®â®© ᪨­  ¯® ®¯à¥¤¥«¥­¨î áç¨â ¥âáï ¢ëá®â  § £®«®¢ª  ®ª®­,
¨á¯®«ì§ãîé¨å ᪨­.
* ‘¬®âਠ⠪¦¥ ®¡éãî áâàãªâãàã ®ª­  ¢ ®¯¨á ­¨¨ ä㭪樨 0.
 
======================================================================
===== ”ã­ªæ¨ï 48, ¯®¤äã­ªæ¨ï 5 - ¯®«ãç¨âì à ¡®çãî ®¡« áâì íªà ­ . ====
======================================================================
 à ¬¥âàë:
* eax = 48 - ­®¬¥à ä㭪樨
* ebx = 5 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = [left]*65536 + [right]
* ebx = [top]*65536 + [bottom]
‡ ¬¥ç ­¨ï:
*  ¡®ç ï ®¡« áâì íªà ­  ®¯à¥¤¥«ï¥â ¯®«®¦¥­¨¥ ¨ ª®®à¤¨­ âë
¬ ªá¨¬¨§¨à®¢ ­­®£® ®ª­ .
*  ¡®ç ï ®¡« áâì íªà ­  ¯à¨ ­®à¬ «ì­®© à ¡®â¥ ¥áâì ¢¥áì íªà ­
§  ¢ëç¥â®¬ ¯ ­¥«¨ (@panel).
* (left,top) - ª®®à¤¨­ âë «¥¢®£® ¢¥àå­¥£® 㣫 ,
(right,bottom) - ª®®à¤¨­ âë ¯à ¢®£® ­¨¦­¥£®.
’ ª¨¬ ®¡à §®¬, à §¬¥à à ¡®ç¥© ®¡« á⨠¯® ®á¨ x ®¯à¥¤¥«ï¥âáï
ä®à¬ã«®© right-left+1, ¯® ®á¨ y - ä®à¬ã«®© bottom-right+1.
* ‘¬®âਠ⠪¦¥ äã­ªæ¨î 14,
¯®§¢®«ïîéãî ®¯à¥¤¥«¨âì à §¬¥àë ¢á¥£® íªà ­ .
* …áâì ¯ à­ ï äã­ªæ¨ï ãáâ ­®¢ª¨ à ¡®ç¥© ®¡« á⨠- ¯®¤äã­ªæ¨ï 6.
 
======================================================================
==== ”ã­ªæ¨ï 48, ¯®¤äã­ªæ¨ï 6 - ãáâ ­®¢¨âì à ¡®çãî ®¡« áâì íªà ­ . ===
======================================================================
 à ¬¥âàë:
* eax = 48 - ­®¬¥à ä㭪樨
* ebx = 6 - ­®¬¥à ¯®¤ä㭪樨
* ecx = [left]*65536 + [right]
* edx = [top]*65536 + [bottom]
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
*  ¡®ç ï ®¡« áâì íªà ­  ®¯à¥¤¥«ï¥â ¯®«®¦¥­¨¥ ¨ ª®®à¤¨­ âë
¬ ªá¨¬¨§¨à®¢ ­­®£® ®ª­ .
* â  äã­ªæ¨ï ¨á¯®«ì§ã¥âáï ⮫쪮 ¯à¨«®¦¥­¨¥¬ @panel,
ãáâ ­ ¢«¨¢ î騬 à ¡®ç¥© ®¡« áâìî ¢¥áì íªà ­ §  ¢ëç¥â®¬ ¯ ­¥«¨.
* (left,top) - ª®®à¤¨­ âë «¥¢®£® ¢¥àå­¥£® 㣫 ,
(right,bottom) - ª®®à¤¨­ âë ¯à ¢®£® ­¨¦­¥£®.
’ ª¨¬ ®¡à §®¬, à §¬¥à à ¡®ç¥© ®¡« á⨠¯® ®á¨ x ®¯à¥¤¥«ï¥âáï
ä®à¬ã«®© right-left+1, ¯® ®á¨ y - ä®à¬ã«®© bottom-right+1.
* …᫨ left>=right, â® x-ª®®à¤¨­ âë à ¡®ç¥© ®¡« á⨠­¥ ¨§¬¥­ïîâáï.
…᫨ left<0, â® left ­¥ ãáâ ­ ¢«¨¢ ¥âáï. …᫨ right ¡®«ìè¥
¨«¨ à ¢­® è¨à¨­ë íªà ­ , â® right ­¥ ãáâ ­ ¢«¨¢ ¥âáï.
€­ «®£¨ç­® ¯® ®á¨ y.
* ‘¬®âਠ⠪¦¥ äã­ªæ¨î 14,
¯®§¢®«ïîéãî ®¯à¥¤¥«¨âì à §¬¥àë ¢á¥£® íªà ­ .
* …áâì ¯ à­ ï äã­ªæ¨ï ¯®«ã祭¨ï à ¡®ç¥© ®¡« á⨠-
¯®¤äã­ªæ¨ï 5.
* â  äã­ªæ¨ï  ¢â®¬ â¨ç¥áª¨ ¯¥à¥à¨á®¢ë¢ ¥â íªà ­, ¯® 室㠤¥« 
®¡­®¢«ï¥â ª®®à¤¨­ âë ¨ à §¬¥àë ¬ ªá¨¬¨§¨à®¢ ­­ëå ®ª®­.
‚ᥠ®ª­  ¨§¢¥é îâáï ® ­¥®¡å®¤¨¬®á⨠¯¥à¥à¨á®¢ª¨ (ᮡë⨥ 1).
 
======================================================================
====================== ”ã­ªæ¨ï 48, ¯®¤äã­ªæ¨ï 7 ======================
============ ®«ãç¨âì ®¡« áâì ᪨­  ¤«ï ⥪áâ  § £®«®¢ª . ============
======================================================================
‚®§¢à é ¥â ®¡« áâì § £®«®¢ª  ®ª­  ᮠ᪨­®¬, ¯à¥¤­ §­ ç¥­­ãî
¤«ï ¢ë¢®¤  ⥪áâ  § £®«®¢ª .
 à ¬¥âàë:
* eax = 48 - ­®¬¥à ä㭪樨
* ebx = 7 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = [left]*65536 + [right]
* ebx = [top]*65536 + [bottom]
‡ ¬¥ç ­¨ï:
* ˆá¯®«ì§®¢ ­¨¥/­¥¨á¯®«ì§®¢ ­¨¥ í⮩ ä㭪樨 -
«¨ç­®¥ ¤¥«® ¯à¨«®¦¥­¨ï.
* ¥ª®¬¥­¤ã¥âáï ãç¨â뢠âì §­ ç¥­¨ï, ¢®§¢à é ¥¬ë¥ í⮩ ä㭪樥©,
¯à¨ ¢ë¡®à¥ ¬¥áâ  ¤«ï à¨á®¢ ­¨ï ⥪áâ  § £®«®¢ª  (ä㭪樥© 4) ¨«¨
ª ª®£®-­¨¡ã¤ì § ¬¥­¨â¥«ï ⥪áâ  § £®«®¢ª 
(¯® ãᬮâ७¨î ¯à¨«®¦¥­¨ï).
 
======================================================================
==== ”ã­ªæ¨ï 48, ¯®¤äã­ªæ¨ï 8 - ãáâ ­®¢¨âì ¨á¯®«ì§ã¥¬ë© ᪨­ ®ª®­. ===
======================================================================
 à ¬¥âàë:
* eax = 48 - ­®¬¥à ä㭪樨
* ebx = 8 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 㪠§ â¥«ì ­  ¡«®ª ¤«ï ä㭪樨 58, ¢ ª®â®à®¬ ãáâ ­®¢«¥­®
¯®«¥ ¯à®¬¥¦ãâ®ç­®£® ¡ãä¥à  ¨ 㪠§ ­® ¨¬ï ä ©« 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* ¨­ ç¥ eax = ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë; ¥á«¨ ä ©« ­¥ § ¤ ñâ ᪨­,
â® ¢®§¢à é ¥âáï ®è¨¡ª  3 (­¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬ ).
‡ ¬¥ç ­¨ï:
* à¨ ãᯥ譮© § £à㧪¥ ᪨­  ¢á¥ ®ª­  ¨§¢¥é îâáï ® ­¥®¡å®¤¨¬®áâ¨
¯¥à¥à¨á®¢ª¨ (ᮡë⨥ 1).
* à¨ § £à㧪¥ á¨á⥬  áç¨â뢠¥â ᪨­ ¨§ ä ©«  default.skn
­  à ¬¤¨áª¥.
* ®«ì§®¢ â¥«ì ¬®¦¥â ¨§¬¥­ïâì ᪨­ áâ â¨ç¥áª¨, ᮧ¤ ¢ ᢮©
default.skn, ¨«¨ ¤¨­ ¬¨ç¥áª¨ á ¯®¬®éìî ¯à¨«®¦¥­¨ï desktop.
 
======================================================================
============ ”ã­ªæ¨ï 49 - Advanced Power Management (APM). ===========
======================================================================
 à ¬¥âàë:
* eax = 49 - ­®¬¥à ä㭪樨
* dx = ­®¬¥à ä㭪樨 APM ( ­ «®£ ax ¢ ᯥæ¨ä¨ª æ¨¨)
* bx, cx = ¯ à ¬¥âàë ä㭪樨 APM
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* 16-¡¨â­ë¥ ॣ¨áâàë ax, bx, cx, dx, si, di ¨ ä« £ CF
ãáâ ­®¢«¥­ë ¢ ᮮ⢥âá⢨¨ ᮠᯥæ¨ä¨ª æ¨¥© APM
* áâ à訥 ¯®«®¢¨­ë 32-¡¨â­ëå ॣ¨áâ஢ eax, ebx, ecx,
edx, esi, edi à §àãè îâáï
‡ ¬¥ç ­¨ï:
* ‘¯¥æ¨ä¨ª æ¨ï APM 1.2 ®¯¨á뢠¥âáï ¢ ¤®ªã¬¥­â¥
"Advanced Power Management (APM) BIOS Specification"
(Revision 1.2), ¤®áâ㯭®¬ ­ 
http://www.microsoft.com/whdc/archive/amp_12.mspx;
ªà®¬¥ ⮣®, ®­  ¢ª«î祭  ¢ ¨§¢¥áâ­ë© Interrupt List by Ralf Brown
(http://www.pobox.com/~ralf/files.html,
ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
 
======================================================================
================= ”ã­ªæ¨ï 50 - ãáâ ­®¢ª  ä®à¬ë ®ª­ . =================
======================================================================
Ž¡ëç­ë¥ ®ª­  ¯à¥¤áâ ¢«ïîâ ᮡ®© ¯àאַ㣮«ì­¨ª¨. ‘ ¯®¬®éìî í⮩ ä㭪樨
®ª­ã ¬®¦­® ¯à¨¤ âì ¯à®¨§¢®«ì­ãî ä®à¬ã. ”®à¬  § ¤ ñâáï ­ ¡®à®¬ â®ç¥ª
¢­ãâਠ®¡à ¬«ïî饣® ¯àאַ㣮«ì­¨ª , ¯à¨­ ¤«¥¦ é¨å ®ª­ã. ®«®¦¥­¨¥ ¨
à §¬¥àë ®¡à ¬«ïî饣® ¯àאַ㣮«ì­¨ª  § ¤ îâáï ä㭪樥© 0 ¨ ¨§¬¥­ïîâáï
ä㭪樥© 67.
 
--------------- “áâ ­®¢ª  ¤ ­­ëå á ¨­ä®à¬ æ¨¥© ® ä®à¬¥ ---------------
 à ¬¥âàë:
* eax = 50 - ­®¬¥à ä㭪樨
* ebx = 0 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 㪠§ â¥«ì ­  ¤ ­­ë¥ ä®à¬ë (¬ áᨢ ¡ ©â 0/1)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
 
------------------ “áâ ­®¢ª  ¬ áèâ ¡  ¤ ­­ëå ä®à¬ë -------------------
 à ¬¥âàë:
* eax = 50 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
* ecx § ¤ ñâ ¬ áèâ ¡: ª ¦¤ë© ¡ ©â ¤ ­­ëå ®¯à¥¤¥«ï¥â
(2^scale)*(2^scale) ¯¨ªá¥«¥©
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* Œ áèâ ¡ ¯® 㬮«ç ­¨î à ¢¥­ 0 (¬ áèâ ¡¨àãî騩 ¬­®¦¨â¥«ì 1). …᫨ ¢
¤ ­­ëå ä®à¬ë ®¤¨­ ¡ ©â ᮮ⢥âáâ¢ã¥â ®¤­®¬ã ¯¨ªá¥«î, â® ¬ áèâ ¡
¬®¦­® ­¥ ãáâ ­ ¢«¨¢ âì.
* Ž¡®§­ ç¨¬ xsize = è¨à¨­  ®ª­  (¢ ¯¨ªá¥«ïå), ysize = ¢ëá®â ;
®¡à â¨â¥ ¢­¨¬ ­¨¥, çâ® ®­¨ ­  ¥¤¨­¨æã ¡®«ìè¥, 祬 ãáâ ­ ¢«¨¢ ¥¬ë¥
äã­ªæ¨ï¬¨ 0, 67.
* ® ®¯à¥¤¥«¥­¨î ¬ áèâ ¡  xsize ¨ ysize ¤®«¦­ë ¤¥«¨âìáï ­  2^scale.
*  ©â ¤ ­­ëå ¯® ᬥ饭¨î a ¤®«¦¥­ ¡ëâì 0/1 ¨
®¯à¥¤¥«ï¥â ¯à¨­ ¤«¥¦­®áâì ®ª­ã ª¢ ¤à â  á® áâ®à®­®© 2^scale
(¯à¨ scale=0 ¯®«ãç ¥¬ ¯¨ªá¥«ì) ¨ ª®®à¤¨­ â ¬¨ «¥¢®£® ¢¥àå­¥£® 㣫 
(a mod (xsize shr scale), a div (xsize shr scale))
*  §¬¥à ¤ ­­ëå: (xsize shr scale)*(ysize shr scale).
* „ ­­ë¥ ¤®«¦­ë ¯à¨áãâá⢮¢ âì ¢ ¯ ¬ï⨠¨ ­¥ ¬¥­ïâìáï
¯®á«¥ ãáâ ­®¢ª¨ ä®à¬ë.
* ‘¨á⥬  ¯à®á¬ âਢ ¥â ¤ ­­ë¥ ® ä®à¬¥ ¯à¨ ª ¦¤®© ¯¥à¥à¨á®¢ª¥ ®ª­ 
ä㭪樥© 0.
* ‚맮¢ ¯®¤ä㭪樨 0 á ­ã«¥¢ë¬ 㪠§ â¥«¥¬ ¯à¨¢®¤¨â ª ¢®§¢à âã
ª ¯àאַ㣮«ì­®© ä®à¬¥.
 
======================================================================
===================== ”ã­ªæ¨ï 51 - ᮧ¤ âì ¯®â®ª. ====================
======================================================================
 à ¬¥âàë:
* eax = 51 - ­®¬¥à ä㭪樨
* ebx = 1 - ¥¤¨­á⢥­­ ï ¯®¤äã­ªæ¨ï
* ecx =  ¤à¥á â®çª¨ ¢å®¤  ¯®â®ª  (­ ç «ì­ë© eip)
* edx = 㪠§ â¥«ì áâíª  ¯®â®ª  (­ ç «ì­ë© esp)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ®è¨¡ª  (¢ á¨á⥬¥ ᫨誮¬ ¬­®£® ¯®â®ª®¢)
* ¨­ ç¥ eax = TID - ¨¤¥­â¨ä¨ª â®à ¯®â®ª 
 
======================================================================
= ”ã­ªæ¨ï 52, ¯®¤äã­ªæ¨ï 0 - ¯®«ãç¨âì ª®­ä¨£ãà æ¨î á¥â¥¢®£® ¤à ©¢¥à .
======================================================================
 à ¬¥âàë:
* eax = 52 - ­®¬¥à ä㭪樨
* ebx = 0 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ¤¢®©­®¥ á«®¢® ª®­ä¨£ãà æ¨¨
‡ ¬¥ç ­¨ï:
* ‘«®¢® ª®­ä¨£ãà æ¨¨ ¬®¦­® ãáâ ­®¢¨âì ¯®¤ä㭪樥© 2.
* Ÿ¤à® ­¥ ¨á¯®«ì§ã¥â ᮮ⢥âáâ¢ãîéãî ¯¥à¥¬¥­­ãî.
–¥­­®áâì í⮩ ¯¥à¥¬¥­­®© ¨ à ¡®â îé¨å á ­¥© ¯®¤ä㭪権 0 ¨ 2
¯à¥¤áâ ¢«ï¥âáï ᮬ­¨â¥«ì­®©.
 
======================================================================
======= ”ã­ªæ¨ï 52, ¯®¤äã­ªæ¨ï 1 - ¯®«ãç¨âì «®ª «ì­ë© IP- ¤à¥á. ======
======================================================================
 à ¬¥âàë:
* eax = 52 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = IP- ¤à¥á (4 ¡ ©â )
‡ ¬¥ç ­¨ï:
* ‹®ª «ì­ë© IP- ¤à¥á ãáâ ­ ¢«¨¢ ¥âáï ¯®¤ä㭪樥© 3.
 
======================================================================
”ã­ªæ¨ï 52, ¯®¤äã­ªæ¨ï 2 - ãáâ ­®¢¨âì ª®­ä¨£ãà æ¨î á¥â¥¢®£® ¤à ©¢¥à .
======================================================================
 à ¬¥âàë:
* eax = 52 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¤¢®©­®¥ á«®¢® ª®­ä¨£ãà æ¨¨; ¥á«¨ ¬« ¤è¨¥ 7 ¡¨â ®¡à §ãîâ
ç¨á«® 3, íâ® ¢®á¯à¨­¨¬ ¥âáï ª ª § ¯à®á ­  [¯¥à¥-]¨­¨æ¨ «¨§ æ¨î
Ethernet-ª àâë, ¢ ¯à®â¨¢­®¬ á«ãç ¥ Ethernet ¢ëª«îç ¥âáï
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ¥á«¨ ­¥ § ¯à®è¥­ Ethernet-¨­â¥à䥩á, â® ¢®§¢à é ¥âáï eax=2,
­® íâ® ¬®¦¥â ¨§¬¥­¨âìáï ¢ ¡ã¤ãé¨å ¢¥àá¨ïå ï¤à 
* ¥á«¨ § ¯à®è¥­ Ethernet-¨­â¥à䥩á, â® eax=0 ®§­ ç ¥â ®è¨¡ªã
(®âáãâá⢨¥ Ethernet-ª àâë),   ­¥­ã«¥¢®¥ §­ ç¥­¨¥ - ãᯥå
‡ ¬¥ç ­¨ï:
* ‘«®¢® ª®­ä¨£ãà æ¨¨ ¬®¦­® ¯à®ç¨â âì ¯®¤ä㭪樥© 0.
* Ÿ¤à® ­¥ ¨á¯®«ì§ã¥â ᮮ⢥âáâ¢ãîéãî ¯¥à¥¬¥­­ãî.
–¥­­®áâì í⮩ ¯¥à¥¬¥­­®©, ¯®¤ä㭪樨 0 ¨ ç á⨠¯®¤ä㭪樨 2,
ãáâ ­ ¢«¨¢ î饩 íâã ¯¥à¥¬¥­­ãî, ¯à¥¤áâ ¢«ï¥âáï ᮬ­¨â¥«ì­®©.
 
======================================================================
====== ”ã­ªæ¨ï 52, ¯®¤äã­ªæ¨ï 3 - ãáâ ­®¢¨âì «®ª «ì­ë© IP- ¤à¥á. =====
======================================================================
 à ¬¥âàë:
* eax = 52 - ­®¬¥à ä㭪樨
* ebx = 3 - ­®¬¥à ¯®¤ä㭪樨
* ecx = IP- ¤à¥á (4 ¡ ©â )
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ⥪ãé ï ॠ«¨§ æ¨ï ¢®§¢à é ¥â eax=3, ­® íâ® ¬®¦¥â ¡ëâì ¨§¬¥­¥­®
¢ ¡ã¤ãé¨å ¢¥àá¨ïå
‡ ¬¥ç ­¨ï:
* ‹®ª «ì­ë© IP- ¤à¥á ¬®¦­® ¯®«ãç¨âì ¯®¤ä㭪樥© 1.
 
======================================================================
= ”ã­ªæ¨ï 52, ¯®¤äã­ªæ¨ï 6 - ¤®¡ ¢¨âì ¤ ­­ë¥ ¢ á⥪ ¢å®¤­®© ®ç¥à¥¤¨. =
======================================================================
 à ¬¥âàë:
* eax = 52 - ­®¬¥à ä㭪樨
* ebx = 6 - ­®¬¥à ¯®¤ä㭪樨
* edx = à §¬¥à ¤ ­­ëå
* esi = 㪠§ â¥«ì ­  ¤ ­­ë¥
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ®è¨¡ª 
* eax = 0 - ãᯥ譮
‡ ¬¥ç ­¨ï:
* â  äã­ªæ¨ï ¯à¥¤­ §­ ç¥­  ⮫쪮 ¤«ï ¬¥¤«¥­­ëå á¥â¥¢ëå ¤à ©¢¥à®¢
(PPP, SLIP).
*  §¬¥à ¤ ­­ëå ­¥ ¤®«¦¥­ ¯à¥¢®á室¨âì 1500 ¡ ©â,
å®âï ¯à®¢¥à®ª ª®à४⭮á⨠­¥ ¤¥« ¥âáï.
 
======================================================================
====================== ”ã­ªæ¨ï 52, ¯®¤äã­ªæ¨ï 8 ======================
============= à®ç¨â âì ¤ ­­ë¥ ¨§ á¥â¥¢®© ®ç¥à¥¤¨ ¢ë¢®¤ . ============
======================================================================
 à ¬¥âàë:
* eax = 52 - ­®¬¥à ä㭪樨
* ebx = 8 - ­®¬¥à ¯®¤ä㭪樨
* esi = 㪠§ â¥«ì ­  ¡ãä¥à à §¬¥à®¬ 1500 ¡ ©â
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ç¨á«® ¯à®ç¨â ­­ëå ¡ ©â (¢ ⥪ã饩 ॠ«¨§ æ¨¨
«¨¡® 0 = ­¥â ¤ ­­ëå, «¨¡® 1500)
* ¤ ­­ë¥ ᪮¯¨à®¢ ­ë ¢ ¡ãä¥à
‡ ¬¥ç ­¨ï:
* â  äã­ªæ¨ï ¯à¥¤­ §­ ç¥­  ⮫쪮 ¤«ï ¬¥¤«¥­­ëå á¥â¥¢ëå ¤à ©¢¥à®¢
(PPP, SLIP).
 
======================================================================
=========== ”ã­ªæ¨ï 52, ¯®¤äã­ªæ¨ï 9 - ¯®«ãç¨âì gateway IP. ==========
======================================================================
 à ¬¥âàë:
* eax = 52 - ­®¬¥à ä㭪樨
* ebx = 9 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = gateway IP (4 ¡ ©â )
 
======================================================================
========= ”ã­ªæ¨ï 52, ¯®¤äã­ªæ¨ï 10 - ¯®«ãç¨âì ¬ áªã ¯®¤á¥â¨. ========
======================================================================
 à ¬¥âàë:
* eax = 52 - ­®¬¥à ä㭪樨
* ebx = 10 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ¬ áª  ¯®¤á¥â¨
 
======================================================================
========= ”ã­ªæ¨ï 52, ¯®¤äã­ªæ¨ï 11 - ãáâ ­®¢¨âì gateway IP. =========
======================================================================
 à ¬¥âàë:
* eax = 52 - ­®¬¥à ä㭪樨
* ebx = 11 - ­®¬¥à ¯®¤ä㭪樨
* ecx = gateway IP (4 ¡ ©â )
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ⥪ãé ï ॠ«¨§ æ¨ï ¢®§¢à é ¥â eax=11, ­® íâ® ¬®¦¥â ¡ëâì ¨§¬¥­¥­®
¢ ¡ã¤ãé¨å ॠ«¨§ æ¨ïå
 
======================================================================
======== ”ã­ªæ¨ï 52, ¯®¤äã­ªæ¨ï 12 - ãáâ ­®¢¨âì ¬ áªã ¯®¤á¥â¨. =======
======================================================================
 à ¬¥âàë:
* eax = 52 - ­®¬¥à ä㭪樨
* ebx = 12 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¬ áª  ¯®¤á¥â¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ⥪ãé ï ॠ«¨§ æ¨ï ¢®§¢à é ¥â eax=12, ­® íâ® ¬®¦¥â ¡ëâì ¨§¬¥­¥­®
¢ ¡ã¤ãé¨å ¢¥àá¨ïå
 
======================================================================
============ ”ã­ªæ¨ï 52, ¯®¤äã­ªæ¨ï 13 - ¯®«ãç¨âì DNS IP. ============
======================================================================
 à ¬¥âàë:
* eax = 52 - ­®¬¥à ä㭪樨
* ebx = 13 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = DNS IP (4 ¡ ©â )
 
======================================================================
=========== ”ã­ªæ¨ï 52, ¯®¤äã­ªæ¨ï 14 - ãáâ ­®¢¨âì DNS IP. ===========
======================================================================
 à ¬¥âàë:
* eax = 52 - ­®¬¥à ä㭪樨
* ebx = 14 - ­®¬¥à ¯®¤ä㭪樨
* ecx = DNS IP (4 ¡ ©â )
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ⥪ãé ï ॠ«¨§ æ¨ï ¢®§¢à é ¥â eax=14, ­® íâ® ¬®¦¥â ¡ëâì ¨§¬¥­¥­®
¢ á«¥¤ãîé¨å ¢¥àá¨ïå
 
======================================================================
============ ”ã­ªæ¨ï 53, ¯®¤äã­ªæ¨ï 0 - ®âªàëâì UDP-᮪¥â. ===========
======================================================================
 à ¬¥âàë:
* eax = 53 - ­®¬¥à ä㭪樨
* ebx = 0 - ­®¬¥à ¯®¤ä㭪樨
* ecx = «®ª «ì­ë© ¯®àâ (ãç¨â뢠¥âáï ⮫쪮 ¬« ¤è¥¥ á«®¢®)
* edx = 㤠«ñ­­ë© ¯®àâ (ãç¨â뢠¥âáï ⮫쪮 ¬« ¤è¥¥ á«®¢®)
* esi = 㤠«ñ­­ë© IP
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 = 0xFFFFFFFF - ®è¨¡ª ; ebx à §àãè ¥âáï
* eax = åí­¤« ᮪¥â  (­¥ª®â®à®¥ ç¨á«®, ®¤­®§­ ç­® ¨¤¥­â¨ä¨æ¨àãî饥
᮪¥â ¨ ¨¬¥î饥 á¬ë᫠⮫쪮 ¤«ï á¨á⥬ë) - ãᯥ譮;
ebx à §àãè ¥âáï
 
======================================================================
============ ”ã­ªæ¨ï 53, ¯®¤äã­ªæ¨ï 1 - § ªàëâì UDP-᮪¥â. ===========
======================================================================
 à ¬¥âàë:
* eax = 53 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
* ecx = åí­¤« ᮪¥â 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ­¥¢¥à­ë© åí­¤«
* eax = 0 - ãᯥ譮
* ebx à §àãè ¥âáï
‡ ¬¥ç ­¨ï:
* ’¥ªãé ï ॠ«¨§ æ¨ï ­¥ § ªà뢠¥â  ¢â®¬ â¨ç¥áª¨ ¢á¥ ᮪¥âë ¯®â®ª 
¯à¨ ¥£® § ¢¥à襭¨¨. ‚ ç áâ­®áâ¨, ­¥ á«¥¤ã¥â ¯à¨¡¨¢ âì ¯®â®ª
á ªã祩 ®âªàëâëå ᮪¥â®¢ - ¡ã¤¥â ãâ¥çª  à¥áãàᮢ.
* ’¥ªãé ï ॠ«¨§ æ¨ï ­¥ ¤¥« ¥â ¯à®¢¥à®ª ­  ª®à४⭮áâì
(¥¤¨­á⢥­­®¥, ­  çâ® ¢®§¢à é ¥âáï ®è¨¡ª , - ¯®¯ë⪠ § ªàëâì
­¥®âªàëâë© á®ª¥â á ª®à४â­ë¬ åí­¤«®¬).
 
======================================================================
============== ”ã­ªæ¨ï 53, ¯®¤äã­ªæ¨ï 2 - ®¯à®á ᮪¥â . ==============
======================================================================
 à ¬¥âàë:
* eax = 53 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = åí­¤« ᮪¥â 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ç¨á«® ¯®«ã祭­ëå ¡ ©â
* ebx à §àãè ¥âáï
‡ ¬¥ç ­¨ï:
* à®¢¥àª¨ ª®à४⭮á⨠­¥ ¤¥« ¥âáï.
 
======================================================================
======== ”ã­ªæ¨ï 53, ¯®¤äã­ªæ¨ï 3 - ¯à®ç¨â âì ¡ ©â ¨§ ᮪¥â . ========
======================================================================
 à ¬¥âàë:
* eax = 53 - ­®¬¥à ä㭪樨
* ebx = 3 - ­®¬¥à ¯®¤ä㭪樨
* ecx = åí­¤« ᮪¥â 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ¥á«¨ ­¥â ¯à¨­ïâëå ¤ ­­ëå: eax=0, bl=0,
¯à®ç¨¥ ¡ ©âë ebx à §àãè îâáï
* ¥á«¨ ¡ë«¨ ¯à¨­ïâë¥ ¤ ­­ë¥: eax=ç¨á«® ®áâ ¢è¨åáï ¡ ©â
(¢®§¬®¦­®, 0), bl=¯à®ç¨â ­­ë© ¡ ©â, ¯à®ç¨¥ ¡ ©âë ebx à §àãè îâáï
‡ ¬¥ç ­¨ï:
* à®¢¥àª¨ ª®à४⭮á⨠­¥ ¯à®¨§¢®¤¨âáï.
 
======================================================================
========== ”ã­ªæ¨ï 53, ¯®¤äã­ªæ¨ï 4 - § ¯¨á âì ¢ UDP-᮪¥â. ==========
======================================================================
 à ¬¥âàë:
* eax = 53 - ­®¬¥à ä㭪樨
* ebx = 4 - ­®¬¥à ¯®¤ä㭪樨
* ecx = åí­¤« ᮪¥â 
* edx = ç¨á«® ¡ ©â ¤«ï § ¯¨á¨
* esi = 㪠§ â¥«ì ­  ¤ ­­ë¥ ¤«ï § ¯¨á¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0xffffffff - ­¥¢¥à­ë© åí­¤«
* eax = 0xffff - ­¥¤®áâ â®ç­® ¯ ¬ïâ¨
* eax = 0 - ãᯥ譮
* ebx à §àãè ¥âáï
‡ ¬¥ç ­¨ï:
* à®¢¥àª  ­  ¯à ¢¨«ì­®áâì åí­¤«  ¬¨­¨¬ «ì­  - ¨áª«îç îâáï ⮫쪮
­¥ ®ç¥­ì ­¥¯à ¢¨«ì­ë¥ ­¥®âªàëâë¥ åí­¤«ë.
* —¨á«® ¡ ©â ¤«ï § ¯¨á¨ ­¥ ¬®¦¥â ¯à¥¢ëè âì 1500-28, å®âï
ᮮ⢥âáâ¢ãî饩 ¯à®¢¥àª¨ ­¥ ¤¥« ¥âáï.
 
======================================================================
============ ”ã­ªæ¨ï 53, ¯®¤äã­ªæ¨ï 5 - ®âªàëâì TCP-᮪¥â. ===========
======================================================================
 à ¬¥âàë:
* eax = 53 - ­®¬¥à ä㭪樨
* ebx = 5 - ­®¬¥à ¯®¤ä㭪樨
* ecx = «®ª «ì­ë© ¯®àâ (ãç¨â뢠¥âáï ⮫쪮 ¬« ¤è¥¥ á«®¢®)
* edx = 㤠«ñ­­ë© ¯®àâ (ãç¨â뢠¥âáï ⮫쪮 ¬« ¤è¥¥ á«®¢®)
* esi = 㤠«ñ­­ë© IP
* edi = ०¨¬ ®âªàëâ¨ï: SOCKET_PASSIVE=0 ¨«¨ SOCKET_ACTIVE=1
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 = 0xFFFFFFFF - ®è¨¡ª ; ebx à §àãè ¥âáï
* eax = åí­¤« ᮪¥â  (­¥ª®â®à®¥ ç¨á«®, ®¤­®§­ ç­® ¨¤¥­â¨ä¨æ¨àãî饥
᮪¥â ¨ ¨¬¥î饥 á¬ë᫠⮫쪮 ¤«ï á¨á⥬ë) - ãᯥ譮;
ebx à §àãè ¥âáï
 
======================================================================
====== ”ã­ªæ¨ï 53, ¯®¤äã­ªæ¨ï 6 - ¯®«ãç¨âì á®áâ®ï­¨¥ TCP-᮪¥â . =====
======================================================================
 à ¬¥âàë:
* eax = 53 - ­®¬¥à ä㭪樨
* ebx = 6 - ­®¬¥à ¯®¤ä㭪樨
* ecx = åí­¤« ᮪¥â 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = áâ âãá ᮪¥â : ®¤­® ¨§
* TCB_LISTEN = 1
* TCB_SYN_SENT = 2
* TCB_SYN_RECEIVED = 3
* TCB_ESTABLISHED = 4
* TCB_FIN_WAIT_1 = 5
* TCB_FIN_WAIT_2 = 6
* TCB_CLOSE_WAIT = 7
* TCB_CLOSING = 8
* TCB_LAST_ASK = 9
* TCB_TIME_WAIT = 10
* TCB_CLOSED = 11
* ebx à §àãè ¥âáï
‡ ¬¥ç ­¨ï:
* à®¢¥à®ª ª®à४⭮á⨠­¥ ¯à®¨§¢®¤¨âáï.
 
======================================================================
========== ”ã­ªæ¨ï 53, ¯®¤äã­ªæ¨ï 7 - § ¯¨á âì ¢ TCP-᮪¥â. ==========
======================================================================
 à ¬¥âàë:
* eax = 53 - ­®¬¥à ä㭪樨
* ebx = 7 - ­®¬¥à ¯®¤ä㭪樨
* ecx = åí­¤« ᮪¥â 
* edx = ç¨á«® ¡ ©â ¤«ï § ¯¨á¨
* esi = 㪠§ â¥«ì ­  ¤ ­­ë¥ ¤«ï § ¯¨á¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0xffffffff - ®è¨¡ª 
* eax = 0xffff - ­¥¤®áâ â®ç­® ¯ ¬ïâ¨
* eax = 0 - ãᯥ譮
* ebx à §àãè ¥âáï
‡ ¬¥ç ­¨ï:
* à®¢¥àª  ­  ¯à ¢¨«ì­®áâì åí­¤«  ¬¨­¨¬ «ì­  - ¨áª«îç îâáï ⮫쪮
­¥ ®ç¥­ì ­¥¯à ¢¨«ì­ë¥ ­¥®âªàëâë¥ åí­¤«ë.
* —¨á«® ¡ ©â ¤«ï § ¯¨á¨ ­¥ ¬®¦¥â ¯à¥¢ëè âì 1500-40,
å®âï ᮮ⢥âáâ¢ãî饩 ¯à®¢¥àª¨ ­¥ ¤¥« ¥âáï.
 
======================================================================
============ ”ã­ªæ¨ï 53, ¯®¤äã­ªæ¨ï 8 - § ªàëâì TCP-᮪¥â. ===========
======================================================================
 à ¬¥âàë:
* eax = 53 - ­®¬¥à ä㭪樨
* ebx = 8 - ­®¬¥à ¯®¤ä㭪樨
* ecx = åí­¤« ᮪¥â 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ­¥¢¥à­ë© åí­¤«
* eax = 0xffff - ­¥¤®áâ â®ç­® ¯ ¬ï⨠¤«ï ¯ ª¥â  § ªàëâ¨ï ᮪¥â 
* eax = 0 - ãᯥ譮
* ¢® ¬­®£¨å á«ãç ïå eax à §àãè ¥âáï (¢®§¢à é ¥âáï १ã«ìâ â ä㭪樨
queue) - ¢¨¤¨¬®, íâ® ¡ £, ª®â®àë© ¡ã¤¥â ¨á¯à ¢«¥­
* ebx à §àãè ¥âáï
‡ ¬¥ç ­¨ï:
* ’¥ªãé ï ॠ«¨§ æ¨ï ­¥ § ªà뢠¥â  ¢â®¬ â¨ç¥áª¨ ¢á¥ ᮪¥âë ¯®â®ª 
¯à¨ ¥£® § ¢¥à襭¨¨. ‚ ç áâ­®áâ¨, ­¥ á«¥¤ã¥â ¯à¨¡¨¢ âì ¯®â®ª
á ªã祩 ®âªàëâëå ᮪¥â®¢ - ¡ã¤¥â ãâ¥çª  à¥áãàᮢ.
* ’¥ªãé ï ॠ«¨§ æ¨ï ­¥ ¤¥« ¥â ¯à®¢¥à®ª ­  ª®à४⭮áâì
(¥¤¨­á⢥­­®¥, ­  çâ® ¢®§¢à é ¥âáï ®è¨¡ª , - ¯®¯ë⪠ § ªàëâì
­¥®âªàëâë© á®ª¥â á ª®à४â­ë¬ åí­¤«®¬).
 
======================================================================
== ”ã­ªæ¨ï 53, ¯®¤äã­ªæ¨ï 9 - ¯à®¢¥à¨âì, ᢮¡®¤¥­ «¨ «®ª «ì­ë© ¯®àâ. =
======================================================================
 à ¬¥âàë:
* eax = 53 - ­®¬¥à ä㭪樨
* ebx = 9 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ­®¬¥à «®ª «ì­®£® ¯®àâ  (¨á¯®«ì§ãîâáï ⮫쪮 ¬« ¤è¨¥ 16 ¡¨â)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ¯®à⠨ᯮ«ì§ã¥âáï
* eax = 1 - ¯®àâ ᢮¡®¤¥­
* ebx à §àãè ¥âáï
 
======================================================================
”ã­ªæ¨ï 53, ¯®¤äã­ªæ¨ï 255 - ®â« ¤®ç­ ï ¨­ä®à¬ æ¨ï á¥â¥¢®£® ¤à ©¢¥à .
======================================================================
 à ¬¥âàë:
* eax = 53 - ­®¬¥à ä㭪樨
* ebx = 255 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ⨯ § ¯à è¨¢ ¥¬®© ¨­ä®à¬ æ¨¨ (ᬮâਠ­¨¦¥)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = § ¯à®è¥­­ ï ¨­ä®à¬ æ¨ï
* ebx à §àãè ¥âáï
‚®§¬®¦­ë¥ §­ ç¥­¨ï ecx:
* 100: ¤«¨­  ®ç¥à¥¤¨ 0 (empty queue)
* 101: ¤«¨­  ®ç¥à¥¤¨ 1 (ip-out queue)
* 102: ¤«¨­  ®ç¥à¥¤¨ 2 (ip-in queue)
* 103: ¤«¨­  ®ç¥à¥¤¨ 3 (net1out queue)
* 200: ç¨á«® í«¥¬¥­â®¢ ¢ â ¡«¨æ¥ ARP
* 201: à §¬¥à â ¡«¨æë ARP (¢ í«¥¬¥­â å) (20 ¢ ⥪ã饩 ¢¥àᨨ)
* 202: ¯à®ç¨â âì í«¥¬¥­â edx â ¡«¨æë ARP ¢® ¢à¥¬¥­­ë© ¡ãä¥à, ®âªã¤ 
¡¥àãâ ¨­ä®à¬ æ¨î 5 ¯®á«¥¤ãîé¨å ⨯®¢;
¢ í⮬ á«ãç ¥ eax ­¥®¯à¥¤¥«ñ­
* 203: IP- ¤à¥á, § ¯®¬­¥­­ë© ⨯®¬ 202
* 204: áâ à襥 dword MAC- ¤à¥á , § ¯®¬­¥­­®£® ⨯®¬ 202
* 205: ¬« ¤è¥¥ word MAC- ¤à¥á , § ¯®¬­¥­­®£® ⨯®¬ 202
* 206: á«®¢® áâ âãá , § ¯®¬­¥­­®¥ ⨯®¬ 202
* 207: á«®¢® ttl, § ¯®¬­¥­­®¥ ⨯®¬ 202
* 2: ®¡é¥¥ ç¨á«® ¯®«ã祭­ëå IP-¯ ª¥â®¢
* 3: ®¡é¥¥ ç¨á«® ¯¥à¥¤ ­­ëå IP-¯ ª¥â®¢
* 4: ®¡é¥¥ ç¨á«® ᤠ¬¯«¥­­ëå ¯®«ã祭­ëå ¯ ª¥â®¢
* 5: ®¡é¥¥ ç¨á«® ¯®«ã祭­ëå ARP-¯ ª¥â®¢
* 6: áâ âãá ¤à ©¢¥à  ¯ ª¥â®¢, 0=­¥ ªâ¨¢¥­,
­¥­ã«¥¢®¥ §­ ç¥­¨¥= ªâ¨¢¥­
 
======================================================================
======== ”ã­ªæ¨ï 55, ¯®¤äã­ªæ¨ï 0 - § £à㧨âì ¤ ­­ë¥ ¤«ï SB16. =======
======================================================================
 à ¬¥âàë:
* eax = 55 - ­®¬¥à ä㭪樨
* ebx = 0 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 㪠§ â¥«ì ­  ¤ ­­ë¥ (ª®¯¨àã¥âáï 64 ª¨«®¡ ©â , ¨á¯®«ì§ã¥âáï
á⮫쪮, ᪮«ìª® ãáâ ­®¢«¥­® ¯®¤ä㭪樥© 2)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ”®à¬ â ¨ à §¬¥à ¤ ­­ëå ãáâ ­ ¢«¨¢ îâáï ¯®¤ä㭪樥© 2.
 
======================================================================
==== ”ã­ªæ¨ï 55, ¯®¤äã­ªæ¨ï 1 - ­ ç âì ¯à®¨£à뢠âì ¤ ­­ë¥ ­  SB16. ===
======================================================================
 à ¬¥âàë:
* eax = 55 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ¤ ­­ë¥ ¤®«¦­ë ¡ëâì § £à㦥­ë ¯®¤ä㭪樥© 0 ¨
®¯à¥¤¥«ñ­ ¨å ä®à¬ â ¯®¤ä㭪樥© 2.
* ”ã­ªæ¨ï ¢®§¢à é ¥â ã¯à ¢«¥­¨¥, ª®£¤  ­ ç «®áì ¯à®¨£à뢠­¨¥ ¤ ­­ëå;
¯®á«¥ í⮣® ¯à®¨£à뢠­¨¥ ¨¤ñâ ­¥§ ¢¨á¨¬® ®â ¯à¨«®¦¥­¨ï (¨ ¢®®¡é¥
­¥ âॡã¥â § £à㧪¨ ¯à®æ¥áá®à ).
* à¥¤¢ à¨â¥«ì­® ¤®«¦­ë ¡ëâì ®¯à¥¤¥«¥­ë ¡ §®¢ë© ¯®àâ SB16
(¯®¤ä㭪樥© 4 ä㭪樨 21) ¨ ª ­ « DMA
(¯®¤ä㭪樥© 10 ä㭪樨 21).
 
======================================================================
====== ”ã­ªæ¨ï 55, ¯®¤äã­ªæ¨ï 2 - ãáâ ­®¢¨âì ä®à¬ â ¤ ­­ëå SB16. =====
======================================================================
 à ¬¥âàë:
* eax = 55 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 0 - ãáâ ­®¢¨âì à §à來®áâì
* edx = 1 - 8¡¨â ¬®­®
* edx = 2 - 8¡¨â áâ¥à¥®
* ecx = 1 - ãáâ ­®¢¨âì à §¬¥à ¤ ­­ëå
* edx = à §¬¥à ¢ ¡ ©â å
* ecx = 2 - ãáâ ­®¢¨âì ç áâ®â㠯ந£à뢠­¨ï
* edx = ç áâ®â 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* à¨ § £à㧪¥ á¨á⥬ë ãáâ ­ ¢«¨¢ îâáï á«¥¤ãî騥 ¯ à ¬¥âàë
¯® 㬮«ç ­¨î: à §à來®áâì - 8 ¡¨â ¬®­®, à §¬¥à - 64 Š¡,
ç áâ®â  44100 ƒæ. ’¥¬ ­¥ ¬¥­¥¥ ४®¬¥­¤ã¥âáï ® ãáâ ­ ¢«¨¢ âì
­¥®¡å®¤¨¬ë¥ §­ ç¥­¨ï, ¯®áª®«ìªã ®­¨ ¬®£«¨ ¡ëâì ¯¥à¥ãáâ ­®¢«¥­ë
ª ª®©-­¨¡ã¤ì ¯à®£à ¬¬®©.
 
======================================================================
====================== ”ã­ªæ¨ï 55, ¯®¤äã­ªæ¨ï 55 =====================
==========  ç âì ¯à®¨£à뢠âì ¤ ­­ë¥ ­  ¢áâ஥­­®¬ ᯨª¥à¥. ==========
======================================================================
 à ¬¥âàë:
* eax = 55 - ­®¬¥à ä㭪樨
* ebx = 55 - ­®¬¥à ¯®¤ä㭪樨
* esi = 㪠§ â¥«ì ­  ¤ ­­ë¥
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 55 - ®è¨¡ª  (ᯨª¥à ®âª«îçñ­ ¨«¨ § ­ïâ)
„ ­­ë¥ - íâ® ¬ áᨢ í«¥¬¥­â®¢ ¯¥à¥¬¥­­®© ¤«¨­ë.
”®à¬ â ª ¦¤®£® í«¥¬¥­â  ®¯à¥¤¥«ï¥âáï ¯¥à¢ë¬ ¡ ©â®¬:
* 0 = ª®­¥æ ¤ ­­ëå
* 1..0x80 = § ¤ ñâ ¤«¨â¥«ì­®áâì §¢ãç ­¨ï ¢ á®âëå ¤®«ïå ᥪ㭤ë
­®âë, ®¯à¥¤¥«ï¥¬®© ­¥¯®á।á⢥­­ë¬ §­ ç¥­¨¥¬ ç áâ®âë
* á«¥¤ãî饥 á«®¢® (2 ¡ ©â ) ᮤ¥à¦¨â ¤¥«¨â¥«ì ç áâ®âë;
ç áâ®â  ®¯à¥¤¥«ï¥âáï ª ª 1193180/divider
* 0x81 = invalid
* 0x82..0xFF = ­®â , ®¯à¥¤¥«ï¥¬ ï ®ªâ ¢®© ¨ ­®¬¥à®¬:
* ¤«¨â¥«ì­®áâì ¢ á®âëå ¤®«ïå ᥪ㭤ë = (¯¥à¢ë© ¡ ©â)-0x81
* ¯à¨áãâáâ¢ã¥â ¥éñ ®¤¨­ ¡ ©â;
* (¢â®à®© ¡ ©â)=0xFF - ¯ ã§ 
* ¨­ ç¥ ®­ ¨¬¥¥â ¢¨¤ a*0x10+b, £¤¥ b=­®¬¥à ­®âë ¢ ®ªâ ¢¥ ®â 1
¤® 12, a=­®¬¥à ®ªâ ¢ë (áç¨â ï á 0)
‡ ¬¥ç ­¨ï:
* ¨é ­¨¥ ᯨª¥à®¬ ¬®¦¥â ¡ëâì § ¯à¥é¥­®/à §à¥è¥­® ¯®¤ä㭪樥© 8
ä㭪樨 18.
* ”ã­ªæ¨ï ¢®§¢à é ¥â ã¯à ¢«¥­¨¥, á®®¡é¨¢ ªã¤  á«¥¤ã¥â ¨­ä®à¬ æ¨î
® § ¯à®á¥. ‘ ¬® ¯à®¨£à뢠­¨¥ ¨¤ñâ ­¥§ ¢¨á¨¬® ®â ¯à®£à ¬¬ë.
* „ ­­ë¥ ¤®«¦­ë á®åà ­ïâìáï ¢ ¯ ¬ï⨠¯® ªà ©­¥© ¬¥à¥
¤® ª®­æ  ¯à®¨£à뢠­¨ï.
 
======================================================================
============= ”ã­ªæ¨ï 56 - § ¯¨á âì ä ©« ­  ¦ñá⪨© ¤¨áª. ============
======================================================================
 à ¬¥âàë:
* eax = 56 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨¬ï ä ©« 
* ecx = à §¬¥à ¤ ­­ëå ¤«ï § ¯¨á¨ (¢ ¡ ©â å)
* edx = 㪠§ â¥«ì ­  ¤ ­­ë¥ ¤«ï § ¯¨á¨
* esi = 㪠§ â¥«ì ­  ¯ãâì (ASCIIZ-áâபã)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
‡ ¬¥ç ­¨ï:
* â  äã­ªæ¨ï ãáâ à¥« ; äã­ªæ¨ï 70 ¯®§¢®«ï¥â ¢ë¯®«­ïâì
⥠¦¥ ¤¥©á⢨ï á à áè¨à¥­­ë¬¨ ¢®§¬®¦­®áâﬨ.
* „ ­­ ï äã­ªæ¨ï ¯à¥¤¯®« £ ¥â, çâ® ¢® ¢à¥¬ï ¥ñ ¢ë§®¢  ®¤­¨¬
¯à¨«®¦¥­¨¥¬ ­¨ª ª®¥ ¤à㣮¥ ¯à¨«®¦¥­¨¥ ­¥ à ¡®â ¥â
á ¦ñá⪨¬ ¤¨áª®¬.
* ãâì ª ä ©«ã - ASCIIZ-áâப , ª®â®à ï ¬®¦¥â ¡ëâì ¯ãá⮩
(¥á«¨ ä ©« ᮧ¤ ñâáï ¢ ª®à­¥¢®¬ ª â «®£¥) ¨«¨ ¨¬¥âì ä®à¬ â
/d1/d2/.../dn, £¤¥ ¢á¥ ¨¬¥­  ¯ ¯®ª ¤®«¦­ë ¨¬¥âì ä®à¬ â 8+3, â.¥.
8 ᨬ¢®«®¢ ¨¬¥­¨ ¨ 3 ᨬ¢®«  à áè¨à¥­¨ï ¡¥§ à §¤¥«¨â¥«ï,
¯à¨ ­¥®¡å®¤¨¬®á⨠¤®¯®«­¥­­ë¥ ¯à®¡¥« ¬¨;
¢á¥ ¡ãª¢ë ¤®«¦­ë ¡ëâì § £« ¢­ë¥.
* ˆ¬ï ª ä ©«ã â ª¦¥ ¤®«¦­® ¨¬¥âì ä®à¬ â 8+3.
 
======================================================================
============== ”ã­ªæ¨ï 58 - à ¡®â  á ä ©«®¢®© á¨á⥬®©. ==============
======================================================================
 à ¬¥âàë:
* eax = 58
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮; ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ¢ § ¢¨á¨¬®á⨠®â ¯®¤ä㭪樨 ¬®¦¥â ¢®§¢à é âìáï §­ ç¥­¨¥ ¨
¢ ¤à㣨å ॣ¨áâà å
Ž¡é¨© ä®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ­®¬¥à ¡«®ª 
* +8: dword: à §¬¥à
* +12 = +0xC: dword: 㪠§ â¥«ì ­  ¤ ­­ë¥
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï à ¡®âë á¨á⥬ë
(4096 ¡ ©â)
* +20 = +0x14: n db: ASCIIZ-áâப  á ¨¬¥­¥¬ ä ©« 
“â®ç­¥­¨ï - ¢ ¤®ªã¬¥­â æ¨¨ ­  ᮮ⢥âáâ¢ãîéãî ¯®¤äã­ªæ¨î.
ˆ¬ï ä ©«  ­¥çã¢á⢨⥫쭮 ª ॣ¨áâàã « â¨­áª¨å ¡ãª¢,
àãá᪨¥ ¡ãª¢ë ¤®«¦­ë ¡ëâì § £« ¢­ë¬¨.
”®à¬ â ¨¬¥­¨ ä ©« :
/base/number/dir1/dir2/.../dirn/file,
£¤¥ /base/number ¨¤¥­â¨ä¨æ¨àã¥â ãáâனá⢮, ­  ª®â®à®¬ ¨é¥âáï ä ©«:
®¤­® ¨§
* /RD/1 = /RAMDISK/1 ¤«ï ¤®áâ㯠 ª à ¬¤¨áªã
* /FD/1 = /FLOPPYDISK/1 ¤«ï ¤®áâ㯠 ª ¯¥à¢®¬ã ä«®¯¯¨-¤¨áª®¢®¤ã,
/FD/2 = /FLOPPYDISK/2 ¤«ï ¢â®à®£® ä«®¯¯¨-¤¨áª®¢®¤ 
* /HD/x = /HARDDISK/x - ãáâ à¥¢è¨© ¢ à¨ ­â ¤®áâ㯠 ª ¦ñá⪮¬ã ¤¨áªã
(¢ í⮬ á«ãç ¥ ¡ §  ®¯à¥¤¥«ï¥âáï ¯®¤ä㭪樥© 7 ä㭪樨 21),
x - ­®¬¥à à §¤¥«  (áç¨â ï á 1)
* /HD0/x, /HD1/x, /HD2/x, /HD3/x ¤«ï ¤®áâ㯠 ᮮ⢥âá⢥­­®
ª ãáâனá⢠¬ IDE0 (Primary Master), IDE1 (Primary Slave),
IDE2 (Secondary Master), IDE3 (Secondary Slave);
x - ­®¬¥à à §¤¥«  ­  ¢ë¡à ­­®¬ ¢¨­ç¥áâ¥à¥, ¨§¬¥­ï¥âáï ®â 1 ¤® 255
(­  ª ¦¤®¬ ¨§ ¢¨­ç¥áâ¥à®¢ ­ã¬¥à æ¨ï ­ ç¨­ ¥âáï á 1)
‡ ¬¥ç ­¨ï:
* ‚ ¯¥à¢ëå ¤¢ãå á«ãç ïå ¤®¯ã᪠¥âáï ¨á¯®«ì§®¢ ­¨¥ FIRST ¢¬¥áâ® 1,
SECOND ¢¬¥áâ® 2, ­® ¨á¯®«ì§®¢ âì íâã ¢®§¬®¦­®áâì
­¥ ४®¬¥­¤ã¥âáï ¤«ï 㤮¡á⢠ ¯¥à¥å®¤  ­  ¡ã¤ã騥 à áè¨à¥­¨ï.
*  ª« ¤ë¢ ¥âáï ®£à ­¨ç¥­¨¥ n<=39.
* ˆ¬¥­  ¯ ¯®ª ¨ ä ©«  dir1,...,dirn,file ¤®«¦­ë ¡ëâì ¢ ä®à¬ â¥ 8.3:
¨¬ï ­¥ ¡®«¥¥ 8 ᨬ¢®«®¢, â®çª , à áè¨à¥­¨¥ ­¥ ¡®«¥¥ 3 ᨬ¢®«®¢.
•¢®áâ®¢ë¥ ¯à®¡¥«ë ¨£­®à¨àãîâáï. „àã£¨å ¯à®¡¥«®¢ ¡ëâì ­¥ ¤®«¦­®.
…᫨ ¨¬ï § ­¨¬ ¥â ஢­® 8 ᨬ¢®«®¢, â®çªã ¬®¦­® ®¯ãáâ¨âì
(å®âï ¯®«ì§®¢ âìáï í⨬ ­¥ ४®¬¥­¤ã¥âáï ¤«ï 㤮¡á⢠ ¯¥à¥å®¤ 
­  ¡ã¤ã騥 à áè¨à¥­¨ï).
* ”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥â ¯ ¯®ª ­  à ¬¤¨áª¥.
à¨¬¥àë:
* '/RAMDISK/FIRST/KERNEL.ASM',0
'/rd/1/kernel.asm',0
* '/HD0/1/kernel.asm',0
* '/hd0/1/menuet/pics/tanzania.bmp',0
„®áâã¯­ë¥ ¯®¤ä㭪樨:
* ¯®¤äã­ªæ¨ï 0 - ç⥭¨¥ ä ©« /¯ ¯ª¨
* ¯®¤äã­ªæ¨ï 1 - ¯¥à¥§ ¯¨áì ä ©« 
* ¯®¤äã­ªæ¨ï 2 - 㤠«¥­¨¥ ä ©« /¯ ¯ª¨
* ¯®¤äã­ªæ¨ï 4 - ᮧ¤ ­¨¥ ¯ ¯ª¨
* ¯®¤äã­ªæ¨ï 5 - ¯¥à¥¨¬¥­®¢ ­¨¥/¯¥à¥¬¥é¥­¨¥ ä ©« /¯ ¯ª¨
* ¯®¤äã­ªæ¨ï 8 - LBA-ç⥭¨¥ á ãáâனá⢠
* ¯®¤äã­ªæ¨ï 15 - ¯®«ã祭¨¥ ¨­ä®à¬ æ¨¨ ® ä ©«®¢®© á¨á⥬¥
 
======================================================================
========== ”ã­ªæ¨ï 58, ¯®¤äã­ªæ¨ï 0 - ¯à®ç¨â âì ä ©«/¯ ¯ªã. ==========
======================================================================
 à ¬¥âàë:
* eax = 58
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 0 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ­®¬¥à ¡«®ª  ¤«ï ç⥭¨ï (áç¨â ï á 0)
* +8: dword: ç¨á«® ¡«®ª®¢ ¤«ï ç⥭¨ï
* +12 = +0xC: dword: 㪠§ â¥«ì ­  ¡ãä¥à, ªã¤  ¡ã¤ãâ § ¯¨á ­ë ¤ ­­ë¥
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¡ãä¥à ¤«ï à ¡®âë á¨á⥬ë
(4096 ¡ ©â)
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx = à §¬¥à ä ©«  (¢ ¡ ©â å) ¨«¨
-1=0xffffffff, ¥á«¨ ä ©« ­¥ ­ ©¤¥­
‡ ¬¥ç ­¨ï:
*  §¬¥à ¡«®ª  - 512 ¡ ©â.
* â  äã­ªæ¨ï ãáâ à¥« , ¤«ï ç⥭¨ï ä ©«®¢ ¨á¯®«ì§ã©â¥ ¯®¤äã­ªæ¨î 0
ä㭪樨 70, ¤«ï ç⥭¨ï ¯ ¯®ª - ¯®¤äã­ªæ¨î 1 ä㭪樨 70.
* ”ã­ªæ¨ï ¯®§¢®«ï¥â ç¨â âì ᮤ¥à¦¨¬®¥ ¯ ¯ª¨. ˆ§ ä ©«®¢ëå á¨á⥬
¯®¤¤¥à¦¨¢ ¥âáï ⮫쪮 FAT. ”®à¬ â FAT-¯ ¯ª¨ ®¯¨á ­ ¢ «î¡®©
¤®ªã¬¥­â æ¨¨ ¯® FAT.
*  §¬¥à ¯ ¯ª¨ ®¯à¥¤¥«ï¥âáï ¯® à §¬¥àã 楯®çª¨ ª« áâ¥à®¢ ¢ FAT.
* …᫨ ä ©« ª®­ç¨«áï à ­ìè¥, 祬 ¡ë« ¯à®ç¨â ­ ¯®á«¥¤­¨© § ¯à®è¥­­ë©
¡«®ª, â® äã­ªæ¨ï ¯à®ç¨â ¥â, ᪮«ìª® ᬮ¦¥â, ¯®á«¥ 祣® ¢¥à­ñâ
eax=6 (EOF).
* ”ã­ªæ¨ï ¯®§¢®«ï¥â ç¨â âì ª®à­¥¢ë¥ ¯ ¯ª¨ /rd/1,/fd/x,/hd[n]/x, ­®
¢ ¯¥à¢ëå ¤¢ãå á«ãç ïå ⥪ãé ï ॠ«¨§ æ¨ï ­¥ á«¥¤ã¥â
ãáâ ­®¢«¥­­ë¬ ¯à ¢¨« ¬:
¤«ï /rd/1:
* ¥á«¨ 㪠§ ­® 0 ¡«®ª®¢ ¤«ï ç⥭¨ï, áç¨â ¥âáï,
çâ® § ¯à è¨¢ ¥âáï 1;
* ¥á«¨ § ¯à è¨¢ ¥âáï ¡®«ìè¥ 14 ¡«®ª®¢ ¨«¨ ­ ç «ì­ë© ¡«®ª
­¥ ¬¥­ìè¥ 14-£®, â® ¢®§¢à é ¥âáï eax=5 (not found) ¨ ebx=-1;
* à §¬¥à ª®à­¥¢®£® ª â «®£  à ¬¤¨áª  = 14 ¡«®ª®¢,
0x1C00=7168 ¡ ©â; ­® ¢®§¢à é ¥âáï ebx=0
(§  ¨áª«î祭¨¥¬ á«ãç ï ¯à¥¤ë¤ã饣® ¯ã­ªâ );
* ª ª ­¨ áâà ­­®, ¬®¦­® ¯à®ç¨â âì 14-© ¡«®ª (â ¬, ¢®®¡é¥ £®¢®àï,
¬ãá®à - ­ ¯®¬¨­ î, áçñâ ¢¥¤ñâáï á 0);
* ¥á«¨ ¡ë« § ¯à®è¥­ å®âï ¡ë ®¤¨­ ¡«®ª á ­®¬¥à®¬, ­¥ ¬¥­ì訬 14,
â® ¢®§¢à é ¥âáï eax=6(EOF); ¨­ ç¥ eax=0.
„«ï /fd/x:
* ¥á«¨ ­ ç «ì­ë© ¡«®ª ­¥ ¬¥­ìè¥ 14-£®, â® ¢®§¢à é ¥âáï
eax=5 (not found) ¨ ebx=0;
* ªáâ â¨ £®¢®àï, ä®à¬ â FAT12 ¤®¯ã᪠¥â ¤¨áª¥âë á à §¬¥à®¬
ª®à­¥¢®£® ª â «®£  ¬¥­ìè¥ ¨«¨ ¡®«ìè¥ 14 ¡«®ª®¢;
* ¯à®¢¥àª¨ ¤«¨­ë ­¥ ¤¥« ¥âáï;
* ¥á«¨ 㤠«®áì ¯à®ç¨â âì ¤ ­­ë¥ á ¤¨áª¥âë, ¢®§¢à é ¥âáï
eax=0,ebx=0; ¢ ¯à®â¨¢­®¬ á«ãç ¥ eax=10 (access denied), ebx=-1.
* ”ã­ªæ¨ï ®¡à ¡ â뢠¥â ç⥭¨¥ ᯥ樠«ì­ëå ¯ ¯®ª /,/rd,/fd,/hd[n];
­® १ã«ìâ â ­¥ ᮮ⢥âáâ¢ã¥â ®¦¨¤ ¥¬®¬ã
(¯® à ¡®â¥ á ®¡ëç­ë¬¨ ä ©« ¬¨/¯ ¯ª ¬¨), ­¥ á«¥¤ã¥â ãáâ ­®¢«¥­­ë¬
¯à ¢¨« ¬, ¬®¦¥â ¨§¬¥­¨âìáï ¢ á«¥¤ãîé¨å ¢¥àá¨ïå ï¤à  ¨ ¯®â®¬ã
­¥ ®¯¨á뢠¥âáï. „«ï ¯®«ã祭¨ï ¨­ä®à¬ æ¨¨ ®¡ ®¡®à㤮¢ ­¨¨
¨á¯®«ì§ã©â¥ ¯®¤äã­ªæ¨î 11 ä㭪樨 18 ¨«¨
ç¨â ©â¥ ᮮ⢥âáâ¢ãî騥 ¯ ¯ª¨ ¯®¤ä㭪樥© 1 ä㭪樨 70.
 
======================================================================
============ ”ã­ªæ¨ï 58, ¯®¤äã­ªæ¨ï 1 - ¯¥à¥§ ¯¨á âì ä ©«. ===========
======================================================================
…᫨ ä ©« ­¥ áãé¥áâ¢ã¥â, ®­ ᮧ¤ ñâáï.
…᫨ ä ©« áãé¥áâ¢ã¥â, ®­ ¯¥à¥§ ¯¨á뢠¥âáï.
 à ¬¥âàë:
* eax = 58 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 1 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ¨£­®à¨àã¥âáï (ãáâ ­ ¢«¨¢ ©â¥ ¢ 0)
* +8: dword: ç¨á«® ¡ ©â ¤«ï § ¯¨á¨
* +12 = +0xC: dword: 㪠§ â¥«ì ­  ¤ ­­ë¥ ¤«ï § ¯¨á¨
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¡ãä¥à ¤«ï à ¡®âë á¨á⥬ë
(4096 ¡ ©â)
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx à §àãè ¥âáï
‡ ¬¥ç ­¨ï:
* â  äã­ªæ¨ï ãáâ à¥« , ¨á¯®«ì§ã©â¥ ¯®¤äã­ªæ¨î 2 ä㭪樨 70.
 
======================================================================
=========== ”ã­ªæ¨ï 58, ¯®¤äã­ªæ¨ï 2 - 㤠«¨âì ä ©«/¯ ¯ªã. ===========
======================================================================
 à ¬¥âàë:
* eax = 58 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 2 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ¨£­®à¨àã¥âáï
* +8: dword: ¨£­®à¨àã¥âáï
* +12 = +0xC: dword: ¨£­®à¨àã¥âáï
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¡ãä¥à ¤«ï à ¡®âë á¨á⥬ë
(4096 ¡ ©â)
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx à §àãè ¥âáï
‡ ¬¥ç ­¨ï:
* à¨ à ¡®â¥ á ¤¨áª¥â®© ­¥ á«¥¤ã¥â 㤠«ïâì ­¥¯ãáâãî ¯ ¯ªã.
Š®¤ à ¡®âë á ¦ñá⪨¬ ¤¨áª®¬ ­¥¯ãáâë¥ ¯ ¯ª¨ 㤠«ï¥â ª®à४⭮
(â.¥. ४ãàᨢ­® á® ¢á¥¬¨ ä ©« ¬¨ ¨ ¢«®¦¥­­ë¬¨ ¯ ¯ª ¬¨).
 ¬¤¨áª ¯ ¯®ª ­¥ ¯®¤¤¥à¦¨¢ ¥â.
 
======================================================================
============== ”ã­ªæ¨ï 58, ¯®¤äã­ªæ¨ï 4 - ᮧ¤ âì ¯ ¯ªã. =============
======================================================================
 à ¬¥âàë:
* eax = 58 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 4 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ¨£­®à¨àã¥âáï
* +8: dword: ¨£­®à¨àã¥âáï
* +12 = +0xC: dword: ¨£­®à¨àã¥âáï
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¡ãä¥à ¤«ï à ¡®âë á¨á⥬ë
(4096 ¡ ©â)
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx à §àãè ¥âáï
‡ ¬¥ç ­¨ï:
*  ¬¤¨áª ¨ ¤¨áª¥âë ­¥ ¯®¤¤¥à¦¨¢ îâ íâã äã­ªæ¨î,
®­  ⮫쪮 ¤«ï ¦ñáâª¨å ¤¨áª®¢.
 
======================================================================
== ”ã­ªæ¨ï 58, ¯®¤äã­ªæ¨ï 5 - ¯¥à¥¨¬¥­®¢ âì/¯¥à¥¬¥áâ¨âì ä ©«/¯ ¯ªã. ==
======================================================================
 à ¬¥âàë:
* eax = 58 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 5 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ¨£­®à¨àã¥âáï
* +8: dword: ¨£­®à¨àã¥âáï
* +12 = +0xC: dword: ¨£­®à¨àã¥âáï
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¡ãä¥à ¤«ï à ¡®âë á¨á⥬ë
(4096 ¡ ©â)
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
* +20+n: (áࠧ㠯®á«¥ § ¢¥àè î饣® ­ã«¥¢®£® ᨬ¢®« ) ­®¢®¥
ASCIIZ-¨¬ï, ¤®«¦­® ­ ç¨­ âìáï á /hd/1, çâ® ¨­â¥à¯à¥â¨àã¥âáï ª ª
¦ñá⪨© ¤¨áª, 㪠§ ­­ë© ¢ ¯¥à¢®¬ ¨¬¥­¨
(¯¥à¥¬¥é¥­¨¥ á ®¤­®£® ¤¨áª  ­  ¤à㣮© ­¥ ¯®¤¤¥à¦¨¢ ¥âáï)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx à §àãè ¥âáï
‡ ¬¥ç ­¨ï:
*  ¬¤¨áª ¨ ¤¨áª¥âë ­¥ ¯®¤¤¥à¦¨¢ îâ íâã äã­ªæ¨î,
®­  ⮫쪮 ¤«ï ¦ñáâª¨å ¤¨áª®¢.
* …᫨ ­®¢®¥ ASCIIZ-¨¬ï ᨫ쭮 ­¥¯à ¢¨«ì­®¥, â.¥. ­¥ ­ ç¨­ ¥âáï á
/hd/1, /hd/first, /harddisk/1, /harddisk/first ¨«¨ ¯®á«¥ í⮣®
­ ç «  ¨¤ñ⠯஡¥« ¨«¨ ᨬ¢®« á ª®¤®¬ 0, â® äã­ªæ¨ï ¢®§¢à é ¥â,
ª ª ­¨ áâà ­­®, ª®¤ ®è¨¡ª¨ 4. â® ¥¤¨­á⢥­­ ï äã­ªæ¨ï, ª®â®à ï
¢®®¡é¥ ¢®§¢à é ¥â íâ®â ª®¤.
 
======================================================================
========= ”ã­ªæ¨ï 58, ¯®¤äã­ªæ¨ï 8 - LBA-ç⥭¨¥ á ãáâனá⢠. ========
======================================================================
 à ¬¥âàë:
* eax = 58 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 8 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ­®¬¥à ¡«®ª  ¤«ï ç⥭¨ï (áç¨â ï á 0)
* +8: dword: ¨£­®à¨àã¥âáï (ãáâ ­ ¢«¨¢ ©â¥ ¢ 1)
* +12 = +0xC: dword: 㪠§ â¥«ì ­  ¡ãä¥à, ªã¤  ¡ã¤ãâ § ¯¨á ­ë ¤ ­­ë¥
(512 ¡ ©â)
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¡ãä¥à ¤«ï à ¡®âë á¨á⥬ë
(4096 ¡ ©â)
* +20 = +0x14: ASCIIZ-¨¬ï ãáâனá⢠: ­¥çã¢á⢨⥫쭮 ª ॣ¨áâàã,
®¤­® ¨§ /rd/1 = /RamDisk/1, /hd/n = /HardDisk/n,
1<=n<=4 - ­®¬¥à ãáâனá⢠: 1=IDE0, ..., 4=IDE3.
‚¬¥áâ® æ¨äà ¤®¯ã᪠¥âáï, å®âï ¨ ­¥ ४®¬¥­¤ã¥âáï ¤«ï 㤮¡á⢠
¯¥à¥å®¤  ­  ¡ã¤ã騥 à áè¨à¥­¨ï,
¨á¯®«ì§®¢ ­¨¥ 'first','second','third','fourth'.
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ¥á«¨ 㪠§ ­® ¨¬ï ãáâனá⢠ /hd/xxx, £¤¥ xxx ­¥ ­ å®¤¨âáï
¢ ᯨ᪥ ¢ëè¥:
* eax = ebx = 1
* ¥á«¨ 㪠§ ­® ­¥¯à ¢¨«ì­®¥ ¨¬ï ãáâனá⢠
(§  ¨áª«î祭¨¥¬ ¯à¥¤ë¤ã饣® á«ãç ï):
* eax = 5
* ebx ­¥ ¬¥­ï¥âáï
* ¥á«¨ LBA-¤®áâ㯠§ ¯à¥éñ­ ¯®¤ä㭪樥© 11 ä㭪樨 21:
* eax = 2
* ebx à §àãè ¥âáï
* ¤«ï à ¬¤¨áª : ¯®¯ë⪠ ç⥭¨ï ¡«®ª  §  ¯à¥¤¥« ¬¨ à ¬¤¨áª 
(18*2*80 ¡«®ª®¢) ¯à¨¢®¤¨â ª
* eax = 3
* ebx = 0
* ¯à¨ ãᯥ譮¬ ç⥭¨¨:
* eax = ebx = 0
‡ ¬¥ç ­¨ï:
*  §¬¥à ¡«®ª  - 512 ¡ ©â; ç¨â ¥âáï ®¤¨­ ¡«®ª.
* ¥ á«¥¤ã¥â ¯®« £ âìáï ­  ¢®§¢à é ¥¬®¥ §­ ç¥­¨¥,
®­® ¬®¦¥â ¨§¬¥­¨âìáï ¢ á«¥¤ãîé¨å ¢¥àá¨ïå.
* ’ॡã¥âáï, çâ®¡ë ¡ë« à §à¥èñ­ LBA-¤®áâ㯠ª ãáâனá⢠¬
¯®¤ä㭪樥© 11 ä㭪樨 21. “§­ âì íâ® ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樥© 11 ä㭪樨 26.
* LBA-ç⥭¨¥ ¤¨áª¥âë ­¥ ¯®¤¤¥à¦¨¢ ¥âáï.
* ”ã­ªæ¨ï áç¨â뢠¥â ¤ ­­ë¥ 䨧¨ç¥áª®£® ¦ñá⪮£® ¤¨áª ;
¥á«¨ ¯® ª ª¨¬-â® ¯à¨ç¨­ ¬ ­ã¦­ë ¤ ­­ë¥ ª®­ªà¥â­®£® à §¤¥« ,
¯à¨¤ñâáï ®¯à¥¤¥«ïâì ­ ç «ì­ë© ᥪâ®à í⮣® à §¤¥« 
(«¨¡® ­ ¯àï¬ãî ç¥à¥§ MBR, «¨¡® ¨§ à áè¨à¥­­®© áâàãªâãàë,
¢®§¢à é ¥¬®© ⮩ ¦¥ ¯®¤ä㭪樥© 11 ä㭪樨 18).
* ”ã­ªæ¨ï ­¥ ¯à®¢¥àï¥â ª®¤ ®è¨¡ª¨ ¦ñá⪮£® ¤¨áª , â ª çâ® § ¯à®á
­¥áãé¥áâ¢ãî饣® ᥪâ®à  ¢áñ à ¢­® çâ®-â® ¯à®ç¨â ¥â
(¢¥à®ïâ­¥¥ ¢á¥£®, ­ã«¨, ­® íâ® ®¯à¥¤¥«ï¥âáï ãáâனá⢮¬) ¨
íâ® ¡ã¤¥â áç¨â âìáï ãᯥ宬 (eax=0).
 
======================================================================
= ”ã­ªæ¨ï 58, ¯®¤äã­ªæ¨ï 15 - ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ä ©«®¢®© á¨á⥬¥.
======================================================================
 à ¬¥âàë:
* eax = 58 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 15 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ¨£­®à¨àã¥âáï
* +8: dword: ¨£­®à¨àã¥âáï
* +12 = +0xC: dword: ¨£­®à¨àã¥âáï
* +16 = +0x10: dword: ¨£­®à¨àã¥âáï
* +20 = +0x14: (¯à®¢¥àï¥âáï ⮫쪮 ¢â®à®© ᨬ¢®«, áࠧ㠯®á«¥ á«íè )
/rd=/RAMDISK ¨«¨ /hd=/HARDDISK
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ¥á«¨ ¢â®à®© ᨬ¢®« ­¥ ¯à¨­ ¤«¥¦¨â ¬­®¦¥áâ¢ã {'r','R','h','H'}:
* eax = 3
* ebx = ecx = dword [fileinfo] = 0
* ¤«ï à ¬¤¨áª :
* eax = 0 (ãᯥå)
* ebx = ®¡é¥¥ ç¨á«® ª« áâ¥à®¢ = 2847
* ecx = ç¨á«® ᢮¡®¤­ëå ª« áâ¥à®¢
* dword [fileinfo] = à §¬¥à ª« áâ¥à  = 512
* ¤«ï ¦ñá⪮£® ¤¨áª : ¡ §  ¨ à §¤¥« ®¯à¥¤¥«ïîâáï ¯®¤äã­ªæ¨ï¬¨ 7 ¨ 8
ä㭪樨 21:
* eax = 0 (ãᯥå)
* ebx = ®¡é¥¥ ç¨á«® ª« áâ¥à®¢
* ecx = ç¨á«® ᢮¡®¤­ëå ª« áâ¥à®¢
* dword [fileinfo] = à §¬¥à ª« áâ¥à  (¢ ¡ ©â å)
‡ ¬¥ç ­¨ï:
* ¥ 㤨¢«ï©â¥áì áâà ­­®¬ã à á¯®«®¦¥­¨î 4-£® ¢®§¢à é ¥¬®£®
¯ à ¬¥âà  - ª®£¤  ¯¨á «áï íâ®â ª®¤, ¯à¨ á¨á⥬­ëå ¢ë§®¢ å
¯à¨«®¦¥­¨î ¢®§¢à é «¨áì ⮫쪮 ॣ¨áâàë eax,ebx,ecx (¨§
pushad-áâàãªâãàë, ¯¥à¥¤ î饩áï ª ª  à£ã¬¥­â á¨á⥬­®© ä㭪樨).
’¥¯¥àì íâ® ¨á¯à ¢«¥­®, â ª çâ®, ¢®§¬®¦­®, ¨¬¥¥â á¬ëá« ¢®§¢à é âì
à §¬¥à ª« áâ¥à  ¢ edx, ¯®ª  íâã äã­ªæ¨î ­¥ ­ ç «¨ ¨á¯®«ì§®¢ âì.
* ‚®®¡é¥-â® ¥éñ áãé¥áâ¢ã¥â ¯®¤äã­ªæ¨ï 11 ä㭪樨 18, ¢®§¢à é îé ï
¨­ä®à¬ æ¨î ® ä ©«®¢®© á¨á⥬¥. ® à áè¨à¥­­®© â ¡«¨æ¥ ¤¨áª®¢®©
¯®¤á¨áâ¥¬ë ¬®¦­® ®¯à¥¤¥«¨âì à §¬¥à ª« áâ¥à  (â ¬ ®­ åà ­¨âáï
¢ ᥪâ®à å) ¨ ®¡é¥¥ ç¨á«® ª« áâ¥à®¢ ¤«ï ¦ñáâª¨å ¤¨áª®¢.
 
======================================================================
=== ”ã­ªæ¨ï 59 - ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ¯®á«¥¤­¨å á¨á⥬­ëå ¢ë§®¢ å. ==
======================================================================
®«ã砥⠤ ­­ë¥ ® ¢á¥å á¨á⥬­ëå ¢ë§®¢ å ¢á¥å ¯à®æ¥áᮢ.
 à ¬¥âàë:
* eax = 59 - ­®¬¥à ä㭪樨
* ebx = 0 - ¥¤¨­á⢥­­ ï ¯®¤äã­ªæ¨ï
* ecx = 㪠§ â¥«ì ­  ¡ãä¥à
* edx = à §¬¥à ¡ãä¥à 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ®¡é¥¥ ç¨á«® á¨á⥬­ëå ¢ë§®¢®¢,
ᤥ« ­­ëå á ¬®¬¥­â  § £à㧪¨ á¨á⥬ë (¯® ¬®¤ã«î 2^32)
* ebx = 0
”®à¬ â ¨­ä®à¬ æ¨¨ ®¡ ®¤­®¬ ¢ë§®¢¥: (à §¬¥à = 0x40 = 64 ¡ ©â )
* +0: dword: PID ¯à®æ¥áá /¯®â®ª 
* +4: 7*dword: ¬ãá®à
* +32 = +0x20: dword: §­ ç¥­¨¥ edi ¯à¨ ¢ë§®¢¥
* +36 = +0x24: dword: esi
* +40 = +0x28: dword: ebp
* +44 = +0x2C: dword: 㪠§ â¥«ì áâíª  ®¡à ¡®â稪  ï¤à 
* +48 = +0x30: dword: ebx
* +52 = +0x34: dword: edx
* +56 = +0x38: dword: ecx
* +60 = +0x3C: dword: eax (=­®¬¥à á¨á⥬­®© ä㭪樨)
‡ ¬¥ç ­¨ï:
* ”ã­ªæ¨ï ¨á¯®«ì§ã¥âáï ⮫쪮 ¢ ¯à¨«®¦¥­¨¨ systrace.
„®¢®«ì­® âà㤭® ¯à¥¤áâ ¢¨âì á¨âã æ¨î, ¢ ª®â®à®© íâ® ¯à¨«®¦¥­¨¥
¨«¨ íâ  äã­ªæ¨ï ¤¥©á⢨⥫쭮 ¯®«¥§­ë,   ¢®â ¢á¥ á¨á⥬­ë¥ ¢ë§®¢ë
¤«ï ¯®¤¤¥à¦ª¨ í⮩ ä㭪樨 ­¥áª®«ìª® § ¬¥¤«ïîâáï
(å®âï ¨ ­¥­ ¬­®£®)...
* ‚ á¢ï§¨ á í⨬ ¥áâì ¯à¥¤«®¦¥­¨¥ ¯®¤¤¥à¦ªã í⮩ ä㭪樨
¨§ ï¤à  ã¡à âì ᮢᥬ, ¢¬¥áâ¥ á ¯à¨«®¦¥­¨¥¬ systrace.
* ˆ­ä®à¬ æ¨ï ® á¨á⥬­ëå ¢ë§®¢ å á®åà ­ï¥âáï ¢
á¨á⥬­®¬ ª®«ì楢®¬ ¡ãä¥à¥ ­  0x10 ¢å®¤®¢.
â  äã­ªæ¨ï ¯à®áâ® ª®¯¨àã¥â 㪠§ ­­ë© ®¡êñ¬ ¤ ­­ëå
¨§ 㯮¬ï­ã⮣® ¡ãä¥à  ¯® 㪠§ ­­®¬ã  ¤à¥áã.
* Š ª®© ¨§ ¢å®¤®¢ ¢ ¡ãä¥à¥ ᮮ⢥âáâ¢ã¥â ¯®á«¥¤­¥¬ã ¢ë§®¢ã,
¬®¦­® ®¯à¥¤¥«¨âì ¯® §­ ç¥­¨î eax,   ¨¬¥­­®,
¢å®¤ (eax and 0xF) (¯® ᬥ饭¨î (eax and 0xF)*0x40).
* ‚ ⥪ã饩 ॠ«¨§ æ¨¨ ¢®§¬®¦­ë ।ª® ¢áâà¥ç î騥áï
¯à®¡«¥¬ë à áᨭåà®­¨§ æ¨¨, ª®£¤  ® ­¥ª®â®àëå ¢ë§®¢ å
¨­ä®à¬ æ¨ï ãáâ à¥¢ ¥â.
* ®¤ á¨á⥬­ë© ¡ãä¥à ¢ë¤¥«¥­  áâà ­¨æ , 4Š¡.
 §¬¥à ¢å®¤  = 64 ¡ ©â .
®ç¥¬ã ¨á¯®«ì§ã¥âáï ⮫쪮 16 ¢å®¤®¢ - ­¥¯®­ïâ­®.
* ‡­ ç¥­¨¥ esp ¢ ¬®¬¥­â á¨á⥬­®£® ¢ë§®¢ 
í⮩ ä㭪樥© 㧭 âì ­¥«ì§ï.
* à®¢¥àª¨ ª®à४⭮á⨠edx ¢ ⥪ã饩 ॠ«¨§ æ¨¨ ­¥ ¤¥« ¥âáï.
 
======================================================================
=========== ”ã­ªæ¨ï 60 - Inter Process Communication (IPC). ==========
======================================================================
IPC ¯à¨¬¥­ï¥âáï ¤«ï ¯®áë«®ª á®®¡é¥­¨© ®â ®¤­®£® ¯à®æ¥áá /¯®â®ª 
¤à㣮¬ã. à¨ í⮬ á«¥¤ã¥â ¯à¥¤¢ à¨â¥«ì­® ¤®£®¢®à¨âìáï ® ⮬, ª ª
¨­â¥à¯à¥â¨à®¢ âì ª®­ªà¥â­®¥ á®®¡é¥­¨¥.
 
-------- ®¤äã­ªæ¨ï 1 - ãáâ ­®¢¨âì ®¡« áâì ¤«ï ¯®«ã祭¨ï IPC ---------
‚ë§ë¢ ¥âáï ¯à®æ¥áᮬ-¯à¨ñ¬­¨ª®¬.
 à ¬¥âàë:
* eax = 60 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 㪠§ â¥«ì ­  ¡ãä¥à
* edx = à §¬¥à ¡ãä¥à 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ¢á¥£¤  ãᯥ譮
”®à¬ â IPC-¡ãä¥à :
* +0: dword: ¥á«¨ §¤¥áì ­¥ 0, â® ¡ãä¥à áç¨â ¥âáï § ¡«®ª¨à®¢ ­­ë¬;
¡«®ª¨àã©â¥/à §¡«®ª¨àã©â¥ ¡ãä¥à, ª®£¤  ¢ë á ­¨¬  ªâ¨¢­® à ¡®â ¥â¥
¨ ¢ ¬ ­ ¤®, çâ®¡ë ¨§¢­¥ ­¥ ¨§¬¥­ï«¨áì ¤ ­­ë¥ ¡ãä¥à 
(­¥ ¯®áâ㯠«¨ ­®¢ë¥ á®®¡é¥­¨ï)
* +4: dword: § ­ïâ® ¬¥áâ  ¢ ¡ãä¥à¥ (¢ ¡ ©â å)
* +8: ¯¥à¢®¥ á®®¡é¥­¨¥
* +8+n: ¢â®à®¥ á®®¡é¥­¨¥
* ...
”®à¬ â á®®¡é¥­¨ï:
* +0: dword: PID ¯à®æ¥áá /¯®â®ª , ¯®á« ¢è¥£® á®®¡é¥­¨¥
* +4: dword: ¤«¨­  á®®¡é¥­¨ï (­¥ áç¨â ï íâ®â § £®«®¢®ª)
* +8: n*byte: ¤ ­­ë¥ á®®¡é¥­¨ï
 
--------------- ®¤äã­ªæ¨ï 2 - ¯®á« âì á®®¡é¥­¨¥ IPC. ----------------
‚ë§ë¢ ¥âáï ¯à®æ¥áᮬ-¨­¨æ¨ â®à®¬.
 à ¬¥âàë:
* eax = 60 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = PID ¯à¨ñ¬­¨ª 
* edx = 㪠§ â¥«ì ­  ¤ ­­ë¥ á®®¡é¥­¨ï
* esi = ¤«¨­  á®®¡é¥­¨ï (¢ ¡ ©â å)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ¯à¨ñ¬­¨ª ­¥ ®¯à¥¤¥«¨« ¡ãä¥à ¤«ï IPC-á®®¡é¥­¨©
(¬®¦¥â ¡ëâì, ¥éñ ­¥ ãᯥ«,   ¬®¦¥â ¡ëâì, íâ® ­¥ â®â ¯®â®ª,
ª®â®àë© ­ã¦¥­)
* eax = 2 - ¯à¨ñ¬­¨ª § ¡«®ª¨à®¢ « IPC-¡ãä¥à;
¯®¯à®¡ã©â¥ ­¥¬­®£® ¯®¤®¦¤ âì
* eax = 3 - ¯¥à¥¯®«­¥­¨¥ IPC-¡ãä¥à  ¯à¨ñ¬­¨ª 
* eax = 4 - ¯à®æ¥áá /¯®â®ª  á â ª¨¬ PID ­¥ áãé¥áâ¢ã¥â
‡ ¬¥ç ­¨ï:
* ‘¨á⥬  áࠧ㠯®á«¥ § ¯¨á¨ IPC-á®®¡é¥­¨ï ¢ ¡ãä¥à ¯®áë« ¥â
¯®â®ªã-¯à¨ñ¬­¨ªã ᮡë⨥ á ª®¤®¬ 7 (á¬. ª®¤ë ᮡë⨩).
 
======================================================================
=== ”ã­ªæ¨ï 61 - ¯®«ãç¨âì ¯ à ¬¥âàë ¤«ï ¯àאַ£® ¤®áâ㯠 ª £à ä¨ª¥. ===
======================================================================
à®£à ¬¬¥ ¤®áâã¯­ë ¤ ­­ë¥ £à ä¨ç¥áª®£® íªà ­  (®¡« áâì ¯ ¬ïâ¨, ª®â®à ï
ᮡá⢥­­® ¨ ®â®¡à ¦ ¥â ᮤ¥à¦¨¬®¥ íªà ­ ) ­ ¯àï¬ãî ¡¥§ ¢ë§®¢®¢
á¨á⥬­ëå ä㭪権 ç¥à¥§ ᥫ¥ªâ®à gs:
mov eax, [gs:0]
¯®¬¥áâ¨â ¢ eax ¯¥à¢ë© dword ¡ãä¥à , ᮤ¥à¦ é¨© ¨­ä®à¬ æ¨î ® 梥â¥
«¥¢®© ¢¥àå­¥© â®çª¨ (¨, ¢®§¬®¦­®, æ¢¥â  ­¥áª®«ìª¨å á«¥¤ãîé¨å).
mov [gs:0], eax
¯à¨ à ¡®â¥ ¢ ०¨¬ å VESA c LFB
ãáâ ­®¢¨â 梥⠫¥¢®© ¢¥àå­¥© â®çª¨
(¨ ¢®§¬®¦­®, æ¢¥â  ­¥áª®«ìª¨å á«¥¤ãîé¨å).
„«ï ¨­â¥à¯à¥â æ¨¨ ¤ ­­ëå £à ä¨ç¥áª®£® íªà ­  âॡã¥âáï §­ ­¨¥
­¥ª®â®àëå ¯ à ¬¥â஢, ª®â®àë¥ ¢®§¢à é îâáï í⮩ ä㭪樥©.
‡ ¬¥ç ­¨ï:
*  à ¬¥âàë £à ä¨ª¨ ®ç¥­ì ।ª® ¬¥­ïîâáï ¯à¨ à ¡®â¥ á¨á⥬ë,
  ¨¬¥­­®, ⮫쪮 ¢ á«ãç ïå, ª®£¤  ¯®«ì§®¢ â¥«ì à ¡®â ¥â
á ¯à®£à ¬¬®© VRR.
* à¨ ¨§¬¥­¥­¨¨ ¢¨¤¥®à¥¦¨¬  á¨á⥬  ¯¥à¥à¨á®¢ë¢ ¥â ¢á¥ ®ª­ 
(ᮡë⨥ á ª®¤®¬ 1) ¨ ¯¥à¥à¨á®¢ë¢ ¥â ä®­ (ᮡë⨥ 5).
â¨ ¦¥ ᮡëâ¨ï ¯à®¨á室ïâ ¨ ¢ ¤à㣨å á«ãç ïå,
ª®â®àë¥ ¢áâà¥ç îâáï §­ ç¨â¥«ì­® ç é¥, 祬 ¨§¬¥­¥­¨¥ ¢¨¤¥®à¥¦¨¬ .
* à¨ à ¡®â¥ ¢ ¢¨¤¥®à¥¦¨¬ å á LFB ᥫ¥ªâ®à gs 㪠§ë¢ ¥â ­ 
ᮡá⢥­­® LFB, â ª çâ® ç⥭¨¥/§ ¯¨áì ¯® gs ¯à¨¢®¤ïâ
­¥¯®á।á⢥­­® ª ¨§¬¥­¥­¨î ᮤ¥à¦¨¬®£® íªà ­ . à¨ à ¡®â¥ ¢
¢¨¤¥®à¥¦¨¬ å ¡¥§ LFB gs 㪠§ë¢ ¥â ­  ­¥ª®â®àãî ®¡« áâì ¤ ­­ëå
ï¤à , ¯à¨çñ¬ ¢á¥ ä㭪樨 ¢ë¢®¤  ­  íªà ­ ¤®¡à®á®¢¥áâ­® ¢ë¯®«­ïîâ
¤¢®©­ãî à ¡®âã ¯® § ¯¨á¨ ­¥¯®á।á⢥­­® ­  íªà ­ ¨ ¯® § ¯¨á¨
¢ íâ®â ¡ãä¥à. ‚ १ã«ìâ â¥ ¯à¨ ç⥭¨¨ ᮤ¥à¦¨¬®£® í⮣® ¡ãä¥à 
१ã«ìâ âë ᮮ⢥âáâ¢ãîâ ᮤ¥à¦¨¬®¬ã íªà ­ 
(á, ¢®®¡é¥ £®¢®àï, ¡®«ì訬 æ¢¥â®¢ë¬ à §à¥è¥­¨¥¬),
  § ¯¨áì ¨£­®à¨àã¥âáï.
ˆáª«î祭¨¥¬ ï¥âáï ०¨¬ 320*200, ¤«ï ª®â®à®£® ¢ £« ¢­®¬ 横«¥
á¨á⥬­®£® ¯®â®ª  ¢ë¯®«­ï¥âáï ®¡­®¢«¥­¨¥ íªà ­  ¢ ᮮ⢥âá⢨¨
á ¤¢¨¦¥­¨ï¬¨ ªãàá®à  ¬ëè¨.
 
-------------------------  §à¥è¥­¨¥ íªà ­  --------------------------
 à ¬¥âàë:
* eax = 61 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = [à §à¥è¥­¨¥ ¯® ®á¨ x]*65536 + [à §à¥è¥­¨¥ ¯® ®á¨ y]
‡ ¬¥ç ­¨ï:
* Œ®¦­® ¨á¯®«ì§®¢ âì äã­ªæ¨î 14 á ãçñ⮬ ⮣®, çâ® ®­  ¢®§¢à é ¥â
à §¬¥àë ­  1 ¬¥­ìè¥. â® ¯®«­®áâìî íª¢¨¢ «¥­â­ë© ᯮᮡ.
 
------------------------ —¨á«® ¡¨â ­  ¯¨ªá¥«ì ------------------------
 à ¬¥âàë:
* eax = 61 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ç¨á«® ¡¨â ­  ¯¨ªá¥«ì (24 ¨«¨ 32)
 
------------------------ —¨á«® ¡ ©â ­  áâபã ------------------------
 à ¬¥âàë:
* eax = 61 - ­®¬¥à ä㭪樨
* ebx = 3 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ç¨á«® ¡ ©â, ª®â®à®¥ § ­¨¬ ¥â ®¤­  áâப  à §¢ñà⪨
(£®à¨§®­â «ì­ ï «¨­¨ï ­  íªà ­¥)
 
======================================================================
===== ”ã­ªæ¨ï 62, ¯®¤äã­ªæ¨ï 0 - ¯®«ãç¨âì ¢¥àá¨î PCI-¨­â¥à䥩á . =====
======================================================================
 à ¬¥âàë:
* eax = 62 - ­®¬¥à ä㭪樨
* bl = 0 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ¤®áâ㯠ª PCI § ¯à¥éñ­; ¨­ ç¥
* ah.al = ¢¥àá¨ï PCI-¨­â¥àä¥©á  (ah=¢¥àá¨ï, al=¯®¤¢¥àá¨ï)
* áâ à襥 á«®¢® eax ®¡­ã«¥­®
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ¤®«¦¥­ ¡ëâì à §à¥èñ­ ­¨§ª®ã஢­¥¢ë© ¤®áâ㯠ª PCI
¤«ï ¯à¨«®¦¥­¨© ¯®¤ä㭪樥© 12 ä㭪樨 21.
* …᫨ PCI BIOS ­¥ ¯®¤¤¥à¦¨¢ ¥âáï, â® §­ ç¥­¨¥ ax ­¥®¯à¥¤¥«¥­®.
 
======================================================================
==== ”ã­ªæ¨ï 62, ¯®¤äã­ªæ¨ï 1 - ¯®«ãç¨âì ­®¬¥à ¯®á«¥¤­¥© PCI-設ë. ===
======================================================================
 à ¬¥âàë:
* eax = 62 - ­®¬¥à ä㭪樨
* bl = 1 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ¤®áâ㯠ª PCI § ¯à¥éñ­; ¨­ ç¥
* al = ­®¬¥à ¯®á«¥¤­¥© PCI-設ë; ®á⠢訥áï ¡ ©âë eax à §àãè îâáï
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ¤®«¦¥­ ¡ëâì à §à¥èñ­ ­¨§ª®ã஢­¥¢ë© ¤®áâ㯠ª PCI
¤«ï ¯à¨«®¦¥­¨© ¯®¤ä㭪樥© 12 ä㭪樨 21.
* …᫨ PCI BIOS ­¥ ¯®¤¤¥à¦¨¢ ¥âáï, â® §­ ç¥­¨¥ al ­¥®¯à¥¤¥«¥­®.
 
======================================================================
====================== ”ã­ªæ¨ï 62, ¯®¤äã­ªæ¨ï 2 ======================
== ®«ãç¨âì ¬¥å ­¨§¬ ®¡à é¥­¨ï ª ª®­ä¨£ãà æ¨®­­®¬ã ¯à®áâà ­áâ¢ã PCI. =
======================================================================
 à ¬¥âàë:
* eax = 62 - ­®¬¥à ä㭪樨
* bl = 2 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ¤®áâ㯠ª PCI § ¯à¥éñ­; ¨­ ç¥
* al = ¬¥å ­¨§¬ (1 ¨«¨ 2); ¯à®ç¨¥ ¡ ©âë eax à §àãè îâáï
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ¤®«¦¥­ ¡ëâì à §à¥èñ­ ­¨§ª®ã஢­¥¢ë© ¤®áâ㯠ª PCI
¤«ï ¯à¨«®¦¥­¨© ¯®¤ä㭪樥© 12 ä㭪樨 21.
* Œ¥å ­¨§¬ ®¡à é¥­¨ï ¢ë¡¨à ¥âáï ¢ ᮮ⢥âá⢨¨
á å à ªâ¥à¨á⨪ ¬¨ ®¡®à㤮¢ ­¨ï.
* ®¤ä㭪樨 ç⥭¨ï ¨ § ¯¨á¨  ¢â®¬ â¨ç¥áª¨ à ¡®â îâ
á ¢ë¡à ­­ë¬ ¬¥å ­¨§¬®¬.
 
======================================================================
======== ”ã­ªæ¨ï 62, ¯®¤ä㭪樨 4,5,6 - ¯à®ç¨â âì PCI-ॣ¨áâà. =======
======================================================================
 à ¬¥âàë:
* eax = 62 - ­®¬¥à ä㭪樨
* bl = 4 - ç¨â âì ¡ ©â
* bl = 5 - ç¨â âì á«®¢®
* bl = 6 - ç¨â âì ¤¢®©­®¥ á«®¢®
* bh = ­®¬¥à PCI-設ë
* ch = dddddfff, £¤¥ ddddd = ­®¬¥à ãáâனá⢠ ­  設¥,
fff = ­®¬¥à ä㭪樨 ãáâனá⢠
* cl = ­®¬¥à ॣ¨áâà  (¤®«¦¥­ ¡ëâì çñâ­ë¬ ¤«ï bl=5,
¤¥«¨âìáï ­  4 ¤«ï bl=6)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ®è¨¡ª  (§ ¯à¥éñ­ ¤®áâ㯠ª PCI ¨«¨
­¥¯®¤¤¥à¦¨¢ ¥¬ë¥ ¯ à ¬¥âàë); ¨­ ç¥
* al/ax/eax (¢ § ¢¨á¨¬®á⨠®â § ¯à®è¥­­®£® à §¬¥à ) ᮤ¥à¦¨â ¤ ­­ë¥;
®áâ ¢è ïáï ç áâì ॣ¨áâà  eax à §àãè ¥âáï
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ¤®«¦¥­ ¡ëâì à §à¥èñ­ ­¨§ª®ã஢­¥¢ë© ¤®áâ㯠ª PCI
¤«ï ¯à¨«®¦¥­¨© ¯®¤ä㭪樥© 12 ä㭪樨 21.
* Œ¥å ­¨§¬ ¤®áâ㯠 2 ¯®¤¤¥à¦¨¢ ¥â ⮫쪮 16 ãáâனá⢠­  設¥ ¨
¨£­®à¨àã¥â ­®¬¥à ä㭪樨. ®«ãç¨âì ¬¥å ­¨§¬ ¤®áâ㯠 ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樨 2.
* ¥ª®â®àë¥ à¥£¨áâàë áâ ­¤ àâ­ë ¨ áãé¥áâ¢ãîâ ¤«ï ¢á¥å ãáâனáâ¢,
­¥ª®â®àë¥ ®¯à¥¤¥«ïîâáï ª®­ªà¥â­ë¬ ãáâனá⢮¬. ‘¯¨á®ª ¯¥à¢ëå
¢å®¤¨â, ­ ¯à¨¬¥à, ¢ ¨§¢¥áâ­ë© Interrupt List by Ralf Brown
(http://www.pobox.com/~ralf/files.html,
ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/);
ᯨ᮪ ¢â®àëå ¤®«¦¥­ ¡ëâì 㪠§ ­ ¢ ¤®ªã¬¥­â æ¨¨ ¯® ãáâனáâ¢ã.
 
======================================================================
======= ”ã­ªæ¨ï 62, ¯®¤ä㭪樨 8,9,10 - § ¯¨á âì ¢ PCI-ॣ¨áâà. ======
======================================================================
 à ¬¥âàë:
* eax = 62 - ­®¬¥à ä㭪樨
* bl = 8 - ¯¨á âì ¡ ©â
* bl = 9 - ¯¨á âì á«®¢®
* bl = 10 - ¯¨á âì ¤¢®©­®¥ á«®¢®
* bh = ­®¬¥à PCI-設ë
* ch = dddddfff, £¤¥ ddddd = ­®¬¥à ãáâனá⢠ ­  設¥,
fff = ­®¬¥à ä㭪樨 ãáâனá⢠
* cl = ­®¬¥à ॣ¨áâà  (¤®«¦¥­ ¡ëâì çñâ­ë¬ ¤«ï bl=9,
¤¥«¨âìáï ­  4 ¤«ï bl=10)
* dl/dx/edx (¢ § ¢¨á¨¬®á⨠®â § ¯à®è¥­­®£® à §¬¥à ) ᮤ¥à¦¨â
¤ ­­ë¥ ¤«ï § ¯¨á¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 - ®è¨¡ª  (§ ¯à¥éñ­ ¤®áâ㯠ª PCI ¨«¨
­¥¯®¤¤¥à¦¨¢ ¥¬ë¥ ¯ à ¬¥âàë)
* eax = 0 - ãᯥ譮
‡ ¬¥ç ­¨ï:
* à¥¤¢ à¨â¥«ì­® ¤®«¦¥­ ¡ëâì à §à¥èñ­ ­¨§ª®ã஢­¥¢ë© ¤®áâ㯠ª PCI
¤«ï ¯à¨«®¦¥­¨© ¯®¤ä㭪樥© 12 ä㭪樨 21.
* Œ¥å ­¨§¬ ¤®áâ㯠 2 ¯®¤¤¥à¦¨¢ ¥â ⮫쪮 16 ãáâனá⢠­  設¥ ¨
¨£­®à¨àã¥â ­®¬¥à ä㭪樨. ®«ãç¨âì ¬¥å ­¨§¬ ¤®áâ㯠 ¬®¦­® ¢ë§®¢®¬
¯®¤ä㭪樨 2.
* ¥ª®â®àë¥ à¥£¨áâàë áâ ­¤ àâ­ë ¨ áãé¥áâ¢ãîâ ¤«ï ¢á¥å ãáâனáâ¢,
­¥ª®â®àë¥ ®¯à¥¤¥«ïîâáï ª®­ªà¥â­ë¬ ãáâனá⢮¬. ‘¯¨á®ª ¯¥à¢ëå
¢å®¤¨â, ­ ¯à¨¬¥à, ¢ ¨§¢¥áâ­ë© Interrupt List by Ralf Brown;
ᯨ᮪ ¢â®àëå ¤®«¦¥­ ¡ëâì 㪠§ ­ ¢ ¤®ªã¬¥­â æ¨¨ ¯® ãáâனáâ¢ã.
 
======================================================================
================ ”ã­ªæ¨ï 63 - à ¡®â  á ¤®áª®© ®â« ¤ª¨. ===============
======================================================================
„®áª  ®â« ¤ª¨ ¯à¥¤áâ ¢«ï¥â ᮡ®© á¨á⥬­ë© ¡ãä¥à (­  512 ¡ ©â),
¢ ª®â®àë© «î¡ ï ¯à®£à ¬¬  ¬®¦¥â § ¯¨á âì (¢®®¡é¥ £®¢®àï, ¯à®¨§¢®«ì­ë¥)
¤ ­­ë¥ ¨ ¨§ ª®â®à®£® ¤àã£ ï ¯à®£à ¬¬  ¬®¦¥â í⨠¤ ­­ë¥ ¯à®ç¨â âì.
…áâì ᮣ« è¥­¨¥, ¢ ᮮ⢥âá⢨¨ á ª®â®àë¬ § ¯¨á뢠¥¬ë¥ ¤ ­­ë¥ -
⥪áâ®¢ë¥ áâப¨, ¨­â¥à¯à¥â¨àã¥¬ë¥ ª ª ®â« ¤®ç­ë¥ á®®¡é¥­¨ï ® 室¥
¢ë¯®«­¥­¨ï ¯à®£à ¬¬ë. Ÿ¤à® ¢ ®¯à¥¤¥«ñ­­ëå á¨âã æ¨ïå â ª¦¥ § ¯¨á뢠¥â
­  ¤®áªã ®â« ¤ª¨ ᢥ¤¥­¨ï ® ¢ë¯®«­¥­¨¨ ­¥ª®â®àëå ä㭪権;
¯® ᮣ« è¥­¨î á®®¡é¥­¨ï ï¤à  ­ ç¨­ îâáï á ¯à¥ä¨ªá  "K : ".
„«ï ¯à®á¬®âà  ¤®áª¨ ®â« ¤ª¨ ᮧ¤ ­® ¯à¨«®¦¥­¨¥ board,
ª®â®à®¥ áç¨â뢠¥â ¤ ­­ë¥ ¨§ ¡ãä¥à  ¨ ®â®¡à ¦ ¥â ¨å ¢ ᢮ñ¬ ®ª­¥. board
¯®­¨¬ ¥â ¯®á«¥¤®¢ â¥«ì­®áâì ª®¤®¢ 13,10 ª ª ¯¥à¥å®¤ ­  ­®¢ãî áâபã.
‘¨¬¢®« á ­ã«¥¢ë¬ ª®¤®¬ ¢ ª®­æ¥ áâப¨ ­¥ ®¡ï§ â¥«¥­, ­® ¨ ­¥ ¬¥è ¥â.
‚ á¢ï§¨ á ¯®ï¢«¥­¨¥¬ ®â« ¤ç¨ª  業­®áâì ¤®áª¨ ®â« ¤ª¨ ­¥áª®«ìª®
á­¨§¨« áì, ¯®áª®«ìªã ®â« ¤ç¨ª ¯®§¢®«ï¥â ¯®«­®áâìî ª®­â஫¨à®¢ âì 室
¢ë¯®«­¥­¨ï ¯à®£à ¬¬ë, ¯à¨çñ¬ ¤«ï í⮣® ­¥ âॡã¥âáï ­¨ª ª¨å ãᨫ¨©
á® áâ®à®­ë á ¬®© ¯à®£à ¬¬ë. ’¥¬ ­¥ ¬¥­¥¥ ¢® ¬­®£¨å á«ãç ïå
¤®áª  ®â« ¤ª¨ ¯à®¤®«¦ ¥â ®áâ ¢ âìáï ¯®«¥§­®©.
 
---------------------------- ‡ ¯¨áì ¡ ©â  ----------------------------
 à ¬¥âàë:
* eax = 63 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
* cl = ¡ ©â ¤ ­­ëå
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
*  ©â § ¯¨á뢠¥âáï ¢ ¡ãä¥à. „«¨­  ¡ãä¥à  - 512 ¡ ©â.
à¨ ¯¥à¥¯®«­¥­¨¨ ¡ãä¥à  ¢á¥ ¯®«ã祭­ë¥ ¤ ­­ë¥ â¥àïîâáï
¨ § ¯®«­¥­¨¥ ­ ç¨­ ¥âáï á­®¢  á ­ã«ï.
* „«ï ¢ë¢®¤  ­  ¤®áªã ®â« ¤ª¨ ¡®«¥¥ á«®¦­ëå ®¡ê¥ªâ®¢ (áâப, ç¨á¥«)
¤®áâ â®ç­® í⮩ ä㭪樨, ¢ë§ë¢ ¥¬®© ¢ 横«¥. Œ®¦­® ­¥ ¯¨á âì
¢àãç­ãî ᮮ⢥âáâ¢ãî騩 ª®¤,   ¢®á¯®«ì§®¢ âìáï ä ©«®¬ debug.inc,
¢å®¤ï騬 ¢ ¤¨áâਡã⨢.
 
---------------------------- —⥭¨¥ ¡ ©â  ----------------------------
‡ ¡¨à ¥â ¡ ©â ¨§ ¡ãä¥à .
 à ¬¥âàë:
* eax = 63 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ebx = 0 - ¡ãä¥à ¯ãáâ
* eax = ¡ ©â, ebx = 1 - ¡ ©â ãᯥ譮 ¯à®ç¨â ­
 
======================================================================
========== ”ã­ªæ¨ï 64 - ¯¥à¥à á¯à¥¤¥«¨âì ¯ ¬ïâì ¯à¨«®¦¥­¨ï. ==========
======================================================================
 à ¬¥âàë:
* eax = 64 - ­®¬¥à ä㭪樨
* ebx = 1 - ¥¤¨­á⢥­­ ï ¯®¤äã­ªæ¨ï
* ecx = ­®¢ë© à §¬¥à ¯ ¬ïâ¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ­¥¤®áâ â®ç­® ¯ ¬ïâ¨
‡ ¬¥ç ­¨ï:
*   ¤ ­­ë© ¬®¬¥­â íâ  äã­ªæ¨ï ï¥âáï ¥¤¨­á⢥­­ë¬ á।á⢮¬ ¤«ï
¤¨­ ¬¨ç¥áª®£® ¢ë¤¥«¥­¨ï/®á¢®¡®¦¤¥­¨ï ¯ ¬ï⨠¯à¨«®¦¥­¨ï.
 
======================================================================
================= ”ã­ªæ¨ï 66 - à ¡®â  á ª« ¢¨ âãன. =================
======================================================================
¥¦¨¬ ¢¢®¤  ¢«¨ï¥â ­  १ã«ìâ âë ç⥭¨ï ª« ¢¨è ä㭪樥© 2.
à¨ § £à㧪¥ ¯à®£à ¬¬ë ¤«ï ­¥ñ ãáâ ­ ¢«¨¢ ¥âáï ASCII-०¨¬ ¢¢®¤ .
 
-------- ®¤äã­ªæ¨ï 1 - ãáâ ­®¢¨âì ०¨¬ ¢¢®¤  á ª« ¢¨ âãàë. ---------
 à ¬¥âàë:
* eax = 66 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ०¨¬:
* 0 = ®¡ëç­ë© (ASCII-ᨬ¢®«ë)
* 1 = ᪠­ª®¤ë
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
 
--------- ®¤äã­ªæ¨ï 2 - ¯®«ãç¨âì ०¨¬ ¢¢®¤  á ª« ¢¨ âãàë. ----------
 à ¬¥âàë:
* eax = 66 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ⥪ã騩 ०¨¬
 
------- ®¤äã­ªæ¨ï 3 - ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è. --------
 à ¬¥âàë:
* eax = 66 - ­®¬¥à ä㭪樨
* ebx = 3 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ¡¨â®¢ ï ¬ áª :
* ¡¨â 0 (¬ áª  1): «¥¢ë© Shift ­ ¦ â
* ¡¨â 1 (¬ áª  2): ¯à ¢ë© Shift ­ ¦ â
* ¡¨â 2 (¬ áª  4): «¥¢ë© Ctrl ­ ¦ â
* ¡¨â 3 (¬ áª  8): ¯à ¢ë© Ctrl ­ ¦ â
* ¡¨â 4 (¬ áª  0x10): «¥¢ë© Alt ­ ¦ â
* ¡¨â 5 (¬ áª  0x20): ¯à ¢ë© Alt ­ ¦ â
* ¡¨â 6 (¬ áª  0x40): CapsLock ¢ª«îçñ­
* ¡¨â 7 (¬ áª  0x80): NumLock ¢ª«îçñ­
* ¡¨â 8 (¬ áª  0x100): ScrollLock ¢ª«îçñ­
* ¯à®ç¨¥ ¡¨âë á¡à®è¥­ë
 
----- ®¤äã­ªæ¨ï 4 - ãáâ ­®¢¨âì ®¡é¥á¨á⥬­ãî "£®àïçãî ª« ¢¨èã". -----
Ž ­ ¦ â¨¨ "£®àï祩 ª« ¢¨è¨" ¨§¢¥é îâáï ⮫쪮 ¯à¨«®¦¥­¨ï,
ãáâ ­®¢¨¢è¨¥ ¥ñ;  ªâ¨¢­®¥ ¯à¨«®¦¥­¨¥ (ª ª®â®à®¬ã ¯®áâ㯠¥â
¢¥áì ­®à¬ «ì­ë© ¢¢®¤) â ª¨å ª« ¢¨è ­¥ ¯®«ãç ¥â.
ˆ§¢¥é¥­¨¥ § ª«îç ¥âáï ¢ ¯®á뫪¥ ᮡëâ¨ï á ª®¤®¬ 2.
à®ç¨â âì "£®àïçãî ª« ¢¨èã" ¬®¦­® â ª ¦¥, ª ª ¨ ®¡ëç­ãî, -
ä㭪樥© 2.
 à ¬¥âàë:
* eax = 66 - ­®¬¥à ä㭪樨
* ebx = 4 - ­®¬¥à ¯®¤ä㭪樨
* cl § ¤ ñâ ᪠­ª®¤ ª« ¢¨è¨;
¨á¯®«ì§ã©â¥ cl=0 ¤«ï § ¤ ­¨ï ª®¬¡¨­ æ¨© ⨯  Ctrl+Shift
* edx = 0xXYZ § ¤ ñâ ¢®§¬®¦­ë¥ á®áâ®ï­¨ï ã¯à ¢«ïîé¨å ª« ¢¨è:
* Z (¬« ¤è¨¥ 4 ¡¨â ) § ¤ ñâ á®áâ®ï­¨¥ ª« ¢¨è LShift ¨ RShift:
* 0 = ­¨ ®¤­  ¨§ ª« ¢¨è ­¥ ¤®«¦­  ¡ëâì ­ ¦ â ;
* 1 = ஢­® ®¤­  ¨§ ª« ¢¨è ¤®«¦­  ¡ëâì ­ ¦ â ;
* 2 = ®¡¥ ª« ¢¨è¨ ¤®«¦­ë ¡ëâì ­ ¦ âë;
* 3 = ¤®«¦­  ¡ëâì ­ ¦ â  LShift, ­® ­¥ RShift;
* 4 = ¤®«¦­  ¡ëâì ­ ¦ â  RShift, ­® ­¥ LShift
* Y -  ­ «®£¨ç­® ¤«ï LCtrl ¨ RCtrl;
* X -  ­ «®£¨ç­® ¤«ï LAlt ¨ RAlt
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax=0 - ãᯥ譮
* eax=1 - ᫨誮¬ ¬­®£® "£®àïç¨å ª« ¢¨è" (¤®¯ã᪠¥âáï ¬ ªá¨¬ã¬ 256)
‡ ¬¥ç ­¨ï:
* ƒ®àïç ï ª« ¢¨è  ¬®¦¥â áà ¡ â뢠âì «¨¡® ¯à¨ ­ ¦ â¨¨,
«¨¡® ¯à¨ ®â¯ã᪠­¨¨. ‘ª ­ª®¤ ®â¯ã᪠­¨ï ª« ¢¨è¨ ­  128 ¡®«ìè¥,
祬 ᪠­ª®¤ ­ ¦ â¨ï (â.¥. ãáâ ­®¢«¥­ áâ à訩 ¡¨â).
* ¥áª®«ìª® ¯à¨«®¦¥­¨© ¬®£ãâ ãáâ ­®¢¨âì ®¤­ã ¨ âã ¦¥ ª®¬¡¨­ æ¨î;
® ­ ¦ â¨¨ â ª®© ª®¬¡¨­ æ¨¨ ¡ã¤ãâ ¨§¢¥é âìáï ¢á¥ â ª¨¥ ¯à¨«®¦¥­¨ï.
 
------ ®¤äã­ªæ¨ï 5 - 㤠«¨âì ãáâ ­®¢«¥­­ãî "£®àïçãî ª« ¢¨èã". -------
 à ¬¥âàë:
* eax = 66 - ­®¬¥à ä㭪樨
* ebx = 5 - ­®¬¥à ¯®¤ä㭪樨
* cl = ᪠­ª®¤ ª« ¢¨è¨ ¨ edx = 0xXYZ â ª¨¥ ¦¥, ª ª ¨ ¢ ¯®¤ä㭪樨 4
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ­¥â â ª®© £®àï祩 ª« ¢¨è¨
‡ ¬¥ç ­¨ï:
* à¨ § ¢¥à襭¨¨ ¯à®æ¥áá /¯®â®ª  㤠«ïîâáï ¢á¥ ãáâ ­®¢«¥­­ë¥ ¨¬
£®àï稥 ª« ¢¨è¨.
* ‚맮¢ ä㭪樨 ­¥ ¢«¨ï¥â ­  ¤à㣨¥ ¯à¨«®¦¥­¨ï.
…᫨ ¤à㣮¥ ¯à¨«®¦¥­¨¥ ®¯à¥¤¥«¨«® íâã ¦¥ ª®¬¡¨­ æ¨î,
®­® ¯®-¯à¥¦­¥¬ã ¡ã¤¥â ¯®«ãç âì 㢥¤®¬«¥­¨ï.
 
======================================================================
============ ”ã­ªæ¨ï 67 - ¨§¬¥­¨âì ¯®«®¦¥­¨¥/à §¬¥àë ®ª­ . ===========
======================================================================
 à ¬¥âàë:
* eax = 67 - ­®¬¥à ä㭪樨
* ebx = ­®¢ ï x-ª®®à¤¨­ â  ®ª­ 
* ecx = ­®¢ ï y-ª®®à¤¨­ â  ®ª­ 
* edx = ­®¢ë© x-à §¬¥à ®ª­ 
* esi = ­®¢ë© y-à §¬¥à ®ª­ 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ‡­ ç¥­¨¥ -1 ¤«ï ¯ à ¬¥âà  ®§­ ç ¥â "­¥ ¨§¬¥­ïâì"; ­ ¯à¨¬¥à, ¤«ï
¯¥à¥¬¥é¥­¨ï ®ª­  ¡¥§ ¨§¬¥­¥­¨ï à §¬¥à®¢ ¬®¦­® 㪠§ âì edx=esi=-1.
* à¥¤¢ à¨â¥«ì­® ®ª­® ¤®«¦­® ¡ëâì ®¯à¥¤¥«¥­® ä㭪樥© 0.
Ž­  ¦¥ § ¤ ñâ ­ ç «ì­ë¥ ª®®à¤¨­ âë ¨ à §¬¥àë ®ª­ .
*  §¬¥àë ®ª­  ¯®­¨¬ îâáï ¢ á¬ëá«¥ ä㭪樨 0, â.¥.
­  ®¤¨­ ¯¨ªá¥«ì ¬¥­ìè¥, 祬 ॠ«ì­ë¥ à §¬¥àë.
* ‚맮¢ ä㭪樨 ¤«ï ¬ ªá¨¬¨§¨à®¢ ­­ëå ®ª®­ ¯à®áâ® ¨£­®à¨àã¥âáï.
* „«ï ®ª®­ ᮮ⢥âáâ¢ãîé¨å á⨫¥© ¯®«®¦¥­¨¥ ¨/¨«¨ à §¬¥àë ¬®£ãâ ¡ëâì
¨§¬¥­¥­ë ¯®«ì§®¢ â¥«¥¬; ⥪ã騥 ¯®«®¦¥­¨¥ ¨ à §¬¥àë ¬®£ãâ ¡ëâì
¯®«ãç¥­ë ¢ë§®¢®¬ ä㭪樨 9.
* ”ã­ªæ¨ï ¯®áë« ¥â ®ª­ã ᮡë⨥ ¯¥à¥à¨á®¢ª¨ (á ª®¤®¬ 1).
 
======================================================================
=== ”ã­ªæ¨ï 68, ¯®¤äã­ªæ¨ï 0 - ¯®«ãç¨âì áçñâ稪 ¯¥à¥ª«î祭¨© § ¤ ç. ==
======================================================================
 à ¬¥âàë:
* eax = 68 - ­®¬¥à ä㭪樨
* ebx = 0 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = ç¨á«® ¯¥à¥ª«î祭¨© § ¤ ç á ¬®¬¥­â  § £à㧪¨ á¨á⥬ë
(¯® ¬®¤ã«î 2^32)
 
======================================================================
====================== ”ã­ªæ¨ï 68, ¯®¤äã­ªæ¨ï 1 ======================
============ ¥à¥ª«îç¨âìáï ­  á«¥¤ãî騩 ¯®â®ª ¢ë¯®«­¥­¨ï. ============
======================================================================
”ã­ªæ¨ï § ¢¥àè ¥â ⥪ã騩 ª¢ ­â ¢à¥¬¥­¨, ¢ë¤¥«¥­­ë© ¯®â®ªã,
¨ ¯¥à¥ª«îç ¥âáï ­  á«¥¤ãî騩.
(Š ª®© ¯®â®ª ª ª®£® ¯à®æ¥áá  ¡ã¤¥â á«¥¤ãî騬, ¯à¥¤áª § âì ­¥«ì§ï).
®§¤­¥¥, ª®£¤  ¤® ⥪ã饣® ¯®â®ª  ¤®©¤ñâ ®ç¥à¥¤ì,
¢ë¯®«­¥­¨¥ ¢®§®¡­®¢¨âáï.
 à ¬¥âàë:
* eax = 68 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
 
======================================================================
=============== ”ã­ªæ¨ï 68, ¯®¤äã­ªæ¨ï 2 - ªíè + rdpmc. ==============
======================================================================
 à ¬¥âàë:
* eax = 68 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = âॡ㥬®¥ ¤¥©á⢨¥:
* ecx = 0 - à §à¥è¨âì ¢ë¯®«­¥­¨¥ ¨­áâàãªæ¨¨ rdpmc
(ReaD Performance-Monitoring Counters)
* ecx = 1 - 㧭 âì, ¢ª«îçñ­/¢ëª«î祭 ªíè
* ecx = 2 - ¢ª«îç¨âì ªíè
* ecx = 3 - ¢ëª«îç¨âì ªíè
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ¤«ï ecx=0:
* eax = §­ ç¥­¨¥ cr4
* ¤«ï ecx=1:
* eax = (cr0 and 0x60000000):
* eax = 0 - ªíè ¢ª«îçñ­
* eax <> 0 - ªíè ¢ëª«î祭
* ¤«ï ecx=2 ¨ ecx=3:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
 
======================================================================
========== ”ã­ªæ¨ï 68, ¯®¤äã­ªæ¨ï 3 - ¯à®ç¨â âì MSR-ॣ¨áâà. =========
======================================================================
MSR = Model Specific Register; ¯®«­ë© ᯨ᮪ MSR-ॣ¨áâ஢ ¯à®æ¥áá®à 
ᮤ¥à¦¨âáï ¢ ¤®ªã¬¥­â æ¨¨ ¯® ¯à®æ¥áá®àã (­ ¯à¨¬¥à, IA-32 Intel
Architecture Software Developer's Manual, Volume 3, Appendix B);
ª ¦¤®¥ ᥬ¥©á⢮ ¯à®æ¥áá®à®¢ ¨¬¥¥â ᢮ñ ¯®¤¬­®¦¥á⢮ MSR-ॣ¨áâ஢.
 à ¬¥âàë:
* eax = 68 - ­®¬¥à ä㭪樨
* ebx = 3 - ­®¬¥à ¯®¤ä㭪樨
* ecx ¨£­®à¨àã¥âáï
* edx =  ¤à¥á MSR
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ebx:eax = áâ à訩:¬« ¤è¨© dword १ã«ìâ â 
‡ ¬¥ç ­¨ï:
* “ª § ­¨¥ ¢ ecx ­¥áãé¥áâ¢ãî饣® ¨«¨ ­¥à¥ «¨§®¢ ­­®£® ¤«ï ¤ ­­®£®
¯à®æ¥áá®à  MSR ¯®¢«¥çñ⠨᪫î祭¨¥ ¢ ï¤à¥, ª®â®à®¥ ¯à¨¡ìñâ ¯®â®ª.
* à¥¤¢ à¨â¥«ì­® á«¥¤ã¥â ®¯à¥¤¥«¨âì, ¯®¤¤¥à¦¨¢ îâáï «¨ MSR ¢ 楫®¬,
ª®¬ ­¤®© cpuid. ˆ­ ç¥ ¢®§­¨ª­¥â 㦥 ¤à㣮¥ ¨áª«î祭¨¥ ¢ ï¤à¥,
ª®â®à®¥ ¢áñ à ¢­® ¯à¨¡ìñâ ¯®â®ª.
 
======================================================================
========= ”ã­ªæ¨ï 68, ¯®¤äã­ªæ¨ï 4 - § ¯¨á âì ¢ MSR-ॣ¨áâà. =========
======================================================================
MSR = Model Specific Register; ¯®«­ë© ᯨ᮪ MSR-ॣ¨áâ஢ ¯à®æ¥áá®à 
ᮤ¥à¦¨âáï ¢ ¤®ªã¬¥­â æ¨¨ ¯® ¯à®æ¥áá®àã (­ ¯à¨¬¥à, IA-32 Intel
Architecture Software Developer's Manual, Volume 3, Appendix B);
ª ¦¤®¥ ᥬ¥©á⢮ ¯à®æ¥áá®à®¢ ¨¬¥¥â ᢮ñ ¯®¤¬­®¦¥á⢮ MSR-ॣ¨áâ஢.
 à ¬¥âàë:
* eax = 68 - ­®¬¥à ä㭪樨
* ebx = 4 - ­®¬¥à ¯®¤ä㭪樨
* ecx ¨£­®à¨àã¥âáï
* edx =  ¤à¥á MSR
* esi:edi = áâ à訩:¬« ¤è¨© dword
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* ebx:eax = ª®¯¨ï esi:edi
‡ ¬¥ç ­¨ï:
* “ª § ­¨¥ ¢ ecx ­¥áãé¥áâ¢ãî饣® ¨«¨ ­¥à¥ «¨§®¢ ­­®£® ¤«ï ¤ ­­®£®
¯à®æ¥áá®à  MSR ¯®¢«¥çñ⠨᪫î祭¨¥ ¢ ï¤à¥, ª®â®à®¥ ¯à¨¡ìñâ ¯®â®ª.
* à¥¤¢ à¨â¥«ì­® á«¥¤ã¥â ®¯à¥¤¥«¨âì, ¯®¤¤¥à¦¨¢ îâáï «¨ MSR ¢ 楫®¬,
ª®¬ ­¤®© cpuid. ˆ­ ç¥ ¢®§­¨ª­¥â 㦥 ¤à㣮¥ ¨áª«î祭¨¥ ¢ ï¤à¥,
ª®â®à®¥ ¢áñ à ¢­® ¯à¨¡ìñâ ¯®â®ª.
 
======================================================================
======= ”ã­ªæ¨ï 68, ¯®¤äã­ªæ¨ï 5 - ¢ë¤¥«¨âì 䨧¨ç¥áªãî ¯ ¬ïâì. =======
======================================================================
 à ¬¥âàë:
* eax = 68 - ­®¬¥à ä㭪樨
* ebx = 5 - ­®¬¥à ¯®¤ä㭪樨
* ecx = à §¬¥à (¢ ¡ ©â å)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 䨧¨ç¥áª¨©  ¤à¥á ¢ë¤¥«¥­­®© ¯ ¬ïâ¨
‡ ¬¥ç ­¨ï:
* Ž¡ëç­ë¥ ¯à¨«®¦¥­¨ï ­¥ ¤®«¦­ë ¨á¯®«ì§®¢ âì íâã äã­ªæ¨î, ®­ 
¯à¥¤­ §­ ç¥­  ¤«ï á«ãç ï, ª®£¤  ¯à¨ à ¡®â¥ á ª ª¨¬-«¨¡®
ãáâனá⢮¬ âॡã¥âáï à §¬¥áâ¨âì ¤ ­­ë¥ ¯® ¨§¢¥áâ­®¬ã 䨧¨ç¥áª®¬ã
 ¤à¥áã. (‚ áãé­®áâ¨, íâ  äã­ªæ¨ï ࠧࠡ â뢠« áì ¤«ï AC97WAV.)
* —¨á«® ¡«®ª®¢ 䨧¨ç¥áª®© ¯ ¬ï⨠®£à ­¨ç¥­® (ª®­á⠭⮩ 24,
¯à¨çñ¬ íâ  ª®­áâ ­â  ¢ª«î砥⠨ ­¥áª®«ìª® ¡«®ª®¢ ¯ ¬ïâ¨
¤«ï ­ ¤®¡­®á⥩ ï¤à ).
* Žá¢®¡®¤¨âì ¢ë¤¥«¥­­ãî â ª¨¬ ®¡à §®¬ ¯ ¬ïâì ¬®¦­®
¯®¤ä㭪樥© 6, ª®¯¨à®¢ ­¨¥¬ ¤ ­­ëå â㤠/®¡à â­®
§ ­¨¬ îâáï ¯®¤ä㭪樨 7 ¨ 8.
 
======================================================================
====== ”ã­ªæ¨ï 68, ¯®¤äã­ªæ¨ï 6 - ®á¢®¡®¤¨âì 䨧¨ç¥áªãî ¯ ¬ïâì. ======
======================================================================
 à ¬¥âàë:
* eax = 68 - ­®¬¥à ä㭪樨
* ebx = 6 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 䨧¨ç¥áª¨©  ¤à¥á ¯ ¬ïâ¨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* Ž¡ëç­ë¥ ¯à¨«®¦¥­¨ï ­¥ ¤®«¦­ë ¨á¯®«ì§®¢ âì íâã äã­ªæ¨î, ®­ 
¯à¥¤­ §­ ç¥­  ¤«ï á«ãç ï, ª®£¤  ¯à¨ à ¡®â¥ á ª ª¨¬-«¨¡®
ãáâனá⢮¬ âॡã¥âáï à §¬¥áâ¨âì ¤ ­­ë¥ ¯® ¨§¢¥áâ­®¬ã 䨧¨ç¥áª®¬ã
 ¤à¥áã. (‚ áãé­®áâ¨, íâ  äã­ªæ¨ï ࠧࠡ â뢠« áì ¤«ï AC97WAV.)
*  ¬ïâì ¤®«¦­  ¡ëâì à ­¥¥ ¢ë¤¥«¥­  ¯®¤ä㭪樥© 5.
 
======================================================================
=== ”ã­ªæ¨ï 68, ¯®¤äã­ªæ¨ï 7 - § ¯¨á âì ¤ ­­ë¥ ¢ 䨧¨ç¥áªãî ¯ ¬ïâì. ==
======================================================================
 à ¬¥âàë:
* eax = 68 - ­®¬¥à ä㭪樨
* ebx = 7 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 䨧¨ç¥áª¨©  ¤à¥á
* edx = 㪠§ â¥«ì ­  ¤ ­­ë¥ (¢ ¯à¨«®¦¥­¨¨)
* esi = à §¬¥à ¤ ­­ëå (¢ ¡ ©â å)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* Ž¡ëç­ë¥ ¯à¨«®¦¥­¨ï ­¥ ¤®«¦­ë ¨á¯®«ì§®¢ âì íâã äã­ªæ¨î, ®­ 
¯à¥¤­ §­ ç¥­  ¤«ï á«ãç ï, ª®£¤  ¯à¨ à ¡®â¥ á ª ª¨¬-«¨¡®
ãáâனá⢮¬ âॡã¥âáï à §¬¥áâ¨âì ¤ ­­ë¥ ¯® ¨§¢¥áâ­®¬ã 䨧¨ç¥áª®¬ã
 ¤à¥áã. (‚ áãé­®áâ¨, íâ  äã­ªæ¨ï ࠧࠡ â뢠« áì ¤«ï AC97WAV.)
* „¨ ¯ §®­ 䨧¨ç¥áª¨å  ¤à¥á®¢ ¤®«¦¥­ «¥¦ âì ¢­ãâਠ࠭¥¥ ¢ë¤¥«¥­­®£®
¯®¤ä㭪樥© 5 ¡«®ª  䨧¨ç¥áª®© ¯ ¬ïâ¨.
* à®¢¥à®ª ª®à४⭮á⨠­¥ ¯à®¨§¢®¤¨âáï.
 
======================================================================
== ”ã­ªæ¨ï 68, ¯®¤äã­ªæ¨ï 8 - ¯à®ç¨â âì ¤ ­­ë¥ ¨§ 䨧¨ç¥áª®© ¯ ¬ïâ¨. =
======================================================================
 à ¬¥âàë:
* eax = 68 - ­®¬¥à ä㭪樨
* ebx = 8 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 䨧¨ç¥áª¨©  ¤à¥á
* edx = 㪠§ â¥«ì ­  ¡ãä¥à ¤«ï ¤ ­­ëå (¢ ¯à¨«®¦¥­¨¨)
* esi = à §¬¥à ¤ ­­ëå (¢ ¡ ©â å)
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* Ž¡ëç­ë¥ ¯à¨«®¦¥­¨ï ­¥ ¤®«¦­ë ¨á¯®«ì§®¢ âì íâã äã­ªæ¨î, ®­ 
¯à¥¤­ §­ ç¥­  ¤«ï á«ãç ï, ª®£¤  ¯à¨ à ¡®â¥ á ª ª¨¬-«¨¡®
ãáâனá⢮¬ âॡã¥âáï à §¬¥áâ¨âì ¤ ­­ë¥ ¯® ¨§¢¥áâ­®¬ã 䨧¨ç¥áª®¬ã
 ¤à¥áã. (‚ áãé­®áâ¨, íâ  äã­ªæ¨ï ࠧࠡ â뢠« áì ¤«ï AC97WAV.)
* „¨ ¯ §®­ 䨧¨ç¥áª¨å  ¤à¥á®¢ ¤®«¦¥­ «¥¦ âì ¢­ãâਠ࠭¥¥ ¢ë¤¥«¥­­®£®
¯®¤ä㭪樥© 5 ¡«®ª  䨧¨ç¥áª®© ¯ ¬ïâ¨.
* à®¢¥à®ª ª®à४⭮á⨠­¥ ¯à®¨§¢®¤¨âáï.
 
======================================================================
======================== ”ã­ªæ¨ï 69 - ®â« ¤ª . =======================
======================================================================
à®æ¥áá ¬®¦¥â § £à㧨âì ¤à㣮© ¯à®æ¥áá ª ª ®â« ¦¨¢ ¥¬ë© ãáâ ­®¢ª®©
ᮮ⢥âáâ¢ãî饣® ¡¨â  ¯à¨ ¢ë§®¢¥ ¯®¤ä㭪樨 16 ä㭪樨 58
¨«¨ ¯®¤ä㭪樨 7 ä㭪樨 70.
“ ¯à®æ¥áá  ¬®¦¥â ¡ëâì ⮫쪮 ®¤¨­ ®â« ¤ç¨ª; ®¤¨­ ¯à®æ¥áá ¬®¦¥â
®â« ¦¨¢ âì ­¥áª®«ìª® à §­ëå. ‘¨á⥬  㢥¤®¬«ï¥â ®â« ¤ç¨ª ® ᮡëâ¨ïå,
¯à®¨á室ïé¨å á ®â« ¦¨¢ ¥¬ë¬ ¯à®æ¥áᮬ. ‘®®¡é¥­¨ï § ¯¨á뢠îâáï ¢ ¡ãä¥à,
®¯à¥¤¥«ñ­­ë© ¯®¤ä㭪樥© 0.
”®à¬ â á®®¡é¥­¨ï:
* +0: dword: ª®¤ á®®¡é¥­¨ï
* +4: dword: PID ®â« ¦¨¢ ¥¬®£® ¯à®æ¥áá 
* +8: ¬®£ãâ ¯à¨áãâá⢮¢ âì ¤®¯®«­¨â¥«ì­ë¥ ¤ ­­ë¥,
®¯à¥¤¥«ï¥¬ë¥ ª®¤®¬ á®®¡é¥­¨ï
Š®¤ë á®®¡é¥­¨©:
* 1 = ¨áª«î祭¨¥
* ¤®¯®«­¨â¥«ì­® ¯¥à¥¤ ñâáï dword-­®¬¥à ¨áª«î祭¨ï
* ¯à®æ¥áá ¯à¨®áâ ­®¢«¥­
* 2 = ¯à®æ¥áá § ¢¥à訫áï
* ¯à¨å®¤¨â ¯à¨ «î¡®¬ § ¢¥à襭¨¨: ª ª ç¥à¥§ á¨á⥬­ãî äã­ªæ¨î -1,
â ª ¨ ¯à¨ "㡨©á⢥" «î¡ë¬ ¤à㣨¬ ¯à®æ¥áᮬ
(¢ ⮬ ç¨á«¥ á ¬¨¬ ®â« ¤ç¨ª®¬)
* 3 = ®â« ¤®ç­®¥ ¨áª«î祭¨¥ int 1 = #DB
* ¤®¯®«­¨â¥«ì­® ¯¥à¥¤ ñâáï dword-®¡à § ॣ¨áâà  DR6:
* ¡¨âë 0-3: ¢ë¯®«­¥­® ãá«®¢¨¥ ᮮ⢥âáâ¢ãî饩 â®çª¨ ®áâ ­®¢ 
(ãáâ ­®¢«¥­­®© ¯®¤ä㭪樥© 9)
* ¡¨â 14: ¨áª«î祭¨¥ ¯à®¨§®è«® ¨§-§  ०¨¬ 
¯®è £®¢®© âà áá¨à®¢ª¨ (ãáâ ­®¢«¥­ ä« £ TF)
* ¯à®æ¥áá ¯à¨®áâ ­®¢«¥­
à¨ § ¢¥à襭¨¨ ®â« ¤ç¨ª  ¯à¨¡¨¢ îâáï ¢á¥ ®â« ¦¨¢ ¥¬ë¥ ¯à®æ¥ááë.
…᫨ ®â« ¤ç¨ª í⮣® ­¥ å®ç¥â, ®­ ¤®«¦¥­ ¯à¥¤¢ à¨â¥«ì­® ®âª«îç¨âìáï
¯®¤ä㭪樥© 3.
 
‚ᥠ¯®¤ä㭪樨 ¯à¨¬¥­¨¬ë ⮫쪮 ª ¯à®æ¥áá ¬/¯®â®ª ¬, § ¯ã饭­ë¬
¨§ ⥪ã饣® ä㭪樥© 58 ¨«¨ 70 á ãáâ ­®¢«¥­­ë¬ ä« £®¬ ®â« ¤ª¨.
Žâ« ¤ª  ¬­®£®¯®â®ç­ëå ¯à®£à ¬¬ ¯®ª  ­¥ ¯®¤¤¥à¦¨¢ ¥âáï.
®«­ë© ᯨ᮪ ¯®¤ä㭪権:
* ¯®¤äã­ªæ¨ï 0 - ®¯à¥¤¥«¨âì ®¡« áâì ¤ ­­ëå ¤«ï ®â« ¤®ç­ëå á®®¡é¥­¨©
* ¯®¤äã­ªæ¨ï 1 - ¯®«ãç¨âì á®áâ®ï­¨¥ ॣ¨áâ஢ ®â« ¦¨¢ ¥¬®£® ¯®â®ª 
* ¯®¤äã­ªæ¨ï 2 - ãáâ ­®¢¨âì á®áâ®ï­¨¥ ॣ¨áâ஢ ®â« ¦¨¢ ¥¬®£® ¯®â®ª 
* ¯®¤äã­ªæ¨ï 3 - ®âª«îç¨âìáï ®â ®â« ¦¨¢ ¥¬®£® ¯à®æ¥áá 
* ¯®¤äã­ªæ¨ï 4 - ¯à¨®áâ ­®¢¨âì ®â« ¦¨¢ ¥¬ë© ¯®â®ª
* ¯®¤äã­ªæ¨ï 5 - ¢®§®¡­®¢¨âì ¢ë¯®«­¥­¨¥ ®â« ¦¨¢ ¥¬®£® ¯®â®ª 
* ¯®¤äã­ªæ¨ï 6 - ¯à®ç¨â âì ¨§ ¯ ¬ï⨠®â« ¦¨¢ ¥¬®£® ¯à®æ¥áá 
* ¯®¤äã­ªæ¨ï 7 - § ¯¨á âì ¢ ¯ ¬ïâì ®â« ¦¨¢ ¥¬®£® ¯à®æ¥áá 
* ¯®¤äã­ªæ¨ï 8 - § ¢¥àè¨âì ®â« ¦¨¢ ¥¬ë© ¯®â®ª
* ¯®¤äã­ªæ¨ï 9 - ãáâ ­®¢¨âì/á­ïâì  ¯¯ à â­ãî â®çªã ®áâ ­®¢ 
 
======================================================================
====================== ”ã­ªæ¨ï 69, ¯®¤äã­ªæ¨ï 0 ======================
========= Ž¯à¥¤¥«¨âì ®¡« áâì ¤ ­­ëå ¤«ï ®â« ¤®ç­ëå á®®¡é¥­¨©. ========
======================================================================
 à ¬¥âàë:
* eax = 69 - ­®¬¥à ä㭪樨
* ebx = 0 - ­®¬¥à ¯®¤ä㭪樨
* ecx = 㪠§ â¥«ì
”®à¬ â ®¡« á⨠¤ ­­ëå:
* +0: dword: N = à §¬¥à ¡ãä¥à  (­¥ áç¨â ï í⮣® § £®«®¢ª )
* +4: dword: § ­ïâ® ¢ ¡ãä¥à¥
* +8: N*byte: ¡ãä¥à
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* …᫨ ¯®«¥ à §¬¥à  ®âà¨æ â¥«ì­®, ¡ãä¥à áç¨â ¥âáï § ¡«®ª¨à®¢ ­­ë¬
¨ ¯à¨ ¯®áâ㯫¥­¨¨ ­®¢®£® á®®¡é¥­¨ï á¨á⥬  ¡ã¤¥â ¦¤ âì.
„«ï ᨭåà®­¨§ æ¨¨ ®¡à ¬«ï©â¥ ¢áî à ¡®âã á ¡ãä¥à®¬ ®¯¥à æ¨ï¬¨
¡«®ª¨à®¢ª¨/à §¡«®ª¨à®¢ª¨
neg [bufsize]
* „ ­­ë¥ ¢ ¡ãä¥à¥ âà ªâãîâáï ª ª ¬ áᨢ í«¥¬¥­â®¢ ¯¥à¥¬¥­­®© ¤«¨­ë -
á®®¡é¥­¨©. ”®à¬ â á®®¡é¥­¨ï 㪠§ ­ ¢ ®¡é¥¬ ®¯¨á ­¨¨.
 
======================================================================
====================== ”ã­ªæ¨ï 69, ¯®¤äã­ªæ¨ï 1 ======================
========= ®«ãç¨âì á®áâ®ï­¨¥ ॣ¨áâ஢ ®â« ¦¨¢ ¥¬®£® ¯®â®ª . =========
======================================================================
 à ¬¥âàë:
* eax = 69 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¨¤¥­â¨ä¨ª â®à ¯®â®ª 
* edx = ¤«¨­  áâàãªâãàë ª®­â¥ªáâ , ¤®«¦­® ¡ëâì 0x28=40 ¡ ©â
* esi = 㪠§ â¥«ì ­  áâàãªâãàã ª®­â¥ªáâ 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
”®à¬ â áâàãªâãàë ª®­â¥ªáâ : (FPU ¯®ª  ­¥ ¯®¤¤¥à¦¨¢ ¥âáï)
* +0: dword: eip
* +4: dword: eflags
* +8: dword: eax
* +12 = +0xC: dword: ecx
* +16 = +0x10: dword: edx
* +20 = +0x14: dword: ebx
* +24 = +0x18: dword: esp
* +28 = +0x1C: dword: ebp
* +32 = +0x20: dword: esi
* +36 = +0x24: dword: edi
‡ ¬¥ç ­¨ï:
* …᫨ ¯®â®ª ¢ë¯®«­ï¥â ª®¤ 0-ª®«ìæ , ¢®§¢à é ¥âáï
á®áâ®ï­¨¥ ॣ¨áâ஢ 3-ª®«ìæ .
* à®æ¥áá ¤®«¦¥­ ¡ëâì § £à㦥­ ¤«ï ®â« ¤ª¨ (ª ª 㪠§ ­® ¢
®¡é¥¬ ®¯¨á ­¨¨).
 
======================================================================
====================== ”ã­ªæ¨ï 69, ¯®¤äã­ªæ¨ï 2 ======================
======== “áâ ­®¢¨âì á®áâ®ï­¨¥ ॣ¨áâ஢ ®â« ¦¨¢ ¥¬®£® ¯®â®ª . ========
======================================================================
 à ¬¥âàë:
* eax = 69 - ­®¬¥à ä㭪樨
* ebx = 2 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¨¤¥­â¨ä¨ª â®à ¯®â®ª 
* edx = ¤«¨­  áâàãªâãàë ª®­â¥ªáâ , ¤®«¦­® ¡ëâì 0x28=40 ¡ ©â
* esi = 㪠§ â¥«ì ­  áâàãªâãàã ª®­â¥ªáâ 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
”®à¬ â áâàãªâãàë ª®­â¥ªáâ  ãª § ­ ¢ ®¯¨á ­¨¨ ¯®¤ä㭪樨 1.
‡ ¬¥ç ­¨ï:
* …᫨ ¯®â®ª ¢ë¯®«­ï¥â ª®¤ 0-ª®«ìæ , ãáâ ­ ¢«¨¢ ¥âáï
á®áâ®ï­¨¥ ॣ¨áâ஢ 3-ª®«ìæ .
* à®æ¥áá ¤®«¦¥­ ¡ëâì § £à㦥­ ¤«ï ®â« ¤ª¨ (ª ª 㪠§ ­® ¢
®¡é¥¬ ®¯¨á ­¨¨).
 
======================================================================
== ”ã­ªæ¨ï 69, ¯®¤äã­ªæ¨ï 3 - ®âª«îç¨âìáï ®â ®â« ¦¨¢ ¥¬®£® ¯à®æ¥áá . =
======================================================================
 à ¬¥âàë:
* eax = 69 - ­®¬¥à ä㭪樨
* ebx = 3 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¨¤¥­â¨ä¨ª â®à
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* …᫨ ¯à®æ¥áá ¡ë« ¯à¨®áâ ­®¢«¥­, ®­ ¢®§®¡­®¢«ï¥â ¢ë¯®«­¥­¨¥.
 
======================================================================
==== ”ã­ªæ¨ï 69, ¯®¤äã­ªæ¨ï 4 - ¯à¨®áâ ­®¢¨âì ®â« ¦¨¢ ¥¬ë© ¯®â®ª. ====
======================================================================
 à ¬¥âàë:
* eax = 69 - ­®¬¥à ¯à®æ¥áá 
* ebx = 4 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¨¤¥­â¨ä¨ª â®à
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* à®æ¥áá ¤®«¦¥­ ¡ëâì § £à㦥­ ¤«ï ®â« ¤ª¨ (ª ª 㪠§ ­® ¢
®¡é¥¬ ®¯¨á ­¨¨).
 
======================================================================
====================== ”ã­ªæ¨ï 69, ¯®¤äã­ªæ¨ï 5 ======================
============ ‚®§®¡­®¢¨âì ¢ë¯®«­¥­¨¥ ®â« ¦¨¢ ¥¬®£® ¯®â®ª . ============
======================================================================
 à ¬¥âàë:
* eax = 69 - ­®¬¥à ä㭪樨
* ebx = 5 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¨¤¥­â¨ä¨ª â®à
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* à®æ¥áá ¤®«¦¥­ ¡ëâì § £à㦥­ ¤«ï ®â« ¤ª¨ (ª ª 㪠§ ­® ¢
®¡é¥¬ ®¯¨á ­¨¨).
 
======================================================================
====================== ”ã­ªæ¨ï 69, ¯®¤äã­ªæ¨ï 6 ======================
============= à®ç¨â âì ¨§ ¯ ¬ï⨠®â« ¦¨¢ ¥¬®£® ¯à®æ¥áá . ============
======================================================================
 à ¬¥âàë:
* eax = 69 - ­®¬¥à ä㭪樨
* ebx = 6 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¨¤¥­â¨ä¨ª â®à
* edx = ᪮«ìª® ¡ ©â ç¨â âì
* esi =  ¤à¥á ¯ ¬ï⨠®â« ¦¨¢ ¥¬®£® ¯à®æ¥áá 
* edi = 㪠§ â¥«ì ­  ¡ãä¥à ¤«ï ¤ ­­ëå
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 ¯à¨ ®è¨¡ª¥ (­¥¢¥à­ë© PID ¨«¨ ¡ãä¥à)
* ¨­ ç¥ eax = ç¨á«® ¯à®ç¨â ­­ëå ¡ ©â (¢®§¬®¦­®, 0,
¥á«¨ ¢ esi ᫨誮¬ ¡®«ì讥 §­ ç¥­¨¥)
‡ ¬¥ç ­¨ï:
* à®æ¥áá ¤®«¦¥­ ¡ëâì § £à㦥­ ¤«ï ®â« ¤ª¨ (ª ª 㪠§ ­® ¢
®¡é¥¬ ®¯¨á ­¨¨).
 
======================================================================
”ã­ªæ¨ï 69, ¯®¤äã­ªæ¨ï 7 - § ¯¨á âì ¢ ¯ ¬ïâì ®â« ¦¨¢ ¥¬®£® ¯à®æ¥áá .
======================================================================
 à ¬¥âàë:
* eax = 69 - ­®¬¥à ä㭪樨
* ebx = 7 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¨¤¥­â¨ä¨ª â®à
* edx = ᪮«ìª® ¡ ©â ¯¨á âì
* esi =  ¤à¥á ¯ ¬ï⨠¢ ®â« ¦¨¢ ¥¬®¬ ¯à®æ¥áá¥
* edi = 㪠§ â¥«ì ­  ¤ ­­ë¥
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = -1 ¯à¨ ®è¨¡ª¥ (­¥¢¥à­ë© PID ¨«¨ ¡ãä¥à)
* ¨­ ç¥ eax = ç¨á«® § ¯¨á ­­ëå ¡ ©â (¢®§¬®¦­®, 0,
¥á«¨ ¢ esi ᫨誮¬ ¡®«ì讥 §­ ç¥­¨¥)
‡ ¬¥ç ­¨ï:
* à®æ¥áá ¤®«¦¥­ ¡ëâì § £à㦥­ ¤«ï ®â« ¤ª¨ (ª ª 㪠§ ­® ¢
®¡é¥¬ ®¯¨á ­¨¨).
 
======================================================================
====== ”ã­ªæ¨ï 69, ¯®¤äã­ªæ¨ï 8 - § ¢¥àè¨âì ®â« ¦¨¢ ¥¬ë© ¯®â®ª. ======
======================================================================
 à ¬¥âàë:
* eax = 69 - ­®¬¥à ä㭪樨
* ebx = 8 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¨¤¥­â¨ä¨ª â®à
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* à®æ¥áá ¤®«¦¥­ ¡ëâì § £à㦥­ ¤«ï ®â« ¤ª¨ (ª ª 㪠§ ­® ¢
®¡é¥¬ ®¯¨á ­¨¨).
* ”ã­ªæ¨ï  ­ «®£¨ç­  ¯®¤ä㭪樨 2 ä㭪樨 18 á ¤¢ã¬ï ®â«¨ç¨ï¬¨:
âॡã¥âáï ¢ë¯®«­¥­¨¥ ¯¥à¢®£® § ¬¥ç ­¨ï ¨ ¯à¨­¨¬ ¥âáï PID,
  ­¥ ­®¬¥à á«®â .
 
======================================================================
====================== ”ã­ªæ¨ï 69, ¯®¤äã­ªæ¨ï 9 ======================
============= “áâ ­®¢¨âì/á­ïâì  ¯¯ à â­ãî â®çªã ®áâ ­®¢ . ============
======================================================================
 à ¬¥âàë:
* eax = 69 - ­®¬¥à ä㭪樨
* ebx = 9 - ­®¬¥à ¯®¤ä㭪樨
* ecx = ¨¤¥­â¨ä¨ª â®à ¯®â®ª 
* dl = ¨­¤¥ªá â®çª¨ ®áâ ­®¢ , ®â 0 ¤® 3 ¢ª«îç¨â¥«ì­®
* dh = ä« £¨:
* ¥á«¨ áâ à訩 ¡¨â á¡à®è¥­ - ãáâ ­®¢¨âì â®çªã ®áâ ­®¢ :
* ¡¨âë 0-1 - ãá«®¢¨¥:
* 00 = â®çª  ®áâ ­®¢  ­  ¢ë¯®«­¥­¨¥
* 01 = â®çª  ®áâ ­®¢  ­  § ¯¨áì
* 11 = â®çª  ®áâ ­®¢  ­  ç⥭¨¥/§ ¯¨áì
* ¡¨âë 2-3 - ¤«¨­ ; ¤«ï â®ç¥ª ®áâ ­®¢  ­  ¨á¯®«­¥­¨¥ ¤®«¦­® ¡ëâì
00, ¢ ¯à®â¨¢­®¬ á«ãç ¥ ®¤­® ¨§
* 00 = ¡ ©â
* 01 = á«®¢®
* 11 = ¤¢®©­®¥ á«®¢®
* esi =  ¤à¥á â®çª¨ ®áâ ­®¢ ; ¤®«¦¥­ ¡ëâì ¢ë஢­¥­
ᮮ⢥âá⢥­­® ¤«¨­¥ (â.¥. ¤®«¦¥­ ¡ëâì çñâ­ë¬ ¤«ï
â®ç¥ª ®áâ ­®¢  ­  á«®¢®, ªà â¥­ 4 ¤«ï ¤¢®©­®£® á«®¢ )
* ¥á«¨ áâ à訩 ¡¨â ãáâ ­®¢«¥­ - á¡à®á¨âì â®çªã ®áâ ­®¢ 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮
* eax = 1 - ®è¨¡ª  ¢® ¢å®¤­ëå ¤ ­­ëå
* eax = 2 - (§ à¥§¥à¢¨à®¢ ­®, ­¨ª®£¤  ­¥ ¢®§¢à é ¥âáï
¢ ⥪ã饩 ॠ«¨§ æ¨¨) á í⨬ ¨­¤¥ªá®¬ 㦥 ãáâ ­®¢«¥­ 
£«®¡ «ì­ ï â®çª  ®áâ ­®¢ 
‡ ¬¥ç ­¨ï:
* à®æ¥áá ¤®«¦¥­ ¡ëâì § £à㦥­ ¤«ï ®â« ¤ª¨ (ª ª 㪠§ ­® ¢
®¡é¥¬ ®¯¨á ­¨¨).
* €¯¯ à â­ë¥ â®çª¨ ®áâ ­®¢  ॠ«¨§ãîâáï ç¥à¥§ DRx-ॣ¨áâàë
¯à®æ¥áá®à , ®âá ¢á¥ ®£à ­¨ç¥­¨ï.
* ”ã­ªæ¨ï ¬®¦¥â ¯¥à¥ãáâ ­®¢¨âì à ­¥¥ ãáâ ­®¢«¥­­ãî ¥© ¦¥
â®çªã ®áâ ­®¢  (­¨ª ª ­¥ á®®¡é ï ®¡ í⮬).
‚¥¤¨â¥ ᯨ᮪ ãáâ ­®¢«¥­­ëå â®ç¥ª ®áâ ­®¢  ¢ ®â« ¤ç¨ª¥.
* ‘à ¡ â뢠­¨¥ â®çª¨ ®áâ ­®¢  § ª«îç ¥âáï ¢ £¥­¥à¨à®¢ ­¨¨
®â« ¤®ç­®£® ¨áª«î祭¨ï #DB, ® ª®â®à®¬ á¨á⥬  á®®¡é ¥â ®â« ¤ç¨ªã.
* ’®çª  ®áâ ­®¢  ­  § ¯¨áì ¨ ç⥭¨¥/§ ¯¨áì áà ¡ â뢠¥â ¯®á«¥
¢ë¯®«­¥­¨ï ¢ë§¢ ¢è¥© ¥ñ ¨­áâàãªæ¨¨.
 
======================================================================
= ”ã­ªæ¨ï 70 - à ¡®â  á ä ©«®¢®© á¨á⥬®© á ¯®¤¤¥à¦ª®© ¤«¨­­ëå ¨¬ñ­. =
======================================================================
 à ¬¥âàë:
* eax = 70
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮; ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ¢ § ¢¨á¨¬®á⨠®â ¯®¤ä㭪樨 ¬®¦¥â ¢®§¢à é âìáï §­ ç¥­¨¥ ¨
¢ ¤à㣨å ॣ¨áâà å
Ž¡é¨© ä®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ᬥ饭¨¥ ¢ ä ©«¥
* +8: dword: áâ à訩 dword ᬥ饭¨ï (¤®«¦¥­ ¡ëâì 0) ¨«¨ ¯®«¥ ä« £®¢
* +12 = +0xC: dword: à §¬¥à
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¤ ­­ë¥
* +20 = +0x14: n db: ASCIIZ-áâப  á ¨¬¥­¥¬ ä ©« 
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
“â®ç­¥­¨ï - ¢ ¤®ªã¬¥­â æ¨¨ ­  ᮮ⢥âáâ¢ãîéãî ¯®¤äã­ªæ¨î.
ˆ¬ï ä ©«  ­¥çã¢á⢨⥫쭮 ª ॣ¨áâà㠡㪢. ãá᪨¥ ¡ãª¢ë ¤®«¦­ë ¡ëâì
§ ¯¨á ­ë ¢ ª®¤¨à®¢ª¥ cp866 (DOS).
”®à¬ â ¨¬¥­¨ ä ©« :
/base/number/dir1/dir2/.../dirn/file,
£¤¥ /base/number ¨¤¥­â¨ä¨æ¨àã¥â ãáâனá⢮, ­  ª®â®à®¬ ¨é¥âáï ä ©«:
®¤­® ¨§
* /RD/1 = /RAMDISK/1 ¤«ï ¤®áâ㯠 ª à ¬¤¨áªã
* /FD/1 = /FLOPPYDISK/1 ¤«ï ¤®áâ㯠 ª ¯¥à¢®¬ã ä«®¯¯¨-¤¨áª®¢®¤ã,
/FD/2 = /FLOPPYDISK/2 ¤«ï ¢â®à®£® ä«®¯¯¨-¤¨áª®¢®¤ 
* /HD0/x, /HD1/x, /HD2/x, /HD3/x ¤«ï ¤®áâ㯠 ᮮ⢥âá⢥­­®
ª ¦ñá⪨¬ ¤¨áª ¬ ­  IDE0 (Primary Master), IDE1 (Primary Slave),
IDE2 (Secondary Master), IDE3 (Secondary Slave);
x - ­®¬¥à à §¤¥«  ­  ¢ë¡à ­­®¬ ¢¨­ç¥áâ¥à¥, ¨§¬¥­ï¥âáï ®â 1 ¤® 255
(­  ª ¦¤®¬ ¨§ ¢¨­ç¥áâ¥à®¢ ­ã¬¥à æ¨ï ­ ç¨­ ¥âáï á 1)
* /CD0/1, /CD1/1, /CD2/1, /CD3/1 ¤«ï ¤®áâ㯠 ᮮ⢥âá⢥­­®
ª CD ­  IDE0 (Primary Master), IDE1 (Primary Slave),
IDE2 (Secondary Master), IDE3 (Secondary Slave)
à¨¬¥àë:
* '/rd/1/kernel.asm',0
* '/HD0/1/kernel.asm',0
* '/hd0/2/menuet/pics/tanzania.bmp',0
* '/hd0/1/Program files/NameOfProgram/SomeFile.SomeExtension',0
„®áâã¯­ë¥ ¯®¤ä㭪樨:
* ¯®¤äã­ªæ¨ï 0 - ç⥭¨¥ ä ©« 
* ¯®¤äã­ªæ¨ï 1 - ç⥭¨¥ ¯ ¯ª¨
* ¯®¤äã­ªæ¨ï 2 - ᮧ¤ ­¨¥/¯¥à¥§ ¯¨áì ä ©« 
* ¯®¤äã­ªæ¨ï 3 - § ¯¨áì ¢ áãé¥áâ¢ãî騩 ä ©«
* ¯®¤äã­ªæ¨ï 4 - ãáâ ­®¢ª  à §¬¥à  ä ©« 
* ¯®¤äã­ªæ¨ï 5 - ¯®«ã祭¨¥  âਡã⮢ ä ©« /¯ ¯ª¨
* ¯®¤äã­ªæ¨ï 6 - ãáâ ­®¢ª   âਡã⮢ ä ©« /¯ ¯ª¨
* ¯®¤äã­ªæ¨ï 7 - § ¯ã᪠¯à®£à ¬¬ë
„«ï CD-¯à¨¢®¤®¢ ¢ á¢ï§¨ á  ¯¯ à â­ë¬¨ ®£à ­¨ç¥­¨ï¬¨ ¤®áâ㯭ë
⮫쪮 ¯®¤ä㭪樨 0,1,5 ¨ 7, ¢ë§®¢ ¤àã£¨å ¯®¤ä㭪権 § ¢¥àè¨âáï
®è¨¡ª®© á ª®¤®¬ 2.
 
======================================================================
= ”ã­ªæ¨ï 70, ¯®¤äã­ªæ¨ï 0 - ç⥭¨¥ ä ©«  á ¯®¤¤¥à¦ª®© ¤«¨­­ëå ¨¬ñ­. =
======================================================================
 à ¬¥âàë:
* eax = 70 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 0 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ¯®§¨æ¨ï ¢ ä ©«¥ (¢ ¡ ©â å)
* +8: dword: 0 (§ à¥§¥à¢¨à®¢ ­® ¯®¤ áâ à訩 dword ¯®§¨æ¨¨)
* +12 = +0xC: dword: ᪮«ìª® ¡ ©â ç¨â âì
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¡ãä¥à, ªã¤  ¡ã¤ãâ § ¯¨á ­ë ¤ ­­ë¥
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx = ç¨á«® ¯à®ç¨â ­­ëå ¡ ©â ¨«¨
-1=0xffffffff, ¥á«¨ ä ©« ­¥ ­ ©¤¥­
‡ ¬¥ç ­¨ï:
* …᫨ ä ©« ª®­ç¨«áï à ­ìè¥, 祬 ¡ë« ¯à®ç¨â ­ ¯®á«¥¤­¨© § ¯à®è¥­­ë©
¡«®ª, â® äã­ªæ¨ï ¯à®ç¨â ¥â, ᪮«ìª® ᬮ¦¥â, ¯®á«¥ 祣® ¢¥à­ñâ
eax=6 (EOF).
* ”ã­ªæ¨ï ­¥ ¯®§¢®«ï¥â ç¨â âì ¯ ¯ª¨
(¢¥à­ñâáï eax=10, access denied).
 
======================================================================
= ”ã­ªæ¨ï 70, ¯®¤äã­ªæ¨ï 1 - ç⥭¨¥ ¯ ¯ª¨ á ¯®¤¤¥à¦ª®© ¤«¨­­ëå ¨¬ñ­. =
======================================================================
 à ¬¥âàë:
* eax = 70 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 1 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ¨­¤¥ªá ­ ç «ì­®£® ¡«®ª  (áç¨â ï á 0)
* +8: dword: ¯®«¥ ä« £®¢:
* ¡¨â 0 (¬ áª  1): ¢ ª ª®¬ ä®à¬ â¥ ¢®§¢à é âì ¨¬¥­ ,
0=ANSI, 1=UNICODE
* ¯à®ç¨¥ ¡¨âë § à¥§¥à¢¨à®¢ ­ë ¨ ¤®«¦­ë ¡ëâì ãáâ ­®¢«¥­ë ¢ 0
¤«ï ¡ã¤ã饩 ᮢ¬¥á⨬®áâ¨
* +12 = +0xC: dword: ᪮«ìª® ¡«®ª®¢ ç¨â âì
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¡ãä¥à, ªã¤  ¡ã¤ãâ § ¯¨á ­ë
¤ ­­ë¥, à §¬¥à ¡ãä¥à  ¤®«¦¥­ ¡ëâì ­¥ ¬¥­ìè¥ 32 + [+12]*560 ¡ ©â
* +20 = +0x14: ASCIIZ-¨¬ï ¯ ¯ª¨, ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx = ç¨á«® ä ©«®¢, ¨­ä®à¬ æ¨ï ® ª®â®àëå ¡ë«  § ¯¨á ­  ¢ ¡ãä¥à,
¨«¨ -1=0xffffffff, ¥á«¨ ¯ ¯ª  ­¥ ­ ©¤¥­ 
‘âàãªâãà  ¡ãä¥à :
* +0: 32*byte: § £®«®¢®ª
* +32 = +0x20: n1*byte: ¡«®ª á ¨­ä®à¬ æ¨¥© ® ä ©«¥ 1
* +32+n1: n2*byte: ¡«®ª á ¨­ä®à¬ æ¨¥© ® ä ©«¥ 2
* ...
‘âàãªâãà  § £®«®¢ª :
* +0: dword: ¢¥àá¨ï áâàãªâãàë (⥪ãé ï ¢¥àá¨ï = 1)
* +4: dword: ª®«¨ç¥á⢮ à §¬¥éñ­­ëå ¡«®ª®¢; ­¥ ¡®«ìè¥, 祬 § ¯à®è¥­®
¢ ¯®«¥ +12 ¨­ä®à¬ æ¨®­­®© áâàãªâãàë; ¬®¦¥â ¡ëâì ¬¥­ìè¥,
¥á«¨ ¢ ¯ ¯ª¥ ª®­ç¨«¨áì ä ©«ë (â® ¦¥ á ¬®¥, çâ® ¨ ¢ ebx)
* +8: dword: ®¡é¥¥ ç¨á«® ä ©«®¢ ¢ ¯ ¯ª¥
* +12 = +0xC: 20*byte: § à¥§¥à¢¨à®¢ ­® (­ã«¨)
‘âàãªâãà  ¡«®ª  ¤ ­­ëå ¢å®¤  ª â «®£  („‚Š):
* +0: dword:  âਡãâë ä ©« :
* ¡¨â 0 (¬ áª  1): ä ©« ⮫쪮 ¤«ï ç⥭¨ï
* ¡¨â 1 (¬ áª  2): ä ©« ï¥âáï áªàëâë¬
* ¡¨â 2 (¬ áª  4): ä ©« ï¥âáï á¨á⥬­ë¬
* ¡¨â 3 (¬ áª  8): íâ® ­¥ ä ©«,   ¬¥âª  ⮬ 
(­  § ¤ ­­®¬ à §¤¥«¥ ¢áâà¥ç ¥âáï ­¥ ¡®«¥¥ ®¤­®£® à §  ¨
⮫쪮 ¢ ª®à­¥¢®© ¯ ¯ª¥)
* ¡¨â 4 (¬ áª  0x10): íâ® ¯ ¯ª 
* ¡¨â 5 (¬ áª  0x20): ä ©« ­¥  à娢¨à®¢ «áï - ¬­®£¨¥ ¯à®£à ¬¬ë
 à娢 æ¨¨ ¨¬¥îâ ®¯æ¨î, ¯® ª®â®à®©  à娢¨àãîâáï ⮫쪮 ä ©«ë
á ãáâ ­®¢«¥­­ë¬ í⨬ ¡¨â®¬, ¯®á«¥ 祣® íâ®â ¡¨â á¡à á뢠¥âáï -
íâ® ¬®¦¥â ¡ëâì ¯®«¥§­® ¤«ï  ¢â®¬ â¨ç¥áª®£® ᮧ¤ ­¨ï
backup- à娢®¢, ¨¡® ¯à¨ § ¯¨á¨ ¡¨â ®¡ëç­® ãáâ ­ ¢«¨¢ ¥âáï
(­¥ ¢ Kolibri, ¯à ¢¤ )
* +4: byte: ⨯ ¤ ­­ëå ¨¬¥­¨:
(ᮢ¯ ¤ ¥â á ¡¨â®¬ 0 ä« £®¢ ¨­ä®à¬ æ¨®­­®© áâàãªâãàë)
* 0 = ASCII = 1-¡ ©â­®¥ ¯à¥¤áâ ¢«¥­¨¥ ª ¦¤®£® ᨬ¢®« 
* 1 = UNICODE = 2-¡ ©â­®¥ ¯à¥¤áâ ¢«¥­¨¥ ª ¦¤®£® ᨬ¢®« 
* +5: 3*byte: § à¥§¥à¢¨à®¢ ­® (­ã«¨)
* +8: 4*byte: ¢à¥¬ï ᮧ¤ ­¨ï ä ©« 
* +12 = +0xC: 4*byte: ¤ â  ᮧ¤ ­¨ï ä ©« 
* +16 = +0x10: 4*byte: ¢à¥¬ï ¯®á«¥¤­¥£® ¤®áâ㯠 (ç⥭¨¥ ¨«¨ § ¯¨áì)
* +20 = +0x14: 4*byte: ¤ â  ¯®á«¥¤­¥£® ¤®áâ㯠
* +24 = +0x18: 4*byte: ¢à¥¬ï ¯®á«¥¤­¥© ¬®¤¨ä¨ª æ¨¨
* +28 = +0x1C: 4*byte: ¤ â  ¯®á«¥¤­¥© ¬®¤¨ä¨ª æ¨¨
* +32 = +0x20: qword: à §¬¥à ä ©«  ¢ ¡ ©â å (¤® 16777216 ’¡)
* +40 = +0x28: ¨¬ï
* ¤«ï ä®à¬ â  ASCII: ¬ ªá¨¬ «ì­ ï ¤«¨­  ¨¬¥­¨ 263 ᨬ¢®« 
(263 ¡ ©â ), ¡ ©â ¯®á«¥ ¨¬¥­¨ ¨¬¥¥â §­ ç¥­¨¥ 0
* ¤«ï ä®à¬ â  UNICODE: ¬ ªá¨¬ «ì­ ï ¤«¨­  ¨¬¥­¨ 259 ᨬ¢®«®¢
(518 ¡ ©â), ¤¢  ¡ ©â  ¯®á«¥ ¨¬¥­¨ ¨¬¥îâ §­ ç¥­¨¥ 0
”®à¬ â ¢à¥¬¥­¨:
* +0: byte: ᥪ㭤ë
* +1: byte: ¬¨­ãâë
* +2: byte: ç áë
* +3: byte: § à¥§¥à¢¨à®¢ ­® (0)
* ­ ¯à¨¬¥à, 23.59.59 § ¯¨á뢠¥âáï ª ª (¢ hex) 3B 3B 17 00
”®à¬ â ¤ âë:
* +0: byte: ¤¥­ì
* +1: byte: ¬¥áïæ
* +2: word: £®¤
* ­ ¯à¨¬¥à, 25.11.1979 § ¯¨á뢠¥âáï ª ª (¢ hex) 19 0B BB 07
‡ ¬¥ç ­¨ï:
* …᫨ ¢ „‚Š ¯à¨áãâáâ¢ã¥â ¨¬ï ¢ ASCII, â® ¤«¨­  „‚Š á®áâ ¢«ï¥â
304 ¡ ©â , ¥á«¨ ¢ UNICODE - 560 ¡ ©â. ‡­ ç¥­¨¥ ¤«¨­ë ¢ëà ¢­¥­®
­  楫®¥ ªà â­®¥ 16 ¡ ©â
(¤«ï ã᪮७¨ï ®¡à ¡®âª¨ ¢ ªíè-¯ ¬ï⨠CPU).
* ¥à¢ë© ᨬ¢®« ¯®á«¥ ¨¬¥­¨ ­ã«¥¢®© (ASCIIZ-áâப ). „ «ì­¥©è¨¥
¤ ­­ë¥ ᮤ¥à¦ â ¬ãá®à.
* …᫨ ä ©«ë ¢ ¯ ¯ª¥ ª®­ç¨«¨áì à ­ìè¥, 祬 ¡ë«® ¯à®ç¨â ­®
§ ¯à®è¥­­®¥ ª®«¨ç¥á⢮, â® äã­ªæ¨ï ¯à®ç¨â ¥â, ᪮«ìª® ᬮ¦¥â,
¯®á«¥ 祣® ¢¥à­ñâ eax=6 (EOF).
* ‹î¡ ï ¯ ¯ª  ­  ¤¨áª¥, ªà®¬¥ ª®à­¥¢®©, ᮤ¥à¦¨â ¤¢  ᯥ樠«ì­ëå
¢å®¤  "." ¨ "..", ¨¤¥­â¨ä¨æ¨àãîé¨å ᮮ⢥âá⢥­­® ᠬ㠯 ¯ªã ¨
த¨â¥«ìáªãî ¯ ¯ªã.
* ”ã­ªæ¨ï ¯®§¢®«ï¥â â ª¦¥ ç¨â âì ¢¨àâã «ì­ë¥ ¯ ¯ª¨ "/", "/rd",
"/fd", "/hd[n]", ¯à¨ í⮬  âਡãâë ¯®¤¯ ¯®ª ¯®« £ îâáï à ¢­ë¬¨
0x10,   ¢à¥¬¥­  ¨ ¤ âë ®¡­ã«¥­ë. €«ìâ¥à­ â¨¢­ë© ᯮᮡ ¯®«ã祭¨ï
¨­ä®à¬ æ¨¨ ®¡ ®¡®à㤮¢ ­¨¨ - ¯®¤äã­ªæ¨ï 11 ä㭪樨 18.
 
======================================================================
====================== ”ã­ªæ¨ï 70, ¯®¤äã­ªæ¨ï 2 ======================
======== ‘®§¤ ­¨¥/¯¥à¥§ ¯¨áì ä ©«  á ¯®¤¤¥à¦ª®© ¤«¨­­ëå ¨¬ñ­. ========
======================================================================
 à ¬¥âàë:
* eax = 70 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 2 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +8: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +12 = +0xC: dword: ᪮«ìª® ¡ ©â ¯¨á âì
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¤ ­­ë¥
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx = ç¨á«® § ¯¨á ­­ëå ¡ ©â (¢®§¬®¦­®, 0)
‡ ¬¥ç ­¨ï:
* …᫨ ä ©« á â ª¨¬ ¨¬¥­¥¬ ­¥ áãé¥á⢮¢ «, ®­ ᮧ¤ ñâáï; ¥á«¨
áãé¥á⢮¢ «, â® ¯¥à¥§ ¯¨á뢠¥âáï.
* …᫨ ᢮¡®¤­®£® ¬¥áâ  ­  ¤¨áª¥ ­¥¤®áâ â®ç­®, â® äã­ªæ¨ï § ¯¨è¥â,
᪮«ìª® ᬮ¦¥â, ¯®á«¥ 祣® ¢¥à­ñâ ª®¤ ®è¨¡ª¨ 8.
* ”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥âáï ¤«ï CD (¢¥à­ñâáï ª®¤ ®è¨¡ª¨ 2).
 
======================================================================
====================== ”ã­ªæ¨ï 70, ¯®¤äã­ªæ¨ï 3 ======================
======== ‡ ¯¨áì ¢ áãé¥áâ¢ãî騩 ä ©« á ¯®¤¤¥à¦ª®© ¤«¨­­ëå ¨¬ñ­. =======
======================================================================
 à ¬¥âàë:
* eax = 70 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 3 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ¯®§¨æ¨ï ¢ ä ©«¥ (¢ ¡ ©â å)
* +8: dword: áâ à訩 dword ¯®§¨æ¨¨ (¤®«¦¥­ ¡ëâì 0 ¤«ï FAT)
* +12 = +0xC: dword: ᪮«ìª® ¡ ©â ¯¨á âì
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¤ ­­ë¥
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx = ç¨á«® § ¯¨á ­­ëå ¡ ©â (¢®§¬®¦­®, 0)
‡ ¬¥ç ­¨ï:
* ” ©« ¤®«¦¥­ 㦥 áãé¥á⢮¢ âì, ¨­ ç¥ ¢¥à­ñâáï eax=5.
* …¤¨­á⢥­­ë¬ १ã«ìâ â®¬ § ¯¨á¨ 0 ¡ ©â ï¥âáï ãáâ ­®¢ª  ¢
 âਡãâ å ä ©«  ¤ âë/¢à¥¬¥­¨ ¬®¤¨ä¨ª æ¨¨ ¨ ¤®áâ㯠 ¢ ⥪ãéãî.
* …᫨ ­ ç «ì­ ï ¨/¨«¨ ª®­¥ç­ ï ¯®§¨æ¨ï ¢ë室¨â §  ¯à¥¤¥«ë ä ©« 
(§  ¨áª«î祭¨¥¬ ¯à¥¤ë¤ã饣® á«ãç ï), ä ©« à áè¨àï¥âáï ¤®
­¥®¡å®¤¨¬®£® à §¬¥à  ­ã«¥¢ë¬¨ ᨬ¢®« ¬¨.
* ”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥âáï ¤«ï CD (¢¥à­ñâáï ª®¤ ®è¨¡ª¨ 2).
 
======================================================================
========= ”ã­ªæ¨ï 70, ¯®¤äã­ªæ¨ï 4 - ãáâ ­®¢ª  à §¬¥à  ä ©« . ========
======================================================================
 à ¬¥âàë:
* eax = 70 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 4 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ¬« ¤è¨© dword ­®¢®£® à §¬¥à  ä ©« 
* +8: dword: áâ à訩 dword ­®¢®£® à §¬¥à  ä ©« 
(¤®«¦¥­ ¡ëâì 0 ¤«ï FAT)
* +12 = +0xC: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +16 = +0x10: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx à §àãè ¥âáï
‡ ¬¥ç ­¨ï:
* …᫨ ­®¢ë© à §¬¥à ä ©«  ¬¥­ìè¥ áâ à®£®, ä ©« ãᥪ ¥âáï. …᫨
­®¢ë© à §¬¥à ¡®«ìè¥ áâ à®£®, ä ©« à áè¨àï¥âáï ­ã«¥¢ë¬¨ ᨬ¢®« ¬¨.
…᫨ ­®¢ë© à §¬¥à à ¢¥­ áâ à®¬ã, ¥¤¨­á⢥­­ë¬ १ã«ìâ â®¬ ¢ë§®¢ 
ï¥âáï ãáâ ­®¢ª  ¤ âë/¢à¥¬¥­¨ ¬®¤¨ä¨ª æ¨¨ ¨ ¤®áâ㯠 ¢ ⥪ã騥.
* …᫨ ᢮¡®¤­®£® ¬¥áâ  ­  ¤¨áª¥ ­¥¤®áâ â®ç­® ¤«ï à áè¨à¥­¨ï ä ©« ,
â® äã­ªæ¨ï à áè¨à¨â ­ áª®«ìª® ¢®§¬®¦­®, ¯®á«¥ 祣® ¢¥à­ñâ
ª®¤ ®è¨¡ª¨ 8.
* ”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥âáï ¤«ï CD (¢¥à­ñâáï ª®¤ ®è¨¡ª¨ 2).
 
======================================================================
=== ”ã­ªæ¨ï 70, ¯®¤äã­ªæ¨ï 5 - ¯®«ã祭¨¥ ¨­ä®à¬ æ¨¨ ® ä ©«¥/¯ ¯ª¥. ===
======================================================================
 à ¬¥âàë:
* eax = 70 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 5 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +8: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +12 = +0xC: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¡ãä¥à, ªã¤  ¡ã¤ãâ § ¯¨á ­ë ¤ ­­ë¥
(40 ¡ ©â)
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx à §àãè ¥âáï
ˆ­ä®à¬ æ¨ï ® ä ©«¥ ¢®§¢à é ¥âáï ¢ ä®à¬ â¥ „‚Š
(¡«®ª  ¤ ­­ëå ¢å®¤  ª â «®£ ), 㪠§ ­­®¬ ¢ ®¯¨á ­¨¨
¯®¤ä㭪樨 1, ­® ¡¥§ ¨¬¥­¨ ä ©« 
(â® ¥áâì ¯¥à¢ë¥ 40 = 0x28 ¡ ©â).
‡ ¬¥ç ­¨ï:
* ”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥â ¢¨àâã «ì­ë¥ ¯ ¯ª¨ ⨯  /, /rd ¨
ª®à­¥¢ë¥ ¯ ¯ª¨ ⨯  /rd/1.
 
======================================================================
===== ”ã­ªæ¨ï 70, ¯®¤äã­ªæ¨ï 6 - ãáâ ­®¢ª   âਡã⮢ ä ©« /¯ ¯ª¨. ====
======================================================================
 à ¬¥âàë:
* eax = 70 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 6 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +8: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +12 = +0xC: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +16 = +0x10: dword: 㪠§ â¥«ì ­  ¡ãä¥à á  âਡãâ ¬¨ (32 ¡ ©â )
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = 0 - ãᯥ譮, ¨­ ç¥ ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx à §àãè ¥âáï
€âਡãâë ä ©«  - ¯¥à¢ë¥ 32 ¡ ©â  ¢ „‚Š (¡«®ª¥ ¤ ­­ëå ¢å®¤  ª â «®£ ),
ä®à¬ â ª®â®à®£® 㪠§ ­ ¢ ®¯¨á ­¨¨ ¯®¤ä㭪樨 1
(â® ¥áâì ¡¥§ ¨¬¥­¨ ¨ à §¬¥à  ä ©« ). €âਡãâ ä ©«/¯ ¯ª /¬¥âª  ⮬ 
(¡¨âë 3,4 ¢ dword'¥ +0) ­¥ ¬¥­ï¥âáï.
 ©â +4 (ä®à¬ â ¨¬¥­¨) ¨£­®à¨àã¥âáï.
‡ ¬¥ç ­¨ï:
* ”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥â ¢¨àâã «ì­ë¥ ¯ ¯ª¨ ⨯  /, /rd ¨
ª®à­¥¢ë¥ ¯ ¯ª¨ ⨯  /rd/1.
* ”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥âáï ¤«ï CD (¢¥à­ñâáï ª®¤ ®è¨¡ª¨ 2).
 
======================================================================
============ ”ã­ªæ¨ï 70, ¯®¤äã­ªæ¨ï 7 - § ¯ã᪠¯à®£à ¬¬ë. ============
======================================================================
 à ¬¥âàë:
* eax = 70 - ­®¬¥à ä㭪樨
* ebx = 㪠§ â¥«ì ­  ¨­ä®à¬ æ¨®­­ãî áâàãªâãàã
”®à¬ â ¨­ä®à¬ æ¨®­­®© áâàãªâãàë:
* +0: dword: 7 = ­®¬¥à ¯®¤ä㭪樨
* +4: dword: ¯®«¥ ä« £®¢:
* ¡¨â 0: § ¯ãáâ¨âì ¯à®æ¥áá ª ª ®â« ¦¨¢ ¥¬ë©
* ®áâ «ì­ë¥ ¡¨âë § à¥§¥à¢¨à®¢ ­ë ¨ ¤®«¦­ë ¡ëâì ãáâ ­®¢«¥­ë ¢ 0
* +8: dword: 0 ¨«¨ 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¯ à ¬¥âà ¬¨
* +12 = +0xC: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +16 = +0x10: dword: 0 (§ à¥§¥à¢¨à®¢ ­®)
* +20 = +0x14: ASCIIZ-¨¬ï ä ©« , ¯à ¢¨«  ä®à¬¨à®¢ ­¨ï ¨¬ñ­ 㪠§ ­ë ¢
®¡é¥¬ ®¯¨á ­¨¨
¨«¨
* +20 = +0x14: db 0
* +21 = +0x15: dd 㪠§ â¥«ì ­  ASCIIZ-áâபã á ¨¬¥­¥¬ ä ©« 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax > 0 - ¯à®£à ¬¬  § £à㦥­ , eax ᮤ¥à¦¨â PID
* eax < 0 - ¯à®¨§®è«  ®è¨¡ª , -eax ᮤ¥à¦¨â
ª®¤ ®è¨¡ª¨ ä ©«®¢®© á¨á⥬ë
* ebx à §àãè ¥âáï
‡ ¬¥ç ­¨ï:
* Š®¬ ­¤­ ï áâப  ¤®«¦­  § ª ­ç¨¢ âìáï ᨬ¢®«®¬ á ª®¤®¬ 0
(ASCIIZ-áâப ); ãç¨â뢠îâáï «¨¡® ¢á¥ ᨬ¢®«ë ¤® § ¢¥àè î饣® ­ã«ï
¢ª«îç¨â¥«ì­®, «¨¡® ¯¥à¢ë¥ 256 ᨬ¢®«®¢, ¢ § ¢¨á¨¬®á⨠®â ⮣®,
çâ® ¬¥­ìè¥.
* …᫨ ¯à®æ¥áá § ¯ã᪠¥âáï ª ª ®â« ¦¨¢ ¥¬ë©, ®­ ᮧ¤ ñâáï
¢ § ¬®à®¦¥­­®¬ á®áâ®ï­¨¨; ¤«ï § ¯ã᪠ ¨á¯®«ì§ã©â¥
¯®¤äã­ªæ¨î 5 ä㭪樨 69.
 
======================================================================
=== ”ã­ªæ¨ï 71, ¯®¤äã­ªæ¨ï 1 - ãáâ ­®¢¨âì § £®«®¢®ª ®ª­  ¯à®£à ¬¬ë. ==
======================================================================
 à ¬¥âàë:
* eax = 71 - ­®¬¥à ä㭪樨
* ebx = 1 - ­®¬¥à ¯®¤ä㭪樨
* ecx =  ¤à¥á áâப¨ § £®«®¢ª 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â §­ ç¥­¨ï
‡ ¬¥ç ­¨ï:
* ‘âப  § £®«®¢ª  ¤®«¦­  ¡ëâì ¢ ä®à¬ â¥ ASCIIZ. ‚ § £®«®¢ª¥
®â®¡à ¦ ¥âáï ­¥ ¡®«¥¥ 255 ᨬ¢®«®¢ ­¥§ ¢¨á¨¬® ®â ¯®«­®© ¤«¨­ë
áâப¨.
* —⮡ë ã¡à âì § £®«®¢®ª, ¯¥à¥¤ ©â¥ NULL ¢ ecx.
 
======================================================================
========== ”ã­ªæ¨ï -1 - § ¢¥àè¨âì ¢ë¯®«­¥­¨¥ ¯®â®ª /¯à®æ¥áá  =========
======================================================================
 à ¬¥âàë:
* eax = -1 - ­®¬¥à ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* äã­ªæ¨ï ­¥ ¢®§¢à é ¥â ­¨ §­ ç¥­¨ï, ­¨ ã¯à ¢«¥­¨ï
‡ ¬¥ç ­¨ï:
* …᫨ ¯à®æ¥áá ® ­¥ ᮧ¤ ¢ « ¯®â®ª®¢, â® ã ­¥£® ¥áâì ⮫쪮
®¤¨­ ¯®â®ª, § ¢¥à襭¨¥ ª®â®à®£® ¯à¨¢®¤¨â ª § ¢¥à襭¨î ¯à®æ¥áá .
* …᫨ ⥪ã騩 ¯®â®ª - ¯®á«¥¤­¨© ¢ ¯à®æ¥áá¥, â® ¥£® § ¢¥à襭¨¥
â ª¦¥ ¯à¨¢®¤¨â ª § ¢¥à襭¨î ¯à®æ¥áá .
* â  äã­ªæ¨ï § ¢¥àè ¥â ⥪ã騩 ¯®â®ª. „à㣮© ¯®â®ª ¬®¦­® ¯à¨¡¨âì
¢ë§®¢®¬ ¯®¤ä㭪樨 2 ä㭪樨 18.
 
======================================================================
=========================== ‘¯¨á®ª ᮡë⨩ ===========================
======================================================================
Žç¥à¥¤­®¥ ᮡë⨥ ¬®¦­® ¯®«ãç¨âì ¢ë§®¢®¬ ®¤­®© ¨§ ä㭪権 10
(®¦¨¤ âì ᮡëâ¨ï), 11 (¯à®¢¥à¨âì ¡¥§ ®¦¨¤ ­¨ï), 23
(®¦¨¤ âì ¢ â¥ç¥­¨¥ § ¤ ­­®£® ¢à¥¬¥­¨).
â¨ ä㭪樨 ¢®§¢à é îâ ⮫쪮 ⥠ᮡëâ¨ï, ª®â®àë¥ ¢å®¤ïâ ¢ ¬ áªã,
ãáâ ­ ¢«¨¢ ¥¬ãî ä㭪樥© 40. ® 㬮«ç ­¨î íâ® ¯¥à¢ë¥ âà¨, 祣®
¢¯®«­¥ ¤®áâ â®ç­® ¤«ï ¬­®£¨å ¯à¨«®¦¥­¨©.
Š®¤ë ᮡë⨩:
* 1 = á®®¡é¥­¨¥ ® ¯¥à¥à¨á®¢ª¥ (á¡à á뢠¥âáï ¯à¨ ¢ë§®¢¥ ä㭪樨 0)
* 2 = ­ ¦ â  ª« ¢¨è  ­  ª« ¢¨ âãॠ(¯®áâ㯠¥â, ⮫쪮 ª®£¤  ®ª­®
 ªâ¨¢­®) ¨«¨ ­ ¦ â  "£®àïç ï ª« ¢¨è ";
á¡à á뢠¥âáï, ª®£¤  ¢á¥ ª« ¢¨è¨ ¨§ ¡ãä¥à  áç¨â ­ë ä㭪樥© 2
* 3 = ­ ¦ â  ª­®¯ª , ®¯à¥¤¥«ñ­­ ï à ­¥¥ ä㭪樥© 8 (¨«¨ ª­®¯ª 
§ ªàëâ¨ï, ᮧ¤ ­­ ï ­¥ï¢­® ä㭪樥© 0; ª­®¯ª  ¬¨­¨¬¨§ æ¨¨
®¡à ¡ â뢠¥âáï á¨á⥬®© ¨ ® ­¥© á®®¡é¥­¨ï ­¥ ¯à¨å®¤¨â;
¯®áâ㯠¥â, ⮫쪮 ª®£¤  ®ª­®  ªâ¨¢­®; á¡à á뢠¥âáï, ª®£¤  ¢á¥
ª­®¯ª¨ ¨§ ¡ãä¥à  áç¨â ­ë ä㭪樥© 17)
* 4 = § à¥§¥à¢¨à®¢ ­® (¢ ⥪ã饩 ॠ«¨§ æ¨¨ ­¨ª®£¤  ­¥ ¯à¨å®¤¨â ¤ ¦¥
¯à¨ à §¬ áª¨à®¢ª¥ ä㭪樥© 40)
* 5 = ¯¥à¥à¨á®¢ë¢ ¥âáï ä®­ à ¡®ç¥£® á⮫  (á¡à á뢠¥âáï
 ¢â®¬ â¨ç¥áª¨ ¯®á«¥ ¯¥à¥à¨á®¢ª¨, â ª çâ® ¥á«¨ ¢® ¢à¥¬ï ¯¥à¥à¨á®¢ª¨
ä®­  ¯à®£à ¬¬  ­¥ ¦¤ñâ ¨ ­¥ ¯à®¢¥àï¥â ᮡëâ¨ï, â® í⮣® ᮡëâ¨ï
®­  ­¥ § ¬¥â¨â)
* 6 = ᮡë⨥ ®â ¬ëè¨ (çâ®-â® á«ã稫®áì - ­ ¦ â¨¥ ­  ª­®¯ªã ¬ëè¨
¨«¨ ¯¥à¥¬¥é¥­¨¥; á¡à á뢠¥âáï ¯à¨ ¯à®ç⥭¨¨)
* 7 = ¯à®¨§®è«® ᮡë⨥ IPC (ᬮâਠäã­ªæ¨î 60 - Inter Process
Communication; á¡à á뢠¥âáï ¯à¨ ¯à®ç⥭¨¨)
* 8 = ¯à®¨§®è«® á¥â¥¢®¥ ᮡë⨥ (á¡à á뢠¥âáï ¯à¨ ¯à®ç⥭¨¨;
ᬮâਠࠡ®âã á á¥âìî)
* 9 = ¯à®¨§®è«® ®â« ¤®ç­®¥ ᮡë⨥ (á¡à á뢠¥âáï ¯à¨ ¯à®ç⥭¨¨;
ᬮâਠ®â« ¤®ç­ãî ¯®¤á¨á⥬ã)
* 16..31 = ¯à®¨§®è«® ᮡë⨥ á ᮮ⢥âáâ¢ãî騬 IRQ
(16=IRQ0, 31=IRQ15) (á¡à á뢠¥âáï ¯à¨ áç¨â뢠­¨¨ ¢á¥å ¤ ­­ëå IRQ)
 
======================================================================
==================== Š®¤ë ®è¨¡®ª ä ©«®¢®© á¨á⥬ë ====================
======================================================================
* 0 = ãᯥ譮
* 1 = ­¥ ®¯à¥¤¥«¥­  ¡ §  ¨/¨«¨ à §¤¥« ¦ñá⪮£® ¤¨áª  (¯®¤äã­ªæ¨ï¬¨
7, 8 ä㭪樨 21)
* 2 = äã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥âáï ¤«ï ¤ ­­®© ä ©«®¢®© á¨á⥬ë
* 3 = ­¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬ 
* 4 = ¢®§¢à é ¥âáï ⮫쪮 ä㭪樥© rename ¯à¨ ¯¥à¥¤ ç¥ ᨫ쭮
­¥¢¥à­®£® ¯ à ¬¥âà  ¨ ­¨ª ª ­¥ ᮮ⢥âáâ¢ã¥â ®¯¨á ­¨î
¢ ¨á室­¨ª å ï¤à  "partition not defined at hd"
* 5 = ä ©« ­¥ ­ ©¤¥­
* 6 = ä ©« § ª®­ç¨«áï
* 7 = 㪠§ â¥«ì ¢­¥ ¯ ¬ï⨠¯à¨«®¦¥­¨ï
* 8 = ¤¨áª § ¯®«­¥­
* 9 = â ¡«¨æ  FAT à §àã襭 
* 10 = ¤®áâ㯠§ ¯à¥éñ­
* 11 = ®è¨¡ª  ãáâனá⢠
à¨ § ¯ã᪥ ¯à®£à ¬¬ë ¢®§¬®¦­ë â ª¦¥ á«¥¤ãî騥 ª®¤ë ®è¨¡®ª:
* 30 = 0x1E = ­¥¤®áâ â®ç­® ¯ ¬ïâ¨
* 31 = 0x1F = ä ©« ­¥ ï¥âáï ¨á¯®«­¨¬ë¬
* 32 = 0x20 = ᫨誮¬ ¬­®£® ¯à®æ¥áᮢ
/kernel/tags/kolibri0.6.0.0/docs/sysfuncs.txt
0,0 → 1,4437
SYSTEM FUNCTIONS of OS Kolibri 0.6.0.0
 
Number of the function is located in the register eax.
The call of the system function is executed by "int 0x40" command.
All registers except explicitly declared in the returned value,
including eflags, are preserved.
 
 
======================================================================
============== Function 0 - define and draw the window. ==============
======================================================================
Defines an application window. Draws a frame of the window, header and
working area. For skinned windows defines standard close and minimize
buttons.
Parameters:
* eax = 0 - function number
* ebx = [coordinate on axis x]*65536 + [size on axis x]
* ecx = [coordinate on axis y]*65536 + [size on axis y]
* edx = 0xXYRRGGBB, where:
* Y = style of the window:
* Y=0 - type I - fixed-size window
* Y=1 - only define window area, draw nothing
* Y=2 - type II - variable-size window
* Y=3 - skinned window
* other possible values (from 4 up to 15) are reserved,
function call with such Y is ignored
* RR, GG, BB = accordingly red, green, blue components of a color
of the working area of the window (are ignored for style Y=2)
* X = DCBA (bits)
* A = 1 - window has caption; for style Y=3 caption string
must be passed in edi, for other styles use
subfunction 1 of function 71
* B = 1 - coordinates of all graphics primitives are relative to
window client area
* C is reserved (set to 0)
* D = 0 - normal filling of the working area, 1 - gradient
The following parameters are intended for windows
of a type I and II, and ignored for styles Y=1,3:
* esi = 0xXYRRGGBB - color of the header
* RR, GG, BB define color
* Y=0 - usual window, Y=1 - unmovable window
* X defines a gradient of header: X=0 - no gradient,
X=8 - usual gradient,
for windows of a type II X=4 - negative gradient
* other values of X and Y are reserved
* edi = 0x00RRGGBB - color of the frame
Returned value:
* function does not return value
Remarks:
* Position and sizes of the window are installed by the first
call of this function and are ignored at subsequent; to change
position and/or sizes of already created window use function 67.
* For windows with style Y=3 and caption (A=1) caption string is set
by the first call of this function and is ignored at subsequent
(strictly speaking, is ignored after a call to subfunction 2
of function 12 - end redraw); to change caption of already created
window use subfunction 1 of function 71.
* If the window has appropriate styles, position and/or sizes can be
changed by user. Current position and sizes can be obtained
by function 9.
* The window must fit on the screen. If the transferred
coordinates and sizes do not satisfy to this condition,
appropriate coordinate (or, probably, both) is considered as zero,
and if it does not help too, the appropriate size
(or, probably, both) is installed in a size of the screen.
Further let us designate xpos,ypos,xsize,ysize - values passed
in ebx,ecx. The coordinates are resulted concerning
the left upper corner of the window, which, thus, is set as (0,0),
coordinates of the right lower corner essence (xsize,ysize).
* The sizes of the window are understood in sence of coordinates
of the right lower corner. This concerns all other functions too.
It means, that the real sizes are on 1 pixel more.
* The window of type I looks as follows:
* draw external frame of color indicated in edi, 1 pixel in width
* draw header - rectangle with the left upper corner (1,1) and
right lower (xsize-1,min(25,ysize)) color indicated in esi
(taking a gradient into account)
* if ysize>=26, fill the working area of the window -
rectangle with the left upper corner (1,21) and right lower
(xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color
indicated in edx (taking a gradient into account)
* if A=1 and caption has been already set by subfunction 1
of function 71, it is drawn in the corresponding place of header
* The window of style Y=1 looks as follows:
* completely defined by the application
* The window of type II looks as follows:
* draw external frame of width 1 pixel with the "shaded" color
edi (all components of the color decrease twice)
* draw intermediate frame of width 3 pixels with color edi
* draw internal frame of width 1 pixel with the "shaded" color edi
* draw header - rectangle with the left upper corner (4,4)
and right lower (xsize-4,min(20,ysize)) color, indicated in esi
(taking a gradient into account)
* if ysize>=26, fill the working area of the window -
rectangle with the left upper corner (5,20) and right lower
(xsize-5,ysize-5) with color indicated in edx
(taking a gradient into account)
* if A=1 and caption has been already set by subfunction 1
of function 71, it is drawn in the corresponding place of header
* The skinned window looks as follows:
* draw external frame of width 1 pixel
with color 'outer' from the skin
* draw intermediate frame of width 3 pixel
with color 'frame' from the skin
* draw internal frame of width 1 pixel
with color 'inner' from the skin
* draw header (on bitmaps from the skin) in a rectangle
(0,0) - (xsize,_skinh-1)
* if ysize>=26, fill the working area of the window -
rectangle with the left upper corner (5,_skinh) and right lower
(xsize-5,ysize-5) with color indicated in edx
(taking a gradient into account)
* define two standard buttons: close and minimize
(see function 8)
* if A=1 and edi contains (nonzero) pointer to caption string,
it is drawn in place in header defined in the skin
* value _skinh is accessible as the result of call
subfunction 4 of function 48
 
======================================================================
================ Function 1 - put pixel in the window. ===============
======================================================================
Parameters:
* eax = 1 - function number
* ebx = x-coordinate (relative to the window)
* ecx = y-coordinate (relative to the window)
* edx = 0x00RRGGBB - color of a pixel
edx = 0x01xxxxxx - invert color of a pixel
(low 24 bits are ignored)
Returned value:
* function does not return value
 
======================================================================
============ Function 2 - get the code of the pressed key. ===========
======================================================================
Takes away the code of the pressed key from the buffer.
Parameters:
* eax = 2 - function number
Returned value:
* if the buffer is empty, function returns eax=1
* if the buffer is not empty, function returns al=0,
ah=code of the pressed key, high word of eax is zero
* if there is "hotkey", function returns al=2,
ah=scancode of the pressed key (0 for control keys),
high word of eax contains a status of control keys at the moment
of pressing a hotkey
Remarks:
* There is a common system buffer of the pressed keys
by a size of 120 bytes, organized as queue.
* There is one more common system buffer on 120 "hotkeys".
* If the application with the inactive window calls this function,
the buffer of the pressed keys is considered to be empty.
* By default this function returns ASCII-codes; to switch
to the scancodes mode (and back) use function 66.
However, hotkeys are always notificated as scancodes.
* To find out, what keys correspond to what codes, start
the application keyascii and scancode.
* Scancodes come directly from keyboard and are fixed;
ASCII-codes turn out with usage of the conversion tables,
which can be set by subfunction 2 of function 21
and get by subfunction 2 of function 26.
* As a consequence, ASCII-codes take into account current
keyboard layout (rus/en) as opposed to scancodes.
* This function notifies only about those hotkeys, which were
defined by this thread by subfunction 4 of function 66.
 
======================================================================
==================== Function 3 - get system time. ===================
======================================================================
Parameters:
* eax = 3 - function number
Returned value:
* eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds
* each item is BCD-number, for example,
for time 23:59:59 function returns 0x00595923
Remarks:
* See also subfunction 9 of function 26 - get time from
the moment of start of the system; it is more convenient, because
returns simply DWORD-value of the time counter.
* System time can be set by function 22.
 
======================================================================
============ Function 4 - draw text string in the window. ============
======================================================================
Parameters:
* eax = 4 - function number
* ebx = [coordinate on axis x]*65536 + [coordinate on axis y]
* ecx = 0xX0RRGGBB, where
* RR, GG, BB specify text color
* X=ABnn (bits):
* nn specifies the used font: 0=system monospaced,
1=system font of variable width
* A=0 - output esi characters, A=1 - output ASCIIZ-string
* B=1 - fill background with the color edi
* edx = pointer to the beginning of the string
* esi = for A=0 length of the string, must not exceed 255;
for A=1 is ignored
Returned value:
* function does not return value
Remarks:
* First system font is read out at loading from the file char.mt,
second - from char2.mt.
* Both fonts have height 9 pixels, width of the monospaced font
is equal to 6 pixels.
 
======================================================================
========================= Function 5 - delay. ========================
======================================================================
Delays execution of the program on the given time.
Parameters:
* eax = 5 - function number
* ebx = time in the 1/100 of second
Returned value:
* function does not return value
Remarks:
* Passing ebx=0 does not transfer control to the next process
and does not make any operations at all. If it is really required
to transfer control to the next process (to complete a current
time slice), use subfunction 1 of function 68.
* At current implementation there will be an immediate return from
the function, if the addition of ebx with current value of
time counter will call 32-bit overflow.
 
======================================================================
============== Function 6 - read the file from ramdisk. ==============
======================================================================
Parameters:
* eax = 6 - function number
* ebx = pointer to the filename
* ecx = number of start block, beginning from 1;
ecx=0 - read from the beginning of the file (same as ecx=1)
* edx = number of blocks to read;
edx=0 - read one block (same as edx=1)
* esi = pointer to memory area for the data
Returned value:
* eax = file size in bytes, if the file was successfully read
* eax = -1, if the file was not found
Remarks:
* This function is out-of-date; function 70 allows
to fulfil the same operations with the extended possibilities.
* Block = 512 bytes.
* For reading all file you can specify the certainly large value
in edx, for example, edx = -1; but in this case be ready that
the program will "fall", if the file will appear too large and can
not be placed in the program memory.
* The filename must be either in the format 8+3 characters
(first 8 characters - name itself, last 3 - extension,
the short names and extensions are supplemented with spaces),
or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
(name no more than 8 characters, dot, extension 3 characters
supplemented if necessary by spaces).
The filename must be written with capital letters. The terminating
character with code 0 is not necessary (not ASCIIZ-string).
* This function does not support folders on the ramdisk.
 
======================================================================
=============== Function 7 - draw image in the window. ===============
======================================================================
Paramters:
* eax = 7 - function number
* ebx = pointer to the image in the format BBGGRRBBGGRR...
* ecx = [size on axis x]*65536 + [size on axis y]
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
Returned value:
* function does not return value
Remarks:
* Coordinates of the image are coordinates of the upper left corner
of the image relative to the window.
* Size of the image in bytes is 3*xsize*ysize.
 
======================================================================
=============== Function 8 - define/delete the button. ===============
======================================================================
Parameters for button definition:
* eax = 8 - function number
* ebx = [coordinate on axis x]*65536 + [size on axis x]
* ecx = [coordinate on axis y]*65536 + [size on axis y]
* edx = 0xXYnnnnnn, where:
* nnnnnn = identifier of the button
* high (31st) bit of edx is cleared
* if 30th bit of edx is set - do not draw the button
* if 29th bit of edx is set - do not draw a frame
at pressing the button
* esi = 0x00RRGGBB - color of the button
Parameters for button deleting:
* eax = 8 - function number
* edx = 0x80nnnnnn, where nnnnnn - identifier of the button
Returned value:
* function does not return value
Remarks:
* Sizes of the button must be more than 0 and less than 0x8000.
* For skinned windows definition of the window
(call of 0th function) creates two standard buttons -
for close of the window with identifier 1 and
for minimize of the window with identifier 0xffff.
* The creation of two buttons with same identifiers is admitted.
* The button with the identifier 0xffff at pressing is interpreted
by the system as the button of minimization, the system handles
such pressing independently, not accessing to the application.
In rest it is usual button.
* Total number of buttons for all applications is limited to 4095.
 
======================================================================
============ Function 9 - information on execution thread. ===========
======================================================================
Parameters:
* eax = 9 - function number
* ebx = pointer to 1-Kb buffer
* ecx = number of the slot of the thread
ecx = -1 - get information on the current thread
Returned value:
* eax = maximum number of the slot of a thread
* buffer pointed to by ebx contains the following information:
* +0: dword: usage of the processor (how many time units
per second leaves on execution of this thread)
* +4: word: position of the window of thread in the window stack
* +6: word: (has no relation to the specified thread)
number of the thread slot, which window has in the window stack
position ecx
* +8: word: reserved
* +10 = +0xA: 11 bytes: name of the process
(name of corresponding executable file in the format 8+3)
* +21 = +0x15: byte: reserved, this byte is not changed
* +22 = +0x16: dword: address of the process in memory
* +26 = +0x1A: dword: size of used memory - 1
* +30 = +0x1E: dword: identifier (PID/TID)
* +34 = +0x22: dword: coordinate of the thread window on axis x
* +38 = +0x26: dword: coordinate of the thread window on axis y
* +42 = +0x2A: dword: size of the thread window on axis x
* +46 = +0x2E: dword: size of the thread window on axis y
* +50 = +0x32: word: status of the thread slot:
* 0 = thread is running
* 1 = thread is suspended
* 2 = thread is suspended while waiting for event
* 3 = thread is terminating as a result of call to function -1
or under duress as a result of call to subfunction 2
of function 18 or termination of the system
* 4 = thread is terminating as a result of exception
* 5 = thread waits for event
* 9 = requested slot is free, all other information on the slot
is not meaningful
* +52 = +0x34: word: reserved, this word is not changed
* +54 = +0x36: dword: coordinate of the client area on axis x
* +58 = +0x3A: dword: coordinate of the client area on axis y
* +62 = +0x3E: dword: width of the client area
* +66 = +0x42: dword: height of the client area
* +70 = +0x46: byte: state of the window - bitfield
* bit 0 (mask 1): window is maximized
* bit 1 (mask 2): window is minimized to panel
* bit 2 (mask 4): window is rolled up
Remarks:
* Slots are numbered starting from 1.
* Returned value is not a total number of threads, because there
can be free slots.
* When process is starting, system automatically creates
execution thread.
* Function gives information on the thread. Each process has
at least one thread. One process can create many threads,
in this case each thread has its own slot and the fields
+10, +22, +26 in these slots coincide.
Applications have no common way to define whether two threads
belong to one process.
* The active window - window on top of the window stack -
receives the messages on a keyboard input. For such window
the position in the window stack coincides with returned value.
* Slot 1 corresponds to special system thread, for which:
* the window is in the bottom of the window stack, the fields
+4 and +6 contain value 1
* name of the process - "OS/IDLE" (supplemented by spaces)
* address of the process in memory is 0, size of used memory is
16 Mb (0x1000000)
* PID=1
* coordinates and sizes of the window and the client area are by
convention set to 0
* status of the slot is always 0 (running)
* the execution time adds of time leaving on operations itself
and idle time in waiting for interrupt (which can be got by call
to subfunction 4 of function 18).
* Beginning from slot 2, the normal applications are placed.
* The normal applications are placed in memory at the address
0x10000000 (kernel constand 'std_application_base_address').
There is no intersection, as each process has its own page table.
* At creation of the thread it is assigned the slot
in the system table and identifier (Process/Thread IDentifier =
PID/TID), which do not vary with time for given thread.
After completion of the thread its slot can be anew used
for another thread. The thread identifier can not be assigned
to other thread even after completion of this thread.
Identifiers, assigned to new threads, grow monotonously.
* If the thread has not yet defined the window by call to
function 0, the position and the sizes
of its window are considered to be zero.
* Coordinates of the client area are relative to the window.
* At the moment only the part of the buffer by a size
71 = 0x37 bytes is used. Nevertheless it is recommended to use
1-Kb buffer for the future compatibility, in the future
some fields can be added.
 
======================================================================
==================== Function 10 - wait for event. ===================
======================================================================
If the message queue is empty, waits for appearance of the message
in queue. In this state thread does not consume CPU time.
Then reads out the message from queue.
 
Parameters:
* eax = 10 - function number
Returned value:
* eax = event (see the list of events)
Remarks:
* Those events are taken into account only which enter into
a mask set by function 40. By default it is
redraw, key and button events.
* To check, whether there is a message in queue, use function 11.
To wait for no more than given time, use function 23.
 
======================================================================
=============== Function 11 - check for event, no wait. ==============
======================================================================
If the message queue contains event, function reads out
and return it. If the queue is empty, function returns 0.
Parameters:
* eax = 11 - function number
Returned value:
* eax = 0 - message queue is empty
* else eax = event (see the list of events)
Remarks:
* Those events are taken into account only, which enter into
a mask set by function 40. By default it is
redraw, key and button events.
* To wait for event, use function 10.
To wait for no more than given time, use function 23.
 
======================================================================
=============== Function 12 - begin/end window redraw. ===============
======================================================================
 
---------------- Subfunction 1 - begin window redraw. ----------------
Parameters:
* eax = 12 - function number
* ebx = 1 - subfunction number
Returned value:
* function does not return value
 
----------------- Subfunction 2 - end window redraw. -----------------
Parameters:
* eax = 12 - function number
* ebx = 2 - subfunction number
Returned value:
* function does not return value
Remarks:
* Subfunction 1 deletes all buttons defined with
function 8, they must be defined again.
 
======================================================================
============ Function 13 - draw a rectangle in the window. ===========
======================================================================
Parameters:
* eax = 13 - function number
* ebx = [coordinate on axis x]*65536 + [size on axis x]
* ecx = [coordinate on axis y]*65536 + [size on axis y]
* edx = color 0xRRGGBB or 0x80RRGGBB for gradient fill
Returned value:
* function does not return value
Remarks:
* Coordinates are understood as coordinates of the left upper corner
of a rectangle relative to the window.
 
======================================================================
=================== Function 14 - get screen size. ===================
======================================================================
Parameters:
* eax = 14 - function number
Returned value:
* eax = [xsize]*65536 + [ysize], where
* xsize = x-coordinate of the right lower corner of the screen =
horizontal size - 1
* ysize = y-coordinate of the right lower corner of the screen =
vertical size - 1
Remarks:
* See also subfunction 5 of function 48 - get sizes of
working area of the screen.
 
======================================================================
== Function 15, subfunction 1 - set a size of the background image. ==
======================================================================
Parameters:
* eax = 15 - function number
* ebx = 1 - subfunction number
* ecx = width of the image
* edx = height of the image
Returned value:
* function does not return value
Remarks:
* There is no checks for correctness. The setting of too large
values will result that the background will contain data abroad
of buffer for the background image. Buffer size = 0x160000-0x10,
that corresponds to maximum size 800*600. (800*600*3=0x15F900)
* For update of the screen (after completion of a series of commands
working with a background) call subfunction 3.
* There is a pair function for get size of the background image -
subfunction 1 of function 39.
 
======================================================================
=== Function 15, subfunction 2 - put pixel on the background image. ==
======================================================================
Parameters:
* eax = 15 - function number
* ebx = 2 - subfunction number
* ecx = offset
* edx = color of a pixel 0xRRGGBB
Returned value:
* function does not return value
Remarks:
* Offset for a pixel with coordinates (x,y) is calculated as
(x+y*xsize)*3.
* If the given offset exceeds 0x160000-16 = 1.375 Mb - 16 bytes,
the call is ignored.
* For update of the screen (after completion of a series of commands
working with a background) call subfunction 3.
* There is a pair function for get pixel on the background image -
subfunction 2 of function 39.
 
======================================================================
=========== Function 15, subfunction 3 - redraw background. ==========
======================================================================
Parameters:
* eax = 15 - function number
* ebx = 3 - subfunction number
Returned value:
* function does not return value
 
======================================================================
== Function 15, subfunction 4 - set drawing mode for the background. =
======================================================================
Parameters:
* eax = 15 - function number
* ebx = 4 - subfunction number
* ecx = drawing mode:
* 1 = tile
* 2 = stretch
Returned value:
* function does not return value
Remarks:
* For update of the screen (after completion of a series of commands
working with a background) call subfunction 3.
* There is a pair function for get drawing mode of the background -
subfunction 4 of function 39.
 
======================================================================
===================== Function 15, subfunction 5 =====================
============ Put block of pixels on the background image. ============
======================================================================
Parameters:
* eax = 15 - function number
* ebx = 5 - subfunction number
* ecx = pointer to the data in the format BBGGRRBBGGRR...
* edx = offset in data of the background image
* esi = size of data in bytes = 3 * number of pixels
Returned value:
* function does not return value
Remarks:
* If the block gets out abroad 0x160000-16 = 1.375 Mb - 16 bytes,
the call is ignored.
* Color of each pixel is stored as 3-bytes value BBGGRR.
* Pixels of the background image are written sequentially
from left to right, from up to down.
* Offset of pixel with coordinates (x,y) is (x+y*xsize)*3.
* For update of the screen (after completion of a series of commands
working with a background) call subfunction 3.
 
======================================================================
=============== Function 16 - save ramdisk on a floppy. ==============
======================================================================
Parameters:
* eax = 16 - function number
* ebx = 1 or ebx = 2 - on which floppy save
Returned value:
* eax = 0 - success
* eax = 1 - error
 
======================================================================
======= Function 17 - get the identifier of the pressed button. ======
======================================================================
Takes away the code of the pressed button from the buffer.
Parameters:
* eax = 17 - function number
Returned value:
* if the buffer is empty, function returns eax=1
* if the buffer is not empty, function returns al=0,
high 24 bits of eax contain button identifier (in particular, ah
contains low byte of the identifier; if all buttons have
the identifier less than 256, ah is enough to distinguish).
Remarks:
* "Buffer" keeps only one button, at pressing the new button the
information about old is lost.
* The call of this function by an application with inactive window
will return answer "buffer is empty".
 
======================================================================
============ Function 18, subfunction 1 - system shutdown. ===========
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 1 - subfunction number
Returned value:
* function always return eax = 0 as tag of success
Remarks:
* On the last step menu of exit from the system appears and waits
response of the user.
* See also subfunction 9, system shutdown with
the parameter to force the choice in the exit menu.
 
======================================================================
= Function 18, subfunction 2 - terminate process/thread by the slot. =
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 2 - subfunction number
* ecx = number of the slot of process/thread
Returned value:
* function does not return value
Remarks:
* It is impossible to terminate system thread OS/IDLE (with
number of the slot 1),
it is possible to terminate any normal process/thread.
* See also subfunction 18 - terminate
process/thread by the identifier.
 
======================================================================
===================== Function 18, subfunction 3 =====================
============= Make active the window of the given thread. ============
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 3 - subfunction number
* ecx = number of the thread slot
Returned value:
* function does not return value
Remarks:
* If correct, but nonexistent slot is given,
some window is made active.
* To find out, which window is active, use subfunction 7.
 
======================================================================
===================== Function 18, subfunction 4 =====================
=========== Get counter of idle time units per one second. ===========
======================================================================
Idle time units are units, in which the processor stands idle
in waiting for interrupt (in the command 'hlt').
 
Parameters:
* eax = 18 - function number
* ebx = 4 - subfunction number
Returned value:
* eax = value of the counter of idle time units per one second
 
======================================================================
========== Function 18, subfunction 5 - get CPU clock rate. ==========
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 5 - subfunction number
Returned value:
* eax = clock rate (modulo 2^32 clock ticks = 4GHz)
 
======================================================================
Function 18, subfunction 6 - save ramdisk to the file on hard drive.
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 6 - subfunction number
* ecx defines path to the file:
* 1 = in the folder "/KOLIBRI"
* 2 = in the root folder
* 3 = edx points to the path (names of folders in the format 8+3,
divided by '/')
Returned value:
* eax = 0 - success
* else eax = error code of the file system
Çàìå÷àíèÿ:
* Filename is fixed, "menuet.img" (global kernel variable
'image_save' from 'preboot.inc')
* Drive and partition are defined by subfunction 7
and subfunction 8 of function 21.
* All folders in the given path must exist, otherwise function
returns value 5, "file not found".
 
======================================================================
=========== Function 18, subfunction 7 - get active window. ==========
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 7 - subfunction number
Returned value:
* eax = number of the active window
(number of the slot of the thread with active window)
Remarks:
* Active window is at the top of the window stack and receives
messages on all keyboard input.
* To make a window active, use subfunction 3.
 
======================================================================
== Function 18, subfunction 8 - disable/enable the internal speaker. =
======================================================================
If speaker sound is disabled, all calls to subfunction 55 of
function 55 are ignored. If speaker sound is enabled,
they are routed on builtin speaker.
 
------------------- Subsubfunction 1 - get status. -------------------
Parameters:
* eax = 18 - function number
* ebx = 8 - subfunction number
* ecx = 1 - number of the subsubfunction
Returned value:
* eax = 0 - speaker sound is enabled; 1 - disabled
 
----------------- Subsubfunction 2 - toggle status. ------------------
Toggles states of disable/enable.
Parameters:
* eax = 18 - function number
* ebx = 8 - subfunction number
* ecx = 2 - number of the subsubfunction
Returned value:
* function does not return value
 
======================================================================
== Function 18, subfunction 9 - system shutdown with the parameter. ==
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 9 - subfunction number
* ecx = parameter:
* 1 = on the last step of shutdown save ramdisk on a floppy and
then show the exit menu and request further operations
from the user
* 2 = turn off computer
* 3 = reboot computer
* 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
Returned value:
* at incorrect ecx the registers do not change (i.e. eax=18)
* by correct call function always returns eax=0
as the tag of success
Remarks:
* Do not rely on returned value by incorrect call, it can be
changed in future versions of the kernel.
* It is possible to use subfunction 1, that on the last step
the user makes choice himself.
* It is not recommended to use value ecx=1 (to not irritate the user
with excessive questions); to save ramdisk on a floppy use
function 16 (which admits specification, on which floppy to
write), and to shutdown with the exit menu use already mentioned
subfunction 1.
 
======================================================================
===== Function 18, subfunction 10 - minimize application window. =====
======================================================================
Minimizes the own window.
Parameters:
* eax = 18 - function number
* ebx = 10 - subfunction number
Returned value:
* function does not return value
Remarks:
* The minimized window from the point of view of function 9
keeps position and sizes.
* Restoring of an application window occurs at its activation by
subfunction 3.
* Usually there is no necessity to minimize/restire a window
obviously: minimization of a window is carried out by the system
at pressing the minimization button (for skinned windows
it is defined automatically by function 0,
for other windows it can be defined manually by function 8),
restore of a window is done by the application '@panel'.
 
======================================================================
Function 18, subfunction 11 - get information on the disk subsystem.
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 11 - subfunction number
* ecx = type of the table:
* 1 = short version, 10 bytes
* 2 = full version, 65536 bytes
* edx = pointer to the buffer (in the application) for the table
Returned value:
* function does not return value
Format of the table: short version:
* +0: byte: information about FDD's (drives for floppies),
AAAABBBB, where AAAA gives type of the first drive, BBBB -
of the second regarding to the following list:
* 0 = there is no drive
* 1 = 360Kb, 5.25''
* 2 = 1.2Mb, 5.25''
* 3 = 720Kb, 3.5''
* 4 = 1.44Mb, 3.5''
* 5 = 2.88Mb, 3.5'' (such drives are not used anymore)
For example, for the standard configuration from one 1.44-drive
here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B:
the value is 24h.
* +1: byte: information about hard disks and CD-drives, AABBCCDD,
where AA corresponds to the controller IDE0, ..., DD - IDE3:
* 0 = device is absent
* 1 = hard drive
* 2 = CD-drive
For example, in the case HD on IDE0 and CD on IDE2
this field contains 48h.
* +2: 4 db: number of the retrieved partitions on hard disks
at accordingly IDE0,...,IDE3.
If the hard disk on IDEx is absent, appropriate byte is zero,
otherwise it shows number of the recognized partitions, which
can be not presented (if the drive is not formatted or if
the file system is not supported). Current version of the kernel
supports only FAT16 and FAT32 for hard disks.
* +6: 4 db: reserved
Format of the table: full version:
* +0: 10 db: same as for the short version
* +10: 100 db: data for the first partition
* +110: 100 db: data for the second partition
* ...
* +10+100*(n-1): 100 db: data for the last partition
The partitions are located as follows: at first sequentially all
recoginzed partitions on HD on IDE0 (if present),
then on HD on IDE1 (if present) and so on up to IDE3.
Format of the information about partition
(at moment only FAT is supported):
* +0: dword: first physical sector of the partition
* +4: dword: last physical sector of the partition
(belongs to the partition)
* +8: dword: sectors per one copy of FAT
* +12 = +0xC: dword: number of copies of FAT
* +16 = +0x10: dword: number of sectors per cluster
* +20 = +0x14: dword: bytes per sector;
current implementation expects 0x200 = 512 in this field
* +24 = +0x18: dword: first root cluster in FAT32, 0 for FAT16
* +28 = +0x1C: dword: first physical sector of FAT
* +32 = +0x20: dword: first physical root sector for FAT16,
ignored for FAT32
* +36 = +0x24: dword: number of root sectors for FAT16,
0 for FAT32
* +40 = +0x28: dword: physical sector of the beginning of
the data area
* +44 = +0x2C: dword: maximum number of a cluster
* +48 = +0x30: dword: physical sector of the information
about the file system for FAT32, ignored for FAT16
* +52 = +0x34: dword: value used as boundary for special
values in FAT
* +56 = +0x38: dword: value used for bad clusters in FAT
* +60 = +0x3C: dword: value used as the end marker for FAT chain
* +64 = +0x40: dword: mask for FAT items
* +68 = +0x44: byte: file system type: 16 èëè 32
* +69 = +0x45: 31 db: reserved
Remarks:
* The short table can be used for obtaining the information about
available devices.
* First two fields in the information about partition
gives the parameters of partition, other - parameters of
FAT file system. For other file systems (when they will be
supported) specific for file system information will be, of
course, another, but first two fields will have the same sense.
 
======================================================================
========== Function 18, subfunction 13 - get kernel version. =========
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 13 - subfunction number
* ecx = pointer to the buffer (not less than 16 bytes), where
the information will be placed
Returned value:
* function does not return value
Structure of the buffer:
db a,b,c,d for version a.b.c.d
db UID_xxx: one of UID_NONE=0, UID_MENUET=1, UID_KOLIBRI=2
db 'name',0 - ASCIIZ-string with the name
For Kolibri 0.6.0.0 kernel:
db 0,6,0,0
db 2
db 'Kolibri',0
 
======================================================================
======= Function 18, subfunction 14 - wait for screen retrace. =======
======================================================================
Waits for the beginning of retrace of the scanning ray of the screen
monitor.
Parameters:
* eax = 18 - function number
* ebx = 14 - subfunction number
Returned value:
* eax = 0 as the tag of success
Remarks:
* Function is intended only for active high-efficiency graphics
applications; is used for smooth output of a graphics.
 
======================================================================
== Function 18, subfunction 15 - center mouse cursor on the screen. ==
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 15 - subfunction number
Returned value:
* eax = 0 as the tag of success
 
======================================================================
========= Function 18, subfunction 16 - get size of free RAM. ========
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 16 - subfunction number
Returned value:
* eax = size of free memory in kilobytes
 
======================================================================
======== Function 18, subfunction 17 - get full amount of RAM. =======
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 17 - subfunction number
Returned value:
* eax = total size of existing memory in kilobytes
 
======================================================================
===================== Function 18, subfunction 18 ====================
============= Terminate process/thread by the identifier. ============
======================================================================
Parameters:
* eax = 18 - function number
* ebx = 18 - subfunction number
* ecx = identifer of process/thread (PID/TID)
Returned value:
* eax = 0 - success
* eax = -1 - error (process is not found or is system)
Remarks:
* It is impossible to terminate system thread OS/IDLE (identifier
1), it is possible to terminate any normal process/thread.
* See also subfunction 2 - terminate
process/thread by given slot.
 
======================================================================
======== Function 18, subfunction 19 - get/set mouse features. =======
======================================================================
 
---------------- Subsubfunction 0 - get mouse speed. -----------------
Parameters:
* eax = 18 - function number
* ebx = 19 - subfunction number
* ecx = 0 - subsubfunction number
Returned value:
* eax = current mouse speed
 
---------------- Subsubfunction 1 - set mouse speed. -----------------
Parameters:
* eax = 18 - function number
* ebx = 19 - subfunction number
* ecx = 1 - subsubfunction number
* edx = new value for speed
Returned value:
* function does not return value
 
---------------- Subsubfunction 2 - get mouse delay. -----------------
Parameters:
* eax = 18 - function number
* ebx = 19 - subfunction number
* ecx = 2 - subsubfunction number
Returned value:
* eax = current mouse delay
 
---------------- Subsubfunction 3 - set mouse delay. -----------------
Parameters:
* eax = 18 - function number
* ebx = 19 - subfunction number
* ecx = 3 - subsubfunction number
* edx = new value for mouse delay
Returned value:
* function does not return value
 
----------- Subsubfunction 4 - set mouse pointer position. -----------
Parameters:
* eax = 18 - function number
* ebx = 19 - subfunction number
* ecx = 4 - subsubfunction number
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
Returned value:
* function does not return value
Remarks:
* It is recommended to set speed of the mouse (in subsubfunction 1)
from 1 up to 9. The installed value is not inspected by the kernel
code, so set it carefully, at incorrect value the cursor
can "freeze". Speed of the mouse can be regulated through the
application SETUP.
* Recommended delay of the mouse (in subsubfunction 3) = 10. Lower
value is not handled by COM mice. At the very large values the
movement of the mouse on 1 pixel is impossible and the cursor will
jump on the value of installed speed (subsubfunction 1). The
installed value is not inspected by the kernel code.
Mouse delay can be regulated through the application SETUP.
* The subsubfunction 4 does not check the passed value. Before
its call find out current screen resolution (with function 14)
and check that the value of position is inside the limits of the
screen.
 
======================================================================
==================== Function 20 - MIDI interface. ===================
======================================================================
 
----------------------- Subfunction 1 - reset ------------------------
Parameters:
* eax = 20 - function number
* ebx = 1 - subfunction number
 
-------------------- Subfunction 2 - output byte ---------------------
Parameters:
* eax = 20 - function number
* ebx = 2 - subfunction number
* cl = byte for output
Returned value (is the same for both subfunctions):
* eax = 0 - success
* eax = 1 - base port is not defined
Remarks:
* Previously the base port must be defined by
subfunction 1 of function 21.
 
======================================================================
======== Function 21, subfunction 1 - set MPU MIDI base port. ========
======================================================================
Parameters:
* eax = 21 - function number
* ebx = 1 - subfunction number
* ecx = number of base port
Returned value
* eax = 0 - success
* eax = -1 - erratic number of a port
Remarks:
* Number of a port must satisfy to conditions 0x100<=ecx<=0xFFFF.
* The installation of base is necessary for function 20.
* To get base port use subfunction 1 of function 26.
 
======================================================================
========== Function 21, subfunction 2 - set keyboard layout. =========
======================================================================
Keyboard layout is used to convert keyboard scancodes to ASCII-codes,
which will be read by function 2.
Parameters:
* eax = 21 - function number
* ebx = 2 - subfunction number
* ecx = which layout to set:
* 1 = normal layout
* 2 = layout at pressed Shift
* 3 = layout at pressed Alt
* edx = pointer to layout - table of length 128 bytes
Or:
* ecx = 9
* dx = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
Returned value:
* eax = 0 - success
* eax = 1 - incorrect parameter
Remarks:
* If Alt is pressed, the layout with Alt is used;
if Alt is not pressed, but Shift is pressed,
the layout with Shift is used;
if Alt and Shift are not pressed, but Ctrl is pressed, the normal
layout is used and then from the code is subtracted 0x60;
if no control key is pressed, the normal layout is used.
* To get layout and country identifier use
subfunction 2 of function 26.
* Country identifier is global system variable, which is not used
by the kernel itself; however the application '@panel' displays
the corresponding icon.
* The application @panel switches layouts on user request.
 
======================================================================
============== Function 21, subfunction 3 - set CD base. =============
======================================================================
Parameters:
* eax = 21 - function number
* ebx = 3 - subfunction number
* ecx = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
Returned value:
* eax = 0
Remarks:
* CD base is used by function 24.
* To get CD base use subfunction 3 of function 26.
 
======================================================================
====== Function 21, subfunction 4 - set Sound Blaster base port. =====
======================================================================
Parameters:
* eax = 21 - function number
* ebx = 4 - subfunction number
* ecx = number of the base port
Returned value:
* eax = 0 - success
* eax = -1 - erratic port number
Remarks:
* Number of the port must satisfy to conditions 0x100<=ecx<=0xFFFF.
* The installation of the base is necessary for
functions 25, 28, 55.
* To get base port use subfunction 4 of function 26.
 
======================================================================
========== Function 21, subfunction 5 - set system language. =========
======================================================================
Parameters:
* eax = 21 - function number
* ebx = 5 - subfunction number
* ecx = system language (1=eng, 2=fi, 3=ger, 4=rus)
Returned value:
* eax = 0
Remarks:
* System language is global system variable and is not used
by the kernel itself, however application @panel draws the
appropriate icon.
* Function does not check for correctness, as the kernel does not
use this variable.
* To get system language use subfunction 5 of function 26.
 
======================================================================
=========== Function 21, subfunction 6 - set WSS base port. ==========
======================================================================
Parameters:
* eax = 21 - function number
* ebx = 6 - subfunction number
* ecx = base port
Returned value:
* eax = 0 - success
* eax = -1 - erratic port number
Remarks:
* Port number must satisfy to condition 0x100<=ecx.
* WSS base is used by function 27.
* To get WSS base port use subfunction 6 of function 26.
 
======================================================================
============== Function 21, subfunction 7 - set HD base. =============
======================================================================
The HD base defines hard disk to write with usage of obsolete
file system functions and functions implicitly using the hard disk
(such as subfunction 6 of function 18);
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
these function set base themselves.
Parameters:
* eax = 21 - function number
* ebx = 7 - subfunction number
* ecx = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
Returned value:
* eax = 0
Remarks:
* Any application at any time can change the base.
* Do not change base, when any application works with hard disk.
If you do not want system bugs.
* To get HD base use subfunction 7 of function 26.
* It is also necessary to define used partition of hard disk by
subfunction 8.
 
======================================================================
========= Function 21, subfunction 8 - set used HD partition. ========
======================================================================
The HD partition defines partition of the hard disk to write with
usage of obsolete file system functions and functions implicitly
using the hard disk (such as subfunction 6 of function 18);
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
these functions set base and partition themselves.
Parameters:
* eax = 21 - function number
* ebx = 8 - subfunction number
* ecx = HD partition (beginning from 1)
Return value:
* eax = 0
Remarks:
* Any application at any time can change partition.
* Do not change partition when any application works with hard disk.
If you do not want system bugs.
* To get used partition use subfunction 8 of function 26.
* There is no correctness checks.
* To get the number of partitions of a hard disk use
subfunction 11 of function 18.
* It is also necessary to define used HD base by subfunction 7.
 
======================================================================
======== Function 21, subfunction 10 - set sound DMA channel. ========
======================================================================
Parameters:
* eax = 21 - function number
* ebx = 10 - subfunction number
* ecx = number of channel (from 0 up to 3 inclusively)
Returned value:
* eax = 0 - success
* eax = -1 - incorrect channel number
Remarks:
* Number of DMA channel is used in subfunction 1 of function 55.
* To get sound DMA channel use subfunction 10 of function 26.
 
======================================================================
Function 21, subfunction 11 - enable/disable low-level access to HD.
======================================================================
Parameters:
* eax = 21 - function number
* ebx = 11 - subfunction number
* ecx = 0/1 - disable/enable
Returned value:
* eax = 0
Remarks:
* Is used in LBA-read (subfunction 8 of function 58).
* The current implementation uses only low bit of ecx.
* To get current status use subfunction 11 of function 26.
 
======================================================================
Function 21, subfunction 12 - enable/disable low-level access to PCI.
======================================================================
Parameters:
* eax = 21 - function number
* ebx = 12 - subfunction number
* ecx = 0/1 - disable/enable
Returned value:
* eax = 0
Remarks:
* Is used in operations with PCI bus (function 62).
* The current implementation uses only low bit of ecx.
* To get current status use subfunction 12 of function 26.
 
======================================================================
============ Function 21, subfunction 13, subsubfunction 1 ===========
======== Initialize + get information on the driver vmode.mdr. =======
======================================================================
Parameters:
* eax = 21 - function number
* ebx = 13 - subfunction number
* ecx = 1 - number of the driver function
* edx = pointer to 512-bytes buffer
Returned value:
* if driver is not loaded
(never happens in the current implementation):
* eax = -1
* ebx, ecx destroyed
* if driver is loaded:
* eax = 'MDAZ' (in fasm style, that is 'M' - low byte, 'Z' - high)
- signature
* ebx = current frequency of the scanning (in Hz)
* ecx destroyed
* buffer pointed to by edx is filled
Format of the buffer:
* +0: 32*byte: driver name, "Trans VideoDriver"
(without quotes, supplemented by spaces)
* +32 = +0x20: dword: driver version (version x.y is encoded as
y*65536+x), for the current implementation is 1 (1.0)
* +36 = +0x24: 7*dword: reserved (0 in the current implementation)
* +64 = +0x40: 32*word: list of supported videomodes (each word
is number of a videomode, after list itself there are zeroes)
* +128 = +0x80: 32*(5*word): list of supported frequences of the
scannings for videomodes: for each videomode listed in the
previous field up to 5 supported frequences are given
(unused positions contain zeroes)
Remarks:
* Function initializes the driver (if it is not initialized yet)
and must be called first, before others (otherwise they will do
nothing and return -1).
* The current implementation supports only one frequency
of the scanning on videomode.
 
======================================================================
============ Function 21, subfunction 13, subsubfunction 2 ===========
================ Get information on current videomode. ===============
======================================================================
Parameters:
* eax = 21 - function number
* ebx = 13 - subfunction number
* ecx = 2 - number of the driver function
Returned value:
* eax = -1 - driver is not loaded or not initialized;
ebx,ecx are destroyed
* eax = [width]*65536 + [height]
* ebx = frequency of the vertical scanning (in Hz)
* ecx = number of current videomode
Remarks:
* Driver must be initialized by call to
driver function 1.
* If only screen sizes are required, it is more expedient to use
function 14 taking into account that it
returns sizes on 1 less.
 
======================================================================
=== Function 21, subfunction 13, subsubfunction 3 - set videomode. ===
======================================================================
Parameters:
* eax = 21 - function number
* ebx = 13 - subfunction number
* ecx = 3 - number of the driver function
* edx = [scanning frequency]*65536 + [videomode number]
Returned value:
* eax = -1 - driver is not loaded, not initialized or
an error has occured
* eax = 0 - success
* ebx, ecx destroyed
Remarks:
* Driver must be initialized by driver function 1.
* The videomode number and frequency must be in the table
returned by driver function 1.
 
======================================================================
============ Function 21, subfunction 13, subsubfunction 4 ===========
================== Return to the initial videomode. ==================
======================================================================
Returns the screen to the videomode set at system boot.
Parameters:
* eax = 21 - function number
* ebx = 13 - subfunction number
* ecx = 4 - number of the driver function
Returned value:
* eax = -1 - driver is not loaded or not initialized
* eax = 0 - success
* ebx, ecx destroyed
Remarks:
* Driver must be initialized by call to driver function 1.
 
======================================================================
============ Function 21, subfunction 13, subsubfunction 5 ===========
===== Increase/decrease the size of the visible area of monitor. =====
======================================================================
Parameters:
* eax = 21 - function number
* ebx = 13 - subfunction number
* ecx = 5 - number of the driver function
* edx = 0/1 - decrease/increase horizontal size on 1 position
* edx = 2/3 - is not supported in the current implementation;
is planned as decrease/increase vertical size on 1 position
Returned value:
* eax = -1 - driver is not loaded or not initialized
* eax = 0 - success
* ebx, ecx destroyed
Remarks:
* Driver must be initialized by call to driver function 1.
* Function influences only the physical size of the screen image;
the logical size (number of pixels) does not change.
 
======================================================================
================= Function 22 - set system date/time. ================
======================================================================
Parameters:
* eax = 22 - function number
* ebx = 0 - set time
* ecx = 0x00SSMMHH - time in the binary-decimal code (BCD):
* HH=hour 00..23
* MM=minute 00..59
* SS=second 00..59
* ebx = 1 - set date
* ecx = 0x00DDMMYY - date in the binary-decimal code (BCD):
* DD=day 01..31
* MM=month 01..12
* YY=year 00..99
* ebx = 2 - set day of week
* ecx = 1 for Sunday, ..., 7 for Saturday
* ebx = 3 - set alarm clock
* ecx = 0x00SSMMHH
Returned value:
* eax = 0 - success
* eax = 1 - incorrect parameter
* eax = 2 - CMOS-battery was unloaded
Remarks:
* Value of installation of day of week seems to be doubtful,
as it a little where is used
(day of week can be calculated by date).
* Alarm clock can be set on operation in the given time every day.
But there is no existing system function to disable it.
* Operation of alarm clock consists in generation IRQ8.
* Generally CMOS supports for alarm clock set of value 0xFF
as one of parameters and it means that the appropriate parameter
is ignored. But current implementation does not allow this
(will return 1).
* Alarm clock is a global system resource; the set of
an alarm clock cancels automatically the previous set.
However, at moment no program uses it.
 
======================================================================
============= Function 23 - wait for event with timeout. =============
======================================================================
If the message queue is empty, waits for new message in the queue,
but no more than given time. Then reads out a message from the queue.
 
Parameters:
* eax = 23 - function number
* ebx = timeout (in 1/100 of second)
Returned value:
* eax = 0 - the message queue is empty
* otherwise eax = event (see the list of events)
Remarks:
* Only those events are taken into account, which enter into
the mask set by function 40. By default it is
redraw, key and button events.
* To check for presence of a message in the queue use function 11.
To wait without timeout use function 10.
* Transmission ebx=0 results in immediate returning eax=0.
* Current implementation returns immediately with eax=0,
if the addition of ebx with the current value of time counter
makes 32-bit overflow.
 
======================================================================
======== Function 24, subfunction 1 - begin to play CD-audio. ========
======================================================================
Parameters:
* eax = 24 - function number
* ebx = 1 - subfunction number
* ecx = 0x00FRSSMM, where
* MM = starting minute
* SS = starting second
* FR = starting frame
Returned value:
* eax = 0 - success
* eax = 1 - CD base is not defined
Remarks:
* Previously CD base must be defined by the call to
subfunction 3 of function 21.
* One second includes 75 frames, one minute includes 60 seconds.
* The function is asynchronous (returns control, when play begins).
 
======================================================================
======= Function 24, subfunction 2 - get information on tracks. ======
======================================================================
Parameters:
* eax = 24 - function number
* ebx = 2 - subfunction number
* ecx = pointer to the buffer for the table
(maximum 8*64h+4 bytes=100 tracks)
Returned value:
* eax = 0 - success
* eax = 1 - CD base is not defined
Remarks:
* The format of the table with tracks information is the same as
for ATAPI-CD command 43h (READ TOC), usual table (subcommand 00h).
Function returns addresses in MSF.
* Previously CD base port must be set by call to
subfunction 3 of function 21.
* Function returns information only about no more than 100
first tracks. In most cases it is enough.
 
======================================================================
========== Function 24, subfunction 3 - stop play CD-audio. ==========
======================================================================
Parameters:
* eax = 24 - function number
* ebx = 1 - subfunction number
Returned value:
* eax = 0 - success
* eax = 1 - CD base is not defined
Çàìå÷àíèÿ:
* Previously CD base port must be defined by call to
subfunction 3 of function 21.
 
======================================================================
=================== Function 25 - set SBPro volume. ==================
======================================================================
Parameters:
* eax = 25 - function number
* ebx = what to set:
* 1 - set common volume
* 2 - set CD-audio volume
* cl = volume level: high 4 bits for the left column,
low 4 bits for the right one
Returned value:
* eax = 0 - success
* eax = 1 - SB base is not defined
* eax = 2 - incorrect subfunction
Remarks:
* Previously SB base port must be defined by
subfunction 4 of function 21.
* See also function 28 which sets
volume for the later standard SB16.
 
======================================================================
======== Function 26, subfunction 1 - get MPU MIDI base port. ========
======================================================================
Parameters:
* eax = 26 - function number
* ebx = 1 - subfunction number
Returned value:
* eax = port number
Parameters:
* To set base port use subfunction 1 of function 21.
 
======================================================================
========== Function 26, subfunction 2 - get keyboard layout. =========
======================================================================
The keyboard layout is used to convert keyboard scancodes to
ASCII-codes for function 2.
Parameters:
* eax = 26 - function number
* ebx = 2 - subfunction number
* ecx = what layout to get:
* 1 = normal layout
* 2 = layout with pressed Shift
* 3 = layout with pressed Alt
* edx = pointer to the 128-bytes buffer, where the layout will be
copied
Returned value:
* function does not return value
Or:
* eax = 26 - function number
* ebx = 2 - subfunction number
* ecx = 9
Returned value:
* eax = country identifier (1=eng, 2=fi, 3=ger, 4=rus)
Remarks:
* If Alt is pressed, the layout with Alt is used;
if Alt is not pressed, but Shift is pressed,
the layout with Shift is used;
if Alt and Shift are not pressed, but Ctrl is pressed, the normal
layout is used and then from the code is subtracted 0x60;
if no control key is pressed, the normal layout is used.
* To set layout and country identifier use
subfunction 2 of function 21.
* Country identifier is global system variable, which is not used
by the kernel itself; however the application '@panel' displays
the corresponding icon (using this function).
* The application @panel switches layouts on user request.
 
======================================================================
============== Function 26, subfunction 3 - get CD base. =============
======================================================================
Parameters:
* eax = 26 - function number
* ebx = 3 - subfunction number
Returned value:
* eax = CD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
Remarks:
* CD base is used by function 24.
* To set CD base use subfunction 3 of function 21.
 
======================================================================
====== Function 26, subfunction 4 - get Sound Blaster base port. =====
======================================================================
Parameters:
* eax = 26 - function number
* ebx = 4 - subfunction number
Returned value:
* eax = base port number
Remarks:
* Bae port is used by functions 25, 55.
* To set base port use subfunction 4 of function 21.
 
======================================================================
========== Function 26, subfunction 5 - get system language. =========
======================================================================
Parameters:
* eax = 26 - function number
* ebx = 5 - subfunction number
Returned value:
* eax = system language (1=eng, 2=fi, 3=ger, 4=rus)
Remarks:
* System language is global system variable and is not used
by the kernel itself, however application @panel draws the
appropriate icon (using this function).
* To set system language use subfunction 5 of function 21.
 
======================================================================
=========== Function 26, subfunction 6 - get WSS base port. ==========
======================================================================
Parameters:
* eax = 26 - function number
* ebx = 6 - subfunction number
Returned value:
* eax = base port
Remarks:
* WSS base is used by function 27.
* To set WSS base port use subfunction 6 of function 21.
 
======================================================================
============== Function 26, subfunction 7 - get HD base. =============
======================================================================
The HD base defines hard disk to write with usage of obsolete
file system functions and functions implicitly using the hard disk
(such as subfunction 6 of function 18);
at usage of function 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
these function set base themselves.
Parameters:
* eax = 26 - function number
* ebx = 7 - subfunction number
Returned value:
* eax = HD base: 1=IDE0, 2=IDE1, 3=IDE2, 4=IDE3
Remarks:
* Any application in any time can change HD base.
* To set base use subfunction 7 of function 21.
* To get used partition of hard disk use subfunction 8.
 
======================================================================
========= Function 26, subfunction 8 - get used HD partition. ========
======================================================================
The HD partition defines partition of the hard disk to write with
usage of obsolete file system functions and functions implicitly
using the hard disk (such as subfunction 6 of function 18);
at usage of functions 58 and 70 and modern syntax /HD0,/HD1,/HD2,/HD3
these functions set base and partition themselves.
Parameters:
* eax = 26 - function number
* ebx = 8 - subfunction number
Returned value:
* eax = HD partition (beginning from 1)
Remarks:
* Any application in any time can change partition.
* To set partition use subfunction 8 of function 21.
* To get number of partitions on a hard disk use
subfunction 11 of function 18.
* To get base of used hard disk, use subfunction 7.
 
======================================================================
=== Function 26, subfunction 9 - get the value of the time counter. ==
======================================================================
Parameters:
* eax = 26 - function number
* ebx = 9 - subfunction number
Returned value:
* eax = number of 1/100s of second, past from the system boot time
Remarks:
* Counter takes modulo 2^32, that correspond to a little more
than 497 days.
* To get system time use function 3.
 
======================================================================
======== Function 26, subfunction 10 - get sound DMA channel. ========
======================================================================
Parameters:
* eax = 26 - function number
* ebx = 10 - subfunction number
Returned value:
* eax = number of the channel (from 0 to 3 inclusive)
Remarks:
* Number of the DMA channel is used by subfunction 1 of function 55.
* To set the sound DMA channel use subfunction 10 of function 21.
 
======================================================================
===================== Function 26, subfunction 11 ====================
========== Find out whether low-level HD access is enabled. ==========
======================================================================
Parameters:
* eax = 26 - function number
* ebx = 11 - subfunction number
Returned value:
* eax = 0/1 - disabled/enabled
Remarks:
* Is used in LBA read (subfunction 8 of function 58).
* To set current state use subfunction 11 of function 21.
 
======================================================================
===================== Function 26, subfunction 12 ====================
========== Find out whether low-level PCI access is enabled. =========
======================================================================
Parameters:
* eax = 26 - function number
* ebx = 12 - subfunction number
Returned value:
* eax = 0/1 - disabled/enabled
Remarks:
* Is used by operations with PCI bus (function 62).
* The current implementation uses only low bit of ecx.
* To set the current state use subfunction 12 of function 21.
 
======================================================================
======== Function 27 - set Windows Sound System (WSS) volume. ========
======================================================================
Parameters:
* eax = 27 - function number
* ebx = what to set:
* 1 - set common volume
* 2 - set Line In volume
* cl = volume level (0x0=highest, 0x1F=lowest,
if bit 0x80 is set=disable)
Returned value:
* eax = 0 - success
* eax = 1 - WSS base is not defined
* eax = 2 - incorrect subfunction
Remarks:
* Previously WSS base port must be defined by call to
subfunction 6 of function 21.
* Set of common volume is ignored (function simply returns eax=0).
* Old documentation and kernel sources erraticly name function 2
as CD-audio volume.
 
======================================================================
=================== Function 28 - set SB16 volume. ===================
======================================================================
Parameters:
* eax = 28 - function number
* ebx = what to install:
* 1 - install common volume
* 2 - install CD-audio volume
* cl = volume level (0=off, 0xFF=max)
Returned value:
* eax = 0 - success
* eax = 1 - SB base is not defined
* eax = 2 - incorrect subfunction
Remarks:
* Previously SB base port must be defined by
subfunction 4 of function 21.
* This function gives more variants for volume, that function 25.
 
======================================================================
=================== Function 29 - get system date. ===================
======================================================================
Parameters:
* eax = 29 - function number
Returned value:
* eax = 0x00DDMMYY, where
(binary-decimal coding, BCD, is used)
* YY = two low digits of year (00..99)
* MM = month (01..12)
* DD = day (01..31)
Remarks:
* To set system date use function 22.
 
======================================================================
=============== Function 32 - delete file from ramdisk. ==============
======================================================================
Parameters:
* eax = 32 - function number
* ebx = pointer to the filename
Returned value:
* eax = 0 - success; otherwise file system error code
Remarks:
* This function is obsolete; function 58 allows to fulfill
the same operations with the extended possibilities.
* The current implementation returns only values 0(success) and
5(file not found).
* The filename must be either in the format 8+3 characters
(first 8 characters - name itself, last 3 - extension,
the short names and extensions are supplemented with spaces),
or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
(name no more than 8 characters, dot, extension 3 characters
supplemented if necessary by spaces).
The filename must be written with capital letters. The terminating
character with code 0 is not necessary (not ASCIIZ-string).
* This function does not support folders on the ramdisk.
 
======================================================================
================ Function 33 - write file to ramdisk. ================
======================================================================
Parameters:
* eax = 33 - function number
* ebx = pointer to the filename
* ecx = pointer to data for writing
* edx = number of bytes for writing
* should be set esi=0
Returned value:
* eax = 0 - success, otherwise file system error code
Remarks:
* This function is obsolete; function 70 allows to fulfil
the same operations with extended possibilities.
* If esi contains non-zero value and selected file already exists,
one more file with the same name will be created.
* Otherwise file will be overwritten.
* The filename must be either in the format 8+3 characters
(first 8 characters - name itself, last 3 - extension,
the short names and extensions are supplemented with spaces),
or in the format 8.3 characters "FILE.EXT"/"FILE.EX "
(name no more than 8 characters, dot, extension 3 characters
supplemented if necessary by spaces).
The filename must be written with capital letters. The terminating
character with code 0 is not necessary (not ASCIIZ-string).
* This function does not support folders on the ramdisk.
 
======================================================================
======= Function 35 - read the color of a pixel on the screen. =======
======================================================================
Parameters:
* eax = 35
* ebx = y*xsize+x, where
* (x,y) = coordinates of a pixel (beginning from 0)
* xsize = horizontal screen size
Returned value:
* eax = color 0x00RRGGBB
Remarks:
* To get screen sizes use function 14. Pay attention,
that it subtracts 1 from both sizes.
* There is also direct access (without any system calls)
to videomemory through the selector gs. To get parameters of
the current videomode, use function 61.
 
======================================================================
========= Function 37 - get coordinates/status of the mouse. =========
======================================================================
 
---------- Subfunction 0 - screen coordinates of the mouse -----------
Parameters:
* eax = 37 - function number
* ebx = 0 - subfunction number
Returned value:
* eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
(beginning from 0)
 
-- Subfunction 1 - coordinates of the mouse relative to the window ---
Parameters:
* eax = 37 - function number
* ebx = 1 - subfunction number
Returned value:
* eax = x*65536 + y, (x,y)=coordinates of the mouse pointer
relative to the application window (beginning from 0)
Remarks:
* The value is calculated by formula (x-xwnd)*65536 + (y-ywnd).
If y>=ywnd, the low word is non-negative and contains
relative y-coordinate, and the high word - relative x-coordinate
(with correct sign). Otherwise the low word is negative and still
contains relative y-coordinate, and to the high word
1 should be added.
 
------------ Subfunction 2 - pressed buttons of the mouse ------------
Parameters:
* eax = 37 - function number
* ebx = 2 - subfunction number
Returned value:
* eax contains information on the pressed mouse buttons:
* bit 0 is set = left button is pressed
* bit 1 is set = right button is pressed
* other bits are cleared
 
======================================================================
====================== Function 38 - draw line. ======================
======================================================================
Parameters:
* eax = 38 - function number
* ebx = [start coordinate on axis x]*65536 +
[end coordinate on axis x]
* ecx = [start coordinate on axis y]*65536 +
[end coordinate on axis y]
* edx = 0x00RRGGBB - color
edx = 0x01xxxxxx - draw inversed line
(low 24 bits are ignored)
Returned value:
* function does not return value
Remarks:
* Coordinates are relative to the window.
* End point is also drawn.
 
======================================================================
== Function 39, subfunction 1 - get a size of the background image. ==
======================================================================
Parameters:
* eax = 39 - function number
* ebx = 1 - subfunction number
Returned value:
* eax = [width]*65536 + [height]
Remarks:
* There is a pair function to set sizes of background image -
subfunction 1 of function 15. After which it is necessary,
of course, anew to define image.
 
======================================================================
== Function 39, subfunction 2 - get pixel from the background image. =
======================================================================
Parameters:
* eax = 39 - function number
* ebx = 2 - subfunction number
* ecx = offset
Returned value:
* eax = 0x00RRGGBB - pixel color, if offset is valid
(less than 0x160000-16)
* eax = 2 otherwise
Remarks:
* Do not rely on returned value for invalid offsets, it may be
changed in future kernel versions.
* Offset for pixel with coordinates (x,y)
is calculated as (x+y*xsize)*3.
* There is a pair function to set pixel on the background image -
subfunction 2 of function 15.
 
======================================================================
== Function 39, subfunction 4 - get drawing mode for the background. =
======================================================================
Parameters:
* eax = 39 - function number
* ebx = 4 - subfunction number
Returned value:
* eax = 1 - tile
* eax = 2 - stretch
Remarks:
* There is a pair function to set drawing mode -
subfunction 4 of function 15.
 
======================================================================
=========== Function 40 - set the mask for expected events. ==========
======================================================================
The mask for expected events affects function working with events
10, 11, 23 - they notify only about events allowed by this mask.
Parameters:
* eax = 40 - function number
* ebx = mask: bit i corresponds to event i+1 (see list of events)
(set bit permits notice on event)
Returned value:
* function does not return value
Remarks:
* Default mask (7=111b) enables nofices about redraw,
keys and buttons. This is enough for many applications.
* Events prohibited in the mask are saved anyway, when come;
they are simply not informed with event functions.
* Event functions take into account the mask on moment of
function call, not on moment of event arrival.
 
======================================================================
==================== Function 41 - get IRQ owner. ====================
======================================================================
Parameters:
* eax = 41 - function number
* ebx = IRQ number, 0..15
Returned value:
* eax = owner PID
* eax = 0, if there is no owner
* eax = -1 for incorrect ebx
 
======================================================================
==================== Function 42 - read IRQ data. ====================
======================================================================
When an IRQ occurs, the system reads data from ports indicated
earlier by function 44 and writes this data to
internal buffer. This function reads out data from that buffer
bytewise.
Parameters:
* eax = 42 - function number
* ebx = IRQ number, 0..15
Returned value: (use value of ecx to distinguish)
* if the thread is not IRQ owner (or IRQ number is incorrect):
* ecx = 2
* if there is no data:
* eax = 0
* ecx = 1
* ebx destroyed
* if all is ok:
* eax = byte size of data, not yet read from buffer
* ecx = 0
* ebx = current byte
Remarks:
* Previously the thread must reserve indicated IRQ for itself
by function 45.
* The size of data buffer is 4000 bytes, on overflow
"fresh" data cease to be written in the buffer.
 
======================================================================
================ Function 43 - input/output to a port. ===============
======================================================================
 
------------------------ Output data to port -------------------------
Parameters:
* eax = 43 - function number
* bl = byte for output
* ecx = port number 0xnnnn (from 0 to 0xFFFF)
Returned value:
* eax = 0 - success
* eax = 1 - the thread has not reserved the selected port
 
------------------------ Input data from port ------------------------
Parameters:
* eax = 43 - function number
* ebx is ignored
* ecx = 0x8000nnnn, where nnnn = port number (from 0 to 0xFFFF)
Returned value:
* eax = 0 - success, thus ebx = entered byte
* eax = 1 - the thread has not reserved the selected port
Remarks:
* Previously the thread must reserve the selected port
for itself by function 46.
* Instead of call to this function it is better to use
processor instructions in/out - this is much
faster and a bit shorter and easier.
 
======================================================================
=========== Function 44 - define operations at IRQ arrival. ==========
======================================================================
At IRQ arrival the system can read the data from ports defined
by this function and write these data to internal buffer, whence
they can be read by ôóíêöèåé 42.
Parameters:
* eax = 44 - function number
* ebx = pointer to the array of structures each describing one port:
* +0: word: 0 means end of array, otherwise port number
* +2: byte: reserved (ignored)
* +3: byte: 1=read byte from this port, 2=read word
* ecx = IRQ number, 0..15
Returned value:
* eax = 0 - success
* eax = 1 - the thread is not owner of selected IRQ
Remarks:
* Previously the thread must reserve for itself selected IRQ
by function 45.
* First 16 ports are considered only.
* The current implementation considers incorrect value of field +3
as a signal to terminate IRQ processing.
 
======================================================================
=================== Function 45 - reserve/free IRQ. ==================
======================================================================
Parameters:
* eax = 45 - function number
* ebx = 0 - reserve, 1 = free
* ecx = IRQ number, 0..15
Returned value:
* eax = 0 - success
* eax = 1 - error (invalid IRQ number
or attempt to reserve not free IRQ
or to free IRQ, not reserved by this thread)
Remarks:
* IRQ reservation is required for functions 42 and 44.
* Only one thread can reserve the specific IRQ.
* IRQs, handled by the system itself, are reserved by the system
(thread 1) at booting.
* When a thread terminates, all reserved by it IRQs
are freed automatically.
 
======================================================================
====== Function 46 - reserve/free a group of input/output ports. =====
======================================================================
To work with reserved ports an application can access directly by
commands in/out (recommended way) and can use function 43
(not recommended way).
Parameters:
* eax = 46 - function number
* ebx = 0 - reserve, 1 - free
* ecx = start port number
* edx = end port number (inclusive)
Returned value:
* eax = 0 - success
* eax = 1 - error
Remarks:
* For ports reservation: an error occurs if and only if
one from the following condition satisfies:
* start port is more than end port;
* the selected range contains incorrect port number
(correct are from 0 to 0xFFFF);
* limit for the total number of reserved areas is exceeded
(maximum 255 are allowed);
* the selected range intersects with any of earlier reserved
* For ports free: an error is an attempt to free range,
that was not earlier reserved by this function
(with same ecx,edx).
* If an error occurs (for both cases) function performs no action.
* At booting the system reserves for itself ports 0..0xff, and if
COM-mouse is detected - additionally range of COM-ports
0x3f0..0x3ff and/or 0x2f0..0x2ff.
* When a thread terminates, all reserved by it ports
are freed automatically.
 
======================================================================
============= Function 47 - draw a number in the window. =============
======================================================================
Parameters:
* eax = 47 - function number
* ebx = parameters of conversion number to text:
* bl = 0 - ecx contains number
* bl = 1 - ecx contains pointer to dword-number
* bh = 0 - display in decimal number system
* bh = 1 - display in hexadecimal system
* bh = 2 - display in binary system
* áèòû 16-21 = how many digits to display
* áèòû 22-31 reserved and must be set to 0
* ecx = number (if bl=0) or pointer (if bl=1)
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
* esi = 0xX0RRGGBB:
* RR, GG, BB specify the color
* X = ABnn (bits)
* nn = font (0/1)
* A is ignored
* B=1 - fill background with the color edi
Returned value:
* function does not return value
Remarks:
* The given length must not exceed 60.
* The exactly given amount of digits is output. If number is small
and can be written by smaller amount of digits, it is supplemented
by leading zeroes; if the number is big and can not be written by
given amount of digits, extra digits are not drawn.
* Parameters of fonts are shown in the description of function 4
(text output).
 
======================================================================
========= Function 48, subfunction 0 - apply screen settings. ========
======================================================================
Parameters:
* eax = 48 - function number
* ebx = 0 - subfunction number
* ecx = 0 - reserved
Returned value:
* function does not return value
Remarks:
* Function redraws the screen after parameters change by
subfunctions 1 and 2.
* Function call without prior call to one of indicated subfunctions
is ignored.
* Function call with nonzero ecx is ignored.
 
======================================================================
=========== Function 48, subfunction 1 - set button style. ===========
======================================================================
Parameters:
* eax = 48 - function number
* ebx = 1 - subfunction number
* ecx = button style:
* 0 = flat
* 1 = 3d
Returned value:
* function does not return value
Remarks:
* After call to this function one should redraw the screen by
subfunction 0.
* Button style influences only to their draw of function 8.
 
======================================================================
====== Function 48, subfunction 2 - set standard window colors. ======
======================================================================
Parameters:
* eax = 48 - function number
* ebx = 2 - subfunction number
* ecx = pointer to the color table
* edx = size of the color table
(must be 40 bytes for future compatibility)
Format of the color table is shown in description of subfunction 3.
Returned value:
* function does not return value
Remarks:
* After call to this function one should redraw the screen by
subfunction 0.
* Table of standard colors influences only to applications,
which receive this table obviously (by subfunction 3)
and use it (specifying colors from it to drawing functions).
* Table of standard colors is included in skin and is installed
anew with skin installation (by subfunction 8).
* Color table can be viewed/changed interactively with
the application 'desktop'.
 
======================================================================
====== Function 48, subfunction 3 - get standard window colors. ======
======================================================================
Parameters:
* eax = 48 - function number
* ebx = 3 - subfunction number
* ecx = pointer to the buffer with size edx bytes,
where table will be written
* edx = size of color table
(must be 40 bytes for future compatibility)
Returned value:
* function does not return value
Format of the color table:
each item is dword-value for color 0x00RRGGBB
* +0: dword: frames - color of frame
* +4: dword: grab - color of header
* +8: dword: grab_button - color of button on header bar
* +12 = +0xC: dword: grab_button_text - color of text on button
on header bar
* +16 = +0x10: dword: grab_text - color of text on header
* +20 = +0x14: dword: work - color of working area
* +24 = +0x18: dword: work_button - color of button in working area
* +28 = +0x1C: dword: work_button_text - color of text on button
in working area
* +32 = +0x20: dword: work_text - color of text in working area
* +36 = +0x24: dword: work_graph - color of graphics in working area
Remarks:
* Structure of the color table is described in the standard
include file 'macros.inc' as 'system_colors'; for example,
it is possible to write:
sc system_colors ; variable declaration
... ; somewhere one must call
; this function with ecx=sc
mov ecx, [sc.work_button_text] ; read text color on
; buttin in working area
* A program itself desides to use or not to use color table.
For usage program must simply at calls to drawing functions select
color taken from the table.
* At change of the table of standard colors (by subfunction 2 with
the subsequent application of changes by subfunction 0 or
at skin set by subfunction 8) the system sends to all windows
redraw message (the event with code 1).
* Color table can be viewed/changed interactively with
the application 'desktop'.
 
======================================================================
============ Function 48, subfunction 4 - get skin height. ===========
======================================================================
Parameters:
* eax = 48 - function number
* ebx = 4 - subfunction number
Returned value:
* eax = skin height
Remarks:
* Skin height is defined as the height of a header
of skinned windows.
* See also general structure of window in the description
of function 0.
 
======================================================================
======== Function 48, subfunction 5 - get screen working area. =======
======================================================================
Parameters:
* eax = 48 - function number
* ebx = 5 - subfunction number
Returned value:
* eax = [left]*65536 + [right]
* ebx = [top]*65536 + [bottom]
Remarks:
* The screen working area defines position and coordinates of
a maximized window.
* The screen working area in view of normal work is all screen
without system panel (the application '@panel').
* (left,top) are coordinates of the left upper corner,
(right,bottom) are coordinates of the right lower one.
Thus the size of working area on x axis can be calculated by
formula right-left+1, on y axis - by formula bottom-right+1.
* See also function 14,
to get sizes of all screen.
* There is a pair function to set working area - subfunction 6.
 
======================================================================
======== Function 48, subfunction 6 - set screen working area. =======
======================================================================
Parameters:
* eax = 48 - function number
* ebx = 6 - subfunction number
* ecx = [left]*65536 + [right]
* edx = [top]*65536 + [bottom]
Returned value:
* function does not return value
Remarks:
* The screen working area defines position and coordinates of
a maximized window.
* This function is used only by the application '@panel',
which set working area to all screen without system panel.
* (left,top) are coordinates of the left upper corner,
(right,bottom) are coordinates of the right lower one.
Thus the size of working area on x axis can be calculated by
formula right-left+1, on y axis - by formula bottom-right+1.
* If 'left'>='right', x-coordinate of working area is not changed.
If 'left'<0, 'left' will not be set. If 'right' is greater than or
equal to screen width, 'right' will not be set.
Similarly on y axis.
* See also function 14,
to get sizes of all screen.
* There is a pair function to get working area - subfunction 5.
* This function redraws the screen automatically,
updating coordinates and sizes of maximized windows.
The system sends to all windows redraw message (the event 1).
 
======================================================================
=========== Function 48, subfunction 7 - get skin margins. ===========
======================================================================
Returns the area of a header of a skinned window, intended for
a text of a header.
Parameters:
* eax = 48 - function number
* ebx = 7 - subfunction number
Returned value:
* eax = [left]*65536 + [right]
* ebx = [top]*65536 + [bottom]
Remarks:
* An application decides itself to use or not to use this function.
* It is recommended to take into account returned value
of this function for choice of a place for drawing header text
(by function 4) or a substitute of header text
(at the discretion of an application).
 
======================================================================
============= Function 48, subfunction 8 - set used skin. ============
======================================================================
Parameters:
* eax = 48 - function number
* ebx = 8 - subfunction number
* ecx = pointer to a block for function 58, in
which the fields of intermediate buffer and file name are filled
Returned value:
* eax = 0 - success
* otherwise eax = file system error code; if file does not
contain valid skin, function returns error 3
(unknown file system).
Remarks:
* After successful skin loading the system sends to all windows
redraw message (the event 1).
* At booting the system reads skin from file 'default.skn'
on ramdisk.
* User can change the skin statically by creating hisself
'default.skn' or dynamically with the application 'desktop'.
 
======================================================================
=========== Function 49 - Advanced Power Management (APM). ===========
======================================================================
Parameters:
* eax = 49 - function number
* dx = number of the APM function
(analogue of ax in APM specification)
* bx, cx = parameters of the APM function
Returned value:
* 16-bit registers ax, bx, cx, dx, si, di and carry flag CF
are set according to the APM specification
* high halves of 32-bit registers eax, ebx, ecx,
edx, esi, edi are destroyed
Remarks:
* APM 1.2 specification is described in the document
"Advanced Power Management (APM) BIOS Specification"
(Revision 1.2), available at
http://www.microsoft.com/whdc/archive/amp_12.mspx;
besides it is included in famous Interrupt List by Ralf Brown
(http://www.pobox.com/~ralf/files.html,
ftp://ftp.cs.cmu.edu/afs/cs/user/ralf/pub/).
 
======================================================================
=================== Function 50 - set window shape. ==================
======================================================================
Normal windows have rectangular shape. This function can give to
a window any shape. The shape is given by a set of points inside
the base rectangle belonging to a window. Position and coordinates
of the base rectangle are set by function 0
and changed by function 67.
 
--------------------------- Set shape data ---------------------------
Parameters:
* eax = 50 - function number
* ebx = 0 - subfunction number
* ecx = pointer to shape data (array of bytes 0/1)
Returned value:
* function does not return value
 
-------------------------- Set shape scale ---------------------------
Parameters:
* eax = 50 - function number
* ebx = 1 - subfunction number
* ecx sets a scale: each byte of data defines
(2^scale)*(2^scale) pixels
Returned value:
* function does not return value
Remarks:
* Default scale is 0 (scale factor is 1). If in the shape data
one byte corresponds to one pixel, there is no necessity
to set scale.
* Let's designate xsize = window width (in pixels), ysize = height;
pay attention, that they are one pixel more than defined by
functions 0, 67.
* On definition of scale xsize and ysize must be divisible
on 2^scale.
* Byte of data on offset 'a' must be 0/1 and defines belonging
to a window of square with the side 2^scale (if scale=0,
this is one pixel) and coordinates of the left upper corner
(a mod (xsize shr scale), a div (xsize shr scale))
* Data size: (xsize shr scale)*(ysize shr scale).
* Data must be presented in the memory and not change
after set of shape.
* The system views the shape data at every window redraw by
function 0.
* The call of subfunction 0 with NULL pointer results in return
to the rectangular shape.
 
======================================================================
==================== Function 51 - create thread. ====================
======================================================================
Parameters:
* eax = 51 - function number
* ebx = 1 - unique subfunction
* ecx = address of thread entry point (starting eip)
* edx = pointer to thread stack (starting esp)
Returned value:
* eax = -1 - error (there is too many threads)
* otherwise eax = TID - thread identifier
</UL>
 
======================================================================
=== Function 52, subfunction 0 - get network driver configuration. ===
======================================================================
Parameters:
* eax = 52 - function number
* ebx = 0 - subfunction number
Returned value:
* eax = configuration dword
Remarks:
* Configuration dword can be set by subfunction 2.
* The kernel does not use this variable. The value of this
variable and working with it subfunctions 0 and 2 is represented
doubtful.
 
======================================================================
========= Function 52, subfunction 1 - get local IP-address. =========
======================================================================
Parameters:
* eax = 52 - function number
* ebx = 1 - subfunction number
Returned value:
* eax = IP-address (4 bytes)
Remarks:
* Local IP-address is set by subfunction 3.
 
======================================================================
=== Function 52, subfunction 2 - set network driver configuration. ===
======================================================================
Parameters:
* eax = 52 - function number
* ebx = 2 - subfunction number
* ecx = configuration dword; if low 7 bits derivate the number 3,
function [re-]initializes Ethernet-card, otherwise
Ethernet turns off
Returned value:
* if Ethernet-interface is not requested, function returns eax=2,
but this can be changed in future kernel versions
* if Ethernet-interface is requested, eax=0 means error
(absence of Ethernet-card), and nonzero value - success
Remarks:
* Configuration dword can be read by subfunction 0.
* The kernel does not use this variable. The value of this
variable, subfunction 0 and part of subfunction 2, which set it,
is represented doubtful.
 
======================================================================
========= Function 52, subfunction 3 - set local IP-address. =========
======================================================================
Parameters:
* eax = 52 - function number
* ebx = 3 - subfunction number
* ecx = IP-address (4 bytes)
Returned value:
* the current implementation returns eax=3, but this can be changed
in future versions
Remarks:
* Local IP-address can be get by subfunction 1.
 
======================================================================
= Function 52, subfunction 6 - add data to the stack of input queue. =
======================================================================
Parameters:
* eax = 52 - function number
* ebx = 6 - subfunction number
* edx = data size
* esi = data pointer
Returned value:
* eax = -1 - error
* eax = 0 - success
Remarks:
* This function is intended only for slow network drivers
(PPP, SLIP).
* Data size must not exceed 1500 bytes, though function
performs no checks on correctness.
 
======================================================================
Function 52, subfunction 8 - read data from the network output queue.
======================================================================
Parameters:
* eax = 52 - function number
* ebx = 8 - subfunction number
* esi = pointer to 1500-byte buffer
Returned value:
* eax = number of read bytes (in the current implementation
either 0 = no data or 1500)
* data was copied in buffer
Remarks:
* This function is intended only for slow network drivers
(PPP, SLIP).
 
======================================================================
============ Function 52, subfunction 9 - get gateway IP. ============
======================================================================
Parameters:
* eax = 52 - function number
* ebx = 9 - subfunction number
Returned value:
* eax = gateway IP (4 bytes)
 
======================================================================
=========== Function 52, subfunction 10 - get subnet mask. ===========
======================================================================
Parameters:
* eax = 52 - function number
* ebx = 10 - subfunction number
Returned value:
* eax = subnet mask
 
======================================================================
============ Function 52, subfunction 11 - set gateway IP. ===========
======================================================================
Parameters:
* eax = 52 - function number
* ebx = 11 - subfunction number
* ecx = gateway IP (4 bytes)
Returned value:
* the current implementation returns eax=11, but this can be changed
in future versions
 
======================================================================
=========== Function 52, subfunction 12 - set subnet mask. ===========
======================================================================
Parameters:
* eax = 52 - function number
* ebx = 12 - subfunction number
* ecx = subnet mask
Returned value:
* the current implementation returns eax=12, but this can be changed
in future versions
 
======================================================================
============== Function 52, subfunction 13 - get DNS IP. =============
======================================================================
Parameters:
* eax = 52 - function number
* ebx = 13 - subfunction number
Returned value:
* eax = DNS IP (4 bytes)
 
======================================================================
============== Function 52, subfunction 14 - set DNS IP. =============
======================================================================
Parameters:
* eax = 52 - function number
* ebx = 14 - subfunction number
* ecx = DNS IP (4 bytes)
Returned value:
* the current implementation returns eax=14, but this can be changed
in future versions
 
======================================================================
============ Function 53, subfunction 0 - open UDP-socket. ===========
======================================================================
Parameters:
* eax = 53 - function number
* ebx = 0 - subfunction number
* ecx = local port (only low word is taken into account)
* edx = remote port (only low word is taken into account)
* esi = remote IP
Returned value:
* eax = -1 = 0xFFFFFFFF - error; ebx destroyed
* eax = socket handle (some number which unambiguously identifies
socket and have sense only for the system) - success;
ebx destroyed
 
======================================================================
=========== Function 53, subfunction 1 - close UDP-socket. ===========
======================================================================
Parameters:
* eax = 53 - function number
* ebx = 1 - subfunction number
* ecx = socket handle
Returned value:
* eax = -1 - incorrect handle
* eax = 0 - success
* ebx destroyed
Remarks:
* The current implementation does not close automatically all
sockets of a thread at termination. In particular, one should not
kill a thread with many opened sockets - there will be an outflow
of resources.
* The current implementation does no checks on correctness
(function returns error only if thread tries to close not opened
socket with correct handle).
 
======================================================================
============== Function 53, subfunction 2 - poll socket. =============
======================================================================
Parameters:
* eax = 53 - function number
* ebx = 2 - subfunction number
* ecx = socket handle
Returned value:
* eax = number of read bytes
* ebx destroyed
Remarks:
* There is no checks for correctness.
 
======================================================================
========= Function 53, subfunction 3 - read byte from socket. ========
======================================================================
Parameters:
* eax = 53 - function number
* ebx = 3 - subfunction number
* ecx = socket handle
Returned value:
* if there is no read data: eax=0, bl=0,
other bytes of ebx are destroyed
* if there are read data: eax=number of rest bytes
(possibly 0), bl=read byte, other bytes of ebx are destroyed
Remarks:
* There is no checks for correctness.
 
======================================================================
========== Function 53, subfunction 4 - write to UDP-socket. =========
======================================================================
Parameters:
* eax = 53 - function number
* ebx = 4 - subfunction number
* ecx = socket handle
* edx = number of bytes to write
* esi = pointer to data to write
Returned value:
* eax = 0xffffffff - invalid handle
* eax = 0xffff - not enough memory
* eax = 0 - success
* ebx destroyed
Remarks:
* Check on validity of handle is minimal - only not very incorrect
not opened handles are eliminated.
* Number of bytes to write must not exceed 1500-28, though
the appropriate check is not made.
 
======================================================================
============ Function 53, subfunction 5 - open TCP-socket. ===========
======================================================================
Parameters:
* eax = 53 - function number
* ebx = 5 - subfunction number
* ecx = local port (only low word is taken into account)
* edx = remote port (only low word is taken into account)
* esi = remote IP
* edi = open mode: SOCKET_PASSIVE=0 or SOCKET_ACTIVE=1
Returned value:
* eax = -1 = 0xFFFFFFFF - error; ebx destroys
* eax = socket handle (some number which unambiguously identifies
socket and have sense only for the system) - success;
ebx destroyed
 
======================================================================
========= Function 53, subfunction 6 - get TCP-socket status. ========
======================================================================
Parameters:
* eax = 53 - function number
* ebx = 6 - subfunction number
* ecx = socket handle
Returned value:
* eax = socket status: one of
* TCB_LISTEN = 1
* TCB_SYN_SENT = 2
* TCB_SYN_RECEIVED = 3
* TCB_ESTABLISHED = 4
* TCB_FIN_WAIT_1 = 5
* TCB_FIN_WAIT_2 = 6
* TCB_CLOSE_WAIT = 7
* TCB_CLOSING = 8
* TCB_LAST_ASK = 9
* TCB_TIME_WAIT = 10
* TCB_CLOSED = 11
* ebx destroys
Remarks:
* There is no checks for correctness.
 
======================================================================
========== Function 53, subfunction 7 - write to TCP-socket. =========
======================================================================
Parameters:
* eax = 53 - function number
* ebx = 7 - subfunction number
* ecx = socket handle
* edx = number of bytes to write
* esi = pointer to data to write
Returned value:
* eax = 0xffffffff - error
* eax = 0xffff - not enough memory
* eax = 0 - success
* ebx destroyed
Remarks:
* Check on validity of handle is minimal - only not very incorrect
not opened handles are eliminated.
* Number of bytes to write must not exceed 1500-40, though
the appropriate check is not made.
 
======================================================================
=========== Function 53, subfunction 8 - close TCP-socket. ===========
======================================================================
Parameters:
* eax = 53 - function number
* ebx = 8 - subfunction number
* ecx = socket handle
Returned value:
* eax = -1 - invalid handle
* eax = 0xffff - not enough memory for socket close packet
* eax = 0 - success
* in many cases eax is destroyed (the result of function 'queue'
is returned) - probably this is bug, which will be corrected
* ebx destroyed
Remarks:
* The current implementation does not close automatically all
sockets of a thread at termination. In particular, one should not
kill a thread with many opened sockets - there will be an outflow
of resources.
* The current implementation does no checks on correctness
(function returns error only if thread tries to close not opened
socket with correct handle).
 
======================================================================
=== Function 53, subfunction 9 - check whether local port is free. ===
======================================================================
Parameters:
* eax = 53 - function number
* ebx = 9 - subfunction number
* ecx = local port number (low 16 bits are used only)
Returned value:
* eax = 0 - port is used
* eax = 1 - port is free
* ebx destroyed
 
======================================================================
= Function 53, subfunction 255 - debug information of network driver.
======================================================================
Parameters:
* eax = 53 - function number
* ebx = 255 - subfunction number
* ecx = type of requested information (see below)
Returned value:
* eax = requested information
* ebx destroyed
Possible values for ecx:
* 100: length of queue 0 (empty queue)
* 101: length of queue 1 (ip-out queue)
* 102: length of queue 2 (ip-in queue)
* 103: length of queue 3 (net1out queue)
* 200: number of items in the ARP table
* 201: size of the ARP table (in items) (20 for current version)
* 202: read item at edx of the ARP table to the temporary buffer,
whence 5 following types take information;
in this case eax is not defined
* 203: IP-address saved by type 202
* 204: high dword of MAC-address saved by type 202
* 205: low word of MAC-address saved by type 202
* 206: status word saved by type 202
* 207: ttl word saved by type 202
* 2: total number of received IP-packets
* 3: total number of transferred IP-packets
* 4: total number of dumped received packets
* 5: total number of received ARP-packets
* 6: status of packet driver, 0=inactive, nonzero=active
 
======================================================================
========== Function 55, subfunction 0 - load data for SB16. ==========
======================================================================
Parameters:
* eax = 55 - function number
* ebx = 0 - subfunction number
* ecx = pointer to data (is copied 64 kilobytes, is used as much as
set by subfunction 2)
Returned value:
* function does not return value
Remarks:
* Format and size of data are set by subfunction 2.
 
======================================================================
======== Function 55, subfunction 1 - begin play data on SB16. =======
======================================================================
Parameters:
* eax = 55 - function number
* ebx = 1 - subfunction number
Returned value:
* function does not return value
Remarks:
* Previously data must be loaded by subfunction 0 and
their format must be defined by subfunction 2.
* Function returns control, when playing of data began; after that
play goes independently from application (and does not use
processor time at all).
* Previously must be defined SB16 base port
(by subfunction 4 of function 21) and DMA channel
(by subfunction 10 of function 21).
 
======================================================================
======== Function 55, subfunction 2 - set format of SB16 data. =======
======================================================================
Parameters:
* eax = 55 - function number
* ebx = 2 - subfunction number
* ecx = 0 - set digit capacity
* edx = 1 - 8bit mono
* edx = 2 - 8bit stereo
* ecx = 1 - set data size
* edx = size in bytes
* ecx = 2 - set play frequency
* edx = frequency
Returned value:
* function does not return value
Remarks:
* When the system boots, it sets following default parameters:
digit capacity - 8bit mono, size - 64 Kb, frequency - 44100 Hz.
Nevertheless it is recommended to set necessary values obviously
as they could be reset by some application.
 
======================================================================
Function 55, subfunction 55 - begin to play data on built-in speaker.
======================================================================
Parameters:
* eax = 55 - function number
* ebx = 55 - subfunction number
* esi = pointer to data
Returned value:
* eax = 0 - success
* eax = 55 - error (speaker is off or busy)
Data is an array of items with variable length.
Format of each item is defined by first byte:
* 0 = end of data
* 1..0x80 = sets sound duration on 1/100 of second; sound note
is defined by immediate value of frequency
* following word (2 bytes) contains frequency divider;
frequency is defined as 1193180/divider
* 0x81 = invalid
* 0x82..0xFF = note is defined by octave and number:
* duration in 1/100 of second = (first byte)-0x81
* there is one more byte;
* (second byte)=0xFF - delay
* otherwise it looks like a*0x10+b, where b=number of the note in
an octave from 1 to 12, a=number of octave (beginning from 0)
Remarks:
* Speaker play can be disabled/enabled by
subfunction 8 of function 18.
* Function returns control, having informed the system
an information on request. Play itself goes independently from
the program.
* The data must be kept in the memory at least up to the end
of play.
 
======================================================================
=============== Function 56 - write file to hard disk. ===============
======================================================================
Parameters:
* eax = 56 - function number
* ebx = pointer to the file name
* ecx = size of data to write (in bytes)
* edx = pointer to data to write
* esi = pointer to path (ASCIIZ-string)
Returned value:
* eax = 0 - success, otherwise file system error code
Remarks:
* This function is obsolete; function 70 allows to fulfil the same
operations with the extended possibilities.
* This function assumes that during its call by one application
no other application works with hard disk.
* The path to file is ASCIIZ-string, which may be empty
(if the file is created in the root folder) or have the format
/d1/d2/.../dn, where all folder names must have the 8+3 format,
i.e. 8 characters of name and 3 characters of the extension
without separator, supplemented by blanks if necessary;
all letters must be capital.
* The file name must also have the format 8+3.
 
======================================================================
================ Function 58 - work with file system. ================
======================================================================
Parameters:
* eax = 58
* ebx = pointer to the information structure
Returned value:
* eax = 0 - success; otherwise file system error code
* some subfunctions return value in other registers too
General format of the information structure:
* +0: dword: subfunction number
* +4: dword: number of block
* +8: dword: size
* +12 = +0xC: dword: pointer to data
* +16 = +0x10: dword: pointer to a memory for system operations
(4096 bytes)
* +20 = +0x14: n db: ASCIIZ-string with the file name
Specifications - in documentation on the appropriate subfunction.
Filename is case-insensitive for latin letters, russian letters
must be capital.
Format of filename:
/base/number/dir1/dir2/.../dirn/file,
where /base/number identifies device, on which file is located:
one of
* /RD/1 = /RAMDISK/1 to access ramdisk
* /FD/1 = /FLOPPYDISK/1 to access first floppy drive,
/FD/2 = /FLOPPYDISK/2 to access second one
* /HD/x = /HARDDISK/x - obsolete variant of access to hard disk
(in this case base is defined by subfunction 7 of function 21),
x - partition number (beginning from 1)
* /HD0/x, /HD1/x, /HD2/x, /HD3/x to access accordingly to devices
IDE0 (Primary Master), IDE1 (Primary Slave),
IDE2 (Secondary Master), IDE3 (Secondary Slave);
x - partition number on the selected hard drive, varies from 1
to 255 (on each hard drive the indexing starts from 1)
Remarks:
* In the first two cases it is also possible to use FIRST
instead of 1, SECOND instead of 2, but it is not recommended
for convenience of transition to the future extensions.
* Limitation n<=39 is imposed.
* Names of folders and file dir1,...,dirn,file must have the
format 8.3: name no more than 8 characters, dot, extension no
more than 3 characters. Trailing spaces are ignored, no other
spaces is allowed. If name occupies equally 8 characters,
dot may be omitted (though it is not recommended to use this
feature for convenience of transition to the future extensions).
* This function does not support folders on ramdisk.
Examples:
* '/RAMDISK/FIRST/KERNEL.ASM',0
'/rd/1/kernel.asm',0
* '/HD0/1/kernel.asm',0
* '/hd0/1/menuet/pics/tanzania.bmp',0
Existing subfunctions:
* subfunction 0 - read file/folder
* subfunction 1 - rewrite file
* subfunction 2 - delete file/folder
* subfunction 4 - make folder
* subfunction 5 - rename/move file/folder
* subfunction 8 - LBA-read from device
* subfunction 15 - get file system information
 
======================================================================
=========== Function 58, subfunction 0 - read file/folder. ===========
======================================================================
Parameters:
* eax = 58
* ebx = pointer to the information structure
Format of the information structure:
* +0: dword: 0 = subfunction number
* +4: dword: first block to read (beginning from 0)
* +8: dword: amount of blocks to read
* +12 = +0xC: dword: pointer to buffer for data
* +16 = +0x10: dword: pointer to buffer for system operations
(4096 bytes)
* +20 = +0x14: ASCIIZ-name of file, the rules of names forming are
given in the general description
Returned value:
* eax = 0 - success, otherwise file system error code
* ebx = file size (in bytes) or -1=0xffffffff, if file was not found
Remarks:
* Block size is 512 bytes.
* This function is obsolete, for reading files use subfunction 0
of function 70, for reading folders - subfunction 1 of
function 70.
* Function can read contents of a folder. Only FAT file system is