Gotchas: Difference between revisions
→{{header|X86 Assembly}}
Puppydrum64 (talk | contribs) m (→Delay Slots) |
Puppydrum64 (talk | contribs) |
||
Line 461:
System.print(rect.diagonal) // runtime error (if previous line commented out)
// Rectangle does not implement 'sqrt(_)'</lang>
=={{header|X86 Assembly}}==
===Don't use LOOP===
This doesn't affect the 16-bit 8086, but <code>LOOP</code> has some quirks where it's much more efficient to use:
<lang asm>label:
;loop body goes here
DEC ECX
JNZ label</lang>
Which is very ironic considering that <code>LOOP</code> was originally designed to be a more efficient version of the above construct. (It was more efficient in the original 8086, but not in today's version.) Thankfully, compilers are "aware" of this and don't use <code>LOOP</code>.
=={{header|Z80 Assembly}}==
|