in a University project in graphic mode in DOS operrarion system I need to clear the screen (color it all in one color), does anyone know what's the intterapt for that and what do I need to put in the registers? In which register put the color i want the screen will be in? thank very much to the helpers!
this is my code (in assembly): if someone can help me understand why the up & down arrowes are moving right & left and why my exit is writing me deternmind code 0 I would love that!:
> IDEAL MODEL small STACK 100h DATASEG x dw 0 xa dw 0 y dw 5 ya dw 5 z dw 1 za dw 1 color db 4 Pixels Color bgcolor db 0 ;BackGround Color > CODESEG start: mov ax, @data mov ds, ax ; Graphic mode mov ax, 13h int 10h ; Print red dot mov bh,0h mov cx,[x] mov dx,[y] > mov al,[color] mov ah,0ch int 10h amit: > ;Wait for + > mov ah,00h > int 16h > cmp ax, 0d3dh > je plus > ;Wait for - > cmp ax, 0c2dh > je minus > ; Wait for exit > cmp ax, 1071h > je exit > cmp ax, 4d00h > je right > cmp ax, 4b00h > je left1 > cmp ax, 4800h > je up1 > cmp ax, 5000h > je down1 > > exit: > mov ah, 0 > mov al, 2 > int 10h > mov ax, 4c00h > int 21h > plus: > add [x], 1 > mov cx, [x] > add [y], 1 > mov dx, [y] > mov bh, 0h > mov al,[color] > mov ah, 0ch > int 10h > add [z], 1h > add [za], 1h > jmp amit > left1: > jmp left > up1: > jmp up > down1: > jmp down > minus: > mov bh, 00h > mov al,[bgcolor] > mov ah,0ch > int 10h > sub [x], 1 > mov cx, [x] > sub [y], 1 > mov dx, [y] > sub [z], 1h > sub [za], 1h > jmp amit > right: > clsright: > mov bh, 00h > mov al,[bgcolor] > mov ah,0ch > int 10h > sub [x], 1 > mov cx, [x] > sub [y], 1 > mov dx, [y] > sub [z], 1h > cmp [z], 0h > jne clsright > add [x],1h > jmp arrowplus > left: > clsleft: > mov bh, 00h > mov al,[bgcolor] > mov ah,0ch > int 10h > sub [x], 1 > mov cx, [x] > sub [y], 1 > mov dx, [y] > sub [z], 1h > cmp [z], 0h > jne clsleft > sub [x], 1h > jmp arrowplus > up: > clsup: > mov bh, 00h > mov al,[bgcolor] > mov ah,0ch > int 10h > sub [x], 1 > mov cx, [x] > sub [y], 1 > mov dx, [y] > sub [z], 1h > cmp [z], 0h > jne clsup > sub [y], 1h > jmp arrowplus > down: > clsdown: > mov bh, 00h > mov al,[bgcolor] > mov ah,0ch > int 10h > sub [x], 1 > mov cx, [x] > sub [y], 1 > mov dx, [y] > sub [z], 1h > cmp [z], 0h > jne clsdown > add [y], 1h > jmp arrowplus > arrowplus: > add [x], 1 > mov cx, [x] > add [y], 1 > mov dx, [y] > mov bh, 0h > mov al,[color] > mov ah, 0ch > int 10h > add [z], 1h > mov [z], dx > cmp [za], dx > jne arrowplus > jmp amit END start