can anyone tell me what this means....if code is necessary, i can give that.
File not found errors mean you don't have the file available OR you don't have a path set to it so the assembler / linker can find it.
well, i have another program in the same location, could it perhaps be a code problem? if so, i'll give my code here too, but it just doesnt seem like it should be that. what this program is supposed to do is make a sprite, a plus sign, and be able to move it around using the arrow keys, esc to quit. but for some reason it wont compile, so i can't tell what is going to be wrong with it anyways. thanks in advance....
here is the code....
;TITLE Sprite Mover (spriteMover.asm)
include Irvine16.inc
.data
saveMode BYTE ?
xval WORD ?
yval WORD ?
.code
main proc
mov ax, @data
mov ds, ax
call SetVideoMode
call SetScreenBackground
call MakeSprite
call TakeSomeInput
call RestoreVideoMode
exit
main endp
;------------------------------------------------
SetVideoMode proc
;
; this procedure saves the current video mode, switches to
; a new mode, and points es to the video segment.
;------------------------------------------------
pusha
mov ah, 0fh
int 10h
mov saveMode, al
mov ah, 0
mov al, 13h
int 10h
push 0a000h
pop es
popa
ret
SetVideoMode endp
;------------------------------------------------
SetScreenBackground proc
;
; This proc sets the screen's background color.
; vidoe palette index 0 is the background color.
;------------------------------------------------
pusha
mov dx, 3c8h
mov al, 0
out dx, al
; set screen background coor to dark blue.
mov dx, 3c9h
mov al, 0 ; red
out dx, al
mov al, 0 ; green
out dx, al
mov al, 0 ; blue
out dx, al
popa
ret
SetScreenBackground endp
;-------------------------------------------------
RestoreVideoMode proc
;
; this procedure
; restores the video mode to its original value.
;-------------------------------------------------
pusha
mov ah, 0
mov al, saveMode
int 10h
popa
ret
RestoreVideoMode endp
;--------------------------------------------------
MakeSprite proc
;
; this procedure creates a sprite and puts it on
; the screen.
;--------------------------------------------------
pusha
; change color at index 1 to white(63,63,63)
mov dx, 3c8h
mov al, 1
out dx, al
mov dx, 3c9h
mov al, 63
out dx, al
mov al, 63
out dx, al
mov al, 63
out dx, al
; calculate the vidoe buffer offset of the first pixel.
; specific to mode 13h, which is 320 X 200.
mov xval, 160
mov yval, 100
mov ax, 320
mul yVal
add ax, xVal
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 320
mov di, ax
mov BYTE PTR es:[di], 1
add ax, -1
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 2
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 319
mov di, ax
mov BYTE PTR es:[di], 1
popa
ret
MakeSprite endp
;----------------------------------------------------
TakeSomeInput proc
;
; this procedure takes input of arrow keys and moves
; the sprite in the direction arrow, if escape is
; pressed, the procedure ends.
;----------------------------------------------------
; Set typematic rate
pusha
mov ax, 0305h
mov bh, 0
mov bl, 1fh
int 16h
; this is the loop for the arrow section, continues
; until esc key is pressed.
L1:
mov ah, 10h
int 16h
cmp al, 1bh
je done
cmp ah, 4bh
je left
cmp ah, 4dh
je right
cmp ah, 48h
je up
cmp ah, 50h
je down
jmp L1
done:
call clrscr
popa
ret
left:
call MoveLeft
jmp L1
right:
call MoveRight
jmp L1
up:
call MoveUp
jmp L1
down:
call MoveDown
jmp L1
TakeSomeInput endp
;-----------------------------------------------
MoveLeft proc
;
; this procedure clears the old sprite location
; and moves it left one pixel.
;-----------------------------------------------
pusha
mov dx, 3c8h
mov al, 1
out dx, al
mov dx, 3c9h
mov al, 63
out dx, al
mov al, 63
out dx, al
mov al, 63
out dx, al
call RemoveSprite
add xval, -1
mov ax, 320
mul yVal
add ax, xVal
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 320
mov di, ax
mov BYTE PTR es:[di], 1
add ax, -1
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 2
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 319
mov di, ax
mov BYTE PTR es:[di], 1
popa
ret
MoveLeft endp
;-----------------------------------------------
MoveRight proc
;
; this procedure clears the old sprite location
; and moves it left one pixel.
;-----------------------------------------------
pusha
mov dx, 3c8h
mov al, 1
out dx, al
mov dx, 3c9h
mov al, 63
out dx, al
mov al, 63
out dx, al
mov al, 63
out dx, al
call RemoveSprite
add xval, 1
mov ax, 320
mul yVal
add ax, xVal
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 320
mov di, ax
mov BYTE PTR es:[di], 1
add ax, -1
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 2
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 319
mov di, ax
mov BYTE PTR es:[di], 1
popa
ret
MoveRight endp
;-----------------------------------------------
MoveUp proc
;
; this procedure clears the old sprite location
; and moves it left one pixel.
;-----------------------------------------------
pusha
mov dx, 3c8h
mov al, 1
out dx, al
mov dx, 3c9h
mov al, 63
out dx, al
mov al, 63
out dx, al
mov al, 63
out dx, al
call RemoveSprite
add yval, -1
mov ax, 320
mul yVal
add ax, xVal
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 320
mov di, ax
mov BYTE PTR es:[di], 1
add ax, -1
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 2
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 319
mov di, ax
mov BYTE PTR es:[di], 1
popa
ret
MoveUp endp
;-----------------------------------------------
MoveDown proc
;
; this procedure clears the old sprite location
; and moves it left one pixel.
;-----------------------------------------------
pusha
mov dx, 3c8h
mov al, 1
out dx, al
mov dx, 3c9h
mov al, 63
out dx, al
mov al, 63
out dx, al
mov al, 63
out dx, al
call RemoveSprite
add yval, 1
mov ax, 320
mul yVal
add ax, xVal
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 320
mov di, ax
mov BYTE PTR es:[di], 1
add ax, -1
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 2
mov di, ax
mov BYTE PTR es:[di], 1
add ax, 319
mov di, ax
mov BYTE PTR es:[di], 1
popa
ret
MoveDown endp
;-----------------------------------------------
RemoveSprite proc
;
; This procedure removes the sprite at its
; current location.
;-----------------------------------------------
pusha
mov dx, 3c8h
mov al, 0
out dx, al
mov dx, 3c9h
mov al, 0
out dx, al
mov al, 0
out dx, al
mov al, 0
out dx, al
mov ax, 320
mul yVal
add ax, xVal
mov di, ax
mov BYTE PTR es:[di], 0
add ax, 320
mov di, ax
mov BYTE PTR es:[di], 0
add ax, -1
mov di, ax
mov BYTE PTR es:[di], 0
add ax, 2
mov di, ax
mov BYTE PTR es:[di], 0
add ax, 319
mov di, ax
mov BYTE PTR es:[di], 0
popa
ret
RemoveSprite endp
end main
It appears to be a does program you have there. Are you using the correct linker to link the program?
also there is a sub forum for 16bit dos on this forum, that would be a better place to post your dos related
questions, since the campus and other sub-forums are geared towards 32bit windows.
:8)
rags
well what i dont get is why the other 16-bit program works when it is in the same directory with access to the same files....i cant figure out where in my code that this program requires linking to another program...
thanks anyways
With ML.EXE, ML.ERR, the 16-bit linker (here named LINK16.EXE), irvine16.inc, and irvine16.lib in the current directory, I was able to assemble and link with a minimal batch file containing:
ML /c spritemover.asm
pause
LINK16 spritemover.obj irvine16.lib;
pause
The supplied batch file is a little more complex:
http://www.cs.fit.edu/~mmahoney/cse3101/examples/Lib16/
hey everybody, thanks for all the input, this entire time the ONLY problem was the fact that the file's name was too long.
sorry about bothering you all with such a trivial problem.