0 Replies - 711 Views - Last Post: 05 May 2017 - 02:10 PM

#1 cpmurray1985  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 05-May 17

Creating color filled blocks using x86 Assembly Language MASM615

Posted 05 May 2017 - 02:10 PM

Hi everyone!

So I need some direction in how to create vertical color filled blocks that will fill up the screen. I'll have an example below.
Posted Image
This is what I have so far, for reference. My code will be provided below. I looked for references and tutorials online, but I'm still stuck.

Title drawline.asm

.model small
.data
mode byte ?
color byte 0
gap WORD 30
yStart WORD 15
maxX WORD 639
maxY WORD 479
maxColor WORD 15
.stack 100h

.code
main PROC
mov ax,@data
mov ds,ax
call init
call drawit
call wrapUp

init PROC
mov ah,0fh
int 10h
mov mode,al
mov ah,0
mov al,12h
int 10h
RET
init ENDP

drawIt PROC
mov cx,yStart   ;;this use to be mov dx and the line below was mov cx, but it still gives the same ouput.
mov dx,maxColor
next: mov al, cl
push cx
mov cx, maxX
mov ah,0ch

L1: int 10h
loop L1

add dx, gap
pop cx
loop next
RET
drawIt ENDP

wrapUp PROC
mov ah,1
int 21h
mov al, mode
mov ah,0
int 10h
mov ah,4ch
int 21h
RET
wrapUp ENDP

main ENDP

end main

This is what it keeps producing, not what I really want.
Posted Image
I just need some guidance or idea how to proceed. I've been stuck for hours and I need fresh pair of eyes. Thank you!

Is This A Good Question/Topic? 0
  • +

Page 1 of 1