Loading ...
Sorry, an error occurred while loading the content.
 

Re: A delay with 1 instruction resolution: Page boundrys

Expand Messages
  • fun_4_me_now20012000
    Does anyone know how to get jal to align code so that it remains on one page? pragma jump_table is supposed to do it, but it isn t. Have I used it right? ...
    Message 1 of 2 , Jan 1, 2004
      Does anyone know how to get jal to align code so that it remains on
      one page?

      pragma jump_table is supposed to do it, but it isn't.

      Have I used it right?



      --- In jallist@yahoogroups.com, "fun_4_me_now20012000"
      <fun_4_me_now20012000@y...> wrote:
      > I am looking to create a delay that has a 1 instruction resolution
      > (plus overhead).
      >
      > The delay_1us is too jumpy for my app. When delay_1us(1..7) I get,
      > say, a 4us delay. Then for When delay_1us(8..11) I get, say, 8us.
      > then for When delay_1us(12..17) I get, say, 12us.
      >
      > Below is what I have so far.
      >
      > Is there a way to align this piece of code so that it starts at the
      > beginning of the page?
      >
      > Is there an ORG type instruction?
      >
      > Isn't that what pragma jump_table is for?
      >
      > In searching the jallist, I have also found references/code for
      > hpage. How does it work and where is it documented?
      >
      > As I understand it, hpage will set the high page adress bits, but
      > what good is it if the table is near the end of the page and
      > therefore will overrun the boundry?
      >
      > Again, this is what I have so far. It works, by luck, when the list
      > of nops is short. I need it to be 127 or 255 nops long. When it
      gets
      > long, the program gets lost becuase the table goes past the page
      > boundry(I think).
      >
      >
      >
      > -- -------------------
      > -- delay routine
      >
      > procedure delay_1cy_asm ( byte in _delay) is
      > pragma jump_table
      > var byte jump_value
      > jump_value = _delay
      > const list_length = 10
      >
      > -- limit _delay to table size
      > if jump_value > list_length then
      > jump_value = list_length
      > end if
      >
      > -- the table
      > jump_value = (list_length - _delay)
      > assembler
      > movfw jump_value
      > addwf PCL,f ; jump to table address
      >
      > nop
      > nop
      > nop
      > nop
      > nop
      > nop
      > nop
      > nop
      > nop
      > nop
      > nop
      >
      > end assembler
      >
      > end procedure
    Your message has been successfully submitted and would be delivered to recipients shortly.