Zortech C++ v2.06

This commit is contained in:
davidly 2024-07-02 07:30:38 -07:00
parent c411c69691
commit ff1b2da987
329 changed files with 46815 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,672 @@
0
Zortech ZED Default Keybindings
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍ» ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º Function keys º Esc º º Cursor keys º
ÌÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍ͹ ÌÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍ͹
ºF1 ZED HELP ºF2 Undo º Abort º ºStart of lineºUp a line ºUp a page º
º #C++ HELP º #Save All º º º^Top of page º º^Top of fileº
ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍͼ ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍ͹
ºF3 Hold->Buf ºF4 Blk->Hold º ºChar->left º ºChar->right º
º #Edit New º #Save º º^Word->left º º^Word->rightº
ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍ͹ ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍ͹
ºF5 Tag<->CursºF6 Place Tag º ºEnd of line ºDown a lineºDown a page º
º º #System º º^End of page º º^End of fileº
ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍ͹ ÉÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍËÍÍÍÍÊÍÍÍÍÍÍËÍÍÍÍͼ
ºF7 Search FwdºF8 Search Bwdº ºToggle insert/OvertypeºDelete charº
º #Find º #Replace º º º º
ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍ͹ ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍͼ
ºF9 Compile ºF10 Debug º Upper label = unshifted key
º #Make º #Print º #Lower label = shift & key
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍͼ ^Lower label = control & key
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³20Help index ³16Alternate keys ³17Control keys ³10Macro function keys ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
1
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º FILES MENU º
º º
º When a file is edited, the old version of the file is kept as a backup. º
º If required, all old versions may be kept on a single directory (see º
º Configuring Zed) with the the same name as the original. Otherwise the old º
º version has the same name as the original, but with an extension of "BAK". º
º º
º Edit (Shift-F3) Saves the current file (if any), then prompts for a new º
º file to edit. You may use a full pathname if required. º
º Save (Shift-F4) Save any changes made to disk, and continue editing. º
º Abort (Alt-Q) Abandon changes made since the last save, clear the buffer.º
º Read (Alt-I) Read the contents of a file at the cursor position. º
º Write (Alt-W) Write part of the current buffer to a disk file. º
º Configure Change the editor configuration, quick-keys, colors etc. º
º Exit (Alt-X) Leave the editor. If the current buffer has been edited º
º since the last save, prompts to see if you wish to save the buffer.º
º If any other buffers have been edited since the last save, displaysº
º them and prompts to see if you want to save them. º
º º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º15 Entering file names 25 Configuring Zed 2 Buffers 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
2
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º BUFFERS º
º º
º The editor has 5 edit buffers, each of which can hold a file being edited. º
º The current buffer no. is shown after the file name at the end of line 2. º
º Each buffer has its own cursor position and text markers. º
º To change or select a different buffer, use the keys Alt 1 to Alt 5 º
º º
º The COMPARE function (Alt-O or Alt-C O) enables you to compare the º
º contents of any two buffers. º
º º
º º
º º
º º
º º
º º
º º
º º
º º
º º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º12 Comparing buffers 16 Alternate Keys 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
3
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º MOVES MENU º
º º
º As well as the normal move functions (Start/End of line,page,buffer), you º
º can also move directly to a given line number in the text (Alt-N), to º
º the end of a program block (AltJ when the cursor is not on a bracket), to º
º the bracket which corresponds to the one the cursor is on (AltJ), or to any º
º one of ten text markers (Alt-M A and enter the number). º
º º
º There is also a TAG marker, which can be used to move back and forth between º
º two places in the buffer - when you press (Alt-M T or F5), the TAG and cursorº
º are exchanged.Pressing (Alt-M T or F5) again returns you to where you were. º
º º
º To place the TAG at the current cursor position, use (Alt-B T or F6). The TAGº
º can also be used as a block delimiter (all text between the cursor and the º
º TAG counts as the block). º
º º
º You can also move to the start and end block markers (Alt-B B and Alt-B K). º
º Note that moving to a marker is the only way of finding out where it is. º
º º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º6 Block Menu 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
4
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º COMPILATION - Zortech C and C++ Compilers º
º º
º The F9 key or the compile option of the Compile menu (Alt-C C) is used to º
º start a compilation. You will first be prompted for any compiler flags º
º which you may wish to use. You may enter these in the same way that you wouldº
º when doing a command line compilation, for example: º
º º
º -ml -c -g (large memory model, compile only, include debug info) º
º º
º You may also include other object file names and libraries by entering them º
º here: º
º -ml myprog.obj mylib.lib º
º º
º Compilation will stop at the first error, and the cursor will be placed on º
º or near the source code which caused the error to occur. If it is a Warning, º
º you may press Enter to continue, or Esc to abort. º
º º
º If you have a Ramdisk, or you keep some compiler files on another directory, º
º you can use the configuration program ZCONFIG to set up these directories. º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º21 Compiler flags 22 Debugging flags 18 Entering Strings 20 Help indexº
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
5
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º EDITING MENU & UNDO º
º Insert Enter Insert mode. Any characters you type will be inserted at the º
º cursor position. Pressing Enter inserts a new line. º
º Overtype Enter Overtype mode. Characters typed will replace the character at º
º the cursor, unless at the end of line, when they will be added. º
º Rest Also F2 (UNDO). Restore the last item deleted at the cursor positionº
º The editor remembers up to 100 items deleted (max 10000 characters).º
º Lower Convert part of the buffer to lower case (calls the Size menu). º
º Upper Convert part of the buffer to lower case (calls the Size menu). º
º Graphic (Alt-7) Insert Ascii graphic character (e.g. for printer control). º
º Setseq Set sequence number to initial value. º
º seQ Insert current value of sequence number in buffer. Increment number.º
º (Useful in #define's for consecutive numbering). º
º Comment (Alt-U) Right-justifies the C++ or C comment on this line º
º + (Alt-0) Move part of the buffer right 1 tab stop. º
º - (Alt-9) Move part of the buffer left one tab stop. These two º
º functions are useful for indenting blocks of C++ code. º
º Auto (Shift-Tab) Toggle auto-indent. Auto-indent automatically inserts º
º tabs and spaces to start each new line level with the one above. º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º13 Size menu 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
6
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º BLOCK MENU & TAG º
º To tag an area of text to delete, print etc., move the cursor to one end of º
º the area, press F6 or (Alt-B T), then move the cursor to the other end. Then º
º perform the function, selecting TAG from the size menu. To move a tagged areaº
º mark it as above, and press F4 or (Alt-B S) to move it to the block buffer. º
º Move to the destination, and press F3 or (Alt-B R) to copy into position. º
º º
º Alternatively, you may wish to use the Wordstar-compatible block move º
º system. Mark the start of the block with (Alt-B B) or (^K B), the end with º
º (Alt B K) or (^K K), and then use block Move (Alt-B M) or º
º (^K V), Copy (Alt-B C) or (^K C), or Delete (Alt-B D) or (^K Y). º
º º
º Every time you copy, move or delete a block or tagged area, the text is also º
º saved in the block hold buffer. You can always copy the block hold buffer º
º into the text using (Alt-B R). You can always copy any sized piece of text toº
º the block hold buffer using the Yank command (Alt Y), useful for copying º
º between different files. If you need to see where the current block is, you º
º can Hilite it (Alt H), (Alt-B H) or (^K H). Pressing a second time removes º
º the highlighting. There are also 9 text markers which can be set (Alt-B P). º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
7
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º SYSTEM COMMANDS & PRINTING º
º º
º System (Shift-F6) you may execute any Operating System command provided º
º you have sufficient memory available. When the command has been º
º completed, you will be back in the editor. You may even temporarilyº
º exit to the operating system, by entering an empty command - to º
º return to the editor, type EXIT at the OS prompt. º
º º
º The last command used is presented as the default. To use this, º
º simply press Enter. You may also use the normal editing keys to º
º edit it, or press Esc to abort. º
º º
º Printing (Shift-F10) You may print any part of the buffer. Which part is º
º printed depends on your response to the size menu. º
º º
º º
º º
º º
º º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º13 Size menu 18 Entering strings 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
8
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º DELETE MENU º
º You may delete any part of the buffer. Which part depends on the size menu : º
º Word - (^T) From the cursor position to the end of the next word. º
º End of line - (^U) From the cursor position to the end of the current line. º
º Line - (^Y) The whole of the current line. º
º Paragraph - From the cursor position until the next completely blank line. º
º Block - The marked block. º
º Tag - Everything between the cursor and the TAG marker. º
º ] - Everything between the cursor and the next corresponding '}'. º
º All buffer - The whole buffer (careful, you may not be able to UNDO this) º
º No of lines - Specify how many lines. º
º º
º Single character delete functions may be carried out using the following keysº
º Del : Delete character under cursor º
º Bksp : Delete character to left of cursor. º
º Everything you delete is saved in the UNDO stack, and may be recalled by º
º pressing F2. º
º NOTE ***** Only up to 10000 characters can be saved in this way - If you º
º delete a block bigger than this, it cannot be recalled. º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
9
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º SEARCH MENU º
º º
º Find (Shift-F7) Set up a string to search for. º
º Case (Alt-K) Set up search string (ignore upper/lower case distinctions) º
º Next (F7) Find next occurrence º
º Last (F8) Find previous occurrence º
º Replace (Shift-F8) Replace found item with string º
º Global (Alt G) Replace throughout file without asking º
º Exit (Esc) return to editing º
º º
º º
º º
º º
º º
º º
º º
º º
º º
º º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º18 Entering strings 14 Wordstar search 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
10
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º MACROS (RECORD & PLAY MENUS) º
º º
º You may save a combination of keystrokes in a MACRO. Press Ctrl & a function º
º key to start recording keystrokes. Press Ctrl and the same function key to º
º stop recording. Press Alt and the function key to replay the saved keystrokesº
º on that function key. Macros are also available on the Record and Play menus º
º for completeness. You may save all the macros to a file for next time by º
º using (Alt-R W) to save, or (Alt-R R) to read back your macros. (If you are º
º not sure of the required file name, enter an ambiguous name like *.* to º
º allow selection from a list.) You may save up to 63 key depressions on a º
º particular function key. º
º º
º If you want to save longer macros, you may record keystrokes in a file, by º
º using (Alt-R L) to start and stop recording, and (Alt-P L) to play back the º
º file. (If you are not sure of the file name, use *.* to get a pick list). º
º º
º On the Play menu, there is an option (Number) to repeat a macro any number º
º of times. If you want to stop the macro repeating once it has started, hold º
º down the Esc key. º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º15 Entering file names 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
11
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º TEXT MENU º
º º
º Lmarg Set the left margin : default 1 º
º Rmarg Set the right margin (0 = no right margin) : default 0 º
º Tabs Set tab stops every n positions : default 8 º
º Update Refresh screen (in case of bugs) º
º Format (^B) Tidy up the layout of part of the buffer, within the º
º specified left and right margins (right margin must be non-zero).º
º Spaces Convert tabs to spaces in part of the buffer º
º tAbs Convert spaces to tabs (where possible) in part of the buffer º
º º
º º
º º
º º
º º
º º
º º
º º
º º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º13 Size menu 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
12
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º COMPILE MENU º
º º
º cOmpile (F9) Compile the program in this buffer. º
º Debug (F10) Debug the program in this buffer. º
º Make (Shift-F9) Call MAKE with a specified makefile (default 'makefile')º
º Any target file can be specified after the makefile separated by a º
º space. Make flags can be specified in the same way. º
º Unlike the -k or -K flags this prompts to save buffers first. º
º Compare (Alt-C) Compare the contents of two buffers. º
º System (Shift-F6) Enter an operating system command or run an external º
º program. º
º Print (Shift-F10) Print part of the buffer. A menu will appear to allow º
º the part of the buffer that is to be printed to be selected. º
º º
º º
º º
º º
º º
º º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º13 Size menu 18 Entering commands 15 File names 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
13
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º SELECTING TEXT º
º º
º Size menu : When a function operates on part of the buffer the size menu º
º allows you to select which part : º
º º
º Word - From the cursor position to the end of the next word. º
º End of line - From the cursor position to the end of the current line. º
º Line - The whole of the current line. º
º Paragraph - From the cursor position until the next completely blank line. º
º Block - The marked block. º
º Tag - Everything between the cursor and the TAG marker. º
º ] - Everything between the cursor and the next corresponding '}'. º
º All buffer - The whole buffer º
º No of lines - Specify how many lines. º
º º
º º
º º
º º
º º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
14
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º WORDSTAR (TM) COMPATIBLE SEARCH º
º º
º ^QF Search for string º
º Enter the string, and then either press Return to start searching, º
º or enter some options followed by return. º
º ^QA Search for string, and replace. º
º Enter the string and the replacement string, and then either press º
º Return to start searching, or enter some options followed by return. º
º º
º Options : º
º B Search backwards towards start of file. º
º U Ignore case (upper and lower case match each other). º
º <no> A number causes search (and replace) to be repeated that no of times.º
º N If replacing, don't ask for confirmation each time. º
º G If replacing, replace every occurrence in rest of file. º
º º
º Entering options : The last options used are presented as the default. º
º To use them, press Enter. You may use the normal editing keys to edit them, º
º or press Esc to abort. º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º18 Entering options 9 Search & Replace 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
15
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º ENTERING FILE NAMES º
º º
º The last file name used is presented as the default. To use this, press º
º Enter. You may use the normal editing keys to edit it, or press Esc to abort.º
º º
º Obtaining a file picking list: º
º ------------------------------ º
º If you are not sure of the required file name, enter an ambiguous name like º
º *.* to allow selection from a list, for example *.c will list all C source º
º files as a picking list. º
º º
º Using the filename picking list: º
º -------------------------------- º
º Use the cursor keys, Home, End ^Home and ^End to move the highlighted bar to º
º the file name required. Press Return to select the highlighted file. º
º º
º If the file you require is not displayed, press Escape to return to the º
º filename prompt. You may use the mouse within a picking list. º
º º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º18 Entering names 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
16
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º ALTernate Keys º
º A mArk the start of a block (Alt-B B) S *Search Menu º
º B *Block Menu T *Text Menu º
º C *Compile Menu U right-jUstify comment (Alt-E C) º
º D *Delete Menu V saVe and exit editor (^K X) º
º E *Edit Menu W Write to file (Alt-F W) º
º F *File Menu X Exit the editor (Alt-F X) º
º G Global replace string (Alt-S G) Y Yank a block to the hold buffer º
º H Toggle Hilite of marked block Z mark end of blocK (Alt-B K) º
º I Input (read) file (Alt-F R) 1 edit buffer 1 º
º J move to corres. bracket (Alt-M [) 2 edit buffer 2 º
º K Search for a string (ignore case) 3 edit buffer 3 º
º L set Left margin (Alt-T L) 4 edit buffer 4 º
º M *Move Menu 5 edit buffer 5 º
º N move to line Number (Alt-M N) 6 not used º
º O Compare two buffers (Alt-C O) 7 Insert graphic character º
º P *Play Menu 8 Toggle block hilite º
º Q Quit current buffer (Alt-F A) 9 move text left 1 tab stop (Alt-E -) º
º R *Record Menu 0 move text right 1 tab stop (Alt-E +)º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
17
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º WORDSTAR (TM) COMPATIBLE KEYS º
º º
º ^S char left ^A word left ^G delete char ^L find/replace again º
º ^D char right ^F word right ^T delete word ^Q Quick move menu º
º ^E line up ^R page up ^Y delete line ^K Block/file menu º
º ^X line down ^C page down ^V Toggle insert ^N Insert line º
º º
º º
º º
º º
º º
º º
º º
º º
º º
º º
º º
º º
º º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º12 Alternate Keys 14 Wordstar search 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
18
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º ENTERING STRINGS ON THE INPUT LINE º
º º
º The last string used in this type of command is presented as the default. º
º To use this, press Enter. You may use the following keys to edit it :- º
º º
º Left arrow Left 1 character ³ ^Left arrow Left 1 word º
º Right arrow Right 1 character ³ ^Right arrow Right 1 word º
º Home Beginning of string ³ End End of string º
º Del Deletes character ³ ^T Deletes the next wordº
º ^U Deletes to end of line ³ ^Y Deletes whole line º
º Ins Toggles Insert mode ³ Esc Abort current commandº
º Return Accepts the string as displayed (no matter where the cursor isº
º Backspace If the cursor is at the end of the string, or you are in º
º insert mode, Backspace deletes the character to the left of º
º the cursor Otherwise, Backspace just moves the cursor left. º
º º
º Note : If you wish to type a completely different string, press ^Y first º
º to clear the default. If you forget to do this, and the old string is longer º
º than the new one, you should press ^U before pressing Return. º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
19
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º OTHER COMPILER FLAGS º
º º
º -cpp use the C++ compiler even on file with a .C extension º
º -v verbose output from compiler º
º -d<id>=<tx> #define macro <id> with a value <tx> º
º -e show the effect of pre-processor during compilation º
º -u suppress the generation of automatic macros º
º -l<list> generate a list file called <list> º
º -i<path> search for include files on the supplied path <path> º
º -C (C++) disable the production of inline code for functions º
º -o+<flag> use the global optimizer and pass it the flag <flag> º
º -f generate inline 8087 code (won't run without a 80x87 chip) º
º -S always generate stack frame (for stack tracing utilities) º
º -o<file> produce an output file called <file>.exe º
º -j use asian language (two byte) characters º
º -J char defaults to unsigned char (normal default is signed char) º
º -w Suppress compiler warning messages º
º -gs produce only symbolic information for debugging º
º -gl produce only line number information for debugging º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º21 Major Flags 22 Debugging flags 18 Entering Strings 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
20
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º Help Index º
ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
º1 Aborting current edit 16Alternate keys 5 Auto-indent º
º6 Block menu 2 Buffers 5 C++ Comments º
º12Comparing buffers 4 Compiling 5 Changing case º
º25Configuring ZED 11Converting tabs/spaces 22 Debugging flags º
º8 Delete menu 7 System Commands 5 Edit menu º
º1 Editing another file 18Entering command string15 Entering file namesº
º1 Exiting from the editor1 Files menu 11 Format text º
º0 Function & cursor keys 5 Graphics characters 20 Help index º
º5 Indentation 5 Insert mode 10 Macros º
º21Major Compiler flags 11Margin settings 3 Move menu º
º19Other Compiler Flags 5 Overtype mode 10 Playing keystrokes º
º7 Printing 1 Read another file 10 Record keystrokes º
º1 Saving current file 9 Search & replace 13 Selecting text º
º5 Sequence number 13Size menu 11 Tab settings º
º6 Tag 11Text formatting 11 Text menu º
º5 Undoing a mistake 24Using a Mouse 23 Using the Debugger º
º17Wordstar keys 14Wordstar search 1 Write block to fileº
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º Use the cursor keys to select the item you want help on and press Enter º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
21
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º MAJOR COMPILER FLAGS º
º Compiler flags may be any of: º
º -a align all structure members on byte boundaries º
º -A enforce strict ANSI C compatibility º
º -b use big compiler (slower but can handle very large programs) º
º -c compile to object only (don't link) º
º -r strict prototyping (functions without a prototype generate an error) º
º -s include stack overflow checking º
º -W compile and link for Microsoft(tm) Windows º
º -p turn auto-prototyping off (-r flag does this automatically) º
º -o use the global optimizer - this takes a lot longer º
º -L use Microsoft(tm) Link instead of Blink for the linking stage º
º -g include full debugging information in the .exe file º
º -m<m> set memory model - <m> may be one of : T TI S SI M MI C CI L LI º
º T - tiny S -small M - medium C - Compact L - Large I - Integer only º
º º
º Special flags valid in ZED only : º
º -k<file> Run MAKE using <file> as the project file (default is makefile) º
º -K<file> Like -k, but don't compile the program you are editing first º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º19 Minor flags 22 Debugging flags 18 Entering Strings 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
22
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º DEBUGGING FLAGS º
º º
º ZED compiler flags for debugging are: º
º -g Full debugger information -gs Symbol information only º
º -gl line number information only º
º º
º To produce an .EXE file for debugging with either the Zortech C++ Debugger orº
º Microsoft CodeView(tm) use: -g -C º
º º
º Other debugging Flags are: º
º -l<list> Generate List file list. -L Use Microsoft(tm) Link º
º -co link for debugging -C Disable inlining of functions º
º -S Always generate stack frame º
º º
º Note: If you use a -g, -gs, or -gl flag you do NOT need to add the -S, º
º -co flags, these will be used automatically. º
º º
º º
º º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º23 Using the Debugger 18 Entering Strings 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
23
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º USING THE DEBUGGER º
º º
º To debug a program from within the editor using the Zortech C++ Debugger º
º use F10 or the Debug menu option of the Compile menu (Alt-C D). º
º º
º You can enter debugger flags if required: º
º /2 Use secondary display /c Clear file related debugging info º
º /e Use expanded memory /m[size] allow size for debugger º
º /n prevent screen snow /o allow direct screen writes º
º /p ignore mouse if fitted /s[path] use this directory º
º /t[size] allow size tracing /x use screen page flipping º
º Any flag can be turned off by adding a -, e.g. /e- º
º º
º If the attempt to invoke the debugger fails, possible reasons are: º
º 1. The -g flag was not used to compile the file. º
º 2. The Zortech C++ Debugger cannot be found on your path. º
º 3. There is insufficient memory, remove any TSR's and try again. º
º º
º NB: This option will only work with v2.0 and above of the Zortech Debuggers º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º22 Debugging flags 18 Entering Strings 20 Help index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
24
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º USING A MOUSE º
º º
º Using a Microsoft(tm) compatible mouse with ZED requires the mouse driver. º
º º
º Menus Activated by moving the mouse pointer to the required menu on º
º the top display line and clicking the left hand mouse button. º
º Menu options Move the mouse cursor over the options and click the left º
º mouse button. Menus are exited by clicking the left mouse º
º button outside of the menu, or by means of the Exit option. º
º Moving the Place the mouse cursor where you wish the text cursor to be º
º text cursor and click the left mouse button. The text cursor will move º
º to that position. º
º Scrolling Hold the left mouse button down and drag the mouse button to º
º the edge of the text area, in the direction opposite to that º
º you wish to the screen to scroll. º
º Block Marking Press and hold the right mouse button at the start of the º
º area you wish to block, and release it at the end of the º
º block. In circumstances you may need to use (Alt-H) or º
º (^K H) to hilite the marked block. º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º16 Alternate keys 17 Wordstar Commands 6 Block Menu 20 Help Index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
25
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º Configuring ZED º
º º
º ZED is configured by selecting the Configure option of the File menu, or º
º using the stand alone program ZCONFIG. Many of the features of the editor º
º can be changed including keybindings and colors. Just select from the menus º
º displayed (as bar menus). To get help on any option press the F1 key. º
º º
º This version of ZED has been modified to bring it more closely into line º
º The IBM SAA and Common User Access guidelines. If you prefer ZED to behave º
º in the same way as previous versions, rename the configuration file z26.cfg º
º to zed.cfg and use this. Zed will the behave in much the same way as version º
º 2.6x. You will still have access to operations using the mouse. In the 2.6x º
º emulation mode the menus operate differently from the 3.0 mode. ZED decides º
º which mode is in use by looking to see if the File menu is assigned to Alt F.º
º If it is not, 2.6x emulation is assumed to be in effect. º
º º
º Please note that ZED supports the EGA/VGA enhanced text modes as well as the º
º extra modes supported by the Video 7 VEGA(tm) VGA. Select the Screen option º
º of ZCONFIG and press F1 (HELP) for more information. º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º20 Help Index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
26
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º Using Project Make º
º º
º ZED allows the Zortech Project Make facility to be used without exiting the º
º debugger. The make facility has only a few thousand bytes less available to º
º it than when it is executed from the command line. The make facility is º
º selected using the Make option of the Compile menu (Shift+F9). º
º º
º The user is prompted for a project file name, with the last name used in the º
º current directory provided as default. If this is cleared using Ctrl+Y and º
º return pressed, the default 'makefile' is used. If a project file name is º
º entered the user may optionally append the name of a target file to build andº
º any MAKE command line switches required seperated by spaces, thus: º
º proj.mak -s test.exe º
º will use the project file proj.mak to build test.exe without echoing make º
º rules to the display. º
º º
º Make macros can also be appended. If a target or switch is required for the º
º default project file 'makefile' the project file must be named. º
º º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º27 Project Make Switches 20 Help Index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
27
ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
º Project Make Switches º
º º
º The following switches are available in the integrated Project Make facility:º
º º
º -d Output debugging information º
º -i Ignore errors from executing make rules º
º -l Show macro expansions from the project file º
º -n Do not execute make rules, write them to stdout º
º -q Return with error if rules would be executed º
º -s Do not echo rules as they are executed º
º -t Update time stamps on files that are out of date º
º º
º In addition Make macros can be specified in the form macro=text º
º º
º A target file to be built may also be specified. º
º º
º For more information on Project Make refer to the chapter on this subject in º
º the C++ Compiler Reference. º
º º
ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
º27 Using Project Make 20 Help Index º
ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,7 @@
#include <stdio.h>
void main()
{
printf( "hello\n" );
}


View File

@ -0,0 +1,24 @@
/*
EXAMPLE ONE
This program illustrates a simple 'C' program that executes
a loop, outputting information to the screen as it goes. This is a long source line for use as an example in window line scrolling.
*/
#include <stdio.h>
int j;
main()
{
int i;
printf("EXAMPLE 1\n");
for (i=0;i<10;i++) {
j = i*i;
printf("%d squared is %d\n",i,j);
}
printf("EXAMPLE 1 finished\n");
exit(0);
}


View File

@ -0,0 +1,52 @@
/*
EXAMPLE TWO
This program illustrates a calling functions with parameters
and automatics.
*/
#include <stdio.h>
char buff[128];
factor(n)
int n;
{
char *s;
int i;
long f;
s = buff;
while (*s) s++;
f = 1;
for (i=1;i<=n;i++) {
f *= i;
}
sprintf(s," - %d factorial is %ld",n,f);
}
display(i)
int i;
{
long j;
char *p;
p = buff;
j = i*i;
sprintf(p,"%d squared is %ld",i,j);
factor(i);
}
main()
{
int i;
printf("EXAMPLE 2\n");
for (i=0;i<10;i++) {
display(i);
printf("%s\n",buff);
}
printf("EXAMPLE 2 finished\n");
exit(0);
}


View File

@ -0,0 +1,61 @@
/*
EXAMPLE THREE
This program illustrates the various types of data available
in a 'C' program.
*/
#include <stdio.h>
int i=1;
unsigned ui=2;
long l=3;
unsigned long ul=4;
char c1='A';
char c2='\n';
char c3=0xa3;
float f1=1.3;
float f2=1.678912;
double d1=1.0;
double d2=123456789.123456;
char a_c[128]= "this is a test string";
int a_i[10]={100,101,102,103,104,105,106,107,108,109};
struct test_s {
int i;
int j;
unsigned fl1:4;
unsigned fl2:2;
unsigned fl3:6;
unsigned fl4:6;
};
struct test_s str;
struct test_s a_str[4];
char *p_c=a_c;
struct test_s *p_str=a_str;
int *p_i=a_i;
main()
{
char *p;
printf("EXAMPLE 3\n");
p = a_c;
for (i=0;i<10;i++) {
int j;
unsigned k;
j = i*i;
k = j*i;
sprintf(p,"%d squared is %d and cubed is %d",i,j,k);
puts(a_c);
}
printf("EXAMPLE 3 finished\n");
exit(0);
}


View File

@ -0,0 +1,52 @@
/*
EXAMPLE FOUR
This program illustrates a calling functions using register variables
*/
#include <stdio.h>
char buff[128];
long factor(n)
int n;
{
int i;
long f;
f = 0;
for (i=1;i<=n;i++) {
f += i;
}
return(f);
}
display(i)
int i;
{
long j;
char *p;
p = buff;
j = i*i;
sprintf(p,"%d squared is %ld - the progressive sum of %d is %ld",i,j,i,factor(i));
}
dummy()
{
return;
}
main()
{
int i;
printf("EXAMPLE 4\n");
for (i=0;i<10;i++) {
display(i);
printf("%s\n",buff);
}
printf("EXAMPLE 4 finished\n");
exit(0);
}


View File

@ -0,0 +1,68 @@
/*
Example Program 5
Shows how more than one source file is debugged
'box' is in exam5a
Demonstrates graphics being debugged, cga and ega
*/
#include <stdio.h>
#include <dos.h>
#define VIDEO_INT int86(0x10,&regs,&regs)
union REGS regs;
unsigned old_mode;
int box(int x,int y,int w,int h);
main()
{
printf("EXAMPLE 5\n");
/* get old mode */
regs.x.ax = 0x0f00;
VIDEO_INT;
old_mode = regs.x.ax&0xff;
/* set CGA mode */
regs.x.ax = 0x0004; /* CGA graphics */
VIDEO_INT;
/* draw some boxes */
box(0,0,319,199); /* box the screen */
printf("press any key\n");
getch();
/* test if EGA present */
regs.h.bl = 0x10;
regs.h.ah = 0x12;
VIDEO_INT;
if (regs.h.bl!=0x10) {
/* set EGA mode */
regs.x.ax = 0x0010; /* EGA graphics */
VIDEO_INT;
/* draw some boxes */
box(0,0,639,349);
printf("press any key\n");
getch();
}
/* restore old mode */
regs.x.ax = old_mode;
int86(0x10,&regs,&regs);
printf("EXAMPLE 5 finished\n");
exit(0);
}


View File

@ -0,0 +1,26 @@
/*
Example Program 5a
called from example program 5 to draw a box
plot is in exam5b
*/
int plot(int x,int y);
int box(int x,int y,int w,int h)
{
int i;
while (w>0&&h>0) {
for (i=x;i<x+w;i++) plot(i,y);
for (i=y+1;i<y+h;i++) plot(x,i);
for (i=x;i<x+w;i++) plot(i,y+h-1);
for (i=y+1;i<y+h;i++) plot(x+w-1,i);
w -= 40;
h -= 20;
x += 20;
y += 10;
}
}


View File

@ -0,0 +1,20 @@
/*
Example Program 5b
called from example program 5a to plot a point
*/
#include <dos.h>
#define VIDEO_INT int86(0x10,&regs,&regs)
union REGS regs;
plot(int x,int y)
{
regs.x.ax = 0x0c03;
regs.x.cx = x;
regs.x.dx = y;
VIDEO_INT;
}


View File

@ -0,0 +1,25 @@
/*
Simple example program showing the use of assembler modules
mixed with C modules. The function gotoxy is written in assembler.
*/
#include <stdio.h>
void gotoxy(int y,int x); /* assembler function in exam6a.asm */
int loop,x,y;
main()
{
printf("EXAMPLE 6\n");
for (loop=0;loop<10;loop++) {
for (y=0;y<25;y++) gotoxy(y,0);
for (x=0;x<80;x++) gotoxy(24,x);
for (y=24;y>=0;y--) gotoxy(y,79);
for (x=79;x>=0;x--) gotoxy(0,x);
}
printf("EXAMPLE 6 finished\n");
exit(0);
}


View File

@ -0,0 +1,37 @@
;
; simple function to be called from 'C' to move the cursor
;
include MACROS.ASM
begdata
c_public curr_x
_curr_x dw ?
c_public curr_y
_curr_y dw ?
enddata
begcode gotoxy
;
; usage:
; void gotoxy(int y,int x);
;
c_public gotoxy
func gotoxy
push bp
mov bp,sp
mov ax,word ptr P[bp]
mov curr_y,ax
mov dh,al
mov ax,word ptr P+2[bp]
mov curr_x,ax
mov dl,al
mov ah,2
xor bx,bx
int 10H
pop bp
ret
c_endp gotoxy
endcode gotoxy
end


View File

@ -0,0 +1,462 @@
;_ macros.asm Wed Feb 3 1988 Modified by: Walter Bright */
; Copyright (C) 1985-1988 by Northwest Software
; All Rights Reserved
; Written by Walter Bright
; Determine which memory model we are assembling for. For .COM files,
; force S model.
ifdef I8086T
I8086S equ 1
else
ifndef I8086S
ifndef I8086M
ifndef I8086C
ifndef I8086L ;if none of the memory models are defined
I8086S equ 1 ;default to S model
endif
endif
endif
endif
endif
;Decide if SI and DI are saved across function calls
SAVESIDI equ 1 ;1 means SI and DI are saved across functions
;Decide if we want to use Microsoft C calling conventions
;or Lattice C calling conventions
MSC equ 1 ;ifdef means use Microsoft C calling conventions
;ifndef means use Lattice
; Macros to bracket data segment stuff.
begdata macro
ifdef MSC
_DATA segment word public 'DATA'
_DATA ends
CONST segment word public 'CONST'
CONST ends
_BSS segment word public 'BSS'
_BSS ends
DGROUP group _DATA,CONST,_BSS
_DATA segment
else
DGROUP group data
data segment word public 'data'
endif
assume ds:DGROUP
endm
enddata macro
ifdef MSC
_DATA ends
else
data ends
endif
endm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Macros specific to each memory model in an attempt to make it easier
; to write memory model independent code.
; begcode,endcode Use to bracket code sections
; P Offset on BP to first argument on stack
; (excluding any local variables)
; SPTR 1 if small data model
; LPTR 1 if large pointers (large data)
; LCODE 1 if large code model
; ESeqDS 1 if ES == DS at all times
; SIZEPTR # of bytes in a pointer
; func Declare a function as NEAR or FAR
; callm Call function as NEAR or FAR
;;;;;;;;;;;;;; SMALL MEMORY MODEL ;;;;;;;;;;;;;;;;;
ifdef I8086S
ifdef MSC
begcode macro module
_TEXT segment word public 'CODE'
assume cs:_TEXT
endm
endcode macro module
_TEXT ENDS
endm
else
begcode macro module
pgroup group prog
prog segment byte public 'prog'
assume cs:pgroup
endm
endcode macro module
prog ends
endm
endif
P equ 4 ; Offset of start of parameters on the stack frame
SPTR equ 1
LPTR equ 0
LCODE equ 0
ESeqDS equ 0
SIZEPTR equ 2 ; Size of a pointer
ifdef MSC
func macro name
_&name proc near
ifndef name
name equ _&name
endif
endm
callm macro name
call near ptr _&name
endm
else
func macro name
name proc near
endm
callm macro name
call near ptr name
endm
endif
endif
;;;;;;;;;;;;;;;;; MEDIUM MEMORY MODEL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ifdef I8086M
ifdef MSC
begcode macro module
module&_TEXT segment word public 'CODE'
assume cs:module&_TEXT
endm
endcode macro module
module&_TEXT ends
endm
else
begcode macro module
module&_code segment byte public 'code'
assume cs:module&_code
endm
endcode macro module
module&_code ends
endm
endif
P equ 6 ; Offset of start of parameters on the stack frame
SPTR equ 1
LPTR equ 0
LCODE equ 1
ESeqDS equ 0
SIZEPTR equ 2
ifdef MSC
func macro name
_&name proc far
ifndef name
name equ _&name
endif
endm
callm macro name
call far ptr _&name
endm
else
func macro name
name proc far
endm
callm macro name
call far ptr name
endm
endif
endif
;;;;;;;;;;;;;;;;; COMPACT MEMORY MODEL ;;;;;;;;;;;;;;
ifdef I8086C
ifdef MSC
begcode macro module
_TEXT segment word public 'CODE'
assume cs:_TEXT
endm
endcode macro module
_TEXT ends
endm
else
begcode macro module
cgroup group code
code segment byte public 'code'
assume cs:cgroup
endm
endcode macro module
code ends
endm
endif
P equ 4 ; Offset of start of parameters on the stack frame
SPTR equ 0
LPTR equ 1
LCODE equ 0
ESeqDS equ 0
SIZEPTR equ 4
ifdef MSC
func macro name
_&name proc near
ifndef name
name equ _&name
endif
endm
callm macro name
call near ptr _&name
endm
else
func macro name
name proc near
endm
callm macro name
call near ptr name
endm
endif
endif
;;;;;;;;;;;;;;;; LARGE MEMORY MODEL ;;;;;;;;;;;;;;;;;;;
ifdef I8086L
ifdef MSC
begcode macro module
module&_TEXT segment word 'CODE'
assume cs:module&_TEXT
endm
endcode macro module
module&_TEXT ends
endm
else
begcode macro module
module&_prog segment byte 'prog'
assume cs:module&_prog
endm
endcode macro module
module&_prog ends
endm
endif
P equ 6 ; Offset of start of parameters on the stack frame
SPTR equ 0
LPTR equ 1
LCODE equ 1
ESeqDS equ 0
SIZEPTR equ 4
ifdef MSC
func macro name
_&name proc far
ifndef name
name equ _&name
endif
endm
callm macro name
call far ptr _&name
endm
else
func macro name
name proc far
endm
callm macro name
call far ptr name
endm
endif
endif
;Macros to replace public, extrn, and endp for C-callable assembly routines,
; and to define labels: c_label defines labels,
; c_public replaces public, c_extrn replaces extrn, and c_endp replaces endp
ifdef MSC
c_name macro name
name equ _&name
endm
c_label macro name
_&name:
endm
c_public macro a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
ifnb <a> ;;Check for blank argument
public _&a
a equ _&a
ifnb <b>
c_public b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
endif
endif
endm
c_extrn macro a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
ifnb <a> ;;Check for blank argument
extrn _&a:b
a equ _&a
ifnb <c>
c_extrn c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
endif
endif
endm
c_endp macro name
_&name ENDP
endm
else
c_name macro name
endm
c_label macro name
name:
endm
c_public macro a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
ifnb <a> ;;Check for blank argument
public a
ifnb <b>
c_public b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
endif
endif
endm
c_extrn macro a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
ifnb <a> ;;Check for blank argument
extrn a:b
ifnb <c>
c_extrn c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
endif
endif
endm
c_endp macro name
name endp
endm
endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Other more or less useful macros
setESeqDS macro ;set ES == DS, if not already true
ife ESeqDS
push DS
pop ES
endif
endm
.push macro list
irp arg,<list>
push arg
endm
endm
.pop macro list
irp arg,<list>
pop arg
endm
endm
; Macros to save and restore regs destroyed by a function
.save macro list
if SAVESIDI
irp arg,<list>
push arg
endm
endif
endm
.restore macro list
if SAVESIDI
irp arg,<list>
pop arg
endm
endif
endm
; Macros to save and restore ES, but only if ESeqDS is 1.
pushES macro
if ESeqDS
push ES
endif
endm
popES macro
if ESeqDS
pop ES
endif
endm
clr macro list ;clear a register
irp reg,<list>
xor reg,reg
endm
endm
tst macro reg
or reg,reg
endm
jmps macro lbl
jmp short lbl
endm
.if macro arg1,cond,arg2,lbl
cmp arg1,arg2
j&cond lbl
endm
;sob macro arg,lbl
; ifidn <arg>,<CX>
; loop lbl
; else
; dec arg
; jnz lbl
; endif
; endm
ifndef nobdos
bdos macro func
ifnb <func>
mov AH,func
endif
int 21h
endm
endif
.retf macro val ;force assembler to build a far return
ifnb <val>
db 0CAh
dw val
else
db 0CBh
endif
endm
; Sometimes MASM ignores my segment overrides.
segES macro
db 26h
endm
; 32 bit negate
neg32 macro reg1,reg2
neg reg1
neg reg2
sbb reg1,0
endm

View File

@ -0,0 +1,19 @@
#_ makefile Mon Oct 16 1989 Modified by: Samuel Druker */
#
# makefile to build examples for the Zortech Debugger
#
MEM = S
all : exam1.exe exam2.exe exam3.exe exam4.exe exam5.exe exam6.exe
exam5.exe : exam5.c exam5a.c exam5b.c
ztc -g -m$(MEM) exam5 exam5a exam5b
exam6.exe : exam6.c exam6a.obj
ztc -g -m$(MEM) exam6 exam6a.obj
.asm.obj :
MASM /Zi /MX /Z /DI8086$(MEM) $*.asm;
.c.exe :
ztc -g -m$(MEM) $*

View File

@ -0,0 +1,28 @@
#
# makefile to build examples for Zortech Debugger
#
CFLAGS = /Zi /Od
AFLAGS = /Zi /MX /DI8086S /R
.c.exe:
cl $(CFLAGS) $*.c
exam6a.obj: exam6a.asm
masm $(AFLAGS) exam6a;
exam1.exe:
exam2.exe:
exam3.exe:
exam4.exe:
exam5.exe: exam5.c exam5a.c exam5b.c
cl $(CFLAGS) exam5.c exam5a.c exam5b.c
exam6.exe: exam6.c exam6a.obj
cl $(CFLAGS) exam6.c exam6a.obj
exam7.exe:


View File

@ -0,0 +1,24 @@
ZDB - The Zortech C++ Debugger
==============================
Version : V2.00 First Formal Release of ZDB
Date : 14/10/89
-f Flag
-------
The default for the debugger has been changed so that the retention of expanded
automatic variables between function calls is not automatic. This change has
been made to avoid problems with running out of memory. If you want expanded
variables to be retained when a function is re-entered, you will need to specify
the -f flag to ZDB. This will have an impact on the size of program you can
debug.
Warning - This behavior may be different to that outlined in the Technical Notes
Note
----
If you are running ZDB on a system that simulates a CGA screen in monochrome,
you should use the dos command MODE BW80 before running the debugger.
EOF


View File

@ -0,0 +1,145 @@
/*_ chmod.c Mon Feb 29 1988 Modified by: Walter Bright */
/* Copyright (C) 1987-1988 by Walter Bright */
/* All Rights Reserved */
/* Written by Walter Bright */
/* To compile with Zortech C: */
/* ztc -mti chmod */
#include <stdio.h>
#include <dos.h>
#include <stdlib.h>
#include <ctype.h>
/* Prototypes */
void usage(void);
void faterr(char*, char*);
int chmod(char* filename, int mode);
/* Attribute bits: */
#define R 1
#define H 2
#define S 4
#define V 8
#define D 0x10
#define A 0x20
main(argc,argv)
int argc;
char *argv[];
{ int i,j,c;
char *p;
struct FIND *find;
unsigned onmask,offmask;
static char flag[9] = "RHSVDAUU";
if (argc <= 1)
usage();
p = argv[1];
if (*p == '+' || *p == '-')
{
onmask = 0;
offmask = 0;
while (1)
{
c = toupper(p[1]);
if (*p == '+')
{ switch (c)
{ case 'R': onmask |= R; break;
case 'H': onmask |= H; break;
case 'S': onmask |= S; break;
case 'V': onmask |= V; break;
case 'D': onmask |= D; break;
case 'A': onmask |= A; break;
default:
faterr("unrecognized flag '%s'",p);
}
}
else if (*p == '-')
{ switch (c)
{ case 'R': offmask |= R; break;
case 'H': offmask |= H; break;
case 'S': offmask |= S; break;
case 'V': offmask |= V; break;
case 'D': offmask |= D; break;
case 'A': offmask |= A; break;
default:
faterr("unrecognized flag '%s'",p);
}
}
else if (*p == 0)
break;
else
faterr("unrecognized flag '%s'",p);
p += 2;
}
for (i = 2; i < argc; i++)
{
find = findfirst(argv[i],0xFF);
while (find)
{ c = find->attribute;
c = (c & ~offmask) | onmask;
chmod(find->name,c);
find = findnext();
}
}
}
else /* merely print the attributes of the files */
{
for (i = 1; i < argc; i++)
{
find = findfirst(argv[i],0xFF);
while (find)
{ c = find->attribute;
for (j = 7; j >= 0; j--)
if ((1 << j) & c)
printf("%c",flag[j]);
else
printf("-");
printf("\t0x%02x\t%s\n",c,find->name);
find = findnext();
}
}
}
}
/********************
* Change attribute of file.
*/
int chmod(char* filename, int mode)
{ union REGS regs;
regs.x.ax = 0x4301;
regs.x.cx = mode;
regs.x.dx = (int) filename;
intdos(&regs,&regs);
}
void faterr(f,p)
char *f,*p;
{
printf("Fatal error: ");
printf(f,p);
printf("\n");
exit(1);
}
void usage(void)
{
printf("\
File attribute byte display/modification program.\n\
Use:\n\
chmod {(+|-)flag} file...\n\
Where:\n\
flag is one of R,H,S,V,D,A\n\
R Read-only\n\
H Hidden\n\
S System\n\
V Volume label\n\
D Sub-directory\n\
A Archive\n\
\n\
If no flags are given, the attributes are displayed.\n\
");
}

View File

@ -0,0 +1,55 @@
/*_ dump.c Thu Jul 31 1986 Modified by: Walter Bright */
/* Copyright (C) 1985 by Northwest Software */
/* All Rights Reserved */
/* Written by Walter Bright */
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
main(argc,argv)
int argc;
char *argv[];
{ FILE *f;
int i, buffer[16];
unsigned long offset = 0;
if (argc < 2 || argc > 3)
{ printf("Error: wrong number of arguments\n");
printf("Use: dump file [starting offset in hex]\n");
exit(1);
}
f = fopen(argv[1],"rb"); /* open file for binary read */
if (!f)
{ printf("Can't open file '%s'\n",argv[1]);
exit(1);
}
if (argc == 3)
{ sscanf(argv[2],"%lx",&offset);
fseek(f,offset,0);
}
while (1)
{ for (i = 0; i < 16; i++)
buffer[i] = fgetc(f);
if (buffer[0] == -1) break; /* done */
printf("%04lx: ",offset);
for (i = 0; i < 16; i++)
if (buffer[i] != -1)
printf("%2x ",buffer[i]);
else
printf(" ");
printf(" ");
for (i = 0; i < 16; i++)
{
if (buffer[i] != -1)
{ if (!isprint(buffer[i])) buffer[i] = '.';
putchar(buffer[i]);
}
else
putchar(' ');
}
putchar('\n');
offset += 16;
}
}

View File

@ -0,0 +1,130 @@
/*_ dumpobj.c Mon Feb 29 1988 Modified by: Walter Bright */
/*****************************************************
* Dump .OBJ files.
* Use:
* dumpobj filename.obj
*/
#include <stdio.h>
#include <stdlib.h>
/* Prototypes */
void chkeof(void);
int gchar(void);
int putrecord(void);
int getrecord(void);
int isprint(unsigned c);
int xc = ' '; /* last char read from file */
unsigned rectyp; /* record type */
unsigned chksum = 0; /* current check sum */
unsigned reclength; /* record length */
unsigned char *record = NULL; /* pointer to data bytes */
FILE *f; /* input file pointer */
main(argc,argv)
int argc;
char *argv[];
{ int i, buffer[16];
if (argc != 2)
{ printf("Error: wrong number of arguments\r\n");
printf("Use: dumpobj filename.obj\r\n");
exit(1);
}
f = fopen(argv[1],"rb"); /* open file for binary read */
if (!f)
{ printf("Can't open file '%s'\r\n",argv[1]);
exit(1);
}
while (gchar() != EOF) /* while not end of file */
{ getrecord(); /* read in a record */
putrecord(); /* display a record */
}
}
/***************************************
* Get a record.
* record ::= rectyp reclength { data_bytes } chksum
*/
getrecord()
{ unsigned i;
rectyp = xc; /* record type */
reclength = gchar();
reclength += gchar() << 8; /* 2 byte record length */
if (record) free(record); /* junk pre-existing record */
record = malloc(reclength - 1);
chkeof(); /* check for premature eof */
for (i = 0; i < reclength - 1; i++)
{ record[i] = gchar();
chkeof();
}
gchar(); /* read chksum byte */
if (chksum & 0xFF)
{ printf("Bad checksum: %x\r\n",chksum & 0xFF);
exit(1);
}
}
int gchar()
{
return xc = fgetc(f);
}
putrecord()
{ static char *typtab[] =
{"RHEADR","REGINT","REDATA","RIDATA","OVLDEF","ENDREC","BLKDEF",
"BLKEND","DEBSYM","THEADR","lHEADR","PEDATA","PIDATA","COMENT",
"MODEND","EXTDEF","TYPDEF","PUBDEF","LOCSYM","LINNUM","LNAMES",
"SEGDEF","GRPDEF","FIXUPP","(none)","LEDATA","LIDATA","LIBHED",
"LIBNAM","LIBLOC","LIBDIC"
};
int i,j;
i = (rectyp - 0x6E) / 2;
if (i == (0xB0 - 0x6E) / 2)
printf("COMDEF");
else if (i < 0 || i >= sizeof(typtab) / sizeof(char *))
printf("%6x",rectyp);
else
printf(typtab[i]); /* record type string */
for (j = 0; j < reclength - 1; j += 16)
{
if (j) printf(" ");
for (i = 0; i < 16; i++)
{ if (j + i < reclength - 1)
printf(" %2x",record[j + i]);
else
printf(" ");
}
printf(" ");
for (i = 0; i < 16; i ++)
{ if (j + i < reclength - 1)
{
if (isprint(record[j+i]))
putchar(record[j+i]);
else
putchar('.');
}
else
putchar(' ');
}
printf("\r\n");
}
}
int isprint(unsigned c)
{
return c >= ' ' && c <= '~';
}
void chkeof(void)
{
if (xc == EOF)
{ printf("Premature end of file\r\n");
exit(1);
}
}

View File

@ -0,0 +1,104 @@
/*_ freq.c Sun Oct 15 1989 Modified by: Walter Bright */
/* Written by Walter Bright */
/* Compile with: ZTC freq -ml (Use large model
so strcmp() can handle far pointers.) */
/*
* Usage: freq <infile >outfile
* Pipes work well here.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <handle.h>
struct tree {
char __handle *word;
int count;
struct tree __handle *left;
struct tree __handle *right;
};
int readword(char *w, int nbytes)
{
int c;
do {
c = getchar();
if (c == EOF)
return 0;
} while (!isalpha(c));
do {
if (nbytes > 1)
{
*w++ = c;
nbytes--;
}
c = getchar();
} while (isalnum(c));
*w = 0;
return 1;
}
void tree_insert(struct tree __handle * __handle *pt, char *w)
{
int cmp;
struct tree __handle *p;
while ((p = *pt) != NULL)
{
if ((cmp = strcmp(w,p->word)) == 0)
goto gotit;
pt = (cmp < 0) ? &p->left : &p->right;
}
p = (struct tree __handle *)
handle_calloc(sizeof(struct tree));
if (!p || (p->word = handle_strdup(w)) == NULL)
{
printf("Out of memory\n");
exit(EXIT_FAILURE);
}
*pt = p;
gotit:
p->count++;
}
tree_print(struct tree __handle *p)
{
while (p)
{
tree_print(p->left);
printf("%5d %s\n",p->count,(char far *)p->word);
p = p->right;
}
}
tree_free(struct tree __handle *p)
{
struct tree __handle *pn;
while (p)
{
handle_free(p->word);
tree_free(p->left);
pn = p->right;
handle_free(p);
p = pn;
}
}
main()
{
struct tree __handle *root = NULL;
char word[32];
while (readword(word,sizeof(word)))
tree_insert(&root, word);
tree_print(root);
tree_free(root);
return EXIT_SUCCESS;
}

View File

@ -0,0 +1,21 @@
#_ makefile Thu May 19 1988 Modified by: Walter Bright */
# Make file for utility programs
# Assume environment variables LIB, TMP, INCLUDE, PATH
# are set.
.c.com :
ztc -mti $*
all : dump.com zcmore.com timer.com chmod.com dumpobj.com wc.com freq.exe
del *.obj
del *.map
wc.com : wc.c
ztc -mti wc.c $(LIB)\_mains.obj
chmod.com : chmod.c
ztc -mti chmod.c $(LIB)\_mains.obj
freq.exe : freq.c
ztc -ml freq.c $(LIB)\_mainl.obj


View File

@ -0,0 +1,556 @@
----------------- 2.06 Notes --------------------
ZTCPP1 is numbered as 2.06.
ZTC2 and ZTC2B are at 2.05.
ZTC1, ZTC1B and ZTG are at 2.00.
ZTCPP1
Fixed a number of errors.
ZTC2 and ZTC2B
Fixed bug in Windows prolog/epilog code.
Fixed bug in LINK4 compatibility.
-------------------------------------------------
ZTCSETUP
UNLIKE the documentation states, you cannot run ztcsetup from c: by typing
a:ztcsetup, it thinks it should look for compiler disk #1 on c:.
-------------------------------------------------
C and C++ COMPILERS
The following is *NOT* a bug, it's ANSI C:
extern int func(char);
int func(c)
char c;
{
^
"test.c", line 5 Syntax error: type of 'c' does not match function prototype
Had: <int>
and: <char>
}
Old style parameter types undergo integral promotions before
comparing them against the prototype. The old style "char c;"
is interpreted as "c is passed as an int, but interpret it as
a char in func". If you want it to be a char, define func as:
int func(char c) { ... }
Bit fields can now be any integral type, though they are always
treated as the unsigned versions of the integral types.
Pointer type mismatches are now syntax errors instead of warnings.
Conversions of ints directly to far pointers is now a syntax error
instead of a warning. If you want to do this, cast the int to
a long before casting it to a pointer.
The following cast:
long l;
char near *p;
l = (long) p;
is now handled like:
l = (long)(char far *)p;
instead of like:
l = (long)(unsigned)p; /* 0 fill high 16 bits */
The conversion of a far pointer to a long and vice versa
is done as a 'paint', i.e. no change in the bit pattern
occurs.
-------------------------------------------------
C++ COMPILER
Inline functions involving only simple combinations of if-else
constructs are now actually inlined. If an inline function contains
loop or switch statements, it is not inlined.
Inline member functions are now parsed at the close of the class
definition, rather than as they are tokenized. This eliminates
order dependencies in class definitions, at the cost of
obscure error messages. The error message line number will try
to be the line of the inline function causing it, but the
source line and ^ displayed will be the one with the closing }
of the class definition.
Inline member functions that have a non-void return value,
but no return statement, now generate a syntax error.
0 sized structs are no longer generated if there are no
non-static data members, the minimum size of a struct is now
1. This is to prevent new() from return 0 when it tries to
allocate an instance of a struct.
If a runtime error message is printed by the library, the program
is aborted without calling any static constructors. The reason
is that a serious error has occurred (such as the heap has been
corrupted), and it's best to stop the program immediately so
that hopefully the damage is contained.
-------------------------------------------------
WINDOWS SUPPORT
The documentation says to use the switch "-mw" when compiling for
MS-Windows, to tell the compiler that DS!=SS.
This is misleading, since for regular Windows apps, DS==SS. A
switch that specifies DS!=SS is only needed for the following types of code:
A) Windows Dynamic Link Libraries (DLLs).
B) OS/2 DLLs.
C) OS/2 threads.
Currently, class objects can only be created on the near heap for S and M
models, and only on the far heap for C and L models. Objects cannot be
created in __ss or __handle space.
-------------------------------------------------
MAKE
You can now include files in makefiles, with the syntax:
include filespec
This is quite handy when supporting several configurations with
one makefile.
-------------------------------------------------
LIBRARY
Added
void disp_puts(const char *p);
which sends out string p to the display.
Added disp_getattr() as a complement to disp_setattr().
Modified getcwd(char *buffer,size_t length) so that if buffer
is NULL, sufficient bytes are malloc'd for the path. At least
length bytes are allocated, instead of failing if length bytes
aren't enough. Therefore, the following doesn't have to decide
in advance how big the path could be:
pathbuffer = getcwd(NULL,0);
ANSI offsetof(type,identifier) macro added to stddef.h.
If you are using the EMM functions, it is important to note
that when the program exits, EMM pages that are allocated are
not automatically freed like regular allocated memory is.
Therefore, it is important to find all routes by which the
program can be terminated, and add in a call to free up and
terminate use of EMM pages. The ways a program can terminate are:
1. Return from main().
2. Calling exit().
3. Calling _exit(), _assert(), abort() or raise(SIGABRT).
4. Control C or Control Break.
5. Heap corruption or Floating point not loaded errors
from the runtime library.
Case 4 can only be handled by intercepting the control break
interrupt (0x23). Case 5 is a program crash anyway.
The symptoms of not freeing up EMM memory are that programs run
later will not find any available EMM pages to allocate. This will
persist until a program is run that frees up EMM, or the system
is rebooted.
If you are using EMM via handles, this is already taken care of
by the runtime library. Cases 1 and 2 are handled by setting
up a static destructor. Case 4 is done by chaining into the
control break interrupt. Case 3 is not dealt with.
-------------------------------------------------
SYMBOLIC DEBUG INFO
Limitations and problems:
o In order to conserve the size of the symbol table,
typedefs and enums are not emitted. Only the minimal
type information for variables actually used is emitted.
o Because the optimizer moves variables and sections of code
around, there becomes only one scope per function. Thus,
avoid using the same variable names in nested scopes
if you want to use the debugger on them.
o Use the -S switch to cause the code generator to always
generate a stack frame for each function if you want
symbolic debugging. CodeView seems to expect this.
ZTC.COM will automatically invoke -S if the -g or -gs
switch was specified.
-------------------------------------------------
There are two ways to find the version of the compiler you are using:
1. Compile a file with -v.
2. Run ZTCPP1, etc., with no arguments.
-------------------------------------------------
THIRD PARTY LIBRARIES
Many people have asked if modules compiled with Zortech C or C++ can be
linked with Microsoft runtime libraries or 3rd party libraries for Microsoft
C. The answer is probably not. The reasons are:
1. The Zortech 'compiler helper' functions are not the same
as Microsoft's. Compiler helper functions are things like
long multiply. Zortech's are different because Microsoft's
cannot be used to generate .COM files.
Workaround: Include the 'compiler helper' functions needed.
2. Zortech's floating point is different. Zortech's floating
point is reentrant.
Workaround: Pass a parameter that is a pointer to the return
value.
3. The layout of the _iob struct defined in stdio.h is different,
therefore the buffered I/O functions cannot be compiled with
one stdio.h and linked with functions compiled with another
stdio.h.
Workaround: Avoid using stdio functions, or compile with
the same stdio.h.
4. Structure returns when the structure <= 4 bytes is different,
though I intend to fix this.
Workaround: Avoid returning small structs.
5. The same comments apply to Turbo C.
6. By default, ZTC aligns struct members on 16 bit boundaries.
MSC's do not align them by default. Therefore, compile with
the -a switch to suppress struct member alignment if
binary compatibility is desired.
It is still possible to create a library that will link with Zortech C,
Microsoft C and Turbo C, by avoiding the problems listed above. The FG
graphics library is an example of this, but this is a job for an expert.
-------------------------------------------------
LIBRARY SOURCE
Added files to support ROM code development:
ROMASM BAT Replace ASM module in rom libs
ROMC BAT Replace C module in rom libs
CROM ASM Sample ROM startup code
The BUILDLIB.BAT file can be used to make all four rom libraries.
-------------------------------------------------
C PROGRAMMING TOOLS
Please look in the subdirectory GENERAL for a description of these
useful utilities.
-------------------------------------------------
VIRTUAL FUNCTION POINTER TABLES
A table of pointers to functions is created for each class that
has virtual functions or is derived from a class with virtual
functions. Because of separate compilation, sometimes redundant
copies of the tables are created, even leading to excessive
consumption of space in DGROUP. It turns out that the only time
the code needs a virtual function pointer table (vtbl) is within
the body of a constructor. So a vtbl for a class is only actually
generated when the body of a constructor that needs a vtbl is
instantiated. A maximum of one vtbl per class per object module
is generated.
This suggests a technique for minimizing vtbl generation:
1. Avoid inline constructors.
2. Group all the definitions for constructors for a class into
one source file.
This will create a maximum of one vtbl per class per program.
Other C++ implementations use command line switches to cause
vtbls in some modules to be global, in others external. This
can get rather complex, the above technique is simpler and more
reliable.
===========================================================================
Existing problems and workarounds
===========================================================================
****************** MAKE ****************
-----------------------------------------
Should have a -k switch to cause make to continue after errors
occur attempting to make targets not depending on the one that failed.
-----------------------------------------
Make cannot figure out more than one level of implicit rules.
I.e. this doesn't work:
.c.obj: ;ztc -c $<
.obj.exe: ;ztc $<
hello.exe: hello.c
-----------------------------------------
****************** C COMPILER ****************
-----------------------------------------
The macros:
#define STR(a) NXSTR(a)
#define NXSTR(a) #a
#define A 1
if (STR(A)[0] == '1')
result in:
if ("A"[0] == '1')
instead of:
if ("1"[0] == '1')
-----------------------------------------
If a, b and c are structs, the following generates a syntax error:
a = blah ? b : c;
To work around, write as:
if (blah)
a = b;
else
a = c;
-----------------------------------------
If a and b are structs, the following fails:
func(a = b);
To work around, write as:
a = b;
func(a);
-----------------------------------------
Conversions between doubles and unsigned longs are handled
as if they are conversions between doubles and signed longs.
-----------------------------------------------------
Expecting void functions to return values gets ZTC2 bugs in the following
case:
{
extern void func();
i = h() ? g() : func();
}
-----------------------------------------------------
The preprocessor line
#line 47 "FILE.C"
does not set the module name to file.c.
-----------------------------------------------------
If there is an error writing the .OBJ file, the .OBJ file is not
deleted. If the error is because the disk is full, there remains a
partial corrupted .OBJ file.
-----------------------------------------------------
Initializations that determine the size of an array, as in:
static char abc[] = "fred";
still represent the size of the array as 0 to CodeView, instead of 5.
This problem does not occur with the C++ compiler.
-----------------------------------------------------
The type 'long double' is not distinguished from type 'double'.
-----------------------------------------------------
The expression:
float f1,f2;
f1 + f2;
has type double instead of type float (because all floating point
expressions are implicitly converted to double).
-----------------------------------------------------
The floating point emulation does not yet conform to the IEEE standard.
-----------------------------------------------------
Switch statements with longs are not supported.
-----------------------------------------------------
A near pointer is converted to a far pointer by putting DS, SS or CS into
the segment portion as appropriate. The bug is if the near pointer is NULL,
the resulting far pointer gets a non-zero segment value! When converting,
always testing for 0 before loading the segment would cause a lot of
inefficiencies. Note that MSC 5.1 has the same bug, I haven't checked
TC for it.
-----------------------------------------------------
****************** C++ COMPILER ****************
-------------------------------------------
All the current bugs in the C compiler (!).
-------------------------------------------
Classes derived from an abstract class are not checked to make sure that
all pure virtual functions are defined or redefined as pure.
-------------------------------------------
When the compiler internally generates an X& X::operator=(X&), and
X has a virtual base class V that appears N times in the inheritance DAG,
the function V& V::operator=(V&) is called N times instead of once.
-------------------------------------------
When the compiler internally generates an X& X::operator=(X&), and
X has a member that is an array of class Y, a bit copy is done of the
array instead of a loop calling Y& Y::operator=(Y&).
-------------------------------------------
Inline functions that contain any whiles, dos,
fors or switches are not inlined. The code will still compile and
execute correctly, however. This is not a bug.
-------------------------------------------
If a class name is hidden in a lower level scope, you still
can't access it even if you prefix it with 'struct' or 'class'.
-------------------------------------------
This will fail:
struct A;
struct B;
struct A {
friend void B::func(void); // forward reference to B::func
int a;
};
struct B {
void func(void);
};
-------------------------------------------
There are cases where a lot of look-ahead is required in order for the
compiler to figure out what the parse tree really is. Zortech C++ isn't
always as clever as ATT C++ is with some bizarre cases (though ATT's
compiler doesn't do all of the cases correctly either!). Unfortunately,
C++ also isn't a context-free grammar, making things worse.
Here's an example of how things can go wrong:
struct fgtest {
int c;
fgtest();
};
main() {
#if 1
fgtest A; // this works as expected
#else
fgtest A(); // this doesn't (parser thinks that A is a function
// returning an fgtest)
#endif
A.c = 3; // now we discover that A should be a variable!
}
-------------------------------------------
Pointers to members are not implemented.
-------------------------------------------
The anachronistic member access syntax on the last page of the C++ book:
int cl.fct() { /* ... */ }
is not supported. Use instead:
int cl::fct() { /* ... */ }
-------------------------------------------
Implicit conversions from void* to another type are allowed, like
in ANSI C. AT&T's C++ disallows them, an explicit cast must be used.
Methinks this is a difference in philosophy between AT&T and Zortech.
-------------------------------------------
Compiler should issue warning when a non-virtual method in a sub-class hides
a virtual method in the base class. (Tony Hagen, James Coggins,
Bjarne Stroustrup, et. al. suggest it.) The other way around, too.
-------------------------------------------
Deleting a NULL pointer to a class with a destructor still calls the
destructor. A crash could result, especially if the destructor is virtual.
-------------------------------------------
Variadic Pascal and C++ functions that return structures return them in a static
temporary rather than on the stack, thus they are not reentrant and more
than one cannot be used in the same expression.
-------------------------------------------
If a class or a struct has no tag name, the compiler will generate one of
the form "_C%d", where %d increments with each new name generated. This
is necessary for the name mangling to work. Unfortunately, if you have
structs like this defined in header files, and include the files in
different orders in different files, the names will come out different.
This can cause errors at link time due to the name mangling and typesafe
linkage not lining up. Because of this, the compiler generates a warning
if there is no tag name.
-------------------------------------------
The iostream stuff invented by AT&T for 2.0 is not implemented.
-------------------------------------------
The asm() statement is not supported.
-------------------------------------------
To make the name mangling work out, all classes and enums should
have tag names.
-------------------------------------------
struct s { f(); };
static s::f() {} // diagnosed as an error by cfront
ZTC++ allows member functions to be local to a file, i.e. static. Cfront
does not allow this.
-------------------------------------------
Arrays with non-constant initializer expressions are not supported
(but arrays of structs with constructors can be statically initialized).
Static variables can have non-constant initializer expressions.
-------------------------------------------
The -J switch causes declarations like:
char *p;
to be interpreted as:
unsigned char *p;
Thus, this will cause syntax errors if functions are overloaded like:
int func(char *);
int func(signed char *);
int func(unsigned char *); // causes syntax error if -J
Also, -J does not affect the behavior of library functions (like strcmp()).
-----------------------------------------------------
****************** C LIBRARY ****************
-----------------------------------------------------
The int package uses a local stack for the interrupt service routine (isr).
If there are overlapping interrupts to the same isr, the program will
crash because the stacks overlap!
If you use 0 for the stack size parameter to int_intercept(), no local
stack will be allocated for the isr. Thus, overlapping interrupts have
a chance of working (if the original stack is big enough).
-----------------------------------------------------
The stat() function uses findfirst(). So if you are in the middle of a
findfirst-findnext sequence, you cannot use stat().
-----------------------------------------------------
****************** BLINK ****************
-----------------------------------------------------
If a .OBJ file is corrupted, BLINK may crash instead of issuing
an error message.
-----------------------------------------------------
BLINK sometimes is reported to produce the message about VM.TMP and a
bad file handle. If anyone is able to produce a test case which reliably
duplicates this, please send it in. I've never seen that message!
-----------------------------------------------------
Reported to have problems if the pagesize of the library is not 16 (which is
the default). I haven't verified this.
-----------------------------------------------------
Problem with complex LIDATA records (generated by MASM
when it sees a DUP).
******************** MANUAL ERRATA **************************
C++ COMPILER REFERENCE MANUAL
Page 222
The parameter conversions described in 11.1.11 are incorrect.
The example given is incorrect.
Parameter promotions are now ANSI. For instance,
int func(c,f)
char c;
float f;
{}
is now equivalent to:
int func(i,d)
int i;
double d;
{ char c = i;
float f = d;
}
Page 246 is intentionally blank.
This is an artifact of starting each new letter on a right-hand page.
******************** BUG REPORTS **************************
Occasionally, you may run across a suspected problem with the compiler.
If you send in a bug report, please do the following:
1. Try to determine the smallest possible program that exhibits the problem.
Sending in a 10,000 line program with a message that "it doesn't work"
doesn't help much. Also, frequently the process of determining that
smallest program reveals the problem to be something other than a compiler
bug. At the least, an easy workaround to keep you going becomes obvious.
2. Include all the #include'd .h and .hpp files. Better yet, boil it all
down to 1 source file that demonstrates the problem without #include'ing
anything.
3. Include a READ.ME file describing the problem, and what command was
issued to the compiler to cause it.
4. Check to make sure it isn't one of the following problems. A large
number of the bug reports we get are really variations on these,
even experts frequently make these mistakes:
Common error #1: Assigning beyond the end of alloc'd data.
p = malloc(4);
for (i = 0; i <= 4; i++)
p[i] = value;
The bug is that when i==4, assigning to p[4] will cause a
probable program crash.
Another common manifestation of this is:
p = malloc(strlen(s));
strcpy(p,s); /* didn't leave room for terminating 0! */
Common error #2: Returning a reference to a variable that goes out of scope.
int &func()
{ int a;
...
return a;
}
-------------------------------------------------------------------------------
ZED
One extra feature was added to ZED too late to be put into the manual.
This a new option Configure on the File menu. It allows the editor
configuration to be changed. A mouse is now supported for editor configuration.
************************ ZORTECH BBS *************************
Zortech operates a free bulletin board system for Zortech customers
and anyone else who is interested in C++. There is no registration,
just dial up and use it. There are many files of interest to C++
programmers to download, and message areas where you can have conversations
with other C++ users. The phone number is:
(206) 822-6970 USA
01 855 3286 UK


View File

@ -0,0 +1,49 @@
/*_ timer.c Mon Feb 29 1988 Modified by: Walter Bright */
/* Written by Walter Bright */
/* To compile (with Zortech C): */
/* ZTC -mti timer */
#include <stdio.h>
#include <time.h>
#include <process.h>
#include <stdlib.h>
#if __ZTC__
int _okbigbuf = 0; /* Use as little memory as possible */
#endif
main(argc,argv)
int argc;
char *argv[];
{ clock_t clock(),starttime;
int status;
if (argc < 2)
{ printf("Time execution of a command.\nUse:\n\ttimer command\n");
exit(1);
}
argv[argc] = 0; /* terminate with a 0 (unportable method) */
starttime = clock();
status = spawnvp(0,argv[1],argv + 1);
starttime = clock() - starttime;
if (status == -1)
{ printf("'%s' failed to execute\n",argv[1]);
exit(1);
}
printf("Elapsed time = %d.%02d seconds\n",(int) (starttime/CLK_TCK),
(int) (starttime%CLK_TCK));
if (status != 0)
printf("--- errorlevel %d\n",status);
}
#if __ZTC__
/* Prevent exit() and fclose() from being linked in from library */
/* (to conserve the size of the output file). */
void exit(int exitstatus)
{
_exit(exitstatus);
}
#endif

View File

@ -0,0 +1,51 @@
#include <stdio.h>
#include <ctype.h>
main (argc, argv)
int argc;
char *argv[];
{
int i;
unsigned long int w_total = 0, l_total = 0, c_total = 0;
printf (" lines words bytes file\n");
for (i = 1; i < argc; ++i)
{
FILE *input;
unsigned long int w_cnt, l_cnt, c_cnt;
int c, inword;
if ((input = fopen(argv[i], "rb")) == NULL)
{
printf ("wc: cannot open %s\n", argv[i]);
continue;
}
w_cnt = l_cnt = c_cnt = 0;
while ((c = fgetc(input)) != EOF)
{
if (c == '\n')
++l_cnt;
if (!isspace(c))
{
if (!inword){
inword = 1;
++w_cnt;
}
}
else
inword = 0;
++c_cnt;
}
fclose (input);
printf ("%8lu%8lu%8lu %s\n", l_cnt, w_cnt, c_cnt, argv[i]);
l_total += l_cnt;
w_total += w_cnt;
c_total += c_cnt;
}
if (argc > 2)
{
printf ("--------------------------------------\n%8lu%8lu%8lu total",
l_total, w_total, c_total);
}
}

View File

@ -0,0 +1,102 @@
/*_ zcmore.c Fri Oct 13 1989 Modified by: Samuel Druker */
/* Copyright (C) 1986 by Northwest Software */
/* All Rights Reserved */
/* Written by Walter Bright */
/* This is a program meant to demonstrate the use of the disp package */
/* of functions. It also illustrates how ftell() and fseek() can be */
/* used with text files. */
/* ZCMORE is a functional replacement for the MORE program supplied */
/* with MS-DOS. It, however, does not work with non-IBM PC compatible */
/* displays. */
/* To compile: */
/* ZTC -mti zcmore */
/* To use: */
/* ZCMORE filename */
#include <stdio.h>
#include <disp.h>
main(argc,argv)
int argc;
char *argv[];
{ FILE *f;
int c;
int rows;
unsigned long fsize,fpos,startpage,lastpage;
if (argc == 2) /* expecting 1 arg, the file name */
{ f = fopen(argv[1],"r");
if (!f)
{ fprintf(stderr,"Can't open file '%s'\n",argv[1]);
exit(1);
}
fsize = filesize(argv[1]);
}
else
{ fprintf(stderr,"ZCMORE: a program to peruse files\n\
Use:\n\tZCMORE filename\n");
exit(1);
}
disp_open(); /* initialize display package */
rows = 0; /* row 0 == top row */
lastpage = 0; /* no previous page */
startpage = 0; /* start of this page */
while ((c = fgetc(f)) != EOF) /* while not end of file */
{ c &= 0x7F; /* so WordStar files can be read */
disp_putc(c); /* display character read */
if (disp_cursorcol == 0) /* if finished a line */
{ rows++; /* # of lines output */
if (rows == disp_numrows - 1) /* if end of screen */
{ disp_startstand();
fpos = ftell(f); /* where are we in file? */
disp_printf("--More-- %2ld%%",(fpos*100)/fsize);
disp_endstand();
disp_putc(' ');
loop:
disp_flush(); /* flush output to display */
c = getch(); /* wait for user input */
switch (c)
{
case 't': /* start of file */
case 'T':
lastpage = 0;
/* FALL-THROUGH */
case 'b': /* go back a screen */
case 'B':
fseek(f,lastpage,0);
fpos = startpage = lastpage;
/* FALL-THROUGH */
case ' ':
rows = 0; /* next screen */
lastpage = startpage;
startpage = fpos;
disp_move(0,0);
disp_eeop(); /* clear screen */
break;
case '\r':
/* just one more line */
rows = disp_numrows - 2;
disp_putc('\r');
disp_eeol(); /* erase 'More' */
break;
case 3:
case 'Q':
case 'q':
disp_putc('\r');
disp_eeol(); /* erase 'More' */
goto done; /* quit */
default: /* error */
disp_printf("' '=next page, 'b'=\
back page, 't'=top, Return=next line, 'q'=quit");
disp_move(disp_numrows - 1,13);
goto loop; /* try again */
}
}
}
} /* while */
done: disp_close(); /* finish up gracefully */
}


View File

@ -0,0 +1,23 @@
/*_ assert.h Fri May 12 1989 Modified by: Walter Bright */
#if __cplusplus
extern "C" {
#endif
#undef assert
#ifdef NDEBUG
#define assert(ignore) ((void) 0)
#else
#define assert(e) ((void)((e) || _assert(#e,__FILE__,__LINE__)))
extern void
#ifndef __STDC__
cdecl
#endif
_assert(const char *,const char *,unsigned);
#endif
#if __cplusplus
}
#endif

View File

@ -0,0 +1,51 @@
#ifndef BCDHPP
#define BCDHPP
#include <stream.hpp>
#include "errn.hpp"
extern int _allocerr;
class bcd {
unsigned char nbytes, sign, status;
unsigned char *body;
int signed_add(bcd&);
int lmul(bcd&);
int ldiv(bcd&);
void ltobcd(long);
void atobcd(char *);
public:
bcd();
bcd(long, int = 24); // Conversion from a long
bcd(bcd&); // Copy constructor
bcd(char *, int = 24); // Conversion from a digit string
~bcd() { delete body; }
bcd& operator=(bcd&);
bcd& operator=(long);
bcd& operator=(char *);
bcd operator+(bcd&);
bcd operator+(long);
bcd operator-(bcd&);
bcd operator-(long);
bcd operator*(bcd&);
bcd operator*(long);
bcd operator/(bcd);
bcd operator/(long);
bcd operator%(bcd);
bcd operator%(long);
bcd& operator++();
bcd& operator--();
long tolong();
operator double(); // Provide one implicit conversion
// to a built in type
int test(void); // and an explicit one to avoid
// ambiguity
int cmp(bcd&);
int cmp(long);
int cmp(double);
int state() { return(status); }
void decode(char *);
};
ostream& operator<<(ostream&, bcd&);
#endif

View File

@ -0,0 +1,59 @@
#ifndef BINTREEHPP
#define BINTREEHPP
#include <stddef.h>
#if LCODE
#define NULLF 0L
#else
#define NULLF 0
#endif
#include <generic.hpp>
#include "errn.hpp"
typedef int (*IPVPVP)(void*,void*); // kludges for version 1.06
typedef void (*VPVP)(void*); // which does not always understand
// void*
class node {
friend class bintree;
node *left, *right;
void* body;
};
class bintree {
node* root;
int (* cf)(void*, void*);
void (* visit)(void*);
public:
bintree(int (* compare)(void*, void*) = NULLF,
void (* what_to_do)(void*) = NULLF)
{ root = NULL; cf = compare; visit = what_to_do; }
void* insert(void *, int&);
int remove(void *);
void* seek(void*);
void set_process(void (*v)(void*)) { visit = v; }
void set_comp(int (* compare)(void*, void*)) { cf = compare; }
void inorder(node* n = NULL, int first = 1);
void cleanup(node* n = NULL, int first = 1);
~bintree(void) { cleanup(); }
};
#define gbsearch(type) name2(type,gbsearch)
#define gbsearchdeclare(type) \
struct gbsearch(type) : bintree { \
gbsearch(type)(int (* compare)(type,type) = NULLF, \
void (*what_to_do)(type) = NULLF) : \
((IPVPVP) compare, (VPVP) what_to_do) {} \
type insert(type a, int& result) \
{ return bintree::insert(a, result); } \
int remove(type a) \
{ return bintree::remove(a); } \
type seek(type a) \
{ return bintree::seek(a); } \
void set_process(void (*v)(void*)) \
{ bintree::set_process((VPVP) v); } \
void set_comp(int (*c)(type, type)) \
{ bintree::set_comp((IPVPVP) c); } \
void inorder(void) { bintree::inorder(); } \
}
#endif

View File

@ -0,0 +1,103 @@
/*_ bios.h Tue Jul 25 1989 Modified by: Dave Mansell */
#ifndef BIOS_H
#define BIOS_H
#if __cplusplus
extern "C" {
#endif
/* struct used to send and receive information to and from */
/* the BIOS (int 0x13) disk services */
struct diskinfo_t {
unsigned drive;
unsigned head;
unsigned track;
unsigned sector;
unsigned nsectors;
void far *buffer;
};
/* manifest constants for BIOS services */
/* serial port services */
#define _COM_INIT 0 /* init serial port */
#define _COM_SEND 1 /* send character */
#define _COM_RECEIVE 2 /* receive character */
#define _COM_STATUS 3 /* get serial port status */
/* serial port initializers. One constant from each of the following */
/* four groups must be specified in the initialization byte. */
/* character size */
#define _COM_CHR7 2 /* 7 bits characters */
#define _COM_CHR8 3 /* 8 bits characters */
/* stop bit values */
#define _COM_STOP1 0 /* 1 stop bit */
#define _COM_STOP2 4 /* 2 stop bits */
/* parity */
#define _COM_NOPARITY 0 /* no parity */
#define _COM_ODDPARITY 8 /* odd parity */
#define _COM_EVENPARITY 24 /* even parity */
/* baud rate */
#define _COM_110 0 /* 110 baud */
#define _COM_150 32 /* 150 baud */
#define _COM_300 64 /* 300 baud */
#define _COM_600 96 /* 600 baud */
#define _COM_1200 128 /* 1200 baud */
#define _COM_2400 160 /* 2400 baud */
#define _COM_4800 192 /* 4800 baud */
#define _COM_9600 224 /* 9600 baud */
/* disk services */
#define _DISK_RESET 0 /* reset disk controller */
#define _DISK_STATUS 1 /* get disk status */
#define _DISK_READ 2 /* read disk sectors */
#define _DISK_WRITE 3 /* write disk sectors */
#define _DISK_VERIFY 4 /* verify disk sectors */
#define _DISK_FORMAT 3 /* format disk track */
/* keyboard services */
#define _KEYBRD_READ 0 /* read next character from keyboard */
#define _KEYBRD_READY 1 /* check for keystroke */
#define _KEYBRD_SHIFTSTATUS 2 /* get current shift key status */
/* printer services */
#define _PRINTER_WRITE 0 /* write character to printer */
#define _PRINTER_INIT 1 /* intialize printer */
#define _PRINTER_STATUS 2 /* get printer status */
/* time of day services */
#define _TIME_GETCLOCK 0 /* get current clock count */
#define _TIME_SETCLOCK 1 /* set current clock count */
/* Function prototypes for Bios services */
int cdecl _bios_keybrd(int);
int cdecl bioskey(int);
int cdecl _bios_equiplist(void);
int cdecl _bios_memsize(void);
int cdecl _bios_printer(unsigned, unsigned, unsigned);
int cdecl _bios_serialcom(unsigned, unsigned, unsigned);
int cdecl _bios_timeofday(unsigned, long *);
int cdecl _bios_disk(unsigned, struct diskinfo_t *);
#if __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,38 @@
#ifndef BITVECHPP
#define BITVECHPP
extern int _allocerr;
class bitvec {
unsigned nbits;
unsigned char *body;
public:
bitvec(int n) {
nbits = (n | 7)+1;
body = new unsigned char[nbits/8];
if (!body) { _allocerr = 1; return; }
memset(body,'\0',nbits/8);
}
bitvec(bitvec& a) {
nbits = a.nbits;
body = new unsigned char[nbits/8];
if (!body) { _allocerr = 1; return; }
memmove(body,a.body,nbits/8);
}
~bitvec() { delete body; }
int operator[](int i)
{ return (body[i >> 3] & 1 << (i & 7))? 1: 0; }
int set(int i) {
if (i < 0 || i >= nbits)
return 0;
body[i >> 3] |= 1 << (i & 7);
return 1;
}
int reset(int i) {
if (i < 0 || i >= nbits)
return 0;
body[i >> 3] &= ~(1 << (i & 7));
return 1;
}
};
#endif

View File

@ -0,0 +1,23 @@
/*_ CONIO.H Wed Jun 28 1989 Modified by: Walter Bright */
/* Copyright (C) 1988-1989 by Northwest Software */
/* All Rights Reserved */
/* Written by Walter Bright */
#if __cplusplus
extern "C" {
#endif
int cdecl getche(void);
int cdecl getch(void);
int cdecl kbhit(void);
unsigned char cdecl inp(unsigned);
unsigned char cdecl outp(unsigned,char);
int cdecl inpw(unsigned);
int cdecl outpw(unsigned,unsigned);
#if __cplusplus
}
#endif

View File

@ -0,0 +1,14 @@
#ifndef CRITERRHPP
#define CRITERRHPP
#include <int.h>
enum { CE_IGNORE, CE_RETRY, CE_ABORT };
class ce_handler {
int (* predecessor)(int, int);
void previous();
public:
ce_handler(int (* user_handler)(int,int));
~ce_handler() { previous(); }
};
#endif

View File

@ -0,0 +1,66 @@
/*_ ctype.h Fri Apr 28 1989 Modified by: Walter Bright */
#ifndef __CTYPE_H
#define __CTYPE_H 1
#if __cplusplus
extern "C" {
#endif
#ifdef __STDC__
#define __CDECL
#else
#define __CDECL cdecl
#endif
#define _SPC 8 /* white space */
#define _CTL 0x20 /* control char */
#define _BLK 0x40 /* ' ' */
#define _HEX 0x80 /* hex digit */
#define _UC 1 /* upper case letter */
#define _LC 2 /* lower case letter */
#define _PNC 0x10 /* punctuation */
#define _DIG 4 /* dig */
extern const char _ctype[];
int __CDECL isalnum(int);
int __CDECL isalpha(int);
int __CDECL iscntrl(int);
int __CDECL isdigit(int);
int __CDECL isgraph(int);
int __CDECL islower(int);
int __CDECL isprint(int);
int __CDECL ispunct(int);
int __CDECL isspace(int);
int __CDECL isupper(int);
int __CDECL isxdigit(int);
int __CDECL toupper(int);
int __CDECL tolower(int);
#define isalnum(c) (_ctype[(c)+1]&(_UC|_LC|_DIG))
#define isalpha(c) (_ctype[(c)+1]&(_UC|_LC))
#define iscntrl(c) (_ctype[(c)+1]&_CTL)
#define isdigit(c) (_ctype[(c)+1]&_DIG)
#define isgraph(c) (_ctype[(c)+1]&(_UC|_LC|_DIG|_PNC))
#define islower(c) (_ctype[(c)+1]&_LC)
#define isprint(c) (_ctype[(c)+1]&(_UC|_LC|_DIG|_PNC|_BLK))
#define ispunct(c) (_ctype[(c)+1]&_PNC)
#define isspace(c) (_ctype[(c)+1]&_SPC)
#define isupper(c) (_ctype[(c)+1]&_UC)
#define isxdigit(c) (_ctype[(c)+1]&_HEX)
#ifndef __STDC__
#define isascii(c) ((unsigned)(c)<0200)
#define toascii(c) ((c)&0x7F)
#endif
#undef __CDECL
#if __cplusplus
}
#endif
#endif /* __CTYPE_H */

View File

@ -0,0 +1,29 @@
#ifndef DATEDITHPP
#define DATEDITHPP
#include "sedit.hpp"
#include <ctype.h>
#define BS 0x0e08
#define DEL 0x5300
#define LCUR 0x4b00
#define RCUR 0x4d00
#define RET 0x1c0d
extern int _usdate;
class date_editor : public string_editor {
char loc[7];
int month() { return _usdate? (10*(loc[0]-'0')+loc[1] - '0'):
(10*(loc[2]-'0')+loc[3]-'0'); }
int day() { return _usdate? (10*(loc[2]-'0') + loc[3] - '0'):
(10*(loc[0]-'0')+loc[1]-'0'); }
int year() { return 10*(loc[4]-'0') + loc[5] -'0'; }
public:
date_editor() : (6,0) {}
int filter(char, char *, int);
int convertor(int k, char* s, int pos) {
if (k == BS) k = LCUR; if (k == DEL) k = RCUR;
if (k == RET && strlen(s) < 6) k = 0;
return k;
}
};
#endif

View File

@ -0,0 +1,46 @@
#ifndef DIRHPP
#define DIRHPP
#include <dos.h>
#include <string.h>
#include "dlist.hpp"
#include "errn.hpp"
extern int _allocerr;
struct file_info {
char attribute;
unsigned time,date;
unsigned long size;
char name[13];
};
typedef file_info *pfinf;
declare(gdlist,pfinf);
class directory {
gdlist(pfinf) d;
public:
int count;
directory(char *spec = "*.*", int attr = 0);
pfinf first()
{
return count? (d.start(), d()): 0;
}
pfinf last()
{
return count? (d.end(), d()): 0;
}
pfinf next()
{
pfinf t, n;
return count?
(t = d(), d++, n = d(), t == n? 0: n): 0;
}
pfinf prev()
{
pfinf t, n;
return count?
(t = d(), d--, n = d(), t == n? 0: n): 0;
}
};
#endif

View File

@ -0,0 +1,16 @@
/*_ DIRECT.H Wed Jun 28 1989 Modified by: Walter Bright */
#if __cplusplus
extern "C" {
#endif
#define size_t unsigned
char * cdecl getcwd(char *,size_t);
int cdecl chdir(char *);
int cdecl mkdir(char *);
int cdecl rmdir(char *);
#if __cplusplus
}
#endif

View File

@ -0,0 +1,75 @@
/*_ disp.h Fri Aug 18 1989 Modified by: Walter Bright */
/* Copyright (C) 1985-1989 by Northwest Software */
/* All rights reserved */
/* Written by Walter Bright */
#ifndef DISP_H
#define DISP_H 1 /* prevent multiple #include's */
#if __cplusplus
extern "C" {
#endif
extern int disp_numrows,disp_numcols,disp_cursorrow,disp_cursorcol;
extern int
cdecl disp_printf(char *,...),
cdecl disp_getmode(void),
cdecl disp_getattr(void),
cdecl disp_putc(int);
extern void
cdecl disp_open(void),
cdecl disp_puts(const char *),
cdecl disp_box(int,int,unsigned,unsigned,unsigned,unsigned),
cdecl disp_close(void),
cdecl disp_usebios(void),
cdecl disp_move(int,int),
cdecl disp_flush(void),
cdecl disp_eeol(void),
cdecl disp_eeop(void),
cdecl disp_startstand(void),
cdecl disp_endstand(void),
cdecl disp_setattr(int),
cdecl disp_setcursortype(int),
cdecl disp_pokew(int,int,unsigned),
cdecl disp_scroll(int,unsigned,unsigned,unsigned,unsigned,unsigned),
cdecl disp_setmode(unsigned char),
cdecl disp_peekbox(unsigned *,unsigned,unsigned,unsigned,unsigned),
cdecl disp_pokebox(unsigned *,unsigned,unsigned,unsigned,unsigned),
cdecl disp_set43(void),
cdecl disp_reset43(void),
cdecl disp_fillbox(unsigned,unsigned,unsigned,unsigned,unsigned),
cdecl disp_hidecursor(void),
cdecl disp_showcursor(void);
extern unsigned cdecl disp_peekw(int,int);
/* Globals for IBM PC displays (read only): */
extern unsigned char disp_mono,disp_snowycga,disp_mode,disp_inited,disp_ega;
extern unsigned disp_base;
/***************************
* Some attributes for the text display adapters for disp_setattr():
*/
#define DISP_REVERSEVIDEO 0x70
#define DISP_NORMAL 0x07
#define DISP_UNDERLINE 0x01
#define DISP_NONDISPLAY 0x00
/* The following attribute bits should be OR'ed in: */
#define DISP_INTENSITY 0x08
#define DISP_BLINK 0x80
/*****************************
* Values for disp_setcursortype():
*/
#define DISP_CURSORBLOCK (disp_mono ? 0x000C : 0x0007) /* block cursor */
#define DISP_CURSORHALF (disp_mono ? 0x060C : 0x0307) /* half-size cursor */
#define DISP_CURSORUL (disp_mono ? 0x0B0C : 0x0707) /* underline cursor */
#if __cplusplus
}
#endif
#endif /* DISP_H */

View File

@ -0,0 +1,56 @@
#ifndef DLISTHPP
#define DLISTHPP
#include <stdio.h>
#include <generic.hpp>
#include <stddef.h>
#include "errn.hpp"
extern int _allocerr;
class dnode {
friend class dlist;
dnode *next, *prev; // pointers to next and previous items in list
void *body; // points to whatever is associated with this node
};
class dlist {
dnode *root; // root->next is head of list *root is tail
dnode *current; // remembers current context
long count; // how many items in the list
long lpos; // where are we now
int heapobj; // delete objects as well as nodes?
public:
int linkin(void*); // put new item in list before current
void* linkout(void); // remove and return pointer to current item
void fwd(void) { if (lpos < count) { current = current->next; ++lpos;} }
void bkwd(void) { if (lpos > 1L) { current = current->prev; --lpos;} }
void start(void) { current = root->next; lpos = 1; }
void end(void) { current = root; lpos = count; }
void* get(void);
void update(void*);
long size(void) { return count; }
void cleanup();
dlist(void)
{ root = NULL; current = NULL; lpos = count = 0L; heapobj = 0; }
dlist(void* a, int = 0);
void setdel(int n) { heapobj = n; }
~dlist() { cleanup(); }
};
#define gdlist(type) name2(type,gdlist)
#define gdlistdeclare(type) \
struct gdlist(type) : public dlist { \
gdlist(type)(void) {} \
gdlist(type)(type a) : (a) {} \
void operator+=(int n) { while (n--) dlist::fwd(); } \
void operator-=(int n) { while (n--) dlist::bkwd(); } \
void operator++(void) { dlist::fwd(); } \
void operator--(void) { dlist::bkwd(); } \
void operator=(type a) {dlist::update(a); } \
type operator*(void) { return (type) dlist::linkout(); } \
type operator()(void) { return (type) dlist::get(); } \
void setflush(int n) { dlist::setdel(n); } \
}
#endif

View File

@ -0,0 +1,171 @@
/*_ dos.h Sat Aug 19 1989 Modified by: Walter Bright */
/* Copyright (C) 1985-1989 by Northwest Software */
/* All rights reserved */
/* Written by Walter Bright */
#ifndef DOS_H
#define DOS_H 1
#if __cplusplus
extern "C" {
#endif
#define size_t unsigned
/* DOS and IBM PC specific declarations */
/* Register structure required for functions int86() and intdos() */
struct WORDREGS {unsigned ax,bx,cx,dx,si,di,cflag,flags; };
struct BYTEREGS {unsigned char al,ah,bl,bh,cl,ch,dl,dh; };
union REGS { struct WORDREGS x; struct BYTEREGS h; };
struct SREGS { unsigned es,cs,ss,ds; };
int cdecl int86(int,union REGS *,union REGS *);
int cdecl int86x(int,union REGS *,union REGS *,struct SREGS *);
int cdecl intdos(union REGS *,union REGS *);
int cdecl intdosx(union REGS *,union REGS *,struct SREGS *);
void cdecl segread(struct SREGS *);
struct FIND /* struct used by findfirst() and findnext() */
{ char reserved[21]; /* reserved by DOS */
char attribute; /* attribute found (FA_XXXX) */
unsigned time,date; /* file's time and date */
unsigned long size; /* file's size */
char name[13]; /* filename followed by 0 byte */
};
struct FIND * cdecl findfirst(char *,int),* cdecl findnext(void);
/* Directory entry attributes */
#define FA_NORMAL 0x00
#define FA_RDONLY 0x01
#define FA_HIDDEN 0x02
#define FA_SYSTEM 0x04
#define FA_LABEL 0x08
#define FA_DIREC 0x10
#define FA_ARCH 0x20
extern unsigned _psp;
extern unsigned char _osmajor,_osminor,_osmode;
extern volatile int _doserrno; /* MS-DOS error codes. Refer to the */
/* ERROR RETURN TABLE in your MS-DOS */
/* manual. */
/***************************
* Define macros to get at the segment and offset of a far pointer.
*/
#define FP_SEG(fp) ((unsigned)((unsigned long)(fp) >> 16))
#define FP_OFF(fp) ((unsigned)(fp))
/* Generate a far pointer from a segment and an offset */
#define MK_FP(seg,offset) \
((void far *)(((unsigned long)(seg)<<16) | (unsigned)(offset)))
void far * cdecl _farptr_norm(void far *);
void far * cdecl _farptr_fromlong(long);
long cdecl _farptr_tolong(void far *);
/***********************************
* Far storage allocation functions
*/
void far * cdecl farmalloc(unsigned long size);
void far * cdecl farcalloc(unsigned long numelems,unsigned long elemsize);
void far * cdecl farrealloc(void far *oldptr,unsigned long newsize);
int cdecl farfree(void far *ptr);
unsigned long cdecl farcoreleft(void);
/*******************************
* File modes for open().
*/
#ifndef __FCNTL_H
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
#define O_CREAT 0
#endif
/* structure for dos_exterr */
struct DOSERROR
{
int exterror; /* extended error code */
char eclass; /* error class */
char action; /* recommended action */
char locus; /* error locus */
};
/* structure for dos_setdate/dos_getdate */
struct dos_date_t
{
char day;
char month;
int year;
char dayofweek;
};
/* structure for dos_settime/dos_gettime */
struct dos_time_t
{
char hour;
char minute;
char second;
char hsecond;
};
/* DOS specific functions: */
void cdecl dos_set_verify(int);
void cdecl dos_set_ctrl_break(int);
int cdecl dos_get_verify(void);
int cdecl dos_get_ctrl_break(void);
long cdecl dos_getdiskfreespace(int);
int cdecl dos_abs_disk_read(int,int,int,char *);
int cdecl dos_abs_disk_write(int,int,int,char *);
void cdecl dos_setdrive(unsigned, unsigned *);
void cdecl dos_getdrive(unsigned *);
int cdecl dos_setftime(int, unsigned, unsigned);
int cdecl dos_getftime(int, unsigned *, unsigned *);
int cdecl dos_setfileattr(char *, unsigned);
int cdecl dos_getfileattr(char *, unsigned *);
int cdecl dos_exterror(struct DOSERROR *);
int cdecl dosexterror(struct DOSERROR *);
int cdecl dos_setdate(struct dos_date_t *);
int cdecl dos_getdate(struct dos_date_t *);
int cdecl dos_settime(struct dos_time_t *);
int cdecl dos_gettime(struct dos_time_t *);
/* For inline code generation for inp(), inpw(), outp() and outpw() functions */
unsigned char cdecl _inline_inp(unsigned);
int cdecl _inline_inpw(unsigned);
unsigned char cdecl _inline_outp(unsigned,char);
int cdecl _inline_outpw(unsigned,unsigned);
#define inp _inline_inp
#define inpw _inline_inpw
#define outp _inline_outp
#define outpw _inline_outpw
size_t cdecl _chkstack(void);
void cdecl peek(unsigned,unsigned,void *,size_t);
void cdecl poke(unsigned,unsigned,const void *,size_t);
int cdecl bdos(char,...);
int cdecl bdosx(char,void *,char);
/* From parall.asm */
unsigned cdecl dos_alloc(unsigned);
unsigned cdecl dos_calloc(unsigned);
int cdecl dos_free(unsigned);
void cdecl _copy(unsigned,unsigned,unsigned);
unsigned long cdecl dos_avail(void);
unsigned cdecl dos_setblock(unsigned,unsigned);
#if __cplusplus
}
#endif
#endif /* DOS_H */


View File

@ -0,0 +1,30 @@
#ifndef DYNARRHPP
#define DYNARRHPP
#include <generic.hpp>
#include "errn.hpp"
class dynarr {
char *dummy;
unsigned elems;
unsigned es;
char *body;
int resize(unsigned);
public:
dynarr(unsigned n = 1, unsigned elemsize = 1);
~dynarr(void) { delete body; }
char *access(unsigned);
char *address(void) { return body; }
unsigned size(void) { return elems; }
};
#define gdynarr(type) name2(type,gdynarr)
#define gdynarrdeclare(type) \
struct gdynarr(type): dynarr { \
gdynarr(type)(unsigned n = 1) : (n, sizeof(type)) {} \
type& operator[](unsigned i) \
{ return *((type *) dynarr::access(i)); } \
type *operator&(void) { return (type *) dynarr::address(); }\
unsigned size(void) { return dynarr::size(); } \
}
#endif

View File

@ -0,0 +1,180 @@
/*_ emm.h Wed Apr 26 1989 Modified by: Walter Bright */
/* Expanded (LIM EMS) Memory Interface */
/* References:
* Lotus/Intel/Microsoft
* Expanded Memory Specification
* Version 4.0
* Available from Intel at 800-538-3373
*/
#ifndef EMM_H
#define EMM_H 1
#ifdef __cplusplus
extern "C"{
#endif
#define EMM_PAGESIZE 0x4000 /* 16K page size */
extern int emm_inited; /* != 0 if emm handler is initialized */
/********************************
* Initialize EMM handler.
* Returns:
* 0 EMS installed and operating
* !=0 No EMS detected, or it isn't functioning properly
*/
int cdecl emm_init(void);
/************************************
* Get number of unallocated pages.
* Use this function to determine how many pages available before
* you attempt to allocate them with emm_allocpages().
*/
unsigned cdecl emm_getunalloc(void);
/************************************
* Get total number of pages in EMM system.
*/
unsigned cdecl emm_gettotal(void);
/**********************************
* Allocate pages.
* It is a fatal error if there are no emm handles available.
* Input:
* n number of pages to allocate, 0 < n <= emm_getunalloc()
* Returns:
* handle that refers to these pages
*/
int cdecl emm_allocpages(unsigned);
/****************************
* Map page from logical page to physical page.
*/
void cdecl emm_maphandle(int handle,unsigned logical,unsigned physical);
/*****************************
* Save the state of the page mapping registers associated with
* the handle. The state is restored by emm_restorepagemap().
* You cannot nest emm_savepagemap()/emm_restorepagemap() calls for
* a single handle.
* There is a limited number of handles that can be saved with this
* function, fixed by the particular EMM handler. The application should
* strive to never require more than 1. This function will abort the
* program if there is no more handle space.
*/
void cdecl emm_savepagemap(int handle);
void cdecl emm_restorepagemap(int handle);
/********************************
* Get physical page address of EMM frame page.
* Input:
* pagenum EMM page number (0..3)
* Returns:
* pointer to base of that page
* NULL if error
*/
void far * cdecl emm_physpage(int);
/********************************
* Terminate use of EMM handler.
*/
void cdecl emm_term(void);
/*******************************
* Get all handles pages.
* Input:
* *p points to array to be filled in. The number of entries
* needed is returned by emm_gethandlecount();
* Output:
* *p data filled in
* Returns:
* 0 success
* !=0 error code
*/
struct emm_handle_s
{ int handle; /* active handle */
int pages; /* number of pages alloc'd to that handle */
};
int cdecl emm_gethandlespages(struct emm_handle_s *p);
/*******************************
* Get number of active emm handles.
* Returns:
* number of active handles
*/
int cdecl emm_gethandlecount(void);
/****************************
* Deallocate pages allocated for a handle by emm_allocpages().
* The program needs to deallocate its handles before exiting the program,
* else the pages will remain allocated and unavailable for use
* by other programs.
*/
void cdecl emm_deallocpages(int handle);
/****************************
* Return version number of EMM.
* Returns 0 if not initialized.
* The number is in the form of 2 hex digits, the most significant
* being the major version and the least the minor.
* For example, 0x32 means version 3.2.
*/
int cdecl emm_getversion(void);
/************************************
* The following four functions allow a program to save and restore
* the state of the EMM mapping registers. These are used in place
* of emm_savepagemap() and emm_restorepagemap() when you don't
* want to use a handle.
*/
/************************************
* Get and return size in bytes of buffer needed by the functions
* emm_getpagemap(), emm_setpagemap() and emm_getsetpagemap().
*/
unsigned cdecl emm_getpagemapsize(void);
/*******************************
* Write state of mapping registers into *dst.
*/
void cdecl emm_getpagemap(void *dst);
/*******************************
* Set state of mapping registers from values previously saved by
* emm_getpagemap() into *src.
*/
void cdecl emm_setpagemap(void *src);
/**********************************
* Equivalent to:
* emm_getpagemap(dst);
* emm_setpagemap(src);
*/
void cdecl emm_getsetpagemap(void *dst,void *src);
#ifdef __cplusplus
}
#endif
#endif /* EMM_H */


View File

@ -0,0 +1,14 @@
#define ENOMEM 1
#define EEMPTY 2
#define EBADARG 3
#define ENOCREAT 4
#define ENOTOPEN 5
#define EBADREAD 6
#define EBADWRITE 7
#define EFLUSHERR 8
#define ENOTOPENI 9
#define EBADREADI 10
#define EWINDEX 11
#define EOUTBOUND 12
#define EINCONST 13
#define EINTVEC 14

View File

@ -0,0 +1,24 @@
/*_ errno.h Sat Jun 3 1989 Modified by: Walter Bright */
#ifndef __ERRNO_H
#define __ERRNO_H 1
extern volatile int errno;
/* Values for errno corresponding to MS-DOS error numbers: */
#define ENOENT 2
#define ENOTDIR 3
#define EMFILE 4
#define EACCES 5
#define EBADF 6
#define ENOMEM 8
#define EEXIST 80
/* Our own values for errno: */
#define E2BIG 1000
#define ENOEXEC 1001
#define EDOM 1002
#define ERANGE 1003
#endif /* __ERRNO_H */

View File

@ -0,0 +1,202 @@
// EVENT.HPP - Classes Event and Event_queue and
// related definitions
#ifndef EVENT_HPP
#define EVENT_HPP
#include <stdlib.h>
#include <msmouse.h>
#include <bios.h>
#include <assert.h>
#include <string.h>
#include <int.h>
//. This is written so that it can be compiled for either text based or
//. graphics oriented applications.
#ifdef GRAPHICS
#include <fg.h>
#else
#include <disp.h>
#endif
//. Figurative constants are provided for the various possible mouse
//. events, and for the 'special keys' on the keyboard, that is the
//. keys which return a zero character value.
// Mouse events
#define MOUSE_move -1
#define MOUSE_leftdn -2
#define MOUSE_leftup -3
#define MOUSE_rightdn -4
#define MOUSE_rightup -5
#define MOUSE_middledn -6
#define MOUSE_middleup -7
// Keyboard events
#define KEY_up 0x4800
#define KEY_down 0x5000
#define KEY_left 0x4B00
#define KEY_right 0x4D00
#define KEY_pgup 0x4900
#define KEY_pgdn 0x5100
#define KEY_home 0x4700
#define KEY_end 0x4F00
#define KEY_insert 0x5200
#define KEY_del 0x5300
#define KEY_ctrlhome 0x7700
#define KEY_ctrlend 0x7500
#define KEY_ctrlright 0x7400
#define KEY_ctrlleft 0x7300
#define KEY_F1 0x3B00
#define KEY_F2 0x3C00
#define KEY_F3 0x3D00
#define KEY_F4 0x3E00
#define KEY_F5 0x3F00
#define KEY_F6 0x4000
#define KEY_F7 0x4100
#define KEY_F8 0x4200
#define KEY_F9 0x4300
#define KEY_F10 0x4400
#define KEY_ShiftF1 0x5400
#define KEY_ShiftF2 0x5500
#define KEY_ShiftF3 0x5600
#define KEY_ShiftF4 0x5700
#define KEY_ShiftF5 0x5800
#define KEY_ShiftF6 0x5900
#define KEY_ShiftF7 0x5A00
#define KEY_ShiftF8 0x5B00
#define KEY_ShiftF9 0x5C00
#define KEY_ShiftF10 0x5D00
#define KEY_CtrlF1 0x5E00
#define KEY_CtrlF2 0x5F00
#define KEY_CtrlF3 0x6000
#define KEY_CtrlF4 0x6100
#define KEY_CtrlF5 0x6200
#define KEY_CtrlF6 0x6300
#define KEY_CtrlF7 0x6400
#define KEY_CtrlF8 0x6500
#define KEY_CtrlF9 0x6600
#define KEY_CtrlF10 0x6700
#define KEY_AltF1 0x6800
#define KEY_AltF2 0x6900
#define KEY_AltF3 0x6A00
#define KEY_AltF4 0x6B00
#define KEY_AltF5 0x6C00
#define KEY_AltF6 0x6D00
#define KEY_AltF7 0x6E00
#define KEY_AltF8 0x6F00
#define KEY_AltF9 0x7000
#define KEY_AltF10 0x7100
#define KEY_AltA 0x2200
#define KEY_AltB 0x3000
#define KEY_AltC 0x2E00
#define KEY_AltD 0x2000
#define KEY_AltE 0x1200
#define KEY_AltF 0x2100
#define KEY_AltG 0x2200
#define KEY_AltH 0x2300
#define KEY_AltI 0x1700
#define KEY_AltJ 0x2400
#define KEY_AltK 0x2500
#define KEY_AltL 0x2600
#define KEY_AltM 0x3200
#define KEY_AltN 0x3100
#define KEY_AltO 0x1800
#define KEY_AltP 0x1900
#define KEY_AltQ 0x1000
#define KEY_AltR 0x1300
#define KEY_AltS 0x1F00
#define KEY_AltT 0x1400
#define KEY_AltU 0x1600
#define KEY_AltV 0x2F00
#define KEY_AltW 0x1100
#define KEY_AltX 0x2D00
#define KEY_AltY 0x1500
#define KEY_AltZ 0x2C00
//. Class Event also enumerates the types of event with which we are
//. concerned, mouse, keboard, timer, kbdint, and a further useful
//. constant, any, which represents all of the events.
typedef int coord_t;
enum event_t {
non_event = 0,
mouse = 1,
keyboard = 2,
timer = 4,
kbdint = 8,
any = 0xff
};
class Event {
friend class Event_queue;
public:
Event(event_t = non_event, coord_t = 0,
coord_t = 0, int = 0);
int is() { return type; }
int value() { return val; }
coord_t x() { return cx; }
coord_t y() { return cy; }
private:
void set(event_t, coord_t, coord_t, int = 0);
event_t type; // type of event
int val; // actual event value
coord_t cx,cy; // mouse position when event ocurred
};
//. Class Event provides a constructor and a set of access functions to
//. reflect the fact that an event is a historic fact, something which
//. has a definate set of values. The private set function allows the
//. Event_queue class only to mess about with event private data.
//. Class Event_queue provides the specified public functions, get,
//. lookahead, putback, flush, set_timer, and a constructor and
//. destructor. The get and lookahead can qualify thieir operation
//. with an optional argument which describes what sort of events to look
//. for. A static data member is used to ensure that only one Event_queue
//. is constructed.
class Event_queue {
public:
Event_queue();
~Event_queue();
Event& get(event_t which = any);
// Event& get(int which = (int) any);
// Wait for an event of specified type.
Event& lookahead(event_t which = any);
// Take a look at anything which is pending.
int putback(Event&);
// Park an event back on the queue,
// only one putback allowed.
void flush(event_t which = any);
// Dump some or all parked events.
unsigned long set_timer(unsigned long t);
// Initiate a timer event t ticks from now.
int buttons() { return lastbuttons; }
private:
int counting;
// Timing in progress
static int sentinel;
// Protects against multiple event queues
int pushed; // Classifies any putback event
Event pushed_event;
// Last event which was put back
coord_t lastx, lasty;
unsigned lastbuttons;
// Private variables for tracking mouse
int mouse_avail;// Got a previewed mouse event
Event mouse_event, current;
// Place to park a peeked mouse event
// and the event we have
event_t pending(event_t which = any);
// Has some event of interest happened?
int mevent(); // Function to analyse msm_status
int timed_out();// Is current timer period expired.
};
extern Event_queue eq;
#endif /* EVENT_HPP */

View File

@ -0,0 +1,36 @@
/*_ fcntl.h Sat Jun 3 1989 Modified by: Walter Bright */
/* Copyright (C) 1985-1989 by Northwest Software */
/* All rights reserved */
/* Written by Walter Bright */
#ifndef __FCNTL_H
#define __FCNTL_H 1
/*******************************
* File modes for open().
*/
#ifndef DOS_H
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
#define O_CREAT 0
#endif
#if 0
/* additional file modes for open - OR together as required */
#define O_CREAT 0x1200 /* create and open file - truncate if exists */
#define O_TRUNC 0x0200 /* open and truncate - fail if doesn't exist */
#define O_EXCL 0x1000 /* create - fail if file exists */
#define O_OPCR 0x1100 /* open if exists, create otherwise */
#define O_DENYRDWR 0x10 /* Exclusive use of file (default) */
#define O_DENYWR 0x20 /* Allow other processes to read */
#define O_DENYRD 0x30 /* Allow other process to write */
#define O_DENYNONE 0x40 /* Allow other processes to read & write */
#endif
/* MSC compatible mode (files are ALWAYS O_BINARY anyway) */
#define O_BINARY 0
#endif /* __FCNTL_H */


View File

@ -0,0 +1,331 @@
/*_ fg.h Fri Mar 24 1989 Modified by: Walter Bright */
/* Copyright (C) 1987-1989 by Northwest Software */
/* All Rights Reserved */
/* Originally written by Joe Huffman */
#ifndef FG_H
#define FG_H 1
#if __cplusplus
extern "C" {
#endif
/* Definition of basic coordinate system */
/************************************
* Coordinate system (right-handed):
*
* Y2 +
* |
* |
* |
* Y1 +-----------+
* X1 X2
*
* Where:
* X1 <= X2
* Y1 <= Y2
*/
typedef int fg_coord_t; /* data type for all coordinates */
/*****************************
* Coordinate box.
* box[FG_X1] = x coordinate of left edge
* box[FG_Y1] = y coordinate of bottom edge
* box[FG_X2] = x coordinate of right edge
* box[FG_Y2] = y coordinate of top edge
*/
typedef fg_coord_t fg_box_t[4];
typedef fg_coord_t far *fg_pbox_t; /* pointer to a box */
typedef fg_coord_t const far *fg_const_pbox_t;/* pointer to a const box */
typedef fg_coord_t fg_line_t[4];
typedef fg_coord_t far *fg_pline_t; /* pointer to a line */
typedef fg_coord_t const far *fg_const_pline_t;/* pointer to a const line */
#define FG_X1 0
#define FG_Y1 1
#define FG_X2 2
#define FG_Y2 3
/* Midpoint of 2 coordinates */
#define fg_coord_midpoint(x1,x2) (((x1) + (x2)) / 2)
/* Determine # of pixels high a box is */
#define fg_box_height(b) ((b)[FG_Y2] - (b)[FG_Y1] + 1)
/* Determine # of pixels wide a box is */
#define fg_box_width(b) ((b)[FG_X2] - (b)[FG_X1] + 1)
/* The number of bytes to allocate for a matrix with a bounding box 'b'. */
#define fg_matrix_size(b) (sizeof(char)*((b)[FG_X2]+1+7)/8*((b)[FG_Y2]+1))
/* The number of pixels in a box 'b'. Helpful for calculating memory for
a fg_boxread. */
#define fg_box_area(b) (((long)fg_box_width(b))*((long)fg_box_height(b)))
/* Fill in the coordinates of a line. */
#define fg_make_line(l,x1,y1,x2,y2) ((l)[FG_X1]=(x1),(l)[FG_Y1]=(y1),\
(l)[FG_X2]=(x2),(l)[FG_Y2]=(y2))
/* Fill in the coordinates of a box. */
#define fg_make_box(b,x1,y1,x2,y2) ((b)[FG_X1]=(x1),(b)[FG_Y1]=(y1),\
(b)[FG_X2]=(x2),(b)[FG_Y2]=(y2))
/****** Return TRUE if line is horizontal ******/
#define fg_line_horiz(line) ((line)[FG_Y1] == (line)[FG_Y2])
/****** Return TRUE if line is vertical ******/
#define fg_line_vert(line) ((line)[FG_X1] == (line)[FG_X2])
/* Determine if line is 0 length */
#define fg_line_zerolength(ln)\
((ln)[FG_X1] == (ln)[FG_X2] && (ln)[FG_Y1] == (ln)[FG_Y2])
/* Copy boxes */
#define fg_box_cpy(to,from) ((fg_pbox_t)fg_line_cpy((to),(from)))
/* Change the definition of a FG_COLOR. */
/* As in 'fg_setcolornum(FG_WHITE, 7);' */
#define fg_setcolornum(old,new) ((old) = (new))
/*************************
* Rotation values:
*/
#define FG_ROT0 0
#define FG_ROT90 1
#define FG_ROT180 2
#define FG_ROT270 3
typedef unsigned char fg_color_t;
typedef struct FG_HANDLE far *fg_handle_t;
/* Defines for the type of display encountered */
#define FG_NULL 0 /* all graphics are routed to bit bucket */
/* The following correspond to BIOS video modes: */
#define FG_CGAMEDRES 4 /* IBM CGA in 320*200 color (mode 0x04) */
#define FG_CGAHIRES 6 /* IBM CGA in 640*200 (mode 0x06) */
#define FG_EGACOLOR 0x0E /* EGA with regular color display (mode 0x0E) */
#define FG_EGAMONO 0x0F /* EGA with IBM monochrome monitor (mode 0x0F) */
#define FG_EGAECD 0x10 /* EGA with enhanced color display (mode 0x10) */
#define FG_VGA11 0x11 /* IBM VGA in 640*480, 1 color */
#define FG_VGA12 0x12 /* IBM VGA in 640*480, 16 colors */
#define FG_VGA13 0x13 /* IBM VGA in 320*200, 256 colors */
#define FG_PARADISEHIRES 0x58/* PARADISE VGA 800*600, 16 colors */
/* Other values for fg_display: */
#define FG_VEGAVGAHIRES 0x62 /* VIDEO 7 VEGA VGA in 800 x 600, 16 colors */
#define FG_EVGAHIRES 0x70 /* Everex EVGA in 800 x 600, 16 colors */
#define FG_HERCHALF 2 /* Hercules monochrome, 1 display page */
#define FG_HERCFULL 3 /* Hercules monochrome, 2 display pages */
#define FG_TOSHIBA -6 /* Toshiba J-3100 */
#define FG_8514A -10 /* IBM 8514A */
/* Used for filling outlines of pixels, see fg_outlinefill(). */
#define FG_FILL_ON_RIGHT 1 /* Don't change these without careful */
#define FG_FILL_ON_LEFT 0 /* consideration of the source code. See */
/* the static function delete_excess. */
/* Collect global variables into a single structure. */
struct fg_state
{
int (* cdecl far init_p)(void);
#define FG_LINE_MAX 10
int linetype[FG_LINE_MAX];
#define FG_COLOR_MAX 20
int color[FG_COLOR_MAX];
int saddr;
char far *fontptr, far *fontptr2;
int activepage;
int displaypage;
fg_box_t charbox;
int display; /* FGxxxxx */
fg_box_t displaybox;
long ncolormap;
int nsimulcolor;
unsigned numpages;
int pixelx, pixely;
/* Function pointers (initialized by fg_init_xxxx()) */
void (* cdecl far blit_p)(fg_const_pbox_t, fg_coord_t, fg_coord_t,int,int);
void (* cdecl far drawarc_p) (fg_color_t,int,int,fg_coord_t,fg_coord_t,
fg_coord_t,int,int,fg_const_pbox_t);
void (* cdecl far drawdot_p) (fg_color_t,int,int,fg_coord_t,fg_coord_t);
void (* cdecl far drawline_p)(fg_color_t,int,int,int,fg_const_pline_t);
void (* cdecl far drawlinep_p)(fg_color_t,int,int,int,fg_const_pline_t);
void (* cdecl far drawmatrix_p) (fg_color_t,int,int,int,fg_coord_t,
fg_coord_t,char far *, fg_const_pbox_t,fg_const_pbox_t);
void (* cdecl far fillbox_p) (fg_color_t, int, int, fg_const_pbox_t);
void (* cdecl far flush_p)(void);
void (* cdecl far getcolormap_p)(fg_color_t far *, int);
void (* cdecl far putc_p)(fg_color_t,int,int,int,fg_coord_t,
fg_coord_t,char,fg_const_pbox_t);
void (* cdecl far readbox_p) (fg_const_pbox_t, fg_color_t far *);
fg_color_t (* cdecl far readdot_p)(fg_coord_t,fg_coord_t);
void (* cdecl far setcolormap_p) (const fg_color_t far *, int);
void (* cdecl far setdisplaypage_p)(unsigned int);
void (* cdecl far setactivepage_p)(unsigned int);
void (* cdecl far setlinepattern_p)(int, int);
void (* cdecl far term_p)(void);
void (* cdecl far writebox_p)(fg_const_pbox_t, const fg_color_t far *);
char text_rows, attribute, text_mode;
};
extern struct fg_state cdecl fg;
/* For backward compatibility. */
#define fg_activepage fg.activepage
#define fg_charbox fg.charbox
#define fg_color fg.color
#define fg_display fg.display
#define fg_displaybox fg.displaybox
#define fg_displaypage fg.displaypage
#define fg_linetype fg.linetype
#define fg_ncolormap fg.ncolormap
#define fg_nsimulcolor fg.nsimulcolor
#define fg_numpages fg.numpages
#define fg_pixelx fg.pixelx
#define fg_pixely fg.pixely
void cdecl far fg_assert(const char far *,const char far *,unsigned);
int cdecl far fg_get_type(void);
fg_handle_t cdecl far fg_save(fg_const_pbox_t);
int cdecl far fg_init_all(void);
int cdecl far fg_init_cga(void);
int cdecl far fg_init_cgamedres(void);
int cdecl far fg_init_egaecd(void);
int cdecl far fg_init_egamono(void);
int cdecl far fg_init_egacolor(void);
int cdecl far fg_init_herc(void);
int cdecl far fg_init_herchalf(void);
int cdecl far fg_init_hercfull(void);
int cdecl far fg_init_paradisehires(void);
int cdecl far fg_init_vga11(void);
int cdecl far fg_init_vga12(void);
int cdecl far fg_init_vga13(void);
int cdecl far fg_init_evgahires(void);
int cdecl far fg_init_vegavgahires(void);
int cdecl far fg_init_toshiba(void);
int cdecl far fg_init_8514a(void);
int cdecl far fg_box_enclose(fg_const_pbox_t b1, fg_const_pbox_t b2);
int cdecl far fg_pt_inbox(fg_const_pbox_t clip,fg_coord_t x,fg_coord_t y);
int cdecl far fg_getfillside (const fg_coord_t far *p, unsigned int vertices);
unsigned cdecl far fg_linepixels (fg_const_pline_t line);
fg_pline_t cdecl far fg_line_cpy(fg_pline_t to, fg_const_pline_t from);
int cdecl far fg_lineclip(fg_const_pbox_t clip, fg_const_pline_t fline,
fg_pline_t lin);
void cdecl far fg_setenv_variable (const char far *new_string);
void cdecl far fg_setpalette (fg_color_t color_num, fg_color_t red,
fg_color_t green,
fg_color_t blue);
int cdecl far cdecl fg_fillpolygon (fg_color_t color, int mode, int mask,
unsigned int vertices, const fg_coord_t far *polygon,
fg_const_pbox_t clipbox);
void cdecl far fg_restore (fg_handle_t);
void cdecl far fg_drawellipse(fg_color_t,int,int,fg_coord_t,fg_coord_t,
fg_coord_t, fg_coord_t,int,int,fg_const_pbox_t);
void cdecl far fg_drawlineclip (fg_color_t color, int mode, int mask,
int fg_line_type, fg_const_pline_t line,
fg_const_pbox_t clip);
void cdecl far fg_drawlinepclip (fg_color_t color, int mode, int mask,
int fg_line_type, fg_const_pline_t line,
fg_const_pbox_t clip);
void cdecl far fg_drawbox (fg_color_t, int, int, int, fg_const_pbox_t,
fg_const_pbox_t);
void cdecl far fg_drawpolygon (fg_color_t color, int mode, int mask, int
line_type, unsigned int vertices, const fg_coord_t far
*polygon, fg_const_pbox_t clipbox);
void cdecl far fg_filloutline (fg_color_t color, int mode, int mask,
const fg_coord_t far *out_line, fg_coord_t far *buffer,
unsigned int pixels, int fill_side, fg_const_pbox_t clipbox);
void cdecl far fg_puts (fg_color_t,int,int,int,fg_coord_t,fg_coord_t,
char far *, fg_const_pbox_t);
void cdecl far fg_adjustxy (int, int, fg_coord_t far *, fg_coord_t far *,
fg_const_pbox_t);
void cdecl far fg_fill(fg_coord_t,fg_coord_t,fg_color_t,fg_color_t);
void cdecl far fg_traverseline (int line_type, fg_const_pline_t ln_ptr,
fg_coord_t far *pt_pairs);
void cdecl far fg_drawthickline (fg_color_t,int,int,int,fg_const_pline_t,
fg_const_pbox_t,int);
/* Use function pointers for lowest level routines */
#define fg_blit (*fg.blit_p)
#define fg_drawarc (*fg.drawarc_p)
#define fg_drawdot (*fg.drawdot_p)
#define fg_drawline (*fg.drawline_p)
#define fg_drawlinep (*fg.drawlinep_p)
#define fg_drawmatrix (*fg.drawmatrix_p)
#define fg_fillbox (*fg.fillbox_p)
#define fg_flush (*fg.flush_p)
#define fg_getcolormap (*fg.getcolormap_p)
#define fg_init (*fg.init_p)
#define fg_putc (*fg.putc_p)
#define fg_readbox (*fg.readbox_p)
#define fg_readdot (*fg.readdot_p)
#define fg_setcolormap (*fg.setcolormap_p)
#define fg_setdisplaypage (*fg.setdisplaypage_p)
#define fg_setactivepage (*fg.setactivepage_p)
#define fg_setlinepattern (*fg.setlinepattern_p)
#define fg_term (*fg.term_p)
#define fg_writebox (*fg.writebox_p)
/* Writing modes */
#define FG_MODE_XOR 3
#define FG_MODE_SET 0
/* Line types */
#define FG_LINE_SOLID 0
#define FG_LINE_LONG_DASH 1
#define FG_LINE_MEDIUM_DOTTED 2
#define FG_LINE_DASH_DOTTED 3
#define FG_LINE_MEDIUM_DASHED 4
#define FG_LINE_DASH_W_2_DOTS 5
#define FG_LINE_SHORT_DASH 6
#define FG_LINE_DENSE_DOTTED 7
#define FG_LINE_SPARSE_DOTTED 8
#define FG_LINE_USER_DEFINED 9
/* Values for color */
#define FG_BLACK fg.color[0]
#define FG_BLUE fg.color[1]
#define FG_GREEN fg.color[2]
#define FG_CYAN fg.color[3]
/* Cyan is the same as BLUE_GREEN. */
#define FG_BLUE_GREEN fg.color[3]
#define FG_RED fg.color[4]
#define FG_MAGENTA fg.color[5]
/* Purple is the same as magenta. */
#define FG_PURPLE fg.color[5]
#define FG_YELLOW fg.color[6]
#define FG_WHITE fg.color[7]
#define FG_GRAY fg.color[8]
#define FG_LIGHT_BLUE fg.color[9]
#define FG_LIGHT_GREEN fg.color[10]
#define FG_LIGHT_CYAN fg.color[11]
/* Light blue-green is the same as light_cyan. */
#define FG_LIGHT_BLUE_GREEN fg.color[11]
#define FG_LIGHT_RED fg.color[12]
#define FG_LIGHT_MAGENTA fg.color[13]
#define FG_BROWN fg.color[14]
/* normally an intense white */
#define FG_LIGHT_WHITE fg.color[15]
/* Same as LIGHT_WHITE */
#define FG_HIGHLIGHT fg.color[15]
/* blinking white */
#define FG_BLINK fg.color[16]
#if __cplusplus
}
#endif
#endif /* ifndef FG_H */


