Skip to content

Instantly share code, notes, and snippets.

@Yousif-FJ
Last active June 30, 2022 13:53
Show Gist options
  • Save Yousif-FJ/8964969db7d31effb00fbfbe3da00c09 to your computer and use it in GitHub Desktop.
Save Yousif-FJ/8964969db7d31effb00fbfbe3da00c09 to your computer and use it in GitHub Desktop.
Q\Write an 8086 program to draw a horizontal line starts at the position 60,60 with the length of 100 pixel and with Magenta color
org 100h
;set display mode to 320x200 for drawing
MOV AX,0013H
INT 10H
;set up drawing
MOV CX,60 ; x coordinate
MOV DX,60 ; y coordinate
MOV AL,5 ; set colour magenta
MOV AH,0CH ; draw pixel
MOV BH,0 ;page 0
;draw pixel each time
repeat:
INT 10H
INC CX ;move along x axis
CMP CX,160 ; 100(length)+60(starting position) = 160
JNE repeat
ret
@Yousif-FJ
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment