KR0162462B1 - Device and method for driving microprocessor - Google Patents

Device and method for driving microprocessor Download PDF

Info

Publication number
KR0162462B1
KR0162462B1 KR1019960000104A KR19960000104A KR0162462B1 KR 0162462 B1 KR0162462 B1 KR 0162462B1 KR 1019960000104 A KR1019960000104 A KR 1019960000104A KR 19960000104 A KR19960000104 A KR 19960000104A KR 0162462 B1 KR0162462 B1 KR 0162462B1
Authority
KR
South Korea
Prior art keywords
program
end address
microprocessor
address
register
Prior art date
Application number
KR1019960000104A
Other languages
Korean (ko)
Other versions
KR970059948A (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 KR1019960000104A priority Critical patent/KR0162462B1/en
Publication of KR970059948A publication Critical patent/KR970059948A/en
Application granted granted Critical
Publication of KR0162462B1 publication Critical patent/KR0162462B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30145Instruction analysis, e.g. decoding, instruction word fields
    • G06F9/30149Instruction analysis, e.g. decoding, instruction word fields of variable length instructions
    • G06F9/30152Determining start or end of instruction; determining instruction length
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30181Instruction operation extension or modification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

본 발명은, 마이크로 프로세서의 각 프로그램을 독립적으로 실행할 수 있도록 하고, 상기 각 프로그램의 시작번지와 끝번지를 저장하여 에러발생시 각 프로그램별로 디버깅을 함으로써 적은 시간, 적은 비용으로 프로그램을 용이하게 할 수 있는 효과가 있다.The present invention enables each program of the microprocessor to be executed independently, and stores the start address and the end address of each program to debug each program in the event of an error, thereby facilitating the program at a low time and at a low cost. It works.

Description

마이크로 프로세서 구동장치 및 구동방법Microprocessor Drive and Driving Method

제1도는 종래의 기술에 의한 마이크로 프로세서 구동방법을 개략적으로 도시한 순서도.1 is a flow chart schematically showing a method for driving a microprocessor according to the prior art.

제2도는 종래의 기술에 의한 마이크로 프로세서 구동방법을 상세하게 도시한 순서도.2 is a flow chart showing in detail a microprocessor driving method according to the prior art.

제3도는 본 발명에 의한 마이크로 프로세서 구동장치의 구성도.3 is a configuration diagram of a microprocessor driving apparatus according to the present invention.

제4도는 본 발명에 의한 마이크로 프로세서 구동장치의 각부 동작 파형도.4 is an operation waveform diagram of each part of the microprocessor driving apparatus according to the present invention.

제5도는 본 발명에 의한 마이크로 프로세서 구동장치의 구동방법 중 리셋시 부분 프로그램에 따른 레지스터 입력방법을 도시한 순서도.5 is a flowchart illustrating a register input method according to a partial program at the time of reset among driving methods of a microprocessor driving apparatus according to the present invention.

제6도는 본 발명에 의한 마이크로 프로세서 구동장치의 구동방법 중 리셋후 프로그램 카운터값을 수정하기 위한 방법을 도시한 순서도.6 is a flowchart illustrating a method for modifying a program counter value after reset among driving methods of a microprocessor driving apparatus according to the present invention.

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

1,2,3 : 레지스터 4 : 멀티플렉서1,2,3: Register 4: Multiplexer

5 : 비교기 6 : 프로그램 카운터5: comparator 6: program counter

7,8,9 : 플립플롭7,8,9: flip-flop

본 발명은 마이크로 프로세서(μ-processor)에 관한 것으로, 특히 상기 마이크로 프로세서의 전체 프로그램(program)중 일정 구간의 프로그램만을 처리할 수 있도록 하여 프로그램 개발 및 디버깅(debugging) 효율을 극대화하기 위한 마이크로 프로세서 및 그의 구동방법에 관한 것이다.The present invention relates to a microprocessor (micro-processor), and in particular to a microprocessor for maximizing program development and debugging (debugging) efficiency by being able to process only a certain section of the program of the microprocessor (program); It relates to a driving method thereof.

일반적으로 마이크로 프로세서(μ-processor)는, 리셋번저(reset address)(보통 Φ번지)에 있는 프로그램부터 시작하여 프로그램 카운터(program counter)에 의한 실행 순서에 따라 프로그램을 실행해 나간다.In general, a microprocessor (micro-processor), starting with the program at the reset address (usually Φ address) and executes the program in the order of execution by the program counter (program counter).

즉, 리셋지점에서 상기 프로그램 카운터가 리셋번지를 가지고 있어서, 상기 리셋이 끝나면 마이크로 프로세서는 리셋번지에 있는 프로그램을 실행하고, 이와 동시에 상기 프로그램 카운터 값을 증가시켜 다음 번지에 있는 프로그램을 실행하도록 한다.That is, at the reset point, the program counter has a reset address. When the reset is completed, the microprocessor executes the program at the reset address, and simultaneously increases the value of the program counter to execute the program at the next address.

제1도는 종래의 기술에 의한 마이크로 프로세서의 프로그램 수행흐름을 도시한 것으로, 프로그램의 시작부분은 전형적인 프로그램 실행을 위한 레지스터 셋팅이나 포트(port)의 입출력을 결정하는 초기화부분으로 이루어진다.FIG. 1 illustrates a program execution flow of a microprocessor according to the related art, and the beginning of the program includes an initialization part for determining a register setting for a typical program execution or an input / output of a port.

그리고 상기와 같이 초기화가 끝나면 주프로그램으로 들어가게 되는데, 상기 주프로그램은 기능별로 주프로그램 1에서 주프로그램 N까지 블럭별로 나눌 수 있다.When the initialization is completed as described above, the main program enters the main program. The main program can be divided into blocks from main program 1 to main program N by function.

제2도는 이러한 마이크로 프로세서의 프로그램 수행흐름을 좀 더 구체적으로 도시한 것으로, 마이크로 프로세서의 프로그램 수행흐름은 상기한 바와 같이 처음 리셋번지부터 시작하여 여러과정을 거쳐서 주프로그램에 도달한 후 주프로그램 1부터 수행한다.FIG. 2 shows the program execution flow of the microprocessor in more detail. The program execution flow of the microprocessor starts from the first reset address as described above, and reaches the main program through several processes. Perform.

그러나 상기와 같은 마이크로 프로세서는, 프로그래머가 프로그램을 개발하는데 제1도와 같은 흐름을 갖는 프로그램을 개발한 경우, 임의의 프로그램에서 에러가 발생하면 이를 디버깅하기 위해 프로그래머는 제1도의 모든 순서를 다시 확인해야 한다.However, such a microprocessor, if a programmer develops a program having the same flow as FIG. 1 when developing a program, the programmer has to check all the steps of FIG. 1 again in order to debug an error in any program. do.

즉, 종래의 마이크로 프로세서는, 그 구동방법에 있어서 에러가 발생하면 모든 구동프로그램을 확인하여야 하므로, 상기 구동프로그램이 커지게 되면 디버깅이 매우 어렵고, 또한 디버깅을 한다 하더라도 이를 위한 인적자원, 시간 및 비용면에서 커다란 손실을 가져오게 되는 문제점이 있다.That is, in the conventional microprocessor, if an error occurs in the driving method, all driving programs should be checked. Therefore, when the driving program becomes large, debugging is very difficult, and even if debugging, human resources, time, and cost are required. There is a problem in that a great loss in terms of.

따라서, 본 발명의 목적은, 상기와 같은 문제점을 해결하기 위하여, 각 프로그램을 독립적으로 실행할 수 있도록 하고, 상기 각 프로그램의 시작번지와 끝번지를 저장하여 에러발생시 각 프로그램별로 디버깅을 할 수 있는 마이크로 프로세서 구동장치를 제공하는 것이다.Accordingly, an object of the present invention, in order to solve the above problems, it is possible to run each program independently, and to store the start address and the end address of each program, which can be debugged by each program when an error occurs It is to provide a processor drive.

본 발명의 다른 목적은 상기 마이크로 프로세서 구동장치를 효율적으로 제어하기 위한 마이크로 프로세서 구동장치의 구동방법을 제공하는 것이다.Another object of the present invention is to provide a method of driving a microprocessor driving apparatus for efficiently controlling the microprocessor driving apparatus.

상기 목적을 달성하기 위한 본 발명의 마이크로 프로세서 구동장치는, 전체 프로그램중 실행시키고자 하는 부프로그램의 시작어드레스를 저장하기 위한 제1레지스터와, 초기화 프로그램의 끝 어드레스를 저장하기 위한 제2레지스터와, 상기 실행시키고자 하는 프로그램의 끝 어드레스를 저장하기 위한 제3레지스터와, 상기 제1플립플롭의 출력신호에 따라 제2, 제3레지스터의 출력을 선택적으로 비교기에 출력시키기 위한 멀티플렉서와, 액티브시 포트0,1,2를 통해 상기 제1 내지 제3레지스터에 각각 상기 초기화 프로그램의 끝 어드레스와, 부프로그램의 시작어드레스 및 끝어드레스가 입력되도록 하고 인액티브시에는 상기 포트1,2,3를 마이크로 프로세서의 일반 포트로 사용하도록 하는 제1∼제3 3상 버퍼와, 상기 제2레지스터에 저장된 시작어드레스값이 입력되면 프로그램 수행에 따라 카운터 값을 증가시키는 프로그램 카운터와, 상기 프로그램 카운터의 출력과 제2∼제3레지스터의 출력을 비교하기 위한 비교기와, 상기 프로그램 카운터가 초기 끝 어드레스에 도달하는 순간부터 한주기 동안 하이신호를 출력하는 제1플립플롭과, 마이크로 프로세서의 리셋상태에 따라 상기 멀티플렉서에 선택신호를 인가하는 제2플립플롭과, 상기 제3레지스터의 끝 어드레스와 프로그램 카운터의 카운터 값이 같아지면 부 프로그램 실행 모드를 종결시키도록 하이신호를 출력하는 제3플립플롭을 포함하여 구성된 것을 특징으로 한다.The microprocessor driving apparatus of the present invention for achieving the above object comprises: a first register for storing the start address of the sub-program to be executed in the whole program, a second register for storing the end address of the initialization program; A third register for storing the end address of the program to be executed, a multiplexer for selectively outputting outputs of the second and third registers to a comparator according to an output signal of the first flip-flop, and an active port 0, 1, and 2 input the end address of the initialization program, the start address and the end address of the subprogram to the first to third registers, respectively. First to third three-phase buffers for use as general ports of the first address and start address values stored in the second register A program counter that increases a counter value when the program is input, a comparator for comparing the output of the program counter with the outputs of the second to third registers, and a cycle from the moment the program counter reaches the initial end address. The first flip-flop for outputting a high signal, the second flip-flop for applying a selection signal to the multiplexer according to the reset state of the microprocessor, and the end address of the third register and the counter value of the program counter become negative. And a third flip-flop for outputting a high signal to terminate the program execution mode.

상기 다른 목적을 달성하기 위한 본 발명의 마이크로 프로세서 구동장치의 구동방법은, 초기화 과정과, 복수개의 부 프로그램으로 이루어진 마이크로 프로세서의 프로그램 수행시 상기 초기화 프로그램 수행후 전 프로그램을 수행할 것인지 일부 부 프로그램만 수행할 것인지를 결정하는 과정과, 상기 일부 부 프로그램만을 수행할 경우 해당 부 프로그램의 시작 어드레스와 끝 어드레스를 입력시켜 해당 부 프로그램만을 수행하도록 하는 과정으로 이루어진 것을 특징으로 한다.In the method of driving the microprocessor driving apparatus of the present invention for achieving the above another object, only a partial program whether to perform the entire program after the initialization program during the initialization process and the program execution of the microprocessor consisting of a plurality of subprograms And a process of determining whether or not to perform the partial program and executing only the corresponding subprogram by inputting a start address and an end address of the corresponding subprogram.

이하 첨부도면을 참조하여 본 발명을 좀 더 상세하게 설명하고자 한다.Hereinafter, the present invention will be described in more detail with reference to the accompanying drawings.

본 발명의 마이크로 프로세서 구동장치는, 제3도에 도시한 바와 같이 PPRMEN(Partial Program Run Mode Enable) 신호와 리셋(RESET) 신호를 입력하는 앤드 게이트(AND0)와, 상기 앤드 게이트(AND0)의 출력에 따라 3상 버퍼에 포트0,1,2로부터 실행시킬 부프로그램의 시작 어드레스(START ADDRESS)와, 초기 끝 어드레스(INITIAL END ADDRESS)와, 상기 부프로그램의 끝 어드레스(END ADDRESS)를 입력받아 제1∼제3레지스터(1,2,3)로 각각 출력시키거나, 원래의 마이크로 프로세서의 포트로 사용하도록 하는 3상 버퍼(TB0∼TB2)와, 상기 제2레지스터와 제3레지스터(2,3)의 출력을 프로그램 카운터(6) 값과 비교하기 위한 비교기(5)와, 제2플립플롭(9)의 출력(XYZ)에 따라 상기 비교기(5)로 상기 제2레지스터와 제3레지스터로부터의 입력을 선택적으로 출력시키기 위한 멀티플렉서(4)와, 상기 프로그램 카운터(6)가 초기 끝 어드레스에 도달하는 순간부터 한주기 동안 하이신호(FLAG1)를 출력하는 제1플립플롭(7)과, 상기 제1플립플롭(7)의 출력과 클럭신호의 논리곱을 입력으로 하여 상기 멀티플렉서(4)에 선택신호(XYZ)를 출력하는 제2플립플롭(9)과, 상기 제2플립플롭(9)의 출력(XYZ)가 하이(=1)이면 상기 멀티플렉서(4)의 출력을 제3레지스터의 출력으로 선택하여 프로그램 카운터(6)가 이 값과 같을때 출력신호(FLAG2)를 하이로 하여 부프로그램 실행모드를 종료시키는 제3플립플롭(8)을 포함하여 구성된다.As shown in FIG. 3, the microprocessor driving apparatus of the present invention includes an AND gate AND0 for inputting a Partial Program Run Mode Enable (PPRMEN) signal and a reset signal, and an output of the AND gate AND0. According to the three-phase buffer, the start address (START ADDRESS), the initial end address (INITIAL END ADDRESS), and the end address (END ADDRESS) of the subprogram to be executed from the ports 0, 1, and 2 are input. Three-phase buffers TB0 to TB2 to be output to the first to third registers 1, 2 and 3, or to be used as ports of the original microprocessor, and the second and third registers 2 and 3 And a comparator 5 for comparing the output of the < RTI ID = 0.0 >) < / RTI > with the value of the program counter 6 and the comparator 5 according to the output XYZ of the second flip-flop 9 from the second register and the third register. A multiplexer (4) for selectively outputting an input and said program count The first flip-flop 7, which outputs the high signal FLAG1, and the logical product of the output of the first flip-flop 7 and the clock signal for one period from the moment (6) reaches the initial end address are input. The second flip-flop 9 for outputting the selection signal XYZ to the multiplexer 4 and the output XYZ of the second flip-flop 9 is high (= 1). And a third flip-flop 8 which selects the output as the output of the third register and sets the output signal FLAG2 high when the program counter 6 is equal to this value to end the subprogram execution mode.