View File

@ -0,0 +1,394 @@
//_ fg.hpp Thu Sep 21 1989 Modified by: Walter Bright */
// Copyright (C) 1989 by Zortech, All Rights Reserved
// Written by Walter Bright
// Modified by Joe Huffman October 8, 1989
// Modified by Samuel Druker/Steve Teale October 14 1989
#ifndef FG_HPP
#define FG_HPP
#ifndef FG_H
#include <fg.h>
#endif
//////////////////////////////////////////
// Class representing the display itself.
class FgDisp
{
public:
// Get pointer to a box describing the edges of the display
static fg_const_pbox_t box() { return fg.displaybox; }
// Inquire about the coordinates of the edges of the display
static fg_coord_t left() { return fg.displaybox[FG_X1]; }
static fg_coord_t right() { return fg.displaybox[FG_X2]; }
static fg_coord_t bottom() { return fg.displaybox[FG_Y1]; }
static fg_coord_t top() { return fg.displaybox[FG_Y2]; }
// Inquire about the height and width of the display
static int height() { return fg.displaybox[FG_Y2] + 1; }
static int width() { return fg.displaybox[FG_X2] + 1; }
// Determine if point x,y is inside the display
static int inside(fg_coord_t x, fg_coord_t y);
// Inquire about the display type (FG_EGAECD, etc.)
static int type() { return fg.display; }
// Clear the display (set it to color)
static void clear(fg_color_t color = FG_BLACK);
};
//////////////////////////////////////////
// Root of all drawing objects
class Fg
{
public:
// Drawing modes
enum MODE { SET = FG_MODE_SET, XOR = FG_MODE_XOR };
///////////////////////////////////
// Access functions.
static int mode() { return _mode; }
static int setmode(enum MODE newmode) { return _mode = newmode; }
static int mask() { return _mask; }
static int setmask(int newmask) { return _mask = newmask; }
fg_color_t foreg() { return curfg; }
fg_color_t setdefforeg(fg_color_t dfg)
{ curfg = dfg; return _setdefforeg(dfg); }
fg_color_t setforeg(fg_color_t fg) { return curfg = fg; }
static fg_color_t backg() { return attrbg; }
static fg_color_t setbackg(fg_color_t bg) { return attrbg = bg; }
///////////////////////////////////
// Draw the object.
// The drawing is not guaranteed to be complete until
// fg_flush() is called.
// Input:
// clip Box against which to clip all output
virtual void drawc(fg_const_pbox_t clip) = 0;
virtual void draw(); // clip against edge of screen
///////////////////////////////////
// Erase the object.
virtual void erasec(fg_const_pbox_t clip) = 0;
virtual void erase(); // clip against edge of screen
///////////////////////////////////
// Translate the object, that is, move it by xoffset, yoffset.
virtual void translate(fg_coord_t xoffset, fg_coord_t yoffset) = 0;
// Constructors and destructors
Fg();
virtual ~Fg();
private:
static int display;
static MODE _mode; // drawing mode
static int _mask; // drawing mask
fg_color_t curfg; // color for this instance
static fg_color_t deffg; // default color
static fg_color_t attrbg; // background color
static fg_color_t _setdefforeg(fg_color_t dfg)
{ return deffg = dfg; }
};
//////////////////// Dot //////////////////
class FgDot : public Fg
{
public:
fg_coord_t setx(fg_coord_t x) { return _x = x; }
fg_coord_t sety(fg_coord_t y) { return _y = y; }
fg_coord_t x() { return _x; }
fg_coord_t y() { return _y; }
virtual void drawc(fg_const_pbox_t clip);
virtual void erasec(fg_const_pbox_t clip);
virtual void translate(fg_coord_t xoffset, fg_coord_t yoffset);
FgDot(fg_coord_t x, fg_coord_t y);
private:
fg_coord_t _x,_y;
};
//////////////////// Line //////////////////
class FgLine : public Fg
{
public:
fg_const_pline_t line() { return _line; }
fg_coord_t setx1(fg_coord_t x) { return _line[FG_X1] = x; }
fg_coord_t sety1(fg_coord_t y) { return _line[FG_Y1] = y; }
fg_coord_t setx2(fg_coord_t x) { return _line[FG_X2] = x; }
fg_coord_t sety2(fg_coord_t y) { return _line[FG_Y2] = y; }
fg_coord_t x1() { return _line[FG_X1]; }
fg_coord_t y1() { return _line[FG_Y1]; }
fg_coord_t x2() { return _line[FG_X2]; }
fg_coord_t y2() { return _line[FG_Y2]; }
static int type() { return _type; }
static int settype(int type) { return _type = type; }
virtual void drawc(fg_const_pbox_t clip);
virtual void erasec(fg_const_pbox_t clip);
virtual void translate(fg_coord_t xoffset, fg_coord_t yoffset);
FgLine(fg_coord_t x1, fg_coord_t y1, fg_coord_t x2, fg_coord_t y2);
FgLine(fg_const_pline_t pline);
protected:
fg_line_t _line;
static int _type; // line style (FG_LINE_XXXX)
};
class FgThickLine : public FgLine {
public:
int thickness() { return _thickness; }
int setthickness(int t) { return _thickness = t; }
virtual void drawc(fg_const_pbox_t clip);
virtual void erasec(fg_const_pbox_t clip);
virtual void translate(fg_coord_t xoffset, fg_coord_t yoffset);
FgThickLine(fg_coord_t x1, fg_coord_t y1,
fg_coord_t x2, fg_coord_t y2, int t);
FgThickLine(fg_const_pline_t pline, int t);
private:
int _thickness;
};
//////////////////// Box //////////////////
class FgBox : public FgLine
{
// This is nearly identical to the FgLine class, mostly we
// just need to redefine the drawing functions.
public:
fg_const_pbox_t box() { return FgLine::line(); }
fg_coord_t setleft(fg_coord_t x) { return setx1(x); }
fg_coord_t setbottom(fg_coord_t y) { return sety1(y); }
fg_coord_t setright(fg_coord_t x) { return setx2(x); }
fg_coord_t settop(fg_coord_t y) { return sety2(y); }
fg_coord_t left() { return x1(); }
fg_coord_t bottom() { return y1(); }
fg_coord_t right() { return x2(); }
fg_coord_t top() { return y2(); }
virtual void drawc(fg_const_pbox_t clip);
virtual void erasec(fg_const_pbox_t clip);
FgBox(fg_coord_t left, fg_coord_t bottom, fg_coord_t right, fg_coord_t top);
FgBox(fg_const_pbox_t pbox);
};
//////////////////// FillBox //////////////////
class FgFillBox : public FgBox
{
// This is nearly identical to the FgBox class, mostly we
// just need to redefine the drawing functions.
public:
virtual void drawc(fg_const_pbox_t clip);
virtual void erasec(fg_const_pbox_t clip);
FgFillBox(fg_coord_t left, fg_coord_t bottom, fg_coord_t right, fg_coord_t top);
FgFillBox(fg_const_pbox_t pbox);
private:
void drawfb(fg_const_pbox_t clip, fg_color_t color);
};
//////////////////// Char //////////////////
class FgChar : public FgDot // FgDot is the position of the lower left corner
{
public:
char ch() { return _ch; }
char setch(char ch) { return _ch = ch; }
char rot() { return _rot; }
char setrot(int rot){ return _rot = rot; }
virtual void drawc(fg_const_pbox_t clip);
virtual void erasec(fg_const_pbox_t clip);
FgChar(fg_coord_t x, fg_coord_t y, char ch, int rot = FG_ROT0);
private:
int _rot; // rotation (FG_ROT_XXX)
char _ch; // the char itself
};
//////////////////// Matrix //////////////////
class FgMatrix : public FgBox // FgBox encloses the matrix
{
public:
const char *matrix() { return _matrix; }
const char *setmatrix(const char *matrix);
char rot() { return _rot; }
char setrot(int rot) { return _rot = rot; }
virtual void drawc(fg_const_pbox_t clip);
virtual void erasec(fg_const_pbox_t clip);
FgMatrix(fg_coord_t x, fg_coord_t y, fg_const_pbox_t box, char *matrix,
int rot = FG_ROT0);
FgMatrix(const FgMatrix&);
FgMatrix& operator=(const FgMatrix&);
~FgMatrix();
private:
int _rot; // rotation (FG_ROT_XXX)
char *_matrix; // the matrix data
};
//////////////////// String //////////////////
class FgString : public FgDot // FgDot is the position of the lower left corner
{
public:
char *string() { return _string; }
char *setstring(char *string);
char rot() { return _rot; }
char setrot(int rot) { return _rot = rot; }
virtual void drawc(fg_const_pbox_t clip);
virtual void erasec(fg_const_pbox_t clip);
FgString(fg_coord_t x, fg_coord_t y, char *string, int rot = FG_ROT0);
FgString(const FgString&);
FgString& operator=(const FgString&);
~FgString();
private:
int _rot; // rotation (FG_ROT_XXX)
char *_string; // the string data
};
//////////////////// Circle //////////////////
class FgCircle : public FgDot
{
public:
fg_coord_t setradius(fg_coord_t radius) {return _radius = radius;}
fg_coord_t radius() {return _radius;}
virtual void drawc(fg_const_pbox_t clip);
virtual void erasec(fg_const_pbox_t clip);
FgCircle(fg_coord_t x, fg_coord_t y, fg_coord_t radius):FgDot(x,y)
{
setradius(radius);
}
private:
fg_coord_t _radius;
};
//////////////////// Arc //////////////////
class FgArc : public FgCircle
{
public:
fg_coord_t setstart(fg_coord_t start) {return start_angle = start;}
fg_coord_t setend(fg_coord_t end) {return end_angle = end;}
fg_coord_t start() {return start_angle;}
fg_coord_t end() {return end_angle;}
virtual void drawc(fg_const_pbox_t clip);
virtual void erasec(fg_const_pbox_t clip);
FgArc(fg_coord_t x, fg_coord_t y, fg_coord_t radius,
fg_coord_t start, fg_coord_t end):FgCircle(x,y,radius)
{
setstart(start);
setend(end);
}
private:
fg_coord_t start_angle, end_angle;
};
//////////////////// Ellipse //////////////////
class FgEllipse : public FgArc
{
public:
fg_coord_t setxradius(fg_coord_t xrad) {return setradius(xrad);}
fg_coord_t setyradius(fg_coord_t yrad) {return y_radius = yrad;}
fg_coord_t xradius() {return radius();}
fg_coord_t yradius() {return y_radius;}
virtual void drawc(fg_const_pbox_t clip);
virtual void erasec(fg_const_pbox_t clip);
FgEllipse(fg_coord_t x, fg_coord_t y, fg_coord_t xradius,
fg_coord_t yradius, fg_coord_t start, fg_coord_t end)
:FgArc(x,y,xradius,start,end)
{
setyradius(yradius);
}
private:
fg_coord_t y_radius;
};
//////////////////// Polygon //////////////////
class FgPolygon : public Fg
{
public:
unsigned int vertices() {return _vertices;}
const fg_coord_t *polygon() {return _poly;}
const fg_coord_t *setpolygon(unsigned int vertices,const fg_coord_t *poly);
void setvertex (unsigned int vertex,fg_coord_t x,fg_coord_t y);
int type() {return _type;} // Line type to draw with.
int settype(int type) {return _type = type;}
virtual void drawc(fg_const_pbox_t clip);
virtual void erasec(fg_const_pbox_t clip);
virtual void translate(fg_coord_t xoffset, fg_coord_t yoffset);
FgPolygon(unsigned int vertices, const fg_coord_t *poly = 0,
int type = FG_LINE_SOLID);
FgPolygon(const FgPolygon&);
virtual FgPolygon& operator=(const FgPolygon&);
~FgPolygon();
private:
fg_coord_t *_poly;
unsigned int _vertices;
static int _type;
};
//////////////////// Filled Polygon //////////////////
class FgFilledPolygon : public FgPolygon
{
public:
virtual void drawc (fg_const_pbox_t clip);
virtual void erasec(fg_const_pbox_t clip);
FgFilledPolygon (unsigned int vertices, const fg_coord_t *poly)
: FgPolygon (vertices, poly) {}
FgFilledPolygon(const FgFilledPolygon &a)
: FgPolygon(a) {}
};
#endif /* FG_HPP */


