Post Reply 
Recognizing addressing features
03-10-2020, 12:15 AM
Post: #2
RE: Recognizing addressing features
(03-09-2020 10:13 PM)Orome Wrote:  The feature comparison tables refer to
  • Line number addressing
  • Global program label addressing
  • Local program label addressing
  • Indirect / computed addressing and control

What are these different addressing features. Can they be illustrated with simple examples, and how would I know from looking at code which mode was available or being used?

Some calculators differ in implementation but I've used some that follow these conventions.

Line number addressing if x>0 print 5 and stop otherwise just stop:
1: if x>0 gto 3
2: r/s
3: 5
4: r/s

Global program addressing GTO A will print 5 no matter what program is being executed:

LBL A
print 5
R/S

Local program addressing If program 1 is executing, gto A will print 5. If program 2 is executing, gto A will print 7:

Prog1:
LBL A
print 5
R/S

Prog2:
LBL A
print 7
R/S

Indirect addressing use a register to store the line number to branch to:
9 -> i ; store 9 in i
gto(i) ; go to the line number stored in i (in this case go to line 9)

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Recognizing addressing features - Orome - 03-09-2020, 10:13 PM
RE: Recognizing addressing features - toml_12953 - 03-10-2020 12:15 AM



User(s) browsing this thread: 1 Guest(s)