tasm16_32_1.pp 591 B

123456789101112131415161718192021222324252627282930313233
  1. { %cpu=i8086 }
  2. { i8086 test for correct assembly of 32-bit instructions on the i8086 target }
  3. { this one tests an instruction with a 32-bit const operand }
  4. program tasm16_32_1;
  5. {$asmmode intel}
  6. {$asmcpu 80386}
  7. var
  8. lo_word, hi_word: Word;
  9. begin
  10. asm
  11. db 66h, 31h, 0c0h { xor eax, eax }
  12. { the actual instruction being tested: }
  13. mov eax, 12345678h
  14. db 66h, 50h { push eax }
  15. pop word ptr [lo_word]
  16. pop word ptr [hi_word]
  17. end;
  18. if (lo_word=$5678) and (hi_word=$1234) then
  19. Writeln('Ok!')
  20. else
  21. begin
  22. Writeln('Error!');
  23. Halt(1);
  24. end;
  25. end.