ideal
model small
stack 256h
video equ 0b800h

dataseg
bar dw 1e50h
barct dw 0
codeseg
EXTRN wall:proc, direction:proc
start:
 mov ax, @data
 mov ds, ax
 mov ax, video
 mov es, ax
 mov ax, 4
 int 10h         ;sets at medium resolution
        mov ah, 0ch
 int 21h
 mov di, 2    ;to begin the figure at the first even line
 xor si, si
 xor dx, dx

paint_back:
 push di
 xor di, di     ;start di at first even line
 mov cx,1f40h
 mov al, 0aah
 rep stosb
 mov di, 2000h
 mov cx,1f40h
 rep stosb
paint_ball:
        mov al, 01010101b
 pop di          ;restore the starting position
 push di         ;save that position
 mov cx, 1
 rep stosb       ;second even line
 add di, 78
 mov cx, 3
 rep stosb
 add di, 76   ;third even line
 mov cx, 5
 rep stosb
 add di, 76
 mov cx, 3
 rep stosb
 add di, 78
 mov cx, 1
 rep stosb

 pop di
 push di
 add di, 2000h  ;first odd line
 mov cx, 1
 rep stosb
 add di, 78 ;second odd line
 mov cx, 3
 rep stosb
 add di, 76   ;third odd line
 mov cx, 5
 rep stosb
 add di, 76
 mov cx, 3
 rep stosb
 add di, 78
 mov cx, 1
 rep stosb
 xor cx, cx
 push cx
paint_bar:
 mov di, [bar]
 push di
 mov cx, 7
 rep stosb
 pop di
 add di, 2000h
 mov cx, 7
 rep stosb
 
 mov ah,1
 int 21h
 
 dosRet:
  mov ax, 2
  int 10h
  mov ax, 4c00h
  int 21h
end start