View File

@ -0,0 +1,39 @@
/*_ float.h Sat May 20 1989 Modified by: Walter Bright */
/* Implementation limits */
#ifndef __FLOAT_H
#define __FLOAT_H 1
#define DBL_DIG 15
#define DBL_EPSILON 2.2204460492503131e-16
#define DBL_MANT_DIG 53
extern double DBL_MAX;
#define DBL_MAX_10_EXP 308
#define DBL_MAX_EXP 1024
extern double DBL_MIN;
#define DBL_MIN_10_EXP -307
#define DBL_MIN_EXP -1021
#define FLT_DIG 6
#define FLT_EPSILON 1.19209290e-7f
#define FLT_MANT_DIG 24
extern float FLT_MAX;
#define FLT_MAX_10_EXP 38
#define FLT_MAX_EXP 128
extern float FLT_MIN;
#define FLT_MIN_10_EXP -37
#define FLT_MIN_EXP -125
#define FLT_RADIX 2
#define FLT_ROUNDS 1 /* to nearest */
#define LDBL_DIG DBL_DIG
#define LDBL_EPSILON DBL_EPSILON
#define LDBL_MANT_DIG DBL_MANT_DIG
#define LDBL_MAX DBL_MAX
#define LDBL_MAX_10_EXP DBL_MAX_10_EXP
#define LDBL_MAX_EXP DBL_MAX_EXP
#define LDBL_MIN DBL_MIN
#define LDBL_MIN_10_EXP DBL_MIN_10_EXP
#define LDBL_MIN_EXP DBL_MIN_EXP
#endif /* __FLOAT_H */

