Browse Source

* use 'cbw' and 'cwd' instead of 'xor reg, reg' in the asm version of GetPixel16

git-svn-id: trunk@40970 -
nickysn 6 years ago
parent
commit
003a08f040
1 changed files with 4 additions and 2 deletions
  1. 4 2
      packages/graph/src/msdos/graph.pp

+ 4 - 2
packages/graph/src/msdos/graph.pp

@@ -1744,9 +1744,11 @@ end;
     or    ah,al            { save bit in AH       }
     or    ah,al            { save bit in AH       }
 
 
     mov   al,ah            { 16-bit pixel in AX   }
     mov   al,ah            { 16-bit pixel in AX   }
-    xor   ah,ah
+    { 1 byte shorter than 'xor ah, ah'; will always set ah to 0, because sign(al)=0 }
+    cbw
 {$ifdef FPC_GRAPH_SUPPORTS_TRUECOLOR}
 {$ifdef FPC_GRAPH_SUPPORTS_TRUECOLOR}
-    xor   dx,dx
+    { 1 byte shorter than 'xor dx, dx'; will always set dx to 0, because sign(ah)=0 }
+    cwd
 {$endif FPC_GRAPH_SUPPORTS_TRUECOLOR}
 {$endif FPC_GRAPH_SUPPORTS_TRUECOLOR}
   end;
   end;
 {$endif asmgraph}
 {$endif asmgraph}