raavrgas.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. {
  2. Copyright (c) 1998-2008 by Carl Eric Codere and Peter Vreman
  3. Does the parsing for the ARM GNU AS styled inline assembler.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. Unit raavrgas;
  18. {$i fpcdefs.inc}
  19. Interface
  20. uses
  21. raatt,raavr,
  22. cpubase;
  23. type
  24. tavrattreader = class(tattreader)
  25. function is_asmopcode(const s: string):boolean;override;
  26. function is_register(const s:string):boolean;override;
  27. procedure handleopcode;override;
  28. procedure BuildReference(oper : tavroperand);
  29. procedure BuildOperand(oper : tavroperand);
  30. function TryBuildShifterOp(oper : tavroperand) : boolean;
  31. procedure BuildOpCode(instr : tavrinstruction);
  32. procedure ReadSym(oper : tavroperand);
  33. procedure ConvertCalljmp(instr : tavrinstruction);
  34. end;
  35. Implementation
  36. uses
  37. { helpers }
  38. cutils,
  39. { global }
  40. globtype,globals,verbose,
  41. systems,
  42. { aasm }
  43. cpuinfo,aasmbase,aasmtai,aasmdata,aasmcpu,
  44. { symtable }
  45. symconst,symbase,symtype,symsym,symtable,
  46. { parser }
  47. scanner,
  48. procinfo,
  49. itcpugas,
  50. rabase,rautils,
  51. cgbase,cgobj
  52. ;
  53. function tavrattreader.is_register(const s:string):boolean;
  54. type
  55. treg2str = record
  56. name : string[2];
  57. reg : tregister;
  58. end;
  59. {
  60. const
  61. extraregs : array[0..19] of treg2str = (
  62. (name: 'X'; reg : NR_Z),
  63. (name: 'Y'; reg : NR_R1),
  64. (name: 'Z'; reg : NR_R2),
  65. );
  66. }
  67. var
  68. i : longint;
  69. begin
  70. result:=inherited is_register(s);
  71. { reg found?
  72. possible aliases are always 2 char
  73. }
  74. if result or (length(s)<>2) then
  75. exit;
  76. {
  77. for i:=low(extraregs) to high(extraregs) do
  78. begin
  79. if s=extraregs[i].name then
  80. begin
  81. actasmregister:=extraregs[i].reg;
  82. result:=true;
  83. actasmtoken:=AS_REGISTER;
  84. exit;
  85. end;
  86. end;
  87. }
  88. end;
  89. procedure tavrattreader.ReadSym(oper : tavroperand);
  90. var
  91. tempstr, mangledname : string;
  92. typesize,l,k : longint;
  93. begin
  94. tempstr:=actasmpattern;
  95. Consume(AS_ID);
  96. { typecasting? }
  97. if (actasmtoken=AS_LPAREN) and
  98. SearchType(tempstr,typesize) then
  99. begin
  100. oper.hastype:=true;
  101. Consume(AS_LPAREN);
  102. BuildOperand(oper);
  103. Consume(AS_RPAREN);
  104. if oper.opr.typ in [OPR_REFERENCE,OPR_LOCAL] then
  105. oper.SetSize(typesize,true);
  106. end
  107. else
  108. if not oper.SetupVar(tempstr,false) then
  109. Message1(sym_e_unknown_id,tempstr);
  110. { record.field ? }
  111. if actasmtoken=AS_DOT then
  112. begin
  113. BuildRecordOffsetSize(tempstr,l,k,mangledname,false);
  114. if (mangledname<>'') then
  115. Message(asmr_e_invalid_reference_syntax);
  116. inc(oper.opr.ref.offset,l);
  117. end;
  118. end;
  119. Procedure tavrattreader.BuildReference(oper : tavroperand);
  120. procedure Consume_RBracket;
  121. begin
  122. if actasmtoken<>AS_RBRACKET then
  123. Begin
  124. Message(asmr_e_invalid_reference_syntax);
  125. RecoverConsume(true);
  126. end
  127. else
  128. begin
  129. Consume(AS_RBRACKET);
  130. if not (actasmtoken in [AS_COMMA,AS_SEPARATOR,AS_END]) then
  131. Begin
  132. Message(asmr_e_invalid_reference_syntax);
  133. RecoverConsume(true);
  134. end;
  135. end;
  136. end;
  137. procedure read_index;
  138. begin
  139. Consume(AS_COMMA);
  140. if actasmtoken=AS_REGISTER then
  141. Begin
  142. oper.opr.ref.index:=actasmregister;
  143. Consume(AS_REGISTER);
  144. end
  145. else if actasmtoken=AS_HASH then
  146. begin
  147. Consume(AS_HASH);
  148. inc(oper.opr.ref.offset,BuildConstExpression(false,true));
  149. end;
  150. end;
  151. begin
  152. Consume(AS_LBRACKET);
  153. if actasmtoken=AS_REGISTER then
  154. begin
  155. oper.opr.ref.base:=actasmregister;
  156. Consume(AS_REGISTER);
  157. { can either be a register or a right parenthesis }
  158. { (reg) }
  159. if actasmtoken=AS_RBRACKET then
  160. Begin
  161. Consume_RBracket;
  162. oper.opr.ref.addressmode:=AM_POSTINDEXED;
  163. if actasmtoken=AS_COMMA then
  164. read_index;
  165. exit;
  166. end;
  167. if actasmtoken=AS_COMMA then
  168. begin
  169. read_index;
  170. Consume_RBracket;
  171. end;
  172. if actasmtoken=AS_NOT then
  173. begin
  174. consume(AS_NOT);
  175. oper.opr.ref.addressmode:=AM_PREINDEXED;
  176. end;
  177. end {end case }
  178. else
  179. Begin
  180. Message(asmr_e_invalid_reference_syntax);
  181. RecoverConsume(false);
  182. end;
  183. end;
  184. Procedure tavrattreader.BuildOperand(oper : tavroperand);
  185. var
  186. expr : string;
  187. typesize,l : longint;
  188. procedure AddLabelOperand(hl:tasmlabel);
  189. begin
  190. if not(actasmtoken in [AS_PLUS,AS_MINUS,AS_LPAREN]) and
  191. is_calljmp(actopcode) then
  192. begin
  193. oper.opr.typ:=OPR_SYMBOL;
  194. oper.opr.symbol:=hl;
  195. end
  196. else
  197. begin
  198. oper.InitRef;
  199. oper.opr.ref.symbol:=hl;
  200. end;
  201. end;
  202. procedure MaybeRecordOffset;
  203. var
  204. mangledname: string;
  205. hasdot : boolean;
  206. l,
  207. toffset,
  208. tsize : longint;
  209. begin
  210. if not(actasmtoken in [AS_DOT,AS_PLUS,AS_MINUS]) then
  211. exit;
  212. l:=0;
  213. hasdot:=(actasmtoken=AS_DOT);
  214. if hasdot then
  215. begin
  216. if expr<>'' then
  217. begin
  218. BuildRecordOffsetSize(expr,toffset,tsize,mangledname,false);
  219. if (oper.opr.typ<>OPR_CONSTANT) and
  220. (mangledname<>'') then
  221. Message(asmr_e_wrong_sym_type);
  222. inc(l,toffset);
  223. oper.SetSize(tsize,true);
  224. end;
  225. end;
  226. if actasmtoken in [AS_PLUS,AS_MINUS] then
  227. inc(l,BuildConstExpression(true,false));
  228. case oper.opr.typ of
  229. OPR_LOCAL :
  230. begin
  231. { don't allow direct access to fields of parameters, because that
  232. will generate buggy code. Allow it only for explicit typecasting }
  233. if hasdot and
  234. (not oper.hastype) and
  235. (tabstractnormalvarsym(oper.opr.localsym).owner.symtabletype=parasymtable) and
  236. (current_procinfo.procdef.proccalloption<>pocall_register) then
  237. Message(asmr_e_cannot_access_field_directly_for_parameters);
  238. inc(oper.opr.localsymofs,l)
  239. end;
  240. OPR_CONSTANT :
  241. inc(oper.opr.val,l);
  242. OPR_REFERENCE :
  243. if (mangledname<>'') then
  244. begin
  245. if (oper.opr.val<>0) then
  246. Message(asmr_e_wrong_sym_type);
  247. oper.opr.typ:=OPR_SYMBOL;
  248. oper.opr.symbol:=current_asmdata.RefAsmSymbol(mangledname);
  249. end
  250. else
  251. inc(oper.opr.val,l);
  252. OPR_SYMBOL:
  253. Message(asmr_e_invalid_symbol_ref);
  254. else
  255. internalerror(200309221);
  256. end;
  257. end;
  258. function MaybeBuildReference:boolean;
  259. { Try to create a reference, if not a reference is found then false
  260. is returned }
  261. begin
  262. MaybeBuildReference:=true;
  263. case actasmtoken of
  264. AS_INTNUM,
  265. AS_MINUS,
  266. AS_PLUS:
  267. Begin
  268. oper.opr.ref.offset:=BuildConstExpression(True,False);
  269. if actasmtoken<>AS_LPAREN then
  270. Message(asmr_e_invalid_reference_syntax)
  271. else
  272. BuildReference(oper);
  273. end;
  274. AS_LPAREN:
  275. BuildReference(oper);
  276. AS_ID: { only a variable is allowed ... }
  277. Begin
  278. ReadSym(oper);
  279. case actasmtoken of
  280. AS_END,
  281. AS_SEPARATOR,
  282. AS_COMMA: ;
  283. AS_LPAREN:
  284. BuildReference(oper);
  285. else
  286. Begin
  287. Message(asmr_e_invalid_reference_syntax);
  288. Consume(actasmtoken);
  289. end;
  290. end; {end case }
  291. end;
  292. else
  293. MaybeBuildReference:=false;
  294. end; { end case }
  295. end;
  296. var
  297. tempreg : tregister;
  298. ireg : tsuperregister;
  299. hl : tasmlabel;
  300. ofs : longint;
  301. registerset : tcpuregisterset;
  302. Begin
  303. expr:='';
  304. case actasmtoken of
  305. AS_LBRACKET: { Memory reference or constant expression }
  306. Begin
  307. oper.InitRef;
  308. BuildReference(oper);
  309. end;
  310. AS_HASH: { Constant expression }
  311. Begin
  312. Consume(AS_HASH);
  313. BuildConstantOperand(oper);
  314. end;
  315. (*
  316. AS_INTNUM,
  317. AS_MINUS,
  318. AS_PLUS:
  319. Begin
  320. { Constant memory offset }
  321. { This must absolutely be followed by ( }
  322. oper.InitRef;
  323. oper.opr.ref.offset:=BuildConstExpression(True,False);
  324. if actasmtoken<>AS_LPAREN then
  325. begin
  326. ofs:=oper.opr.ref.offset;
  327. BuildConstantOperand(oper);
  328. inc(oper.opr.val,ofs);
  329. end
  330. else
  331. BuildReference(oper);
  332. end;
  333. *)
  334. AS_ID: { A constant expression, or a Variable ref. }
  335. Begin
  336. { Local Label ? }
  337. if is_locallabel(actasmpattern) then
  338. begin
  339. CreateLocalLabel(actasmpattern,hl,false);
  340. Consume(AS_ID);
  341. AddLabelOperand(hl);
  342. end
  343. else
  344. { Check for label }
  345. if SearchLabel(actasmpattern,hl,false) then
  346. begin
  347. Consume(AS_ID);
  348. AddLabelOperand(hl);
  349. end
  350. else
  351. { probably a variable or normal expression }
  352. { or a procedure (such as in CALL ID) }
  353. Begin
  354. { is it a constant ? }
  355. if SearchIConstant(actasmpattern,l) then
  356. Begin
  357. if not (oper.opr.typ in [OPR_NONE,OPR_CONSTANT]) then
  358. Message(asmr_e_invalid_operand_type);
  359. BuildConstantOperand(oper);
  360. end
  361. else
  362. begin
  363. expr:=actasmpattern;
  364. Consume(AS_ID);
  365. { typecasting? }
  366. if (actasmtoken=AS_LPAREN) and
  367. SearchType(expr,typesize) then
  368. begin
  369. oper.hastype:=true;
  370. Consume(AS_LPAREN);
  371. BuildOperand(oper);
  372. Consume(AS_RPAREN);
  373. if oper.opr.typ in [OPR_REFERENCE,OPR_LOCAL] then
  374. oper.SetSize(typesize,true);
  375. end
  376. else
  377. begin
  378. if not(oper.SetupVar(expr,false)) then
  379. Begin
  380. { look for special symbols ... }
  381. if expr= '__HIGH' then
  382. begin
  383. consume(AS_LPAREN);
  384. if not oper.setupvar('high'+actasmpattern,false) then
  385. Message1(sym_e_unknown_id,'high'+actasmpattern);
  386. consume(AS_ID);
  387. consume(AS_RPAREN);
  388. end
  389. else
  390. if expr = '__RESULT' then
  391. oper.SetUpResult
  392. else
  393. if expr = '__SELF' then
  394. oper.SetupSelf
  395. else
  396. if expr = '__OLDEBP' then
  397. oper.SetupOldEBP
  398. else
  399. Message1(sym_e_unknown_id,expr);
  400. end;
  401. end;
  402. end;
  403. if actasmtoken=AS_DOT then
  404. MaybeRecordOffset;
  405. { add a constant expression? }
  406. if (actasmtoken=AS_PLUS) then
  407. begin
  408. l:=BuildConstExpression(true,false);
  409. case oper.opr.typ of
  410. OPR_CONSTANT :
  411. inc(oper.opr.val,l);
  412. OPR_LOCAL :
  413. inc(oper.opr.localsymofs,l);
  414. OPR_REFERENCE :
  415. inc(oper.opr.ref.offset,l);
  416. else
  417. internalerror(200309202);
  418. end;
  419. end
  420. end;
  421. { Do we have a indexing reference, then parse it also }
  422. if actasmtoken=AS_LPAREN then
  423. BuildReference(oper);
  424. end;
  425. { Register, a variable reference or a constant reference }
  426. AS_REGISTER:
  427. Begin
  428. { save the type of register used. }
  429. tempreg:=actasmregister;
  430. Consume(AS_REGISTER);
  431. if (actasmtoken in [AS_END,AS_SEPARATOR,AS_COMMA]) then
  432. Begin
  433. if not (oper.opr.typ in [OPR_NONE,OPR_REGISTER]) then
  434. Message(asmr_e_invalid_operand_type);
  435. oper.opr.typ:=OPR_REGISTER;
  436. oper.opr.reg:=tempreg;
  437. end
  438. else if (actasmtoken=AS_NOT) and (actopcode in [A_LDM,A_STM]) then
  439. begin
  440. consume(AS_NOT);
  441. oper.opr.typ:=OPR_REFERENCE;
  442. oper.opr.ref.addressmode:=AM_PREINDEXED;
  443. oper.opr.ref.index:=tempreg;
  444. end
  445. else
  446. Message(asmr_e_syn_operand);
  447. end;
  448. { Registerset }
  449. AS_LSBRACKET:
  450. begin
  451. consume(AS_LSBRACKET);
  452. registerset:=[];
  453. while true do
  454. begin
  455. if actasmtoken=AS_REGISTER then
  456. begin
  457. include(registerset,getsupreg(actasmregister));
  458. tempreg:=actasmregister;
  459. consume(AS_REGISTER);
  460. if actasmtoken=AS_MINUS then
  461. begin
  462. consume(AS_MINUS);
  463. for ireg:=getsupreg(tempreg) to getsupreg(actasmregister) do
  464. include(registerset,ireg);
  465. consume(AS_REGISTER);
  466. end;
  467. end
  468. else
  469. consume(AS_REGISTER);
  470. if actasmtoken=AS_COMMA then
  471. consume(AS_COMMA)
  472. else
  473. break;
  474. end;
  475. consume(AS_RSBRACKET);
  476. oper.opr.typ:=OPR_REGSET;
  477. oper.opr.regset:=registerset;
  478. end;
  479. AS_END,
  480. AS_SEPARATOR,
  481. AS_COMMA: ;
  482. else
  483. Begin
  484. Message(asmr_e_syn_operand);
  485. Consume(actasmtoken);
  486. end;
  487. end; { end case }
  488. end;
  489. {*****************************************************************************
  490. tavrattreader
  491. *****************************************************************************}
  492. procedure tavrattreader.BuildOpCode(instr : tavrinstruction);
  493. var
  494. operandnum : longint;
  495. Begin
  496. { opcode }
  497. if (actasmtoken<>AS_OPCODE) then
  498. Begin
  499. Message(asmr_e_invalid_or_missing_opcode);
  500. RecoverConsume(true);
  501. exit;
  502. end;
  503. { Fill the instr object with the current state }
  504. with instr do
  505. begin
  506. Opcode:=ActOpcode;
  507. condition:=ActCondition;
  508. oppostfix:=actoppostfix;
  509. end;
  510. { We are reading operands, so opcode will be an AS_ID }
  511. operandnum:=1;
  512. Consume(AS_OPCODE);
  513. { Zero operand opcode ? }
  514. if actasmtoken in [AS_SEPARATOR,AS_END] then
  515. begin
  516. operandnum:=0;
  517. exit;
  518. end;
  519. { Read the operands }
  520. repeat
  521. case actasmtoken of
  522. AS_COMMA: { Operand delimiter }
  523. Begin
  524. if ((instr.opcode=A_MOV) and (operandnum=2)) or
  525. ((operandnum=3) and not(instr.opcode in [A_UMLAL,A_UMULL,A_SMLAL,A_SMULL,A_MLA])) then
  526. begin
  527. Consume(AS_COMMA);
  528. if not(TryBuildShifterOp(instr.Operands[operandnum+1] as tavroperand)) then
  529. Message(asmr_e_illegal_shifterop_syntax);
  530. Inc(operandnum);
  531. end
  532. else
  533. begin
  534. if operandnum>Max_Operands then
  535. Message(asmr_e_too_many_operands)
  536. else
  537. Inc(operandnum);
  538. Consume(AS_COMMA);
  539. end;
  540. end;
  541. AS_SEPARATOR,
  542. AS_END : { End of asm operands for this opcode }
  543. begin
  544. break;
  545. end;
  546. else
  547. BuildOperand(instr.Operands[operandnum] as tavroperand);
  548. end; { end case }
  549. until false;
  550. instr.Ops:=operandnum;
  551. end;
  552. function tavrattreader.is_asmopcode(const s: string):boolean;
  553. const
  554. { sorted by length so longer postfixes will match first }
  555. postfix2strsorted : array[1..19] of string[2] = (
  556. 'EP','SB','BT','SH',
  557. 'IA','IB','DA','DB','FD','FA','ED','EA',
  558. 'B','D','E','P','T','H','S');
  559. postfixsorted : array[1..19] of TOpPostfix = (
  560. PF_EP,PF_SB,PF_BT,PF_SH,
  561. PF_IA,PF_IB,PF_DA,PF_DB,PF_FD,PF_FA,PF_ED,PF_EA,
  562. PF_B,PF_D,PF_E,PF_P,PF_T,PF_H,PF_S);
  563. var
  564. len,
  565. j,
  566. sufidx : longint;
  567. hs : string;
  568. maxlen : longint;
  569. icond : tasmcond;
  570. Begin
  571. { making s a value parameter would break other assembler readers }
  572. hs:=s;
  573. is_asmopcode:=false;
  574. { clear op code }
  575. actopcode:=A_None;
  576. actcondition:=C_None;
  577. { first, handle B else BLS is read wrong }
  578. if ((hs[1]='B') and (length(hs)=3)) then
  579. begin
  580. for icond:=low(tasmcond) to high(tasmcond) do
  581. begin
  582. if copy(hs,2,3)=uppercond2str[icond] then
  583. begin
  584. actopcode:=A_B;
  585. actasmtoken:=AS_OPCODE;
  586. actcondition:=icond;
  587. is_asmopcode:=true;
  588. exit;
  589. end;
  590. end;
  591. end;
  592. maxlen:=max(length(hs),5);
  593. actopcode:=A_NONE;
  594. for j:=maxlen downto 1 do
  595. begin
  596. actopcode:=tasmop(PtrInt(iasmops.Find(copy(hs,1,j))));
  597. if actopcode<>A_NONE then
  598. begin
  599. actasmtoken:=AS_OPCODE;
  600. { strip op code }
  601. delete(hs,1,j);
  602. break;
  603. end;
  604. end;
  605. if actopcode=A_NONE then
  606. exit;
  607. { search for condition, conditions are always 2 chars }
  608. if length(hs)>1 then
  609. begin
  610. for icond:=low(tasmcond) to high(tasmcond) do
  611. begin
  612. if copy(hs,1,2)=uppercond2str[icond] then
  613. begin
  614. actcondition:=icond;
  615. { strip condition }
  616. delete(hs,1,2);
  617. break;
  618. end;
  619. end;
  620. end;
  621. { check for postfix }
  622. if length(hs)>0 then
  623. begin
  624. for j:=low(postfixsorted) to high(postfixsorted) do
  625. begin
  626. if copy(hs,1,length(postfix2strsorted[j]))=postfix2strsorted[j] then
  627. begin
  628. actoppostfix:=postfixsorted[j];
  629. { strip postfix }
  630. delete(hs,1,length(postfix2strsorted[j]));
  631. break;
  632. end;
  633. end;
  634. end;
  635. { if we stripped all postfixes, it's a valid opcode }
  636. is_asmopcode:=length(hs)=0;
  637. end;
  638. procedure tavrattreader.ConvertCalljmp(instr : tavrinstruction);
  639. var
  640. newopr : toprrec;
  641. begin
  642. if instr.Operands[1].opr.typ=OPR_REFERENCE then
  643. begin
  644. newopr.typ:=OPR_SYMBOL;
  645. newopr.symbol:=instr.Operands[1].opr.ref.symbol;
  646. newopr.symofs:=instr.Operands[1].opr.ref.offset;
  647. if (instr.Operands[1].opr.ref.base<>NR_NO) or
  648. (instr.Operands[1].opr.ref.index<>NR_NO) then
  649. Message(asmr_e_syn_operand);
  650. instr.Operands[1].opr:=newopr;
  651. end;
  652. end;
  653. procedure tavrattreader.handleopcode;
  654. var
  655. instr : tavrinstruction;
  656. begin
  657. instr:=tavrinstruction.Create(tavroperand);
  658. BuildOpcode(instr);
  659. if is_calljmp(instr.opcode) then
  660. ConvertCalljmp(instr);
  661. {
  662. instr.AddReferenceSizes;
  663. instr.SetInstructionOpsize;
  664. instr.CheckOperandSizes;
  665. }
  666. instr.ConcatInstruction(curlist);
  667. instr.Free;
  668. actoppostfix:=PF_None;
  669. end;
  670. {*****************************************************************************
  671. Initialize
  672. *****************************************************************************}
  673. const
  674. asmmode_avr_att_info : tasmmodeinfo =
  675. (
  676. id : asmmode_avr_gas;
  677. idtxt : 'GAS';
  678. casmreader : tavrattreader;
  679. );
  680. asmmode_avr_standard_info : tasmmodeinfo =
  681. (
  682. id : asmmode_standard;
  683. idtxt : 'STANDARD';
  684. casmreader : tavrattreader;
  685. );
  686. initialization
  687. RegisterAsmMode(asmmode_avr_att_info);
  688. RegisterAsmMode(asmmode_avr_standard_info);
  689. end.