KR860001785B1 - System program protection circuit of z80 cpu - Google Patents

System program protection circuit of z80 cpu Download PDF

Info

Publication number
KR860001785B1
KR860001785B1 KR1019840006037A KR840006037A KR860001785B1 KR 860001785 B1 KR860001785 B1 KR 860001785B1 KR 1019840006037 A KR1019840006037 A KR 1019840006037A KR 840006037 A KR840006037 A KR 840006037A KR 860001785 B1 KR860001785 B1 KR 860001785B1
Authority
KR
South Korea
Prior art keywords
output
cpu
signal
input
mode
Prior art date
Application number
KR1019840006037A
Other languages
Korean (ko)
Other versions
KR860002760A (en
Inventor
이덕연
Original Assignee
주식회사 금성사
허신구
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 금성사, 허신구 filed Critical 주식회사 금성사
Priority to KR1019840006037A priority Critical patent/KR860001785B1/en
Publication of KR860002760A publication Critical patent/KR860002760A/en
Application granted granted Critical
Publication of KR860001785B1 publication Critical patent/KR860001785B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units

Abstract

The protective circuit sectionalizes a system mode and a user mode to protect the system program from an illegal user instruction. The circuit comprises a clock generator which receives an external signal of (NMI) and CPU signal of (M1) and (iORQ) and whose output is connected to the clock latches; an I/O controller which receives a CPU signal of (M1, iORQ, RD,WR) and the output signal of the clock latches. When a CPU instruction is being fetched, Z-80 CPU is operated in the system mode because a flip-flop of clock latches is set at a high-level by the inverter of the clock generator and the OR gate of the clock latches.

Description

Z 80 CPU의 시스템 프로그램 보호회로System program protection circuit of Z 80 CPU

제1도는 통상의 Z 80 CPU의 핀 구성도.1 is a pin configuration diagram of a typical Z 80 CPU.

제2도는 본 발명의 회로도.2 is a circuit diagram of the present invention.

제3도는 본 발명의 입출력 명령 실행 사이클에 대한 타이밍 챠트.3 is a timing chart of the input / output instruction execution cycle of the present invention.

제4도는 본 발명의 인터럽트 요청/인지 사이클에 대한 타이밍 챠트.4 is a timing chart for the interrupt request / acknowledge cycle of the present invention.

제5도는 본 발명의 모드 변경 출력 명령 사이클에 대한 타이밍챠트.5 is a timing chart for the mode change output command cycle of the present invention.

제6도는 본 발명의 시스템 모드에서 사용자모드로의 변경 사이클에 대한 타이밍 챠트.6 is a timing chart for the change cycle from the system mode to the user mode of the present invention.

제7도는 통상의 인스트럭션 OP 코드 인출 사이클에 대한 타이밍 챠트.7 is a timing chart for a typical instruction OP code fetch cycle.

* 도면의 주요부분에 대한 부호의 설명* Explanation of symbols for main parts of the drawings

1 : 클럭펄스발생기 2 : 클럭래치부1: Clock pulse generator 2: Clock latch unit

3 : 입, 출력제어부 N3, N6: 앤드게이트3: Input and output control unit N 3 , N 6 : End gate

De : 데코더 5 : 컨트롤신호래치부De: Decoder 5: Control signal latch

6 : 어드레스래치부 7 : 데이타래치부6: address latch part 7: data latch part

11 : 래치세트부11: latch set part

본 발명은 Z 80 CPU를 사용하는 컴퓨터에서, 사용자(User)가 클리어 명령이나 입, 출력 명령을 잘못 실행하므로써 CPU의 시스템 프로그램이 파괴되는 것을 방지하기 위하여 컴퓨터의 사용자 모우드와 시스템 모우드를 구분하는 Z 80 CPU의 시스템 프로그램보호 회로에 관한 것이다.In the present invention, a computer using a Z 80 CPU, Z, which distinguishes a user mode from a system mode of a computer in order to prevent a system program of a CPU from being destroyed by a user incorrectly executing a clear command or an input / output command. 80 CPU system program protection circuit.

일반적으로 Z 8000 CPU나 MC 68000CPU등을 사용하는 멀티 유저 컴퓨터 시스템(Multi-User computer system)에는 시스템모우드와 사용자모우드가 하드웨어(Hardware)로 구성되어 있어서, 사용자 모우드에서는 입, 출력 제어명령, 시스템프로그램이 존재하는 메모리에의 기록명령등이 실행되지 못하도록 되어있다. 그러므로, 사용자 모우드에서 상기와 같은 명령을 실행하고자 할 경우에는, 반드시 시스템 콜(System cal) 또는 인터럽트(Interrupt) 방법으로써 시스템 모우드로 변환시킨후, 모니터프로그램 또는 오퍼레이팅시스템 프로그램이 상기의 각종 명령을 실행하도록 하고 있다.In general, a multi-user computer system using a Z 8000 CPU or an MC 68000CPU includes a system mode and a user mode in hardware. In the user mode, input / output control commands and system programs are used. This write command to the existing memory cannot be executed. Therefore, when the user mode is to execute the above commands, the system mode or the interrupt method must be converted to the system mode, and then the monitor program or the operating system program executes the various commands. I'm trying to.

따라서, 사용자 모우드에서 모니터 프로그램 또는 오퍼레이팅 시스템프로그램이 존재하는 메모리 영역을 클리어(Clear)하는 명령을 실행하게 되면, 사용자 모우드와 시스템 모우드의 두모우드가 있는 컴퓨터에서는 에러(Error)를 검출하게 되므로써 시스템이 파손되는 것을 방지할 수 있지만, Z 80 CPU에서는 사용자 모우드와 시스템 모우드가 하드웨어로써 구분되어 있지 않기 때문에, 사용자 프로그램 실행중, 클리어 명령이나 입, 출력 명령을 잘못 실행하게 되면, 사용자 프로그램은 물론 시스템 프로그램까지 모두 파손될 우려가 있었다.Therefore, when the user program executes a command to clear the memory area in which the monitor program or the operating system program exists, the system detects an error in the computer having both the user mode and the system mode. Although it is possible to prevent damage, the Z 80 CPU does not distinguish between the user mode and the system mode by hardware. If the user executes a clear instruction or an input / output instruction incorrectly during the execution of a user program, the user program as well as the system program can be prevented. All of them could be damaged until now.

본 발명은 이와같은 문제점을 해소하기 위하여 안출한 것으로, Z 80 CPU를 사용하는 컴퓨터에 시스템 모우드와 사용자 모우드를 하드웨어적으로 구분하는 회로를 추가하므로써, 사용자 모우드에서의 프로그램이 잘못 실행될 경우 시스템이 파손되는 것을 방지하는데 그 목적이 있는 것이다.The present invention has been made to solve such a problem, and by adding a circuit for separating the system mode and the user mode in hardware to the computer using the Z 80 CPU, the system is damaged if the program in the user mode is executed incorrectly The purpose is to prevent that.

이하에서 이를 상세히 설명하면 다음과 같다.This will be described in detail below.

Z 80 CPU에서 이의 시스템과 CPU 제어 명령인

Figure kpo00001
신호단자에 낸드게이트(N1, N2), 인버터(I1, I2), 오어게이트(O1, O2), 지연기(Dy)로 구성된 클럭펄스 발생기(1)를 연결하고, 이 클럭발생기(1)의 오어게이트(O2)의 출력과 외부로부터의 리세트 출력(
Figure kpo00002
)을, D플립플롭((D1-D3)으로 구성된 클럭 래치부(2)의 플립플롭(D1, D2)을 제어하도록 한 래치세트부(11)의 오어 게이트(O5)입력 단에 연결하며, 상기 클럭발생기(1)의 인버터(I1)출력과 오어게이트(O2)출력은 각기 클럭래치부(2)의 오어게이트(O5)를 거친 플립플롭(D3)과 오어게이트(O4)에 가해지도록 연결하고, 오어게이트(O4), 앤드게이트(N3-N5)로 구성된 입, 출력 제어부(3)에, Z 80의 각 출력단
Figure kpo00003
및 클럭래치부(2)의 플립플롭(D3)의 출력단(Q)을 연결하며, 모드 변경 출력단 (
Figure kpo00004
)을 2입력 앤드 게이트(N6, N7)의 일단을 연결하고, 이들 앤드게이트(N6, N7)의 타단에 각기 입, 출력 제어부(3)의 각 앤드게이트(N4, N5)의 출력이 가해지도록 연결하며, 상기 앤드게이트(N6) 출력은 데코더(De)를 거쳐 4비트 단위의 컨트롤 신호래치부(5), 8비트 단위의 어드레스 래치부(6), 데이타 래치부(7)의 래치용 IC (L1-L4)의
Figure kpo00005
단자에 연결하고, 상기 콘트롤 신호 래치부(5)에는 Z 80의 리드, 라이트 신호(RD, WR)와 외부로 부터의 넌 마스크 에이블 인터럽트(Non Maskable Interrupt)신호(NMi)와 클럭 래치부(2)의 출력(S)이 입력되게 연결하며, Z 80의 어드레스 출력단에 연결된 어드레스 버스에는 데코더(De)의 어드레스 입력단(A0, A1)과 래치용 IC(L3, L3)의 각 어드레스 입력단(A0-A7, A8-A15)을 연결하고, 데이타 버스에는 래치용 IC(L2, L3, L4)의 각 데이타 입, 출력단(D0-D7)과 래치용 IC(L1)의 데이타 입, 출력단(D0-D3)을 연결하며, 또한 데이타 버스의 데이타(D0)가 클럭 래치부(2)의 플립플롭(D1)의 입력단(D)으로 입력되게 연결하여 구성한다.Z 80 CPU has its system and CPU control instructions
Figure kpo00001
Connect a clock pulse generator (1) consisting of NAND gates (N 1 , N 2 ), inverters (I 1 , I 2 ), or gates (O 1 , O 2 ), and delay (Dy) to the signal terminal. The output of the or gate O 2 of the clock generator 1 and the reset output from the outside (
Figure kpo00002
) Is the or gate (O 5 ) input of the latch set portion 11 to control the flip-flops D 1 and D 2 of the clock latch portion 2 composed of D flip-flops (D 1 -D 3 ). And an inverter (I 1 ) output and an or gate (O 2 ) output of the clock generator (1) and flip-flops (D 3 ) passing through the or gate (O 5 ) of the clock latch unit (2), respectively. each output end of the OR connected so applied to the gate (O 4), and the OR gate (O 4), the aND gate (N 3 -N 5) input, the output control section (3), Z 80 consisting of
Figure kpo00003
And an output terminal Q of the flip-flop D 3 of the clock latch unit 2, and a mode change output terminal (
Figure kpo00004
) A two-input AND gate (N 6, N 7) once the connection, these AND gates (N 6, N 7) N 4, each AND gate of each of the input and output control unit 3 on the other end (a, and the N 5 ) And the output of the AND gate (N 6 ) is passed through a decoder (De) to the control signal latch unit (5) in units of 4 bits, the address latch unit (6) in units of 8 bits, and the data latch unit. (7) of the latch IC (L 1- L 4 )
Figure kpo00005
The control signal latch unit 5 includes the Z 80 read and write signals RD and WR, a non-maskable interrupt signal NMi, and a clock latch unit 2; ) Is connected to the input S, and the address bus connected to the address output terminal of Z 80 is connected to the address input terminals A 0 and A 1 of the decoder De and each address of the latch ICs L 3 and L 3 . Input terminals (A 0 -A 7 , A 8 -A 15 ) are connected, and each data input and output terminal (D 0 -D 7 ) and latches of the latching ICs (L 2 , L 3 , L 4 ) are connected to the data bus. The data input and output terminals D 0 -D 3 of the IC L 1 are connected, and the data D 0 of the data bus is input to the input terminal D of the flip-flop D 1 of the clock latch unit 2. Configure by connecting.

이와같이 구성된 본 발명의 작용 및 효과를 설명하면 다음과 같다.Referring to the operation and effects of the present invention configured as described above are as follows.

마이크로 프로세서인 Z 80 CPU가 최초시동시에는 리세트 동작이 실행되어 시스템 모우드로 되게된다.When the microprocessor, the Z 80 CPU, starts up for the first time, a reset operation is performed to enter the system mode.

즉, 외부로부터의 리세트 신호 (

Figure kpo00006
)가 입력되면 래치세트부(11)의 오어 게이트(O3)로 입력되는 리세트 신호(
Figure kpo00007
)에 의하여 클럭래치부(2)의 플립플롭(D1, D2)이 세트되게 된다.That is, the reset signal from the outside (
Figure kpo00006
Is input to the reset gate (O 3 ) of the latch set unit 11
Figure kpo00007
), The flip-flops D 1 and D 2 of the clock latch unit 2 are set.

이때, 리세트가 해제되어 최초 명령이 페치(Fetch)되기 시작될때 Z 80 CPU의 단자(

Figure kpo00008
)가 하이레벨에서 로우레벨로 바뀌게 되므로, 클럭발생기(1)의 인버터(I1)와 클럭래치부(2)의 오어 게이트(O5)에 의하여 클럭래치부(2)의 플립플롭(D3)의 입력단(CP)은 로우레벨에서 하이레벨로 되어 플립플롭(D3)이 세트되게 되며, 이때에는 Z 80 CPU가 무조건 시스템 모우드로 되는 것이다.At this time, when reset is released and the first instruction starts to fetch,
Figure kpo00008
) Is changed from the high level to the low level, the flip-flop (D 3 of the clock latch unit 2 by the inverter I 1 of the clock generator 1 and the or gate O 5 of the clock latch unit 2). ), The input terminal CP is set from the low level to the high level so that the flip-flop D 3 is set. In this case, the Z 80 CPU becomes the system mode unconditionally.

