Toggle search
Search
Toggle menu
notifications
Toggle personal menu
Editing
Basic Assembly Programming
(section)
From Turing Complete
Views
Read
Edit
Edit source
View history
associated-pages
Page
Discussion
More actions
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!
===== Moving Data Around ===== We said we want to complement the value in register 0. <code>loadi</code> would overwrite that value, so we need to save it in a different register first. Registers 1, 2, and 3 will be used for logical operations, so we’ll save it in register 4. Turing Complete should have automatically given you the mnemonic <code>0to4</code> for “moving” the value in register 0 to register 4. Note that this overwrites register 4, but ''does not'' change register 0. The operation is a copy-and-paste, not a cut-and-paste. Despite this, the typical assembly term for this operation is a '''data move''', '''register move''', or simply '''move'''. I recommend using the bitwise-or trick discussed above to make mnemonics for each source register and each destination register and then write <code>move|s0|d4</code>. Some architectures use the mnemonic <code>mov</code> instead of <code>move</code>, and others use <code>load</code>. <span id="putting-the-first-pieces-together"></span>
Summary:
Please note that all contributions to Turing Complete are considered to be released under the Creative Commons Attribution-ShareAlike (see
TuringComplete:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)