상기 구동장치에서 상기 리셋신호와 PPRMEN 신호가 모두 하이이면, 부 프로그램 실행 모드로 동작하게 된다.If the reset signal and the PPRMEN signal are both high in the driving device, the driving device operates in the sub program execution mode.

제4도에서 나타낸 각 시점은, ①은 초기 끝 어드레스 값이 프로그램 카운터의 카운트 값과 같아지는 시점이고, ②는 상기 프로그램 카운터에 부프로그램 시작 어드레스가 입력되어 프로그램 수행에 따라 상기 카운트 값이 증가하게 되는 구간이며, ③은 상기 부 프로그램 끝 어드레스값이 프로그램 카운터의 카운트값과 같아지는 시점이며, ④는 내부 리셋(RST)이 하이가 되어 프로그램 수행을 중단하는 시점으로서, 이를 중심으로 본 발명의 동작을 구체적으로 설명하면 다음과 같다.At each time point shown in FIG. 4, ① denotes a time point at which an initial end address value is equal to a count value of a program counter, and ② denotes a subprogram start address to be input to the program counter so that the count value increases as a program is executed. ③ is a time point at which the sub-program end address value is equal to the count value of the program counter, and ④ is a time point at which the internal reset (RST) becomes high to stop program execution. In more detail as follows.

