📄 smartcop.asm
字号:
INCLUDE biosio.inc
INCLUDE biosdata.inc
INCLUDE newmac.inc
INCLUDE struct.inc
.model small
.code
EXTRN pile_sta:near
EXTRN write_mille:near
EXTRN dir_it:near
EXTRN put_scrn:near
EXTRN close_win:near
EXTRN ret_scrn:near
write_prot_win EQU 8e4h ;window positions
screen_line EQU 0a0h
format_win EQU 800h
write_pos EQU format_win-4f4h
nmi EQU 80h
cmos_port EQU 70h
cmos_data EQU 71h
begn:
mov ax,@Data
mov ds,ax
mov cl,4
lea dx,end_dat1 ;get segment of extra data segment
shr dx,cl
inc dx
add ax,dx
mov ds:[dat2],ax ;get original vector for int 24
lea bx,boot_buffer
mov ax,ds
shl ax,cl
add ax,bx ;check to see if the buffer for the boot sector is
jnc goed_buf ;not on a 64k boundry if it is then move it 200h
add bh,2
goed_buf:
mov ds:[boot_buf_adrs],bx
mov ax,3524h ;the critical error interupt
int 21h
mov ds:[old_int24],bx
mov ds:[old_int24+2],es ;and save it for later
push ds
push cs
pop ds
lea dx,int24 ;replace int 24 with the one for this program
mov ax,2524h
int 21h
pop ds
mov ah,34h
int 21h
mov word ptr ds:[indos],bx
mov word ptr ds:[indos+2],es
mov ah,62h
int 21h ;get current psp
mov es,bx
mov es,es:psp.psp_enviorment ;find the begining of the enviorment strings
mov al,'C' ;the COMSPEC= string is always the first in the
xor di,di ;enviorment string ????? do the search anyway
we_do:
mov cx,7fffh
sub cx,di
repne scasb
mov cx,7
lea si,spec_str
repe cmpsb
jnz we_do
mov al,es:[di] ;now you have the string COMSPEC=?:\command.com
mov ds:[io_sys],al ;this is the boot drive. Put this in the string
mov ds:[ms_sys],al ;so that it can be used to find io.sys and msdos.sys
push ds
push es
push ds
pop es
pop ds
mov si,di
lea di,comspec_prog ;get the string that defines the COM driver
com_ger: ;ie. command.com and place in memory
lodsb
stosb
or al,al
jnz com_ger
pop ds
mov ah,30h ;get dos version in ax
int 21h
push ax
cmp al,4 ;if the dos version is less than four then the
jae ingg
jmp no_kan_dos ;routine can not be used
nop
ingg:
mov ah,2fh ;the the address of the DTA in ES:BX to use in the
int 21h ;get file name routine that follows
push bx
mov ax,3305h ;get the boot drive
int 21h
add dl,'@' ;change drive number to letter A: to Z:
mov ds:[get_boot],dl ;put it in the strings needed for the format routine
mov ds:[io_sys],dl
mov ds:[ms_sys],dl
mov ah,4eh ;filename of the IO file so as io.sys or ibmbio.com
mov cx,6
lea dx,sys_find ;this is the string 'C:\*.*' for get first file
int 21h
jc bazi
lea dx,io_sys
mov cx,6
mov ah,4eh
int 21h ;cleck for error - other file names?
bazi:
mov cl,14
lea si,io_sys+3
golast:
mov al,es:[bx+1eh] ;put it in the string
mov [si],al
inc bx
inc si
or al,al
loopnz golast
lea si,type_boot
lea bx,io_sys+3
mov cl,9
reppa:
dec cx
jz okky
mov al,ds:[bx]
inc bx
cmp al,'.'
je casma
mov cs:[si],al
inc si
jmp reppa
casma:
mov al,' '
lino:
mov cs:[si],al
inc si
dec cx
jnz lino
okky:
mov ax,ds:[bx]
mov cs:[si],ax
mov al,ds:[bx+2]
mov cs:[si+2],al
pop bx
lea si,ms_sys+3
mov ah,4eh
mov cx,6 ;filename of the DOS file msdos.sys or ibmdos.com
lea dx,dos_find
int 21h
jc bazo
lea dx,ms_sys
mov cx,6
mov ah,4eh
int 21h ;cleck for error - other file names?
bazo:
mov cx,14
folast:
mov al,es:[bx+1eh]
mov [si],al
add bx,1
inc si
or al,al
loopne folast
lea si,type_boot+11
lea bx,ms_sys+3
mov cl,9
reppaa:
dec cx
jz okkya
mov al,ds:[bx]
add bx,1
cmp al,'.'
je casmaa
mov cs:[si],al
inc si
jmp reppaa
casmaa:
mov al,' '
linoa:
mov cs:[si],al
inc si
dec cl
jnz linoa
okkya:
mov ax,ds:[bx]
mov cs:[si],ax
mov al,ds:[bx+2]
mov cs:[si+2],al
no_kan_dos:
mov ah,52h ;Get DOS list of lists to find
int 21h
pop ax ;number of drives in es:bx version
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -