raavrgas.pas 24 KB

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