📄 m.asm
字号:
title Tu Xing Bian Ji
;******************************************************
setcursor macro page,crow,ccol ;set cursor
mov ah,2
mov bh,page ;page No
mov dh,crow ;row
mov dl,ccol ;column
int 10h
endm
;********************************************************
zuobiao1 macro x,y ;
mov ah,0ch
mov dx,x
mov cx,y
mov al,4
int 10h
endm
renew macro ;
mov ah ,7
mov al,30
mov bh,0fh
mov ch,3
mov cl,18
mov dh,27
mov dl,76
int 10h
mov bh,0
mov dh,8
mov dl,20
mov ah,2
int 10h
endm
;--------------------------------------
line macro x1,y1,x2,y2,color
local line1
mov cx,x1
mov dx,y1
line1:
mov ah,0ch
mov al,color
int 10h
inc cx
cmp cx,x2
jne line1
endm
row macro x1,y1,x2,y2,color
local row1
mov cx,x1
mov dx,y1
row1:
mov ah,0ch
mov al,color
int 10h
inc dx
cmp dx,y2
jne row1
endm
show_juxing macro x1,y1,x2,y2,color
local show1
mov si,y1
show1:
line x1,si,x2,si,color
inc si
cmp si,y2
jne show1
endm
display_str macro str,len,x,y,color ;zi fu chuan ,zuo biao,yan se
mov ah,13h
mov al,0
mov cx,len
mov bp,offset str
mov bl,color
mov dh,x
mov dl,y
int 10h
endm
lookmouse1 macro x1,y1
local mouse11
mouse11:
mov ax,0003h
int 33h
cmp bx,1
jne mouse11
mov x1,cx
mov y1,dx
endm
lookmouse2 macro x,y
local mouse21
local mouse22
mouse21:
mov ax,0005h
mov bx,0h
int 33h
cmp ax,1
jne mouse21
mouse22:
mov ax,0006h
mov bx,0h
int 33h
cmp ax,0
jne mouse22
mov x,cx
mov y,dx
endm
write macro x,y
mov ah,0ch
mov al,color
mov dx,y
mov cx,x
int 10h
endm
dian macro j1,b1,n1,w1,color
mov cx,n1
mov dx,w1
mov ax,j1
mov bx,b1
mov al,color
endm
;*********************************************************
data segment
str1 db 'Graphic',0dh,0ah,'$'
str2 db ' Line ',0dh,0ah,'$'
str3 db ' Ploygon ',0dh,0ah,'$'
str4 db ' Circle ',0dh,0ah,'$'
str5 db 'Rectangle',0dh,0ah,'$'
str6 db ' Other ',0dh,0ah,'$'
str7 db 'pen','$'
str8 db 'Color',0dh,0ah,'$'
str9 db 'ew','$'
str10 db 'ove ','$'
str11 db 'elete','$'
str12 db 'ave','$'
str13 db 'uit','$'
str14 db 'Line/Col: '
str15 db 'O', '$'
str16 db 'N','$'
str17 db 'M','$'
str18 db 'D','$'
str19 db 'S','$'
str20 db 'Q', '$'
str21 db '/','$'
p db ' * Picture Edit * ','$'
xijibo db ' -------------------------------- ','$'
zu db ' Ma Zhigang(27) ','$'
zy1 db ' Xi Jibo (23) Nan Weishuang(2) ','$'
zy2 db ' Wang Fuwei(37) Li Fang (6) ', '$'
kong db ' ','$'
ok db ' Click "Delete" To Unload Me ! ','$'
ti db ' 00090B4 NO.6 ','$'
xing db '**************************************** ','$'
po db '*--------------------------------------* ','$'
pp db '* * Picture Edit * * ','$'
xijiboo db '* /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ * ','$'
zuu db '* Ma Zhigang(27) * ','$'
zy11 db '* Xi Jibo (23) Nan Weishuang(2) * ','$'
zy22 db '* Wang Fuwei(37) Li Fang (6) * ', '$'
kongg db '* * ','$'
okk db '* Happy new year! Thanks For Your Use! * ','$'
tii db '* 00090B4 NO.6 * ','$'
xia db '*______________________________________* ','$'
nws db '1. Please input " " to call D O S ! ','$'
hui db '2. Please input " " to return and Edit ! ','$'
q db 'Q','$'
r db 'R','$'
aboat db 'bout','$'
AAAA db 'A','$'
a db 4 dup(?)
b db 3 dup(?)
x0 dw ?
y0 dw ?
x1 dw ?
y1 dw ?
x2 dw ?
y2 dw ?
yuanx dw ? ;yuan xin
yuany dw ?
i dw ?
temp dw ?
highbity dw ?
lowbity dw ?
rc dw ?
m dw ?
n dw ?
mx1 dw ?
my1 dw ?
k1 dw ? ; xie lu
x dw ?
y dw ?
svsr db 0
color db 0
data ends
;********************************************************
code segment
main proc far
assume cs:code,ds:data,es:data
start:
push ds
mov ax,0
push ax
mov ax,data
mov ds,ax
;------------------------
call init
call choose
display_str xing, 40,5,19,10
display_str po, 40,6,19,10
display_str pp, 40,7,19,11
display_str xijiboo,40,8,19,10
display_str zuu,40,9,19,10
display_str zy11, 40, 10, 19, 10
display_str zy22, 40, 11 , 19, 10
display_str kongg, 40, 12, 19, 10
display_str okk, 40, 13, 19, 10
display_str kongg, 40, 14, 19, 10
display_str tii, 40 ,15,19,10
display_str xia, 40,16,19,10
display_str xing 40,17,19,10
display_str nws ,50,20,19,7
display_str hui 50,21,19,7
display_str q 1, 20,37,15
display_str r 1, 21,37,15
ret
main endp
;-------------------------------------------
init proc near
mov ah,0
mov ax,12h
int 10h
;-----------------------
mov ah,0bh
mov bh,0
mov bl,1
int 10h
;-----------------------
line 0,0,639,0,10
line 0,1,639,1,10
show_juxing 0,2,639,35,9
line 0,35,639,35,10
line 0,36,639,36,10
line 0,478,639,478,10
line 0,479,639,479,10
row 0,0,0,479,10
row 1,0,1,479,10
row 637,0,637,479,10
row 638,0,638,479,10
line 30,40,120,40,10
row 30,40,30,270,10
line 30,270,120,270,10
row 120,40,120,270,10
show_juxing 31,41,119,269,8
line 30,280,120,280,10
line 30,449,120,449,10
row 30,280,30,449,10
row 120,280,120,449,10
show_juxing 31,281,119,448,8
show_juxing 50,320,100,335,12
show_juxing 50,345,100,360,13
show_juxing 50,370,100,385,9
show_juxing 50,395,100,410,6
show_juxing 50,420,100,435,17
line 140,40,620,40,15
line 140,41,620,41,15
line 140,448,620,448,15
line 140,449,620,449,15
row 140,40,140,449,15
row 141,40,141,449,15
row 619,40,619,449,15
row 620,40,620,449,15
line 2,452,637, 452,10
line 2,453,637,452,10
show_juxing 2,454, 637,478 ,9
renew
call zuobiao
line 140,244,620,244,1
row 380,40,380,449,1
;--------------------------------------------------------
mov bp,seg str1
mov es,bp
display_str str1,7,3,6,14
display_str str2,9,6,5, 14
display_str str3,9,8,5, 14
display_str str4,9,10,5,14
display_str str5,11,12,5,14
display_str str6,9,14,5,14
display_str str8,5,18,7,14
display_str str7,3,1,5,14
display_str str9,2,1,11,14
display_str str10,4,1,17,14
display_str str11,5,1,25,14
display_str str12,3,1,33,14
display_str str13,3,1,40,14
display_str str14,10,1,60,14
display_str str21,1,1,73,10
display_str str15,1,1,4,10
display_str str16,1,1,10,10
display_str str17,1,1,16,10
display_str str18,1,1,24,10
display_str str19,1,1,32,10
display_str str20,1,1,39,10
display_str AAAA, 1,1,46,10
display_str aboat,4,1,47,14
;-------------------------------------------
mov ax,01h
int 33h
;-------------------------------------------
display_str a,4,1,74,14
display_str b,3,1,70,14
display_str str21,1,1,73,10
;-------------------------
mov ah,01h
mov ch,0
mov cl,0
int 10h
; mov ah ,2
; mov bh,0
; mov dh,30
; mov dl,40
; int 10h
ret
init endp
;---------------------------
;choose color ,tu xing
choose proc near
mm1:
lookmouse1 mx1,my1
; mov ah,0DH
; int 10h
; mov a,dx
; mov b,cx
mov ax,mx1
mov bx,my1
; lea si,a
; lea di,b
; mov word ptr [si],ax
; mov word ptr [di],bx
cmp bx,320
jl m3
m2:
cmp ax,50
jl m1 ;seletecolor
selcolor:
cmp ax,100
jg m1
cmp bx,335
jl color1
cmp bx,360
jl color2
cmp bx,385
jl color3
cmp bx,410
jl color4
cmp bx,435
jl color5
jmp other
jmp color1
m1:
jmp mm1
color1:
cmp bx,320
jl m1
mov color,12
jmp other
color2:
cmp bx,345
jl m1
mov color,13
jmp other
color3:
cmp bx,370
jl m1
mov color,9
jmp other
color4:
cmp bx,395
jl m1
mov color,6
jmp other
color5:
cmp bx,420
jl col
mov color,17
col:
jmp other
m3:
cmp bx,31
jl m5
cmp ax,31
jg m4
jmp m5
m4:
cmp ax,100
jl zyl1
jmp other
zyl1:
cmp bx,112
jl lin
cmp bx,145
jl zhexian
cmp bx,177
jl yuan
cmp bx,208
jl juxing
;cmp bx,240
;jl tuo
;jmp other
m5:
cmp ax,31
jg sos
jmp other
sos:
;cmp ax,32
;jl open1
cmp ax,107
jl new1
;cmp ax,44
;jl yd
cmp ax,242
jl dele
;cmp ax,160
;jl sav
cmp ax,345
jl quit1
cmp ax,420
jg help
jmp about
help:
jmp other
quit1:
jmp quit
lin:
cmp bx,94
jg w1
jmp other
w1:
call draw_line
jmp other
zhexian:
cmp bx,127
jg w2
jmp other
w2:
call draw_zhexian
jmp other
yuan:
cmp bx,159
jg w3
jmp other
w3:
call draw_circle
jmp other
juxing:
cmp bx,191
jg w4
jmp other
w4:
call draw_juxing
jmp other
;tuo:
;cmp bx,222
;jg w5
;jmp other
w5:call other
jmp other
;open1:
;cmp ax,0
;jg G1
;jmp other
;G1:
;call openproce
;jmp other
new1:
cmp ax,80
jg G2
jmp other
G2:
call aa
jmp other
;yd
;cmp ax,64
;jg G3
;jmp other
;G3:
;call ydproce
;jmp other
dele:
cmp ax,188
jg G4
jmp other
G4:
call bb
call zuobiao
line 140,244,620,244,1
row 380,40,380,449,1
jmp other
;sav:cmp ax,128
;jg G5
;jmp other
;G5:
;call savproce
;jmp other
quit:
cmp ax,310
jg G6
jmp other
G6:
jmp tui
about:
cmp ax, 390
jmp G7
jmp other
G7:
show_juxing 180,180,500,350,9
show_juxing 500,210,520,350,8
show_juxing 200,350,520,370,8
display_str p,35,12,25,11
display_str xijibo,35,13,25,12
display_str zu,35,14,25,14
display_str zy1, 35, 15, 25, 14
display_str zy2, 35, 16 , 25, 14
display_str kong , 35, 17, 25, 14
display_str ok, 35, 18, 25, 10
display_str kong , 35, 19, 25, 14
display_str ti,35 ,20,25,14
other:
mov ax,01h
int 33h
jmp m1
tui:
mov ah,0
mov al,3h
int 10h
jianpan:
mov ah,08h
int 21h
cmp al,'R'
je return
cmp al,'Q'
je tuichu
jmp jianpan
tuichu:
mov ah,4ch
int 21h
return:
call aa
ret
choose endp
;--------------------------------------
aa proc near
mov ah,0
mov ax,12h
int 10h
;-----------------------
mov ah,0bh
mov bh,0
mov bl,1
int 10h
line 0,0,639,0,10
line 0,1,639,1,10
show_juxing 0,2,639,35,9
line 0,35,639,35,10
line 0,36,639,36,10
line 0,478,639,478,10
line 0,479,639,479,10
row 0,0,0,479,10
row 1,0,1,479,10
row 637,0,637,479,10
row 638,0,638,479,10
line 30,40,120,40,10
row 30,40,30,270,10
line 30,270,120,270,10
row 120,40,120,270,10
show_juxing 31,41,119,269,8
line 30,280,120,280,10
line 30,449,120,449,10
row 30,280,30,449,10
row 120,280,120,449,10
show_juxing 31,281,119,448,8
show_juxing 50,320,100,335,12
show_juxing 50,345,100,360,13
show_juxing 50,370,100,385,9
show_juxing 50,395,100,410,6
show_juxing 50,420,100,435,17
line 140,40,620,40,15
line 140,41,620,41,15
line 140,448,620,448,15
line 140,449,620,449,15
row 140,40,140,449,15
row 141,40,141,449,15
row 619,40,619,449,15
row 620,40,620,449,15
line 2,452,637, 452,10
line 2,453,637,452,10
show_juxing 2,454, 637,478 ,9
call zuobiao
line 140,244,620,244,1
row 380,40,380,449,1
;-------------------------
mov ah,01h
mov ch,10
mov cl,10
int 10h
;-----------------------
mov bp,seg str1
mov es,bp
display_str str1,7,3,6,14
display_str str2,9,6,5, 14
display_str str3,9,8,5, 14
display_str str4,9,10,5,14
display_str str5,11,12,5,14
display_str str6,9,14,5,14
display_str str8,5,18,7,14
display_str str7,3,1,5,14
display_str str9,2,1,11,14
display_str str10,4,1,17,14
display_str str11,5,1,25,14
display_str str12,3,1,33,14
display_str str13,3,1,40,14
display_str str14,10,1,60,14
display_str str21,1,1,73,10
display_str str15,1,1,4,10
display_str str16,1,1,10,10
display_str str17,1,1,16,10
display_str str18,1,1,24,10
display_str str19,1,1,32,10
display_str str20,1,1,39,10
display_str AAAA, 1,1,46,10
display_str aboat,4,1,47,14
;-------------------------------------------
mov ax,01h
int 33h
;-------------------------------------------
display_str b,3,1,73,14
display_str a,3,1,70,14
renew
call zuobiao
line 140,244,620,244,1
row 380,40,380,449,1
display_str b,4,1,74,14
display_str a,3,1,70,14
display_str str21 1,1,73,10
ret
aa endp
bb proc near
mov ah ,7
mov al,30
mov bh,0fh
mov ch,3
mov cl,18
mov dh,27
mov dl,76
int 10h
mov bh,0
mov dh,8
mov dl,20
mov ah,2
int 10h
ret
bb endp
draw_line proc near
push ax
push bx
push cx
push dx
next1p:
;mov ax,1
;int 33h
ky:
lookmouse2 x1,y1
mov ax,x1
cmp ax,143
jl next1p
lookmouse2 x2,y2
mov ax,2
int 33h
next2:
call linem
mov ax,1
int 33h
pop dx
pop cx
pop bx
pop ax
jj:
; mov ax,1
; int 33h
ret
draw_line endp
;.........................................
linem proc near
mov ax,x2
cmp ax, x1
je equ1
cmp ax,x1
jg big
jmp small
big: sub ax,x1
cmp ax,10h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -