如何用汇编语言绘制方形

Alb*_*der 2 assembly

T想用汇编语言绘制正方形.我骑过一些东西int 10h.有谁知道,该怎么办?请在这里给我一些代码,我可以用它来绘制正方形或一些高质量的教程.谢谢.

pau*_*sm4 8

就像Frederic Hamidi所说,"int 0x10h"是一个过时的BIOS界面.如果您对汇编感兴趣,我强烈建议您避免使用16位DOS/Masm教程并学习更现代的操作系统(如Linux).

我强烈推荐Jonathan Bartlett撰写的"从头开始编程":

http://savannah.nongnu.org/projects/pgubook/

不过,如果你真的想在16位实模式(即DOS)中画一条线(或方形),这里有一个例子:

http://lateblt.tripod.com/asm.htm

; Draw a line in a graphics mode

;By extension, draws a yellow line in the upper-left.
;A good example of how to efficiently use INC, CMP,
;and a conditional jump for repetitive tasks.

mov ah,00h
mov al,13h
int 10h

;The above three lines just switch to 320x200 256-color VGA.

mov ds,40960
;a000h = 40960 decimal
mov ax, 44h
;44h is yellow! ;)
mov bx,0000
START:
mov [bx],ax
inc bx
cmp bx,20
JL START

;This waits until BX reaches 20, then exits!

mov ah,004C  ;terminate program
int 21h
Run Code Online (Sandbox Code Playgroud)