Enumerations: Difference between revisions
Content added Content deleted
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) |
||
Line 467: | Line 467: | ||
<lang lisp>(deftype fruit () |
<lang lisp>(deftype fruit () |
||
'(member +apple+ +banana+ +cherry+))</lang> |
'(member +apple+ +banana+ +cherry+))</lang> |
||
=={{header|Computer/zero Assembly}}== |
|||
Constants can be defined by simply storing their binary representation into memory. You've only got 32 bytes of RAM so don't waste them. This is the only way to use numeric values, as all instructions on the CPU take memory addresses as operands, not constants. |
|||
<lang 6502asm>LDA 4 ;load from memory address 4 |
|||
STP |
|||
NOP |
|||
NOP |
|||
byte 1</lang> |
|||
The <code>NOP</code> and <code>STP</code> instructions ignore their operands, which means you can store arbitrary data inside those instructions that you can load from. This can save a little bit of memory. |
|||
=={{header|D}}== |
=={{header|D}}== |