Login
Search for:


Previous | Next

From: TLC (all posts)
Date: 2001-07-25
Subject: Re: interrupt
Hello!,

> But it means, that this code will not work:
>
> SEI
> STA $FF3F
> LDA #$00
> STA $FFFE
> STA $FFFF
> LDA #$08
> STA $FF0A
> LDA #$20
> STA $FF00
> LDA #$00
> STA $FF01
>
> LDY #$00 ;To make sure an interrupt triggered
> b: LDX #$00
> a: DEX
> BNE a
> DEY
> BNE b
>
> CLI
> LDA #<irq
> STA $FFFE
> LDA #>irq
> STA $FFFF
> c: JMP c
>
> irq: ASL$FF09
> RTI
>
> I don't know if this piece of code does work on a real machine, but
> I think it would.
>
> What is your opinion?

Yes, it shouldn't work. (My code protector have been defeated by utilizing somewhat the same trick, by initializing an IRQ before starting the decoding process :-/. Stupid me, the depacker code has enabled interrupts after finishing the decrypting phase).

Probably only if the IRQ finds some working code at $0000 (for example,
it runs to an RTI some time later and can return from this false interrupt). It could then execute the setup of the new IRQ handler 'step by step' (provided that the CPU performs one instruction before executing the IRQ handler). If it survives without a crash until reaching 'c', it could probably keep on running without letting the user notice the bug (since things go down fast).

Well, I think there are almost no chances to see it in reality anyway.

L.

Copyright © Plus/4 World Team, 2001-2024