Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i write a this subprogram for this graphic assignment

Status
Not open for further replies.

stevemei

Programmer
Mar 18, 2001
5
US
i have program as below that display a worm pic in pixel.
what do i need to do to make it jum or run
your response is appreciated

INCLUDE PCMAC.INC
.MODEL SMALL
.STACK 100h
.DATA

WHT EQU 0111B
RED EQU 0100B
GRN EQU 0010B
BLU EQU 0001B
BLK EQU 0000B
COLS EQU 16
ROWS EQU 8

WORM1 DB WHT,WHT,WHT,WHT,WHT,WHT,WHT,WHT,WHT,WHT,WHT,WHT,WHT,WHT,WHT,WHT
;;DB RED,RED,RED,RED,RED,RED,RED,RED,RED,RED,RED,RED,RED,RED,RED,RED
;;DB RED,RED,RED,RED,RED,RED,RED,RED,RED,RED,RED,RED,RED,RED,RED,RED
;;DB BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK
;;DB BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK
;;DB BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK
;;DB BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK
;;DB BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK

SAVECX DW ?
CXCTR DW ?
DXCTR DW ?

.CODE

MYWORM PROC
mov ax, @data
mov ds,ax
mov dx,offset worm1
mov ax, 0012h
int 10h
mov cx, 0
mov dx, 0
sub bh, bh
mov di,Rows
Loop2:
mov si, COLS
Loop1:

mov ah, 0ch
mov bx, offset worm1;
mov al, [bx]

inc bx
call Dot5x5
add cx, 5
dec si
jg Loop1

mov cx,0
add dx,5
dec di
jg loop2

_BIOSCH

mov ax, 0003h
int 10h

_Exit 0
myworm ENDP

Public
Dot5X5 Proc
push dx
push cx
mov SaveCx, cx
mov DxCtr, 0
DxLoop:
mov CXctr, 0
CxLoop:
int 10h
inc cx
inc cxctr
cmp cxctr, 5
jnz cxloop
mov cx, Savecx
inc dx
inc dxctr
cmp dxctr, 5
jnz Dxloop


pop cx
pop dx
ret
Dot5X5 Endp
end Myworm


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top