parser.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. This unit does the parsing process
  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 parser;
  19. {$i fpcdefs.inc}
  20. interface
  21. {$ifdef PREPROCWRITE}
  22. procedure preprocess(const filename:string);
  23. {$endif PREPROCWRITE}
  24. procedure compile(const filename:string);
  25. procedure initparser;
  26. procedure doneparser;
  27. implementation
  28. uses
  29. cutils,cclasses,
  30. globtype,version,tokens,systems,globals,verbose,
  31. symbase,symtable,symdef,symsym,
  32. fmodule,fppu,
  33. aasmbase,aasmtai,
  34. cgbase,
  35. script,gendef,
  36. {$ifdef BrowserLog}
  37. browlog,
  38. {$endif BrowserLog}
  39. {$ifdef UseExcept}
  40. tpexcept,
  41. {$endif UseExcept}
  42. {$ifdef GDB}
  43. gdb,
  44. {$endif GDB}
  45. comphook,
  46. scanner,scandir,
  47. pbase,ptype,psystem,pmodules,cresstr,cpuinfo;
  48. procedure initparser;
  49. begin
  50. { ^M means a string or a char, because we don't parse a }
  51. { type declaration }
  52. ignore_equal:=false;
  53. { we didn't parse a object or class declaration }
  54. { and no function header }
  55. testcurobject:=0;
  56. { Symtable }
  57. aktprocsym:=nil;
  58. aktprocdef:=nil;
  59. objectlibrary:=nil;
  60. current_module:=nil;
  61. compiled_module:=nil;
  62. procinfo:=nil;
  63. loaded_units:=TLinkedList.Create;
  64. usedunits:=TLinkedList.Create;
  65. { global switches }
  66. aktglobalswitches:=initglobalswitches;
  67. aktsourcecodepage:=initsourcecodepage;
  68. { initialize scanner }
  69. InitScanner;
  70. InitScannerDirectives;
  71. { scanner }
  72. c:=#0;
  73. pattern:='';
  74. orgpattern:='';
  75. current_scanner:=nil;
  76. { register all nodes and tais }
  77. registernodes;
  78. registertais;
  79. { memory sizes }
  80. if heapsize=0 then
  81. heapsize:=target_info.heapsize;
  82. if stacksize=0 then
  83. stacksize:=target_info.stacksize;
  84. { open assembler response }
  85. GenerateAsmRes(outputexedir+'ppas');
  86. { open deffile }
  87. DefFile:=TDefFile.Create(outputexedir+inputfile+target_info.defext);
  88. { list of generated .o files, so the linker can remove them }
  89. SmartLinkOFiles:=TStringList.Create;
  90. end;
  91. procedure doneparser;
  92. begin
  93. { unload units }
  94. loaded_units.free;
  95. usedunits.free;
  96. { if there was an error in the scanner, the scanner is
  97. still assinged }
  98. if assigned(current_scanner) then
  99. begin
  100. current_scanner.free;
  101. current_scanner:=nil;
  102. end;
  103. { close scanner }
  104. DoneScanner;
  105. { close ppas,deffile }
  106. asmres.free;
  107. deffile.free;
  108. { free list of .o files }
  109. SmartLinkOFiles.Free;
  110. end;
  111. procedure default_macros;
  112. var
  113. hp : tstringlistitem;
  114. begin
  115. { commandline }
  116. hp:=tstringlistitem(initdefines.first);
  117. while assigned(hp) do
  118. begin
  119. current_scanner.def_macro(hp.str);
  120. hp:=tstringlistitem(hp.next);
  121. end;
  122. { set macros for version checking }
  123. current_scanner.set_macro('FPC_VERSION',version_nr);
  124. current_scanner.set_macro('FPC_RELEASE',release_nr);
  125. current_scanner.set_macro('FPC_PATCH',patch_nr);
  126. end;
  127. {$ifdef PREPROCWRITE}
  128. procedure preprocess(const filename:string);
  129. var
  130. i : longint;
  131. begin
  132. new(preprocfile,init('pre'));
  133. { default macros }
  134. current_scanner^.macros:=new(pdictionary,init);
  135. default_macros;
  136. { initialize a module }
  137. current_module:=new(pmodule,init(filename,false));
  138. main_module:=current_module;
  139. { startup scanner, and save in current_module }
  140. current_scanner:=new(pscannerfile,Init(filename));
  141. current_module.scanner:=current_scanner;
  142. { loop until EOF is found }
  143. repeat
  144. current_scanner^.readtoken;
  145. preprocfile^.AddSpace;
  146. case token of
  147. _ID :
  148. begin
  149. preprocfile^.Add(orgpattern);
  150. end;
  151. _REALNUMBER,
  152. _INTCONST :
  153. preprocfile^.Add(pattern);
  154. _CSTRING :
  155. begin
  156. i:=0;
  157. while (i<length(pattern)) do
  158. begin
  159. inc(i);
  160. if pattern[i]='''' then
  161. begin
  162. insert('''',pattern,i);
  163. inc(i);
  164. end;
  165. end;
  166. preprocfile^.Add(''''+pattern+'''');
  167. end;
  168. _CCHAR :
  169. begin
  170. case pattern[1] of
  171. #39 :
  172. pattern:='''''''';
  173. #0..#31,
  174. #128..#255 :
  175. begin
  176. str(ord(pattern[1]),pattern);
  177. pattern:='#'+pattern;
  178. end;
  179. else
  180. pattern:=''''+pattern[1]+'''';
  181. end;
  182. preprocfile^.Add(pattern);
  183. end;
  184. _EOF :
  185. break;
  186. else
  187. preprocfile^.Add(tokeninfo^[token].str)
  188. end;
  189. until false;
  190. { free scanner }
  191. dispose(current_scanner,done);
  192. current_scanner:=nil;
  193. { close }
  194. dispose(preprocfile,done);
  195. end;
  196. {$endif PREPROCWRITE}
  197. procedure compile(const filename:string);
  198. var
  199. { scanner }
  200. oldidtoken,
  201. oldtoken : ttoken;
  202. oldtokenpos : tfileposinfo;
  203. oldc : char;
  204. oldpattern,
  205. oldorgpattern : string;
  206. old_block_type : tblock_type;
  207. { symtable }
  208. oldrefsymtable,
  209. olddefaultsymtablestack,
  210. oldsymtablestack : tsymtable;
  211. oldaktprocsym : tprocsym;
  212. oldaktprocdef : tprocdef;
  213. oldoverloaded_operators : toverloaded_operators;
  214. { cg }
  215. oldparse_only : boolean;
  216. { asmlists }
  217. oldimports,
  218. oldexports,
  219. oldresource,
  220. oldrttilist,
  221. oldresourcestringlist,
  222. oldbsssegment,
  223. olddatasegment,
  224. oldcodesegment,
  225. oldexprasmlist,
  226. olddebuglist,
  227. oldwithdebuglist,
  228. oldconsts : taasmoutput;
  229. oldobjectlibrary : tasmlibrarydata;
  230. { resourcestrings }
  231. OldResourceStrings : tResourceStrings;
  232. { akt.. things }
  233. oldaktlocalswitches : tlocalswitches;
  234. oldaktmoduleswitches : tmoduleswitches;
  235. oldaktfilepos : tfileposinfo;
  236. oldaktpackenum,oldaktmaxfpuregisters : longint;
  237. oldaktalignment : talignmentinfo;
  238. oldaktoutputformat : tasm;
  239. oldaktspecificoptprocessor,
  240. oldaktoptprocessor : tprocessors;
  241. oldaktasmmode : tasmmode;
  242. oldaktinterfacetype: tinterfacetypes;
  243. oldaktmodeswitches : tmodeswitches;
  244. old_compiled_module : tmodule;
  245. oldaktdefproccall : tproccalloption;
  246. oldsourcecodepage : tcodepagestring;
  247. { will only be increased once we start parsing blocks in the }
  248. { implementation, so doesn't need to be saved/restored (JM) }
  249. { oldexceptblockcounter : integer; }
  250. oldstatement_level : integer;
  251. {$ifdef USEEXCEPT}
  252. {$ifndef Delphi}
  253. recoverpos : jmp_buf;
  254. oldrecoverpos : pjmp_buf;
  255. {$endif Delphi}
  256. {$endif useexcept}
  257. {$ifdef GDB}
  258. store_dbx : plongint;
  259. {$endif GDB}
  260. begin
  261. inc(compile_level);
  262. parser_current_file:=filename;
  263. old_compiled_module:=compiled_module;
  264. { save symtable state }
  265. oldsymtablestack:=symtablestack;
  266. olddefaultsymtablestack:=defaultsymtablestack;
  267. oldrefsymtable:=refsymtable;
  268. oldaktprocsym:=aktprocsym;
  269. oldaktprocdef:=aktprocdef;
  270. oldaktdefproccall:=aktdefproccall;
  271. move(overloaded_operators,oldoverloaded_operators,sizeof(toverloaded_operators));
  272. { save scanner state }
  273. oldc:=c;
  274. oldpattern:=pattern;
  275. oldorgpattern:=orgpattern;
  276. oldtoken:=token;
  277. oldidtoken:=idtoken;
  278. old_block_type:=block_type;
  279. oldtokenpos:=akttokenpos;
  280. oldsourcecodepage:=aktsourcecodepage;
  281. { save cg }
  282. oldparse_only:=parse_only;
  283. { save assembler lists }
  284. olddatasegment:=datasegment;
  285. oldbsssegment:=bsssegment;
  286. oldcodesegment:=codesegment;
  287. olddebuglist:=debuglist;
  288. oldwithdebuglist:=withdebuglist;
  289. oldconsts:=consts;
  290. oldrttilist:=rttilist;
  291. oldexprasmlist:=exprasmlist;
  292. oldimports:=importssection;
  293. oldexports:=exportssection;
  294. oldresource:=resourcesection;
  295. oldresourcestringlist:=resourcestringlist;
  296. oldobjectlibrary:=objectlibrary;
  297. OldResourceStrings:=ResourceStrings;
  298. { save akt... state }
  299. { handle the postponed case first }
  300. if localswitcheschanged then
  301. begin
  302. aktlocalswitches:=nextaktlocalswitches;
  303. localswitcheschanged:=false;
  304. end;
  305. oldaktlocalswitches:=aktlocalswitches;
  306. oldaktmoduleswitches:=aktmoduleswitches;
  307. oldaktalignment:=aktalignment;
  308. oldaktpackenum:=aktpackenum;
  309. oldaktmaxfpuregisters:=aktmaxfpuregisters;
  310. oldaktoutputformat:=aktoutputformat;
  311. oldaktoptprocessor:=aktoptprocessor;
  312. oldaktspecificoptprocessor:=aktspecificoptprocessor;
  313. oldaktasmmode:=aktasmmode;
  314. oldaktinterfacetype:=aktinterfacetype;
  315. oldaktfilepos:=aktfilepos;
  316. oldaktmodeswitches:=aktmodeswitches;
  317. oldstatement_level:=statement_level;
  318. { oldexceptblockcounter:=exceptblockcounter; }
  319. {$ifdef GDB}
  320. store_dbx:=dbx_counter;
  321. dbx_counter:=nil;
  322. {$endif GDB}
  323. { show info }
  324. Message1(parser_i_compiling,filename);
  325. { reset symtable }
  326. symtablestack:=nil;
  327. defaultsymtablestack:=nil;
  328. systemunit:=nil;
  329. refsymtable:=nil;
  330. aktprocsym:=nil;
  331. aktdefproccall:=initdefproccall;
  332. registerdef:=true;
  333. statement_level:=0;
  334. aktexceptblock:=0;
  335. exceptblockcounter:=0;
  336. aktmaxfpuregisters:=-1;
  337. fillchar(overloaded_operators,sizeof(toverloaded_operators),0);
  338. { reset the unit or create a new program }
  339. if assigned(current_module) then
  340. current_module.reset
  341. else
  342. begin
  343. current_module:=tppumodule.create(filename,'',false);
  344. main_module:=current_module;
  345. end;
  346. { a unit compiled at command line must be inside the loaded_unit list }
  347. if (compile_level=1) then
  348. loaded_units.insert(current_module);
  349. { Set the module to use for verbose }
  350. SetCompileModule(current_module);
  351. compiled_module:=current_module;
  352. current_module.in_compile:=true;
  353. { Load current state from the init values }
  354. aktlocalswitches:=initlocalswitches;
  355. aktmoduleswitches:=initmoduleswitches;
  356. aktmodeswitches:=initmodeswitches;
  357. {$IFDEF Testvarsets}
  358. aktsetalloc:=initsetalloc;
  359. {$ENDIF}
  360. aktalignment:=initalignment;
  361. aktpackenum:=initpackenum;
  362. aktoutputformat:=initoutputformat;
  363. set_target_asm(aktoutputformat);
  364. aktoptprocessor:=initoptprocessor;
  365. aktspecificoptprocessor:=initspecificoptprocessor;
  366. aktasmmode:=initasmmode;
  367. aktinterfacetype:=initinterfacetype;
  368. { startup scanner and load the first file }
  369. current_scanner:=tscannerfile.Create(filename);
  370. current_scanner.firstfile;
  371. current_module.scanner:=current_scanner;
  372. { macros }
  373. default_macros;
  374. { read the first token }
  375. current_scanner.readtoken;
  376. { init code generator for a new module }
  377. codegen_newmodule;
  378. { If the compile level > 1 we get a nice "unit expected" error
  379. message if we are trying to use a program as unit.}
  380. {$ifdef USEEXCEPT}
  381. if setjmp(recoverpos)=0 then
  382. begin
  383. oldrecoverpos:=recoverpospointer;
  384. recoverpospointer:=@recoverpos;
  385. {$endif USEEXCEPT}
  386. if (token=_UNIT) or (compile_level>1) then
  387. begin
  388. current_module.is_unit:=true;
  389. proc_unit;
  390. end
  391. else
  392. proc_program(token=_LIBRARY);
  393. {$ifdef USEEXCEPT}
  394. recoverpospointer:=oldrecoverpos;
  395. end
  396. else
  397. begin
  398. recoverpospointer:=oldrecoverpos;
  399. longjump_used:=true;
  400. end;
  401. {$endif USEEXCEPT}
  402. { clear memory }
  403. {$ifdef Splitheap}
  404. if testsplit then
  405. begin
  406. { temp heap should be empty after that !!!}
  407. codegen_donemodule;
  408. Releasetempheap;
  409. end;
  410. {$endif Splitheap}
  411. { restore old state, close trees, > 0.99.5 has heapblocks, so
  412. it's the default to release the trees }
  413. codegen_donemodule;
  414. { free ppu }
  415. if assigned(tppumodule(current_module).ppufile) then
  416. begin
  417. tppumodule(current_module).ppufile.free;
  418. tppumodule(current_module).ppufile:=nil;
  419. end;
  420. { free scanner }
  421. if assigned(current_module.scanner) then
  422. begin
  423. if current_scanner=tscannerfile(current_module.scanner) then
  424. current_scanner:=nil;
  425. tscannerfile(current_module.scanner).free;
  426. current_module.scanner:=nil;
  427. end;
  428. if (compile_level>1) then
  429. begin
  430. {$ifdef GDB}
  431. dbx_counter:=store_dbx;
  432. {$endif GDB}
  433. { restore scanner }
  434. c:=oldc;
  435. pattern:=oldpattern;
  436. orgpattern:=oldorgpattern;
  437. token:=oldtoken;
  438. idtoken:=oldidtoken;
  439. akttokenpos:=oldtokenpos;
  440. block_type:=old_block_type;
  441. { restore cg }
  442. parse_only:=oldparse_only;
  443. { restore asmlists }
  444. exprasmlist:=oldexprasmlist;
  445. datasegment:=olddatasegment;
  446. bsssegment:=oldbsssegment;
  447. codesegment:=oldcodesegment;
  448. consts:=oldconsts;
  449. debuglist:=olddebuglist;
  450. withdebuglist:=oldwithdebuglist;
  451. importssection:=oldimports;
  452. exportssection:=oldexports;
  453. resourcesection:=oldresource;
  454. rttilist:=oldrttilist;
  455. resourcestringlist:=oldresourcestringlist;
  456. { object data }
  457. ResourceStrings:=OldResourceStrings;
  458. objectlibrary:=oldobjectlibrary;
  459. { restore previous scanner }
  460. current_scanner:=tscannerfile(old_compiled_module.scanner);
  461. if assigned(current_scanner) then
  462. parser_current_file:=current_scanner.inputfile.name^;
  463. { restore symtable state }
  464. refsymtable:=oldrefsymtable;
  465. symtablestack:=oldsymtablestack;
  466. defaultsymtablestack:=olddefaultsymtablestack;
  467. aktdefproccall:=oldaktdefproccall;
  468. aktprocsym:=oldaktprocsym;
  469. aktprocdef:=oldaktprocdef;
  470. move(oldoverloaded_operators,overloaded_operators,sizeof(toverloaded_operators));
  471. aktsourcecodepage:=oldsourcecodepage;
  472. aktlocalswitches:=oldaktlocalswitches;
  473. aktmoduleswitches:=oldaktmoduleswitches;
  474. aktalignment:=oldaktalignment;
  475. aktpackenum:=oldaktpackenum;
  476. aktmaxfpuregisters:=oldaktmaxfpuregisters;
  477. aktoutputformat:=oldaktoutputformat;
  478. set_target_asm(aktoutputformat);
  479. aktoptprocessor:=oldaktoptprocessor;
  480. aktspecificoptprocessor:=oldaktspecificoptprocessor;
  481. aktasmmode:=oldaktasmmode;
  482. aktinterfacetype:=oldaktinterfacetype;
  483. aktfilepos:=oldaktfilepos;
  484. aktmodeswitches:=oldaktmodeswitches;
  485. statement_level:=oldstatement_level;
  486. aktexceptblock:=0;
  487. exceptblockcounter:=0;
  488. end
  489. else
  490. begin
  491. parser_current_file:='';
  492. end;
  493. { Shut down things when the last file is compiled }
  494. if (compile_level=1) then
  495. begin
  496. { Close script }
  497. if (not AsmRes.Empty) then
  498. begin
  499. Message1(exec_i_closing_script,AsmRes.Fn);
  500. AsmRes.WriteToDisk;
  501. end;
  502. {$ifdef USEEXCEPT}
  503. if not longjump_used then
  504. {$endif USEEXCEPT}
  505. { do not create browsers on errors !! }
  506. if status.errorcount=0 then
  507. begin
  508. {$ifdef BrowserLog}
  509. { Write Browser Log }
  510. if (cs_browser_log in aktglobalswitches) and
  511. (cs_browser in aktmoduleswitches) then
  512. begin
  513. if browserlog.elements_to_list.empty then
  514. begin
  515. Message1(parser_i_writing_browser_log,browserlog.Fname);
  516. WriteBrowserLog;
  517. end
  518. else
  519. browserlog.list_elements;
  520. end;
  521. {$endif BrowserLog}
  522. { Write Browser Collections }
  523. do_extractsymbolinfo{$ifdef FPC}(){$endif};
  524. end;
  525. if current_module.in_second_compile then
  526. begin
  527. current_module.in_second_compile:=false;
  528. current_module.in_compile:=true;
  529. end
  530. else
  531. current_module.in_compile:=false;
  532. end;
  533. dec(compile_level);
  534. compiled_module:=old_compiled_module;
  535. {$ifdef USEEXCEPT}
  536. if longjump_used then
  537. longjmp(recoverpospointer^,1);
  538. {$endif USEEXCEPT}
  539. end;
  540. end.
  541. {
  542. $Log$
  543. Revision 1.43 2002-08-18 19:58:28 peter
  544. * more current_scanner fixes
  545. Revision 1.42 2002/08/16 15:31:08 peter
  546. * fixed possible crashes with current_scanner
  547. Revision 1.41 2002/08/15 19:10:35 peter
  548. * first things tai,tnode storing in ppu
  549. Revision 1.40 2002/08/12 16:46:04 peter
  550. * tscannerfile is now destroyed in tmodule.reset and current_scanner
  551. is updated accordingly. This removes all the loading and saving of
  552. the old scanner and the invalid flag marking
  553. Revision 1.39 2002/08/12 15:08:40 carl
  554. + stab register indexes for powerpc (moved from gdb to cpubase)
  555. + tprocessor enumeration moved to cpuinfo
  556. + linker in target_info is now a class
  557. * many many updates for m68k (will soon start to compile)
  558. - removed some ifdef or correct them for correct cpu
  559. Revision 1.38 2002/08/11 14:28:19 peter
  560. * TScannerFile.SetInvalid added that will also reset inputfile
  561. Revision 1.37 2002/08/11 13:24:12 peter
  562. * saving of asmsymbols in ppu supported
  563. * asmsymbollist global is removed and moved into a new class
  564. tasmlibrarydata that will hold the info of a .a file which
  565. corresponds with a single module. Added librarydata to tmodule
  566. to keep the library info stored for the module. In the future the
  567. objectfiles will also be stored to the tasmlibrarydata class
  568. * all getlabel/newasmsymbol and friends are moved to the new class
  569. Revision 1.36 2002/08/09 19:15:41 carl
  570. - removed newcg define
  571. Revision 1.35 2002/07/20 17:16:03 florian
  572. + source code page support
  573. Revision 1.34 2002/07/01 18:46:24 peter
  574. * internal linker
  575. * reorganized aasm layer
  576. Revision 1.33 2002/05/18 13:34:11 peter
  577. * readded missing revisions
  578. Revision 1.32 2002/05/16 19:46:42 carl
  579. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  580. + try to fix temp allocation (still in ifdef)
  581. + generic constructor calls
  582. + start of tassembler / tmodulebase class cleanup
  583. Revision 1.30 2002/04/21 18:57:23 peter
  584. * fixed memleaks when file can't be opened
  585. Revision 1.29 2002/04/20 21:32:24 carl
  586. + generic FPC_CHECKPOINTER
  587. + first parameter offset in stack now portable
  588. * rename some constants
  589. + move some cpu stuff to other units
  590. - remove unused constents
  591. * fix stacksize for some targets
  592. * fix generic size problems which depend now on EXTEND_SIZE constant
  593. Revision 1.28 2002/04/19 15:46:02 peter
  594. * mangledname rewrite, tprocdef.mangledname is now created dynamicly
  595. in most cases and not written to the ppu
  596. * add mangeledname_prefix() routine to generate the prefix of
  597. manglednames depending on the current procedure, object and module
  598. * removed static procprefix since the mangledname is now build only
  599. on demand from tprocdef.mangledname
  600. Revision 1.27 2002/01/29 19:43:11 peter
  601. * update target_asm according to outputformat
  602. }