Guest yo9hnh Posted December 17, 2008 Share Posted December 17, 2008 Salutare,am gasit situl acesta care este un generator de cod pentru intarzieri http://techref.massmind.org/cgi-bin/delay.exe Si am facut o intarziere de o secunda si acesta este codul : ; Delay = 1 seconds ; Clock frequency = 4 MHz ; Actual delay = 1 seconds = 1000000 cycles ; Error = 0 % cblock d1 d2 d3 endc Delay ;999990 cycles movlw 0x07 movwf d1 movlw 0x2F movwf d2 movlw 0x03 movwf d3 Delay_0 decfsz d1, f goto $+2 decfsz d2, f goto $+2 decfsz d3, f goto Delay_0 ;6 cycles goto $+1 goto $+1 goto $+1 ;4 cycles (including call) return Acum vine intrebarea , nu inteleg ce fac instructiunile goto $+2 si goto $+1 Mai exact $+2 si $+1 , goto stiu ca directioneaza programul la o anume adresa dar ce reprezinta $+2 si $+1 ? Link to comment
Guest Posted December 17, 2008 Share Posted December 17, 2008 Cu $ se noteaza de obicei adresa la care se afla instructiunea respectiva.Goto $+1 inseamna salt neconditionat la adresa urmatoare, Goto $+2 inseamna salt peste 2 adrese. Link to comment
MirceaM Posted February 10, 2009 Share Posted February 10, 2009 da, asa este. iar in cazul "atragator" in care avem un goto chiar catre instructiunea urmatoare, acesta este pus acolo cu scopul ca sa asigure o anumita intarziere, sa se potriveasca la intarzierea pretinsa de catre secventa / bucla respectiva. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now