한편, 외부에서

Figure kpo00009
(None Maskable Interrupt)신호입력시, 즉 파워 정전시 또는 긴급히 수행하여야할 인터럽트 신호가 외부에서 요청되었을때는 이 또한 시스템 모우드로 되게 된다.Meanwhile, from the outside
Figure kpo00009
When a (None Maskable Interrupt) signal is input, i.e. during a power outage or when an interrupt signal to be urgently requested is externally requested, this also becomes the system mode.

즉, 제3도와 같이 외부에서 입력되는

Figure kpo00010
가 하이레벨에서 로우레벨로 되면, 이 신호는 오어게이트(O1)를 거쳐서 하나는 Z 80 CPU의
Figure kpo00011
단자로 입력되고, 또 하나는 오어게이트(O2)와 래치세트부(11)의 오어게이트(O3)를 거쳐 클럭 래치부(2)의 플립플롭(D1, D2)을 세트시키게 된다.That is, the external input as shown in FIG.
Figure kpo00010
Goes from high level to low level, this signal goes through the or gate (O 1 )
Figure kpo00011
It is input to the terminal, and another one sets the flip-flops D 1 and D 2 of the clock latch unit 2 via the or gate O 2 and the or gate O 3 of the latch set unit 11. .

또, 상기 오어게이트(O2)의 출력은 인버터(O2) 및 지연기(Dy)를 거쳐 각 래치(L1, L2, L3, L4)의 CP단자에 지연 입력된다.The output of the or gate O 2 is delayed and input to the CP terminals of the latches L 1 , L 2 , L 3 and L 4 via the inverter O 2 and the delay Dy.

