Monday 28 March 2016

Interfacing of 8251 with 8086 (with Detailed Comments)

Q: Write an ALP to interface 8251 with 8086. Transfer some data from 8086 memory at some location to another location in the memory through 8251.

OS: Fedora-64 bit(Linux)
Software: Minicom

 

 

Code

Dyna-86>U 1000
0000:1000  MOV AL, 4D ;Mode word
0000:1002  OUT 29, AL ;for port B
0000:1004  OUT 31, AL ;for port A
0000:1006  MOV AL, 27 ;CW
0000:1008  OUT 29, AL ;port B
0000:100A  OUT 31, AL ;port A
0000:100C  MOV CL, 09 ;counter for nine nos
0000:100E  MOV SI, 2000 ;location for source data
0000:1011  MOV DI, 5000 ;location for destination data
0000:1014  MOV AL, [SI] ; contents of si moved to al
0000:1016  OUT 30, AL ;data sent to port A transmitter
0000:1018  IN AL, 29 ;status word of reciever
0000:101A  TEST AL, 02 ;rx rdy
0000:101C  JZ 1018 ;loop if reciever not ready
0000:101E  IN AL, 28 ;accept the data from reciever
0000:1020  MOV [DI], AL ;mov this data to the destination
0000:1022  INC SI ;increment and decrement counters
0000:1023  INC DI
0000:1024  DEC CL
0000:1026  JNZ 1014 ;Repeat these steps for the next number
0000:1028  INT 3 ;Exit
Dyna-86>

Output


OUTPUT

Dyna-86>D 2000
0000:2000  01 02 03 04 05 66 77 88 99 32 E6 31 E6 29 B0 27 
0000:2010  E6 31 E6 29 8A 04 E6 30 E4 29 24 02 74 FA E4 28 
0000:2020  88 05 46 47 FE C9 75 EC 00 00 00 00 00 00 00 00 
0000:2030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:2040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:2050  10 20 30 40 50 00 00 00 00 00 00 00 00 00 00 00 
0000:2060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:2070  BF 7B FC FF 00 00 00 00 00 00 00 00 00 00 00 00 
0000:2080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:2090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

Dyna-86>D 5000
0000:5000  B0 CD E6 21 E6 31 B0 23 E6 21 B0 26 E6 31 BE 00 
0000:5010  10 BF 00 20 8A 0C 46 8A 04 E6 20 E4 31 A8 02 74 
0000:5020  FA E4 30 88 05 46 47 FE C9 75 EC CC 00 00 00 00 
0000:5030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:5040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:5050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:5060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:5070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:5080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:5090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 

Dyna-86>G 1000 

Break at FFFF:1029
Dyna-86>D 5000
0000:5000  01 02 03 04 05 66 77 88 99 21 B0 26 E6 31 BE 00 
0000:5010  10 BF 00 20 8A 0C 46 8A 04 E6 20 E4 31 A8 02 74 
0000:5020  FA E4 30 88 05 46 47 FE C9 75 EC CC 00 00 00 00 
0000:5030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:5040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:5050  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:5060  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:5070  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:5080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
0000:5090  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


No comments:

Post a Comment