home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
windows
/
baswind8.zip
/
RESTWIND.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-09-14
|
5KB
|
137 lines
;
; Title:RESTWIND.ASM SEPT 1, 1990
Basic_setup MACRO
PUSH BP
MOV BP,SP
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH SI
PUSH DI
PUSH DS
PUSH ES
ENDM
Basic_cleanup MACRO
CLD
POP ES
POP DS
POP DI
POP SI
POP DX
POP CX
POP BX
POP AX
POP BP
ENDM
Stack STRUC
Bpsav DW ? ;saved by us
Retoff DW ? ;from callf
Retseg DW ? ;from basic
Return_code DW ?
Array_off DW ? ;pointer to array offset
Array_seg DW ? ;pointer to array memory segment address
Col2 DW ? ;get characters from row1,col1
Row2 DW ? ; to row2,col2
Col1 DW ? ;
Row1 DW ? ;
Stack ENDS
;
.Model Medium
.Code
PUBLIC Restwind
Restwind PROC
Basic_setup
MOV BX,[BP].Return_code
MOV WORD PTR [BX],0
MOV SI,[BP].Row2 ;si -> row2
MOV AX,[SI] ;ax has last row
MOV SI,[BP].Row1 ;si -> row1
MOV BX,[SI] ;form # of rows in ax
SUB AX,BX ;ax=rows-1
INC AX ;ax=rows
MOV SI,[BP].Col2 ;si -> col2
MOV CX,[SI] ;now form # of cols in cx
MOV SI,[BP].Col1 ;si -> col1
MOV BX,[SI] ;bx=col1
SUB CX,BX ;cx has # of cols-1
INC CX ;cx has # of cols
MOV BX,AX ;bx=# of rows
MOV SI,[BP].Row1 ;di -> row1
MOV DX,[SI] ;di will -> regen buffer
DEC DX ;make zero-rel
MOV AX,160 ;multiplier
MUL DL ;ax=offset to row
MOV DI,[BP].Col1 ;di -> col1
MOV DI,[DI]
DEC DI ;make col zero-rel
SHL DI,1 ;di=offset in row to col
ADD DI,AX ;total offset in di
CALL Getvid ;get video address
MOV ES,AX
PUSH BX
MOV BX,[BP].Array_off
MOV SI,[BX]
MOV BX,[BP].Array_seg
MOV DS,[BX]
POP BX
CLD
MOV AX,CX ;save col count
MOV DX,AX
ADD DX,AX ;twice because 2 bytes per char
;
LOOP_BACK:
CLI
REPZ MOVSW
STI
ADD DI,160 ;new row
MOV CX,AX ;cx=col count
SUB DI,DX ;move back to right place
DEC BX ;row count
JNZ Loop_back
Basic_cleanup
RET 14 ;get rid of 7 parms
Restwind ENDP
;
Getvid PROC NEAR
PUSH BX ;save bx register
MOV AX,0 ;clear ax
MOV AH,15 ;video mode bios call
INT 010H ;do the bios call
CMP AL,07H ;see if it's monochrome
JZ Ismono ;yes
MOV AX,0B800H ;set it up for graphics
JMP Endvid ;exit
ISMONO:
MOV AX,0B000H ;set it up for monochrome
ENDVID:
POP BX ;restore bx register
RET
Getvid ENDP
END