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 emu exe, can you tell me why i get this error code :
file does not exist:
C:emuvdrive
emuvdriveCinventorytxt
interrupt error: hDh : cannot open file.
When this is my code:
model small
stack h
data
; Memory blocks to simulate the structure
manufacturer db ; Maximum input size db dup ; Buffer for input model db db dup color db db dup enginesize db ; Smaller buffer for engine size db dup doors db db dup filename db C:emuvdriveCinventorytxt continuebuffer db dup ; Buffer for YN prompt input promptmsg db 'Enter manufacturer: $ promptmsg db 'Enter model: $ promptmsg db 'Enter color: $ promptmsg db 'Enter engine size: $ promptmsg db 'Enter number of doors: $ continueprompt db 'Add more inventory YN $ newline db DhAh$ ; Newline characters to move to next line donemsg db Awesome Auto Lot Inventory file has been processed DhAh$ ;For file reading and writing filehandle dw byteswritten dw buffersize db readbuffer db dupcode main: ; Initialize data segment mov ax @data mov ds ax ;Create file mov ahCh ;Create file lea dx filename mov cx int h mov filehandle, ax ;save file handle ; Main loop mainloop: call getautoinfo ; Call procedure to get automobile information call writetofile ; Ask user if they want to add more inventory lea dx continueprompt mov ahh int h ; Get user input for continue prompt YN lea dx continuebuffer mov ahAh int h ; Check if the user entered N mov al continuebuffer ; Get the first character entered Y or N cmp alN je closefile ; If user entered N jump to done lea dx newline ; If yes, move next prompt to next line mov ahh int h jmp mainloop ;If not, continue closefile: mov ahEh mov bx filehandle int h ; lea dx donemsg ;print done message mov ahh int h ;open file to read mov al ; Open file function mov dx offset filename mov ahDh ; Read and write int h mov filehandle, ax ; Save the file handle readloop: call readfromfile ;read structure from file cmp al ;check if end of file je donereading ;if yes, jump to done ;Print structure call printautoinfo ;loop to read more data jmp readloop donereading: ;Close file mov ahEh mov bx filehandle int h ;end prog mov ahCh int h ; Procedure to collect automobile information getautoinfo proc ; Prompt for manufacturer lea dx promptmsg mov ahh int h ; User input for manufacturer lea dx manufacturer mov ahAh int h ; Move to the next line after user input lea dx newline mov ahh int h ; Prompt for model lea dx promptmsg mov ahh int h ; User input for model lea dx model mov ahAh int h ; Move to the next line after user input lea dx newline mov ahh int h ; Prompt for color lea dx promptmsg mov ahh int h ; User input for color lea dx color mov ahAh int h ; Move to the next line after user input lea dx newline mov ahh int h ; Prompt for engine size lea dx promptmsg mov ahh int h ; User input for engine size lea dx enginesize mov ahAh int h ; Move to the next line after user input lea dx newline mov ahh int h ; Prompt for number of doors lea dx promptmsg mov ahh int h ; User input for number of doors lea dx doors mov ahAh int h ; Move to the next line after user input lea dx newline mov ahh int h ret getautoinfo endp ;Write structure to file writetofile proc ; Prepare the combined data for writing lea si manufacturer ; Start with manufacturer lea di readbuffer ; Point to buffer for writing mov cx ; 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