먼저 상기한 바와 같이 PPRMEN 신호를 1로 입력시키고, 마이크로 프로세서를 리셋시키기 위하여 리셋신호를 1로 입력시켜 내부 리셋신호인 RST 신호를 1로 하여 각 플립플롭 및 기타 레지스터들을 초기화시킨다.First, as described above, the PPRMEN signal is inputted to 1, and the reset signal is inputted to 1 to reset the microprocessor, and the respective flip-flops and other registers are initialized by setting the internal reset signal RST to 1.

그리고 포트φ를 통해 초기 끝 어드레스를 입력시키면, 상기 PPRMEN과 리셋신호가 하이이므로 각 포트0,1,2와 연결된 제1 내지 제3 3상 버퍼가 액티브(ACTIVE)되어 제1레지스터(1)에 상기 데이타, 즉 초기 끝 어드레스가 입력된다.When the initial end address is input through the port φ, since the PPRMEN and the reset signal are high, the first to third three-phase buffers connected to each of the ports 0, 1, and 2 are activated to the first register 1. The data, i.e., the initial end address, is input.

이는 프로그램의 초기화를 위하여 레지스터 셋팅이나 포트의 입,출력 관계등을 셋팅하기 위한 것으로, 리셋 벡터 어드레스부터 상기 초기 끝 어드레스까지 실행된다.This is to set register setting or input / output relationship of ports for initialization of a program, and is executed from the reset vector address to the initial end address.