이때, 지연을 행하는 이유는 이 Z 80 CPU가 사용자모드 또는 시스템 모드를 수행하고 있는지를 알수 없는 상태에서, 현재 시스템 코드로 있었을 때는 그 수행되는 명령이 완료된 이후에 다음 정보 내용을 저장시켜야 하는 것이므로, 그 다음 정보의 어드레스 값(A0-A15)을 어드레스 래치부(6)에 각기 입력시키고, Z 80 CPU의 헌 데이타 값은 데이타 래치부(7)에, i/o 명령에 따른 리드, 라이트 신호등을 컨트롤 신호 래치부(5)에 각기 래치시키기 위함이다. 이때, 입, 출력제어부(3)의 낸드게이트(N5)의 출력과 어드레스버스를 데코드하는 모드변경출력단(CS)의 신호가 하이레벨로 낸드게이트(N6)로 입력되므로, 데코더(De)의 출력이 상기 각 래치부(5, 6, 7)로 출력되지 않게된다.At this time, the reason for the delay is that it is not known whether the Z 80 CPU is in user mode or system mode, and if the current system code is present, the following information should be stored after the execution of the command is completed. Then, address values A 0 to A 15 of information are respectively input to the address latch unit 6, and old data values of the Z 80 CPU are read and written to the data latch unit 7 according to i / o instructions. This is for latching the traffic light into the control signal latch section 5, respectively. At this time, the output of the NAND gate N 5 of the input / output control unit 3 and the signal of the mode change output terminal CS which decodes the address bus are input to the NAND gate N 6 at a high level. ) Is not output to each of the latch portions 5, 6 and 7.