View File

@ -0,0 +1,40 @@
#ifndef FILENAMEHPP
#define FILENAMEHPP
#include <string.h>
#include "errn.hpp"
enum {
FN_OK,
FN_BADDRIVE,
FN_BADCOLON,
FN_PTOOLONG,
FN_DTOOLONG,
FN_NTOOLONG,
FN_XTOOLONG,
FN_BADCHAR,
FN_NULL,
FN_NOMEM
};
class filename {
char *fn;
const char *forbid;
public:
char drive;
char name[9];
char ext[4];
char *path;
filename() {
memset(&drive,'\0',14);
forbid = " *+=[]:;\",.?/";
fn = path = NULL;
}
filename(char *, const char * = " *+=[]:;\",.?/");
filename(filename&);
~filename() { delete path; delete fn; }
int build(char, char *,char *,char *, int);
int parse(char *);
char *operator()(void);
filename& operator=(filename&);
};
#endif

View File

@ -0,0 +1,23 @@
/*_ generic.hpp Tue Jul 5 1988 Modified by: Walter Bright */
#ifndef GENERICH
#define GENERICH 1
/* Name concatenator functions */
#define name2(n1,n2) n1 ## n2
#define name3(n1,n2,n3) n1 ## n2 ## n3
#define name4(n1,n2,n3,n4) n1 ## n2 ## n3 ## n4
typedef int (*GPT) (int,char *);
extern int genericerror(int,char *);
#define set_handler(generic,type,x) set_##type##generic##_handler(x)
#define errorhandler(generic,type) type##generic##handler
#define callerror(generic,type,a,b) (*errorhandler(generic,type))(a,b)
#define declare(a,type) a##declare(type)
#define implement(a,type) a##implement(type)
#define declare2(a,type1,type2) a##declare2(type1,type2)
#define implement2(a,type1,type2) a##implement2(type1,type2)
#endif /* GENERICH */

