Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Random-access machine
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Register-to-register ("read-modify-write") model of Cook and Reckhow (1973) === The commonly encountered Cook and Rechkow model is a bit like the ternary-register Malzek model (written with Knuth mnemonics{{spaced ndash}}the original instructions had no mnemonics excepting TRA, Read, Print). :*<code> LOAD ( C, r<sub>d</sub> ) ; C β r<sub>d</sub></code>, C is any integer :: Example: <code>LOAD ( 0, 5 )</code> will clear register 5. :*<code> ADD ( r<sub>s1</sub>, r<sub>s2</sub>, r<sub>d</sub> ) ; [r<sub>s1</sub>] + [r<sub>s2</sub>] β r<sub>d</sub></code>, the registers can be the same or different; ::Example: <code>ADD ( A, A, A )</code> will double the contents of register A. :*<code> SUB ( r<sub>s1</sub>, r<sub>s2</sub>, r<sub>d</sub> ) ; [r<sub>s1</sub>] - [r<sub>s2</sub>] β r<sub>d</sub></code>, the registers can be the same or different: ::Example: <code>SUB ( 3, 3, 3 )</code> will clear register 3. :*<code> COPY ( i, r<sub>p</sub>, d, r<sub>d</sub> ) ; [[r<sub>p</sub>] ] β r<sub>d</sub></code>, Indirectly copy the contents of the source-register pointed to by pointer-register r<sub>p</sub> into the destination register. :*<code> COPY ( d, r<sub>s</sub>, i, r<sub>p</sub> ) ; [r<sub>s</sub>] β [r<sub>p</sub>]</code>. Copy the contents of source register r<sub>s</sub> into the destination-register pointed to by the pointer-register r<sub>p</sub>. :*<code> JNZ ( r, I<sub>z</sub> ) ;</code> Conditional jump if [r] is positive; i.e. IF [r] > 0 THEN jump to instruction z else continue in sequence (Cook and Reckhow call this: "TRAnsfer control to line m if Xj > 0") :*<code> READ ( r<sub>d</sub> ) ;</code> copy "the input" into destination register r<sub>d</sub> :*<code> PRINT ( r<sub>s</sub> ) ;</code> copy the contents of source register r<sub>s</sub> to "the output."
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)