| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 543 人关注过本帖
标题:[求助]求教汇编问题
只看楼主 加入收藏
ququjianke
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-1-2
收藏
 问题点数:0 回复次数:0 
[求助]求教汇编问题

我用汇编编的一个用串口通信用的是两台机子的COM1口相连 运行之后发送方发完之后不能自动换下一行
请哪个大哥帮帮忙 改一下 是它能自动换行
程序一:发送方

STACK SEGMENT
DB 256 DUP(0)
STACK ENDS
DATA SEGMENT
MENU DB 0DH,0AH,"0.END SEND,BYE-BYE! 1.BEGIN RECEIVE: 2.BEGIN SEND:"
DB "PLEASE CHOICE:$"
ERRMSG DB 0DH,0AH,"CHOICE WRONG,PLEASE CHOICE AGAIN:$"
SEL0 DB 0DH,0AH,"YOU CHOICE 0, END SEND,BYE-BYE!$"
SEL1 DB 0DH,0AH,"YOU CHOICE 1,BEGIN RECEIVE:$"
SEL2 DB 0DH,0AH,"YOU CHOICE 2, BEGIN SEND:$"
ADDRTAB DW A0,A1,A2

DATA ENDS
CODE SEGMENT
START PROC FAR
ASSUME CS:CODE ,DS:DATA,SS:STACK
MOV AX,DATA
MOV DS,AX
PUSH DS
MOV AX,0
PUSH AX
MOV DX,3FBH
MOV AL,80H
OUT DX,AL
MOV DX,3F8H
MOV AL,60H
OUT DX,AL
MOV DX,3F9H
MOV AL,0
OUT DX,AL
MOV DX,3FBH
MOV AL,0BH
OUT DX,AL
MOV DX,3FCH
MOV AL,03H
MOV AL,0
MOV DX,3F9H
OUT DX,AL
MENU1:LEA DX,MENU
MOV AH,9
INT 21H
MOV AH,1
INT 21H
CMP AL,'0'
JB ERROR1
CMP AL,'2'
JA ERROR1
LEA BX,ADDRTAB
SUB AL,30H
SHL AL,1
XOR AH,AH
ADD BX,AX
JMP WORD PTR [BX]
ERROR1:MOV DX,OFFSET ERRMSG
MOV AH,9
INT 21H
JMP MENU1
A0: LEA DX,SEL0
MOV AH,9
INT 21H
JMP N1
A1: LEA DX,SEL1
MOV AH ,9
INT 21H
JMP RCV
A2: LEA DX,SEL2
MOV AH,9
INT 21H
JMP CHECK
CHECK:MOV DX,3FDH
IN AL,DX
TEST AL,1EH
JNZ ERROR
TEST AL,01H
JNZ RCV
TEST AL,20H
JZ CHECK
MOV AH,1
INT 16H
JZ CHECK
MOV AH,0
INT 16H
MOV DX,3F8H
OUT DX,AL
CMP AL,30H
JZ A0
MOV DL,AL
MOV AH,2
INT 21H
JMP CHECK
RCV: MOV DX,3F8H
IN AL,DX
PUSH AX
CMP AL,'0'
JZ A0
MOV DL,AL
MOV AH,2
INT 21H
POP AX
CMP AL,03H
JZ N1
CMP AL,0DH
JNZ CHECK
MOV DL,0AH
MOV AH,2
INT 21H
JMP CHECK

ERROR:MOV DX,3F8H
IN AL,DX
MOV AL,'?'
MOV BX,0
MOV AH,14
INT 10H
JMP CHECK
N1: RET
START ENDP
CODE ENDS
END START
程序二:接收方
STACK SEGMENT
DB 256 DUP(0)
STACK ENDS
DATA SEGMENT
MENU DB 0DH,0AH,"0.END SEND,BYE-BYE! 1.BEGIN RECEIVE: 2.BEGIN SEND:"
DB "PLEASE CHOICE:$"
ERRMSG DB 0DH,0AH,"CHOICE WRONG,PLEASE CHOICE AGAIN:$"
SEL0 DB 0DH,0AH,"YOU CHOICE 0, END SEND,BYE-BYE!$"
SEL1 DB 0DH,0AH,"YOU CHOICE 1,BEGIN RECEIVE:$"
SEL2 DB 0DH,0AH,"YOU CHOICE 2, BEGIN SEND:$"
ADDRTAB DW A0,A1,A2
DATA ENDS
CODE SEGMENT
START PROC FAR
ASSUME CS:CODE,DS:DATA,SS:STACK
MOV AX,DATA
MOV DS,AX
PUSH DS
MOV AX,0
PUSH AX
MOV DX,3FBH
MOV AL,80H
OUT DX,AL
MOV DX,3F8H
MOV AL,60H
OUT DX,AL
MOV DX,3F9H
MOV AL,0
OUT DX,AL
MOV DX,3FBH
MOV AL,0BH
OUT DX,AL
MOV DX,3FCH
MOV AL,03H
MOV AL,0
MOV DX,3F9H
OUT DX,AL
MENU1:LEA DX,MENU
MOV AH,9
INT 21H
MOV AH,1
INT 21H
CMP AL,'0'
JB ERROR1
CMP AL,'2'
JA ERROR1
LEA BX,ADDRTAB
SUB AL,30H
SHL AL,1
XOR AH,AH
ADD BX,AX
JMP WORD PTR [BX]
ERROR1:MOV DX,OFFSET ERRMSG
MOV AH,9
INT 21H
JMP MENU1
A0: LEA DX,SEL0
MOV AH,9
INT 21H
JMP N1
A1: LEA DX,SEL1
MOV AH ,9
INT 21H
JMP RCV
A2: LEA DX,SEL2
MOV AH,9
INT 21H
JMP CHECK
CHECK:MOV DX,3FDH
IN AL,DX
TEST AL,1EH
JNZ ERROR
TEST AL,01H
JNZ RCV
TEST AL,20H
JZ CHECK
MOV AH,1
INT 16H
JZ CHECK
MOV AH,0
INT 16H
CMP AL,'0'
JZ A0
MOV DX,3F8H
OUT DX,AL
MOV DL,AL
MOV AH,2
INT 21H
JMP CHECK
RCV: MOV DX,3F8H
IN AL,DX
PUSH AX
CMP AL,30H
JZ S1
MOV DL,AL
MOV AH,2
INT 21H
POP AX
CMP AL,03H
JZ N1
CMP AL,0DH
JNZ CHECK
MOV DL,0AH
MOV AH,2
INT 21H
JMP CHECK
S1: LEA DX,SEL0
MOV AH,9
INT 21H
ERROR:MOV DX,3F8H
IN AL,DX
MOV AL,'?'
MOV BX,0
MOV AH,14
INT 10H
JMP CHECK
N1: RET
START ENDP
CODE ENDS
END START

搜索更多相关主题的帖子: 汇编 
2006-07-04 14:45
快速回复:[求助]求教汇编问题
数据加载中...
 
   



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

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