R equ 31 N equ 2 M equ 3 mov bx,1-R ;MAP build mov si,R*R mov di,map mov bp,-2*R*(R-1) nok mov cx,1-R nol mov ax,cx imul cx push ax mov ax,bx imul bx pop dx add ax,dx cmp ax,si jc nor mov ax,bx push cx jmp short nos nor mov dx,65536*(M-N)/M/N mul dx mov ax,dx add ax,R*R/M push ax imul cx idiv si mov dx,ax pop ax push dx imul bx idiv si nos mov ah,2*R-1 imul ah pop dx add ax,dx push ax sub ax,bp stosw pop bp inc cx cmp cl,R jl nol inc bx cmp bl,R jl nok