852 ;--------------- ; MSDOS ;--------------- DATA SEGMENT ORG 02000 buffer: db 50000 dup (?) f_handle dw ? f_len dw ? DATA ENDS CODE SEGMENT jmp start f_name: db 10,12 dup(?) string: db 'Skriv namnet p† filen som skall visas: ',0 LENGTH EQU $-STRING start: mov cx,LENGTH mov dx,string ; mov ax,00900 ; int 33 mov bx,1 ; to stdout mov ah,040H ; MSDOS function number for WRITE int 33 ; jump to call the operating system mov dx,f_name mov ax,00A00 ; Read string int 33 ; mov b f_name+2+b [f_name+1],0 WHY DOES THIS NOT WORK??? mov dx,0 mov dl,b [f_name+1] mov si,dx mov b [f_name+2+si],0 mov dx,f_name+2 MOPEN_read: mov al,0 MOPEN: mov ah,03DH ; MSDOS function number for MOPEN int 33 ; all MSDOS calls go through this interrupt mov f_handle,ax ; save file handle ; MREAD reads from the open-file numbered BX, to the CX bytes at DX. Return ; with AX set to the number of bytes actually read. mov bx,f_handle mov cx,50000 mov dx,buffer MREAD: mov ah,03fh ; MSDOS function number for READ int 33 ; all MSDOS calls go through this interrupt mov f_len,ax ; number of bytes read mov dx,buffer ; pointer to file contents mov cx,f_len ; number of bytes to output OWRITE: ; alternate entry point for standard output mov bx,1 MWRITE: mov ah,040H ; MSDOS function number for WRITE int 33 ; jump to call the operating system MCLOSE: mov bx,f_handle mov ah,03EH ; MSDOS function number for CLOSE int 33 ; jump to call the operating system mov ax,04C00 ; MSDOS function number for EXIT int 33 ; jump to call the operating system CODE ENDS . 0