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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/16/01 18:41
Read: times


 
#10847 - 80C537 programming problem
I can't figure out how to use the DPTR.
here's the program:

START XDATA 0
LAST XDATA 65535
GOOD EQU 090h
BAD EQU 091h
DPSEL EQU 092h
ORG 0000

RAM_TEST:
MOV A,#55h ;PUT 55h IN ACCUMULATOR
MOV DPSEL,#START ; move DTPR to 0x0000
MOVX @DPTR,A ; move A to address 0x0000
CJNE DPTR,#LAST,NEXT ;keep going until FFFFh

CHECK:
MOV DPSEL,#START ;move DPSEL to 0x0000

NEXT1:
MOVC A,@DPSEL ;read data at 0x0000
CJNE A,#55h,FAIL ;should be 55h if not fail
INC DPTR
CJNE DPTR,#LAST,NEXT1 ;keep going until FFFFh
LCALL PASS ;loop pass result

NEXT:
INC DPSEL
MOVX @DTPR,A
CJNE DPTR,#LAST,NEXT
RET

PASS:
SETB GOOD
LCALL PASS

FAIL:
SETB BAD
LCALL FAIL
END

and here are the errors:

VERSION 1.2h ASSEMBLY COMPLETE, 5 ERRORS FOUND

ERROR SUMMARY:
Line #16, ERROR #20: Illegal operand
DPTR
Line #21, ERROR #21: Illegal indirect register
@DPSEL
Line #24, ERROR #20: Illegal operand
DPTR
Line #29, ERROR #21: Illegal indirect register
@DPTR
Line #30, ERROR #20: Illegal operand
DPTR

Can somebody help me with this?


List of 4 messages in thread
TopicAuthorDate
80C537 programming problem            01/01/70 00:00      
RE: 80C537 programming problem            01/01/70 00:00      
RE: 80C537 programming problem            01/01/70 00:00      
RE: 80C537 programming problem            01/01/70 00:00      

Back to Subject List