Abstract:
A printer having an underlining function includes an underline position memory. Each bit of the underline position memory is allotted to each printable position, and contents of bits corresponding to the underline positions are inverted.

Description:
This application is a continuation of application Ser. No. 045,182 filed Apr. 30, 1987, now abandoned and parent application Ser. No. 754,440 filed July 12, 1985, now abandoned. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a printer having an underlining function, and more particularly to a printer having a text memory for storing a keyed-in text which is capable of storing digits to be underlined in a line by one bit per digit. 
     2. Description of the Prior Art 
     In a prior art electronic typewriter having a text memory and a underlining function, a keyed-in character string with an underline is stored in the memory by 
     (1) using one bit in each character code as a discrimination bit to indicate presence or absence of underline, or 
     (2) inserting a code to indicate start of underline before a digit from which the underline starts and a code to indicate end of underline after a digit at which the underline ends. 
     In the method (1), one bit in each character code is occupied by the underline bit and hence the number of characters which can be stored is reduced to one half. In the method (2), twice as high a memory capacity is required when a broken line is to be stored. 
     SUMMARY OF THE INVENTION 
     It is an object of the present invention to provide a novel printer which is free from the problem encountered in the prior art printer and which can efficiently store information on character positions at which an underline is marked. 
     In order to achieve the above object, the printer having the underlining function of the present invention has an underline position memory, and one bit is allotted to each printable position, and the bits at the underline positions are inverted. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram of one embodiment of the present invention, 
     FIG. 2 is a bit configuration of an underline position memory in the embodiment, 
     FIG. 3 illustrates the operation of the embodiment, 
     FIG. 4 is a control flow chart of the embodiment, and 
     FIG. 5 illustrates the operation of the embodiment. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     FIG. 1 is a block diagram of one embodiment of an electronic typewriter of the present invention. KB denotes a keyboard which has alphanumeric keys αN for inputting A-Z and 0-9, a carriage return key CR and a switch ULSW for indicating the presence or absence of an underline. CPU denotes a control unit such as a microprocessor which may be a sequential control circuit having a clock pulse generator, a delay circuit, gate circuits and other logic circuits. The CPU functions in accordance with a control procedure stored in a ROM. PRT denotes a printer which prints out characters and numerics corresponding to the depressed keys in response to a print control signal CPRT from the control unit CPU. ROM denotes a read-only memory which stores therein microinstructions of the control procedure shown in FIG. 4 which is necessary to supply the control signals to the printer PRT and other units from the control unit CPU. RAM denotes a random access memory which stores therein operation status of the units or stores the keyed-in characters and numerics in a text area. It includes a line buffer LB, underline position memory areas UDL1 and UDL2, a cursor pointer CP and a text memory TEXT. BUS denotes a bus line for transferring a memory address or data between the control unit CPU and the ROM and RAM. 
     In the present embodiment, the RAM includes the underline position memory areas UDL1 and UDL2 each having the same number of bits as the number of print digits of the printer PRT. For example, when the number of print digits (print width) of the printer PRT is eight digits, the underline position memory areas (hereinafter referred to as underline memories) UDL1 and UDL2 each has an 8-bit length as shown in FIG. 2. Accordingly, if the character memory area (not shown) in the RAM represents each character by one byte (8 bits), 256 characters can be represented. 
     The contents of the underline memories UDL1 and UDL2 have a relation of 
     
         (UDL2)=(UDL1)+(UDL2) 
    
     where the symbol + represents a logical OR. The reason therefor will be explained later. 
     FIG. 3 illustrates the operation of the present embodiment by the key operation and FIG. 4 shows a flow chart of a control procedure. In the present embodiment, the underline memories UDL1 and UDL2 each has an eight-bit length. 
     FIG. 5 shows bit contents of the underline memories UDL1 and UDL2. 
     The operation of the present embodiment is explained with reference to FIGS. 3 to 5. 
     As a power is turned on in a procedure 1, the RAM is cleared in a step S1, and &#34;1&#34; (decimal notation) is set in the cursor pointer, &#34;1&#34; (hexadecimal notation) is set in the UDL1 and &#34;0&#34; (hexadecimal notation) is set in the UDL2. In a step S2, a control loop for watching the depression of key is carried out. 
     In a procedure 2, when the key A is depressed, whether a key input signal is entered by the depression of the character key or not is checked in a step S3. If the depression of the character key is detected in the step S3, the set position of the underline selection switch ULSW is checked in a step S4. Since the underline is not designated in the procedure 2, a character corresponding to the input key signal is printed in a step S5. 
     In a step S7, the input key code is stored at a digit pointed by the cursor pointer of the line buffer and then the content of the cursor pointer is incremented by one. The data &#34;1&#34; in the UDL1 is shifted left by one bit position to change the content of the UDL1 to &#34;2&#34; (hexadecimal notation). 
     In a procedure 3, the keys B and C are depressed and &#34;BC&#34; is printed by the printer PRT in the same manner as the procedure 2. &#34;ABC&#34; is now stored in the line buffer and &#34;8&#34; (hexadecimal notation) is stored in the UDL1. Similarly, &#34;4&#34; (decimal notation) is stored in the cursor pointer. 
     In a procedure 4, the underline selection switch ULSW is switched to XX. When the key D is depressed, steps S3, S4 and S6 are carried out. In the step S6, the input character D and an underline are printed, and the data &#34;0&#34; (hexadecimal notation) in the UDL2 and the data &#34;8&#34; (hexadecimal notation) in the UDL1 and logically ORed and the result &#34;8&#34; (hexadecimal notation) is stored in the UDL2. 
     As &#34;8&#34; (hexadecimal notation) is stored in the UDL2, it means that &#34;1&#34; is stored in the fourth bit from the least significant bit. Thus, the fourth bit indicates the underline for the fourth keyed-in character &#34;D&#34;. 
     In a step S7, the input key code is stored in the digit pointed by the cursor pointer of the line buffer. The content of the cursor pointer is then incremented by one and the data in the UDL1 is shifted left. As a result, &#34;10&#34; (hexadecimal notation) is stored in the UDL1. 
     In procedures 5 and 6, the keys E and F are sequentially depressed and the characters E and F with underlines are printed and &#34;38&#34; (hexadecimal notation) is stored in the UDL2. This indicates that &#34;1&#39;s&#34; are stored in the fourth to seventh bits of the UDL2, as seen from FIG. 5. The print positions corresponding to those bits correspond to the underline positions. 
     Then, the underline selection switch ULSW is switched to XX (no underline) and the character key G is depressed. Thus, the character &#34;G&#34; is printed as shown in a procedure 7 and &#34;A B C D E F G&#34; is stored in the line buffer and &#34;38&#34; (hexadecimal notation) is stored in the UDL2. 
     Finally, in a procedure 8, the carriage return key CR is depressed and a step S8 is carried out. In the step S8, the data in the line buffer and the data in the UDL2 are transferred to the text memory area in the RAM. Then, &#34;1&#34; is stored in the UDL1, &#34;0&#34; is stored in the UDL2 and &#34;1&#34; is stored in the cursor pointer, and the carriage return and the line feed are carried out. 
     In accordance with the present invention, the underline position memory having the same number of bits as the number of print digits of the printer is provided separately from the line buffer. Accordingly, the underline can be printed without reducing the number of different print characters or increasing the capacity of the line buffer.