??? 06/23/06 08:37 Read: times |
#118926 - Help Responding to: ???'s previous message |
Arvind Shrivastava said:
In the previous thread I have written the comments and followed the HTMl tags also No, you have not used the HTML tags as described for posting code. Look at the code here: http://www.8052.com/forum/read.phtml?id=118674 Do you honestly think this is clearly laid-out and easy to read? Your aim should be something like this: ORG 001BH INTERRUPT_1: PUSH ACC PUSH PSW CLR TR1 MOV PSW, #00H ACALL KEYPRESSED JNZ CALCULATE JB FLAG_SECOND, HALT1 ; if no key is pressed and earlier ; the key were presed taking into JB FLAG_FIRST, COOL ; account the 1st & 2nd press, then ; jump to HALT1 and only once key JMP AGAIN ; is pressed then jump to COOL or ; jump to AGAIN CALCULATE: ACALL KEYPRESSED ; again check whether any key is ; pressed or not JZ HALT ; if no key is pressed then jump ; to halt for checking the key ; is pressed ;before or not by ; cheking the flag ... FLAG_FIRST ACALL CONVERT ; check the validity of the key ; pressed JBC FLAG_INVALIDKEY, HALT ; if the key pressed is invalid ; then jump to HALT INC R0 ; increment R0 fro checking ; whether the key is pressed first ; time or not CJNE R0, #01, COMPARE ; if the key is not pressed for ; the first time then jump to ; COMPARE MOV NEWKEY, A ; here it shows the key is pressed ; for the first time and so the ; fresh key ;is taken to a new flag ; named NEWKEY for further checking ; on second time key hit SETB FLAG_FIRST ; set this flag which shows the key ; is pressed 1st time, this flag is ; used while the checking the in ; the subroutine HALT JMP OUTPUT ; jump to output the 1st time ; keypressed Your comments need to give more detail on what you are trying to achieve, it's a bit focussed on the operation of individual instructions at the moment. It would also help if you provided separate comments that describe the meaning & usage of each of your variables. Arvind Shrivastava said:
So dont be ajust a blamer try to help others .. Here is what you need to do: http://www.8052.com/forum/read.phtml?id=118587 Have you followed that process: What hypotheses have you tested? What have been your conclusions? |