Hey everyone I need help with my code to run

Started by crazyhorse, December 12, 2011, 07:59:12 AM

Previous topic - Next topic

crazyhorse

jj

jj2007

Quote from: crazyhorse on December 12, 2011, 07:59:12 AM
The following is a 16-bit code i'm trying to run on masm32.

I can't find the error, mind helping me out please :)


I get "There was an Error in Creating." when it runs. What is InputOutputCommand supposed to return in dx?

sinsi


InputOutputCommand PROC
      ;;;;;;;;;;;;;;;;;;;;;;;;For the Input File Name;;;;;;;;;;;;;;;;;;;;
      mov di, 81h   
      mov si, OFFSET InputFileName   
           
      mov al, 20h
      repz scasb

To use a rep prefix you need to init CX, probably when the file is loaded CX=0 so no rep happens.
Light travels faster than sound, that's why some people seem bright until you hear them.

jj2007

Try to check your filenames before using them.
InputOutputCommand PROC
;;;;;;;;;;;;;;;;;;;;;;;;For the Input File Name;;;;;;;;;;;;;;;;;;;;
mov di, 81h
mov si, OFFSET InputFileName
mov al, 20h
mov cx, 128 ; see Sinsi's post
push di  ; you need that one, right?
repz scasb
pop di
jz FileMissing
...
FileMissing: stc
check=1
if check
mov dx, OFFSET InputFileName
mov ah, 9 ; display message the
int 21h ; traditional way
mov ax, 4c00h
int 21h
endif
ret
InputOutputCommand ENDP

qWord

FPU in a trice: SmplMath
It's that simple!