RosettaCodeData/Task/Gotchas/68000-Assembly/gotchas-5.68000
2023-07-01 13:44:08 -04:00

6 lines
371 B
Text

MOVE.L #$12345678,D0 ;set the entire register to a known value for demonstration purposes.
MOVE.W #$7FFF,D0 ;D0 = $12347FFF
ADD.W #1,D0 ;D0 = $12348000
TRAPV ;the above operation set the overflow flag, so this instruction will call the signed overflow handler.
;Even though the entire register didn't overflow, the portion we were operating on did, so that counts.