Comment

Comment by windenntw

Here is one in plain 68000 assembler.

  move.b #200,d0
  move.b #100,d1
  add.b  d0,d1   ; 8th bit goes to X flag
  subx.b d0,d0   ; d0 = $00 or $ff depending on X flag
  or.b   d0,d1   ; d1 = 255 if there was saturation
You can do the same with all others that somehow store the 8th bit carry somewhere then allow using it for substraction.
parent windenntw 5 months ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton