raarmgas.pas 24 KB

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