Size: a a a

️Одноплатники чат

2021 October 18

И

Иван in ️Одноплатники чат
А что говорится в описание на компилер, в разделе interrupt?
источник

D

Dim in ️Одноплатники чат
да муть какая то
источник

D

Dim in ️Одноплатники чат
вроде сказано что сохраняет сам
источник

D

Dim in ️Одноплатники чат
но потом есть оговорки про юзерские регистры
источник

D

Dim in ️Одноплатники чат
3.9.2 Context Saving on Interrupts
The PIC18 processor only saves the program counter on its stack whenever an interrupt occurs. Other
registers and objects must be saved in software. PICC18 automatically determines which registers
and objects are used by an interrupt function and saves these appropriately.
If the interrupt routine calls other functions and these functions are defined before the interrupt
code in the same module, then any registers used by these functions will be saved as well. If the
called functions have not been seen by the compiler, a worst case scenario is assumed and all registers
and objects will be saved.
PICC18 does not scan assembly code which is placed in-line within the interrupt function for
register usage. Thus, if you include in-line assembly code into an interrupt function, you may have
to add extra assembly code to save and restore any registers or locations used if they are not already
saved by the interrupt entry routine.
105
Interrupt Handling in C C Language Features
By default, the high-priority interrupt function will utilize a fast interrupt save/restore tech-
nique where the W, STATUS and BSR registers are saved and restored via the devices’ internal
shadow registers. This minimizes code size and reduces the instruction cycles to access the high-
priority service routine. Note that for some older devices, the compiler will not apply fast inter-
rupt save/restore if compiling for the MPLAB ICD2 debugger, as the debugger itself utilizes these
shadow registers.
The high-priority or compatibility-mode interrupt function places a small routine in a psect
called intcode which is linked directly to the interrupt vector. This code saves the STATUS (if fast
interrupts are not used) and PCLATH registers then jumps to code placed in a text psect. This code
will save further context if it is necessary and then jump to code directly related to the interrupt
function. The interrupt function code is also placed in a text psect.
All objects saved are done so to locations at an offset to a symbol called saved_regsh, except
for the BSR register. If fast interrupts are not used, BSR is saved to a location symbol called
saved_bsrh.
The low-priority interrupt function places the code to save the STATUS and PCLATH registers
in a psect called intcodelo, which is directly linked to the low-priority interrupt vector. Operation
is then similar to the high-priority interrupt case, only with objects being saved offset to the symbol
saved_regsl and the BSR register saved to a location symbol called saved_bsrl.
3.9.3 Context Retrieval
Any objects saved by the compiler are automatically restored before the interrupt function returns.
The restoration code is placed into a text psect. The retfie instruction placed at the end of the
interrupt code will reload the program counter and the program will return to the location at which
it was when the interrupt occurred.
источник

И

Иван in ️Одноплатники чат
Английским по белому... Другие регистры и обыекты должны быть сохранены программно. Ты хоть через переводчик прогоняй, раз лень язык хоть в минимуме выучит
источник

D

Dim in ️Одноплатники чат
так я прогонял
источник

D

Dim in ️Одноплатники чат
что значит другие регистры и объекты?
источник

D

Dim in ️Одноплатники чат
не доходит до меня
источник

D

Dim in ️Одноплатники чат
вот это он сохраняет?

MOVWF   W_TEMP     Со;х ранение W_
MOVFF   STATUS, STATUS_TEMP   ; Сохранение STATUS_TEMP
MOVFF   BSR, BSR_TEMP    ; Сохранение BSR;
; Код пользователя
;
MOVFF   BSR_TEMP, BSR    ; Восстановление BSR
MOVF   W_TEMP, W     ; Восстановление WREG
MOVFF   STATUS_TEMP,STATUS   ; Восстановление STATUS
источник

D

Dim in ️Одноплатники чат
если "да" - то вопрос закрыт
источник

И

Иван in ️Одноплатники чат
Не задавай глупых вопросов
источник

D

Dim in ️Одноплатники чат
мне простительно
источник

D

Dim in ️Одноплатники чат
я только въезжаю в си
источник

И

Иван in ️Одноплатники чат
Не простительно. 2 месяца мозги пудришь. Основы си можно выучить что б от зубов отскакивало
источник
2021 October 19

VC

Verum Corner in ️Одноплатники чат
источник

VC

Verum Corner in ️Одноплатники чат
Сделал
источник

И

Иван in ️Одноплатники чат
Шикарный котяра
источник
2021 October 20

VC

Verum Corner in ️Одноплатники чат
источник
2021 October 21

D

Dim in ️Одноплатники чат
как можно упростить?
for(char i=data_len;i>0;i--) data[i-1+20]=data[i-1];
источник