tw1157.pp 805 B

1234567891011121314151617181920212223242526272829303132333435
  1. { Source provided for Free Pascal Bug Report 1157 }
  2. { Submitted by "Colin Goldie" on 2000-10-06 }
  3. { e-mail: [email protected] }
  4. {$asmmode intel}
  5. Function GetBLUEfromRGB( color : word ) : byte; assembler;
  6. asm
  7. mov cx,color
  8. and cx,0000000000011111b
  9. mov @Result,cl
  10. end;
  11. {
  12. Does something weird .. to the stack im guessing ... error 206 and 103
  13. errors occur 'File not open' ...
  14. However, if instead of using @Result , i chuck my return value into the
  15. accumulator register , everything thing works hunky dory.
  16. }
  17. Function GetBLUEfromRGB2( color : word ) : byte; assembler;
  18. asm
  19. mov cx,color
  20. and cx,0000000000011111b
  21. mov al,cl
  22. end;
  23. begin
  24. if GetBlueFromRGB2($fff)<>GetBlueFromRGB($fff) then
  25. begin
  26. Writeln('Error in assembler statement');
  27. Halt(1);
  28. end;
  29. end.