Author Topic: F**king stacks! How do they work?  (Read 6688 times)

0 Members and 1 Guest are viewing this topic.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: F**king stacks! How do they work?
« Reply #15 on: December 17, 2010, 12:21:18 am »
Doesn't destroying IX mess with the OS?

No, but destroying IY does

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: F**king stacks! How do they work?
« Reply #16 on: December 17, 2010, 12:22:39 am »
Okay, I'll be sure not to touch that. What exactly does the OS use IY for, anyway?
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: F**king stacks! How do they work?
« Reply #17 on: December 17, 2010, 12:24:44 am »
Okay, I'll be sure not to touch that. What exactly does the OS use IY for, anyway?

The OS has what are called "customized flags" to keep track of events that have occured, modes that have been set, graphs that have been drawn, etc.  IY points to where these flags are located.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: F**king stacks! How do they work?
« Reply #18 on: December 17, 2010, 07:46:22 pm »
But if you mess with IY, you can do a ld IY, Flags, right? ???

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: F**king stacks! How do they work?
« Reply #19 on: December 17, 2010, 07:48:28 pm »
But if you mess with IY, you can do a ld IY, Flags, right? ???

That's right.  But one has to remember to do that.

The TI-83+ has some custom flags available for ASM programmers to use.  I make use of these flags in S.A.D., but sometimes I would forget to use ld IY, flags after drawing sprites.  Needless to say, I got some very wacky results, because IY pointed to the wrong spot.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: F**king stacks! How do they work?
« Reply #20 on: December 17, 2010, 07:49:03 pm »
But if you mess with IY, you can do a ld IY, Flags, right? ???
I think so. I know there's an actual address. I'm sure you could do push iy \ pop hl bcall DispHL to find out.

EDIT: ninja'd
« Last Edit: December 17, 2010, 07:49:37 pm by graphmastur »