Verticle lines in emu8086

How do I get this code to show a verticle line?

Page 1 of 1

2 Replies - 1349 Views - Last Post: 07 December 2008 - 11:11 AM Rate Topic: -----

#1 espenodge  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 28
  • Joined: 21-November 08

Verticle lines in emu8086

Posted 02 December 2008 - 03:03 AM

How do I change the code so that a vertical line is displayed from coordinates (50, 50) - (50, 75) in addition to the horizontal line currently displayed by the program?


 

; video.asm
; uses interrupts to set video mode and draw a line

include 'emu8086.inc'

org  100h; set location counter to 100h

jmp CodeStart

DataStart:
	xStart dw 50	   ; x coordinate of line start
	yStart dw 50	   ; y coordinate of line start
	length dw 25	   ; length of line

CodeStart:

   ; set the video mode 320x200, 256 colors
	mov al, 13h
	mov ah, 0
	int 10h

   ; initialize cx (x coord) to xStart + length
	mov cx, xStart
	add cx, length

	
   ; loop from (xStart+length) to xStart to draw a horizontal line
	LoopStart:	

	   ; draw a pixel
	   ; set color in al, x in cx, y in dx
		mov al, 50
		mov dx, yStart
		
	   ; set sub function value in ah to draw a pixel
	   ; and invoke the interrupt
		mov ah, 0ch
		int 10h
		
	   ; decrement the x coord
		sub cx, 1
		
	   ; test to see if x coord has reached start value
		cmp cx, xStart
	
   ; continue loop if cx >= xStart
	jae LoopStart
	
	ret




Is This A Good Question/Topic? 0
  • +

Replies To: Verticle lines in emu8086

#2 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 990
  • View blog
  • Posts: 5,141
  • Joined: 28-September 06

Re: Verticle lines in emu8086

Posted 02 December 2008 - 03:56 AM

I think this might belong in "Other Languages"
Was This Post Helpful? 0
  • +
  • -

#3 espenodge  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 28
  • Joined: 21-November 08

Re: Verticle lines in emu8086

Posted 07 December 2008 - 11:11 AM

Oh, thanks then.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1