Assembly 通过串行通信UART-8250 x8086[程序集]发送字符串

Assembly 通过串行通信UART-8250 x8086[程序集]发送字符串,assembly,serial-port,masm,x86-16,serial-communication,Assembly,Serial Port,Masm,X86 16,Serial Communication,=我正在使用DOSBOX,[TASM或MASM对我的代码没有影响] 好的,我正在做一个串行通信代码游戏,它实际上有一部分要求输入你的“用户名”,然后等待其他玩家输入他的名字,这样它就把你带到主菜单 这里的问题是,我无法将“PlayerName”发送到另一台电脑,并将其作为“PartnerName”接收 这是我代码的一部分: Welcome proc ;Welcome Screen ! mov al,03h mov ah,00 int 10h mov ah,02h mov dh,10d m

=我正在使用DOSBOX,[TASM或MASM对我的代码没有影响]

好的,我正在做一个串行通信代码游戏,它实际上有一部分要求输入你的“用户名”,然后等待其他玩家输入他的名字,这样它就把你带到主菜单

这里的问题是,我无法将“PlayerName”发送到另一台电脑,并将其作为“PartnerName”接收

这是我代码的一部分:

Welcome proc   ;Welcome Screen !

mov al,03h
mov ah,00
int 10h

mov ah,02h
mov dh,10d
mov dl,20d
mov bh,00d
int 10h

mov ah,09h
lea dx,WelcomeMsg
int 21h

mov dh,11   ;Row number
mov dl,28   ;Column number
mov bh,0
mov ah,2
int 10h

;Reading PlayerName
mov ah,0ah
lea dx,PlayerName
int 21h

;Adding $ at the end, so we can print it later
mov bx,00
mov bl,PlayerName[1]
mov PlayerName[bx+2],'$'



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CHECKING FOR NAME;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; SendingName:  ;Sending Player Name
; mov dx,3fdh
; in al,dx
; test al,01000000b
; jnz SendNameDone
; jmp SendingName
; SendNameDone:
; lea ax,[PlayerName]
; mov dx,3f8h   
; out dx,ax


; ReceivingName:  ;Receiving PLayer Name
; mov dx,3fdh
; in al,dx
; test al,00000001b
; jnz ReceiveNameDone
; jmp ReceivingName   ;This will occur if nothing is received.
; ReceiveNameDone:
; mov dx,3f8h
; in ax,dx
; mov si,ax
; mov di,OFFSET PartnerName
; mov cx,15
; movsb

; mov dh,1   ;Row number
; mov dl,1   ;Column number
; mov bh,0
; mov ah,2
; int 10h

; mov ah,09h
; lea dx,PartnerName
; int 21h

; mov ah,01h
; int 21h



;Confirm Message
mov dh,13   ;Row number
mov dl,18   ;Column number
mov bh,0
mov ah,2
int 10h

mov ah,09h
lea dx,WelcomeMsg2
int 21h

mov ah,01h
int 21h

ret
Welcome endp
如果您感到困惑,我的数据段中有一部分:

WelcomeMsg db 'Welcome, Please Enter Your Name: $'
WelcomeMsg2 db 'Please Press Any Key To Continue!$'
这里的问题是,我的“评论部分”——我知道这是错误的——似乎进入了一个无限循环


如果您能帮助并告诉我如何通过串行通信发送“PlayerName”并将其作为“PartnerName”接收。。我会非常感激的

首先清除除数锁存访问位,以使用发射机保持寄存器

mov dx,03FBh        ;Line Control Register
in al,dx
and al,0111_1111b   ;Set DLAB=0
out dx,al
每次传输一个字节,检查变送器保持寄存器是否为空

mov si,PlayerName+2 ;Send name including terminating $ character
SendingName:        ;Sending Player Name
mov dx,03FDh        ;Line Status Register
in al,dx
test al,0010_0000b  ;Use bit 5 to see if THR is empty
jz SendingName
lodsb
mov dx,03F8h        ;Transmitter Holding Register   
out dx,al
cmp al,"$"
jne SendingName