![Intel 80C196NU User Manual Download Page 94](http://html1.mh-extra.com/html/intel/80c196nu/80c196nu_user-manual_2072209094.webp)
5-21
MEMORY PARTITIONS
This listing shows the disassembled code:
2080H ;C814 | PUSH WSR
2082H ;B14814 | LDB WSR,#48H
2085H ;44E4E2E0 | ADD E0H,E2H,E4H
2089H ;B21814 | LDB WSR,[SP]
208CH ;65020018 | ADD SP,#02H
2090H ;F0 | RET
2091H ;C814 | PUSH WSR
2093H ;B14814 | LDB WSR,#48H
2096H ;44EAE8E6 | ADD E6H,E8H,EAH
209AH ;B21814 | LDB WSR,[SP]
209DH ;65020018 | ADD SP,#02H
20A1H ;F0 | RET
The C compiler can also take advantage of this feature if the “windows” switch is enabled. For
details, see the MCS 96 microcontroller architecture software products in the Development Tools
Handbook.
5.3.3
Windowing and Addressing Modes
Once windowing is enabled, the windowed locations can be accessed both through the window
using direct addressing and through its actual address using indirect or indexed addressing. The
lower register file locations that are covered by the window are always accessible by indirect or
indexed operations. To re-enable direct access to the entire lower register file, clear bits 6:0 of the
window selection register. To enable direct access to a particular location in the lower register file,
you may select a smaller window that does not cover that location.
When windowing is enabled:
•
a direct instruction that uses an address within the lower register file actually accesses the
window in the upper register file;
•
an indirect or indexed instruction that uses an address within either the lower register file or
the upper register file accesses the actual location in memory.
The following sample code illustrates the difference between direct and indexed addressing when
using windowing.
PUSHA
; Pushes the contents of WSR onto the stack
LDB
WSR, #17H
; Selects window 17H, a 128-byte block
; (windows 0380-03FFH into 0080-00FFH)
; The next instruction uses direct addr
ADD
40H, 80H
; mem_word(40H)
←
mem_word(40H) + mem_word(380H)
; The next two instructions use indirect addr
ADD
40H, 80H[0]
; mem_word(40H)
←
mem_word(40H) + mem_word(80H +0)
ADD
40H, 380H[0]
; mem_word(40H)
←
mem_word(40H) + mem_word(380H +0)
POPA
; reloads the previous contents into WSR
Summary of Contents for 80C196NU
Page 1: ...8XC196NP 80C196NU Microcontroller User s Manual...
Page 2: ...8XC196NP 80C196NU Microcontroller User s Manual August 1995 Order Number 272479 002...
Page 18: ...1 Guide to This Manual...
Page 19: ......
Page 31: ......
Page 32: ...2 Architectural Overview...
Page 33: ......
Page 48: ...3 Advanced Math Features...
Page 49: ......
Page 56: ...4 Programming Considerations...
Page 57: ......
Page 72: ...5 Memory Partitions...
Page 73: ......
Page 106: ...6 Standard and PTS Interrupts...
Page 107: ......
Page 144: ...7 I O Ports...
Page 145: ......
Page 165: ......
Page 166: ...8 Serial I O SIO Port...
Page 167: ......
Page 183: ......
Page 184: ...9 Pulse width Modulator...
Page 185: ......
Page 196: ...10 Event Processor Array EPA...
Page 197: ......
Page 225: ......
Page 226: ...11 Minimum Hardware Considerations...
Page 227: ......
Page 239: ......
Page 240: ...12 Special Operating Modes...
Page 241: ......
Page 255: ......
Page 256: ...13 Interfacing with External Memory...
Page 257: ......
Page 303: ......
Page 304: ...A Instruction Set Reference...
Page 305: ......
Page 373: ......
Page 374: ...B Signal Descriptions...
Page 375: ......
Page 390: ...C Registers...
Page 391: ......
Page 447: ......
Page 448: ...Glossary...
Page 449: ......
Page 458: ...Index...
Page 459: ......