ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Воскресенье
19 мая
134359 Топик полностью
testerplus (09.10.2008 05:12, просмотров: 167) ответил testerplus на PIC24 и ulnk
SUPPORT отписался, но не о том. Доброго времени суток! 1 октября я отправил в Microchip тикет с таким содержанием: -------------------------------------------------------------------- Hello! There is some problem with skipping ulnk instruction. See code below: <code> clr w0 btsc w0, #0 ulnk </code> It's supposed that instruction ulnk will be skipped. When W14 not eq. to zero, unstruction ulnk is skipped and W14 remain unchanged. But when W14 eq. to zero reset will occure (RCON.IOPUWR will be set to 1). MPLAB SIM skips ulnk in both cases, but in hardware this code occurs reset with setting bit IOPUWR (problem was trapped with ICD2). --------------------------------------------------------------------- В ответ мне написали следующее: --------------------------------------------------------------------- The code is not using W14 it's using W0. You're not checking if W14 is zero or non-zero, the code is only checking weather bit 0 of W0 is clear. --------------------------------------------------------------------- В общем, они не совсем правильно поняли мой вопрос, т.к. я его, возможно, не совсем правильно задал. Сейчас я его переписал, но у меня английский не на уровне и прежде чем отсылать вопрос повторно, хочу спросить: в таком виде он корректнее? --------------------------------------------------------------------- Thank you for answer to my question Ticket # 1-124587. May be I asked my question not quite clearly... Let me try again. Here are two examples: ------------------------- Example 1: ------------------------- 0x0000 goto 0x200 ... 0x0200 mov #1, w14 0x0202 clr w0 0x0204 btsc w0, #0 0x0206 ulnk ------------------------- Example 2: ------------------------- 0x0000 goto 0x200 ... 0x0200 mov #0, w14 0x0202 clr w0 0x0204 btsc w0, #0 0x0206 ulnk The difference between these two example is value of W14: in first example W14=1, in second W14=0. !!! In both cases instruction "ulnk" must be skipped because of W0.0=0. !!! 1. If before checking W0.0 register W14=1, then "ulnk" is skiped and W14 remains unchanged. 2. If before checking W0.0 register W14=0, then instead of skipping "ulnk" we have RESET with RCON.IOPUWR = 1. My question is: why RESET occures when "ulnk" must be skipped. It does not matter that there is no "lnk" because due to W0.0=0 "ulnk" should not be executed. --------------------------------------------------------------------- (про "lnk" я добавил, потому что в их ответе перед последней резолюцией был большой абзац про то, как работают lnk и ulnk, и что они непременно должны быть в паре, чтобы стек не сбивался. Я же пытаюсь объяснить, что обе эти инструкции ядром вообще не выполняются, и что коллизий со стеком быть не должно.) Спасибо.