r/transprogrammer • u/definitelynotagirl99 • Jul 20 '24
Implementing exceptions
Just wanna know if anyone knows a more time-efficient way of implementing exceptions in a language than this or sees any issues with this design :3

handlethrow would exist separately for each try-catch clause
(obv this will only work for x86 but smth similar should work for all major architectures)
15
Upvotes
View all comments
Show parent comment
2
u/definitelynotagirl99 Jul 22 '24 edited Jul 22 '24
it does not as stated by the 3rd volume of the AMD64 specification on pages 172-181
edit: i'm dumb, those are the pages describing
callwhich is irrelevant here, the relevant pages are 343-349 (same document)already gonna have to either way althought that'll cause major issues with one my language features but oh well.
i'll just put the data pointer into
rdxsince it's already a scratch register (needs to be because AMD64 uses it for a variety of instructions, same goes forrcxand potentiallyrbx.edit: reddit seems to have messed up the formatting