BSO/Tasking APPLICATION NOTE ref: AN0801 product(s): TK0831 TK0841 description: CrossView 8051 debugger for Tasking ROM monitor date: Sep 8, 1994 subject: ROM monitor for non-default registerbank How to build the Tasking 8051 ROM monitor for another than the default registerbank? =1= Fix the following known problems in the source of the ROM monitor (solved in v1.2 of the monitor, but still present in v1.0 and v1.1): - Edit the file MON51.ASM. Replace the GT (macro greater than) test by a NE (macro not equal). This has to be done two times, once for %VECTOR_TF0 and once for %VECTOR_IE1 - Edit the file BREAK.ASM. Replace MOV PSW,#018H ; switch to registerbank 3 by MOV PSW,#(%MON_REGBANK * 8); select registerbank =2= Set the macro %MON_REGBANK to the registerbank number to be used by the ROM monitor in the selected configuration file (*.CFG). Rebuild the ROM monitor by typing: MK51 =3= Be sure that the linker control file of your application reserves the data area, which is used as registerbank of the ROM monitor. When changing the ROM monitor's registerbank from 3 to 2, the linker control file of your application should be changed from: RESERVE( DATA(18H-1FH)) to RESERVE( DATA(10H-17H)) =4= When the ROM monitor is using registerbank 1, be sure that the SP register must be set to the user stack area before executing the first Step/Go of the ROM monitor. Initializing SP to the user stack area is normally done in the (C) startup code of your application. When SP is left at it's initial value (07H), the first Step/Go of the monitor would overwrite location 8H, 9H and 0AH, being registers R0, R1 and R2 of the monitor's registerbank. When using CrossView you can easily define a reset macro: set reset "rst; $sp=0x80; s" performing a reset, assigning SP with the user stack area (here idat:080H) and step to main(). When using the MS-Windows version of CrossView, you can bind this macro to one of the user defined buttons of the toolbox, so resetting the application is always just one mouse click away. When the application has executed the startup code, there are no further limitations of the ROM monitor, using registerbank 1 instead of 3.