model tiny,pascal .code .286 jumps public rect rect proc uses es arg x1,y1,x2,y2:word,color:byte cld mov bx,x1 mov ax,y1 mov cx,ax mov di,ax shl di,6 shl ax,8 add ax,bx add di,ax mov dx,y2 sub dx,cx mov cx,x2 sub cx,bx push 0a000h pop es mov al,color mov ah,al shr cx,1 push cx rep stosw jnc right stosb right: mov cx,dx jcxz down pushf next_right: stosb add di,319 loop next_right popf down: pop cx dec di std rep stosw inc di jnc left stosb left: cld mov cx,dx jcxz exit_rect next_left: stosb sub di,321 loop next_left exit_rect: ret rect endp end