home *** CD-ROM | disk | FTP | other *** search
- SNIPPR23.REV
-
- This Mod to SNIPPER.COM was based on work done by Tom Kihlken in the
- original PC Magazine Utilities Article in V6,N18, 10/27/87 and the Mod by
- Jim Turner in his SNIPR22.COM in SNIPR21.ARC in Forum UTILFO Lib #2.
-
- Copies any portion of text screen to a printer or file, or inserts it
- as keyboard input into an applications program. SNIPPR23.COM [Ver 2.3] has
- all the features of the original by Tom Kihlken, plus the added cursor pad
- keys: Home, End, PgUp, & PgDn. These new cursor functions give quick
- 1 keystroke moves to all screen/window edges for either anchoring 1st Upper
- Left corner of window or 2nd Lower Right corner. With .ASM source, .COM,
- & .DOC ,plus list of changes to ASM separately described in .REV file.
-
- The main purpose of this mod is to allow quicker moves to the screen
- edges by using single keystroke moves using Home, End, PgUp, and PgDn. This
- relieves the need to hold down the arrows keys and wait, especially for older
- XT's like mine. The functions are as follows:
-
- HOME Move to Left Edge of Screen/SNIPPER Window
- END Move to Right Edge of Screen
- PGUP Move to Top Edge of Screen/SNIPPER Window
- PGDN Move to Bottom Edge of Screen
-
- Note that like the arrow keys, any of these can be used to anchor/position
- both the starting upper-left corner or the finishing lower-right corner.
-
- The default hot key can be changed using DEBUG by substituting the
- Scan code and Shift mask values listed in the article. The address of the
- Scan code byte in Version 1.1 was :056B, and that of the Shift mask was :057B.
- The present address of the Scan code byte in Version 2.3 is :0622, and that
- of the Shift mask is :0632.
-
- To help find the changes to the code, the revised lines have the
- suffix V2.3 in Columns 75-78 in the ASM file. No lines were deleted,
- although some lines were modified and new lines were added. The increased
- length over V1.2 is 160 bytes,(approximately 10 %) [100 bytes over V2.2],
- which is not much, but if you want it leaner, the Home and PgUp functions
- can be deleted by modifying the ASM source code, since the PgDn and End
- functions are the ones used most.
-
- RENAME the COM file to SNIPPER.COM to replace older versions, or keep
- the name as is to maintain separate versions.
-
- CHANGES in .ASM SOURCE CODE
- Note that only the lines changed are listed below. For a better look at
- the logic, please look in the actual ASM file. Also, some lines have no
- change to the actual code, the mod being only the inclusion of a label to
- allow a jump to that point.
-
- Lines 78-81 include 4 new flags (1 for each key) to record and save the
- cursor keypad presses.
- Lines 117,122,126 & 130 have new labels to allow jumps to them to force
- movement to the appropriate screen edge prior to anchoring the first corner.
- Lines 155-162 perform the comparisons against the keypress to see if any of
- the new keys have been pressed prior to anchoring the first corner.
- Lines 178-181 clear the 4 new flags before reading the keyboard inputs to move
- cursor after anchoring the first corner.
- Line 191-194 & 197-200 perform the comparisons against the keypress to see if
- any of the new keys have been pressed to move cursor after anchoring the
- first corner.
- Lines 195-196 have been moved to preserve a short jump, but are unchanged.
- Lines 202-204, 211-212, 229-231, 238-240 respectively set the flag for a
- given keypress and loads the 2nd corner coords into the DX register.
- Lines 223-227 & 250-254 modify the COL_LOOP and ROW_LOOP respectively, by
- adding compares that check whether any of the new flags are set, and, if so,
- continues adding or removing columns or rows until the screen or window edges
- are reached.
-
- The new/modified lines in the ASM source code are listed below.
-
- Ln # Line... Version
- ----- ------------------------------------------------------------------- ----
- 78 END_FLAG DB 0 ;"END" Key Pressed =1 V2.3
- 79 PGDN_FLAG DB 0 ;"PGDN" Key Pressed =1 V2.3
- 80 HOME_FLAG DB 0 ;"HOME" Key Pressed =1 V2.3
- 81 PGUP_FLAG DB 0 ;"PGUP" Key Pressed =1 V2.3
-
- 117 FORCE_RIGHT: MOV DL,CRT_COLS ;JUMP TO THE RIGHT EDGE V2.3
-
- 122 FORCE_LEFT: XOR DL,DL ;IF YES, WRAP TO LEFT EDGE V2.3
-
- 126 FORCE_BOTTOM: MOV DH,SCRN_ROWS ;JUMP DOWN TO THE BOTTOM V2.3
-
- 130 FORCE_TOP: XOR DH,DH ;JUMP BACK TO THE TOP V2.3
-
- 155 CMP AH,47H ;IS IT HOME KEY? V2.3
- 156 JE FORCE_LEFT ;JUMP TO LEFT SCREEN EDGE V2.3
- 157 CMP AH,49H ;IS IT PGUP KEY? V2.3
- 158 JE FORCE_TOP ;JUMP TO TOP SCRREN EDGE V2.3
- 159 CMP AH,4FH ;IS IT END KEY? V2.3
- 160 JE FORCE_RIGHT ;JUMP TO RIGHT SCREEN EDGE V2.3
- 161 CMP AH,51H ;IS IT PGDN KEY? V2.3
- 162 JE FORCE_BOTTOM ;JUMP TO BOTTOM SCREEN EDGE V2.3
-
- 178 MOV END_FLAG,0 ; CLEAR END FLAG V2.3
- 179 MOV PGDN_FLAG,0 ; CLEAR PGDN FLAG V2.3
- 180 MOV HOME_FLAG,0 ; CLEAR HOME FLAG V2.3
- 181 MOV PGUP_FLAG,0 ; CLEAR PGUP FLAG V2.3
-
- 191 CMP AH,4FH ;IS IT "END"? V2.3
- 192 JE GOT_END ;GO TO RIGHT EDGE OF SCREEN V2.3
- 193 CMP AH,51H ;IS IT "PGDN"? V2.3
- 194 JE GOT_PGDN ;GO TO BOTTOM EDGE OF SCREEN V2.3
-
- 197 CMP AH,47H ;IS IT "HOME"? V2.3
- 198 JE GOT_HOME ;GO TO LEFT EDGE OF WINDOW V2.3
- 199 CMP AH,49H ;IS IT "PGUP"? V2.3
- 200 JE GOT_PGUP ;GO TO TOP EDGE OF WINDOW V2.3
-
- 202 GOT_HOME: MOV HOME_FLAG,1 ;"HOME" KEY PRESSED V2.3
- 203 SUB_COL:
- 204 MOV DX,BOT_RIGHT ;2ND CORNER COORDS V2.3
-
- 211 GOT_END: MOV END_FLAG,1 ;"END" KEY PRESSED V2.3
- 212 ADD_COL:
- 213 MOV DX,BOT_RIGHT ;2ND CORNER COORDS V2.3
-
- 223 CMP END_FLAG,1 ;IF "END", REPEAT TO RIGHT EDGE V2.3
- 224 JE ADD_COL ;ADD ANOTHER COLUMN V2.3
- 225 CMP HOME_FLAG,1 ;IF "HOME", REPEAT TO LEFT EDGE V2.3
- 226 JE SUB_COL ;REMOVE ANOTHER COLUMN V2.3
- 227 GET_KB_K2_JMP: JMP GET_KB_KEY2 ; V2.3
-
- 229 GOT_PGUP: MOV PGUP_FLAG,1 ;"PGUP" KEY PRESSED V2.3
- 230 SUB_ROW:
- 231 MOV DX,BOT_RIGHT ;2ND CORNER COORDS V2.3
-
- 238 GOT_PGDN: MOV PGDN_FLAG,1 ;"PGDN" KEY PRESSED V2.3
- 239 ADD_ROW:
- 240 MOV DX,BOT_RIGHT ;2ND CORNER COORDS V2.3
-
- 250 CMP PGDN_FLAG,1 ;IF "PGDN", REPEAT TO BOTTOM EDGE V2.3
- 251 JE ADD_ROW ;ADD ANOTHER ROW V2.3
- 252 CMP PGUP_FLAG,1 ;IF "PGUP", REPEAT TO TOP EDGE V2.3
- 253 JE SUB_ROW ;REMOVE ANOTHER ROW V2.3
- 254 JMP GET_KB_KEY2 ; V2.3
-
-
- For more info on the earlier versions, download the following files:
-
- Filename : SNIP12.ARC Forum: UTILFO Lib: Utilities (PCMAG) Lib #: 2
- Submitter: [75776,1011] 06-Nov-88 for info on Version 1.2
-
- Filename : SNIP21.ARC Forum: UTILFO Lib: Utilities (PCMAG) Lib #: 2
- Submitter: [71560,3452] 20-Nov-88 for info on Version 2.2
-
- Please note the slight inconsistency in the filenames and version numbers,
- i.e., SNIP21.ARC contains a file labeled Version 2.2. To avoid confusion,
- I have named my mod Version 2.3.
-
- T. Gentile
-