answersLogoWhite

0


Best Answer

Circle Macro x,y,rad,color

local Loop1,Loop2,Loop3

pusha

; BX=X Offset, CX=Y Offset, DX=Some evil counter

xor bx,bx

mov cx,[rad]

mov ax,cx

shl ax,1

mov dx,3

sub dx,ax

; AL=Color

mov al,

; Calculate address of center in vidmem.

mov di,[y]

mov si,di

shl di,8

shl si,6

add di,si

add di,[x]

mov gs,di

Loop1:

; Plot 8 pixels using known centerpoint and X and Y offsets.

mov di,gs

add di,bx

mov si,cx

shl si,6

add di,si

shl si,2

add di,si

mov es:[di],al

sub di,si

sub di,si

shr si,2

sub di,si

sub di,si

mov es:[di],al

sub di,bx

sub di,bx

mov es:[di],al

add di,si

add di,si

shl si,2

add di,si

add di,si

mov es:[di],al

mov di,gs

add di,cx

mov si,bx

shl si,6

add di,si

shl si,2

add di,si

mov es:[di],al

sub di,si

sub di,si

shr si,2

sub di,si

sub di,si

mov es:[di],al

sub di,cx

sub di,cx

mov es:[di],al

add di,si

add di,si

shl si,2

add di,si

add di,si

mov es:[di],al

; Is DX still under zero?

cmp dx,0

jge Loop2

; If, add 4*XOffset+6 to DX

mov si,bx

shl si,2

add si,6

add dx,si

jmp Loop3

Loop2:

; If not, add 4*(XOffset-YOffset)+10 to DX

mov si,bx

sub si,cx

shl si,2

add si,10

add dx,si

; Decrease Y coordinate

dec cx

Loop3:

; Increase X coordinate

inc bx

; Is X Offset<Y Offset; if is, loop again.

cmp bx,cx

jl Loop1

popa

ENDM

mov ax,0013h

int 10h

mov ax,0A000h

mov es,ax

circle 10,10,5,55

AWAIT:

MOV AH,0

INT 16H

CMP AH,1

JE EXIT

JMP AWAIT

EXIT:

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write assembly program that draw circle?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program in 8086 assembly language to draw a circle?

You need an 8086 assembly language pencil.


How do you draw a circle in assembly program?

You can draw a circle in assembly program by using a compass-like tool. Secure the tip of the compass and then rotate the compass tool so that it completes the circle.


Write a java code to draw a circle inside in an ellipse?

write a program draw circle and ellipse by using oval methods in java


Draw a flowchart that will accept radius and display the area of circle?

program that display the area of a circle of a reduce


Write a c programme to draw a rainbow?

Write a C program to Draw a RAINBOW and fill the suitable colors ...


Can you use The Steelers logo in art?

All you need to do is draw a circle, and draw 3 astroids (hypocycloid with four cusps) on the right side of the circle. After that, write Steelers in the left side of the circle.


How do you draw and label the diameter and radius on a circle?

The diameter is a straight line from one side of the circle to the other which passes through the centre of the circle. The radius is a straight line from the centre to the boundary of the circle. To label them, you could either write the words alongside the lines or, if the circle is too small, draw arrows from the two lines to outside the circle and write the words at the end of the arrow.


How to write a Program in C language to draw a house?

here you go nah...


How do you draw a lollipop?

draw a straight line then draw a circle on that line at the top then draw a swirl in the circle


How do you draw a man on his knees step by step?

U first draw a circle and then u draw another circle next to it. After that u make a square in the middle of the 2 circles on top. Now u write on top " I have just wasted my time by reading this."


How do you draw a tutu?

You make a circle then put a circle in it, then draw lines


How do you draw a panda?

Draw a big circle for the body.Draw a smaller circle on top of that circle to be the head. Draw three little circles inside the top circle to be the eyes and nose. Draw two little circles on top of the top circle for the ears. Draw four cylinders off the large circle for the legs.