Claims (1)
Zastrzeżenie- patentoweDisclaimer - patent
Sposób zmiany adresu przerwania niemaskowalnego mikroprocesora Z80, znamienny tym, że wykrywa się cykl pobrania kodu rozkazu z komórki pamięci operacyjnej o adresie 66H, a następnie przez okres trwania wykrytego cyklu blokuje się układ pamięci operacyjnej tak, aby nie wysterowywał linii danych mikroprocesora ustalając w tym czasie na liniach danych mikroprocesora stan będący kodem jednooajtowego rozkazu powodującego zmianę zawartości licznika rozkazów na nowy adres obsługi przerwania niemeskowalnego.The method of changing the address of the interrupt of the non-maskable microprocessor Z80, characterized in that the cycle of downloading the command code from the operating memory cell with the address 66H is detected, and then for the duration of the detected cycle the operational memory system is blocked so that it does not drive the microprocessor data line, determining at that time on microprocessor data lines a state that is a single-byte instruction code causing a change of the instruction counter content to a new non-meshed interrupt service address.
Przedmiotem wynalazku jest sposób zmiany adresu obsługi przerwania niemaskowalnego mikroprocesora Z80 lub jego odpowiednika, znajdujący zastosowanie w układach mikrokomputerów, w których komórka pamięci operacyjnej o adresie 66H jest wykorzystywana do przechowywania danych, a nie programu.The present invention relates to a method of changing the interrupt service address of a non-maskable microprocessor Z80 or its equivalent for use in microcomputer systems in which the main memory location with the address 66H is used to store data, not a program.
Mikroprocesor Z80 posiada wejście zgłoszenia przerwania niemaskowalnego. Po zgłoszeniu tego przerwania mikroprocesor automatycznie przechodzi do realizacji programu rozpoczynającego się w komórce pamięci operacyjnej o adresie 66H. W znanych systemach mikrokomputerowych opartych na mikroprocesorze Z80, w których jest wykorzystywane przerwanie niemaskowalne, komórki pamięci o adresach 66H, 67H i 68H zawierają początek programu obsługi przerwania lub rozkaz skoku do tego programu. Z kolei w mikrokomputerach z mikroprocesorem Z80, pracujących pod kontrolą systemu operacyjnego CP/M, obszar pamięci obejmujący komórkę o adresie 66H jest przeznaczony do przechowywania danych. Z tego względu w komórce o adresie 66H nie można umieścić rozkazu wymaganego dla poprawnej obsługi przerwania niemaskowalnego. Dlatego też w omawianych mikrokomputerach zawierających mikroprocesor Z80 i pracujących pod kontrolą systemu operacyjnego CP/M przerwanie niemaskowalne nie może być wykorzystywane .The Z80 microprocessor has a non-maskable interrupt request input. After reporting this interrupt, the microprocessor automatically proceeds to the execution of the program starting in the main memory location with the address 66H. In known Z80 microprocessor based microcomputer systems, where a non-maskable interrupt is used, the memory cells with addresses 66H, 67H and 68H contain the start of an interrupt handler or a command to jump to the program. In turn, in microcomputers with the Z80 microprocessor, working under the control of the CP / M operating system, the memory area containing the cell with the address 66H is intended for data storage. For this reason, the cell with the address 66H cannot contain the instruction required for the correct handling of the nonmaskable interrupt. Therefore, in the discussed microcomputers containing the Z80 microprocessor and working under the control of the CP / M operating system, a non-maskable interrupt cannot be used.
Istota sposobu według wynalazku polega na tym, że wykrywa się cykl pobrania kodu rozkazu z komórki pamięci o adresie 66H, a następnie przez okres czasu do zakończenia wykrytego cyklu blokuje się układ pamięci tak, aby nie wysterowywał linii danych mikroprocesora i równocześnie uaktywnia się układ, który wysterowuje linie danych mikroprocesora ustalając na nich stan będący kodem jednobajtowego rozkazu powodującego zmianę zawartości licznika rozkazów na nowy adres obsługi przerwania niemaskowalnego.The essence of the method according to the invention consists in the fact that the cycle of downloading the command code from the memory cell with the address 66H is detected, and then the memory circuit is blocked for a period of time until the end of the detected cycle, so that it does not drive the microprocessor data line and at the same time the circuit is activated, which controls the microprocessor data lines setting on them a state which is a code of a one-byte instruction causing a change of the instruction counter content to a new address of a nonmaskable interrupt service.
Zastosowanie sposobu według wynalazku umożliwia zatem wykorzystywanie przerwania niemaskowalnego mikroprocesora Z80 również w tych mikrokomputerach, w których komórka pamięci o adresie 66H wykorzystywana jest do przechowywania danych, a nie programu, jak to ma miejsce w mikrokomputerach pracujących pod kontrolą systemu operacyjnego CP/M.The use of the method according to the invention therefore enables the use of the interrupt of the non-maskable microprocessor Z80 also in those microcomputers in which the memory location with the address 66H is used to store data, and not a program, as is the case in microcomputers operating under the control of the CP / M operating system.
Zastosowane w sposobie według wynalazku wykrywanie cyklu pobrania kodu rozkazu z komórki o adresie 66H jest wystarczające do stwierdzenia, że mikroprocesor jest w trakcie obsługi przerwania niemaskowalnego, gdyż ze względu na wykorzystywanie komórki pamięci o adresie 66H dla przechowywania danych, informacja w niej zawarta nigdy nie będzie odczytywana jako kod rozkazu w trakcie normalnego wykonywania programu.The detection of the command code fetch cycle from the cell with the address 66H used in the method according to the invention is sufficient to determine that the microprocessor is in the process of handling a non-maskable interrupt, because due to the use of the memory cell with the address 66H for data storage, the information contained therein will never be read as an command code during normal program execution.
Przedmiot wynalazku jest bliżej objaśniony na przykładzie realizacji przedstawionym na rysunku, na którym uwidoczniono schemat blokowy układu realizującego sposób według wynalazku, z ideowym pokazaniem połączeń zewnętrznych i wewnętrznych poszczególnych bloków.The subject of the invention is explained in more detail on the basis of an embodiment shown in the drawing, which shows a block diagram of a system implementing the method according to the invention, with a schematic illustration of the external and internal connections of the individual blocks.
Układ współpracuje z szynami: adresową, danych i sterującą mikroprocesora oraz z szyną danych pamięci operacyjnej. Układ składa się z bloku wykrywania cyklu pobrania rozkazuThe system cooperates with the bus: address, data and control of the microprocessor and with the data bus of the operating memory. The system consists of an instruction fetch cycle detection block
157 253157 253
BWCPR, bloku generowania kodu rozkazu 8GKR i bloku blokowania pamięci operacyjnej 8BP. Wejścia IAO do IA15 bloku wykrywania cyklu pobrania rozkazu BWCPR sg połączone kolejno z liniami adresowymi, odpowiednio AO do A15 szyny adeesowej,a wejście IM1 tego bloku połączone jest z linię stanu cyklu pobrania rozkazu -Ml mikroprocesora Z80. Wyjście RESTART bloku BWCPR jest połączone jednocześnie z wejściem blokowania IBP bloku blokowania pamięci operacyjnej BBP oraz z wejściem bloku generowania kodu rozkazu BGKR. Wejścia IPO 'do IP7 bloku blokowania pamięci BBP połączone są odpowiednio z liniami danych DPO do 0P7 pamięci operacyjnej. Wyjścia 0P0 do 0P7 bloku BBP połączone są odpowiednio z liniami DO do D7 szyny danych DB mikroprocesora. Wyjścia 0D3 do 0D5 bloku generowania kodu rozkazu BGKR są połączone odpowiednio z liniami 03 do 05 szyny danych DB.BWCPR, instruction code generation block 8GKR and main memory locking block 8BP. The inputs IAO to IA15 of the fetch cycle detection block BWCPR sg connected sequentially to the address lines AO to A15 of the adee bus, respectively, and the input IM1 of this block is connected to the fetch cycle status line -Ml of microprocessor Z80. The RESTART output of the BWCPR block is connected simultaneously to the IBP blocking input of the BBP blocking block and to the input of the BGKR instruction code generation block. The inputs IPO 'to IP7 of the blocking block BBP are connected to data lines DPO to 0P7 of main memory, respectively. The outputs 0P0 to 0P7 of the BBP are connected to lines DO through D7 of the microprocessor DB, respectively. The outputs 0D3 to 0D5 of the BGKR order code generation block are connected to lines 03 to 05 of the DB bus, respectively.
Działanie układu jest następujące. Układ PROM typu K565RT5 oznaczona na rysunku jako Ul dekoduje stan linii adresowych A10 do A15, uaktywniając wyjście Q5 (sygnał -IAH) w sytuacji, gdy wszystkie te linie znajdują się w stanie 0. Z kolei układ PROM typu K565RT5 oznaczona na rysunku jako U2 dekoduje stan linii adresowych AO do AB, uaktywniając wyjście 06 (sygnał -IAL) w sytuacji, gdy na wejściach występują stany odpowiadające adresowi 66H. Sygnały wyjściowe obu układów PROM (-IAH oraz -IAL), linia adresowa A9 oraz linia -Ml doprowadzone są do wejść AO do A3 układu komparatora 74LSB5. Wejścia BO do B3 komparatora znajdują się w stanie 0. Dzięki takiemu połączeniu wyjście A=B komparatora (sygnał RESTART) znajduje się w stanie aktywnym w czasie cyklu pobrania rozkazu z komórki pamięci o adresie 66H. Z kolei blok blokowania pamięci BBP, w przypadku aktywnego' stanu linii RESTART, blokuje rejestr wyjściowy pamięci RAM. Dzięki temu rejestr wyjściowy nie wysterowuje linii danych mikroprocesora. Blok generowania kodu rozkazu BGKR zawiera trzy bramki 7406 z wyjściami typu otwarty kolektor. Do wyjść tych bramek jest doprowadzony sygnał RESTART i jeśli znajduje się on w stanie 1, to uaktywniane są linie 03, 04 i 05 szyny danych mikroprocesora, w zależności od stanu zworek Z1 do Z3. Pozostałe linie szyny danych znajdują się w stanie 1. Taki stan szyny danych jest równoznaczny z wygenerowaniem przez blok BGKR kodu rozkazu restartu RST o numerze zależnym od stanu zworek Z1 do Z3. W wyniku wykonania rozkazu restartu następuje zmiana stanu licznika rozkazów mikroprocesora na adres, pod którym jest umieszczony początek programu obsługi przerwania niemaskowalnego.The operation of the system is as follows. The K565RT5 PROM circuit marked as Ul in the drawing decodes the state of address lines A10 to A15, activating the Q5 output (signal -IAH) in the situation when all these lines are in state 0. In turn, the K565RT5 type PROM, marked as U2 in the drawing, decodes state of address lines AO to AB, activating the output 06 (signal -IAL) in a situation when the states of the inputs correspond to the address 66H. The output signals of both PROM circuits (-IAH and -IAL), the address line A9 and the -Ml line are connected to the inputs AO to A3 of the 74LSB5 comparator circuit. The inputs BO to B3 of the comparator are in the state 0. Thanks to this connection, the output A = B of the comparator (RESTART signal) is in the active state during the command fetch cycle from the memory location with the address 66H. In turn, the blocking of the BBP memory, in the case of the active 'state of the RESTART line, locks the output register of the RAM memory. As a result, the output register does not drive the microprocessor data line. The BGKR instruction code generation block includes three gates 7406 with open collector outputs. The RESTART signal is supplied to the outputs of these gates and if it is in the state 1, the lines 03, 04 and 05 of the microprocessor data bus are activated, depending on the state of the jumpers Z1 to Z3. The remaining data bus lines are in state 1. This state of the data bus is equivalent to the generation of the RST restart command code by the BGKR block, with a number depending on the state of the Z1 to Z3 jumpers. As a result of the execution of the restart command, the microprocessor instruction counter is changed to the address at which the beginning of the nonmaskable interrupt handler is placed.
Stosowanie sposobu według wynalazku pozwala na wykorzystywanie przerwań niemaskowalnych w mikrokomputerach posiadających mikroprocesor Z80 i pracujących pod kontrolą systemu operacyjnego CP/M lub innych systemów operacyjnych zgodnych z CP/M.The use of the method according to the invention allows the use of non-maskable interrupts in microcomputers having a Z80 microprocessor and operating under the control of the CP / M operating system or other operating systems compatible with CP / M.