English
Language : 

SDA5250 Datasheet, PDF (53/143 Pages) Siemens Semiconductor Group – TVTEXT 8-Bit Microcontroller
SDA 525x
In order to prevent loss of program control during deep subroutine nesting a warning bit
“SF” (Stack Full) is set in MEX2 whenever a memory extension stack depth overflow is
imminent. For example Figure 19 shows the data flows at the memory extension stack
during a LCALL. All three bits of NB are copied to the position CB and NB of the next
higher stack level (now the current MEX1) while the last CB and NB are held on the
stack. Returning from subroutine through RET the memory extension stack pointer
decrements and CB and NB of MEX1 has the same contents as before LCALL.
Before
CB NB
MEX1 010 110
’LCALL’
After
CB NB
010 110
MEX1 110 110
010 110
MEX1: CB 18,17,16
NB 18,17,16
UEC04718
Figure 19
Processing LCALL (same as ACALL)
Examples
The standard sequence jumping from one bank to another is simply preceding a “MOV
MEX1,#”- instruction to an “LJMP / LCALL” as shown in Figure 19. To operate programs
up to 512 Kbytes with standard assemblers or from C the program can be split into
sections, modules or files, that will each run in their own bank. Referencing banks to
each other (jumps, calls, data moves) may be done by a simple preprocessing of the
source programs or object files. Users, going to program a 512-Kbyte EPROM in
assembler, may proceed like this:
1. Build up to eight assembler source files (max. 64 K), inter bank operations will refer to
dummy labels.
2. Do assembler runs on each block and generate label lists.
3. Preprocessing: substitute the inter bank labels in the source files with absolute 64 K
addresses.
4. Second and final assembler runs on each block, generate Hex files.
5. Append the Hex files in right order.
6. Program an EPROM.
Semiconductor Group
53
1998-04-08