.model small N equ 8 char equ 0eh .stack 100h .data .code mov ax,3 ; text mode int 10h mov ax, 0b800h; stores the address of the start of the screen in ax mov ds, ax ; mov bx, 0h ; starts the address bx to the start of the screen mov al, char ; al stores the char mov ah, 0h mov cx, N again: mov [bx], ax ; sets up the first loop inc ah add bx, 2 loop again ; loops 8 times (for each line) sub ah, N add bx, 090h add ah, 10h mov cx, N ; sets the loop to 8 (N equals 8) cmp bx, 500h jnz again ; while zeroflag differs from zero, jump to again mov bx, 12h ; sets up the second loop mov ah, 008h ; sets the backround color to a dark one the char color to a bright one again1:mov [bx], ax inc ah add bx, 2 loop again1 ; loops 8 times (for each line) sub ah, N add bx, 090h add ah, 10h mov cx, N ; sets the loop to 8 (N equals 8) cmp bx, 512h jnz again1 ; while zeroflag differs from zero, jump to again1 mov bx, 5A0h ; sets up the third loop(matrix) next to the first one mov ah, 080h ; sets the background color to a bright one and the char color to a dark one again2:mov [bx], ax inc ah add bx, 2 loop again2 sub ah, N ; loops 8 times (for each line) add bx, 090h add ah, 10h mov cx, N ; sets the loop to 8 (N equals 8) cmp bx, 0AA0h jnz again2 ; while zeroflag differs from zero, jump to again2 mov bx, 5B2h ; sets up the third loop (matrix) under the second one mov ah, 088h ; sets the background color to a dark one and the char color to a bright one again3:mov [bx], ax inc ah add bx, 2 loop again3 ; loops 8 times (for each line) sub ah, N add bx, 090h add ah, 10h mov cx, N ; sets the loop to 8 (N equals 8) cmp bx, 0AB2h jnz again3 ; while zeroflag differs from zero, jump to again3 mov ah, 4ch ;returns control to the OS int 21h end