Category : Word Processors
Archive   : ANIMTECH.ZIP
Filename : BYTBENCH.ASM

 
Output of file : BYTBENCH.ASM contained in archive : ANIMTECH.ZIP
; *** Listing 9 ***
;
;This program benchmarks the byte-move driver.
;Link the byte-move form_driver/erase_form_driver
; module to this program.
;
stack segment para stack 'STACK'
db 512 dup(0)
stack ends
;
one segment para public 'CODE'
assume cs:one,ds:one,es:nothing
extrn form_driver:near,erase_form_driver:near
;
iteration_count dw 0
;
;Lists describing image, location, and motion of 8 objects.
;
;pointers to form byte strings for each object:
form_address dw f0, f1, f2, f3, f3, f2, f1, f0
;the index for the last object in these lists:
highest_object_pointer equ (($-form_address)-2)
row dw 100,100,100,100,100,100,100,100 ;lines (0 - 198)
column dw 32, 32, 32, 32, 32, 32, 32, 32 ;in bytes (0 - 79)
row_increment dw -2, 2, 0, -2, 0, 0, -2, 2 ;lines (0 - 198)
column_increment dw 1, 1, 0, -1, 1, -1, 0, -1 ;in bytes (0 - 79)
left_margin dw 0, 0, 0, 0, 0, 0, 0, 0 ;byte # (0-79)
right_margin dw 76, 74, 72, 70, 70, 72, 74, 76 ;byte # (0-79)
top_margin dw 0, 0, 0, 0, 0, 0, 0, 0 ;line # (0 - 198)
bottom_margin dw 194,184,174,164,164,174,184,194 ;line # (0 - 198)
;
;Form byte structures, as follows:
; byte 1: # of scan lines in forms.
; byte 2: # of bytes per scan line of form.
; byte 3: first byte of image, followed by rest of bytes forming
; image, with bytes for top scan line, left to right,
; first, second scan line next, and so on.
;
f0 db 6,4
db 0f0h,00fh,0f0h,00fh
db 0f0h,03fh,0fch,00fh
db 0ffh,0ffh,0ffh,0ffh
db 0f0h,0ffh,0ffh,00fh
db 0f0h,03fh,0fch,00fh
db 0f0h,00fh,0f0h,00fh
f1 db 16,6
db 4 dup(6 dup(055h))
db 4 dup(6 dup(0ffh))
db 4 dup(6 dup(0aah))
db 4 dup(6 dup(055h))
f2 db 26,8
db 26 dup(0ffh,0aah,0aah,055h,055h,0aah,0aah,0ffh)
f3 db 36,10
db 9 dup(10 dup(0ffh))
db 3 dup(0ffh,0ffh,6 dup(0aah),0ffh,0ffh)
db 3 dup(0ffh,0ffh,0aah,4 dup(055h),0aah,0ffh,0ffh)
db 6 dup(0ffh,0ffh,0aah,055h,000h,000h,055h,0aah,0ffh,0ffh)
db 3 dup(0ffh,0ffh,0aah,4 dup(055h),0aah,0ffh,0ffh)

db 3 dup(0ffh,0ffh,6 dup(0aah),0ffh,0ffh)
db 9 dup(10 dup(0ffh))
;
start proc far
push ds ;set up for return to DOS
sub ax,ax ; through the instruction at DS:0 set
push ax ; up by DOS when it loads this program
cld
push cs
pop ds ;DS and CS are to be the same
mov ax,0b800h ;ES is to point to Color Graphics
mov es,ax ; Adapter's memory buffer
mov ax,0004h ;set 320x200 color mode
int 10h
;
;Set number of times to move all objects
;
mov [iteration_count],700 ;times to repeat move loop
;
;For each iteration, move each object in turn by erasing it,
; moving it one increment, and drawing it at the new position.
;
next_iteration:
mov si,highest_object_pointer ;start at last object
;
;Move each object in turn.
;
move_next_object:
;
;Erase the object at its present position.
;
push si ;save object index
mov bx,[si+row] ;get line at which to start erasing
mov cx,[si+column] ;get col. at which to start erasing
;get address of form for object to erase:
mov si,[si+form_address]
call erase_form_driver ;erase a rectangular area = to the
; dimensions of the object whose
; form is pointed to in SI
pop si ;restore the object index
;
;Advance the object's row and column and adjust increments
; so the object remains within its boundaries.
;
;If adding the row increment to the row would place it outside
; its margins...
;
mov ax,[si+row] ;test the new line position
add ax,[si+row_increment] ; to see if it goes outside
cmp ax,[si+top_margin] ; its limit
jb negate_row_increment ;if outside negate the
cmp ax,[si+bottom_margin] ; increment so that it will
jbe test_column_increment ; move towards its other limit
;
;...then make the row increment negative if positive and
; positive if negative.
;
negate_row_increment:
neg [si+row_increment] ;make it move in other direction
;
;If adding the column increment to the column would place it
; outside its margins...
;
test_column_increment:
mov ax,[si+column] ;if the column for the object
add ax,[si+column_increment] ; would go outside its left
cmp ax,[si+left_margin] ; or right limits, then
jb negate_column_increment ; negate its increment so
cmp ax,[si+right_margin] ; that it will move in the
jbe add_increments ; opposite direction
;
;...then make the column increment negative if positive and
; positive if negative.
;
negate_column_increment:
neg [si+column_increment] ;set to move in opp. direction
;
;Add the increments to the row and column to arrive at the
; object's next position.
;
add_increments:
mov ax,[si+row_increment] ;calculate next line postion
add [si+row],ax ; and store it
mov ax,[si+column_increment] ;calculate next col. postion
add [si+column],ax ; and store it
;
;Draw the object at the new location.
;
push si ;save this object index
mov bx,[si+row] ;find line and column number
mov cx,[si+column] ; at which to place object
mov si,[si+form_address] ;find address of object's form
call form_driver ;put object's image into screen
pop si ;restore the object index
;
sub si,2 ;point to next object to move
jns move_next_object ; if not done jmp to move it
;
dec [iteration_count] ;count down number of times to
jnz next_iteration ; move all the objects
;
;Reset the mode to 80x25 color text mode.
;
mov ax,0003h ;before returning to DOS,
int 10h ; set screen to 80x25 text mode
;
;Return to DOS.
;
ret ;return though instruction at
; start of PSP set up by DOS
start endp
one ends
end start


  3 Responses to “Category : Word Processors
Archive   : ANIMTECH.ZIP
Filename : BYTBENCH.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/