Newsgroups: comp.robotics
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!news.sei.cmu.edu!cis.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!gatech!newsfeed.pitt.edu!dsinc!netnews.upenn.edu!news.amherst.edu!news.mtholyoke.edu!nntp.et.byu.edu!news.provo.novell.com!ga!kevin
From: kevin@novell.com (Kevin White)
Subject: Re: 6808 machine lang problem
Message-ID: <1994Nov2.225845.8456@novell.com>
Keywords: 6808 HERO Robot INDEX Addressing
Sender: news@novell.com (News Administrator)
Nntp-Posting-Host: na
Organization: Novell Inc., San Jose, Califonia
References: <39836g$m8k@nkosi.well.com>
Date: Wed, 2 Nov 1994 22:58:45 GMT
Lines: 60

In article <39836g$m8k@nkosi.well.com> jorge@well.sf.ca.us (Jorge Codina) writes:
>Hi,
> 
>I need help from anyone that knows 6808 machine language. The program
>I'm writing in on a Hero I but the problem is with INDEX addressing.
>Essentially I can't get it to work. I load the index register with the 
>address I intend to use, then try refering to it with zero offset and
>nothing happens. Below is the code. If anyone can tell me what I'm
>doing wrong or give me an idea where to look it would be greatly
>appreciated. 
> 
>Does it have any thing to do with the fact that I'm trying to do this
>as part of interupt processing?
> 
>I want to write a loader for the input port of the expansion board.
> 
>Thanks,
>--jorge
>================ Begin Code ================
>;   this is the machine code for the HERO I one byte loader
>;
>0100    86 7E       ;LDA (immed) copy '7E' (JMP) to Accumulator A
>        B7 00 2D    ;STAA (extnd) copy Accumulator A to 002d, 
>                    ;Expansion board interupt vector
>        86 00       ;Interupt routine stored at 0040
>        B7 00 2E
>        86 40
>        B7 00 2F
>        CE 04 00    ;LDX (immed) Store target address (0400) in the 
>                    ;Index Register
>        0E          ;CLI enable interupts
>        3E          ;WAI wait for interupt
>        7E 01 00    ;JMP to 0100 (loop)
>;
>; Interupt routine
>;
>0040    B6 C2 A0    ;LDA (extnd) copy the contents of c2a0 
>                    ;(expansion board input buffer) to Accumulator A
>        A7 00       ;STAA (index) copy the address pointed to by the 
>                    ;Index Register (0400), This does not work.
>                    ;b7 04 00 (extended addressing) works, and
>                    ;97 FF (Direct (page 0) addressing) also works.
>        BD F7 AD    ;show the contents of Accumulator A on the display 
>                    ;(Robot Language Routine, in ROM)
>        39          ;RTS return from subroutine 
>                    ;Recommended over RTI by HERO manual
>;
>================ End Code ================
>

Jorge,

This relies on the X-register not being modified in the ROM monitor during
the ISR.  I suspect that it is.  You probably need to store the value for
indexing in another location and then load it during your ISR.  Presumably
you are going to increment it for the next time, remember to save it at the
end of your ISR.

kevin white

