Calculator Community => TI Calculators => ASM => Topic started by: Sorunome on August 18, 2016, 06:08:59 am

Title: ret vs reti
Post by: Sorunome 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)
Title: Re: ret vs reti
Post by: Deep Toaster 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.