Draw lines/boxes/borders using EMU8086

Program sudoku using EMU8086

Page 1 of 1

10 Replies - 17446 Views - Last Post: 05 January 2011 - 07:31 AM

#1 deejay220989  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 20-September 08

Draw lines/boxes/borders using EMU8086

Posted 07 December 2010 - 08:31 AM

Hi guys,

I have an assignment and I'm required to create a sudoku using the EMU8086 program. My lecturer gave us a sample. He actually drew borders using the x86 coding. Attached is a picture of the border I'm referring too.

Attached Image

I've never learnt about drawing lines/borders using assembly language. Can someone give me hints?

Thanks!!

Is This A Good Question/Topic? 0
  • +

Replies To: Draw lines/boxes/borders using EMU8086

#2 ishkabible  Icon User is offline

  • spelling expret
  • member icon




Reputation: 1622
  • View blog
  • Posts: 5,709
  • Joined: 03-August 09

Re: Draw lines/boxes/borders using EMU8086

Posted 08 December 2010 - 01:54 PM

if you look at an extended ASCII you will see that there are a bunch of TUI(text user interface) symbols. store these values in in strings as charters and use printf (or what ever function you want to output a string) to output it.
Was This Post Helpful? 1
  • +
  • -

#3 nathanpc  Icon User is offline

  • SCIENCE!
  • member icon

Reputation: 112
  • View blog
  • Posts: 1,171
  • Joined: 31-July 09

Re: Draw lines/boxes/borders using EMU8086

Posted 09 December 2010 - 04:49 PM

I like this site Extended ASCII Table. Take a look on which you want to use for each. Draw them using a print like the routine I have:
printf:
    mov ah, 0eh
    mov bl, 07h

    .nextchar
       lodsb
       or al, al
       jz .return
       int 10h
       jmp .nextchar

    .return
       ret

After printing the whole sudoku table, make the user input where he wants to place the number and which number he wants. So redraw the table, now using the new number. This would be the easiest way, but uses a lot of memory ;)

If you don't have a user input routine. Here is the one I use:
scanf:       
    mov ah, 00h
    int 16h
    
    mov ah, 0eh   
    int 10h
    
    loop getinput


Also take a look at the emu8086 examples that come within :)
Was This Post Helpful? 2
  • +
  • -

#4 deejay220989  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 20-September 08

Re: Draw lines/boxes/borders using EMU8086

Posted 09 December 2010 - 07:16 PM

Aha..I see..thanks alot guys!!
Was This Post Helpful? 0
  • +
  • -

#5 nathanpc  Icon User is offline

  • SCIENCE!
  • member icon

Reputation: 112
  • View blog
  • Posts: 1,171
  • Joined: 31-July 09

Re: Draw lines/boxes/borders using EMU8086

Posted 10 December 2010 - 03:33 PM

You're welcome. Don't forget to use the Posted Image button to regret everyone that helped you to manage it :)
Was This Post Helpful? 1
  • +
  • -

#6 kcp88  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 03-January 11

Re: Draw lines/boxes/borders using EMU8086

Posted 03 January 2011 - 02:38 AM

Nathan , i'm still not very understand about the code , can you explain the code for me ?
Was This Post Helpful? 0
  • +
  • -

#7 nathanpc  Icon User is offline

  • SCIENCE!
  • member icon

Reputation: 112
  • View blog
  • Posts: 1,171
  • Joined: 31-July 09

Re: Draw lines/boxes/borders using EMU8086

Posted 03 January 2011 - 05:26 AM

View Postkcp88, on 03 January 2011 - 08:38 AM, said:

Nathan , i'm still not very understand about the code , can you explain the code for me ?

It's very simple. It just loops in the characters stored and print them, until it reaches the end of the character sequence ;)
Was This Post Helpful? 0
  • +
  • -

#8 kcp88  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 03-January 11

Re: Draw lines/boxes/borders using EMU8086

Posted 03 January 2011 - 05:55 PM

View Postishkabible, on 08 December 2010 - 12:54 PM, said:

if you look at an extended ASCII you will see that there are a bunch of TUI(text user interface) symbols. store these values in in strings as charters and use printf (or what ever function you want to output a string) to output it.


How to store the values ? For the code given by Nathan , is it we need to store in al ? Use DB to define al ? But need to draw the whole table for the sudoku ...

This post has been edited by kcp88: 03 January 2011 - 06:00 PM

Was This Post Helpful? 0
  • +
  • -

#9 nathanpc  Icon User is offline

  • SCIENCE!
  • member icon

Reputation: 112
  • View blog
  • Posts: 1,171
  • Joined: 31-July 09

Re: Draw lines/boxes/borders using EMU8086

Posted 04 January 2011 - 08:32 PM

Using stosb you can made it ;)

I'm going to find an example here and I can share it with you, but this will be tomorrow, since it's 1:35 am here in Brazil now and I need to sleep

This post has been edited by nathanpc: 04 January 2011 - 08:35 PM

Was This Post Helpful? 0
  • +
  • -

#10 Guest_no name*


Reputation:

Re: Draw lines/boxes/borders using EMU8086

Posted 05 January 2011 - 07:27 AM

hello. I am facing the same sudoku algorithm problem now too. May I know how can I make the input algoritm for the sudoku. Please help.
Was This Post Helpful? 0

#11 kcp88  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 03-January 11

Re: Draw lines/boxes/borders using EMU8086

Posted 05 January 2011 - 07:31 AM

Multimedia University student also ? XD I've done but the code quite long . I use variable DB for the ASCII codes of the lines and LEA the variable into SI , then lodsb . Then , int 10h to print AL out .
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1