만일 이러한 초기화 프로그램 부분이 필요없으면 초기 끝 어드레스를 φφφH로 입력시키면 되는데, 이때 상기 초기 끝 어드레스는 BYTE CON 신호가 1이면 상기 제1레지스터의 상위 바이트에 입력되고, φ이면 하위 바이트에 입력된다.If the initialization program part is not necessary, the initial end address may be input as φφφH, wherein the initial end address is input to the upper byte of the first register if the BYTE CON signal is 1, and to the lower byte if φ.

상기 제2레지스터(2)에는, 상기 제1 내지 제3 3상 버퍼가 액티브된 상태에서 포트1을 통하여 전체 프로그램중 실행시키고자 하는 부 프로그램의 시작 어드레스를 입력시킨다.The second register 2 is inputted with a start address of a sub-program to be executed among all programs through port 1 while the first to third three-phase buffers are activated.

이때도 제1레지스터와 마찬가지로 상기 BYTE CON 신호가 1이면 상기 제2레지스터의 상위 바이트에 입력되고, φ이면 하위 바이트에 입력된다.In this case, like the first register, if the BYTE CON signal is 1, the signal is input to the upper byte of the second register, and if φ is input to the lower byte.

상기 제3레지스터(3)에는 상기 제1 내지 제3 3상 버퍼가 액티브된 상태에서 포트2를 통하여 전체 프로그램중 실행시키고자 하는 부 프로그램의 끝 어드레스를 입력시키며, 상위 바이트와 하이 바이트로의 입력은 제1, 제2레지스터와 마찬가지로 BYTE CON 신호에 의해 결정된다.The third register 3 inputs the end address of the sub-program to be executed among the entire programs through the port 2 when the first to third three-phase buffers are activated, and inputs the upper byte and the high byte. As with the first and second registers, is determined by the BYTE CON signal.

