conversations
listlengths
2
2
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x10000`?" }, { "from": "gpt", "value": "`MEM_SIZE` shows why constants should carry meaning at the call site.\n####\nThe source defines `MEM_SIZE` as `0x10000` in a Z80 emulator...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for systems-programming control flow when one source example is `MEM_SIZE`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nThe...
[ { "from": "human", "value": "What tests help catch wrong values for systems-programming control flow constants like `MEM_SIZE`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `MEM_SIZE`, defined...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `MEM_SIZE`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants such...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `MEM_SIZE`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`MEM_SIZE` is def...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x81`?" }, { "from": "gpt", "value": "`STD_PORT` shows why constants should carry meaning at the call site.\n####\nThe source defines `STD_PORT` as `0x81` in a Z80 emulator conte...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `STD_PORT`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nThe...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `STD_PORT`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `STD_PORT`, defined...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `STD_PORT`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants such...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `STD_PORT`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`STD_PORT` is def...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x01`?" }, { "from": "gpt", "value": "`FLAG_C` shows why constants should carry meaning at the call site.\n####\nThe source defines `FLAG_C` as `0x01` in a Z80 emulator context. ...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `FLAG_C`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nThe s...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `FLAG_C`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `FLAG_C`, defined as ...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `FLAG_C`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants such a...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `FLAG_C`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`FLAG_C` is defined...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x02`?" }, { "from": "gpt", "value": "`FLAG_N` shows why constants should carry meaning at the call site.\n####\nThe source defines `FLAG_N` as `0x02` in a Z80 emulator context. ...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `FLAG_N`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nThe s...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `FLAG_N`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `FLAG_N`, defined as ...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `FLAG_N`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants such a...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `FLAG_N`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`FLAG_N` is defined...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x04`?" }, { "from": "gpt", "value": "`FLAG_PV` shows why constants should carry meaning at the call site.\n####\nThe source defines `FLAG_PV` as `0x04` in a Z80 emulator context...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `FLAG_PV`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nThe ...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `FLAG_PV`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `FLAG_PV`, defined a...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `FLAG_PV`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants such ...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `FLAG_PV`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`FLAG_PV` is defin...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x08`?" }, { "from": "gpt", "value": "`FLAG_X` shows why constants should carry meaning at the call site.\n####\nThe source defines `FLAG_X` as `0x08` in a Z80 emulator context. ...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `FLAG_X`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nThe s...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `FLAG_X`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `FLAG_X`, defined as ...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `FLAG_X`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants such a...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `FLAG_X`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`FLAG_X` is defined...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x20`?" }, { "from": "gpt", "value": "`FLAG_Y` shows why constants should carry meaning at the call site.\n####\nThe source defines `FLAG_Y` as `0x20` in a Z80 emulator context. ...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `FLAG_Y`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nThe s...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `FLAG_Y`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `FLAG_Y`, defined as ...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `FLAG_Y`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants such a...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `FLAG_Y`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`FLAG_Y` is defined...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x40`?" }, { "from": "gpt", "value": "`FLAG_Z` shows why constants should carry meaning at the call site.\n####\nThe source defines `FLAG_Z` as `0x40` in a Z80 emulator context. ...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `FLAG_Z`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nThe s...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `FLAG_Z`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `FLAG_Z`, defined as ...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `FLAG_Z`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants such a...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `FLAG_Z`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`FLAG_Z` is defined...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x80`?" }, { "from": "gpt", "value": "`FLAG_S` shows why constants should carry meaning at the call site.\n####\nThe source defines `FLAG_S` as `0x80` in a Z80 emulator context. ...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `FLAG_S`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nThe s...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `FLAG_S`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `FLAG_S`, defined as ...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `FLAG_S`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants such a...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `FLAG_S`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`FLAG_S` is defined...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x00`?" }, { "from": "gpt", "value": "`ALU_OP_ADD` shows why constants should carry meaning at the call site.\n####\nThe source defines `ALU_OP_ADD` as `0x00` in a Z80 emulator c...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `ALU_OP_ADD`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nT...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `ALU_OP_ADD`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `ALU_OP_ADD`, def...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `ALU_OP_ADD`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants su...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `ALU_OP_ADD`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`ALU_OP_ADD` is...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `ALU_OP_ADC`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nT...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `ALU_OP_ADC`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `ALU_OP_ADC`, def...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `ALU_OP_ADC`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants su...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `ALU_OP_ADC`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`ALU_OP_ADC` is...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `ALU_OP_SUB`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nT...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `ALU_OP_SUB`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `ALU_OP_SUB`, def...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `ALU_OP_SUB`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants su...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `ALU_OP_SUB`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`ALU_OP_SUB` is...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x03`?" }, { "from": "gpt", "value": "`ALU_OP_SBC` shows why constants should carry meaning at the call site.\n####\nThe source defines `ALU_OP_SBC` as `0x03` in a Z80 emulator c...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `ALU_OP_SBC`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nT...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `ALU_OP_SBC`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `ALU_OP_SBC`, def...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `ALU_OP_SBC`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants su...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `ALU_OP_SBC`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`ALU_OP_SBC` is...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `ALU_OP_AND`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nT...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `ALU_OP_AND`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `ALU_OP_AND`, def...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `ALU_OP_AND`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants su...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `ALU_OP_AND`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`ALU_OP_AND` is...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x05`?" }, { "from": "gpt", "value": "`ALU_OP_OR` shows why constants should carry meaning at the call site.\n####\nThe source defines `ALU_OP_OR` as `0x05` in a Z80 emulator con...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `ALU_OP_OR`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nTh...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `ALU_OP_OR`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `ALU_OP_OR`, defin...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `ALU_OP_OR`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants suc...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `ALU_OP_OR`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`ALU_OP_OR` is d...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x06`?" }, { "from": "gpt", "value": "`ALU_OP_XOR` shows why constants should carry meaning at the call site.\n####\nThe source defines `ALU_OP_XOR` as `0x06` in a Z80 emulator c...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `ALU_OP_XOR`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nT...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `ALU_OP_XOR`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `ALU_OP_XOR`, def...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `ALU_OP_XOR`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants su...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `ALU_OP_XOR`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`ALU_OP_XOR` is...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x07`?" }, { "from": "gpt", "value": "`ALU_OP_CP` shows why constants should carry meaning at the call site.\n####\nThe source defines `ALU_OP_CP` as `0x07` in a Z80 emulator con...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for systems-programming control flow when one source example is `ALU_OP_CP`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nTh...
[ { "from": "human", "value": "What tests help catch wrong values for systems-programming control flow constants like `ALU_OP_CP`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `ALU_OP_CP`, defin...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `ALU_OP_CP`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants suc...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `ALU_OP_CP`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`ALU_OP_CP` is d...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `ALU_OP_INC`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nT...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `ALU_OP_INC`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `ALU_OP_INC`, def...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `ALU_OP_INC`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants su...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `ALU_OP_INC`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`ALU_OP_INC` is...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x09`?" }, { "from": "gpt", "value": "`ALU_OP_DEC` shows why constants should carry meaning at the call site.\n####\nThe source defines `ALU_OP_DEC` as `0x09` in a Z80 emulator c...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `ALU_OP_DEC`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nT...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `ALU_OP_DEC`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `ALU_OP_DEC`, def...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `ALU_OP_DEC`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants su...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `ALU_OP_DEC`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`ALU_OP_DEC` is...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x0A`?" }, { "from": "gpt", "value": "`ALU_OP_RLC` shows why constants should carry meaning at the call site.\n####\nThe source defines `ALU_OP_RLC` as `0x0A` in a Z80 emulator c...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `ALU_OP_RLC`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nT...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `ALU_OP_RLC`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `ALU_OP_RLC`, def...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `ALU_OP_RLC`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants su...
[ { "from": "human", "value": "How can macros improve readability without hiding unsafe behavior in Z80 emulator code when the source example is `ALU_OP_RLC`?" }, { "from": "gpt", "value": "Macros are best for stable names and simple expressions, not for hidden side effects.\n####\n`ALU_OP_RLC` is...
[ { "from": "human", "value": "How should named constants be used in Z80 emulator code instead of inline literals like `0x0B`?" }, { "from": "gpt", "value": "`ALU_OP_RL` shows why constants should carry meaning at the call site.\n####\nThe source defines `ALU_OP_RL` as `0x0B` in a Z80 emulator con...
[ { "from": "human", "value": "How can I keep public and internal constants consistent for instruction arithmetic and flags when one source example is `ALU_OP_RL`?" }, { "from": "gpt", "value": "Define shared constants in one authoritative place or add checks that catch mismatches early.\n####\nTh...
[ { "from": "human", "value": "What tests help catch wrong values for instruction arithmetic and flags constants like `ALU_OP_RL`?" }, { "from": "gpt", "value": "Use tests that exercise the behavior behind the constant, not just the numeric spelling.\n####\nA grounded example is `ALU_OP_RL`, defin...
[ { "from": "human", "value": "How should constants that describe memory layout be documented in Z80 emulator code when the source example is `ALU_OP_RL`?" }, { "from": "gpt", "value": "Document the address, size, and ownership assumptions next to the constant.\n####\nThe source uses constants suc...