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

Back to Subject List

Thread Closed: Another thread already exists on this topic

???
01/30/06 16:30
Read: times


 
#108739 - formatted
Responding to: ???'s previous message
Using Charles Bannister's trick (the OPs enter the code formatted, but they don't they have to write <pre$gt; before and </pre$gt; after the code to keep the formatting):
R Santosh Kumar said:
/* THIS IS PROGRAM FOR GENERATING ONE SECOND DELAY 
AND I AM GOING TO USE REGISTERS A,R1,R2 */

	ORG 00H
	MOV A,#00H	// 1 MACHINCE CYLE//
START:	MOV P1,A	// 1 MACHINE CYLE//
	MOV P2,A
	MOV P3,A
	ACALL SECOND	// 1 MACHINE CYCLE//
	CPL A		// 1 MACHINE CYCLE//
	SJMP START	// 1 MACHINE CYCLE//

/*   APPROXIMATELY 1 SECOND DELAY PROCEDURE FOR CRYSTAL 11.0592 MHZ */

/*THE BELOW PROCEDURE UPTO 1SEC TAKES 4 MACHINE CYLCES*/

SECOND:	MOV R1,#255
	MOV R2,#7
	MOV R3,#18
	MOV R4,#255
/*THE BELOW LO0P FOR 1SEC TAKES 130305 MACHINE CYCLES*/	

SEC:	DJNZ R4,SEC	// 2 MACHINE CYLCES INTO 255,510 MACHINE CYCLES//
	MOV R4,255	// 1 MACHINE CYLCE //
	DJNZ R1,SEC	// 2 MACHINE CYCLE INTO 255,510 MACHINE CYCLES//
	DJNZ R2,SEC 	// 2 MACHINE CYCLES FOR 7 TIMES// 

/*YHE BELOW LOOP FOR LE9465 TAKES 9465 MACHINE CYLCES*/
	
LE9465:	DJNZ R4,LE9465	// 2 MACHINE CYCLES INTO 255,510 MACHINE CYCLES // 			
	MOV R4,255	// 1 MAVHINE CYLCLE//
	DJNZ R3,LE9465	// 2 MACHINE CYCLES FOR 18 TIMES// 
	RET

	END

[.....]

Build target 'Target 1'
assembling robot.asm...
linking...
*** WARNING L5: CODE SPACE MEMORY OVERLAP
    FROM:    0000H
    TO:      0002H
*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
    SYMBOL:  ?C_START
    MODULE:  STARTUP.obj (?C_STARTUP)
*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
    SYMBOL:  ?C_START
    MODULE:  STARTUP.obj (?C_STARTUP)
    ADDRESS: 080AH
Program Size: data=9.0 xdata=0 code=51
creating hex file from "robo"...
"robo" - 0 Error(s), 3 Warning(s).



JW.

List of 11 messages in thread
TopicAuthorDate
help on keil            01/01/70 00:00      
   Clean it up, please            01/01/70 00:00      
      startup.a51?            01/01/70 00:00      
   formatted            01/01/70 00:00      
      The linker settings            01/01/70 00:00      
         more precisely            01/01/70 00:00      
            Not quite precise enough!            01/01/70 00:00      
               sorry, prof... :-)            01/01/70 00:00      
            other, free tools            01/01/70 00:00      
   In detail            01/01/70 00:00      
   Start with a simple example            01/01/70 00:00      

Back to Subject List