8086 programming using TASM: pc to pc communication
.model small
.stack 100
.data
.code
mov ah,00h
mov al,0e3h
mov dx,00h
int 14h
back: nop
l1: mov ah,03h
mov dx,00h
int 14h
and ah,01h
cmp ah,01h
jne l1
mov ah,02h
mov dx,00h
int 21h
mov dl,al
mov ah,02h
int 21h
jmb back
mov ah,4ch
int 21h
end
This a pc to pc commnicat开发者_如何转开发ion receiver program. I would like to know
why it uses the mov dx,00h
command and what mov al,0e3h
means?
Take a look here. AX will contain the transmission parameters (baud rate etc) and DX chooses the port number. E3 = 9600 rate, no parity, two stop bits, 8 bits char size.
According to the docs I could find on int 14h,
dx determines the port numbber. So if you're using port one, you put 00h into dx. al is used for parameters of the serial communication. Check the docs for more details on the parameters.
dx
is used to select the com ports. 00=com1, 01=com2
.
al
is used to select character size(0 and 1 bit)
, stop bit(2nd bit)
, parity bits (3rd and 4th bit)
and baud rate(5,6,7 bit no.)
al=11100011=e3=8bits
: no parity, one stop bit, 9600 baud rate
精彩评论