0 Members and 1 Guest are viewing this topic.
LDA #>continue PHA LDA #<continue-1 PHA JMP (wherever)continue: blah blah blah....wherever: blah blah blah RTS
lda #>(continue-1) pha lda #<(continue-1) pha ...
lda #$10 pha lda #$ff pha
lda #$ff pha lda #$ff pha
myjsrfar stx vector+1 ;store JSR target address lo sty vector+2 ;ditto for highvector jmp $0000 ;take the jump
ldx #<jsrtarget ;jsr target lo ldy #>jsrtarget ;jsr target hi jsr myjsrfar ;off you go!
You also can use a jump table:
yeah, much better although it's much simpler to use a label for each jmp:
if one likes self-modifying code...... but you know that there are situations were selfmod is not possible (e.g. ROM)for my taste i like the stack manipulation more than selfmodding, but thats a matter of taste...