#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Posts
    24
    Rep Power
    0

    EMU8086 How draw lines ?


    May i know how to draw lines in emu8086 ? Let's say i making a sudoku puzzle and i wanna make lines and border for the puzzle table ? How ?

    Thanks first
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    929
    To get better help you'll need to describe where you're stuck and show your work so far. We won't write the code for you.

    If you just need a place to start, look at the various operations of INT 10h and INT 21h.
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Posts
    24
    Rep Power
    0
    Originally Posted by OmegaZero
    To get better help you'll need to describe where you're stuck and show your work so far. We won't write the code for you.

    If you just need a place to start, look at the various operations of INT 10h and INT 21h.
    I've done it , but the code very long . I DB the ASCII codes for the lines and LEA into SI , then lodsb .

    Any idea how to ultilise gotoxy function ? I tried to use variable for gotoxy function , it seems like cannot use variable . Let say i use gotoxy AL,0 for moving the cursor along the X direction by varying AL , but it is not working .....
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    929
    Show your code (use [code][/code] tags so its legible), show the errors you're getting (or describe the expected output vs the actual if it builds & runs fine). Also what library is the gotoxy function coming from? Either post the code or tell use where we can find its documentation.
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Posts
    24
    Rep Power
    0
    Let's use the tutorial example of emu8086:

    include emu8086.inc

    ORG 100h

    PRINT 'Hello World!'

    GOTOXY 10, 5

    PUTC 65 ; 65 - is an ASCII code for 'A'
    PUTC 'B'

    RET ; return to operating system.
    END ; directive to stop the compiler.


    I just wanna ask , whether the GOTOXY 10,5 can use any variable to substitute the number ? So that i don't need repeatedly use the GOTOXY 0,0 , GOTOXY 0,1 .......
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    929
    Ah. The problem is GOTOXY isn't a function. It's a macro (essentially a piece of code with some blanks that will be filled in with the values you pass to it). In order to set up the INT 10h instruction it uses to position the cursor it overwrites the AX before loading the row & column. (Look at the .inc file , and you can see the exact code that's being used)


    You can try using one of the registers that's not involved or better yet, get rid of the macro and use the interrupt yourself.
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Posts
    24
    Rep Power
    0
    Omega , i've solved the gotoxy problem , thanks . May i know how can i print the text cursor on the emulator screen when i click mouse to the certain point ? The tutorial given there didnt show us how to do so .

    thanks first
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    929
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Posts
    24
    Rep Power
    0
    No, i mean , when i click mouse at certain point , the text cursor goes there . How to do it ?? The mouse.asm and mouse1.asm didnt show any related ...
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2007
    Posts
    765
    Rep Power
    929
    You know how to move the cursor to a certain point (INT 10h / GOTOXY) and you know how to find where the mouse is and if the buttons are pressed (INT 33h). You need to put those pieces together.
    sub{*{$::{$_}}{CODE}==$_[0]&& print for(%:: )}->(\&Meh);

IMN logo majestic logo threadwatch logo seochat tools logo