I’m reading the examples of RISC assembler and list handling.
On the web page (http://www.ulisp.com/show?30ZU), I think there’s a typo because the CAR/CDR example uses ARM mnemonic, not the RISC ones.
So I suppose that part should read,
This loads the CAR of the list in A1
CAR : ($ld 'a1 0 'a0)
This loads the CDR of the list in A1
CDR: ($ld 'a1 8 'a0)
Looking at the “product” example, is it possible to have some clarifications?
In the first part of the code,
($ld 'a1 0 '(a0))
this copies the CAR of the list in a1, correct?
($ld 'a1 8 '(a1))
if my first assumption is correct, this I cannot understand. it’s CDR of CAR (?!?!)
($mul 'a2 'a1 'a2)
this performs the multiplication a1 by a2 (a2 initially is 1).
($ld 'a0 8 '(a0))
this load the CDR of the list in a0
Please, can you clarify this for me?
Thanks a lot,