码迷,mamicode.com
首页 > 编程语言 > 详细

汇编语言画圆

时间:2015-04-04 12:13:00      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:

CODES SEGMENT
    ASSUME CS:CODES
START:
    MOV DS,AX
    
    MOV AH,00H
    MOV AL,13H
    INT 10H
    
    MOV DX,40
AGAIN:
    MOV CX,0
AGAIN_X:
    PUSH CX
    PUSH DX
    
    CMP CX,80
    JB XBELOW
    
    SUB CX,80
    JMP XSQUARE
XBELOW:
    MOV BX,80
    SUB BX,CX
    MOV CX,BX
XSQUARE:
    MOV AX,CX
    MUL CX
    MOV CX,AX
AGAIN_Y:
    POP DX
    PUSH DX
    CMP DX,120
    JB YBELOW
    
    SUB DX,120
    JMP YSQUARE
YBELOW:
    MOV BX,120
    SUB BX,DX
    MOV DX,BX
YSQUARE:
    MOV AX,DX
    MUL DX
    MOV DX,AX
HANDLE:
    ADD CX,DX
    MOV BX,CX
    POP DX
    POP CX
    CMP BX,6400
    JA LAST
    
    MOV AH,0CH
    MOV AL,3
    INT 10H
LAST:
    INC CX
    CMP CX,160
    JB AGAIN_X
    INC DX
    CMP DX,310
    JB AGAIN
    
    MOV AH,4CH
    INT 21H
    
CODES ENDS
    END START

技术分享

汇编语言画圆

标签:

原文地址:http://www.cnblogs.com/laudoak/p/4391846.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!