Question
I have this program that draws a circle but I need it in .model small. .MODEL TINY .286 .CODE ORG 100h Start: mov ax,13h int
I have this program that draws a circle but I need it in .model small.
.MODEL TINY
.286
.CODE ORG 100h Start: mov ax,13h int 10h ;mode 13h push 0a000h pop es ;es in video segment mov dx,160 ;Xc mov di,100 ;Yc mov al,04h ;Colour mov bx,50 ;Radius call Circle ;Draw circle mov ah,0 int 16h ;Wait for key mov ax,3 int 10h ;Mode 3 mov ah,4ch int 21h ;Terminate
;*** Circle ; dx= x coordinate center ; di= y coordinate center ; bx= radius ; al= colour
Circle: mov bp,0 ;X coordinate mov si,bx ;Y coordinate c00: call _8pixels ;Set 8 pixels sub bx,bp ;D=D-X inc bp ;X+1 sub bx,bp ;D=D-(2x+1) jg c01 ;>> no step for Y add bx,si ;D=D+Y dec si ;Y-1 add bx,si ;D=D+(2Y-1) c01: cmp si,bp ;Check X>Y jae c00 ;>> Need more pixels ret
_8pixels: call _4pixels ;4 pixels _4pixels: xchg bp,si ;Swap x and y call _2pixels ;2 pixels _2pixels: neg si push di add di,si imul di,320 add di,dx mov es:[di+bp],al sub di,bp stosb pop di ret
END Start
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started