상기와 같이 제1 내지 제3레지스터에 각각의 포트0,1,2로부터 각 어드레스가 입력되면 상기 마이크로 프로세서를 실행시키기 위하여 리셋신호를 φ으로 출력한다.As described above, when each address is input from each of the ports 0, 1, and 2 to the first to third registers, a reset signal is output as φ to execute the microprocessor.

상기와 같이 리셋신호를 φ으로 출력함으로써 상기 제1 내지 제3 3상 버퍼는 인액티브되고, 이에따라 상기 포트0,1,2를 마이크로 프로세서의 일반 포트로 사용할 수 있게 되며, 상기 프로그램 카운터(6)는 내부 리셋신호가 φ이 되므로 리셋번지(보통 φφφH)부터 실행한다.By outputting the reset signal as φ as described above, the first to third three-phase buffers are inactive, thereby enabling the ports 0, 1, and 2 to be used as general ports of the microprocessor, and the program counter 6 Since the internal reset signal becomes φ, start from the reset address (usually φφφH).

한편, 상기 제2플립플롭(9)의 출력신호(XYZ)는 내부 리셋시 로우신호를 출력하며, 이에따라 상기 멀티플렉서(4)는 상기 입력(Iφ), 즉 제2레지스터에 저장된 초기 끝 어드레스를 비교기(5)의 일측에 출력한다.On the other hand, the output signal XYZ of the second flip-flop 9 outputs a low signal when the internal reset is performed. Accordingly, the multiplexer 4 compares the initial end address stored in the input Iφ, that is, the second register. Output to one side of (5).

상기 비교기(5)의 다른측에는 상기 프로그램 카운터(6)의 카운트 값이 입력되어 리셋번지부터 시작하여 초기 끝 어드레스까지 도달하는지를 검사한다.On the other side of the comparator 5, the count value of the program counter 6 is inputted to check whether it reaches the initial end address starting from the reset address.

여기서 상기 프로그램 카운터(6)의 카운트 값이 상기 초기 끝 어드레스와 같아지면 상기 비교기(5)는 하이신호를 출력하고, 상기 비교기(5)와 제1플립플롭(7) 사이에 연결된 3상버퍼(TB3)의 인에이블 신호인 상기 제2플립플롭의 출력(XYZ)은 로우이므로 상기 제1플립플롭(7)의 출력(FLAG1)은 1로 된다.Here, when the count value of the program counter 6 is equal to the initial end address, the comparator 5 outputs a high signal and connects the three-phase buffer connected between the comparator 5 and the first flip-flop 7. Since the output XYZ of the second flip-flop, which is an enable signal of TB3), is low, the output FLAG1 of the first flip-flop 7 becomes 1.

