| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 982 人关注过本帖
标题:一个基础问题
只看楼主 加入收藏
Donie87412
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2007-11-29
收藏
 问题点数:0 回复次数:3 
一个基础问题
我写了一段输出字符串的代码,但是在要输出的字符串之前总是有很多乱码,请大家帮帮我
代码如下:
;COUNT
;*********************************************
.MODEL small
.stack 100h
;*********************************************
DATA SEGMENT
student_number       DB         0
below60              DB         ?
to6070               DB         ?
to7080               DB         ?
to8090               DB         ?
above90              DB         ?
average              Dw         ?

account      DW         60 dup(?)
;point        DB         '.'
message1     DB         'input the number of the students$'
anotherline  DB          10
message2     DB          'number  result'
DATA ends
;*********************************************
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
;---------------------------------------------
begin                 proc             far
                      call             read

begin                 endp
;---------------------------------------------
;accept name
read                  proc             near
                     
                      MOV              AX,DATA
                      MOV              DS,AX
                      lea              dx,message1
                      mov              ah,09
                      int              21h
                     
                      mov              dl,anotherline
                      mov              ah,02
                      int              21h
                     
                      ;input the number of the student
                      mov              ah,0ah
                      lea              dx,student_number
                      int              21h
                      ;give the format
                      lea              dx,message2
                      mov              ah,09
                      int              21h

                      mov              dl,anotherline
                      mov              ah,02
                      int              21h
                      ;input number    result
                     

                     
                      ret
read                  endp                  
;*********************************************
CODE ends
                      end              begin
搜索更多相关主题的帖子: 基础 
2007-12-04 22:36
zhoulikelvjj
Rank: 1
等 级:新手上路
帖 子:85
专家分:0
注 册:2007-4-10
收藏
得分:0 
你有没有试过,把message1     DB         'input the number of the students$'
这句放到数据段第一句定义,程序就会出错。。。。很另人废解
2007-12-05 00:32
Donie87412
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2007-11-29
收藏
得分:0 
试过啊,都不知道为什么,望高人指点
2007-12-05 12:30
快速回复:一个基础问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011383 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved