Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4266254
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:44:08+00:00 2026-05-21T06:44:08+00:00

I am doing some coding for my class and I think I am on

  • 0

I am doing some coding for my class and I think I am on the right track but I am having a problem with verticle lines. When I run this code it draws 2 lines horizontal at the same time in the same exact place but I need line 2 to move from 50,50 to 50,75 vertically instead of from 50, 50 to 75,50 horizontally. I am not asking for the answer I just need a nudge and explanation, thanks:

; 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:
    xStart1 dw 50        ; x coordinate of line start 1
    yStart1 dw 50        ; y coordinate of line start 1
    xStart2 dw 50        ; x coordinate of line start 2
    yStart2 dw 50        ; y coordinate of line start 2
    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 xStart1 + length
    ; initialize bx (y coord) to yStart2 + length
    mov cx, xStart1
    mov bx, yStart2
    add cx, length
    add bx, length


    ; loop from (xStart1+length) to xStart1 to draw a horizontal line
    ; loop from (yStart1+length) to yStart1 to draw a vertical line
    LoopStart:    

        ; draw a pixel
        ; set color in al, x in cx, y in dx
        mov al, 50
        mov dx, yStart1

        ; set sub function value in ah to draw a pixel
        ; and invoke the interrupt
        mov ah, 0ch
        int 10h

        ; decrement the x coord for line 1
        ; decrement the y coord for line 2
        sub cx, 1
        sub bx, 1

        ; test to see if x coord has reached start value
        cmp cx, xStart1

    ; continue loop if cx >= xStart1
    jae LoopStart

    ret
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T06:44:08+00:00Added an answer on May 21, 2026 at 6:44 am

    Instead of keeping y constant and varying x, keep x constant and vary y

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

some code snippets. The java coding doing the jaxb unmarshaling. pretty straightforward, copied out
I'm doing some JAVA coding at home and at work. At home i have
I have Java experience and recently am doing some C++ coding. My question is
I am coding a E-commerce website/admin interface for a client. They are doing some
Here is some code outlining a problem I've been wrestling with. The final problem
I've recently started doing some coding in Python again and I've encountered an error
I was recently doing some Windows Api coding (still doing it). And I was
The relevant (I think) lines of my coding are below. What is meant is
Doing some jquery animation. I have certain divs set up with an attribute of
Doing some homework here (second assignment, still extremely green...). The object is to read

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.