이후

Figure kpo00012
입력신호에 의한 동작이 Z 80 CPU에 설계된 프로그램대로 시스템모드로써 동작된 이후에
Figure kpo00013
입력신호가 로우레벨에서 하이레벨로 될때, 또는 인출 명령시에 발생되는
Figure kpo00014
이 LOW일때도 항상 시스템모드가 유지되는 것이다.after
Figure kpo00012
After the operation by the input signal is operated in the system mode as the program designed for the Z 80 CPU
Figure kpo00013
Generated when the input signal goes from low to high
Figure kpo00014
The system mode is always maintained even in this LOW state.

한편, Z 80 CPU에 외부에서 단순한 인터럼트 요청이 왔을때는 제4도와 같이 M1

Figure kpo00015
가 모두 로우레벨이 되므로 낸드 게이트(N1)의 출력은 로우레벨로 변하여 액티브 상태가 되고, 또한,
Figure kpo00016
신호가 인버터(I1), 낸드게이트(N2)를 통하여 오어게이트(O1)의 출력단에는 하이레벨로 나타나게 되므로
Figure kpo00017
는 액티브 상태로 되지 못하게 된다.On the other hand, when the Z 80 CPU receives a simple interrupt request from the outside, M 1 and
Figure kpo00015
Since both are at the low level, the output of the NAND gate N 1 is changed to the low level, and becomes active.
Figure kpo00016
Since the signal is displayed at the high level at the output terminal of the or gate O 1 through the inverter I 1 and the NAND gate N 2 .
Figure kpo00017
Will not become active.