그리고 상기 제1플립플롭(7)의 출력(FLAG1)이 1이면 앤드 게이트(AND1)의 출력은 상기 클럭신호에 따라 인에이블되어 제2플립플롭(9)의 출력인 XYZ를 1로 바꾸며, 이에따라 상기 제1플립플롭(7)의 클리어신호(CLR)가 인에이블되어 다시 제1플립플롭(7)의 출력은 0으로 바뀐다.If the output FLAG1 of the first flip-flop 7 is 1, the output of the AND gate AND1 is enabled according to the clock signal to change XYZ, which is the output of the second flip-flop 9 to 1, accordingly. The clear signal CLR of the first flip-flop 7 is enabled, and the output of the first flip-flop 7 is changed back to zero.

즉, 상기 제1플립플롭(7)의 출력(FLAG1)은 상기 프로그램 카운터(6)가 초기 끝 어드레스에 도달하는 순간부터 1클럭주기동안 1이 되며, 이 동안에 PPRMEN 신호와 FLAG1 신호를 입력으로 하는 앤드 게이트(AND2)의 출력은 1이 되어 상기 제1레지스터에 입력되어 있는 부프로그램의 시작 어드레스가 상기 프로그램 카운터(6)로 입력, 셋팅되어 이 어드레스부터 프로그램을 실행하게 된다.That is, the output FLAG1 of the first flip-flop 7 becomes 1 for one clock period from the moment when the program counter 6 reaches the initial end address, during which the PPRMEN signal and the FLAG1 signal are input. The output of the AND gate AND2 is 1, and the start address of the subprogram input to the first register is input and set to the program counter 6 to execute the program from this address.

또한 상기 제2플립플롭의 출력 XYZ가 1이 되었기 때문에 상기 멀티플렉서의 출력은 I1 즉, 제3레지스터에 입력되어 있는 부프로그램의 끝 어드레스가 되며, 상기 비교기(5)는 상기 부프로그램의 끝 어드레스와 프로그램 카운터에서 출력된 부프로그램의 시작 어드레스로부터 끝 어드레스가 입력되어 끝 어드레스까지 도달하는지를 검사하여 전체 프로그램중 실행시키고자 하는 부프로그램만을 실행시키게 된다.In addition, since the output XYZ of the second flip-flop becomes 1, the output of the multiplexer becomes I1, that is, the end address of the subprogram input to the third register, and the comparator 5 is connected to the end address of the subprogram. It checks whether the end address is inputted to the end address from the start address of the subprogram output from the program counter, and executes only the subprogram to be executed among the entire programs.

계속하여 상기 프로그램 카운터의 카운트값과 부 프로그램의 끝 어드레스가 같아지면 상기 비교기(5)는 하이신호를 출력하고, 상기 XYZ 신호도 하이이므로 상기 제3플립플롭(8)의 출력인 FLAG2 신호는 1이 되어 오어 게이트(OR1)을 통해 마이크로 프로세서를 내부 리셋상태가 되도록 하여 부 프로그램 실행 모드를 종료시킨다.Subsequently, when the count value of the program counter is equal to the end address of the subprogram, the comparator 5 outputs a high signal, and since the XYZ signal is also high, the FLAG2 signal that is the output of the third flip-flop 8 is 1. In this manner, the microprocessor is brought into an internal reset state through the OR gate OR1 to terminate the subprogram execution mode.

즉, 본 발명은 동작시 제5도에 도시한 바와 같이, 리셋시 부프로그램의 실행에 관련하여 마이크로 프로세서를 리셋시킨 후 각 레지스터에 초기 끝 어드레스와 부프로그램의 시작 어드레스 및 끝 어드레스를 입력하고, 상기 마이크로 프로세서의 리셋을 해제한 후 제6도에 도시한 바와 같이 프로그램 카운터 값이 초기 끝 어드레스값이 아니면 초기 끝 어드레스로 셋팅하고, 초기 끝 어드레스 처리가 끝나면 다시 프로그램 카운터의 값을 부프로그램의 시작 어드레스 값으로 셋팅하고 상기 프로그램 카운터 값을 증가시켜 부프로그램의 끝 어드레스가 될때까지 상기 부프로그램을 실행시킨다.That is, in the present invention, as shown in FIG. 5 during operation, after resetting the microprocessor in relation to the execution of the subprogram at reset, the initial end address and the start address and end address of the subprogram are input to each register. After releasing the reset of the microprocessor, as shown in FIG. 6, if the program counter value is not the initial end address value, the program counter value is set to the initial end address. The subprogram is executed until the end address of the subprogram is set by setting the address value and increasing the program counter value.

