Assertions in design by contract: Difference between revisions

m
Line 847:
=={{header|Z80 Assembly}}==
There are no built-in assertions, error handlers, etc. at the hardware level. The closest you can get is a function conditionally returning early. For example, this function for multiplication checks if the second factor equals zero or 1 before attempting to multiply.
<lang z80>SmallMultiply:
SmallMultiply:
;returns A = C * A
or a ;compares A to zero
Line 865 ⟶ 864:
ld a,c
ret ;returns A = C</lang>
 
 
=={{header|zkl}}==
1,489

edits