Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Need help with an 8086 Assembly project please!

Comments

  • Registered Users, Registered Users 2 Posts: 3,945 ✭✭✭Anima


    Do yourself a favour man, highlight some problem areas or something. People aren't going to instantly realise the flow of the program and/or spend 20+ mins looking at it.


  • Closed Accounts Posts: 8 mentor07825


    Thank you.

    The problem is that I need to draw the line anywhere I want on the screen. This has to be done in two ways.

    1. The first point clicked can be lower then the second point. At the moment it's the other way around. SOLUTION: Switch the values between the two Y positions if the first click Y is > second click Y.

    2. The line must be drawn anywhere on the screen regardless of slope. At the moment it can only be drawn from top left to bottom right, I want it to be drawn anywhere on the screen. SOLUTION(?): Instead of drawing the X axis first draw the Y axis instead.

    mov endx,ax ;store mouse's x coordinate - now check mouse left click status
    cmp buttons,1 ;was left button clicked? (=> (endx,endy) is end point)
    jne endpt ;-if not, go back and poll mouse again, else output line next

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;
    ;draw the line from the start point to the end point using Bresenham’s classic line drawing algorithm
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;

    ;initialise deltax with the absolute difference between its start and end x coordinates

    mov ax,startx
    mov bx,endx
    cmp ax,bx
    ja otherx
    sub bx,ax
    mov deltax,bx
    jmp dodlty ;go to process deltay now
    otherx: sub ax,bx
    mov deltax,ax

    Around there is the code that would be, I think, a good place to start.

    The reason why I'm posting this is because I don't know much about ASM, this was a skeleton code that was givin and we hardly learned ASM. Not only that, but the tutorials I found online were not the best.


Advertisement