Can you use new line that has 21h on a setting of 10h?
if not then how would it be possible to set a new line for 10h via 8086?
What im trying to do is to use loops that would resemble a square.
org 100h
mov ah, 0 ; set display mode function.
mov al, 13h ; mode 13h = 320x200 pixels, 256 colors.
int 10h ; set it!
mov cx, 10
mov dx, 10
mov ah, 0ch ; put pixel
int 10h
colcount:
inc cx
int 10h
cmp cx, 20
JNE colcount
rowcount:
inc cx
int 10h
cmp cx, 20
JNE rowcount
mov ah, 0 ; set display mode function.
mov al, 13h ; mode 13h = 320x200 pixels, 256 colors.
int 10h ; set it!
mov cx, 10 ;col
mov dx, 10 ;row
mov ah, 0ch ; put pixel
colcount:
inc cx
int 10h
cmp cx, 30
JNE colcount
mov cx, 10 ; reset to start of col
inc dx ;next row
cmp dx, 30
JNE colcount
(Based on your code) this should draw a square,
each time drawing 20 pixels in a row(by increasing cx-col), then going to the next row(increase dx-row) and drawing 20 pixels in that row.
This will create a square by drawing 20pixels each row in 20 rows
The answer presented by YonBruchim indeed draws a rectangle of 20x20 dots at (11,10)-(30,29) but starts out with an extra dot at (10,10)!
This BIOS call also needs you specify the video page number in BH (mostly 0) and the pixel color in AL (15 for bright white).
As already pointed out by Ruud never assume AX will be preserved by any API call.
Personally I don't like constructs likecmp cx,30
jne colcount
Rather usecmp cx,30
jb colcount
The latter is more forgiving if ever CX 'sits' at the wrong end of the value range you are expecting!
来源:https://stackoverflow.com/questions/23723904/how-to-draw-a-square-int-10h-using-loops