Question: Using emu 8 0 8 6 exe, can you tell me why i get this error code : file does not exist: C: emu

Using emu8086 exe, can you tell me why i get this error code :
file does not exist:
C:\emu8086\vdrive\
\emu8086\vdrive\C\inventory.txt
interrupt error: 21h/3Dh : cannot open file.
When this is my code:
.model small
.stack 100h
.data
; Memory blocks to simulate the structure
manufacturer db 20 ; Maximum input size db 20 dup(0) ; Buffer for input model db 20 db 20 dup(0) color db 20 db 20 dup(0) engine_size db 10 ; Smaller buffer for engine size db 10 dup(0) doors db 2 db 2 dup(0) filename db 'C:\emu8086\vdrive\C\inventory.txt',0 continue_buffer db 2,2 dup(0) ; Buffer for Y/N prompt input prompt_msg1 db 'Enter manufacturer: $' prompt_msg2 db 'Enter model: $' prompt_msg3 db 'Enter color: $' prompt_msg4 db 'Enter engine size: $' prompt_msg5 db 'Enter number of doors: $' continue_prompt db 'Add more inventory (Y/N)? $' newline db 0Dh,0Ah,'$' ; Newline characters to move to next line done_msg db '*** Awesome Auto Lot Inventory file has been processed ***',0Dh,0Ah,'$' ;For file reading and writing file_handle dw ? bytes_written dw ? buffer_size db 70 read_buffer db 70 dup(0).code main: ; Initialize data segment mov ax, @data mov ds, ax ;Create file mov ah,3Ch ;Create file lea dx, filename mov cx,0 int 21h mov file_handle, ax ;save file handle ; Main loop main_loop: call get_auto_info ; Call procedure to get automobile information call write_to_file ; Ask user if they want to add more inventory lea dx, continue_prompt mov ah,09h int 21h ; Get user input for continue prompt (Y/N) lea dx, continue_buffer mov ah,0Ah int 21h ; Check if the user entered 'N' mov al, continue_buffer +2 ; Get the first character entered ('Y' or 'N') cmp al,'N' je close_file ; If user entered 'N', jump to done lea dx, newline ; If yes, move next prompt to next line mov ah,09h int 21h jmp main_loop ;If not, continue close_file: mov ah,3Eh mov bx, file_handle int 21h ; lea dx, done_msg ;print done message mov ah,09h int 21h ;open file to read mov al,2 ; Open file function mov dx, offset filename mov ah,3Dh ; Read and write int 21h mov file_handle, ax ; Save the file handle read_loop: call read_from_file ;read structure from file cmp al,0 ;check if end of file je done_reading ;if yes, jump to done ;Print structure call print_auto_info ;loop to read more data jmp read_loop done_reading: ;Close file mov ah,3Eh mov bx, file_handle int 21h ;end prog mov ah,4Ch int 21h ; Procedure to collect automobile information get_auto_info proc ; Prompt for manufacturer lea dx, prompt_msg1 mov ah,09h int 21h ; User input for manufacturer lea dx, manufacturer mov ah,0Ah int 21h ; Move to the next line after user input lea dx, newline mov ah,09h int 21h ; Prompt for model lea dx, prompt_msg2 mov ah,09h int 21h ; User input for model lea dx, model mov ah,0Ah int 21h ; Move to the next line after user input lea dx, newline mov ah,09h int 21h ; Prompt for color lea dx, prompt_msg3 mov ah,09h int 21h ; User input for color lea dx, color mov ah,0Ah int 21h ; Move to the next line after user input lea dx, newline mov ah,09h int 21h ; Prompt for engine size lea dx, prompt_msg4 mov ah,09h int 21h ; User input for engine size lea dx, engine_size mov ah,0Ah int 21h ; Move to the next line after user input lea dx, newline mov ah,09h int 21h ; Prompt for number of doors lea dx, prompt_msg5 mov ah,09h int 21h ; User input for number of doors lea dx, doors mov ah,0Ah int 21h ; Move to the next line after user input lea dx, newline mov ah,09h int 21h ret get_auto_info endp ;Write structure to file write_to_file proc ; Prepare the combined data for writing lea si, manufacturer ; Start with manufacturer lea di, read_buffer ; Point to buffer for writing mov cx,20 ; Size of manufacturer rep movsb ; Copy manufacturer to buffer lea si, model ; Next, copy

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!