2
0

raavrgas.pas 24 KB

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