3 ms·
Cadr here has no relation with lisp cadr, right?
by f1shy 6mo ago
Cadr here has no relation with lisp cadr, right?
- jacquesm 6mo agohttps://news.ycombinator.com/item?id=16008239 https://news.ycombinator.com/item?id=16008239
- jasomill 6mo agoCorrect. CADR is an AGC assembly directive defining a "complete address" including a memory bank, in this case a subroutine to be called by the preceding BANKCALL (TC = transfer control, i.e., store return address and jump to subroutine), which switches to the memory bank specified in the CADR before jumping to the address specified in the CADR. For a brief explanation of AGC subroutine calls, see [1]. CAR and CDR in Lisp come from the original implementation on the IBM 704, where pointers to the two components of a cons cell were stored as the (C)ontents of the (A)ddress and (D)ecrement fields of a (R)egister (memory word). (CADR x) is just shorthand for (CAR (CDR x)), i.e., a function that returns the second element of a list (assuming x is a well-formed list). [1] https://epizodsspace.airbase.ru/bibl/inostr-yazyki/American_Scientist/2019/3/Hayes_Moonshot_Computing_American_Scientist_107_no_03_(2019).pdf#page=4 https://epizodsspace.airbase.ru/bibl/inostr-yazyki/American_...