Logical FSR to FSR convertion
I am looking for a way to convert logical FSR values to physical FSR values and back.
At the moment I have a jumptable that converts :
$00 .. $1F - returns same value
$20 .. $2F -·returns $30 .. $3F
$30 .. $3F - returns $50 .. $5F
..etc.
With a·CALL, a JMP·and a·RET,·the operations spends·9 cycles, so what I am looking for is a <9 cycles code snippit that does the convertion.
At the moment I have a jumptable that converts :
$00 .. $1F - returns same value
$20 .. $2F -·returns $30 .. $3F
$30 .. $3F - returns $50 .. $5F
..etc.
With a·CALL, a JMP·and a·RET,·the operations spends·9 cycles, so what I am looking for is a <9 cycles code snippit that does the convertion.
Comments
into a physical address in fsr so you can use mov fr,indf
or mov indf,fr to read/write a non-global rambyte
mov fsr,w· ;w = logical address 0-127 for ram banks 0 to 7
and w,#$70
add fsr,w
add fsr,#$10 ;bank 0 at $10, fsr points to ram byte
You could at a $10 offset to include the global ram.
regards peter
·