Image Map Image Map
View RSS Feed

All Blog Entries

  1. IDIV and IMUL do not set Sign Flag

    Or more specifically:

    The CF, OF, SF, ZF, AF, and PF flags are undefined.
    What it comes down to is that you cannot safely jump (JS / JNS) based on a signed multiply or divide.

    Code:
    MOV AX, FF00	;
    CWD		; DX:AX = -256
    MOV BX, 0012	; BX = +18
    IDIV	BX	;
    JNS	$+4	; WRONG!
    NEG	AX	; AX = ABS(DX:AX / BX)
    The fix is to re-test the highest byte of the result (DH, AH or AL depending ...):

    Code:
    MOV AX, FF00	;
    ...

    Updated July 11th, 2017 at 08:15 AM by neilobremski (Corrected mistakes identified by Krille)

    Categories
    Asm
  2. My Top 10 AMIGA EXCLUSIVES | It's a Pixel THING - Ep. 121

    The Amiga was home of many mind-blowing exclusives, in so many different genres! Hereís my Top 10 choices that all gamers should try at least once in their lives!

    My Top 10 AMIGA EXCLUSIVES | It's a Pixel THING - Ep. 121
  3. My Personal TOP 10 C64 TUNES | It's a Pixel THING - Ep. 120

    In 2017 the Commodore 64 will be 35 years old, so itís the perfect time to point out my 10 favorite SID tunes that Iíve always worshiped and still listen all the time!

    My Personal TOP 10 C64 TUNES | It's a Pixel THING - Ep. 120
  4. DEC extender adapter for over-the-top OMNIBUS boards

    Quote Originally Posted by jackrubin View Post
    Revision 2 just arrived - smaller board, no vias. Based on how hard I had to smack the connectors with the hammer, I've opened the holes up a little in the next batch. First cable set goes out for testing tomorrow.





    ...
    Categories
    Uncategorized
  5. The Ebay Follies