이때 상기 부 프로그램의 시작 어드레스와 끝 어드레스 범위내의 프로그램 실행중 조건명령 및 무조건 명령에 의하여 범위 밖의 프로그램으로 점프(JUMP)하는 경우에는, 상기 부프로그램 모드에서 지원하지 않으며, 따라서 이러한 가능성은 프로그래머가 미리 예측하여 상기 끝 어드레스를 조정해야 한다.At this time, when jumping to a program out of range by a conditional instruction and an unconditional instruction during program execution within the start address and end address range of the subprogram, the subprogram mode does not support it. The end address must be adjusted in anticipation.

그리고 콜(CALL) 명령에 의하여 상기 부 프로그램의 범위 밖의 프로그램을 콜하는 경우에는, 부프로그램 모드에서 지원하여 콜된 프로그램을 실행 후 다시 부프로그램을 실행하도록 하며, 인터럽트(INTERUPT)의 경우에는 인터럽트 소스에 의하여 인터럽트가 걸려서 이를 처리하기 위하여 상기 시작 어드레스와 끝 어드레스 범위밖의 프로그램을 콜하는 것이므로 상기 부프로그램 모드에서 지원하여 범위 밖의 프로그램을 실행 후 다시 부프로그램을 실행한다.When a program outside the range of the subprogram is called by a CALL instruction, the subprogram is supported in subprogram mode to execute the subprogram again after executing the called program, and in the case of an INTERUPT, In order to process this by interruption, a program outside the start address and end address range is called. Therefore, the program is supported in the subprogram mode and the subprogram is executed again after executing the program outside the range.

한편, 조건 점프나 무조건 점프에 의하여 부프로그램 실행 모드가 에러상태가 되면 상기 PPRMEN 신호를 로우로 출력시켜 외부에 에러발생을 알리고 프로세서 리셋 상태로 가며, 상기 부프로그램 실행 모드를 동작시키지 않으려면 상기 PPRMEN 신호를 로우로 입력하고 리셋을 걸어 마이크로 프로세서가 일반적인 프로그램 실행 모드로 동작되도록 하여 마이크로 프로세서 프로그램 수행흐름을 갖도록 한다.On the other hand, when the subprogram execution mode becomes an error state due to a conditional jump or an unconditional jump, the PPRMEN signal is output low to notify the external occurrence of an error and go to the processor reset state, and if the subprogram execution mode is not operated, the PPRMEN The signal is pulled low and reset to allow the microprocessor to operate in the normal program execution mode to have a microprocessor program flow.

이상에서와 같이 본 발명에 의하면, 각 프로그램을 독립적으로 실행할 수 있도록 하고, 상기 각 프로그램의 시작번지와 끝번지를 저장하여 에러발생시 각 프로그램별로 디버깅을 함으로써 프로그램을 적은 시간, 적은 비용으로 용이하게 할 수 있는 효과가 있다.As described above, according to the present invention, each program can be executed independently, and the start address and the end address of each program can be stored to debug the program for each program in the event of an error, thereby facilitating the program at a low time and a low cost. It can be effective.

Claims (2)

