----- Original Message ----- From: Andy Kunz To: Sent: Tuesday, November 12, 2002 10:30 PM Subject: Re: [PIC]: simple 16F877 long call strategy needed > Olin's right. Use C and you won't know the difference. > > Andy Actually the next version of the xcasm assembler (which is due for imminent release) will automatically generate RAM (data) and ROM (code) paging instructions if enabled. It analyses the generated code and inserts the minimum number of instructions necessary to maintain the correct pages. You could liken this to some kind of intelligent link phase except that by doing it in the assembler you actually get tight control from within the assembler which allows further optimisation. Below is an example of a short section of assembler which decides which RAM page to put a data section into. By doing this within the assembler, any macros used can take advantage of knowing where the data is located (user written macros can take advantage of fixed addresses and constants when generating code - yes the assembler can cope with variable length output from macros). The automatic paging further benefits from this feedback. Regards Sergio Masci http://www.xcprod.com ;---------------------- The following section of assembler is generated by the XCSB compiler and fed straight into the XCASM assembler. It allows the assembler to directly decide in which RAM page to place some floating point variables used by some floating point macros (yes the assembler handles floating point numbers as well). .sect prog_data2_group_base_sect .org 0xA0 .group prog_data2_group, prog_data2_group_base_sect xgroup_val .set 0 .if DEFINED("prog_data_group") xgroup_val .set GROUP_SIZE("prog_data_group") .endif .if DEFINED("code_gen_data_sect") xsect_val .set SECT_SIZE("code_gen_data_sect") .if xgroup_val + xsect_val < 0x70 .group prog_data_group, code_gen_data_sect xgroup_val .set xgroup_val+xsect_val .else .group prog_data2_group, code_gen_data_sect .endif .endif .if DEFINED("code_gen_fp_data_sect") xsect_val .set SECT_SIZE("code_gen_fp_data_sect") .if xgroup_val + xsect_val < 0x70 .group prog_data_group, code_gen_fp_data_sect xgroup_val .set xgroup_val+xsect_val .else .group prog_data2_group, code_gen_fp_data_sect .endif .endif -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads