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

Modify this code: [org 0x0100] mov ax, 0x000D ; set 320x200graphics mode int 0x1

ID: 3612367 • Letter: M

Question

Modify this code:
[org 0x0100]    mov ax, 0x000D ; set 320x200graphics mode    int 0x10 ; bios videoservices    mov ax, 0x0c07 ; put pixel inwhite color    xor bx, bx ; page number0    mov cx, 0 ; x position200    mov dx, 0 ; y position200
l1: int 0x10 ; bios video services    inc dx ; decrease yposition
   loop l1 ; decrease x positionand repeat    mov ah, 0 ; service 0 –get keystroke
   int 0x16 ; bios keyboardservices    mov ax, 0x0003 ; 80x25 textmode    int 0x10 ; bios videoservices
   mov ax, 0x4c00 ; terminateprogram    int 0x21
(draw line in graphics mode) such that it draws Green colorlines on screen boundary as shown in the diagram below:

Explanation / Answer

DearUser,        

The following program draws a horizontal line on the screen fromlocation (240, 170) to (240,470) by writing pixels on the screenusing function (AH=0Ch) of INT 10h.

.MODEL   SMALL        // this defines thememory model

.STACK   100                 //define a stack segment of 100 bytes

.DATA                            //thisis the data segment

.CODE                            //this is the code segment

MOV AX,@DATA         //get the address of the data segment

MOV DS, AX                //and store it in DS register

MOV AH, 00h               //set video mode

MOV AL, 12h               //graphics 640x480

INT 10h

// Draw a green color line from (240, 170) to (240, 470)

MOV CX, 170               //start from row 170

MOV DX, 240               //and column 240

MOV AX, 0C02h          //AH=0Ch and AL = pixel color (green)

BACK: INT 10h            //draw pixel

INC CX                         //go to next column

CMP CX, 470               //check if column=470

JB BACK                      //if not reached column=470, then continue

MOV AH, 07h              //wait for key press to exit program

INT 21h

MOV AX, 4C00H         //Exit to DOS function

INT 21H

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote