Ағылшыншамен салыстырыңыз: абзацты басыңыз — түпнұсқа терезеде ашылады. Абзац астындағы EN түймесі оны мәтін ішінде көрсетеді.
Мазмұны
Кіріспе
8 бит микропроцессор
8 bit microprocessor
National Semiconductor компаниясының SC/MP (Simple Cost effective Micro Processor) – 1976 жылдың сәуір айында қолжетімді болған 8 бит микропроцессор. Ол жүйелерді мүмкіндігінше аз қосымша қолдау микросхемаларымен іске асыруға мүмкіндік беру үшін жасалған. SC/MP құрамында бірнеше SC/MP процессорларына (көптеген жүйелерде үш процессорға дейін) бір ғана негізгі жадты пайдалану арқылы мультипроцессорлық жүйе құруға немесе басқа негізгі орталық процессор (CPU) бар жүйеде контроллер ретінде жұмыс істеуге мүмкіндік беретін тізбектелген басқару сызығы болды. Оның өмірлік циклында SCMP 1-ден 3-ке дейін үш нұсқасы шығарылды, соңғы екеуі INS8060 және INS8070 деп те белгілі болды. Құныны төмендету үшін жүйе біттік тізбекті арифметикалық-логикалық құрылғыны (ALU) қолданды, сондықтан Intel 8080 немесе MOS 6502 сияқты параллельді ALU-ы бар заманауи процессорлардан айтарлықтай баяу болды. Тағы бір ерекшелігі – бағдарламалық тізілім 16 биттік адрестің төменгі 12 битіне ғана қол жеткізе алатындығы, ал жоғарғы 4 битін арнайы командаларды пайдаланып орнату қажет болды. Соның салдарынан командалар негізгі жадқа 4 кБ көлеміндегі 16 «бет» арқылы қол жеткізе алды, ал осы беттерден тыс жадқа қол жеткізу үшін бірнеше командалар қажет болды. Баяу жылдамдық пен беттік жадтың үйлесімі оның мақсатталған нарықтан тыс тартымдылығын шектеді, және бұл нарықта ол бірқатар пайдалы қосымша мүмкіндіктері бар Fairchild F8 процессорымен бәсекелесті. Жүйе салыстырмалы түрде аз қолданылды.
National Semiconductor's SC/MP (pronounced scamp) for Simple Cost effective Micro Processor, is an early 8 bit microprocessor which became available in April 1976. It was designed to allow systems to be implemented with the minimum number of additional support chips. SC/MP included a daisy chained control pin that allowed up to three SC/MP's share a single main memory to produce a multiprocessor system, or to act as controllers in a system with another main central processing unit (CPU). Three versions were released over its lifetime, SCMP 1 through 3, the latter two also known as INS8060 and INS8070. To lower cost, the system used a bit serial arithmetic logic unit (ALU) and was thus significantly slower than contemporary designs like the Intel 8080 or MOS 6502 which had parallel ALUs. Another oddity was that the program counter could only access the lower 12 bits of the 16 bit address, and the upper 4 bits had to be set using special instructions. The result was that instructions accessed main memory as sixteen 4 kB "pages" and reaching memory outside those pages required multiple instructions. The combination of slow speed and paged memory limited its attractiveness outside the embedded markets it was aimed at, and in this market it competed against the Fairchild F8 which had a number of useful additional features. The system saw relatively little use.
ALU және негізгі тіркелімдер
Арифметикалық логикалық құрылғы (ALU) бір ғана 8 биттік аккумулятор, AC негізінде құрылды. Екінші 8 биттік тіркегіш, "Extension" немесе E, AC-нің қосалқы көшірмесі ретінде пайдаланылуы мүмкін. Көптеген нұсқаулар E-ге тікелей қол жеткізе алмады; мысалы, деректерді жадтан тікелей E-ге жүктеу мүмкін емес. Оның орнына, AC-дегі мәнді E-ден оқуға болады немесе AC мен E-ні алмастыруға болады. E сондай-ақ ALU қолдайтын жеті логикалық/арифметикалық операциялар үшін бастапқы мән ретінде де пайдаланылуы мүмкін. Егер E басқа операциялар үшін қолданылмаса, оны Zilog Z80 сияқты конструкциялардағы көлденең тіркегіштерге ұқсас түрде қолдануға болады, бұл E-ні үзіліс кезінде AC мәнін сақтаудың жылдам тәсілі ретінде қызмет етеді. E-нің басты мақсаты сериялық I/O жүйесі үшін буфер ретінде жұмыс істеу болды. Бұл SIO нұсқаулығымен басқарылды, ол E-дегі ең кіші маңызды битті процессордағы SOUT тірегіне қосылған құлыпқа жылдырды. SIO нұсқаулығына бірнеше рет шақыру арқылы 8 биттік E мәнінің біттері біртіндеп шығысқа жіберілді немесе SIN тірегінен оқу үшін кері операция орындалды. 8 биттік мән толығымен оқылғаннан немесе жазылғаннан кейін, мәнді A-мен алмастыру арқылы және содан кейін A-ны жадқа жүктеу немесе сақтау арқылы жадқа жіберуге болады. E сондай-ақ AC-дегі логикалық операциялардың көзі ретінде пайдаланылуы мүмкін, мысалы, сериялық порттан күй байтын оқып, содан кейін AC-дегі маскамен оны АНД (AND) операциясынан өткізуге болады, бұл сыртқы құрылғыдан оқылған әртүрлі күй биттерін тексеру үшін. Жеке Күй тіркегіші 8 биттен тұрады. Ең кіші үш бит, 0-ден 2-ге дейін, тікелей тіреулерге қосылған, бұл сыртқы құрылғының күйін тексерудің оңай жолын қамтамасыз етеді. Тағы екі тіреу, Sense A және B, 4 және 5 биттерге қосылған. Sense A әдетте үзілістерге қызмет ету үшін қолданылады (төмендегі егжей-тегжейлі қараңыз). Үзілістерді 3-ші битті 0-ге орнату арқылы, Үзіліске рұқсат ету (IE) арқылы, DINT нұсқаулығымен немесе IEN нұсқаулығымен өшіруге болады, немесе мәнді A-ға және одан жылжыту арқылы және оны сол жерде өңдеу арқылы қосуға болады. 6 және 7-ші биттер әдеттегідей ағып кету және көшіру тулары болып табылады, көптеген процессорларда көрінеді.
The arithmetic logic unit (ALU) was accumulator based, with a single 8 bit accumulator, AC. A second 8 bit register, "Extension", or E, could be used as a backup for AC. E could not be accessed directly by most instructions; one could not load data from memory directly into E for instance. Instead, the value in AC could be read from E, or AC and E could be swapped. E can also be used as the source value for the seven logical/arithmetic operations supported by the ALU. If E were not used for other operations, it could also used in a fashion similar to the mirror registers seen in designs like the Zilog Z80, with E acting as a quick way to store the value of AC during an interrupt. A major purpose of E was to act as a buffer for the built in serial I/O system. This was driven by the SIO instruction, which bit shifted the least significant bit in E to a latch which was connected to the SOUT pin on the processor. Repeated calls to SIO thus presented bits of the 8 bit E value one at a time to the output, or reversed this operation for reading from the SIN pin. Once a complete 8 bit value had been read or written, the value could be sent to memory by exchanging the value with A and then loading or storing A to memory. E could also be used as the source for logical operations on AC, so for instance, one could read a status byte in from the serial port and then AND that value with a mask in AC, to check for various status bits read from an external device. The separate Status Register was 8 bits. The three least significant bits, 0 through 2, were connected directly to pins, providing an easy way to check external device's status. A further two pins, Sense A and B, were connected to bits 4 and 5. Sense A was normally used to service interrupts (see details below). Interrupts could be turned off by setting bit 3, Interrupt Enable (IE) to 0 with the Disable Interrupt instruction, DINT, and enabled with IEN, or by moving the value to and from A and manipulating it there. Bits 6 and 7 were conventional overflow and carry flags, as seen in most processors.
Адрестік және индекстік регистрлер
Сол дәуірдегі 8 биттік микропроцессорлар сияқты, SC/MP 16 биттік адреске және 8 биттік дерек шинасына негізделген. Пин санының азайтуы үшін сыртқы адрестік шинада тек 12 пин болды, дерек шинасынан 4 пинді бөлісіп, толық 16 биттік адресті құрайды. Ішкі бағдарлама санағы он екі биттен тұрады, ал жоғарғы төрт битті орнату үшін жоғары байтқа 8 биттік мәнді көшіруге арналған жеке нұсқаулар бар. Бұл он алты 4 килобайттық беттен тұратын жад картасын ұсынады, ал бағдарлама коды өз бетінен тыс кодқа немесе PC-ге қатысты деректерге сілтеме жасай алмайды. Осылайша, жад әрқайсысы 4 кБ болатын 16 бетке бөлінген. Бұл дизайнның ерекшелігіне әкеледі: бағдарлама санағы бір беттің соңына жеткенде, ол келесі бетке өтудің орнына, ағымдағы беттің басына оралады. Бұл екі байттық нұсқау форматымен шектелген, ол опкод үшін бір байтты және 128-ден +127-ге дейінгі ауытқуды көрсету үшін екінші байтты пайдаланды, ол процессор тіркелімдеріндегі мәнге қосылып, толық 16 биттік адресті құрады. Мысалы, адрестің жадыдағы орны +10 орын бағдарлама санағындағы мәннен немесе +10 16 биттік индекс тіркелімдерінің біріндегі мәннен екенін көрсетуге болады. Бұл диапазоннан тыс жерге кіру үшін мекенжай индекс тіркелімдерінің бірінде сақталуы керек, содан кейін ауытқу нөлге орнатылады. Тіркелімдер 16 биттік болғандықтан, ал мәндерді жүктеуге арналған аккумулятор 8 биттік болғандықтан, толық адресті орнату бірнеше нұсқауды қажет етеді. Индекстер адрестеу моделі үшін маңызды болғандықтан, SC/MP төрт индекс тіркелімін, PR0-ден PR3-ке дейінгі «Пойнтер тіркелімдерін» қамтыды. PR0 бағдарлама санағы болды және әдетте пайдаланушы бағдарламаларымен өңделмейді. Келісім бойынша, PR1 әдетте ROM-ға, PR2 RAM-ға сілтеме ретінде пайдаланылды, ал PR3 үзілістер мен қосалқы шақырулар кезінде мекенжайды сақтау үшін қолданылды. SC/MP-де стек болмады, онда қайтару мәндері әдетте заманауи дизайнмен сақталады. Бағдарламалар қайтару адрестерін нақты кодпен сақтау керек еді. Төрт негізгі адрестеу режимі болды: PC-ге қатысты, индекстелген, дереу (нұсқаудың екінші байтындағы тұрақты, ауытқу емес) және автоматты индекстелген. PC-ге қатысты адрестеу индекстелгенмен бірдей болды, PR0 индекс тіркелімі ретінде таңдалды. Автоматты индекстеу циклдарды құруға көмектеседі. Егер ауытқу нөлден кем болса, Pointer Register мазмұны тиімді мекенжайдың мазмұны алынбастан немесе сақталмастан бұрын ауытқуға сәйкес азайтылады. Егер ауытқу нөлге тең немесе одан жоғары болса, Pointer Register мазмұны тиімді мекенжай ретінде қолданылады, ал тиімді мекенжайдың мазмұны алынғаннан немесе сақталғаннан кейін Pointer Register мазмұны ауытқуға сәйкес ұлғаяды. Бұл тіркелімдегі мәнді өзгерту үшін жеке нұсқаудың қажеттілігін жояды, сондықтан деректер блогының бастапқы мәнін PR-де жадқа сақтап, содан кейін бір нұсқауды шақыру арқылы барлық деректерді итерациялауға болады. Егер ауытқу теріс болса, ол соңғы мәнге қол жеткізбейінше азайтуды орындайды, егер ол оң болса, ол кейіннен ұлғайтады.
Like most 8 bit microprocessors of the era, the SC/MP is based around a 16 bit address and an 8 bit 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. 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. 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. 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 registers 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 registers. 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. Because the registers are 16 bit, and the accumulator that loads values is 8 bit, setting a complete address required several instructions. 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 interrupts and subroutine calls. The SC/MP did not have a stack, where return values were normally stored on most contemporary designs. Programs had to save return addresses with explicit code. 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. 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. If the offset is negative it performs the decrement before accessing the final value, if it is positive, it does a post increment.
Қолдануды тоқтату
Жүйе Sense A желісіндегі үзілістерді автоматты түрде өңдеуді қамтиды. Үзіліс қабылданғанда және IE жоғары (қосулы) болса, келесі нұсқауды алуды бастамас бұрын жүйе басқа үзіліс болдырмау үшін IE-ді нөлдейді, содан кейін PC және PS3-тегі мәндерді ауыстырады. Бұл PR3-те қайтару мекенжайын сақтап, келесі нұсқауды PR3-те бұрын сақталған үзіліс өңдеушісінің кіру нүктесіне жіберуге әкеледі. Жүйе үзілістен қайтаруға тең келетін нұсқауды қамтымайды. Бұл басқа XPPC нұсқаусымен орындалуы мүмкін, PR3-те бұрын сақталған мекенжайды PC-ге көшіріп, орындалу тоқтаған жерден жалғасады. Дегенмен, бұл PR3-те дұрыс емес мекенжайды қалдырады, үзіліс өңдеушісінің басы емес, соңы. Бұл мәселені шешу үшін, негізгі кодқа қайта оралатын XPPC нұсқауын кіру нүктесінен бір нұсқау жоғары орналастыру қалыпты жағдай. Өңдеуші аяқталған кезде, ол осы нұсқауға қайта секіреді, сондықтан XPPC шақырылғанда PC дұрыс кіру нүктесінен бір позиция бұрын бағытталады. Жүйе нұсқауды шақырудан бұрын PC-ді арттыратындықтан, бұл келесі үзіліс дұрыс кіру нүктесінен басталатынын білдіреді. Бұл "шығу өңдеушісі" әдетте IE-ді 1-ге қайта орнатып, үзілістерді қайта қосады.
The system includes automatic handling of interrupts on the Sense A line. When an interrupt is received and IE is high (enabled), before starting to fetch the next instruction the system instead clears IE to prevent another interrupt, and then exchanges the values in PC and PS3. This has the effect of saving the return address in PR3 and sending the next instruction into the interrupt handler entry point previously stored in PR3. The system does not include the equivalent of a return from interrupt. This can be performed with another XPPC, copying the previously saved address in PR3 back to the PC and execution continues where it left off. However, this leaves the wrong address in PR3, not the start of the interrupt handler, but the end. To address this, the common solution is to place the XPPC that returns to the main code one instruction above the handler entry point, rather than at the end. When the handler completes, it jumps back to this instruction, so when XPPC is called, the PC is pointed one location before the proper entry point. Because the system increments the PC before calling an instruction, this means the next interrupt will result it in entering at the correct entry point. This "exit handler" normally also resets the IE to 1 to re enable interrupts.
Автобус басқару
SC/MP-нің ерекшелігі – бірнеше SC/MP немесе, көбінесе, бір SC/MP және байланысты тікелей жадқа қол жеткізу (DMA) контроллерлеріне бір ортақ жадқа қол жеткізуді бөлісуге мүмкіндік беретін тізбекте жалғанған ортақ басқару желісі болды. Егер автобустағы чиптердің бірі жадқа қол жеткізе алса, ол ENOUT пинін жоғары деңгейге көтеріп, басқа чиптердің ENIN пиндеріне автобусты босату қажеттігін хабарлайтын. Көптеген басқа процессорларда мұндай жағдайда тақта дизайнерлері CPU-ны тоқтату үшін сыртқы логиканы қолдану қажет болатын, бұл ішкі нұсқаулардың уақытына байланысты кейбір қиындықтарға алып келгенімен, бұл сыртқы схемаларға көрінбейтін. SC/MP-де бұл функция толығымен ішкі құрылымында жүзеге асырылды, сондықтан осы мүмкіндікті іске асыру үшін схема тақтасында тек бір желі ғана қажет болды. Бастапқы мақсат – SC/MP, бір немесе бірнеше DMA контроллерлері және ортақ жадтан тұратын микробақылаушы сияқты қосымшаларды жасауды жеңілдету еді. Жүйенің жалпы құнының төмендеуіне бағытталған SC/MP-нің өзінің құнын азайту ниеті біттік сериялық ALU және жеке UART қажеттілігін жою үшін сериялық кіріс/шығыс желілерін енгізу туралы шешімдерге әкелді (бұл мүмкіндік кейінірек SC/MP III үлгісінде алынып тасталды). Осборн жүйенің шолуында оны "көп процессорлы қолданбалар үшін таңдаулы микропроцессоры" деп атады, бірақ бұл нарық күшті болған жоқ және шектеулі болды.
A feature of the SC/MP was a shared daisy chained control line that allowed multiple SC/MP, or more commonly a single SC/MP and related direct memory access (DMA) controllers, to share access to a single main memory. When any one of the chips on the bus desired access to memory, it would set the ENOUT pin high, thereby signalling the other chip's ENIN pins that they had to release the bus. With most other processors, this would normally require external logic implemented by the board designers to pause the CPU to the same end, often with some complexity due to the internal instruction timing that was not visible to the external circuits. In the SC/MP this was all included internally so a single line on the circuit board was all that was needed to implement this feature. The original idea was to ease the creation of microcontroller like applications containing an SC/MP, one or more DMA controllers, and a single shared memory. Designed specifically to be as low cost as possible in terms of an overall system, the desire to lower the cost of the SC/MP itself also led to decisions about the bit serial ALU and the inclusion of serial input/output lines to eliminate the need for a separate UART (this feature was removed in the later SC/MP III). Osborne's review of the system stated it was the "microprocessor of choice in any multi processor application" but this market seems to have been limited as sales were never particularly strong.
Әдеттегі емес ерекшеліктері
SC/MP-де подпрограммаға шақыру нұсқаулы болған жоқ. Оның орнына, құрастыру тілінде осы мүмкіндікті іске асыру үшін нұсқаулар тізбегін жасайтын JS макросы болды. Макрос адрестің жоғарғы байтын AC-ге жүктеді, содан кейін XPAH-ты шақырып, оны таңдалған сілтеме тіркегішінің жоғарғы байтына көшірді. Содан кейін XPAL-ды пайдаланып, төменгі байт үшін осы әрекетті қайталады. Одан кейін XPPC-ге PR-ден PC-ге 16 биттік мәнді беру үшін шақыру жасады. XPPC екі мәнді алмастыратындықтан, PC-нің ағымдағы мәні таңдалған PR-ге сақталады, ал подпрограммадан қайту бір XPPC арқылы мәнді кері көшіру арқылы іске асырылуы мүмкін. SC/MP нұсқауды алу алдында бағдарлама санағышын (PC) арттырады, сондықтан қайта орналастыру кезінде ол 0001 мекенжайынан нұсқауларды орындауды бастайды. Бұл да ауытқуларды есептеу кезінде ескерілуі керек, себебі ауытқу келесі нұсқаудың орнына, ауытқудың өзінің орнына қосылады. Жүйеде бір параметрді, P-ні қабылдайтын DLY (кешіктіру) нұсқаулы болды. Ол 13 + (2 x P) + (2^9 x P) + (2 x AC) микроциклдерге дейін жұмысты тоқтатты, бұл AC-дегі мәнді нөлге дейін үнемі кеміту арқылы жасалды. Бұл 13 мен 131,593 цикл аралығында кешіктіру жасауға мүмкіндік берді. Бұл көбінесе тізбектік порттармен қолданылды; бағдарлама AC-дегі мәнді белгілі бір жылдамдықпен бір битті жіберуге кеткен уақытқа орнатуы мүмкін, содан кейін келесіге дайын екенін тексеру үшін флаг тізбегінің бірінің мәнін тексеруі мүмкін. Процессор уақытты қатаң сақтауды талап етпеді, және төмен жылдамдықты қолданбаларда кристалл осцилляторын пайдалану қажет болмады, оны қарапайым конденсатормен алмастыруға болады.
The SC/MP did not include a jump to subroutine instruction. Instead, the assembler language included the JS macro that wrote a series of instructions to implement this functionality. The macro loaded the high byte of the address into AC, and then called XPAH to move it to the high byte of a selected pointer register. It then repeated this for the low byte using XPAL. It then called XPPC to transfer the resulting 16 bit value from the PR to the PC. Since XPPC exchanges the two values, the current value of the PC is thus stored into the selected PR, and the return from subroutine can be implemented with a single XPPC to copy the value back. SC/MP increments the program counter before fetching the instruction, so that on reset it actually starts executing instructions from location 0001. This also needs to be taken into account for calculating displacements, since the offset will be added to the program counter which will be still pointing to the location of the displacement and not the next instruction. The system included a Delay instruction, DLY, which took a single parameter, P. This stopped operation for a period of 13 + (2 x P) + (2^9 x P) + (2 x AC) microcycles, which it did by continually decrementing the value in AC until it reached zero. This meant it could produce a delay between 13 and 131,593 cycles. This was normally used with the serial pins; a program could set the value in AC to the time it took to transmit a single bit at a given speed and then check the value of one of the flag pins to see if it was ready for the next one. The processor was not particularly picky about timing, and in low speed applications it did not need to use a crystal oscillator and this could be replaced with a simple capacitor instead.
Қолданылуы
SC/MP сонымен қатар, Кембридж ғылымы (кейін Sinclair Research Ltd) компаниясы шығарған MK14 деп аталатын бір тақталы микробасқарушының негізі ретінде де пайдаланылды. Montgomery Elevator Co (Moline IL, кейін KONE, Inc сатып алды) компаниясы 1975 жылы шығарған алғашқы микропроцессорлық лифт контроллері үшін SC/MP-ді негіз ретінде қолданды. Осы құрылғылардың көптегені бүгінгі күнге дейін АҚШ-тың әртүрлі ғимараттарында жұмыс істеп келеді.
The SC/MP was also used as the basis of a single board microcontroller produced by Science of Cambridge (later Sinclair Research Ltd) called the MK14. Montgomery Elevator Co of Moline IL (later purchased by KONE, Inc) used the SC/MP as the basis for its first micro processor based elevator controller released in 1975. There are still many of these units running in buildings across the U. S. A.