Re: [hatari-devel] DSP long interrupts fix |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Le 25/06/2024 à 10:41, Thorsten Otto a écrit :
On Dienstag, 25. Juni 2024 08:10:32 CEST Miro Kropáček wrote:
> There's quite a lot of them: Jcc, JScc, JCLR/JSET, JSCLR/JSSET
But wouldn't it be strange to use such instructions for an interrupt
handler? An interrupt can occur any time, and using conditional JMPs
seems unreliable.
I agree with you that using cc condition is strange and would be hard to
use :
- if 1st instruction word is used to test/update cc flag
- then 2nd word could be a JScc that could possibly jump if cc is true
- but what if cc is false ? in all cases the short int would be over
as it contains only 2 instructions. but why not ?
maybe such scenario could be possible and should be handled as it
changes the flow of instruction, but it's unlikely to be used in real world.
At least handling it doesn't look like a possible cause of bug in the
future.
by the way laurent, I see your patch does this :
- if ( ((instr & 0xfff000) == 0x0d0000) || ((instr & 0xffc0ff) ==
0x0bc080) ) {
+ // JSR or JMP ?
+ if ( ((instr & 0xfff000) == 0x0d0000) || ((instr & 0xffc0ff) ==
0x0bc080) || /* JSR pattern */
+ ((instr & 0xfff000) == 0x0c0000) || ((instr & 0xffc0ff) ==
0x0ac080) ) { /* JMP pattern */
which means code contains bits operation to check if opcode is jsr, jmp, ...
in the cpu core I added some code to have a variable "OpcodeFamily" that
is i_JMP, i_MOVE, i_CLR, ... ; this makes the code easier to
read/maintain in places where instruction type needs to be checked.
Is there a way to do the same in DSP core ? Have a variable that holds
the instruction name ?
Patch could become :
if ( ( Opcode == i_JMP ) || ( Opcode == i_JSR ) )
{
[...]
}
Nicolas