@LucasKauffman @ThomasPornin answered that already, but specifically for NASM you can find safe structured exception handling example here:
nasm.us/xdoc/2.10.07/html/nasmdoc7.html#section-7.5.2 But I'd warn against jumping forward and go by the book. This is section 7 for a reason, and you should first master sections 4-6 in the manual before dealing with it AND understanding it.