JPH0368424B2 - - Google Patents
Info
- Publication number
- JPH0368424B2 JPH0368424B2 JP56210990A JP21099081A JPH0368424B2 JP H0368424 B2 JPH0368424 B2 JP H0368424B2 JP 56210990 A JP56210990 A JP 56210990A JP 21099081 A JP21099081 A JP 21099081A JP H0368424 B2 JPH0368424 B2 JP H0368424B2
- Authority
- JP
- Japan
- Prior art keywords
- register
- days
- date
- data
- week
- Prior art date
- Legal status (The legal status 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 status listed.)
- Expired - Lifetime
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/02—Digital computers in general; Data processing equipment in general manually operated with input through keyboard and computation using a built-in program, e.g. pocket calculators
- G06F15/025—Digital computers in general; Data processing equipment in general manually operated with input through keyboard and computation using a built-in program, e.g. pocket calculators adapted to a specific application
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Calculators And Similar Devices (AREA)
Description
【発明の詳細な説明】
この発明は、小型電子式計算機などの日数・日
付演算方式に関する。DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a day/date calculation method for small electronic calculators, etc.
従来から日数・日付の演算が可能な小型電子式
計算機、すなわち、日付−日付=日数、日付±日
数=日付の演算を実行可能な小型電子式計算機が
提案されている。しかるに、従来のこの種の計算
機では、日曜日や祭日等の特定日を考慮した演算
が実行できないので、例えば、前述の計算機を使
つて仕事の日程を組んだ場合、組まれた日程中に
日曜日や祭日が入り込んでしまい、実質的な日数
による仕事の日程を組むことはできない不便さが
あつた。 2. Description of the Related Art Compact electronic calculators that are capable of calculating days and dates, ie, date-date = number of days, and date±number of days = date, have been proposed. However, with conventional calculators of this type, it is not possible to perform calculations that take specific days such as Sundays and holidays into account. I had the inconvenience of not being able to plan my work schedule based on the actual number of days because holidays were involved.
そこで、本願出願人は、日曜日や祭日を除いた
日数を演算可能な込型電子式計算機(特開昭55−
87727号)を提案したが、この出願では平日が休
みの人の労働日数を計算する場合には適用できず
不都合であつた。 Therefore, the applicant has developed an electronic calculator (Japanese Unexamined Patent Application Publication No. 1983-1989) that can calculate the number of days excluding Sundays and holidays.
No. 87727), but this application was inconvenient because it could not be applied to calculating the number of working days of a person who has weekdays off.
この発明は、上述した事情に鑑みてなされたも
ので、その目的とするところは、日付−日付=日
数の日数演算時あるいは日付±日数=日付の日付
演算時において、日曜日や祭日に限らずに平日等
の特定の曜日を考慮して実質的な真の日数または
日付を得る日数演算あるいは日付演算を実行可能
な日数・日付演算方式を提供することにある。 This invention was made in view of the above-mentioned circumstances, and its purpose is to calculate the number of days of a date - date = number of days, or the number of days of a date + number of days = a date, without being limited to Sundays or holidays. It is an object of the present invention to provide a day number/date calculation method capable of performing day number calculation or date calculation to obtain a substantially true number of days or date by taking into account specific days of the week such as weekdays.
以下、この発明を図面に示す一実施例について
具体的に説明する。第1図は小型電子式計算機に
おける概略の回路構成図である。図中1は、キー
入力部で、このキー入力部1には、通常の小型電
子式計算機に設けられているテンキー1A、フア
ンクシヨンキー1Bのほか、本実施例では更に日
数・日付入力キー1C(DT)、曜日入力キー1D
(曜日)が夫々設けられている。上記各キーの入
力信号は、バスラインB1を介して制御部2に送
られ、また、テンキー1Aから出力される日付、
日数等の数値データはバスラインB2を介してゲ
ート回路3に送られる。このゲート回路3はバス
ラインB3を介して制御部2から入力されるゲー
ト開閉信号にしたがつて開閉制御され、出力デー
タをバスラインB41〜B47を介してRAM(ランダ
ム・アクセス・メモリ)4の所定レジスタに転送
する。RAM4はその行方向にAレジスタ、Bレ
ジスタ……Fレジスタ、Xレジスタを有する構成
となつている。このRAM4のA〜F、Xレジス
タは、この実施例では日数演算、日付演算時のデ
ータ記憶用に利用されているが、勿論、計算機の
通常の計算の実行時にも利用される。なお、
RAM4の各種レジスタは、制御部2から出力さ
れる読出し/書込み命令にしたがつて読出しある
いは書込み動作を実行する。RAM4の各レジス
タから読出されたデータは、対応するバスライン
B51〜B57を介してゲート回路5に送られる。こ
のゲート回路5は制御部2からバスラインB6を
介して入力されるゲート開閉命令にしたがつて開
閉制御され、出力データをバスラインB71,B72
を介して日数・日付演算部6に転送すると共に、
バスラインB73,B74を介して演算部7に、バス
ラインB75を介して表示部8に夫々転送する。日
数・日付演算部6は、制御部2からの演算命令
OP1により日数、日付(曜日を含む)を演算する
もので、たとえば、1900年代のカレンダを内蔵
し、基準日(たとえば、1900年3月1日〔火〕)
からの基準日数により、日数、日付の演算を実行
し、その結果データD1をゲート回路3に供給す
る。また、演算部7は制御部2からの演算命令
OP2により通常の四則演算などを実行し、その経
過データD2をゲート回路3供給すると共に、判
断信号Jを出力し制御部2に与える。 Hereinafter, one embodiment of the present invention shown in the drawings will be specifically described. FIG. 1 is a schematic circuit diagram of a small electronic calculator. Reference numeral 1 in the figure denotes a key input section, which includes not only a numeric keypad 1A and a function key 1B provided in a normal small electronic calculator, but also a day/date input key 1C in this embodiment. (DT), day of the week input key 1D
(days of the week) are set for each day. The input signals of each of the above keys are sent to the control unit 2 via the bus line B1, and the date and time output from the numeric keypad 1A are
Numerical data such as the number of days is sent to the gate circuit 3 via the bus line B2. This gate circuit 3 is controlled to open and close according to a gate opening/closing signal input from the control unit 2 via a bus line B3, and output data is sent to a RAM (random access memory) via bus lines B41 to B47 . 4 to the specified register. The RAM 4 has an A register, a B register, . . . an F register, and an X register in the row direction. In this embodiment, the A to F and X registers of the RAM 4 are used to store data during day calculations and date calculations, but of course they are also used when the computer performs normal calculations. In addition,
Various registers of the RAM 4 perform read or write operations in accordance with read/write commands output from the control section 2. The data read from each register of RAM4 is transferred to the corresponding bus line.
It is sent to the gate circuit 5 via B51 to B57 . This gate circuit 5 is controlled to open and close in accordance with a gate opening/closing command inputted from the control unit 2 via the bus line B 6 , and sends output data to the bus lines B 71 and B 72 .
is transferred to the number of days/date calculation unit 6 via
The data are transferred to the arithmetic unit 7 via bus lines B 73 and B 74 and to the display unit 8 via bus line B 75 , respectively. The number of days/date calculation unit 6 receives calculation instructions from the control unit 2.
OP 1 calculates the number of days and dates (including days of the week).For example, it has a built-in calendar from the 1900s, and the reference date (for example, Tuesday, March 1, 1900).
Calculation of the number of days and date is performed based on the reference number of days from , and the resulting data D 1 is supplied to the gate circuit 3 . In addition, the calculation unit 7 receives calculation instructions from the control unit 2.
The four normal arithmetic operations are executed by OP 2 , and the progress data D 2 is supplied to the gate circuit 3, and a judgment signal J is outputted and given to the control section 2.
制御部2は計算機としての各種演算や日付演
算、日数演算を実行させるために必要な制御プロ
グラムが固定的に記憶されており、キー入力部1
からのキー入力信号等を入力して上記演算命令
OP1、OP2、ゲート開閉命令等の各種制御信号を
出力すると共に、バスラインB8を介してコード
記憶部9にコード発生命令を与える。このコード
記憶部9は数値0〜9のコードやブランキングコ
ードなどを記憶するもので、制御部2からのコー
ド発生命令により所定のコードを発生し、バスラ
インB9を介してゲート回路5に供給するもので
ある。 The control unit 2 has fixedly stored control programs necessary for executing various calculations as a calculator, date calculations, and number of days calculations, and the key input unit 1
Input the key input signals etc. from
It outputs various control signals such as OP 1 , OP 2 and gate opening/closing commands, and also provides a code generation command to the code storage section 9 via the bus line B8. This code storage section 9 stores codes of numerical values 0 to 9, blanking codes, etc., and generates a predetermined code in response to a code generation command from the control section 2, and supplies it to the gate circuit 5 via the bus line B9. It is something to do.
次に、上述のように構成された小型電子式計算
機の日数・日付演算を実行する場合の動作につい
て説明する。まず、日付−日付=日数の日数演算
動作を第2図および第3図を参照し、たとえば、
1981年11月3日から1981年11月15日までの水曜日
を除く日数を求める演算について説明する。この
場合、テンキー1A、日数・日付入力キー1C、
曜日入力キー1Dを夫々使用して第3図1に示す
如く、
81DT11DT15DT−81DT11DT3DT3曜日=と
操作する。この場合、曜日は数値0〜6に対応し
て日曜日から土曜日を入力するものとする。この
場合、水曜日に対応する「3」を入力する。 Next, the operation of the small electronic calculator configured as described above when performing day/date calculations will be described. First, with reference to Figures 2 and 3, the operation of calculating the number of days (date - date = days), for example,
The calculation for calculating the number of days excluding Wednesdays from November 3, 1981 to November 15, 1981 will be explained. In this case, numeric keypad 1A, number of days/date input key 1C,
Using the day of the week input keys 1D, as shown in FIG. 3, operate 81DT11DT15DT-81DT11DT3DT3 Day of the week=. In this case, the days of the week are assumed to be input from Sunday to Saturday, corresponding to the numerical values 0 to 6. In this case, input "3" corresponding to Wednesday.
これにより、第2図に示すフローチヤートの処
理が実行される。まず、ステツプS1では、第1
の日付データがAレジスタ、第2の日付データが
Bレジスタ、特定曜日データがXレジスタに夫々
記憶される動作が実行される。この場合、第1の
日付データ、第2の日付データは入力された順に
定められるものとする。このステツプS1の実行
において、RAM4の各種レジスタの内容は、第
3図2に示すようになる。なお、Aレジスタ、B
レジスタに記憶されている日付データは夫々年、
月、日の間に区切りコードが挿入されている。ま
た、仮に特定曜日の指定がなかつた場合には、X
レジスタにはブランキングコードが入力されるも
のとする。またステツプS1では同時にCレジス
タにブランキングコードを入力して初期化する。
次いで、ステツプS2に進み、Aレジスタ内の日
付データ「81−11−15」とBレジスタ内の日付デ
ータ「81−11−3」を夫々読み出して日数・日付
演算部6に供給される。そして、日数・日付演算
部6ではAレジスタの日付とBレジスタの日付と
の間に存在する日数が算出され、この日数データ
がデータD1としてCレジスタへ転送される。こ
の場合、日数・日付演算部6は、入力される第1
および第2の日付データを基準日「1900年3月1
日」からの日数データに夫々変換し、この変換日
数データを夫々減算して第1・第2の日付間の日
数データを求め、Cレジスタに記憶させる。これ
によつて、Cレジスタには、第1・第2の日付間
の日数データ「12」が第3図3に示すように記憶
される。そして、次のステツプS3に進み、Xレ
ジスタ内のデータを読出し、演算部7でXレジス
タ内のデータが曜日データであるか否かの判断が
実行される。この場合、Xレジスタには特定曜日
の指定がなければブランキングコードが記憶され
ているが、現時点では、Xレジスタには水曜日の
曜日データ「3」が記憶されているので、
「YES」と判定され、次のステツプS4の実行に進
む。このステツプS4ではBレジスタ内に記憶さ
れている第2の日付データ「81−11−3」が日
数・日付演算部6に供給され、この日付データの
曜日が基準日(1900年3月1日〔火〕)から求め
られ、Dレジスタへ転送される。今の場合、第2
の日付の曜日は「火曜日」であるから、Dレジス
タには第3図4に示すように「2」が記憶され
る。次いで、ステツプS5の実行に進む。このス
テツプS5と次のステツプS6では、第2の日付
(起算日)の曜日が特定曜日のどちら側、すなわ
ち日曜日ないし土曜日において起算曜日を境にし
た場合に特定曜日が前後どちら側の領域内にある
かが判断される。換言すれば、ステツプS5では
Xレジスタ内の曜日データ「3」からDレジスタ
内の曜日データ「2」を減算し、この結果データ
をEレジスタへ転送する。そして、次のステツプ
S6ではEレジスタの内容が正負何れかであるか
が判断され、E≦0であると判断された場合には
次のステツプS7に進み、Eレシスタの内容に
「7」を加算する処理が実行され、起算曜日から
特定曜日までの日数が求められる。今の場合、E
レジスタには「1」が記憶されているので、E>
0となり、次のステツプS8に進む。このステツ
プS8ではCレジスタ内の日数データ「12」から
Eレジスタ内の日数データ「1」を減算し、この
減算データ「11」をEレジスタへ転送する。これ
により、第3図6に示すように、Eレジスタには
日数データ「11」が記憶され、後述のステツプ
S9において「7」で除算すべき日数が求められ
る。次いで、ステツプS9に進み、Eレジスタ内
の日数を「7」で除算してこの除算結果に+1
し、この結果データをFレジスタへ転送し、当該
日数間に特定曜日が何日あるかが求められる。こ
こで、「+1」は最初の特定日を加えるためであ
る。今の場合、ステツプS9では「11÷7+1=
2.5714285」の計算が実行されるので、第3図7
に示すようにFレジスタには「2.5714285」が記
憶される。次いで、ステツプS10に進み、Fレジ
スタ内データの小数部がクリアされ、Fレジスタ
の内容は第3図8に示すように「2」となる。続
いて、ステツプS11に進み、Cレジスタの内容か
らFレジスタの内容、すなわち第1の日付と第2
の日付との間の日数からその間に存在する特定曜
日の日数が減算され、その結果データをCレジス
タへ転送する。今の場合、ステツプS11では12−
2=10の計算が実行されるので、第3図8に示す
ようにCレジスタには「10」が記憶される。この
Cレジスタの内容は次のステツプS12で表示部8
に送られ、第3図9に示すように「10」がデジタ
ル表示される。このようにして得られた日数
「10」は、1981年11月3日から1981年11月15日ま
での水曜日を除く日数で、たとえば、水曜日が休
日の人の労働日数である。 As a result, the process of the flowchart shown in FIG. 2 is executed. First, in step S1, the first
An operation is performed in which the date data is stored in the A register, the second date data is stored in the B register, and the specific day of the week data is stored in the X register. In this case, the first date data and the second date data are determined in the order in which they were input. During the execution of step S1, the contents of the various registers in the RAM 4 become as shown in FIG. 3. In addition, A register, B register
The date data stored in the register is year and year respectively.
A separator code is inserted between the month and day. In addition, if a specific day of the week is not specified,
It is assumed that a blanking code is input to the register. At step S1, a blanking code is simultaneously input to the C register for initialization.
Next, the process proceeds to step S2, where the date data "81-11-15" in the A register and the date data "81-11-3" in the B register are read out and supplied to the number of days/date calculation unit 6. Then, the number of days/date calculation section 6 calculates the number of days existing between the date in the A register and the date in the B register, and this number of days data is transferred to the C register as data D1 . In this case, the number of days/date calculation unit 6 receives the first input
and the second date data as the base date "March 1, 1900"
The converted number of days data are subtracted from each other to obtain the number of days between the first and second dates, and the data is stored in the C register. As a result, the number of days between the first and second dates data "12" is stored in the C register as shown in FIG. 3. Then, the process proceeds to the next step S3, where the data in the X register is read out, and the arithmetic unit 7 determines whether the data in the X register is day of the week data. In this case, the blanking code is stored in the X register unless a specific day of the week is specified, but at the moment the day of the week data "3" for Wednesday is stored in the X register, so
If the determination is ``YES'', the process proceeds to the next step S4. In this step S4, the second date data "81-11-3" stored in the B register is supplied to the days/date calculation unit 6, and the day of the week of this date data is set to the reference date (March 1, 1900). [Tue]) and transferred to the D register. In this case, the second
Since the day of the week of the date is "Tuesday", "2" is stored in the D register as shown in FIG. 3. Next, the process proceeds to step S5. In this step S5 and the next step S6, which side of the specific day of the week does the second date (starting day) fall within the area before or after the starting day of the week on Sunday or Saturday? It is determined whether there is In other words, in step S5, the day of the week data "2" in the D register is subtracted from the day of the week data "3" in the X register, and the resulting data is transferred to the E register. And the next step
In S6, it is determined whether the contents of the E register are positive or negative, and if it is determined that E≦0, the process advances to the next step S7, and the process of adding "7" to the contents of the E register is executed. The number of days from the starting day of the week to a specific day of the week is calculated. In this case, E
Since "1" is stored in the register, E>
0, and the process advances to the next step S8. In this step S8, the number of days data "1" in the E register is subtracted from the number of days data "12" in the C register, and the subtracted data "11" is transferred to the E register. As a result, the number of days data "11" is stored in the E register as shown in FIG.
In S9, the number of days to be divided by "7" is calculated. Next, proceed to step S9, divide the number of days in the E register by "7", and add +1 to this division result.
Then, this result data is transferred to the F register, and it is determined how many specific days of the week there are in the relevant number of days. Here, "+1" is for adding the first specific date. In this case, in step S9, "11÷7+1=
2.5714285" is executed, so the calculation shown in Figure 3.7
As shown in the figure, "2.5714285" is stored in the F register. Next, the process advances to step S10, where the decimal part of the data in the F register is cleared, and the contents of the F register become "2" as shown in FIG. 38. Next, the process advances to step S11, and the contents of the F register, that is, the first date and the second date, are converted from the contents of the C register.
The number of days of the specific day of the week that exists during that time is subtracted from the number of days between this date and the resulting data is transferred to the C register. In this case, step S11 is 12−
Since the calculation of 2=10 is executed, "10" is stored in the C register as shown in FIG. 38. The contents of this C register are displayed on the display 8 in the next step S12.
"10" is digitally displayed as shown in FIG. 3. The number of days "10" obtained in this way is the number of days excluding Wednesdays from November 3, 1981 to November 15, 1981, and is, for example, the number of working days for a person whose holiday is Wednesday.
一方、上述のステツプS3でXレジスタにブラ
ンキングコードが記憶されている場合には、単に
日付−日付=日数の演算で、上述のように当該日
数からその間に存在する特定曜日の日数を減算す
る演算ではないので、ステツプS3からステツプ
S12に進み、日付−日付=日数で得られた日数が
そのまま表示される。 On the other hand, if the blanking code is stored in the X register in step S3 above, the number of specific days of the week existing between the days is subtracted from the number of days by simply calculating date - date = number of days. Since it is not a calculation, the steps start from step S3.
Proceeding to S12, the number of days obtained by date - date = number of days is displayed as is.
次に、日付±日数=日付の日付演算動作を第4
図および第5図を参照し、たとえば、1981年11月
4日から金曜日を除いた20日後の日付を求める演
算について説明する。この場合、テンキー1A、
フアンクシヨンキー1B、日数・日付入力キー1
C、曜日入力キー1Dを夫々使用して第5図1に
示すように、
□8□1DT□1□1DT□4DT□2□0□+□5曜日
□=と操作する。これにより、第4図に示すフロー
チヤートの処理が実行される。まず、最初のステ
ツプS21および次のステツプS22では第2図のス
テツプS1、S3と同様の処理が実行される。この
場合、第5図2に示すように、Aレジスタには起
算の日付データ、Bレジスタには日数「20」、X
レジスタには特定曜日のデータが記憶される。仮
に特定曜日の指定がなければXレジスタにはブラ
ンキングコードが入力される。一方、Cレジスタ
はブランキングコードが入力され初期化される。
而して、ステツプS22において、Xレジスタ内に
ブランキングコードが記憶されていて曜日指定が
されていない場合にはステツプS24に進む。今の
場合、Xレジスタには第5図2に示すように
「5」(金曜日)が記憶されているので、次のステ
ツプS23に進み、Aレジスタ内の11月4日の曜日
(水曜日=3)が日数・日付演算部6で算出され、
この「3」が第5図3に示すようにDレジスタへ
転送される。次のステツプS25では日付±日数=
日付の演算において日数は加算か減算かが判断さ
れる。すなわち、日数「20」の入力後にフアンク
シヨンキー1Bの+キーか−キーのどちらが操作
されたかが判断される。このキー操作の判断は、
図示しないフラグの記憶に応じて行なわれる。而
して、加算の場合にはステツプS26が実行され、
減算の場合にはステツプS27が実行される。この
ステツプS26およびS27は、Xレジスタ内の特定
曜日とDレジスタ内の起算曜日との差の日数を求
めるもので、日付±日数の加減によつて符号が異
なるから、ステツプS26では「X−D」、ステツ
プS27では「D−X」を実行し、その結果データ
をEレジスタへ転送する。今の場合、日数「20」
を加算する場合であるからステツプS26が実行さ
れ、「5−3=2」が実行され、第5図4に示す
ようにEレジスタには「2」が記憶される。次い
でステツプS28ないしS32が順次実行されるが、
このステツプS28ないしS32は上述した第2図の
ステツプS6ないしS10と同様であるのでその説明
は省略する。この場合、ステツプS8における日
数データはステツプS30ではBレジスタと対応す
る。この結果、今の場合、ステツプS30の実行に
よりEレジスタの内容は第5図5に示すように
「18」、次いでステツプS31の実行によりFレジス
タの内容は第5図6に示すように「3.5714285」、
更にステツプS32の実行によりFレジスタの内容
は第5図7に示すように「3」となる。 Next, set the date calculation operation for date ± number of days = date to the fourth
With reference to FIG. 5 and FIG. 5, an operation for determining, for example, the date 20 days after November 4, 1981, excluding Fridays, will be explained. In this case, numeric keypad 1A,
Function key 1B, number of days/date input key 1
C. Using the day of the week input keys 1D, perform the following operations as shown in FIG. As a result, the process of the flowchart shown in FIG. 4 is executed. First, in the first step S21 and the next step S22, processing similar to steps S1 and S3 in FIG. 2 is executed. In this case, as shown in Figure 5 2, the A register contains the starting date data, the B register contains the number of days "20", and
Data for a specific day of the week is stored in the register. If no specific day of the week is specified, a blanking code is input to the X register. On the other hand, the C register is initialized by inputting a blanking code.
In step S22, if a blanking code is stored in the X register and no day of the week has been designated, the process advances to step S24. In this case, as "5" (Friday) is stored in the X register as shown in FIG. ) is calculated by the days/date calculation unit 6,
This "3" is transferred to the D register as shown in FIG. In the next step S25, date ± number of days =
In date calculations, it is determined whether the number of days is added or subtracted. That is, after inputting the number of days "20", it is determined whether the + key or the - key of the function key 1B is operated. This key operation judgment is
This is performed according to the storage of a flag (not shown). Therefore, in the case of addition, step S26 is executed,
In the case of subtraction, step S27 is executed. Steps S26 and S27 are to find the number of days of the difference between the specific day of the week in the '', and in step S27 executes ``D-X'' and transfers the resulting data to the E register. In this case, the number of days is "20"
Since this is a case of adding , step S26 is executed and "5-3=2" is executed, and "2" is stored in the E register as shown in FIG. Next, steps S28 to S32 are sequentially executed.
These steps S28 to S32 are the same as steps S6 to S10 in FIG. 2 described above, so their explanation will be omitted. In this case, the number of days data in step S8 corresponds to the B register in step S30. As a result, in this case, the content of the E register becomes "18" as shown in FIG. 5 by executing step S30, and the content of the F register becomes "3.5714285" as shown in FIG. ”,
Further, by executing step S32, the contents of the F register become "3" as shown in FIG. 5.
次にステツプS33に進み、ステツプS33ないし
S35が順次実行される。このステツプS33ないし
S35はFレジスタ内の特定曜日の日数とBレジス
タ内の日数とを加えたときに、更に特定曜日を含
むかどうかを検出する処理である。すなわち、ス
テツプS33でFレジスタの内容がCレジスタの内
容と等しいか否かの判断が実行されるが、最初
(次のステツプS34の実行前)はCレジスタの内
容はブランキングコードであるから、Fレジスタ
の内容と等しくならず、F≠Cであるので、次の
ステツプS34に進み、Fレジスタの内容がCレジ
スタへ転送される。次いでステツプS35が実行さ
れ、Eレジスタの内容とFレジスタの内容とを加
えた値をEレジスタへ入力する。これによりEレ
ジスタには特定曜日と起算曜日との間にある日数
と特定曜日とを加えて得られた日数が記憶され
る。そして、このEレジスタ内の日数をもう一度
「7」で除算する為に、上述のステツプS31に戻
し、ステツプS31ないしS33を順次実行する。こ
の場合、特定曜日の日数が1日増えれば、ステツ
プS33で「NO」と判断され、F=Cとなるまで
上述のステツプS31ないしS35が繰り返し実行さ
れるが、特定曜日の日数が増えなければ、ステツ
プS33で「YES」と判断され、次のステツプS36
の実行に進む。今の場合、ステツプS34でCレジ
スタの内容は第5図8に示すように「3」とな
り、またステツプS35の実行により、「18+3=
21」が求められ、Eレジスタの内容は第5図9に
示すように「21」となる。そして、ステツプS31
に戻り、「21/7+1=4」が求められるので、
Fレジスタの内容は第5図10に示すように
「4」となる。この場合、特定曜日の日数が1日
増えたのでステツプS33では「NO」と判断され、
ステツプS34が実行される。この結果、Cレジス
タの内容は第5図11に示すように「4」とな
る。そして、ステツプS35に進み、「21+4=25」
が求められ、Eレジスタの内容は第5図12に示
すように「25」となる。そして、ステツプS31の
実行により「25/7+1=4.5714285」が求めら
れるので、Fレジスタの内容は第5図13に示す
ようになり、次のステツプS32の実行により第5
図14に示すように「4」となり、Cレジスタの
内容と一致するようになる。この結果、ステツプ
S33からステツプS36の実行に進む。 Next, proceed to step S33, and step S33 or
S35 is executed sequentially. This step S33 or
S35 is a process of detecting whether or not a specific day of the week is further included when the number of days of the specific week in the F register and the number of days in the B register are added. That is, in step S33, it is determined whether the contents of the F register are equal to the contents of the C register, but initially (before executing the next step S34), the contents of the C register are blanking codes. Since it is not equal to the contents of the F register and F≠C, the process advances to the next step S34, and the contents of the F register are transferred to the C register. Next, step S35 is executed, and a value obtained by adding the contents of the E register and the contents of the F register is input to the E register. Thereby, the number of days obtained by adding the number of days between the specific day of the week and the starting day of the week and the specific day of the week is stored in the E register. Then, in order to divide the number of days in the E register by "7" again, the process returns to step S31 described above and steps S31 to S33 are sequentially executed. In this case, if the number of days on the specific weekday increases by one day, "NO" is determined in step S33, and the above-mentioned steps S31 to S35 are repeatedly executed until F=C, but if the number of days on the specific weekday does not increase, , it is judged as "YES" in step S33, and the next step S36
Proceed to execution. In this case, the content of the C register becomes "3" in step S34 as shown in FIG.
21'' is calculated, and the contents of the E register become ``21'' as shown in FIG. 5. And step S31
Returning to , "21/7 + 1 = 4" is calculated, so
The contents of the F register are "4" as shown in FIG. 5 and 10. In this case, the number of days on the specific weekday has increased by one day, so step S33 is determined to be "NO".
Step S34 is executed. As a result, the contents of the C register become "4" as shown in FIG. 5. Then, proceed to step S35 and get "21+4=25"
is calculated, and the contents of the E register become "25" as shown in FIG. 5. Then, by executing step S31, "25/7+1=4.5714285" is obtained, so the contents of the F register become as shown in FIG.
As shown in FIG. 14, it becomes "4" and matches the contents of the C register. As a result, the step
The process proceeds from S33 to execution of step S36.
このステツプS36ではBレジスタの内容にFレ
ジスタの内容を加算し、この結果データをFレジ
スタへ転送する処理が実行される。今の場合、F
レジスタの内容は、第5図15に示すように、
「20+4=24」となる。そして、次のステツプ
S37では上述のステツプS25と同様の判断を実行
し、日付±日数の演算が加算である場合にはステ
ツプS38に進み、減算である場合にはステツプ
S39に進む。このステツプS38、S39は、Aレジス
タ内の日付からFレジスタ内の日数分だけ前ある
いは後の日付を算出し、この日付をCレジスタへ
転送する。すなわち、Aレジスタ内の日付を基準
日「1900年3月1日」からの日数データに変換
し、この日数データからFレジスタ内の日数デー
タを加算あるいは減算し、これにより得られた日
数から日付を逆算することにより実行する。今の
場合、日付±日数の演算は加算であるから、ステ
ツプS38が実行され、Cレジスタの内容は、第5
図16に示すように「81年11月28日」となる。そ
して、このレジスタの内容は次のステツプS40で
表示部8に送られ、第5図17に示すように表示
される。このようにして得られた日付は、1981年
11月4日から金曜日を除いて求められた20日後の
日付であり、金曜日を除いて考慮した実質的な日
数である。 In step S36, the contents of the F register are added to the contents of the B register, and the resulting data is transferred to the F register. In this case, F
The contents of the register are as shown in FIG.
"20+4=24". And the next step
In S37, the same judgment as in step S25 described above is performed, and if the calculation of date ± number of days is addition, the process proceeds to step S38, and if it is subtraction, the process proceeds to step S38.
Proceed to S39. Steps S38 and S39 calculate the date before or after the date in the A register by the number of days in the F register, and transfer this date to the C register. In other words, convert the date in the A register to the number of days from the reference date "March 1, 1900", add or subtract the number of days in the F register from this number of days, and convert the resulting number of days to the date. It is executed by calculating backwards. In this case, since the calculation of the date ± number of days is addition, step S38 is executed, and the contents of the C register are
As shown in Figure 16, it is "November 28, 1981". The contents of this register are then sent to the display section 8 in the next step S40 and displayed as shown in FIG. 517. The date thus obtained is 1981
This is the calculated date 20 days after November 4th, excluding Fridays, and is the actual number of days excluding Fridays.
一方、上述のステツプS22でXレジスタにブラ
ンキングコードが記憶されている場合には、単に
日付±日数=日付の演算で、上述したように当該
日付から特定の曜日を除いた日付を求める演算で
はないので、ステツプS22からステツプS24に進
み、Bレジスタの内容をFレジスタへ転送する処
理を実行したのち、ステツプS36の実行に進み、
以下同様な処理が実行される。 On the other hand, if a blanking code is stored in the X register in step S22 above, the calculation to calculate the date by excluding a specific day of the week from the date as described above is not a simple calculation of date ± number of days = date. Therefore, the process proceeds from step S22 to step S24, and after executing the process of transferring the contents of the B register to the F register, the process proceeds to step S36.
Similar processing is executed thereafter.
なお、上記実施例では演算可能な年を1900年代
としたが、この年の範囲は勿論任意である。ま
た、小型電子式計算機に適用したが、計算機能付
き電子時計にも適用できる。 Note that in the above embodiment, the year that can be calculated is the 1900s, but the range of this year is of course arbitrary. Furthermore, although the present invention has been applied to a small electronic calculator, it can also be applied to an electronic watch with a calculation function.
この発明は、以上詳細に説明したように、日付
−日付=日数の日数演算時及び日付±日数=日付
の日付演算時において、使用者の所望する曜日を
指定してこの特定曜日を除いた日数、日付を演算
するように構成したから、実質的な真の日数、日
付を夫々得られることができ、従来のものに比べ
実質的な仕事の日程を組むことができる。そし
て、特定可能な曜日は日曜日や休日に限らず任意
であるので、平日が休みの人にとつても使用便利
なものとなる。 As explained in detail above, this invention provides the number of days by specifying the day of the week desired by the user and excluding this specific day when calculating the number of days for date - date = days and when calculating the number of days for date ± number of days = date. Since the present invention is configured to calculate dates, it is possible to obtain the actual number of days and dates, and it is possible to schedule work more effectively than with conventional systems. Since the days of the week that can be specified are not limited to Sundays and holidays, but can be any day of the week, it is convenient for people who have weekdays off.
図面はこの発明の一実施例を示し、第1図はこ
の発明を適用した小型電子式計算機のシステム構
成図、第2図は日数演算の動作を示すフローチヤ
ート、第3図は同演算動作に応じて変化する各種
レジスタの状態図及び同演算結果の表示状態図、
第4図は日付演算の動作を示すフローチヤート、
第5図は同演算動作に応じて変化する各種レジス
タの状態図及び同演算結果の表示状態図である。
1……キー入力部、1A……テンキー、1B…
…フアンクシヨンキー、1C……日数・日付入力
キー、1D……曜日入力キー、2……制御部、4
……RAM、6……日数・日付演算部、7……演
算部。
The drawings show an embodiment of the present invention; Fig. 1 is a system configuration diagram of a small electronic calculator to which the invention is applied; Fig. 2 is a flowchart showing the operation of calculating the number of days; and Fig. 3 is a diagram showing the operation of the calculation. State diagrams of various registers that change accordingly and display state diagrams of the same operation results,
Figure 4 is a flowchart showing the operation of date calculation.
FIG. 5 is a state diagram of various registers that change according to the same calculation operation, and a display state diagram of the same calculation result. 1...Key input section, 1A...Numeric keypad, 1B...
...Function key, 1C...Number of days/date input key, 1D...Day of the week input key, 2...Control unit, 4
...RAM, 6...day/date calculation section, 7... calculation section.
1 発光素子及びこの発光素子を駆動する二次電
池を内蔵したハンドスキヤナと、
前記ハンドスキヤナが装着され、受光素子と前
記ハンドスキヤナに電源供給する電源供給部を備
えたホルダー部とを具備し、
前記ハンドスキヤナを前記ホルダー部に装着し
た際に、前記ホルダー部の電源供給部からの電源
供給を前記ハンドスキヤナは受け二次電池に充電
すると共に、ハンドスキヤナの発光素子からの光
信号をホルダー部の受光素子に受信させてデータ
の送受信を行なうようにしたことを特徴とするデ
ータ送受信装置。
1. A hand scanner having a built-in light emitting element and a secondary battery for driving the light emitting element, and a holder part to which the hand scanner is mounted and having a light receiving element and a power supply part for supplying power to the hand scanner, When attached to the holder part, the hand scanner receives power supply from the power supply part of the holder part, charges a secondary battery, and causes the light receiving element of the holder part to receive an optical signal from a light emitting element of the hand scanner. 1. A data transmitting/receiving device characterized in that data is transmitted and received using the same method.
Claims (1)
小型電子機器。A small electronic device equipped with a date calculation function.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP56210990A JPS58114263A (en) | 1981-12-28 | 1981-12-28 | Number of days and date operating system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP56210990A JPS58114263A (en) | 1981-12-28 | 1981-12-28 | Number of days and date operating system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS58114263A JPS58114263A (en) | 1983-07-07 |
| JPH0368424B2 true JPH0368424B2 (en) | 1991-10-28 |
Family
ID=16598488
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP56210990A Granted JPS58114263A (en) | 1981-12-28 | 1981-12-28 | Number of days and date operating system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS58114263A (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH01291357A (en) * | 1988-05-18 | 1989-11-22 | Casio Comput Co Ltd | Actual working days calculation method |
-
1981
- 1981-12-28 JP JP56210990A patent/JPS58114263A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS58114263A (en) | 1983-07-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US3863060A (en) | General purpose calculator with capability for performing interdisciplinary business calculations | |
| JPH0214671B2 (en) | ||
| WO1999050718A2 (en) | Tactile actuated electronic computer wrist watch | |
| JPS58114263A (en) | Number of days and date operating system | |
| JPS6158860B2 (en) | ||
| JPS6025621Y2 (en) | time control device | |
| JPS6329236B2 (en) | ||
| JPH0445071Y2 (en) | ||
| JPS5856894B2 (en) | Working time management device | |
| JPH02292665A (en) | Schedule controller | |
| JP3328815B2 (en) | Timetable display device and timetable display control method | |
| EP0698852B1 (en) | Power-off procedure for data processing apparatus | |
| JPS5920996B2 (en) | Keisankitsukitokei | |
| JPS6329237B2 (en) | ||
| JPS6019537B2 (en) | Key input method | |
| JPH0511074A (en) | Electronic clock | |
| JPH0726761Y2 (en) | Data storage | |
| JPH052877Y2 (en) | ||
| JPH01291357A (en) | Actual working days calculation method | |
| JPH0332116B2 (en) | ||
| JPH0127475B2 (en) | ||
| JPS6040066B2 (en) | Calendar information display method | |
| JPS62126459A (en) | Electronic scheduler calendar date specification method | |
| JPH0214745B2 (en) | ||
| JPS6025625Y2 (en) | Date data supply device |