Author Topic: ret vs reti  (Read 5954 times)

0 Members and 2 Guests are viewing this topic.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
ret vs reti
« on: August 18, 2016, 06:08:59 am »
So, yesterday evening I did some stumbling around and reading docs once again, and then I stumbled upon reti, and that you should always use it instead of ret when returning from an interrupt. However, I've been using ret just fine to return from an interrupt, so I wonder what actually is the difference between reti and ret? (Apart from reti being a byte larger)

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: ret vs reti
« Reply #1 on: August 18, 2016, 06:12:10 am »
reti is ret (as in "pop and go to the popped address") plus a hardware signal that an interrupt just finished.

ret is perfectly fine for returning from interrupts on the TI calculators, because only one interrupt is active at any given time. It's really only necessary for other Z80 platforms where you might have nested interrupts.