View File

@ -0,0 +1,50 @@
/*_ handle.h Thu May 4 1989 Modified by: Walter Bright */
#ifndef __HANDLE_H
#define __HANDLE_H 1
#if __cplusplus
extern "C" {
#endif
/* Values above this are handles, below this are far pointers */
#define HANDLE_BASE 0xFE000000
/* Maximum number of handles possible */
#define HANDLE_MAX ((int)(0x10000 - (HANDLE_BASE >> 16)))
/* Size of pages (for EMM implementations, must match EMM_PAGESIZE) */
#define HANDLE_PAGESIZE (16*1024)
/*********************************
* Determine if handle is a real handle or a far pointer.
* Returns:
* !=0 if handle
* 0 if far pointer
*/
int handle_ishandle(void __handle *h);
#define handle_ishandle(h) ((int)(((unsigned long) (h) >= HANDLE_BASE) != 0))
void __handle * cdecl handle_malloc(unsigned);
void __handle * cdecl handle_calloc(unsigned);
void __handle * cdecl handle_realloc(void __handle *,unsigned);
char __handle * cdecl handle_strdup(char __handle *);
void cdecl handle_free(void __handle *);
/* Enable these to lock out using handle memory */
#if NO_HANDLE
#define handle
#define handle_malloc(n) malloc(n)
#define handle_calloc(n) calloc((n),1)
#define handle_realloc(h,n) realloc((h),(n))
#define handle_free(h) free(h)
#define handle_strdup(h) strdup(h)
#endif
#if __cplusplus
}
#endif
#endif /* __HANDLE_H */

