file libdoc.txt Overview of used constants and variables for generated library code Runtime variables used by generated code (stored in rambank $F0) The dirbuf variables are at the same location as used by SX/B Defined in lib_total.inc lib_threadcount equ $F0 ;thread counter lib_rbint equ $F1 ;rb interrupt flags lib_systimerL equ $F2 ;16bit free running timer lib_systimerH equ $F3 portA_dirbuf equ $FA ;copy of port A direction register portB_dirbuf equ $FB ;copy of port B direction register portC_dirbuf equ $FC ;copy of port C direction register portD_dirbuf equ $FD ;copy of port D direction register portE_dirbuf equ $FE ;copy of port E direction register Runtime variables used by generated code (stored in global ram) These may conflict with SX/B Defined in project_template.src ;required for sxvplib macros main_temp equ global_org+4 ;temporary variable vp_bank equ global_org+5 ;holds vp_bank number vp_portpin equ global_org+6 ;holds vp_portpin number vp_flags equ global_org+7 ;holds vp flags Runtime user constants used by generated code Defined in project_template.src (user main file) cpufreq equ 50_000_000 ;set to freq (for use in calculations) maxvp equ 9 ;set max number of virtual peripherals (1-16) maxbaud equ 115200 ;max baudrate for uarts ;1200,2400,3600,4800,7200,9600,14400,19200,28800,33600 ;38400,57600,76800,115200,153600,230400,307200,460800 THREADS equ 4 ;define number of threads (1-16) in interrupt routine Code and data areas are tracked using compiler variables code use org code to set current rom address use code = $ to store current rom address data use org data to set current ram address use data = $ to store current ram address Library code belonging to a specific part is located between two comments identifying the start and end of that code. Eg: ;file lib_threads.inc code for threads ;end of file lib_threads.inc This makes it easy to convert to include statements, once the assembler allows enough include files. For now, all library code is in the file lib_total.inc VP macros may have many parameters. General parameters for a VP macro are: nr unique number for the VP (start at 0 and increment with each VP declaration) prefix unique name prefix for the VP thread number identifying when the isr code of the VP must be executed Specific parameters may be pins, timing constants, protocol modes etc (depends on VP) VP code consists of an isr part (executed from within isr), optional main part (executed as main code) and init part (executed before enabling interrupts and entering mainloop). VP data consists of (a continues area of) ram bytes, the first byte must be located at such a rambank offset that data areas of identical type of VP's are at the same offset. end of file libdoc.txt