一个汇编写的通讯录程序

这个博客分享了作者使用汇编语言编写的通讯录程序,该程序适用于DOS环境,采用MASM5.11编译。程序包括了数据结构如姓名和电话的存储,以及文件读写、搜索和显示功能。通过用户输入命令进行交互操作。
摘要由CSDN通过智能技术生成

上学期汇编课交的大作业 .....HOHO自我感觉还不错啦...

DOS下的.....MASM5.11通过编译

 

;message list
dataseg segment
        savebloks dw 32*6 dup (?)
        titstr1   db 'Name    List$'
        titstr2   db 'Phone    List$'
        namcolor  db 1eh           ;name space color
        phcolor   db 1eh           ;phone sapce color
        titcolor  db 01110000b           ;title color
        ibcolor   db 01110000b           ;infobox color
        cmdlcolor db 00100100b           ;command line color
        msgcolor  db 01100111b
        msgadr    dw 3 dup(0)
        handle    dw ?
        showin    db 1

        searchstr   db 30 dup(' ')
        searchphone db 30 dup(' ')
        searchn     db 0

        exactmatch db 0
        lastone    db 0


        inputbuf  db 34
        actlen    db ?
        inputstr  db 34 dup(' ')

 

        infomsg1  db 'Info: Give your command below                $'
        infomsg2  db 'Warning: Unanalysable command,type again     $'
        infomsg3  db 'Info: Input your name below                  $'
        infomsg4  db 'Info: Input your phone number below          $'
        infomsg5  db 'Info: Input the number of item you want below$'

        msgempty  db '<Empty List>$'
        msgeol    db '<End Of List>$'

        msg0      db '       Welcome to use         '
        msg00     db '    G-Adresser  0.9 beta      '
        msg000    db '     Write by Gengyiting      '
        msgblank  db '                                                         ','$'
        pathnam   db 'NAME.DAT',0
        msg10     db 'Press any key to continue.....'
        msg1      db '    Cannot find Name.dat      '
        msg2      db '  Program Will Creat the File '
        msg3      db '        ../NAME.DAT           '
        msg4      db '    Open File Successfully    '
        msg5      db '       Creat File Fail        '
        msg6      db '      Program Terminate       '
        msg7      db '    Creat File Successfully   '
        msg8      db '    Read file failed,exit     '
        msg9      db '    Write file failed,exit    '
        msgfind   db '   The item you found is:     '
        msgferr   db '    Cannot find the item      '
        msgferr2  db '     Check  your input!       '

        ;in big size
        filebuf   dw   00   
        arraybuf  dw   250 dup(0)
        itemlist  db   250 dup(30 dup(0),20 dup(0))
        teststr1  db  30 dup('1'),20 dup('2')
        teststr2  db  30 dup('5'),20 dup('6')

 

dataseg ends

codeseg segment

        assume cs:codeseg,ds:dataseg,es:dataseg,ss:dataseg

 

main    proc far
        push ds
        xor  ax,ax
        push ax
        mov  ax,dataseg
        mov  ds,ax
        mov  es,ax

        call setscrmode
        call clrscr
        call buildframe
        lea  si,msg0
        mov  msgadr,si
        lea  si,msg00
        mov  msgadr+2,si
        lea  si,msg000
        mov  msgadr+4,si
        call showmsg
        call findfile
        call showitems
        call getcommand                 ;this is the main subprogram

        ret
main    endp

 

setscrmode proc near
        mov  ah,0
        mov  al,3
        int  10h
        ret
setscrmode endp

clrscr  proc near
        mov  ax,0619h
        mov  cx,0
        mov  dx,184fh
        mov  bh,1eh       ;here is color value
        int  10h
        ret
clrscr  endp

gotoxy  proc near
        push ax
        push bx
        mov  ah,2
        mov  bh,0
        int  10h
        pop  bx
        pop  ax
        ret
gotoxy  endp

hidecursor proc near
        mov  ah,3
        mov  bh,0
        int  10h
        or   ch,30h
        mov  ah,1
        int  10h
        ret
hidecursor endp

showcursor proc near
        mov  bh,0
        mov  ah,3
        int  10h
        mov  ah,1
        mov  cx,0607h
        int  10h
        ret
showcursor endp

waitfk  proc near
        mov  ah,0h
        int  16h
        ret
waitfk  endp

showmsg proc near
        call  hidecursor
        lea  si,savebloks       ;save original scr
        mov  cx,0
        mov  dh,8
  l1:
        mov  cl,0
        inc  dh
        mov  dl,23
  l2:
        inc  dl
        call gotoxy
        mov  ah,8
        mov  bh,0
        int  10h
        mov  [si],al
    

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值