Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

project [R0] clarification

8 views
Skip to first unread message

Andrew Morton

unread,
Mar 8, 2012, 4:28:11 PM3/8/12
to
I've been asked a few times about using R0 for register indirect
addressing. Here's an attempt to clarify.

For most instructions rd can go in either reg1 or reg0 and same for rs.
The dst bit indicates which is rd. That allows:
- for r0 direct put r0 in reg1
- if it is rd then dst = 1
e.g. add r0,r1 (reg1=00, reg0=01 dst=1) r0 <- r0 + r1
- if it is rs, then dst = 0
e.g. add r1,r0 (reg1=00, reg0=01, dst=0) r1 <- r1 + r0
- for r0 indirect put r0 in reg0
- if it is rd then dst = 1
e.g. add [r0],r1 (reg1=01, reg0=00, dst=0) [r0] <- [r0] + r1
- if it is rs, then dst = 0
e.g. add r1,[r0] (reg1=01, reg0=00, dst=1) r1 <- r1 + [r0]

Andrew
0 new messages