How to print a box on top of another box in assembly language? -


my goal make chess board using assembly language i'm trying print small gray box on top of white bigger box, white box disappears gray box printed on screen. tried searching google can't find answer. also, there better approach on making chess board using assembly?

here's code.

dosseg .model small .stack 0100h .data .code      mov ax, @data     mov ds, ax      mov ah, 0     mov al, 11h     int 10h      mov ah, 02h     mov bh, 00h     mov dh, 0ch     mov dl, 28h     int 10h      mov cx, 10     mov dx, 10     mov ah, 0ch      colcount:     inc cx     int 10h     cmp cx, 450     jne colcount      mov cx, 10     inc dx     cmp dx, 450     jne colcount       mov ax, @data     mov ds, ax      mov ah, 0     mov al, 13h     int 10h      mov ah, 02h     mov bh, 00h     mov dh, 0ch     mov dl, 28h     int 10h      mov cx, 10     mov dx, 10     mov ah, 0ch      colcount2:     inc cx     int 10h     cmp cx, 30     jne colcount2      mov cx, 10     inc dx     cmp dx, 30     jne colcount2  end 

mov ah, 0 mov al, 11h int 10h ... mov ah, 0 mov al, 13h int 10h 

you reset video mode between operations! no wonder first box disappears.


  • why bother setting cursor if you're putting graphical pixels on screen?
  • you don't seem set color anywhere. goes in al function 0ch.

Comments