| Profiel van 核桃乐园我是我Foto'sWeblogLijsten | Help |
|
我是我总在挫折中爬起 11-5-2007 如何在开机启动时自动打开小键盘灯(NumLock数字锁定键)打开注册表编辑器,找到HKEY_USERS\.DEFAULT\ControlPanel\Keyboard,将它下面的InitialKeyboardIndicators的键值改为“2”,退出注册表编辑器,重新启动计算机,你就会发现数字小键盘的灯不再熄灭了。 另外,仅需要对config.sys文件动点小手术即可达到此目的。设置方法如下: 1.单击“开始”菜单中的“运行”命令,然后在“打开”框中键入“sysedit”,按下回车键,打开“系统配置编辑程序”窗口。 2.单击“Config.sys”标题栏,将它切换为当前编辑窗口,然后在编辑区中键入“NumLock=ON”这一行命令。 3.保存修改并关闭“系统配置编辑程序”窗口。 23-9-2006 DIR_x(续);接上贴
;--------------------------------------- time: pop dx mov cx,7 blank1: mov dl,' ' mov ah,02h int 21h loop blank1 mov dx,ds:[80h+16h] mov cl,5 rol dx,cl mov al,dl and al,1fh push dx mov dl,30h mov dh,10 go_on: sub al,dh jb back inc dl jmp go_on back: add al,dh push ax mov ah,02h int 21h pop ax cmp dh,1 jz minute mov dh,1 mov dl,30h jmp go_on minute: mov dl,':' push ax mov ah,02h int 21h pop ax pop dx mov cl,6 rol dx,cl mov al,dl and al,3fh push dx mov dl,30h mov dh,10 go_on_m: sub al,dh jb back_m inc dl jmp go_on_m back_m: add al,dh push ax mov ah,02h int 21h pop ax cmp dh,1 jz second mov dh,1 mov dl,30h jmp go_on_m second: mov dl,':' push ax mov ah,02h int 21h pop ax pop dx mov cl,5 rol dx,cl mov al,dl and al,1fh shl al,1 push dx mov dl,30h mov dh,10 go_on_s: sub al,dh jb back_s inc dl jmp go_on_s back_s: add al,dh push ax mov ah,02h int 21h pop ax cmp dh,1 jz attribute mov dh,1 mov dl,30h jmp go_on_s attribute: pop dx mov bl,ds:[80h+15h] test bl,10h jz sizes mov cx,3 blank2: mov dl,' ' mov ah,02h int 21h loop blank2 mov dl,'<' mov ah,02h int 21h mov dl,'D' mov ah,02h int 21h mov dl,'I' mov ah,02h int 21h mov dl,'R' mov ah,02h int 21h mov dl,'>' mov ah,02h int 21h jmp blank5_begin sizes: mov cx,8 blank3: mov dl,' ' mov ah,02h int 21h loop blank3 blank4_begin: mov cx,3 blank4: mov dl,' ' mov ah,02h int 21h loop blank4 call oput_fil_size jmp names blank5_begin: mov cx,16 jmp blank5 names: mov cx,3 blank5: mov dl,' ' mov ah,02h int 21h loop blank5 call oput_fil_nam call crlf ret0: pop dx pop cx pop bx pop ax ret routine endp ;***************************** routine_p proc near push ax push bx push cx push dx call routine ;----------------------------------------------- ;如果file_num为24的倍数,则输出信息; ;接受信息后,清屏 xor bx,bx mov ax,es:file_num mov bl,24 div bl test ah,0ffh jnz ret_routine_p mov cx,6 output_symbol: mov dl,'.' mov ah,2 int 21h loopz output_symbol mov ah,7 int 21h call clear_screen ret_routine_p: pop dx pop cx pop bx pop ax ret routine_p endp ;************************************ routine_w proc near push ax push bx push cx push dx mov cx,12 ;为输出字符计数 mov bl,ds:[80h+15h] test bl,10h jz file_name mov dl,'[' mov ah,2 int 21h dec cx file_name: call oput_fil_nam mov bl,ds:[80h+15h] test bl,10h jz if_need_blank_begin mov dl,']' mov ah,2 int 21h dec cx if_need_blank_begin: add cx,3 if_need_blank: mov dl,' ' mov ah,2 int 21h loop if_need_blank xor bx,bx mov ax,es:file_num mov bl,5 div bl test ah,0ffh jnz ret_routine_w call crlf ret_routine_w: pop dx pop cx pop bx pop ax ret routine_w endp ;********************************* routine_p_w proc near push ax push bx push cx push dx call routine_w ;----------------------------------------------- ;如果file_num为120的倍数,则输出信息; ;接受信息后,清屏 xor bx,bx mov ax,es:file_num mov bl,120 div bl test ah,0ffh jnz ret_routine_p_w mov cx,6 output_symbol_p_w: mov dl,'.' mov ah,2 int 21h loopz output_symbol_p_w mov ah,7 int 21h call clear_screen ret_routine_p_w: pop dx pop cx pop bx pop ax ret routine_p_w endp ;********************************** clear_screen proc near push ax push bx push cx push dx mov ah,6 mov al,0 mov bh,7 mov cx,0 mov dh,24 mov dl,79 int 10h mov dl,0dh mov ah,2 int 21h pop dx pop cx pop bx pop ax ret clear_screen endp ;********************************* oput_fil_size proc near .386 push ax push bx push cx push dx mov es:[flag],0 mov eax, dword ptr ds:[80h+1ah] mov ecx, 1000000000 mov dl,30h go_on_size: sub eax,ecx jb back_size inc dl jmp go_on_size back_size: add eax,ecx cmp dl,30h jnz output_num test es:[flag],0ffh jnz output_num mov dl,' ' push ax mov ah,2 int 21h pop ax jmp if_over output_num: push ax mov ah,2 int 21h pop ax mov es:[flag],1 cmp ecx,1 jz ret_oput_fil_size if_over: push eax mov eax,ecx xor edx,edx mov ecx,10 div ecx mov ecx,eax pop eax mov dl,30h jmp go_on_size ret_oput_fil_size: pop dx pop cx pop bx pop ax ret oput_fil_size endp ;********************************* oput_fil_nam proc near mov si,80h+1eh next_char: lodsb cmp al,0 jz ret2 mov dl,al mov ah,2 int 21h dec cx jmp next_char ret2: ret oput_fil_nam endp ;************************************ crlf proc near mov dl,0dh mov ah,2 int 21h mov dl,0ah mov ah,2 int 21h ret crlf endp ;************************************* end main 一个实现DOS命令DIR的程序(汇编),可跟/P/W参数 .model small
.stack 100h .data para db 2 dup(?) ;参数/p或/w para_num dw 0 ;参数个数 crt_path db 128 dup(?) ;经过处理后要查找的asciiz串 path db 128 dup(?) ;要查找路径的asciiz串 finded db 43 dup(?) ;找到的文件的dta dri_flag db 0 ;如果为1,则给出路径中带驱动器号 fil_flag db 0 ;标识给出路径中是否含有文件名 flag db 0 err1_info db 'parameter error!!!',0ah,0dh,'$' err2_info db 'search error!!!',0ah,0dh,'$' file_num dw 0 ;找到的文件个数 branch_table dw routine0 dw routine1 dw routine2 dw routine3 .code main proc far mov ax,@data mov es,ax call GET_COM_LINE call SEARCH_DIR mov ax,4c00h int 21h main endp ;************************************************************* GET_COM_LINE PROC NEAR ;本程序将命令行所有参数存入para;将要查找的路径串存入crt_path mov si,81h
mov di,offset path cld lop1: lodsb cmp al,0dh jz lop1_end cmp al,' ' jbe lop1 cmp al,'.' jnz con mov bl,1 mov es:[fil_flag],bl stosb jmp lop1 con: cmp al,'/' jz store_para cmp al,':' jnz next ;-------------------------------- ;处理驱动器号 mov bl,1 mov es:[dri_flag],bl stosb cmp byte ptr[si],'\' jnz store_char lodsb stosb jmp lop1 store_char: mov al,'\' stosb jmp lop1 ;--------------------------------- ;将参数存入para store_para: add word ptr es:[para_num],1 lodsb push di mov di,offset para add di,word ptr es:[para_num] dec di stosb pop di jmp lop1 ;------------------------------------ next: stosb jmp lop1 lop1_end: xor al,al stosb ;检验命令行是否给出驱动器号 mov bl,es:[dri_flag] or bl,bl jnz copy ;将命令行路径附到当前路径下 push es pop ds mov ah,19h ;得到当前驱动器号 int 21h inc al mov bl,al add bl,40h mov crt_path,bl mov byte ptr[crt_path+1],':' mov byte ptr[crt_path+2],'\' mov dl,al mov si,offset crt_path add si,3 mov ah,47h int 21h compare: cmp byte ptr[si],0 jz ok inc si jmp compare ok: mov byte ptr[si],'\' inc si push si mov si,offset path pop di jmp move copy: mov si,offset path mov di,offset crt_path move: push es pop ds call MOV_BYTE cmp si,offset path+1 jz test1 mov bl,es:[fil_flag] or bl,bl jnz ret1 mov al,'\' stosb test1: mov bl,es:[fil_flag] or bl,bl jnz ret1 mov al,'*' stosb mov al,'.' stosb mov al,'*' stosb ret1: ret GET_COM_LINE ENDP ;************************************************ MOV_BYTE PROC NEAR lodsb or al,al jz mb_ret stosb jmp short mov_byte mb_ret: ret MOV_BYTE ENDP ;****************************************************** SEARCH_DIR PROC NEAR push ds push es push ax push bx push cx push dx ;检验参数是否合法 mov bx,para_num cmp bx,1 jz check jb o_k cmp bx,2 ja error1 mov para_num,3 jmp o_k check: cmp para,'p' jz o_k cmp para,'w' jnz error1 mov para_num,2 o_k: mov dx,offset crt_path mov cx,37h ;查找所有属性文件 mov ah,4eh int 21h jc oput_err2 add es:file_num,1 call deal_with_dta next1: mov ah,4fh int 21h jnc deal cmp ax,12h jz ret_main call oput_err2 jmp ret_main deal: add es:file_num,1 call deal_with_dta jmp next1 error1: call oput_err1 jmp ret_main ;--------------------------------------- ;输出一号错误信息 oput_err1 proc near push ds push dx mov dx,offset err1_info mov ah,09h int 21h pop dx pop ds ret oput_err1 endp ;------------------------------------- ;输出2号错误信息 oput_err2 proc near push ds push dx mov dx,offset err2_info mov ah,09h int 21h pop dx pop ds ret oput_err2 endp ;-------------------------------------------- ret_main: pop dx pop cx pop bx pop ax pop es pop ds ret SEARCH_DIR ENDP ;********************************************* deal_with_dta proc near push ds push bx push si mov ah,51h int 21h mov ds,bx mov si,es:[para_num] shl si,1 jmp es:branch_table[si] routine0: call routine jmp ret_search_dir routine1: call routine_p jmp ret_search_dir routine2: call routine_w jmp ret_search_dir routine3: call routine_p_w jmp ret_search_dir ret_search_dir: pop si pop dx pop ds ret deal_with_dta endp ;********************************************** routine proc near push ax push bx push cx push dx mov dx,ds:[80h+18h] mov cl,7 rol dx,cl mov bx,dx and bx,007fh add bx,1980 push dx mov dl,30h mov ax,1000 go_next_y: sub bx,ax jb back_y inc dl jmp go_next_y back_y: add bx,ax push ax mov ah,02h int 21h pop ax cmp ax,1 jz month mov cl,10 div cl mov dl,30h jmp go_next_y month: mov dl,'-' push ax mov ah,02h int 21h pop ax pop dx mov cl,4 rol dx,cl mov al,dl and al,0fh push dx mov dl,30h mov dh,10 go_next_m: sub al,dh jb back_month inc dl jmp go_next_m back_month: add al,dh push ax mov ah,02h int 21h pop ax cmp dh,1 jz day mov dh,1 mov dl,30h jmp go_next_m day: mov dl,'-' push ax mov ah,02h int 21h pop ax pop dx mov cl,5 rol dx,cl mov al,dl and al,1fh push dx mov dl,30h mov dh,10 go_next_d: sub al,dh jb back_d inc dl jmp go_next_d back_d: add al,dh push ax mov ah,02h int 21h pop ax cmp dh,1 jz time mov dh,1 mov dl,30h jmp go_next_d |
||||
|
|