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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/15/10 08:43
Read: times


 
#175043 - Errors with indirect registers
Hello


My name is Chris and i have a problem with a project of mine. I'm makin a home alarm, but i have some problems with my code. Here is the thing


Edit/Delete Message
...
PSIFIO2:
DELAY10: MOV R6,#0C3h ; delay for the keys to be pressed
DELAY11: MOV R7,#0FFh
DELAY21: NOP
NOP
DJNZ R7,DELAY21
DJNZ R6,DELAY11


mov R7,#90h
mov A,#0h
call SCAN2 ; scan2 is the routine that scans the keypad
MOV A,R5
CJNE A,#0FFh,ELEGXOSPSIFIOU2 ; check if any key has been pressed and jump to ELEGXOSPSIFIOU2
JMP PSIFIO2 ; ;if no key has been pressed jump to psifio2 and scan again.



ELEGXOSPSIFIOU2:
INC R7
MOV 96h,R5
MOV @R7,96h ;
MOV A,34h
CJNE A,#04h,GRAPSE2 ; Check if it's the 4th key that has been pressed. Go to Grapse 2
TELOS2: JMP ENTER2 ; OR ENTER2

 


I want to scan the keypad and the value of the pressed keys to be saved at successive memory locations (in my program 91H -94H)so i can compare them later in an other part of my program.

The scan2 routine returns the value of the pressed key to R5 and if no key is pressed returns FF. My problem is that when i press the key to build the code, i get 2 errors at the line MOV @R7,96h :

An A4 Bad indirect register and
an A9: Syntax error

What seems to be the problem;

List of 4 messages in thread
TopicAuthorDate
Errors with indirect registers            01/01/70 00:00      
   MOV @R7,96h            01/01/70 00:00      
   using R0 in an other routine            01/01/70 00:00      
      Preserving registers            01/01/70 00:00      

Back to Subject List