I want to read a file that is saved in hard drive to read through assembly language -
the codes shown below structure read file has been saved in computer. how can make program read hard drive? codes shown below sample of codes using in program
code segment main proc far ;housekeeping section assume cs:code,ds:data,ss:stacks mov ax,data ;establish addressability mov ds,ax ;to data segment ;main process section xor ax,ax xor bx,bx xor cx,cx xor dx,dx ;open file mov ah,3dh mov al,0 mov dx,offset file int 21h ;read file mov bx,ax mov ah,3fh mov cx,40 mov dx,offset buffer int 21h jc error ;closing file mov ah, 3eh int 21h error: mov ax, 4c00h int 21h main endp code ends data segment file db "file.txt",0 <----------- should put here make codes read file hard drive buffer db 42 dup(?) ;data buffer data ends stacks segment para stack 'stack' dw 32 dup(?) stacks ends end
Comments
Post a Comment