View File

@ -0,0 +1,47 @@
#ifndef HASHHPP
#define HASHHPP
#include <string.h>
#include "generic.hpp"
#include "errn.hpp"
class hashitem {
friend class hash;
friend void hash_report(hash&);
hashitem *next;
void *body;
char name[1]; //actual length unknown
};
typedef hashitem *HIPT;
unsigned default_hash(char *, int);
typedef unsigned (* HASHFUNC)(char *, int);
//HASHFUNC v107temp = default_hash;
class hash {
HIPT *table;
int tabsize;
HASHFUNC hashfunc;
public:
hash(int, HASHFUNC foo = &default_hash);
void* insert(char*, void*);
int remove(char*);
void* lookup(char*);
void cleanup(void);
~hash() { cleanup(); }
friend void hash_report(hash&);
};
#define ghsearch(type) name2(type,ghsearch)
#define ghsearchdeclare(type) \
struct ghsearch(type) : hash { \
ghsearch(type)(int s, HASHFUNC f = &default_hash) : \
(s,f) {} \
type insert(char *a, type b) \
{ return hash::insert(a,b); } \
int remove(char * p) \
{ return hash::remove(p); } \
type lookup(char *p) \
{ return hash::lookup(p); } \
}
#endif

View File

@ -0,0 +1,46 @@
/*_ INT.H Wed Jun 28 1989 Modified by: Walter Bright */
/* Copyright (C) 1985-1989 by Northwest Software */
/* All rights reserved */
/* Written by Walter Bright */
/* Header for int package */
#ifndef INT_H
#define INT_H 1
#if __cplusplus
extern "C" {
#endif
#ifndef DOS_H
#include <dos.h>
#endif
/* Structure passed to interrupt service routine (see int_xxx()) */
struct INT_DATA
{
unsigned prevvec_off,prevvec_seg; /* previous interrupt vector */
unsigned stacksize; /* size of ISR stack */
unsigned newstack_off,newstack_seg; /* ptr to ISR stack */
unsigned oldstack_off,oldstack_seg; /* ptr to interrupted stack */
#if LPTR
unsigned staticseg; /* value for DS */
#endif
int (cdecl *funcptr)();
union REGS regs; /* passed/returned register and flag values */
/* (the _cflag member is garbage and is ignored) */
struct SREGS sregs; /* passed/returned segment register values */
};
void cdecl int_getvector(unsigned,unsigned *,unsigned *);
void cdecl int_setvector(unsigned,unsigned,unsigned);
int cdecl int_intercept(unsigned,int (cdecl *funcptr)(struct INT_DATA *),unsigned);
int cdecl int_restore(unsigned);
void cdecl int_off(void);
void cdecl int_on(void);
#if __cplusplus
}
#endif
#endif /* INT_H */

