tb0236.pp 977 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. { %CPU=i386 }
  2. { Old file: tbs0276.pp }
  3. { Asm, intel reference parsing incompatibility OK 0.99.13 (PFV) }
  4. {$asmmode intel}
  5. type
  6. trec = record
  7. ypos,
  8. xpos : longint;
  9. end;
  10. z80cont = record
  11. dummy : longint;
  12. page: array [0..11,0..16383] of byte;
  13. end;
  14. var
  15. rec : tRec;
  16. myz80 : z80cont;
  17. error : boolean;
  18. test : byte;
  19. begin
  20. error:=false;
  21. test:=23;
  22. rec.xpos:=1;
  23. myz80.page[0,5]:=15;
  24. asm
  25. lea edi, Rec
  26. cmp byte ptr [edi+tRec.Xpos], 1
  27. jne @error
  28. cmp byte ptr [edi].trec.Xpos, 1
  29. jne @error
  30. mov ecx, 5
  31. mov dh,byte ptr myz80.page[ecx]
  32. cmp dh,15
  33. jne @error
  34. mov byte ptr myz80.page[ecx],51
  35. jmp @noerror
  36. @error:
  37. mov byte ptr error,1
  38. @noerror:
  39. end;
  40. if error or (test<>23) or (myz80.page[0,5]<>51) then
  41. begin
  42. Writeln('Error in assembler code generation');
  43. Halt(1);
  44. end
  45. else
  46. Writeln('Correct assembler generated');
  47. end.