Witam.
Zabrałem się za pisanie biblioteki do obsługi interfejsu SCI w ww. kontrolerze w języku C.
Transmisja i odbiór są realizowane w przerwaniach. Tu mam problem. W procedurze obsługi przerwania wywołanego pojawieniem się odebranego znaku w buforze muszę skasować flagę przerwania (RDRF). Skasować ją można sekwencją:
- odczyt SCISR
- odczyt SCIDR
Robię tak, ale po podejrzeniu wygenerowanego pliku asemblerowego rozdziela mi te dwie operacje  innymi:
w C robię tak:
temp = SCISR;
temp = SCIDR;
W asm otrzymuję to:
1823                     ; 189 			temp = SCISR;
1825  01b4 96            	ld	x,s
1826  01b5 b640          	ld	a,_SCISR
1827  01b7 d70103        	ld	(OFST-1,x),a
1828                     ; 190 			temp = SCIDR;		//read data
1830  01ba 96            	ld	x,s
1831  01bb b641          	ld	a,_SCIDR
1832  01bd d70103        	ld	(OFST-1,x),a
Wie ktoś może jak to zrobić prawidłowo ?
Myślałem o wstawce w asemblerze, ale nie wiem jak się odwołać do zmiennych zadeklarowanych przed nią w C.
			 
Aktyw Forum
Zarejestruj się na forum.ep.com.pl i zgłoś swój akces do Aktywu Forum. Jeśli jesteś już zarejestrowany wystarczy, że się zalogujesz.
Sprawdź punkty Zarejestruj sięRS232 na ST7Flite39 z użyciem przerwań.
Moderatorzy:Jacek Bogusz, procesorowiec, Łukasz Krysiewicz, Moderatorzy
- 
				krzysztofu
- - 
- Posty:9
- Rejestracja:26 lut 2008, o 14:12
- Lokalizacja:Słupsk
- 
				free.cappy
- - 
- Posty:5
- Rejestracja:14 lip 2011, o 22:57
Re: RS232 na ST7Flite39 z użyciem przerwań.
I jak udało się zrobić tę bibliotekę? Czy jest ona gdzieś dostępna?
Żeby odnieść się do zewnętrznych etykiet musisz skorzystać z polecenia extern. Załączam opis.
Purpose: Declare external labels.
Format: EXTERN
Description: When your program consists of several modules, some modules need to refer to
labels that are defined in other modules. Since the modules are assembled separately,
it is not until the link stage that all the necessary label values are going to be
known.
Whenever a label appears in an EXTERN directive, a note is made for the linker to
resolve the reference.
Declaring a label external is a way of telling the assembler not to expect the label to
be defined in this module, although it will be used. Obviously, external labels must
be defined in other modules at link stage, so that all the gaps left by the assembler
can be filled with the right values.
Because the labels declared external are not actually defined, the assembler has no
way of knowing the length, i.e., (byte, word or long) of the label. Therefore, a suffix
must be used on each label in an EXTERN directive declaring its type; if the type is
undefined, the current default label scope (set by BYTES, WORDS, LONGS directives)
is assumed.
Example:
			Żeby odnieść się do zewnętrznych etykiet musisz skorzystać z polecenia extern. Załączam opis.
Purpose: Declare external labels.
Format: EXTERN
Description: When your program consists of several modules, some modules need to refer to
labels that are defined in other modules. Since the modules are assembled separately,
it is not until the link stage that all the necessary label values are going to be
known.
Whenever a label appears in an EXTERN directive, a note is made for the linker to
resolve the reference.
Declaring a label external is a way of telling the assembler not to expect the label to
be defined in this module, although it will be used. Obviously, external labels must
be defined in other modules at link stage, so that all the gaps left by the assembler
can be filled with the right values.
Because the labels declared external are not actually defined, the assembler has no
way of knowing the length, i.e., (byte, word or long) of the label. Therefore, a suffix
must be used on each label in an EXTERN directive declaring its type; if the type is
undefined, the current default label scope (set by BYTES, WORDS, LONGS directives)
is assumed.
Example:
Kod: Zaznacz cały
EXTERN label.w, label1.b, label2.l- 
				free.cappy
- - 
- Posty:5
- Rejestracja:14 lip 2011, o 22:57
Re: RS232 na ST7Flite39 z użyciem przerwań.
Ojej! Dopiero teraz zauważyłem, żę to było z 2009 roku, a nie 2011.
Pewnie już dawno nieaktualne.
			Pewnie już dawno nieaktualne.
Kto jest online
Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 0 gości