View File

@ -0,0 +1,33 @@
#ifndef INTVECTHPP
#define INTVECTHPP
#include <int.h>
#include "errn.hpp"
void default_error(int, char*);
typedef int (cdecl *ihandler)(struct INT_DATA *);
enum { IV_OK, IV_ALREADY, IV_NOTACTIVE, IV_NOCANDO, IV_FAILURE };
enum { INITED = 1, ACTIVE };
class intvector {
unsigned char state; // use bits 1 and 2 for inited and active
unsigned char vector; // only 255 vectors max
unsigned stack; // stack size needed by current server
ihandler intserver; // pointer to current server
public:
intvector() { state = 0; } // default do-nothing initialiser
virtual int install(unsigned, ihandler, unsigned = 256);
// install with error checking
intvector(unsigned v, ihandler fp, unsigned s = 256) {
state = 0;
if (install(v,fp,s))
default_error(EINTVEC,"intvec - failed to install handler");
} // install initialiser - abort on error
int suspend(void); // deactivate
int reinstate(void); // reactivate
virtual int newhandler(ihandler, unsigned);
// specify new server
unsigned operator()(void) { return vector; } // who am I function
unsigned status(void) { return state; } // state access function
~intvector() { suspend(); }
};
#endif

View File

@ -0,0 +1,47 @@
/*_ io.h Sat Aug 19 1989 Modified by: Walter Bright */
/* Copyright (C) 1987-1989 by Northwest Software */
/* All Rights Reserved */
/* Written by Walter Bright */
/* Declarations for low level I/O functions */
#ifndef IO_H
#define IO_H 1
#if __cplusplus
extern "C" {
#endif
int cdecl read(int,void *,unsigned);
int cdecl _readx(int,void *,unsigned,unsigned);
int cdecl write(int,void *,unsigned);
int cdecl _writex(int,void *,unsigned,unsigned);
int cdecl getDS(void);
int cdecl open(const char *,int,...);
int cdecl creat(const char *,int);
int cdecl close(int);
int cdecl locking(int, int, long);
int cdecl unlink(const char *);
int cdecl remove(const char *);
int cdecl access(char *,int);
#define F_OK 0 /* does file exist? */
#define X_OK 1 /* execute permission? */
#define W_OK 2 /* write permission? */
#define R_OK 4 /* read permission? */
long cdecl lseek(int,long,int);
#define SEEK_SET 0 /* seek from start of file */
#define SEEK_CUR 1 /* relative to current position */
#define SEEK_END 2 /* relative to end of file */
long cdecl filesize(char *);
long cdecl filelength(int);
int cdecl isatty(int);
#if __cplusplus
}
#endif
#endif /* IO_H */


View File

@ -0,0 +1,28 @@
/*_ limits.h Sat May 20 1989 Modified by: Walter Bright */
/* Implementation limits */
#ifndef __LIMITS_H
#define __LIMITS_H 1
#define CHAR_BIT 8 /* # of bits in a char */
#define CHAR_MAX 127 /* max value of a char */
#define CHAR_MIN 0 /* min value of a char */
#define SCHAR_MAX 127
#define SCHAR_MIN (-128)
#define UCHAR_MAX 255
#define SHRT_MAX INT_MAX /* max value of short */
#define SHRT_MIN INT_MIN
#define USHRT_MAX UINT_MAX
#define INT_MAX 32767 /* max value of int */
#define INT_MIN (-32768) /* min value of int */
#define UINT_MAX 0xFFFF /* max value of unsigned int */
#define LONG_MAX ((long)0x7FFFFFFF)
#define LONG_MIN ((long)0x80000000)
#define ULONG_MAX 0xFFFFFFFF
#define MB_LEN_MAX 1
#endif /* __LIMITS_H */

View File

