0

I'm not sure what is going wrong with my program. When I assemble and run it as a com file, I get the error Required Parameter Missing.
When I try to debug to see if the carry flag is set for some reason I see that it does cmp ah, 4b and then jumps if zero. Code is below:
Again my goal is to copy everything from c:\Read\readme.dat and to c:\Read\output.dat

copy segment 'code'
org 100h
assume cs:copy, ds:copy

Start: Jmp RealStart

inh dw ?
outh dw ?
buffsize equ 100

inname db 'C:\Read\readme.dat',0
outname db 'C:\Read\output.dat',0
buffer db buffsize dup(?)

;------------------open inname
RealStart:
mov ax, 3d00h
mov dx, offset inname
int 21h
jc error
mov inh, ax
mov ah, 3ch  ;----Creates output
sub cx, cx
mov dx, offset outname
int 21h
jc error
mov outh, ax

;--------- copy data
again:
	mov ah, 3Fh
	mov bx, inh
	mov cx, buffsize
	mov dx, offset buffer
	int 21h
	jc error
	or ax, ax
	jz done
	mov bx, outh
	mov cx, ax
	mov ah, 40h
	mov dx, offset buffer
	int 21h
	jc error
	or ax,ax
	jz error
	jmp again
	
;---------
done:
	mov ah, 3eh
	mov bx, inh
	int 21h
	mov ah, 3eh
	mov bx, outh
	int 21h
	
error:
	
int 20h
copy ends

end Start
2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by MosaicFuneral
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.