• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >汇编语言 > 汇编源码系列之cldoc12

汇编源码系列之cldoc12

作者:匿名 字体:[增加 减小] 来源:互联网 时间:2017-06-28

匿名通过本文主要向大家介绍了汇编源码,易语言反汇编源码,win7用远程汇编源码,反汇编源码,易语言汇编源码等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
</div>

这个都是过去DOS时代的汇编源码,虽然已经过去了,但是对于学习汇编还是有帮助的,汇编语言只是程序员一门基础语言,大多人掌握即可,不一定要深入研究.......

;************************************************************************
;*                                   *
;*   CleanDoc 1.2 (C) 1997 RonSoft.                 *
;*                                   *
;*   This is a simple litte assembler program that cleans out    *
;*   the documents folder in the start menu.             *
;*   This is version 1.2                       *
;*   There's no command line switches and stuff.           *
;*   It gives NO messages if everything goes allright.        *
;*   It check for a environment variable called CLEANDIR and CD:s  *
;*   down to that dir if the variable is found. If not it uses    *
;*   the default WINDOWSRECENT directory and deletes(UNLINKS)    *
;*   EVERYTHING it finds there, and CD:s back to where it started  *
;*   from.                              *
;*                                   *
;*   Comments, suggestions:                     *
;*   Ronald Nordberg.                        *
;*   Silverv刧en 3                          *
;*   907 50 Ume?                          *
;*   Sweden.                             *
;*   http://home2.swipnet.se/~w-20064                *
;*   christine.martinson@swipnet.se                 *
;*                                   *
;*   THIS PROGRAM ARE COPYRIGHTED FREEWARE.             *                                   *
;*                                   *
;************************************************************************
                    ;some euqates for readability
kbd       equ   16h       ;keyboard irq
msdos      equ   21h       ;MSDOS irq
reset      equ   0dh       ;disk reset
dfopen     equ   0fh       ;open disk file
dfclose     equ   10h       ;close disk file
searchf     equ   11h       ;search first
searchn     equ   12h       ;search next
seqread     equ   14h       ;sequential disk read
seqwrite    equ   15h       ;   "    " write
getdisk     equ   19h       ;get current disk(default)
setdta     equ   1ah       ;set disk transfer area address
setdir     equ   3bh       ;set current directory
createf     equ   3ch       ;create file with handle
openf      equ   3dh       ;open file with handle
closef     equ   3eh       ;close file with handle
readf      equ   3fh       ;read from file with handle
writef     equ   40h       ;write to file with handle
unlink     equ   41h       ;UNLINK(delete file)
getdir     equ   47h       ;get current directory
allocmem    equ   48h       ;allocate memory
freemem     equ   49h       ;free memory
changebs    equ   4ah       ;change block size
findfirst    equ   4eh       ;find first file
findnext    equ   4fh       ;find next file
exit      equ   4c00h      ;msdos exit
envir      equ   2ch       ;offset ENVIRONMENT block
[BITS 16]                ;NASM STUFF !?
[ORG 100h]
    mov   ax,cs          ;get code segment
    mov   ds,ax          ;use it now
    mov   [comseg],ds
    mov   [extseg],es
;************************ setup and preparing ***************************
main:
    mov   ah,setdta        ;set our DTA-area
    mov   dx,mydta        ;buffer for it
    int   msdos          ;call dos
    mov   ah,getdisk       ;get default drive
    int   msdos          ;call dos
    add   al,41h         ;drive in al, make it ASCII
    mov   byte [curdir],al    ;fill buffer with name (A:..etc)
    mov   byte [path],al     ;and default path
    
    mov   word [curdir+1],":"  ;copy separator to path
    mov   si,curdir        ;pointer path buffer
    add   si,3          ;offset doscall part
    mov   ah,getdir        ;get current dir
    mov   dl,0          ;0 = default
    int   msdos          ;call dos
    jnc   diskok         ;ok
    mov   bx,errt0        ;could not find current dir ?? If You
    jmp   errout         ;get an error here You probably have
diskok:                 ;forgot to turn on Your computer.
    call  getenv         ;check out if any ENV var
    cmp   dx,-1          ;was it there
    je   findfile        ;yeahh
    mov   dx,path         ;noo way, use default path
    mov   ah,setdir        ;cd down
    int   msdos          ;call dos
    jnc   findfile        ;all ok
    mov   bx,errt1        ;error
    jmp   errout         ;skip
;*************************** the delete file loop ***********************
findfile:
    mov   ah,findfirst      ;see if the files out there
    mov   cx,0fh         ;all files
    mov   dx,files        ;our NULL terminated filname(*.*)
    int   msdos          ;do the stuff
    jnc   delit          ;all ok, must delete first file
    jmp   goback         ;error, CD back and skip
found:                 ;found something
    mov   dx,files        ;files (*.*)
    mov   ah,findnext       ;the function
    int   msdos          ;call dos
    jc   goback         ;no more files, quit
delit:
    mov   ah,unlink        ;UNLINK (delete) file
    mov   dx,mydta        ;pointer Disk Transfer Area
    add   dx,30          ;offset Filename
    int   msdos          ;delete it
    jnc   found          ;deleted ok
    mov   bx,errt2        ;could not delete it ????
    call  write          ;let us know
    mov   bx,mydta        ;show wich file
    add   bx,30          ;offset filename in DTA
    call  write          ;write out filename
    mov   bx,linefeed       ;linefeed
    jmp   errout         ;and skip
goback:
    mov   ah,setdir        ;CD back to origin
    mov   dx,curdir        ;path to dir
    int   msdos          ;do it
    jnc   quit          ;all ok, proceed
    mov   bx,errt1        ;error, get text
    
;***********

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • 汇编源码系列之inthand
  • 汇编源码系列之cdcheck
  • 汇编源码系列之cldoc12
  • 汇编源码系列之basload
  • 汇编源码系列之basmain
  • 汇编源码系列之brk2
  • 汇编源码系列之cleanf
  • 汇编源码系列之charop
  • 汇编源码系列之sertype
  • 汇编源码系列之comint

相关文章

  • 2017-06-28汇编教程之处理鼠标按键消息
  • 2017-06-28汇编语言程序设计(三)
  • 2017-06-28汇编源码系列之fxn
  • 2017-06-28汇编源码系列之clear
  • 2017-06-17变量和标号的属性
  • 2017-06-28V86模式切换程序
  • 2017-06-28TASM V5.0安装及注意事项
  • 2017-06-28内存映射文件原理及实例
  • 2017-06-28鼠标控制CD-Audio播放程序
  • 2017-06-28汇编与C语言的配合使用

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • 汇编教程:使用语句
    • Windows下的控制台输出
    • 中断传送方式
    • WINDOWS钩子函数详解
    • 除运算指令
    • 汇编教程:虚拟设备驱动程序结构
    • 加法指令
    • 汇编教程:Win32调试API
    • 汇编语言的艺术-基本认识(二)
    • 一个win32汇编语言程序示例

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有