한편, 상기 낸드게이트(N1)의 출력이 오어게이트(O2)의 출력을 거쳐 래치세트부(11)의 출력을 하이레벨로 출력시키게 되므로 플립플롭(D1, D2)을 세트시키게 되고, 클럭펄스 발생기(1)의 출력은 래치부(5, 6, 7)의 각 래치용 IC(L1-L4)의 단자(CP)를 로우레벨에서 하이레벨로 액티브시켜, 각 래치부(5, 6, 7)의 입력 값이 래치되게 한다.Meanwhile, since the output of the NAND gate N 1 outputs the output of the latch set unit 11 to the high level through the output of the or gate O 2 , the flip-flops D 1 and D 2 are set. The output of the clock pulse generator 1 activates the terminals CP of the latching ICs L 1 to L 4 of the latch sections 5, 6, and 7 from the low level to the high level. Allow input values 5, 6, and 7 to latch.

즉, 클럭래치부(2)의 플립플롭(D3)의 출력단(Q)의 출력신호(S)가 하이레벨로 되므로써 이때는 Z 80 CPU의 모우드가 시스템모우드로 되는 것이므로, 인터럽트 수행을 위한 사용자 모우드시의 내용을 어드레스, 데이타 래치부(6, 7) 및 컨트롤 신호 래치부(5)에 해당 값을 저장하게 된다.That is, since the output signal S of the output terminal Q of the flip-flop D3 of the clock latch unit 2 becomes high level, at this time, the mode of the Z 80 CPU becomes the system mode. The corresponding values are stored in the address, the data latches 6 and 7 and the control signal latch 5.

한편,

Figure kpo00018
의 입력에 따라 낸드게이트(N1)의 출력이 액티부상태에서 해제될때에는, 플립플롭(D3)의 단자(CP)로 입력되는 오어게이트(O5)의 출력이 로우레벨에서 하이레벨로 되므로, 상기한 바에서와 같이 이미 세트된 플립플롭(D2)의 출력을 래치시켜 플립플롭(D3)의 출력단(Q)에서는 하이레벨이 나타나게 되어 Z 80 CPU의 모우드가 시스템 모우드로 되는 것이다. 이때, Z 80 CPU로 부터 입력되는
Figure kpo00019
Figure kpo00020
는 모두 액티브 상태 즉, 로우레벨 상태이므로, M1의 로우레벨이 인버터(I1), 오어게이트(O4) 및 낸드게이트(N3)를 통하게 되므로, 외부로 출력되는
Figure kpo00021
는 로우레벨로 출력되게 된다.Meanwhile,
Figure kpo00018
When the output of the NAND gate N 1 is released in the active state according to the input of, the output of the or gate O 5 input to the terminal CP of the flip-flop D 3 goes from the low level to the high level. Therefore, as described above, the output of the already set flip-flop (D 2 ) is latched so that a high level appears at the output terminal (Q) of the flip-flop (D 3 ) so that the mode of the Z 80 CPU becomes the system mode. . At this time, input from Z 80 CPU
Figure kpo00019
Wow
Figure kpo00020
Since are all active states, that is, low level state, the low level of M 1 is passed through the inverter (I 1 ), the or gate (O 4 ) and the NAND gate (N 3 ), which is output to the outside
Figure kpo00021
Will be output at the low level.

이상과 같은 과정은 Z 80 CPU에 외부로부터의

