Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

- draw the boarder with numbers as displayed - make it somewhat playable (enteri

ID: 2291784 • Letter: #

Question

- draw the boarder with numbers as displayed
- make it somewhat playable (entering numbers)
- use 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. 6 3 5 8 b 728 5 5 Please enter row I've never learnt about drawing lines/borders using assembly language. Can someone give me hints? Thanksll

Explanation / Answer

In this problem, your lecturer did nothing new. He only used rectangles of different sizes, you just need to develop them one into another and thats it.

The way of making lines/squares/rectangle in programming is explained here:- hope it will be more than helpful :)

; Draw a line in a graphics mode

;By extension, draws a yellow line in the upper-left.

;A good example of how to efficiently use INC, CMP,

;and a conditional jump for repetitive tasks.

mov ah,00h

mov al,13h

int 10h

;The above three lines just switch to 320x200 256-color VGA.

mov ds,40960

;a000h = 40960 decimal

mov ax, 44h

;44h is yellow! ;)

mov bx,0000

START:

mov [bx],ax

inc bx

cmp bx,20

JL START

;This waits until BX reaches 20, then exits!

mov ah,004C ;terminate program

As you can see, the above code puts the PC into 320x200x8 mode (int 0x0x10, mode 0x13), then draws 20 yellow pixels (0x44) to the video buffer (address 40960 == 0xa000). The video buffer is actually an array. The first pixel in the first row is 0xa000 + 0, the second pixel in the first row is 0xa000 + 1, etc. The first pixel in the second row is 0xa000 + 200, the second is 0xa000 + 201, etc. If you want to draw any pixel in any row, just compute the offset. To draw a horizontal line, just add "1". To draw a vertical line, just add "200". Make sense?