The Proteus 51 Serial Port communicates with the virtual terminal.

Source: Internet
Author: User

1. Circuit Diagram

Baud Rate of virtual terminal shoshould be 4800

 

2. When the user inputs 0, the hi, Dave,

When the user inputs 1, hi, Mike is displayed.

Input error is displayed when other parameters are entered.

 

3. Source Code

; Latest revise: 2009-12-10

; By: Alex Shoal

; Email: alex.shoal@gmail.com

Orgw.h

Start: movsp, #60 h

Movscon, # 0101_ B

; Movp1, 00 h

Movtmod, #20 h

Orlpcon, # 0000000b

Movth1, # 0f3h

Movtl1, # 0f3h

Setbtr1

Loop: jnbri, $

Clrri

Mova, sbuf

Cjnea, #30 h, B1

Callmsg1

 

B1: cjnea, #31 H, B2

Callmsg2

 

B2: callmsg3

 

Msg1: movdptr, # M1

Callprint

Sjmploop

Msg2: movdptr, # m2

Callprint

Sjmploop

 

Msg3: movdptr, # m3

Callprint

Sjmploop

 

Print: movr0, #00 h

Dp1: mova, R0

Movca, @ A + dptr

Cjnea, #00 h, output

RET

Output: movsbuf,

Jnbti, $

Clrrti

Incr0

Sjmpdp1

 

 

M1: DB 'Hi, Dave ', 0dh, 00 h

M2: DB 'Hi, Mike ', 0dh, 00 h

M3: DB 'input error', 0dh, 00 h

End

 

3. Result

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.