@ -0,0 +1,66 @@
/*_ locale.h Thu Sep 8 1988 Modified by: Walter Bright */
#ifndef __LOCALE_H
#define __LOCALE_H 1
#if __cplusplus
extern "C" {
#endif
#ifdef __STDC__
#define __CDECL
#else
#define __CDECL cdecl
#endif
/* Supported locales */
enum _LOCALE
{ _LOCALE_C, /* minimal environment for C translation */
_LOCALE_USA, /* implementation-defined native (USA) */
_LOCALE_ITALY,
_LOCALE_NETHERLANDS,
_LOCALE_NORWAY,
_LOCALE_SWITZERLAND,
_LOCALE_UK, /* United Kingdom */
_LOCALE_JAPAN,
_LOCALE_KOREA,
_LOCALE_CHINA, /* and Taiwan */
_LOCALE_MAX
};
#define _LOCALE_NATIVE _LOCALE_USA
struct lconv
{
char *decimal_point;
char *thousands_sep;
char *int_curr_symbol;
char *currency_symbol;
char *mon_decimal_point;
char *mon_thousands_sep;
char *negative_sign;
char frac_digits;
char p_cs_precedes;
char p_sep_by_space;
char n_sc_precedes;
char n_sep_by_space;
char n_sign_posn;
char lc[6]; /* index is LC_XXX, values are _LOCALE_XXX */
};
#define LC_ALL 0
#define LC_COLLATE 1
#define LC_CTYPE 2
#define LC_MONETARY 3
#define LC_NUMERIC 4
#define LC_TIME 5
char * __CDECL setlocale(int category, const char *locale);
struct lconv * __CDECL localeconv(void);
#if __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,517 @@
;_ macros.asm Wed Feb 3 1988 Modified by: Walter Bright */
; Copyright (C) 1985-1988 by Northwest Software
; All Rights Reserved
; Written by Walter Bright
; Determine which memory model we are assembling for. For .COM files,
; force S model.
ifdef I8086T
I8086S equ 1
else
ifndef I8086S
ifndef I8086M
ifndef I8086C
ifndef I8086L ;if none of the memory models are defined
I8086S equ 1 ;default to S model
endif
endif
endif
endif
endif
ifdef __OS2__
.286C
endif
;Decide if SI and DI are saved across function calls
SAVESIDI equ 1 ;1 means SI and DI are saved across functions
;Decide if we want to use Microsoft C calling conventions
;or Lattice C calling conventions
MSC equ 1 ;ifdef means use Microsoft C calling conventions
;ifndef means use Lattice
; Macros to bracket data segment stuff.
begdata macro
ifdef MSC
_DATA segment word public 'DATA'
_DATA ends
CONST segment word public 'CONST'
CONST ends
_BSS segment word public 'BSS'
_BSS ends
DGROUP group _DATA,CONST,_BSS
_DATA segment
else
DGROUP group data
data segment word public 'data'
endif
assume ds:DGROUP
endm
enddata macro
ifdef MSC
_DATA ends
else
data ends
endif
endm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Macros specific to each memory model in an attempt to make it easier
; to write memory model independent code.
; begcode,endcode Use to bracket code sections
; P Offset on BP to first argument on stack
; (excluding any local variables)
; SPTR 1 if small data model
; LPTR 1 if large pointers (large data)
; LCODE 1 if large code model
; ESeqDS 1 if ES == DS at all times
; SSeqDS 1 if SS == DS at all times
; SIZEPTR # of bytes in a pointer
; func Declare a function as NEAR or FAR
; callm Call function as NEAR or FAR
;;;;;;;;;;;;;; SMALL MEMORY MODEL ;;;;;;;;;;;;;;;;;
ifdef I8086S
ifdef MSC
begcode macro module
_TEXT segment word public 'CODE'
assume cs:_TEXT
endm
endcode macro module
_TEXT ENDS
endm
else
begcode macro module
pgroup group prog
prog segment byte public 'prog'
assume cs:pgroup
endm
endcode macro module
prog ends
endm
endif
P equ 4 ; Offset of start of parameters on the stack frame
SPTR equ 1
LPTR equ 0
LCODE equ 0
ESeqDS equ 0
SSeqDS equ 1
SIZEPTR equ 2 ; Size of a pointer
ifdef MSC
func macro name
_&name proc near
ifndef name
name equ _&name
endif
endm
callm macro name
call near ptr _&name
endm
else
func macro name
name proc near
endm
callm macro name
call near ptr name
endm
endif
endif
;;;;;;;;;;;;;;;;; MEDIUM MEMORY MODEL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ifdef I8086M
ifdef MSC
begcode macro module
module&_TEXT segment word public 'CODE'
assume cs:module&_TEXT
endm
endcode macro module
module&_TEXT ends
endm
else
begcode macro module
module&_code segment byte public 'code'
assume cs:module&_code
endm
endcode macro module
module&_code ends
endm
endif
P equ 6 ; Offset of start of parameters on the stack frame
SPTR equ 1
LPTR equ 0
LCODE equ 1
ESeqDS equ 0
SSeqDS equ 1
SIZEPTR equ 2
ifdef MSC
func macro name
_&name proc far
ifndef name
name equ _&name
endif
endm
callm macro name
call far ptr _&name
endm
else
func macro name
name proc far
endm
callm macro name
call far ptr name
endm
endif
endif
;;;;;;;;;;;;;;;;; COMPACT MEMORY MODEL ;;;;;;;;;;;;;;
ifdef I8086C
ifdef MSC
begcode macro module
_TEXT segment word public 'CODE'
assume cs:_TEXT
endm
endcode macro module
_TEXT ends
endm
else
begcode macro module
cgroup group code
code segment byte public 'code'
assume cs:cgroup
endm
endcode macro module
code ends
endm
endif
P equ 4 ; Offset of start of parameters on the stack frame
SPTR equ 0
LPTR equ 1
LCODE equ 0
ESeqDS equ 0
SSeqDS equ 0
SIZEPTR equ 4
ifdef MSC
func macro name
_&name proc near
ifndef name
name equ _&name
endif
endm
callm macro name
call near ptr _&name
endm
else
func macro name
name proc near
endm
callm macro name
call near ptr name
endm
endif
endif
;;;;;;;;;;;;;;;; LARGE MEMORY MODEL ;;;;;;;;;;;;;;;;;;;
ifdef I8086L
ifdef MSC
begcode macro module
module&_TEXT segment word 'CODE'
assume cs:module&_TEXT
endm
endcode macro module
module&_TEXT ends
endm
else
begcode macro module
module&_prog segment byte 'prog'
assume cs:module&_prog
endm
endcode macro module
module&_prog ends
endm
endif
P equ 6 ; Offset of start of parameters on the stack frame
SPTR equ 0
LPTR equ 1
LCODE equ 1
ESeqDS equ 0
SSeqDS equ 0
SIZEPTR equ 4
ifdef MSC
func macro name
_&name proc far
ifndef name
name equ _&name
endif
endm
callm macro name
call far ptr _&name
endm
else
func macro name
name proc far
endm
callm macro name
call far ptr name
endm
endif
endif
;Macros to replace public, extrn, and endp for C-callable assembly routines,
; and to define labels: c_label defines labels,
; c_public replaces public, c_extrn replaces extrn, and c_endp replaces endp
ifdef MSC
c_name macro name
name equ _&name
endm
c_label macro name
_&name:
endm
c_public macro a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
ifnb <a> ;;Check for blank argument
public _&a
a equ _&a
ifnb <b>
c_public b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
endif
endif
endm
c_extrn macro a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
ifnb <a> ;;Check for blank argument
extrn _&a:b
a equ _&a
ifnb <c>
c_extrn c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
endif
endif
endm
c_endp macro name
_&name ENDP
endm
else
c_name macro name
endm
c_label macro name
name:
endm
c_public macro a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
ifnb <a> ;;Check for blank argument
public a
ifnb <b>
c_public b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
endif
endif
endm
c_extrn macro a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
ifnb <a> ;;Check for blank argument
extrn a:b
ifnb <c>
c_extrn c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
endif
endif
endm
c_endp macro name
name endp
endm
endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Define function ctor as a static constructor
static_ctor macro ctor
if LCODE
XIFB segment word public 'DATA'
XIFB ends
XIF segment word public 'DATA'
dd ctor
XIF ends
XIFE segment word public 'DATA'
XIFE ends
else
XIB segment word public 'DATA'
XIB ends
XI segment word public 'DATA'
dw ctor
XI ends
XIE segment word public 'DATA'
XIE ends
endif
endm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Define function ctor as a static destructor
static_dtor macro dtor
if LCODE
XCFB segment word public 'DATA'
XCFB ends
XCF segment word public 'DATA'
dd dtor
XCF ends
XCFE segment word public 'DATA'
XCFE ends
else
XCB segment word public 'DATA'
XCB ends
XC segment word public 'DATA'
dw dtor
XC ends
XCE segment word public 'DATA'
XCE ends
endif
endm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Other more or less useful macros
setESeqDS macro ;set ES == DS, if not already true
ife ESeqDS
push DS
pop ES
endif
endm
.push macro list
irp arg,<list>
push arg
endm
endm
.pop macro list
irp arg,<list>
pop arg
endm
endm
; Macros to save and restore regs destroyed by a function
.save macro list
if SAVESIDI
irp arg,<list>
push arg
endm
endif
endm
.restore macro list
if SAVESIDI
irp arg,<list>
pop arg
endm
endif
endm
; Macros to save and restore ES, but only if ESeqDS is 1.
pushES macro
if ESeqDS
push ES
endif
endm
popES macro
if ESeqDS
pop ES
endif
endm
clr macro list ;clear a register
irp reg,<list>
xor reg,reg
endm
endm
tst macro reg
or reg,reg
endm
jmps macro lbl
jmp short lbl
endm
.if macro arg1,cond,arg2,lbl
cmp arg1,arg2
j&cond lbl
endm
;sob macro arg,lbl
; ifidn <arg>,<CX>
; loop lbl
; else
; dec arg
; jnz lbl
; endif
; endm
ifndef nobdos
bdos macro func
ifnb <func>
mov AH,func
endif
int 21h
endm
endif
.retf macro val ;force assembler to build a far return
ifnb <val>
db 0CAh
dw val
else
db 0CBh
endif
endm
; Sometimes MASM ignores my segment overrides.
segES macro
db 26h
endm
; 32 bit negate
neg32 macro reg1,reg2
neg reg1
neg reg2
sbb reg1,0
endm

View File

@ -0,0 +1,84 @@
/*_ math.h Fri Jan 20 1989 Modified by: Walter Bright */
/* Copyright (C) 1985-1989 by Northwest Software */
/* All Rights Reserved */
#ifndef __MATH_H
#define __MATH_H 1
#if __cplusplus
extern "C" {
#endif
#define HUGE_VAL 1.797693134862315e+308
/*#define HUGE_VAL DBL_MAX */
#ifdef __STDC__
#define __CDECL
#else
#define __CDECL cdecl
#endif
double __CDECL acos(double);
double __CDECL asin(double);
double __CDECL atan(double);
double __CDECL atan2(double,double);
double __CDECL cos(double);
double __CDECL sin(double);
double __CDECL tan(double);
double __CDECL cosh(double);
double __CDECL sinh(double);
double __CDECL tanh(double);
double __CDECL exp(double);
double __CDECL frexp(double,int *);
double __CDECL ldexp(double,int);
double __CDECL log(double);
double __CDECL log10(double);
double __CDECL modf(double,double *);
double __CDECL pow(double,double);
double __CDECL sqrt(double);
double __CDECL ceil(double);
double __CDECL fabs(double);
double __CDECL floor(double);
double __CDECL fmod(double,double);
#ifndef __STDC__ /* non-ANSI stuff */
/* Constants that the 8087 supports directly */
#define PI 3.14159265358979323846
#define LOG2 0.30102999566398119521
#define LN2 0.6931471805599453094172321
#define LOG2T 3.32192809488736234787
#define LOG2E 1.4426950408889634074 /* 1/LN2 */
/* Struct used with matherr() when a floating point exception occurs */
struct exception
{ int type; /* DOMAIN,SING,... */
char *name; /* pointer to string defining the name of the */
/* function that detected the error */
double arg1; /* first argument to function */
double arg2; /* second argument (if defined) to function */
double retval; /* default return value */
};
/* Values for exception.type */
#define DOMAIN 1 /* arguments are out of range for the function */
#define SING 2 /* argument is a singularity */
#define OVERFLOW 3
#define UNDERFLOW 4
#define TLOSS 5 /* total loss of significant digits */
#define PLOSS 6 /* partial loss of significant digits */
int __CDECL matherr(struct exception *);
double __CDECL atof(const char *);
double __CDECL hypot(double,double);
double __CDECL poly(double,int,double []);
#endif
#undef __CDECL
#if __cplusplus
}
#endif
#endif /* __MATH_H */

View File

@ -0,0 +1,83 @@
#ifndef MONEY_HPP
#define MONEY_HPP
#include <stream.hpp>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <ctype.h>
#include <string.h>
class money {
long dollars;
int cents;
static int errf;
void carry();
static void unsafe() { errf = -1; }
public:
money() { dollars = 0; cents = 0; }
money(long d, int c);
money(double);
money(char *);
char *format(char *s, int l = 0);
money& operator-()
{
dollars = -dollars; cents = -cents;
return *this;
}
int operator!()
{ return !dollars && !cents; }
money& operator+=(money&);
money& operator-=(money&);
money& operator*=(double);
operator double()
{ return dollars+((double) cents)/100; }
int err() { return errf; }
void clear_err() { errf = 0; }
friend money operator+(money&, money&);
friend money operator-(money&, money&);
friend money operator*(money&, double);
friend money operator*(double, money&);
friend long operator/(money&, money&);
friend money operator%(money&, money&);
friend int operator==(money&, money&);
friend int operator!=(money&, money&);
friend int operator>(money&, money&);
friend int operator<(money&, money&);
friend int operator>=(money&, money&);
friend int operator<=(money&, money&);
};
//. The friend functions implementing the comparison operations are all
//. rather trivial, and can be inlined for speed.
inline int operator==(money& a, money& b)
{
return a.dollars == b.dollars && a.cents == b.cents;
}
inline int operator!=(money& a, money& b)
{
return a.dollars != b.dollars || a.cents != b.cents;
}
inline int operator>(money& a, money& b)
{
return a.dollars > b.dollars? 1 : a.cents > b.cents;
}
inline int operator<(money& a, money& b)
{
return a.dollars < b.dollars? 1 : a.cents < b.cents;
}
inline int operator>=(money& a, money& b)
{
return !(a < b);
}
inline int operator<=(money& a, money& b)
{
return !(a > b);
}
ostream& operator<<(ostream&, money&);
#endif

View File

@ -0,0 +1,45 @@
/*_ msmouse.h Sat Jun 3 1989 Modified by: Walter Bright */
/* Copyright (C) 1986-1989 by Northwest Software */
/* All Rights Reserved */
/* Written by Walter Bright */
/* Interface to Microsoft mouse driver */
#ifndef __MSMOUSE_H
#define __MSMOUSE_H 1
#if __cplusplus
extern "C" {
#endif
/* Masks for mouse buttons */
#define LEFT_BUTTON 1
#define RIGHT_BUTTON 2
#define MIDDLE_BUTTON 0 /* so middle button is never turned on */
int cdecl msm_init(void);
void cdecl msm_term(void);
void cdecl msm_showcursor(void);
void cdecl msm_hidecursor(void);
int cdecl msm_getstatus(unsigned *,unsigned *);
void cdecl msm_setcurpos(unsigned,unsigned);
int cdecl msm_getpress(unsigned *,unsigned *,unsigned *);
int cdecl msm_getrelease(unsigned *,unsigned *,unsigned *);
void cdecl msm_setareax(unsigned,unsigned);
void cdecl msm_setareay(unsigned,unsigned);
void cdecl msm_setgraphcur(int,int,int *);
void cdecl msm_settextcur(int,int,int);
void cdecl msm_readcounters(int *,int *);
void cdecl msm_signal(unsigned,
void (cdecl *)(unsigned,unsigned,unsigned,unsigned),void *);
void cdecl msm_lightpenon(void);
void cdecl msm_lightpenoff(void);
void cdecl msm_setratio(unsigned,unsigned);
void cdecl msm_condoff(unsigned,unsigned,unsigned,unsigned);
void cdecl msm_setthreshhold(unsigned);
#if __cplusplus
}
#endif
#endif /* __MSMOUSE_H */

View File

@ -0,0 +1,83 @@
/*_ page.h Mon May 1 1989 Modified by: Walter Bright */
#ifndef __PAGE_H
#define __PAGE_H 1
#define PAGEOVERHEAD 10
/*****************************************
* Allocate a block of data and clear it.
* Use:
* unsigned page_calloc(void far *baseptr,unsigned size);
* Returns:
* offset of allocated data else 0
*/
unsigned cdecl page_calloc(void far *baseptr,unsigned size);
/*****************************************
* Allocate a block of data.
* unsigned page_malloc(void far *baseptr,unsigned size);
* Returns:
* offset of allocated data else 0
*/
unsigned cdecl page_malloc(void far *baseptr,unsigned size);
/*****************************************
* Reallocate memory that was allocated by page_malloc() or page_calloc().
* Use:
* unsigned page_realloc(void far *baseptr,unsigned p, unsigned nbytes)
* Returns:
* 0 error
* else offset of reallocated memory
*/
unsigned cdecl page_realloc(void far *baseptr,unsigned p, unsigned nbytes);
/*****************************************
* Free memory that was allocated by page_malloc() or page_calloc().
* Use:
* int page_free(void far *baseptr,unsigned p);
* Returns:
* 0 success
* -1 error (baseptr is bad, or memory is corrupted)
*/
int cdecl page_free(void far *baseptr,unsigned p);
/*****************************************
* Determine size of largest free block in page.
* unsigned page_maxfree(void far *baseptr);
*/
unsigned cdecl page_maxfree(void far *baseptr);
/*****************************************
* Initialize memory allocation system in a page.
* unsigned page_initialize(void far *baseptr,unsigned pagesize);
* Returns:
* size of largest allocatable block
*/
unsigned cdecl page_initialize(void far *baseptr,unsigned pagesize);
/*****************************************
* Return number of bytes allocated for chunk of memory that was
* allocated by page_malloc, page_calloc or page_realloc.
*/
/*unsigned cdecl page_size(void far *baseptr,unsigned p);*/
#define page_size(baseptr,p) \
(*(unsigned short far *)((char far *)(baseptr) + (p) - 2) - 2)
/****************************************
* Convert pointer to page and offset into that page into a void * pointer.
*/
/*void far * near page_toptr(void far *baseptr,unsigned p);*/
#define page_toptr(baseptr,p) (void far *)((char far *)(baseptr) + (p))
#endif /* __PAGE_H */

View File

@ -0,0 +1,40 @@
/*_ process.h Sat Jun 3 1989 Modified by: Walter Bright */
/* OS2 support added by Nikki Locke May 1989 */
/* Copyright (C) 1988-1989 by Northwest Software */
/* All Rights Reserved */
/* Written by Walter Bright */
#if __cplusplus
extern "C" {
#endif
void cdecl _exit(int);
void cdecl _dodtors(void);
int cdecl spawnl(int,char *,char *,...);
int cdecl spawnv(int,char *,char **);
int cdecl spawnlp(int,char *,char *,...);
int cdecl spawnvp(int,char *,char **);
/* mode values for spawn?? */
#define P_WAIT 0
#define P_NOWAIT 1
#define P_SAVEEXIT 2
#define P_DETACHED 4
int cdecl execl(char *,char *,...);
int cdecl execv(char *,char **);
int cdecl execlp(char *,char *,...);
int cdecl execvp(char *,char **);
/* action codes used with cwait() */
#define WAIT_CHILD 0
#define WAIT_GRANDCHILD 1
int cdecl cwait(int *,int,int);
int cdecl wait(int *);
#if __cplusplus
}
#endif

View File

@ -0,0 +1,20 @@
#ifndef RTCHPP
#define RTCHPP
#include <int.h>
#define CLOCKON 1
#define CLOCKOFF 0
class rt_clock {
int state;
int clockrow, clockcol;
int clockattr;
rt_clock *prev_clock;
friend int cdecl rtc(struct INT_DATA *);
public:
rt_clock(int = 24, int = 72, int = 0x70);
void on() { state = CLOCKON; }
void off() { state = CLOCKOFF; }
~rt_clock();
};
#endif

View File

@ -0,0 +1,25 @@
#ifndef STREDITHPP
#define STREDITHPP
#include <ctype.h>
#include <bios.h>
#include <string.h>
#include <dos.h>
#include "errn.hpp"
#define WHOKNOWS -1
class string_editor {
char *local; // saves a copy of the string as was
int insert; // insert or overtype?
public:
int maxlength; // of string when editing
int howlong, where; // reporting variables
virtual int command_source(void) { return bioskey(0); }
virtual int filter(char c, char *s, int pos)
{ return isprint(c); }
virtual int convertor(int k, char *s, int pos) { return k; }
string_editor(int = 79, int = 1);
int edit(int, int, char *, int = 0, int = 0, int = 0);
~string_editor() { delete local; }
};
#endif

View File

@ -0,0 +1,24 @@
/*_ setjmp.h Fri Apr 28 1989 Modified by: Walter Bright */
/* Copyright (C) 1985-1989 by Northwest Software */
/* All Rights Reserved */
#ifndef __SETJMP_H
#define __SETJMP_H 1
typedef int jmp_buf[9];
#if __cplusplus
extern "C" int setjmp(jmp_buf);
extern "C" void longjmp(jmp_buf,int);
#else
#ifndef __STDC__
int cdecl setjmp(jmp_buf);
void cdecl longjmp(jmp_buf,int);
#else
int setjmp(jmp_buf);
void longjmp(jmp_buf,int);
#endif
#endif
#endif /* __SETJMP_H */

View File

@ -0,0 +1,36 @@
/*_ SIGNAL.H Wed Jun 28 1989 Modified by: Walter Bright */
#ifndef SIGNAL_H
#define SIGNAL_H 1
#if __cplusplus
extern "C" {
#endif
#ifdef __STDC__
#define __CDECL
#else
#define __CDECL cdecl
#endif
typedef volatile int sig_atomic_t;
#define SIG_DFL (void (*)(int)) 0
#define SIG_ERR (void (*)(int)) 1
#define SIG_IGN (void (*)(int)) 2
#define SIGABRT 0 /* abort */
#define SIGFPE 1 /* floating point error */
#define SIGILL 2 /* illegal instruction */
#define SIGINT 3 /* interrupt */
#define SIGSEGV 4 /* segment violation */
#define SIGTERM 5 /* terminate (control-break) */
void (*signal(int,void (*)(int)))(int);
int __CDECL raise(int);
#if __cplusplus
}
#endif
#endif /* SIGNAL_H */

View File

@ -0,0 +1,103 @@
#ifndef SLISTHPP
#define SLISTHPP
#include <stddef.h>
#include <generic.hpp>
#include "errn.hpp"
#if LPTR
#define LCAST (long)
#else
#define LCAST
#endif
typedef void* ent;
class slink {
friend class slist; // Members must be accessible to slist
friend class slist_iterator; // and to the iterator
slink* next;
ent e;
slink(ent a) {e = a; next = NULL; }
};
class slist {
friend class slist_iterator;
slink* last; // last->next is head of list
public:
int insert(ent a); // add at head of list
int append(ent a); // add at tail of list
ent get(void); // return and remove head of list
void clear(int = 0); // remove all links
slist(void) { last = NULL; }
slist(ent a);
~slist() { clear(); }
};
class slist_iterator {
slink* ce;
slist* cs;
public:
slist_iterator(slist& s) { cs = &s; ce = NULL; }
ent operator()(void);
};
#define gslist(type) name2(type,gslist)
#define gslist_iterator(type) name2(type,gslist_iterator)
#define gslistdeclare(type) \
struct gslist(type): slist { \
int insert(type a) { return slist::insert(a); } \
int append(type a) { return slist::append(a); } \
type get() { return (type) slist::get(); } \
void flush(int all = 0) { slist::clear(all); } \
gslist(type)(void) {} \
gslist(type)(type a) : ((void *) a) {} \
}; \
\
struct gslist_iterator(type) : slist_iterator { \
gslist_iterator(type)(gslist(type)& s) : (s) {} \
type operator()() \
{ return (type) slist_iterator::operator()(); } \
}
#define gqueue(type) name2(type,gqueue)
#define gqueuedeclare(type) \
struct gqueue(type): slist { \
int queue(type a) { return slist::append(a); } \
type dequeue() { return (type) slist::get(); } \
gqueue(type)() {} \
gqueue(type)(type a) : (a) {} \
}
#define gstack(type) name2(type,gstack)
#define gstackdeclare(type) \
struct gstack(type): slist { \
int push(type a) { return slist::insert(a); } \
type pop() { return (type) slist::get(); } \
gstack(type)() {} \
gstack(type)(type a) : (a) {} \
}
class iqueue : slist {
unsigned ic;
public:
void queue(int a) { slist::append((ent) (LCAST a)); ++ic; }
int dequeue() { return ic? (--ic, (int) slist::get()): 0; }
int any() { return ic; }
iqueue(void) { ic = 0; }
iqueue(int n) : ((ent) (LCAST n)) { ic = 0; }
};
class istack : slist {
unsigned ic;
public:
void push(int a) { slist::insert((ent) (LCAST a)); ++ic; }
int pop() { return ic? (--ic, (int) slist::get()): 0; }
int any() { return ic; }
istack(void) { ic = 0; }
istack(int n) : ((ent) (LCAST n)) { ic = 0; }
};
#endif

View File

@ -0,0 +1,23 @@
/*_ sound.h Sat Jun 3 1989 Modified by: Walter Bright */
/* Copyright (C) 1988-1989 by Northwest Software */
/* All Rights Reserved */
/* Written by Walter Bright */
#if __cplusplus
extern "C" {
#endif
#if __OS2__
void cdecl sound_note(int frequency,int duration);
#else
void cdecl sound_tone(int cycles,int uptime,int dntime);
#endif
void cdecl sound_beep(int freq);
void cdecl sound_click(void);
#if __cplusplus
}
#endif

View File

@ -0,0 +1,15 @@
/*_ stdarg.h Mon Jan 19 1987 Modified by: Walter Bright */
/* ANSI C style variable arguments */
#ifndef STDARG_H
#define STDARG_H 1
typedef char *va_list;
#define va_start(ap,parmn) ((ap) = (va_list)&(parmn) + sizeof(parmn))
#define va_arg(ap,type) (*((type *)ap)++)
#define va_end(ap)
#endif /* STDARG_H */

View File

@ -0,0 +1,24 @@
/*_ stddef.h Tue May 9 1989 Modified by: Walter Bright */
#ifndef __STDDEF_H
#define __STDDEF_H 1
typedef int ptrdiff_t;
extern volatile int errno;
#define size_t unsigned
#define wchar_t char
#define offsetof(t,i) ((size_t)((char *)&((t *)0)->i - (char *)0))
#if LPTR
#define NULL 0L
#else
#define NULL 0
#endif
#if __cplusplus
inline void *operator new(size_t s, void *at)
{ return at; }
#endif
#endif

Some files were not shown because too many files have changed in this diff Show More