Figure kpo00022
신호나 일반 인터럽트 요청시, 본 발명의 하드웨어가 사용자 모드시에는 그 사용자 모드를 정지시켜 시스템 모드로 하는 제어 출력신호 (
Figure kpo00023
, S)를 하이레벨로 출력되게 하고, 제어출력신호 (
Figure kpo00024
)상태는 그대로 유지시키는 변환 동작을 행하여, 시스템 루틴을 행하도록 하는 것이다.The same process from the outside on the Z 80 CPU
Figure kpo00022
When a signal or a general interrupt request is requested, the control output signal for stopping the user mode to the system mode when the hardware of the present invention is in the user mode (
Figure kpo00023
, S) to the high level and the control output signal (
Figure kpo00024
The conversion state is maintained as it is, so that the system routine is executed.

따라서, Z 80 CPU를 이용한 컴퓨터에 있어서 사용자가 i/o명령을 실행하고자 할 경우에는,

Figure kpo00025
가 LOW로 되는 것이므로, 이때는 제4도와 같이 앤드게이트(N2)의출력은 하이레벨이 되어 오어게이트(O1)를 거쳐, Z 80 CPU의
Figure kpo00026
에 연결되는
Figure kpo00027
신호를 보내고, 다른 하나는 오어게이트(O3)를 거쳐 D플립플롭(D1, D2)을 각기 세트시킴과 동시에 각 래치부(5, 6, 7)의 단자(CP)에 로우레벨이 인가되므로 현재 진행중인 내용의 정보값이 각기 래치부(5, 6, 7)에 래치된다.Therefore, if a user wants to execute i / o command in a computer using Z 80 CPU,
Figure kpo00025
Since LOW becomes low, at this time, the output of the AND gate N 2 becomes high level through the OR gate O 1 as shown in FIG.
Figure kpo00026
Connected to
Figure kpo00027
Signal, the other sets the D flip-flops D 1 and D 2 via the or gate O 3 , and at the same time, a low level is applied to the terminal CP of each latch section 5, 6, 7. The information value of the content currently in progress is latched by the latch portions 5, 6, and 7, respectively.

이후

Figure kpo00028
가 원 위치로 해제되면 오어게이트(O5)출력이 하이레벨에서 로우레벨로 되므로 세트된 플립플롭(D3)의 출력이 계속 high를 유지하여 시스템 모드 상태로 유지시킨다.after
Figure kpo00028
When is released to the home position, the or gate (O 5 ) output goes from high level to low level, so the output of the set flip-flop (D 3 ) is kept high to maintain the system mode.

이때

Figure kpo00029
가 원 위치로 해제됨에 따라 플립플롭(D3)의 출력은 로우레벨로,
Figure kpo00030
가 하이레벨로 되므로서 상술한 바와같이
Figure kpo00031
가 로우레벨로 되어 사용자 모드로 전환시키는 것이다.At this time
Figure kpo00029
The output of flip-flop (D 3 ) goes to low level as is released to the home position.
Figure kpo00030
Becomes high level, as described above.
Figure kpo00031
Goes to the low level and switches to user mode.

즉, 언급된 사용자모드에서 i/o명령시 그 내용은 래치부(5, 6, 7)로 기억되는 한편, 플립플롭(D3)에 의해 시스템 모드로 전환되고, 시스템 모드로 전환되면 이러한 동작시 수행하여야 할 제어신호로

Figure kpo00032
신호가 데코더(De)를 동작시켜서 래치부(5, 6, 7)의 내용을 시스템 모드로의 제어계로 선택시켜서 현재 시스템 모드가 i/o명령을 수행하고 있었다면 이를 시스템 모드의 레지스터로 저장시키고, i/o 명령이 없었다면 시스템모드의 제어계로써 상기 내용을 처리하여 i/o명령을 수행하는 것이다. 이러한 상태에서는 사용자 모드에서 내려진 입, 출력장치 구동명령 i/o인스트럭션을 직접 입, 출력 장치에 전달시키지 않고, 이를시스템모드로 전환한 다음 그 정보를 시스템 모드의 명령계통에 내려져서 시스템 계통에서 처리하여야 할 내용이 마무리 된뒤 i/o인스트럭션을 수행하도록 하는 프로그램을 시스템 모드에서 루틴으로 처리한다.That is, the contents of the i / o command in the aforementioned user mode are stored in the latch units 5, 6, and 7, while the system is switched to the system mode by the flip-flop D 3 , and the operation is performed when the system mode is switched. Control signal to be
Figure kpo00032
The signal operates the decoder De to select the contents of the latches 5, 6 and 7 as the control system to the system mode, and if the current system mode is performing i / o commands, it stores them in the system mode register. If there is no i / o command, the system processes the contents and executes the i / o command. In this state, I / O instructions issued from the user mode are not transferred directly to the I / O device. Instead, the system is converted to the system mode and the information is sent to the system mode to process the system. After the work is done, the program that executes the i / o instructions is processed as a routine in system mode.

이후, 시스템모드에서 사용자 모드로 전활할시는 출력명령으로

Figure kpo00033
를 high로 하고 출력데이타 중 D0를 high로 하고 플립플롭(D1)를 제5도와 같이 세트한다.Then, when switching from the system mode to the user mode, the output command is used.
Figure kpo00033
To high, D 0 of the output data to high, and flip-flop (D 1 ) is set as shown in FIG.

그러나, 시스템 모드에서 출력명령을 실행한후 사용자 모드로 가지 않고

Figure kpo00034
이 두번 액티브(Active)되야만 플립플롭(D2)의 출력이 플립플롭(D3)으로 래치 되고, 출력명령 바로 다음의 명령을 시스템 모드에서만 사용할수 있는 메모리에서 인출되고 실행되며, 그 다음 명령의 인출시는 사용자 모드에서 행하여지는 것이다.However, after executing the output command in system mode, it does not go to user mode.
Figure kpo00034
Twice it have to be active (Active), the output of the flip-flop (D 2) are latched by the flip-flop (D 3), it is drawn out and execute the output instruction immediately following the instruction in the memory that can only be used in the system mode, then the command Withdrawal is done in user mode.

또한, 이러한 사용자 모드와 시스템 모드의 하드웨어적 구성에 있어서 듀얼 메모리 멥을 구성할때는 소프트웨어를 다음과 같이 처리하여야 한다.In addition, in the hardware configuration of the user mode and system mode, when configuring the dual memory module, the software should be processed as follows.

즉, 인터럽트 서비스 루틴에서는 입력 명령으로 컨트롤 신호 래치부(5)의 레지스터(L1)에서 모드값(S)을 입력한후, 세이브(Save)시켜 인터럽트 리턴 기능 수행시의 모드값을 다시 리턴시킬수 있도록 하며, 인터럽스 리턴 기능시에는 인터럽트 디스에이블(Disable)모드 값을 출력명령으로 플립플롭(D1)에 래치하도록 하고 리턴 인터럽트 명령을 순서대로 처리하도록 한다.That is, in the interrupt service routine, after inputting the mode value S from the register L 1 of the control signal latch unit 5 as an input command, the mode value S can be saved and returned to return the mode value at the time of performing the interrupt return function. In the interrupt return function, the interrupt disable mode value is latched to the flip-flop (D 1 ) as an output command and the return interrupt command is processed in order.

이때, 상기 인터럽트 디스에이블 기능을 삭제하면, 플립플롭(D1)의 래치로 이루어진 명령이 수행된후 또 다른 인터럽트가 수행되면 모드값을 상실하게 된다.At this time, if the interrupt disable function is deleted, the mode value is lost if another interrupt is performed after the instruction composed of the latch of the flip-flop D 1 is executed.

또한,

Figure kpo00035
서비스 루틴에서는, 콘트롤 신호 래치부(5)의 래치용 IC(L1)에 래치된
Figure kpo00036
값이, 외부
Figure kpo00037
신호인가 또는 사용자 모우드에서 i/o 명령을 수행하므로써 발생된
Figure kpo00038
신호인가가 식별되는 것이다.Also,
Figure kpo00035
In the service routine, the latches of the control signal latch unit 5 are latched to the latching IC L 1 .
Figure kpo00036
Value, external
Figure kpo00037
Generated by performing an i / o command on a signaled or user mode
Figure kpo00038
Signaling is to be identified.

한편, 입, 출력 제어부(3)에선 각 출력 (

Figure kpo00039
)시에 앤드게이트(N7,N6)를 제어하므로써 클럭래치부(2)의 플립플롭(D1)을 홀드(hold)시켜 시스템 모드시의 플립플롭(D3)출력상태를 LOW로 변하지 않도록 유지시키는 것이며, 시스템 모드에서 i/o명령실행시는 Z 80 CPU에
Figure kpo00040
가 가해지면서,
Figure kpo00041
또는
Figure kpo00042
의 제어명령이 컨트롤 신호 래치부(5)로 래치되거나
Figure kpo00043
또는
Figure kpo00044
의 출력으로써 직접 작용하는 것이다.On the other hand, in the input and output control unit 3, each output (
Figure kpo00039
The flip-flop D 1 of the clock latch unit 2 is held by controlling the AND gates N 7, N 6 so that the output state of the flip-flop D 3 in the system mode does not change to LOW. In the system mode when running i / o commands.
Figure kpo00040
Is added,
Figure kpo00041
or
Figure kpo00042
Control command is latched to the control signal latch section 5 or
Figure kpo00043
or
Figure kpo00044
It acts directly as the output of.

이러한 본 발명은 Z 80 CPU의 사용시에 시스템 모드와 사용자 모드시에 이들의 각 상황에 따른 제어신호 (

Figure kpo00045
A0-A15)를 선택적으로 제어하는 회로를 구성하여 사용자 모드와 시스템 모드를 하드 웨어적으로 분리하므로써, 사용자 조작의 잘못에 의한 시스템 파괴를 미연에 방지할 수 있는 유익한 특징이 있는 것이다.The present invention is a control signal according to each of these situations in the system mode and user mode when using the Z 80 CPU (
Figure kpo00045
A 0 -A 15 ) can be configured to selectively control the circuit by separating the user mode and the system mode in a hardware manner, which is an advantageous feature that can prevent the system damage due to user error.

Claims (1)

Z 80 CPU를 사용하는 컴퓨터 시스템에 있어서, 낸드게이트(N1, N2), 오어게이트(O1, O2), 인버터(I1, I2) 및 지연기(Dy)로 구성된 클럭발생기(1)의 입력단에 Z 80 CPU의 신호 (
Figure kpo00046
),(
Figure kpo00047
)와 외부신호 (
Figure kpo00048
)가 입력되게 접속하고, 클럭발생기(1)의 출력이 각 래치부(5, 6, 7)의 단자(CP)로 입력되게 접속하며, 오어게이트(O2), 인버터(I1)의 출력신호 및 리세트 (
Figure kpo00049
)신호가 오어게이트(O5) 및 (O3)를 통하여 클럭래치부(2)로 입력되게 접속하고, 낸드게이트(N3-N5) 및 오어게이트(O4)로 구성된 입, 출력 제어부(3)에는 CPU의 신호(
Figure kpo00050
)와 클럭 래치부(2)의 출력신호가 입력되게 접속하며, 모드변경출력단 신호(
Figure kpo00051
)가 낸드게이트(N6)를 통하여 입력되는 데코더(De)의 출력이 각 래치용 IC(L1-L4)의 각 단자(
Figure kpo00052
)로 입력되게 접속하고, 컨트롤 신호 래치부(5)에는 클럭래치부(2)의 출력(S)과 외부신호(
Figure kpo00053
)와 CPU의 신호(
Figure kpo00054
)가 입력되게 접속하며, 어드레스 버스에는 데코더(De), 래치용 IC(L3) 및 (L2)의 어드레스 단자(A0, A1), (A0-A7) 및 (A8-A15)를, 데이타버스에는 각 래치용 IC(L1, L2, L3, L4)의 데이타 입, 출력단을 접속하여 구성됨을 특징으로 하는 Z 80 CPU의 시스템 프로그램 보호회로.
In a computer system using a Z 80 CPU, a clock generator comprising NAND gates (N 1 , N 2 ), or gates (O 1 , O 2 ), inverters (I 1 , I 2 ), and a delay (Dy) 1) signal of Z 80 CPU at the input of
Figure kpo00046
), (
Figure kpo00047
) And external signal (
Figure kpo00048
) Is connected to the input, the output of the clock generator 1 is connected to the input terminal (CP) of each latch unit (5, 6, 7), the output of the or gate (O 2 ), inverter (I 1 ) Signal and reset (
Figure kpo00049
Signal is connected to the clock latch unit 2 through the or gates (O 5 ) and (O 3 ), and an input / output control unit composed of NAND gates (N 3 -N 5 ) and or gate (O 4 ) (3) the CPU signal (
Figure kpo00050
) And the output signal of the clock latch unit 2 are inputted, and the mode change output terminal signal (
Figure kpo00051
) Is output through the NAND gate (N 6 ), and the output of the decoder (De) is connected to each terminal of each latch IC (L 1- L 4 ) (
Figure kpo00052
The output S of the clock latch unit 2 and the external signal (
Figure kpo00053
) And the signal from the CPU (
Figure kpo00054
) Is connected to the input bus, and the address terminals A 0 , A 1 , (A 0 -A 7 ) and (A 8- ) of the decoder (De), the latching IC (L 3 ) and (L 2 ) A 15 ) is a system program protection circuit for a Z 80 CPU, comprising a data input and an output terminal of each latch IC (L 1 , L 2 , L 3 , L 4 ) connected to a data bus.
KR1019840006037A 1984-09-29 1984-09-29 System program protection circuit of z80 cpu KR860001785B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019840006037A KR860001785B1 (en) 1984-09-29 1984-09-29 System program protection circuit of z80 cpu

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019840006037A KR860001785B1 (en) 1984-09-29 1984-09-29 System program protection circuit of z80 cpu

Publications (2)

Publication Number Publication Date
KR860002760A KR860002760A (en) 1986-04-28
KR860001785B1 true KR860001785B1 (en) 1986-10-22

Family

ID=19235599

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019840006037A KR860001785B1 (en) 1984-09-29 1984-09-29 System program protection circuit of z80 cpu

Country Status (1)

Country Link
KR (1) KR860001785B1 (en)

Also Published As

Publication number Publication date
KR860002760A (en) 1986-04-28

Similar Documents

Publication Publication Date Title
US4961161A (en) Arithmetic processor performing mask and trap operations for exceptions
US4348722A (en) Bus error recognition for microprogrammed data processor
EP0267613A2 (en) Micro processor capable of being connected with coprocessor
US6581120B1 (en) Interrupt controller
EP0230350A2 (en) Protection of data in a multiprogramming data processing system
KR860001785B1 (en) System program protection circuit of z80 cpu
WO1988004449A1 (en) Arrangement for controlling memory operations in a pipeline processor
JPS62179033A (en) Ic microprocessor
US5771361A (en) Data processor having shared terminal for monitoring internal and external memory events
JPH0192843A (en) Data processing apparatus and method
JP3205841B2 (en) Data processing device
JP2581080B2 (en) Microprocessor for debugging
JPH08272770A (en) Microcontroller development system
JPS63173130A (en) Apparatus for expanding instruction set of computer
JP2701799B2 (en) Microcomputer
JP2870405B2 (en) Information processing device
JP3088285B2 (en) In-circuit emulator
JP2945044B2 (en) Evaluation chip
JPH11143732A (en) Microcomputer and emulator
JPH0411895B2 (en)
KR900008883Y1 (en) Bus cycle signal generator
JP2968060B2 (en) Microprocessor
JP2001222443A (en) Data processor
JPS63129427A (en) Conversion circuit for interruption response logic
JPS63155330A (en) Microprogram controller

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
G160 Decision to publish patent application
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 19900108

Year of fee payment: 5

LAPS Lapse due to unpaid annual fee