Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/11/03 06:37
Read: times


 
#54521 - RE: thanx project successful :-)
Responding to: ???'s previous message
Here is an example for a DOL starter...
The user using this interface writes the following...

AND NOT I 0
AND (
AND I 1
OR Q 0
)
= Q 0

and then our application program converts it to the following code...

;Assembly program for DOL
;Translated on Wednesday, June 18, 2003
;Translated at 5:42:42 PM
;ProgramID : DOL-2K3-6-18-17-42-42

ORG 0000
LJMP START

ORG 0100
START: MOV SP,#60h ;Initialize stack pointer with addr : 60h
MOV P1,#00h ;Set P1 as output port
MOV P2,#0FFh ;Set P2 as input port
MOV 26h,#00h ;Clear output buffer (26h)
MOV P1,26h ;Clear output port P1
MOV 27h,P2 ;Copy input port (P2) to input buffer (27h)
MOV 20h,#00h ;Clear Flag bits 0-7
MOV 21h,#00h ;Clear Flag bits 8-15
MOV 22h,#00h ;Clear Flag bits 16-23
MOV 23h,#00h ;Clear Flag bits 24-31
MOV 24h,#00h ;Clear specal status flags
MOV A,#10h ;
MOV R0,#30h ;
LOOP: MOV @R0,#00h ;Clear Counter and Timer buffers
DJNZ A,LOOP ;

SCAN: LCALL P1 ;Subroutine call for path1
LJMP SCAN ;If bit 28h is 1(RUN), goto scan
END

P1:
MOV 27h,P2 ;Copy inputport to input buffer
SETB C ;Set carry flag to 1
ANL C,/38h ;And Not I0 with Carry
MOV 40h,C ;Mov carry status to bit_addr 40
SETB C ;Set the carry flag
ANL C,39h ;And I1 with Carry
ORL C,30h ;OR Q0 with Carry
AND C,40h ;AND current path with previous
MOV 30h,C ;Move Carry status to Q0
MOV P1,26h ;Copy output buffer to output port
RET


rgds
Raj Shetgar

List of 7 messages in thread
TopicAuthorDate
ISP for P89c51rd2bn            01/01/70 00:00      
   RE: ISP for P89c51rd2bn            01/01/70 00:00      
      RE: ISP for P89c51rd2bn            01/01/70 00:00      
   RE: ISP for P89c51rd2bn            01/01/70 00:00      
      thanx project successful :-)            01/01/70 00:00      
         RE: thanx project successful :-)            01/01/70 00:00      
            RE: thanx project successful :-)            01/01/70 00:00      

Back to Subject List