ra386.pas 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Carl Eric Codere and Peter Vreman
  4. Handles the common i386 assembler reader routines
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit Ra386;
  19. {$i defines.inc}
  20. interface
  21. uses
  22. aasm,cpubase,RAUtils;
  23. { Parser helpers }
  24. function is_prefix(t:tasmop):boolean;
  25. function is_override(t:tasmop):boolean;
  26. Function CheckPrefix(prefixop,op:tasmop): Boolean;
  27. Function CheckOverride(overrideop,op:tasmop): Boolean;
  28. Procedure FWaitWarning;
  29. type
  30. T386Operand=class(TOperand)
  31. Procedure SetCorrectSize(opcode:tasmop);override;
  32. Function SetupResult : boolean;override;
  33. end;
  34. T386Instruction=class(TInstruction)
  35. { Operand sizes }
  36. procedure AddReferenceSizes;
  37. procedure SetInstructionOpsize;
  38. procedure CheckOperandSizes;
  39. procedure CheckNonCommutativeOpcodes;
  40. { opcode adding }
  41. procedure ConcatInstruction(p : taasmoutput);override;
  42. end;
  43. implementation
  44. uses
  45. globtype,globals,systems,verbose,
  46. symconst,symdef,symsym,
  47. cgbase,
  48. types,cpuasm;
  49. {$define ATTOP}
  50. {$define INTELOP}
  51. {$ifdef NORA386INT}
  52. {$ifdef NOAG386NSM}
  53. {$ifdef NOAG386INT}
  54. {$undef INTELOP}
  55. {$endif}
  56. {$endif}
  57. {$endif}
  58. {$ifdef NORA386ATT}
  59. {$ifdef NOAG386ATT}
  60. {$undef ATTOP}
  61. {$endif}
  62. {$endif}
  63. {*****************************************************************************
  64. Parser Helpers
  65. *****************************************************************************}
  66. function is_prefix(t:tasmop):boolean;
  67. var
  68. i : longint;
  69. Begin
  70. is_prefix:=false;
  71. for i:=1 to AsmPrefixes do
  72. if t=AsmPrefix[i-1] then
  73. begin
  74. is_prefix:=true;
  75. exit;
  76. end;
  77. end;
  78. function is_override(t:tasmop):boolean;
  79. var
  80. i : longint;
  81. Begin
  82. is_override:=false;
  83. for i:=1 to AsmOverrides do
  84. if t=AsmOverride[i-1] then
  85. begin
  86. is_override:=true;
  87. exit;
  88. end;
  89. end;
  90. Function CheckPrefix(prefixop,op:tasmop): Boolean;
  91. { Checks if the prefix is valid with the following opcode }
  92. { return false if not, otherwise true }
  93. Begin
  94. CheckPrefix := TRUE;
  95. (* Case prefix of
  96. A_REP,A_REPNE,A_REPE:
  97. Case opcode Of
  98. A_SCASB,A_SCASW,A_SCASD,
  99. A_INS,A_OUTS,A_MOVS,A_CMPS,A_LODS,A_STOS:;
  100. Else
  101. Begin
  102. CheckPrefix := FALSE;
  103. exit;
  104. end;
  105. end; { case }
  106. A_LOCK:
  107. Case opcode Of
  108. A_BT,A_BTS,A_BTR,A_BTC,A_XCHG,A_ADD,A_OR,A_ADC,A_SBB,A_AND,A_SUB,
  109. A_XOR,A_NOT,A_NEG,A_INC,A_DEC:;
  110. Else
  111. Begin
  112. CheckPrefix := FALSE;
  113. Exit;
  114. end;
  115. end; { case }
  116. A_NONE: exit; { no prefix here }
  117. else
  118. CheckPrefix := FALSE;
  119. end; { end case } *)
  120. end;
  121. Function CheckOverride(overrideop,op:tasmop): Boolean;
  122. { Check if the override is valid, and if so then }
  123. { update the instr variable accordingly. }
  124. Begin
  125. CheckOverride := true;
  126. { Case instr.getinstruction of
  127. A_MOVS,A_XLAT,A_CMPS:
  128. Begin
  129. CheckOverride := TRUE;
  130. Message(assem_e_segment_override_not_supported);
  131. end
  132. end }
  133. end;
  134. Procedure FWaitWarning;
  135. begin
  136. if (target_info.target=target_i386_GO32V2) and (cs_fp_emulation in aktmoduleswitches) then
  137. Message(asmr_w_fwait_emu_prob);
  138. end;
  139. {*****************************************************************************
  140. T386Operand
  141. *****************************************************************************}
  142. Procedure T386Operand.SetCorrectSize(opcode:tasmop);
  143. begin
  144. if att_needsuffix[opcode]=attsufFPU then
  145. begin
  146. case size of
  147. S_L : size:=S_FS;
  148. S_IQ : size:=S_FL;
  149. end;
  150. end
  151. else if att_needsuffix[opcode]=attsufFPUint then
  152. begin
  153. case size of
  154. S_W : size:=S_IS;
  155. S_L : size:=S_IL;
  156. end;
  157. end;
  158. end;
  159. Function T386Operand.SetupResult:boolean;
  160. var
  161. Res : boolean;
  162. Begin
  163. Res:=inherited setupResult;
  164. { replace by ref by register if not place was
  165. reserved on stack }
  166. if res and (procinfo^.return_offset=0) then
  167. begin
  168. opr.typ:=OPR_REGISTER;
  169. if is_fpu(aktprocdef.rettype.def) then
  170. begin
  171. opr.reg:=R_ST0;
  172. case tfloatdef(aktprocdef.rettype.def).typ of
  173. s32real : size:=S_FS;
  174. s64real : size:=S_FL;
  175. s80real : size:=S_FX;
  176. s64comp : size:=S_IQ;
  177. else
  178. begin
  179. Message(asmr_e_cannot_use_RESULT_here);
  180. res:=false;
  181. end;
  182. end;
  183. end
  184. else if ret_in_acc(aktprocdef.rettype.def) then
  185. case aktprocdef.rettype.def.size of
  186. 1 : begin
  187. opr.reg:=R_AL;
  188. size:=S_B;
  189. end;
  190. 2 : begin
  191. opr.reg:=R_AX;
  192. size:=S_W;
  193. end;
  194. 3,4 : begin
  195. opr.reg:=R_EAX;
  196. size:=S_L;
  197. end;
  198. else
  199. begin
  200. Message(asmr_e_cannot_use_RESULT_here);
  201. res:=false;
  202. end;
  203. end;
  204. Message1(asmr_h_RESULT_is_reg,reg2str(opr.reg));
  205. end;
  206. SetupResult:=res;
  207. end;
  208. {*****************************************************************************
  209. T386Instruction
  210. *****************************************************************************}
  211. procedure T386Instruction.AddReferenceSizes;
  212. { this will add the sizes for references like [esi] which do not
  213. have the size set yet, it will take only the size if the other
  214. operand is a register }
  215. var
  216. operand2,i : longint;
  217. s : tasmsymbol;
  218. so : longint;
  219. begin
  220. for i:=1to ops do
  221. begin
  222. operands[i].SetCorrectSize(opcode);
  223. if (operands[i].size=S_NO) then
  224. begin
  225. case operands[i].Opr.Typ of
  226. OPR_REFERENCE :
  227. begin
  228. if i=2 then
  229. operand2:=1
  230. else
  231. operand2:=2;
  232. if operand2<ops then
  233. begin
  234. { Only allow register as operand to take the size from }
  235. if operands[operand2].opr.typ=OPR_REGISTER then
  236. begin
  237. if ((opcode<>A_MOVD) and
  238. (opcode<>A_CVTSI2SS)) then
  239. operands[i].size:=operands[operand2].size;
  240. end
  241. else
  242. begin
  243. { if no register then take the opsize (which is available with ATT),
  244. if not availble then give an error }
  245. if opsize<>S_NO then
  246. operands[i].size:=opsize
  247. else
  248. begin
  249. Message(asmr_e_unable_to_determine_reference_size);
  250. { recovery }
  251. operands[i].size:=S_L;
  252. end;
  253. end;
  254. end
  255. else
  256. begin
  257. if opsize<>S_NO then
  258. operands[i].size:=opsize
  259. end;
  260. end;
  261. OPR_SYMBOL :
  262. begin
  263. { Fix lea which need a reference }
  264. if opcode=A_LEA then
  265. begin
  266. s:=operands[i].opr.symbol;
  267. so:=operands[i].opr.symofs;
  268. operands[i].opr.typ:=OPR_REFERENCE;
  269. reset_reference(operands[i].opr.ref);
  270. operands[i].opr.ref.symbol:=s;
  271. operands[i].opr.ref.offset:=so;
  272. end;
  273. operands[i].size:=S_L;
  274. end;
  275. end;
  276. end;
  277. end;
  278. end;
  279. procedure T386Instruction.SetInstructionOpsize;
  280. begin
  281. if opsize<>S_NO then
  282. exit;
  283. case ops of
  284. 0 : ;
  285. 1 :
  286. { "push es" must be stored as a long PM }
  287. if ((opcode=A_PUSH) or
  288. (opcode=A_POP)) and
  289. (operands[1].opr.typ=OPR_REGISTER) and
  290. ((operands[1].opr.reg>=firstsreg) and
  291. (operands[1].opr.reg<=lastsreg)) then
  292. opsize:=S_L
  293. else
  294. opsize:=operands[1].size;
  295. 2 :
  296. begin
  297. case opcode of
  298. A_MOVZX,A_MOVSX :
  299. begin
  300. case operands[1].size of
  301. S_W :
  302. case operands[2].size of
  303. S_L :
  304. opsize:=S_WL;
  305. end;
  306. S_B :
  307. case operands[2].size of
  308. S_W :
  309. opsize:=S_BW;
  310. S_L :
  311. opsize:=S_BL;
  312. end;
  313. end;
  314. end;
  315. A_MOVD : { movd is a move from a mmx register to a
  316. 32 bit register or memory, so no opsize is correct here PM }
  317. exit;
  318. A_OUT :
  319. opsize:=operands[1].size;
  320. else
  321. opsize:=operands[2].size;
  322. end;
  323. end;
  324. 3 :
  325. opsize:=operands[3].size;
  326. end;
  327. end;
  328. procedure T386Instruction.CheckOperandSizes;
  329. var
  330. sizeerr : boolean;
  331. i : longint;
  332. begin
  333. { Check only the most common opcodes here, the others are done in
  334. the assembler pass }
  335. case opcode of
  336. A_PUSH,A_POP,A_DEC,A_INC,A_NOT,A_NEG,
  337. A_CMP,A_MOV,
  338. A_ADD,A_SUB,A_ADC,A_SBB,
  339. A_AND,A_OR,A_TEST,A_XOR: ;
  340. else
  341. exit;
  342. end;
  343. { Handle the BW,BL,WL separatly }
  344. sizeerr:=false;
  345. { special push/pop selector case }
  346. if ((opcode=A_PUSH) or
  347. (opcode=A_POP)) and
  348. (operands[1].opr.typ=OPR_REGISTER) and
  349. ((operands[1].opr.reg>=firstsreg) and
  350. (operands[1].opr.reg<=lastsreg)) then
  351. exit;
  352. if opsize in [S_BW,S_BL,S_WL] then
  353. begin
  354. if ops<>2 then
  355. sizeerr:=true
  356. else
  357. begin
  358. case opsize of
  359. S_BW :
  360. sizeerr:=(operands[1].size<>S_B) or (operands[2].size<>S_W);
  361. S_BL :
  362. sizeerr:=(operands[1].size<>S_B) or (operands[2].size<>S_L);
  363. S_WL :
  364. sizeerr:=(operands[1].size<>S_W) or (operands[2].size<>S_L);
  365. end;
  366. end;
  367. end
  368. else
  369. begin
  370. for i:=1 to ops do
  371. begin
  372. if (operands[i].opr.typ<>OPR_CONSTANT) and
  373. (operands[i].size in [S_B,S_W,S_L]) and
  374. (operands[i].size<>opsize) then
  375. sizeerr:=true;
  376. end;
  377. end;
  378. if sizeerr then
  379. begin
  380. { if range checks are on then generate an error }
  381. if (cs_compilesystem in aktmoduleswitches) or
  382. not (cs_check_range in aktlocalswitches) then
  383. Message(asmr_w_size_suffix_and_dest_dont_match)
  384. else
  385. Message(asmr_e_size_suffix_and_dest_dont_match);
  386. end;
  387. end;
  388. { This check must be done with the operand in ATT order
  389. i.e.after swapping in the intel reader
  390. but before swapping in the NASM and TASM writers PM }
  391. procedure T386Instruction.CheckNonCommutativeOpcodes;
  392. begin
  393. if ((ops=2) and
  394. (operands[1].opr.typ=OPR_REGISTER) and
  395. (operands[2].opr.typ=OPR_REGISTER) and
  396. { if the first is ST and the second is also a register
  397. it is necessarily ST1 .. ST7 }
  398. (operands[1].opr.reg=R_ST)) or
  399. (ops=0) then
  400. if opcode=A_FSUBR then
  401. opcode:=A_FSUB
  402. else if opcode=A_FSUB then
  403. opcode:=A_FSUBR
  404. else if opcode=A_FDIVR then
  405. opcode:=A_FDIV
  406. else if opcode=A_FDIV then
  407. opcode:=A_FDIVR
  408. else if opcode=A_FSUBRP then
  409. opcode:=A_FSUBP
  410. else if opcode=A_FSUBP then
  411. opcode:=A_FSUBRP
  412. else if opcode=A_FDIVRP then
  413. opcode:=A_FDIVP
  414. else if opcode=A_FDIVP then
  415. opcode:=A_FDIVRP;
  416. if ((ops=1) and
  417. (operands[1].opr.typ=OPR_REGISTER) and
  418. (operands[1].opr.reg in [R_ST1..R_ST7])) then
  419. if opcode=A_FSUBRP then
  420. opcode:=A_FSUBP
  421. else if opcode=A_FSUBP then
  422. opcode:=A_FSUBRP
  423. else if opcode=A_FDIVRP then
  424. opcode:=A_FDIVP
  425. else if opcode=A_FDIVP then
  426. opcode:=A_FDIVRP;
  427. end;
  428. {*****************************************************************************
  429. opcode Adding
  430. *****************************************************************************}
  431. procedure T386Instruction.ConcatInstruction(p : taasmoutput);
  432. var
  433. siz : topsize;
  434. i,asize : longint;
  435. ai : taicpu;
  436. begin
  437. { Get Opsize }
  438. if (opsize<>S_NO) or (Ops=0) then
  439. siz:=opsize
  440. else
  441. begin
  442. if (Ops=2) and (operands[1].opr.typ=OPR_REGISTER) then
  443. siz:=operands[1].size
  444. else
  445. siz:=operands[Ops].size;
  446. { MOVD should be of size S_LQ or S_QL, but these do not exist PM }
  447. if (ops=2) and (operands[1].size<>S_NO) and
  448. (operands[2].size<>S_NO) and (operands[1].size<>operands[2].size) then
  449. siz:=S_NO;
  450. end;
  451. if ((opcode=A_MOVD)or
  452. (opcode=A_CVTSI2SS)) and
  453. ((operands[1].size=S_NO) or
  454. (operands[2].size=S_NO)) then
  455. siz:=S_NO;
  456. { NASM does not support FADD without args
  457. as alias of FADDP
  458. and GNU AS interprets FADD without operand differently
  459. for version 2.9.1 and 2.9.5 !! }
  460. if (ops=0) and
  461. ((opcode=A_FADD) or
  462. (opcode=A_FMUL) or
  463. (opcode=A_FSUB) or
  464. (opcode=A_FSUBR) or
  465. (opcode=A_FDIV) or
  466. (opcode=A_FDIVR)) then
  467. begin
  468. if opcode=A_FADD then
  469. opcode:=A_FADDP
  470. else if opcode=A_FMUL then
  471. opcode:=A_FMULP
  472. else if opcode=A_FSUB then
  473. opcode:=A_FSUBP
  474. else if opcode=A_FSUBR then
  475. opcode:=A_FSUBRP
  476. else if opcode=A_FDIV then
  477. opcode:=A_FDIVP
  478. else if opcode=A_FDIVR then
  479. opcode:=A_FDIVRP;
  480. {$ifdef ATTOP}
  481. message1(asmr_w_fadd_to_faddp,att_op2str[opcode]);
  482. {$else}
  483. {$ifdef INTELOP}
  484. message1(asmr_w_fadd_to_faddp,int_op2str[opcode]);
  485. {$else}
  486. message1(asmr_w_fadd_to_faddp,'fXX');
  487. {$endif INTELOP}
  488. {$endif ATTOP}
  489. end;
  490. { GNU AS interprets FDIV without operand differently
  491. for version 2.9.1 and 2.10
  492. we add explicit args to it !! }
  493. if (ops=0) and
  494. ((opcode=A_FSUBP) or
  495. (opcode=A_FSUBRP) or
  496. (opcode=A_FDIVP) or
  497. (opcode=A_FDIVRP) or
  498. (opcode=A_FSUB) or
  499. (opcode=A_FSUBR) or
  500. (opcode=A_FDIV) or
  501. (opcode=A_FDIVR)) then
  502. begin
  503. {$ifdef ATTOP}
  504. message1(asmr_w_adding_explicit_args_fXX,att_op2str[opcode]);
  505. {$else}
  506. {$ifdef INTELOP}
  507. message1(asmr_w_adding_explicit_args_fXX,int_op2str[opcode]);
  508. {$else}
  509. message1(asmr_w_adding_explicit_args_fXX,'fXX');
  510. {$endif INTELOP}
  511. {$endif ATTOP}
  512. ops:=2;
  513. operands[1].opr.typ:=OPR_REGISTER;
  514. operands[2].opr.typ:=OPR_REGISTER;
  515. operands[1].opr.reg:=R_ST;
  516. operands[2].opr.reg:=R_ST1;
  517. end;
  518. if (ops=1) and
  519. ((operands[1].opr.typ=OPR_REGISTER) and
  520. (operands[1].opr.reg in [R_ST1..R_ST7])) and
  521. ((opcode=A_FSUBP) or
  522. (opcode=A_FSUBRP) or
  523. (opcode=A_FDIVP) or
  524. (opcode=A_FDIVRP) or
  525. (opcode=A_FADDP) or
  526. (opcode=A_FMULP)) then
  527. begin
  528. {$ifdef ATTOP}
  529. message1(asmr_w_adding_explicit_first_arg_fXX,att_op2str[opcode]);
  530. {$else}
  531. {$ifdef INTELOP}
  532. message1(asmr_w_adding_explicit_first_arg_fXX,int_op2str[opcode]);
  533. {$else}
  534. message1(asmr_w_adding_explicit_first_arg_fXX,'fXX');
  535. {$endif INTELOP}
  536. {$endif ATTOP}
  537. ops:=2;
  538. operands[2].opr.typ:=OPR_REGISTER;
  539. operands[2].opr.reg:=operands[1].opr.reg;
  540. operands[1].opr.reg:=R_ST;
  541. end;
  542. if (ops=1) and
  543. ((operands[1].opr.typ=OPR_REGISTER) and
  544. (operands[1].opr.reg in [R_ST1..R_ST7])) and
  545. ((opcode=A_FSUB) or
  546. (opcode=A_FSUBR) or
  547. (opcode=A_FDIV) or
  548. (opcode=A_FDIVR) or
  549. (opcode=A_FADD) or
  550. (opcode=A_FMUL)) then
  551. begin
  552. {$ifdef ATTOP}
  553. message1(asmr_w_adding_explicit_second_arg_fXX,att_op2str[opcode]);
  554. {$else}
  555. {$ifdef INTELOP}
  556. message1(asmr_w_adding_explicit_second_arg_fXX,int_op2str[opcode]);
  557. {$else}
  558. message1(asmr_w_adding_explicit_second_arg_fXX,'fXX');
  559. {$endif INTELOP}
  560. {$endif ATTOP}
  561. ops:=2;
  562. operands[2].opr.typ:=OPR_REGISTER;
  563. operands[2].opr.reg:=R_ST;
  564. end;
  565. { I tried to convince Linus Torwald to add
  566. code to support ENTER instruction
  567. (when raising a stack page fault)
  568. but he replied that ENTER is a bad instruction and
  569. Linux does not need to support it
  570. So I think its at least a good idea to add a warning
  571. if someone uses this in assembler code
  572. FPC itself does not use it at all PM }
  573. if (opcode=A_ENTER) and ((target_info.target=target_i386_linux) or
  574. (target_info.target=target_i386_FreeBSD)) then
  575. begin
  576. message(asmr_w_enter_not_supported_by_linux);
  577. end;
  578. ai:=taicpu.op_none(opcode,siz);
  579. ai.Ops:=Ops;
  580. for i:=1to Ops do
  581. begin
  582. case operands[i].opr.typ of
  583. OPR_CONSTANT :
  584. ai.loadconst(i-1,operands[i].opr.val);
  585. OPR_REGISTER:
  586. ai.loadreg(i-1,operands[i].opr.reg);
  587. OPR_SYMBOL:
  588. ai.loadsymbol(i-1,operands[i].opr.symbol,operands[i].opr.symofs);
  589. OPR_REFERENCE:
  590. begin
  591. ai.loadref(i-1,newreference(operands[i].opr.ref));
  592. if operands[i].size<>S_NO then
  593. begin
  594. asize:=0;
  595. case operands[i].size of
  596. S_B :
  597. asize:=OT_BITS8;
  598. S_W, S_IS :
  599. asize:=OT_BITS16;
  600. S_L, S_IL, S_FS:
  601. asize:=OT_BITS32;
  602. S_Q, S_D, S_FL, S_FV :
  603. asize:=OT_BITS64;
  604. S_FX :
  605. asize:=OT_BITS80;
  606. end;
  607. if asize<>0 then
  608. ai.oper[i-1].ot:=(ai.oper[i-1].ot and not OT_SIZE_MASK) or asize;
  609. end;
  610. end;
  611. end;
  612. end;
  613. if (opcode=A_CALL) and (opsize=S_FAR) then
  614. opcode:=A_LCALL;
  615. if (opcode=A_JMP) and (opsize=S_FAR) then
  616. opcode:=A_LJMP;
  617. if (opcode=A_LCALL) or (opcode=A_LJMP) then
  618. opsize:=S_FAR;
  619. { Condition ? }
  620. if condition<>C_None then
  621. ai.SetCondition(condition);
  622. { Concat the opcode or give an error }
  623. if assigned(ai) then
  624. begin
  625. { Check the instruction if it's valid }
  626. {$ifndef NOAG386BIN}
  627. ai.CheckIfValid;
  628. {$endif NOAG386BIN}
  629. p.concat(ai);
  630. end
  631. else
  632. Message(asmr_e_invalid_opcode_and_operand);
  633. end;
  634. end.
  635. {
  636. $Log$
  637. Revision 1.13 2001-11-02 22:58:11 peter
  638. * procsym definition rewrite
  639. Revision 1.12 2001/08/26 13:37:01 florian
  640. * some cg reorganisation
  641. * some PPC updates
  642. Revision 1.11 2001/08/07 18:47:14 peter
  643. * merged netbsd start
  644. * profile for win32
  645. Revision 1.10 2001/08/06 21:40:50 peter
  646. * funcret moved from tprocinfo to tprocdef
  647. Revision 1.9 2001/04/13 01:22:19 peter
  648. * symtable change to classes
  649. * range check generation and errors fixed, make cycle DEBUG=1 works
  650. * memory leaks fixed
  651. Revision 1.8 2001/04/05 21:33:45 peter
  652. * movd and opsize fix merged
  653. Revision 1.7 2001/03/05 21:49:44 peter
  654. * noag386bin fix
  655. Revision 1.6 2001/02/20 21:51:36 peter
  656. * fpu fixes (merged)
  657. Revision 1.5 2001/01/12 19:18:42 peter
  658. * check for valid asm instructions
  659. Revision 1.4 2000/12/25 00:07:34 peter
  660. + new tlinkedlist class (merge of old tstringqueue,tcontainer and
  661. tlinkedlist objects)
  662. Revision 1.3 2000/11/29 00:30:50 florian
  663. * unused units removed from uses clause
  664. * some changes for widestrings
  665. Revision 1.2 2000/10/31 22:30:14 peter
  666. * merged asm result patch part 2
  667. Revision 1.1 2000/10/15 09:47:43 peter
  668. * moved to i386/
  669. Revision 1.7 2000/10/08 10:26:33 peter
  670. * merged @result fix from Pierre
  671. Revision 1.6 2000/09/24 21:33:47 peter
  672. * message updates merges
  673. Revision 1.5 2000/09/24 15:06:25 peter
  674. * use defines.inc
  675. Revision 1.4 2000/09/16 12:22:52 peter
  676. * freebsd support merged
  677. Revision 1.3 2000/09/03 11:44:00 peter
  678. * error for not specified operand size, which is now required for
  679. newer binutils (merged)
  680. * previous commit fix for tcflw (merged)
  681. Revision 1.2 2000/07/13 11:32:47 michael
  682. + removed logs
  683. }