Results 1 to 4 of 4

Thread: Indirect JMP?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Location
    cobwebbed to PC
    Posts
    311

    Indirect JMP?

    Hi Folks

    If I have an address stored in, say DPTR reg, how should I jump to that address?
    (Its a long long while since Ive used asm so bear with me!)

    Keil throws a syntax error for
    Code:
    LJMP DPTR
    and also for
    Code:
    LJMP @DPTR
    so.... stuck, guess Im not using LJUMP correctly??
    ta
    Thanks

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Indirect JMP?

    Does this help?
    Specifically, this bit:
    Quote Originally Posted by Michael Podgouzov
    If you speak about the 51th controller and you need to make a jump to an explicit 16-bit address, you may load this address into DPTR (DPH, DPL), clear your accumulator and use JMP @A+DPTR.
    Michael.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Location
    cobwebbed to PC
    Posts
    311

    Re: Indirect JMP?

    Thanks again athiest! I'll give it a try and see what happens.

    Had done similar searches in google myself, but obviously not quite got the search query wording right for google to know what I was on about!
    Thanks

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2007
    Location
    cobwebbed to PC
    Posts
    311

    Re: Indirect JMP?

    Hi so that worked!
    Code:
    MOV A,#0
    LJMP @A+DPTR
    Yay, Muchos Gracias!

    Two other places I need variability is in an ORG instr and a GLOBAL instr. Im not quite sure what this GLOBAL instr does... declares a global variable?

    my inline asm is looking like this currently:
    Code:
    	#asm
    		GLOBAL _ext1isr
    		PSECT vectors,ovrld
    		ORG 0x34
    		MOV A,#0
    		LJMP @A+DPTR
    		PSECT text
    	#endasm
    I want to be able to vary the ORG address and the address used for GLOBAL
    something like ORG @B and GLOBAL @DPTR...


    EDIT: what I THINK might be happening in the asm code currently is that the two instr.s MOV and LJUMP are placed in code memory at the location 0x34
    Last edited by wolf99; Jan 19th, 2012 at 10:24 AM.
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width