To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 2947
2946  |  2948
Subject: 
Re: Help in Assembler
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Fri, 7 Nov 1997 17:03:53 GMT
Original-From: 
MAR ERICSON <MAR@COOPER.EDUnomorespam>
Viewed: 
1553 times
  
What is "ORG"? Does it matter what number you use?
Is the number a memory location?

Thanks for any help!   :)

-----------
ericson mar
Master of Engineering Candidate
Project: Mobile Robotics
mar@cooper.edu
(212)353-4356

Department of Mechanical Engineering
The Cooper Union for the Advancement of Science and Art
-------------------------------------------------------

On Wed, 5 Nov 1997, Brian S Jappinen wrote:

From mar@cooper.edu Wed Nov  5 18:33:16 1997

Consider a part of a program:

var1   FCB   1
var2   FCB   7
var3   FCB   4
     .
     .
     .
varN   FCB   ?

If I want to use a variable (say X) to determine when to use "var1" to
"varN", how can I do this (other than a whole bunch of CMP's).
(i.e. when X = 3, I want to access var3)

I guess what I'm asking is...Is there a way to indicate the address var3
as "the address of var1 plus an offset"?

I think this might be what you want to do:

varind FCB $00 * 0 <= varind <= FF

ORG $c100 * some location of table
var1    FCB   1
var2    FCB   7
var3    FCB   4
     .
     .
     .
varN    FCB   ?
     .
     .
tabadr  FDB #$c100 * address where table is stored

start ORG $c000
LDX tabadr
     .
     .
     .
        INC num
     .
     .
        LDAA num,x


Note: 0,x would access the first element of the table.

You might think about a hash table.

Scott




Message is in Reply To:
  Re: Help in Assembler
 
(...) I think this might be what you want to do: varind FCB $00 * 0 <= varind <= FF ORG $c100 * some location of table var1 FCB 1 var2 FCB 7 var3 FCB 4 . . . varN FCB ? . . tabadr FDB #$c100 * address where table is stored start ORG $c000 LDX tabadr (...) (27 years ago, 6-Nov-97, to lugnet.robotics.handyboard)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR