Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
National Semiconductor SC/MP
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Addressing and index registers=== Like most 8-bit microprocessors of the era, the SC/MP is based around a [[16-bit]] address and an [[8-bit]] [[Bus (computing)|data bus]]. To lower pin count, the external address bus contains only 12 pins, sharing 4 pins from the data bus to create a complete 16-bit address.{{sfn|Osborne|Kane|1981|p=3.3}} Internally, the [[program counter]] is twelve bits wide, and there are separate instructions to set the upper four bits by copying an 8-bit value into the high byte. This provides a memory map of sixteen four-kilobyte pages, and program code could not refer to code or immediate or PC-relative data outside its own page.{{sfn|Handbook|1977|p=1.11}} Thus the memory is arranged as 16 pages of 4 kB each. This leads to a curiosity of the design; when the program counter reaches the end of a page, it does not move to the next page, it returns to the start of the current page.{{sfn|Osborne|Kane|1981|p=3.3}} This was further limited by the two-byte instruction format, which used one byte for the [[opcode]] and a second one to indicate an offset between -128 and +127, which was added to a value in the [[processor register]]s to produce a complete 16-bit address. For instance, an address might refer to a location in memory by saying it is +10 locations from the value in the [[program counter]], or +10 from the value in one of the 16-bit [[index register]]s. To access a location outside that range, the address had to be stored in one of the index registers, and then the offset set to zero.{{sfn|Handbook|1977|p=1.11}} Because the registers are 16-bit, and the accumulator that loads values is 8-bit, setting a complete address required several instructions.{{sfn|Osborne|Kane|1981|p=3.4}} As indexes were critical to the addressing model, the SC/MP included four index registers, the "Pointer Registers" PR0 through PR3. PR0 was the program counter, and not normally manipulated by user programs. By convention, PR1 was normally used as a pointer into ROM, PR2 into RAM, and PR3 was used to store an address during [[interrupt]]s and [[subroutine]] calls.{{sfn|Handbook|1977|p=1.3}} The SC/MP did not have a [[Stack (abstract data type)|stack]], where return values were normally stored on most contemporary designs. Programs had to save return addresses with explicit code.{{sfn|Osborne|Kane|1981|p=3.4}} There were four primary addressing modes, PC-relative, indexed, immediate (meaning a constant in the instruction's second byte as opposed to an offset), and auto-indexed. PC-relative addressing was actually the same as indexed, selecting PR0 as the index register.{{sfn|Handbook|1977|p=1.11}} Auto-indexed is used to aid the construction of loops. If the displacement is less than zero, the contents of the Pointer Register is decreased by the displacement before the contents of the effective address are fetched or stored. If the displacement is equal to or greater than zero, the contents of the Pointer Register are used as the effective address, and the contents of the Pointer Register are increased by the displacement after the contents of the effective address are fetched or stored. This removes the need for a separate instruction to change the value in the register, so one could store the starting value of a block of data in memory in a PR and then loop through all of the data by calling a single instruction.{{sfn|Handbook|1977|p=1.11}} If the offset is negative it performs the decrement before accessing the final value, if it is positive, it does a post-increment.{{sfn|Osborne|Kane|1981|p=3.4}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)