전체 프로그램중 실행시키고자 하는 부프로그램의 시작어드레스를 저장하기 위한 제1레지스터와, 초기화 프로그램의 끝 어드레스를 저장하기 위한 제2레지스터와, 상기 실행시키고자 하는 프로그램의 끝 어드레스를 저장하기 위한 제3레지스터와, 상기 제2플립플롭의 출력신호에 따라 제2, 제3레지스터의 출력을 선택적으로 비교기에 출력시키기 위한 멀티플렉서와, 액티브시 포트0,1,2를 통해 상기 제1 내지 제3레지스터에 각각 상기 초기화 프로그램의 끝 어드레스와, 부프로그램의 시작어드레스 및 끝어드레스가 입력되도록 하고 인액티브시에는 상기 포트1,2,3를 마이크로 프로세서의 일반 포트로 사용하도록 하는 제1∼제3 3상 버퍼와, 상기 제2레지스터에 저장된 시작어드레스값이 입력되면 프로그램 수행에 따라 카운터 값을 증가시키는 프로그램 카운터와, 상기 프로그램 카운터의 출력과 제2∼제3레지스터의 출력을 비교하기 위한 비교기와, 상기 프로그램 카운터가 초기 끝 어드레스에 도달하는 순간부터 한주기 동안 하이신호를 출력하는 제1플립플롭과, 마이크로 프로세서의 리셋상태에 따라 상기 멀티플렉서에 선택신호를 인가하는 제2플립플롭과, 상기 제3레지스터의 끝 어드레스와 프로그램 카운터의 카운터 값이 같아지면 부 프로그램 실행 모드를 종결시키도록 하이신호를 출력하는 제3플립플롭을 포함하여 구성된 것을 특징으로 하는 마이크로 프로세서 구동장치.A first register for storing the start address of the subprogram to be executed among all programs, a second register for storing the end address of the initialization program, and a third for storing the end address of the program to be executed A multiplexer for selectively outputting the outputs of the second and third registers to the comparator in accordance with a register and an output signal of the second flip-flop, and through the ports 0, 1, 2 during active operation to the first to third registers. First to third three-phase buffers for inputting the end address of the initialization program, the start address and the end address of the subprogram, and the ports 1, 2, and 3 to be used as general ports of the microprocessor during inactivity. And a program car that increases a counter value according to program execution when a start address value stored in the second register is input. A comparator for comparing the counter with the output of the program counter and the outputs of the second to third registers, a first flip-flop that outputs a high signal for one period from the moment the program counter reaches the initial end address; A second flip-flop for applying a selection signal to the multiplexer according to the reset state of the microprocessor; and a high signal for terminating the sub-program execution mode when the end address of the third register is equal to the counter value of the program counter. And a third flip-flop. 초기화 과정과, 복수개의 부 프로그램으로 이루어진 마이크로 프로세서의 프로그램 수행시 상기 초기화 프로그램 수행 후 전 프로그램을 수행할 것인지 일부 부 프로그램만 수행할 것인지를 결정하는 과정과, 상기 일부 부 프로그램만을 수행할 경우 해당 부 프로그램의 시작 어드레스와 끝 어드레스를 입력시켜 해당 부 프로그램만을 수행하도록 하는 과정으로 이루어진 것을 특징으로 하는 마이크로 프로세서 구동방법.Determining whether to perform all programs or only some sub-programs after performing the initialization program, when performing the initialization process, the microprocessor consisting of a plurality of sub-programs; And inputting a start address and an end address of a program to perform only a corresponding subprogram.
KR1019960000104A 1996-01-05 1996-01-05 Device and method for driving microprocessor KR0162462B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019960000104A KR0162462B1 (en) 1996-01-05 1996-01-05 Device and method for driving microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019960000104A KR0162462B1 (en) 1996-01-05 1996-01-05 Device and method for driving microprocessor

Publications (2)

Publication Number Publication Date
KR970059948A KR970059948A (en) 1997-08-12
KR0162462B1 true KR0162462B1 (en) 1999-01-15

Family

ID=19449034

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019960000104A KR0162462B1 (en) 1996-01-05 1996-01-05 Device and method for driving microprocessor

Country Status (1)

Country Link
KR (1) KR0162462B1 (en)

Also Published As

Publication number Publication date
KR970059948A (en) 1997-08-12

Similar Documents

Publication Publication Date Title
US6145123A (en) Trace on/off with breakpoint register
US4879646A (en) Data processing system with a pipelined structure for editing trace memory contents and tracing operations during system debugging
US5280616A (en) Logic circuit for task processing
JP2655615B2 (en) Information processing device
JPH01233527A (en) Self-testing circuit for information processor
JPH0447856B2 (en)
JP2513417B2 (en) Information processing device
US5129079A (en) Computer system having subinstruction surveillance capability
US5995993A (en) Serial in-circuit emulator
KR0162462B1 (en) Device and method for driving microprocessor
JPH08272770A (en) Microcontroller development system
JPH04359323A (en) Microcomputer
JP2808757B2 (en) Microprocessor for debugging
JP2940309B2 (en) Microcomputer for program development
JPH04370832A (en) Processor circuit
KR920003909B1 (en) Debugging supporting circuit
JPS6015969B2 (en) Microinstruction address generation method
JPH0563820B2 (en)
JPH04112341A (en) Microcomputer lsi
JPH05250161A (en) Microcomputer device
JPS62197834A (en) Microprogram controller
JPH01253032A (en) Microprogram control type processor
JPS59121440A (en) Integration circuit
JPH11110429A (en) Event generating device, and hardware simulation device and method therefor
JPS63129430A (en) Microprogram controller

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20050607

Year of fee payment: 8

LAPS Lapse due to unpaid annual fee