📄 core.asm
字号:
include core.lib
include immacro.lib
public TaxisMarkT
MESSAGE STRUC
NUMBER DB 10 DUP (0)
UNAME DB 10 DUP (0)
MASM DB 10 DUP (0)
COMPOSE DB 10 DUP (0)
SYSTEM DB 10 DUP (0)
TOTAL DB 10 DUP (0)
ORDER DB 10 DUP (0)
NUMBIT DB 10 DUP (0);每种数据的长度
TOTALNUM DW 0;存放总成绩
MESSAGE ENDS
data segment common
;主菜单名
mainmenu1 db 'File'
mainmenu2 db 'Edit'
mainmenu3 db 'See'
mainmenu4 db 'Help'
;主菜单File下的子菜单名
submenu11 db 'Save'
submenu12 db 'Open'
submenu13 db 'Exit'
;主菜单Edit下的子菜单名
submenu21 db 'Insert'
submenu22 db 'Delete'
submenu23 db 'Order'
submenu24 db 'Modify'
;主菜单See下的子菜单名
submenu31 db 'SeeData'
submenu33 db 'Find'
;主菜单Help下的子菜单名
submenu41 db 'About'
submenu42 db 'Help'
;欢迎窗口信息
msgtitle db 'Info Manage System (V1.0)'
msg0 db 'Powered by lixi'
msg1 db 'Copyright @ 2004 - 2005'
msg6 db 'Press any key to continue...'
;其他信息
buttonMsg1 db 'Alt+X-Exit'
buttonMsg2 db 'Alt+S-Save'
buttonMsg3 db 'Esc-Return'
buttonMsg4 db 'F1-Help'
buttonMsg5 db 'F3-Find'
helpMsg0 db 'Help'
helpMsg1 db 'Press Alt+F,Alt+E,Alt+S,Alt+H or ',19h,' to open the submenu3.'
helpMsg2 db 'Press Enter (',11h,0c4h,0d9h,') to open the submenu3.'
helpMsg3 db 'Press ',1bh,' or ',1ah,' to select the mainmenu.'
helpMsg4 db 'Press ',18h,' or ',19h,' to select the submenu3.'
helpMsg5 db 'Press Esc to exit every subject.'
text db ' NO Name Masm Compose System Total Order'
text20 db '---------------------Insert---------------------------'
text21 db 'No (10):'
text22 db 'Name (6):'
text23 db 'Masm (4):'
text24 db 'Compose (4):'
text25 db 'System (4):'
text26 db 'Total (4):'
text27 db 'Order (4):'
text28 db 'Press Alt+S to Save'
text30 db 'Manage'
text31 db 'Delete'
text32 db 'Modify'
text33 db 'Exit'
text40 db 'Confirm'
text41 db 'Are you sure?'
text42 db 'Yes'
text43 db 'No'
text50 db 'Open File'
text51 db 'Path:'
text60 db 'Save File'
text61 db 'File Name:'
text62 db 'Save To This File?'
text70 db 'File Message'
text71 db 'File open frustratedly!'
text72 db 'File save frustratedly!'
text73 db 'File open successfully!'
text74 db 'File save successfully!'
text80 db 'Find'
text81 db 'Name(6):'
text82 db 'Not find the note!'
text90 db 'About'
text100 db 'Delete'
sub11 db 'Select Save'
sub12 db 'Select Open'
sub13 db 'Select Exit'
sub21 db 'Select Insert'
sub22 db 'Select Delete'
sub23 db 'Select Compose'
sub31 db 'Select SeeData'
sub32 db 'Select InAll'
sub33 db 'Select Find'
sub41 db 'Select About'
sub42 db 'Select Our'
;-------------------------
IL EQU 33 ;输入数据对话框左边界
IT EQU 10 ;输入数据对话框上边界
IB EQU 14 ;输入数据对话框下边界
IR EQU 43 ;输入数据对话框右边界
FL EQU 14 ;文件对话框输入左边界
FR EQU 27 ;文件对话框输入右边界
FT EQU 5 ;文件对话框输入上边界
ML EQU 3 ;菜单的左边界
MT EQU 0 ;菜单的上边界
FINDL EQU 36 ;查找对话框输入左边界
FINDT EQU 10 ;查找对话框输入上边界
FINDR EQU 45 ;查找对话框输入右边界
;-------------------------
;屏幕缓存
scrmm db 100 dup(?)
bscrmm db 20000 dup(?)
scrnum dw 0
;存储数据
;TOTAL DB ?
GRADE MESSAGE 200 dup (<>)
varGrade db 82 dup(0)
;文件名
FILENAME DB 100 DUP (0);存储文件路径
FILENAMEBUF DB 100 DUP (0);文件路径缓存
FILEHANDLE DW 0 ;文件句柄
;查找缓存
FINDBUF DB 15 DUP (0)
isInsData db 0;为0时表示没有插入数据
mainnum db 1;主菜单序列号
subnum db ?;子菜单序列号
subshow db 0;为0时子菜单未显示
mainindex db ?;主菜单字符长度
nowpos db 5 dup(?);当前列
nowrow db ?;当前行
nowline db ?;当前列
datanum db 0;数据数
wdatanum dw 0;
displaynum db 18;显示的行数
temVar db ?;临时变量
wtemVar dw ?;字型临时变量
data ends
code segment
;-------------------------------------
;功能:排序
;-------------------------------------
TaxisMarkT proc far
assume cs:code,ds:data
pushx
push si
push di
push ds
mov ax,data
mov ds,ax
call initOrder
lea si,grade
lea di,grade
mov ax,wdatanum
mov wtemVar,1 ;存储名次
mov bx,word ptr [di+80] ;冒泡法,存储一轮比较中的最大值
mov cx,1 ;当前数的下标
mov dx,0 ;存储当前值
continue:;本轮的比较
cmp cx,ax
jnl nextStep
add si,82
mov dx,word ptr [si+80]
cmp bx,dx
jl changePos
inc cx
jmp continue
changePos:;交换位置
ChangeData [di],[si],82
mov bx,dx
inc cx
jmp continue
nextStep:;进入下一轮
NumToAscll [di+60],wtemVar
cmp wtemVar,ax
jnl TaxisExit
lea si,grade
add di,82
mov bx,word ptr [di+80]
mov si,di
inc wtemVar
mov cx,wtemVar
jmp continue
TaxisExit:
pop ds
pop di
pop si
popx
ret
TaxisMarkT endp
;-------------------------------------
;功能:初始化名次
;-------------------------------------
initOrder proc near
assume cs:code,ds:data
pushx
push di
push ds
mov ax,data
mov ds,ax
lea di,grade
add di,60
mov al,0
mov bx,0
initCon:
cmp bx,wdatanum
jnl initEnd
mov cx,10
rep stosb
add di,72
inc bx
jmp initCon
initEnd:
pop ds
pop di
popx
ret
initOrder endp
code ends
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -