Monday 28 March 2016

ADC : Interfacing with 8086 (with detailed comments)

Q: Write an Alp to interface ADC with 8086

Os: Fedora
Software: Minicom



Code and Output


;port a and c upper act as input i.e data can be recieved from 8255 to 8086
;port b and port c lower act as ouput i,e data can be sent to 8255

A 3000
0000:3000  MOV AL, 99 ;I/O mode,mode 00(basic I/O mode),port A (PA0-7)input,Port C upper(PC4-7)input,10011
      ;mode 0 for Group B,Group B(PB7-0) port B acts as output,Group B port C acts as inp(PC0-3),001
0000:3002  OUT 67, AL ;command word sent to command word register
0000:3004  MOV AL, 05 ;initialization of clock
0000:3006  OUT 63, AL ;output this to port B
0000:3008  MOV AL, 04 ;start of convertion
0000:300A  OUT 63, AL ;mov data from al to port B
0000:300C  IN AL, 65 ;input data from port c upper to check for end of convertion
0000:300E  TEST AL, 01  ;check for end of convertion
0000:3010  JNZ 300C  ;if not done repeat
0000:3012  MOV AL, 06 ;Enable output mode command in AL
0000:3014  OUT 63, AL ;Send this to port B
0000:3016  IN AL, 61 ;Read data from port A into AL
0000:3018  MOV BL, AL ;Copy this value in BL
0000:301A  INT 3

Dyna-86>G 2000  ;FF=5V

Break at FFFF:201B
Dyna-86>R
AX=00FF  BX=00FF  CX=0000  DX=0000  SP=06FD  BP=0000  SI=0000  
DI=0000  CS=FFFF  DS=0000  SS=0000  ES=0000  IP=201B  FL=F046  

Dyna-86>G 2000

Break at FFFF:201B
Dyna-86>R
AX=000D  BX=000D  CX=0000  DX=0000  SP=06FB  BP=0000  SI=0000  
DI=0000  CS=FFFF  DS=0000  SS=0000  ES=0000  IP=201B  FL=F046  

Dyna-86>G 2000

Break at FFFF:201B
Dyna-86>R
AX=000A  BX=000A  CX=0000  DX=0000  SP=06F9  BP=0000  SI=0000  
DI=0000  CS=FFFF  DS=0000  SS=0000  ES=0000  IP=201B  FL=F046

No comments:

Post a Comment