⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 writefb.asm

📁 实现windows系统下的整盘拷贝
💻 ASM
字号:
STACK	SEGMENT PARA STACK 'STACK'
        DB      64 DUP('STACK')
STACK   ENDS

DSEG    SEGMENT PARA PUBLIC 'DATA'
        hand dw 0
        FILENAME DB 'F144.DAT',0,0
        HANDLE Dw 0
        MYDATA DB 24h*200h dup ('d')
        cmyont   db 0
        pin db '.$'
        WMessage db 13,10,'There is a error. about?(a) quit?(q)',13,10,'$'
        aa db 'a'
        ab db 'A'
        qa db 'q'
        qb db 'Q'
        WarningMSG db 'This operation will erase all data on floppy driver A,continue? (y/n)','$'
	ya db 'y'
	yb db 'Y'
        na db 'n'
        nb db 'N'
        dispret db 13,10,'$'
DSEG	ENDS

CSEG    SEGMENT PARA PUBLIC 'CODE'
        ASSUME CS:CSEG,DS:DSEG,SS:STACK
ENTRY   PROC FAR
        MOV     AX,DSEG
        mov     es,ax
        MOV     DS,AX           ;GRT READY
        mov     ax,0900h        ;Display Warning Message
        mov     dx,offset WarningMSG
        int     21h
InputAgain:
        mov     ax,0100h
        int     21h
        cmp     al,ya
        je      ContinueWrite
        cmp     al,yb
        je      ContinueWrite
        cmp     al,na
        je      quitnow
        cmp     al,nb
        je      quitnow
        jmp     InputAgain
quitnow:
        pop     ax
        mov     ax,4c01h        ;end
        int	21h
 	ret
ContinueWrite:
        MOV     AX,0                    ;reset disk
        MOV     BX,0
        MOV     CX,0
        MOV     DX,0
        MOV     AX,0212H
        MOV     BX,OFFSET MYDATA
        mov     ch,0
        MOV     CL,1H
        MOV     DX,0001H
        INT     13H
        mov     ax,0000h        ;reset disk
        mov     dl,01h
        int     13h
        call    error
        MOV     AX,3D00H        ;OPEN
        MOV     AL,00H
        MOV     DX,OFFSET FILENAME
        INT     21H
        call    error
        MOV     HANDLE,AX
read::
	mov     ah,3fh          ;read file(1)
        mov     bx,handle
        mov     cx,12h*200h
        mov     dx,offset mydata
        int     21h
        call    error           ;if there is a error
        MOV     AX,0                    ;write disk(1)
        MOV     BX,0
        MOV     CX,0
        MOV     DX,0
        MOV     AX,0312H
        MOV     BX,OFFSET MYDATA
        mov     ch,cmyont
        MOV     CL,1H
        MOV     DX,0001H
        INT     13H
        call    error           ;if there is a error
	mov     ah,3fh          ;read file(2)
        mov     bx,handle
        mov     cx,12h*200h
        mov     dx,offset mydata
        int     21h
        call    error           ;if there is a error
        MOV     AX,0                    ;write disk(2)
        MOV     BX,0
        MOV     CX,0
        MOV     DX,0
        MOV     AX,0312H
        MOV     BX,OFFSET MYDATA
        mov     ch,cmyont
        MOV     CL,1H
        MOV     DX,0101H
        INT     13H
        call    error           ;if there is a error

        call    display
        mov     ah,cmyont         ;jump
        inc     ah
        mov     cmyont,ah
        mov     al,80
        cmp     ah,al
        jb      read

        mov     ax,0            ;close
        mov     bx,0
        mov     cx,0
        mov     dx,0
        MOV     AX,3E00H
        MOV     BX,HANDLE
        INT     21H
        call    error           ;if there is a error
        mov     ax,4c01h        ;end
        int	21h

error   proc near
        jc	wrong
        ret
wrong:  mov	ax,0900h
        mov     dx,offset wmessage
        int     21h
        mov     ax,0100h
        int     21h
        cmp     al,aa
        je      about
        cmp     al,ab
        je      about
        cmp     al,qa
        je      quit
        cmp     al,qb
        je      quit
        jmp     wrong
quit:   pop     ax
        mov     ax,4c01h        ;end
        int	21h
about: 	ret
error   endp

display proc near
        mov   ax,0900h
        mov   dx,offset pin
        int   21h
        ret
display endp
ENTRY   ENDP
CSEG    ENDS
        END ENTRY

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -