code_gremlins
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| code_gremlins [2026/01/29 01:22] – appledog | code_gremlins [2026/01/29 01:43] (current) – appledog | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| == Meet the Gremlins | == Meet the Gremlins | ||
| - | //When the VC-3 portal opened between dimensions, something else came through... | + | //When the VC-3 portal opened between dimensions, something else came through...// |
| === The CABC Gremlin | === The CABC Gremlin | ||
| - | Carry or No Carry? JC? JNC? Left or Right, up or down, cats and dogs living together... Chaos! | + | //Carry or No Carry? JC? JNC? Left or Right, up or down, cats and dogs living together... Chaos!// |
| This mischievous creature inverts your conditional jumps when you least expect it. It whispers " | This mischievous creature inverts your conditional jumps when you least expect it. It whispers " | ||
| Line 35: | Line 35: | ||
| //"Is it a number? Is it a name? Who knows!"// | //"Is it a number? Is it a name? Who knows!"// | ||
| - | Confuses immediate values with label references. | + | Confuses immediate values with label references. #TOK_PRINT becomes zero, labels |
| - | **Weakness:** Remember the ancient law: `#` for decimals, | + | Weakness: Remember the ancient law: # for decimals, |
| - | --- | + | === Doppelganger Gremlins |
| + | //*"We are many, yet we are one..."// | ||
| - | ### **The Doppelganger Gremlin** | + | ELM and ELD look different but share a soul (the EL register). Modify |
| - | *"We are many, yet we are one..."* | + | |
| - | ELM and ELD look different but share a soul (the EL register). Modify one, corrupt the other. FLD and GLD both claim the D register. | + | Weakness: The separation ritual: use independent pairs (GLK > GLD when paired with FLD). |
| - | **Weakness: | + | === Stack Goblins |
| + | //" | ||
| - | --- | + | There are two forms of this goblin. They look exactly the same except one of them has a beard and a red hat, while all the other goblins have white hats. These goblins are relentless, they are constantly trying to fuck with the stack. |
| - | ### **The Stack Phantom** | + | The first one looks for functions with unbalanced PUSH/POP. Returns to address $292929. Endless calls to LDA #0000. Corrupts everything in its wake. |
| - | *"What goes up must come down... eventually..."* | + | |
| - | Haunts functions with unbalanced PUSH/POP. Returns | + | But the POPA goblin is the worst. He lies to you and tells you this is better but behind your back he is stealing our return values. POPA over-writes a return value, or you accidentally PUSH/POP a register that is used as a return value. |
| - | **Weakness:** Count your PUSHes, count your POPs, on EVERY path! | + | Weakness: |
| - | --- | + | === Flag Goblins |
| + | //" | ||
| - | ### **The Flag Thief** | + | This little green monster is technically a goblin -- he's always tryina' |
| - | *" | + | |
| - | Steals your carefully-set carry flag during innocent POP instructions. Your success becomes failure, | + | Weakness: Use non-reserved flags or put return values in registers. Declare |
| - | **Weakness: | + | === Mirror |
| - | + | //" | |
| - | --- | + | |
| - | + | ||
| - | ### **The Mirror | + | |
| - | *"42? You mean 24!"* | + | |
| Inverts your strings, reverses your numbers, makes everything backwards. | Inverts your strings, reverses your numbers, makes everything backwards. | ||
| - | **Weakness:** The sacred JC, not the cursed JNC! | + | Weakness: |
| - | --- | + | == History |
| - | + | //The Stellar Dynamics engineers learned to respect these creatures. For every gremlin caught, the VC-3 grew stronger...// | |
| - | *The Stellar Dynamics engineers learned to respect these creatures. For every gremlin caught, the VC-3 grew stronger...* | + | |
| - | + | ||
| - | --- | + | |
| - | + | ||
| - | **This is fantastic lore for the project!** 🚀 Want to continue building BASIC, or shall we hunt more gremlins? 😄 | + | |
| == Lessons Learned | == Lessons Learned | ||
| Line 92: | Line 83: | ||
| 5. **Is stack balanced on ALL paths?** (especially error paths) | 5. **Is stack balanced on ALL paths?** (especially error paths) | ||
| - | **You' | + | Always remember: Gremlins |
| - | + | ||
| - | **Ready for the next feature?** `PRINT " | + | |
code_gremlins.txt · Last modified: by appledog
