; Program: AREA ; Author: Joe Wright ; Date: 20 June 1987 ; Version: 1.0 VERS EQU 17 ; Latest Release ; 88/03/31 Added additional entries for Ontario; made some ; cosmetic changes; sorted area codes in ascending order... ; easier to modify existing areacodes or to add new ones. ; v1.7 - Bill Christian ; 88/03/12 Added three newly-announced revisions (A/C 407. 508, & 719). ; v1.6 - John H. Johnson ; 88/02/12 Added PC-Pursuit information to appropriate records. ; v1.5 - Lee D. Rimar ; 87/09/20 Satelite phone-service to ocean-going yachts (A/C 871 & 872). ; v1.4 - John H. Johnson ; 87/08/20 Improved entries for Los Angeles County (A/C 213 and 818). ; v1.3 - Paul Foote ; 87/08/10 Improved entries for Indiana, Ohio, Michigan ; v1.2 - Jim Widner ; 87/07/29 Improved entries for Canada. ; v1.1 - Ian Cottrell ; Sysop - Info Centre RCP/M ; (613) 952-2289 ; Inspired by AREACODE by Kelly Smith circa 1981... ; Like AREACODE, AREA searches a simple database to find telephone area codes. ; Unlike AREACODE, AREA will search the database for any match and report ; the entire record for each match. ; You may use any part of an area code or name for the search. All matches ; will be reported. ; There may be any number of records of the following form: ; db '303' ; db 'Denver, Boulder, Aspen, All of Colorado' ; db CR,LF,' Pursuit - CODEN' ; db 0 ; The form of the record is fairly free except that a three digit ; area code is expected as the first three characters of the record. ; Extra "Pursuit" line added only in applicable areas. ; Each record is terminated with a single null (db 0). ; The end of all records is terminated with a second null. ; This Program is distributed as AREA10.ASM and you are heartily ; invited to add dialing areas to it or to modify it in any way. ; I only ask that you document any changes here at the top of the source ; file and in the code and change the version number. Please make your ; changes available to the rest of us in source (.ASM) form. ; I hope you like this one, I certainly do. Joe Wright, (408) 297-5583 LINES EQU 22 ; Number of records before [More] ; General System Equates BDOS EQU 5 ; BDOS entry point CONO EQU 2 ; Console output function RCON EQU 10 ; Read console function CR EQU 13 ; Carriage return LF EQU 10 ; Line feed TAB EQU 09 ; 8-Space Tab ESC EQU 27 ; Escape character BASE EQU 0 TBUF EQU BASE+80H ; Default buffer TPA EQU BASE+100H ORG TPA JMP START ;SIGN: DB ESC,'p',' AREA v17 ',ESC,'q' ; Will highlight ; filename for terminals using H19 screen codes -- ESC p and ESC q. ; -> To use: 1- remove semicolon from in front of label SIGN: above. ; 2- comment out the following label SIGN: below. SIGN: DB 'AREA Ver ',VERS/10+'0','.',VERS MOD 10+'0' DB 0 ; DB ' by Joe Wright, June, 1987',0 START: LXI H,SIGN ; Point to signon message CALL PSTR ; Print string at (HL) CALL CRLF ; New line LDA TBUF+2 ; First character of command string CPI '/' ; Check for help JZ HELP ; Report help and return to CCP CPI '?' JZ HELP CALL TERM ; Terminate the input line (null) JNZ SEARCH ; Search for user's string, return to CCP STRT: CALL HELP ; Report help STRT1: XRA A STA FOUND ; Show nothing found MVI A,LINES STA LINE ; Restore line count to LINES CALL PRINT ; Ask for target DB CR,LF,LF, ' Enter Area, City, State/Province or mnemonic: ',0 CALL RDCON ; Wait for it RZ ; No selection, quit CALL CRLF ; Turn up a new line LXI H,TBUF+1 ; Point to user's string CALL CAPSTR ; Capitalize it CALL SEARCH ; This time, don't return to CCP but.. JMP STRT1 ; Start over ; Advance HL to first non-space SKSP: MOV A,M ; Get a character CPI 0 ; Is it a null? RZ ; First non-space is a null SUI ' ' ; Is it a space? RNZ ; Return if not INX H ; Next JMP SKSP ; Try again SEARCH: LXI H,TBUF+1 ; Point to user's string CALL SKSP ; Skip leading spaces JZ STRT ; First non-space was a null XCHG ; Target to DE LXI H,AREAS+1 ; Point to database SRCH0: PUSH D ; Save pointer to target JMP SRCH2 ; Get the search underway SRCH1: POP D ; Get target address PUSH D ; And save it again SRCH2: LDAX D ; Get next byte from target ORA A ; Check for null JZ GOTONE ; End of this compare MOV A,M ; Get one from database ORA A ; Is it a null? JNZ SRCH3 ; Nope.. INX H ; Point to the next one MOV A,M ; Get it ORA A ; Is it a null as well? JZ ENDLST ; Finished if so, continue if not. SRCH3: CALL CAPS ; Capitalize character from database XCHG ; Point HL at target CMP M ; Same as target byte? XCHG INX H ; Point to next byte in database JNZ SRCH1 ; Not the same, start over INX D ; Point to next target byte JMP SRCH2 ; Try next character ENDLST: POP H ; Point to target LDA FOUND ; Get found flag ORA A ; Any found? RNZ ; Yes, normal end CALL PRINT DB ' Reference ',0 CALL PSTR ; Print the target string CALL PRINT DB ' Not Found.',0 RET GOTONE: LDA FOUND ORA A CNZ CRLF ORI 255 STA FOUND ; Leave message for endlst CALL PRINT DB ' Area ',0 CALL LAST ; Point HL to beginning of record MVI B,3 ; Three digits for area code P3: MOV A,M ; Get a digit INX H ; Point to next CALL COUT ; Ship it DCR B ; Count down JNZ P3 ; Again CALL PRINT DB ' - ',0 CALL PSTR ; Print the rest of the database record PUSH H ; Save pointer to next record LXI H,LINE ; Point to line count DCR M ; Count down JNZ GOT1 ; Not at limit MVI M,LINES ; Limit was reached, LINES to LINE CALL SAK ; Wait for, and echo, user's response GOT1: POP H ; Get the pointer back JMP SRCH1 ; Try again HELP: CALL PRINT DB ' * Telephone Dialing Area Database *',CR,LF DB ' -------------------------------',CR,LF DB ' Search for Area Code, City, region,',CR,LF DB ' State/Province, or PC-Pursuit mnemonic. ',CR,LF DB ' Usage: AREA BOSTON,AREA 617,AREA MASS,etc.',CR,LF,0 RET ; We have printed LINES lines, report and wait for any keypress SAK: CALL PRINT DB CR,LF,' [More] ',0 MVI C,1 JMP BDOS ; Go to bdos, return to caller ; Capitalize the string at HL until a null is encountered CAPSTR: MOV A,M ; Get a character ORA A ; Check for null RZ ; Finished if so CALL CAPS ; Capitalize it MOV M,A ; Put it back INX H ; Point to the next one JMP CAPSTR ; Again ; Capitalize the character in A if necessary. CAPS: CPI 'a' RC ; Not lower case, ret CPI 'z'+1 RNC ; Also not lower case, ret ANI 5FH ; Force upper case RET RDCON: LXI D,TBUF-1 ; Max length position MVI A,40 ; Any city or state longer ? STAX D ; Store it MVI C,RCON ; Read console function CALL BDOS ; Do it, wait for user input TERM: LXI H,TBUF ; Point to default buffer count MOV E,M ; Count in E MVI D,0 INX H ; Point to first character PUSH H ; Save the pointer DAD D ; Point past last character MVI M,0 ; Terminate it with a null POP H ; Restore pointer to first character MOV A,M ; Get the first character ORA A ; Return Z if no characters RET ; Back up to the first character of the record (area code) LAST: DCX H ; Back up MOV A,M ; Get one ORA A ; Null? JNZ LAST ; Again if not INX H ; Point to first character RET PRINT: XTHL ; Save HL on top of stack and point to string CALL PSTR ; Print the string XTHL ; Restore HL, top of stack is next instruction RET PSTR: MOV A,M ; Get a character INX H ; Point to next ORA A ; Is it a null? RZ ; Quit if so, else.. CALL COUT ; Ship it to the terminal JMP PSTR ; Again CRLF: MVI A,CR ; Carriage return code CALL COUT ; Ship it MVI A,LF ; Line feed code, fall through to cout COUT: PUSH H PUSH D PUSH B PUSH PSW ; Save all the registers MOV E,A ; Character to E MVI C,CONO ; Console output function CALL BDOS ; Do it POP PSW POP B POP D POP H ; Restore all the registers RET FOUND: DB 0 ; At least one match was found if NZ LINE: DB LINES ; Lines per screen ; The following database records are free form except that the three-digit ; area code is expected as the first three characters. They may be of ; any length and may include CR and LF characters where appropriate. ; The main program indents the reported line one space. If you would ; print a second line, you might consider indenting two spaces. ; Please note again that all records are terminated with a null and ; that the end of the records is terminated with a second null. ; Again, please feel free to make whatever changes or corrections and ; additions you like. AREAS: DB 0 ; Permits finding beginning of first record DB '011' DB 'The International Access Code',0 DB '170' DB 'Northwest Mexico',0 DB '190' DB 'Mexico City',0 DB '201' DB 'Newark, Morristown, Hackensack, ' DB 'New Jersey' DB CR,LF,' Pursuit - NJNEW',0 DB '202' DB 'Washington, District of Columbia' DB CR,LF,' Pursuit - DCWAS',0 DB '203' DB 'Hartford, Bridgeport, All of ' DB 'Connecticut',0 DB '204' DB 'Winnipeg, Brandon, All of Manitoba, ' DB 'Canada',0 DB '205' DB 'Huntsville, Mobile, Tuscaloosa, All of ' DB 'Alabama',0 DB '206' DB 'Seattle, Tacoma, Vancouver, Washington' DB CR,LF,' Pursuit - WASEA',0 DB '207' DB 'Portland, Bangor, All of ' DB 'Maine',0 DB '208' DB 'Boise, All of ' DB 'Idaho',0 DB '209' DB 'Fresno, Stockton, ' DB 'California',0 DB '212' DB 'New York City (Manhattan, The Bronx), ' DB 'New York' DB CR,LF,' Pursuit - NYNYO',0 DB '213' DB 'Los Angeles, Hollywood, Long Beach, Santa Monica, ' DB 'California' DB CR,LF,' Pursuit - CALAN',0 DB '214' DB 'Dallas, Texas' DB CR,LF,' Pursuit - TXDAL',0 DB '215' DB 'Philadelphia, Chester, Allentown, ' DB 'Pennsylvania' DB CR,LF,' Pursuit - PAPHI',0 DB '216' DB 'Akron, Cleveland, Massillon, Youngstown, ' DB 'Ohio' DB CR,LF,' Pursuit - OHCLV',0 DB '217' DB 'Casey, Springfield, ' DB 'Illinois',0 DB '218' DB 'Duluth, ' DB 'Minnesota',0 DB '219' DB 'Gary, Hammond, Michigan City, South Bend, ' DB 'Indiana',0 DB '301' DB 'Baltimore, Annapolis, All of ' DB 'Maryland' DB CR,LF,' Pursuit - DCWAS (some areas)',0 DB '302' DB 'Dover, All of ' DB 'Delaware',0 DB '303' DB 'Denver, Aspen, Boulder, ' DB CR,LF,' Pursuit - CODEN',0 DB '304' DB 'Charleston, All of West Virginia',0 DB '305' DB 'Miami, Ft. Lauderdale, Key West, ' DB 'Florida' DB CR,LF,' Pursuit - FLMIA',0 DB '306' DB 'Regina, Saskatoon, All of Saskatchewan, ' DB 'Canada',0 DB '307' DB 'Cheyenne, All of Wyoming',0 DB '308' DB 'North Platte, Scottsbluff, ' DB 'Nebraska',0 DB '309' DB 'Peoria, ' DB 'Illinois',0 DB '312' DB 'Chicago, Libertyville, Lake Forest, Elgin, Highland Park, ' DB CR,LF,TAB,' Illinois' DB CR,LF,' Pursuit - ILCHI',0 DB '313' DB 'Detroit, Royal Oak, Adrian, Ann Arbor, ' DB 'Michigan' DB CR,LF,' Pursuit - MIDET',0 DB '314' DB 'Saint Louis, ' DB 'Missouri',0 DB '315' DB 'Syracuse, Utica, ' DB 'New York',0 DB '316' DB 'Dodge City, Wichita, ' DB 'Kansas',0 DB '317' DB 'Indianapolis, Kokomo, ' DB 'Indiana',0 DB '318' DB 'Lake Charles, Shreveport, ' DB 'Louisiana',0 DB '319' DB 'Dubuque, ' DB 'Iowa',0 DB '401' DB 'Providence, All of ' DB 'Rhode Island',0 DB '402' DB 'Lincoln, Omaha, ' DB 'Nebraska',0 DB '403' DB 'Calgary, Edmonton, Whitehorse, Yellowknife ' DB CR,LF,TAB,' All of Alberta, Yukon and NWT, ' DB 'Canada',0 DB '404' DB 'Atlanta, Rome, ' DB 'Georgia' DB CR,LF,' Pursuit - GAATL',0 DB '405' DB 'Oklahoma City, ' DB 'Oklahoma',0 DB '406' DB 'Billings, All of Montana',0 DB '407' DB 'Southeast Florida, operational, April l6th, 1988',0 DB '408' DB 'San Jose, Sunnyvale, Cupertino, Santa Clara, ' DB 'California' DB CR,LF,' Pursuit - CASJO',0 DB '409' DB 'Galveston, Texas',0 DB '412' DB 'Pittsburgh, Indiana, Rochester, ' DB 'Pennsylvania',0 DB '413' DB 'Springfield, ' DB 'Massachusetts',0 DB '414' DB 'Milwaukee, Racine, Green Bay, Wisconsin' DB CR,LF,' Pursuit - WIMIL',0 DB '415' DB 'San Francisco, Oakland, Bay Area, ' DB 'California' DB CR,LF,' Pursuit - CASFA',0 DB '415' DB 'Palo Alto, Mountain View, Los Altos, ' DB 'California' DB CR,LF,' Pursuit - CAPAL',0 DB '416' DB 'Toronto, Hamilton, St Catherines, Niagara Falls, ',CR,LF DB TAB,' All of the Niagara penninsula, Ontario, ' DB 'Canada',0 DB '417' DB 'Joplin, Springfield, ' DB 'Missouri',0 DB '418' DB 'Quebec City and Southeastern Quebec, ' DB 'Canada',0 DB '419' DB 'Findlay, Sandusky, Toledo, ' DB 'Ohio',0 DB '501' DB 'Little Rock, Texarkana, All of ' DB 'Arkansas',0 DB '502' DB 'Louisville, Paducah, Shelbyville, ' DB 'Kentucky',0 DB '503' DB 'Portland, Salem, All of ' DB 'Oregon' DB CR,LF,' Pursuit - ORPOR',0 DB '504' DB 'New Orleons, Baton Rouge, ' DB 'Louisiana',0 DB '505' DB 'Albuquerque, Santa Fe, All of ' DB 'New Mexico',0 DB '506' DB 'Frederickton, Moncton, All of New Brunswick, ' DB 'Canada',0 DB '507' DB 'Albert Lea, Rochester, ' DB 'Minnesota',0 DB '508' DB 'Eastern Massachusetts. operational July 16th, 1988',0 DB '509' DB 'Spokane, Pullman, Walla Walla, Washington',0 DB '512' DB 'Austin, Corpus Christi, San Antonio, ' DB 'Texas',0 DB '513' DB 'Cincinnati, Dayton, Springfield, ' DB 'Ohio',0 DB '514' DB 'Montreal, ' DB 'Canada',0 DB '515' DB 'Des Moines, Mason City, ' DB 'Iowa',0 DB '516' DB 'Hempstead, ' DB 'New York',0 DB '517' DB 'Lansing, Saginaw, ' DB 'Michigan',0 DB '518' DB 'Albany, Greenwich, Schenectady, ' DB 'New York',0 DB '519' DB 'London, Windsor, Kitchener, Sarnia, ',CR,LF DB TAB,' All of Southwestern Ontario, ' DB 'Canada',0 DB '601' DB 'All of Mississippi',0 DB '602' DB 'Phoenix, Tucson, Flagstaff, All of ' DB 'Arizona' DB CR,LF,' Pursuit - ASPHO',0 DB '603' DB 'All of ' DB 'New Hampshire',0 DB '604' DB 'Vancouver, All of British Columbia, ' DB 'Canada',0 DB '605' DB 'Rapid City, All of ' DB 'South Dakota',0 DB '606' DB 'Ashland, Winchester, ' DB 'Kentucky',0 DB '607' DB 'Elmira, Ithaca, Stamford, ' DB 'New York',0 DB '608' DB 'Madison, Beloit, Wisconsin',0 DB '609' DB 'Atlantic City, Trenton, Camden, ' DB 'New Jersey',0 DB '612' DB 'Minneapolis, Saint Paul, ' DB 'Minnesota' DB CR,LF,' Pursuit - MNMIN',0 DB '613' DB 'Ottawa, Kingston, Belleville, All of eastern Ontario, ' DB 'Canada',0 DB '614' DB 'Athens, Columbus, Marion, Marietta, Newark, ' DB 'Ohio',0 DB '615' DB 'Chattanooga, Nashville, ' DB 'Tennessee',0 DB '616' DB 'Battle Creek, Grand Rapids, Cadillac, Kalamazoo, ' DB 'Michigan',0 DB '617' DB 'Boston, Framingham, New Bedford, ' DB 'Massachusetts' DB CR,LF,' Pursuit - MABOS',0 DB '618' DB 'Alton, Mount Vernon, Centralia, ' DB 'Illinois',0 DB '619' DB 'San Diego and Imperial Valley, ' DB 'California',0 DB '701' DB 'Fargo, All of ' DB 'North Dakota',0 DB '702' DB 'Las Vegas, Reno, Carson City, All of ' DB 'Nevada',0 DB '703' DB 'Alexandria, Fredericksburg, Winchester, Roanoke, ' DB 'Virginia' DB CR,LF,' Pursuit - DCWAS',0 DB '704' DB 'Charlotte, Salisbury, ' DB 'North Carolina',0 DB '705' DB 'Sudbury, North Bay, Timmins, Kirkland Lake, ',CR,LF DB TAB,' New Liskeard, All of northeastern Ontario, ' DB 'Canada',0 DB '706' DB 'Northwest Mexico' DB 'Mexico',0 DB '707' DB 'Eureka, Napa, Santa Rosa, ' DB 'California',0 DB '709' DB 'St. John''s, Gander, All of Newfoundland and Labrador, ' DB 'Canada',0 DB '712' DB 'Council Bluffs, ' DB 'Iowa',0 DB '713' DB 'Houston, Texas' DB CR,LF,' Pursuit - TXHOU',0 DB '714' DB 'Orange and San Bernardino Counties, ' DB 'California',0 DB '715' DB 'Eau Claire, Wausau, Wisconsin',0 DB '716' DB 'Buffalo, Niagara Falls, Rochester, ' DB 'New York',0 DB '717' DB 'Harrisburg, Scranton, Wilkes-Barre, ' DB 'Pennsylvania',0 DB '718' DB 'New York City (Queens, Brooklyn, Staten Island), ' DB 'New York' DB CR,LF,' Pursuit - NYNYO (add 1+areacode to number)',0 DB '719' DB 'Southern Colorado - Pueblo',0 DB '800' DB 'Toll Free number',0 DB '801' DB 'Salt Lake City, All of Utah' DB CR,LF,' Pursuit - UTSLC',0 DB '802' DB 'All of Vermont',0 DB '803' DB 'Charleston, All of ' DB 'South Carolina',0 DB '804' DB 'Norfolk, Richmond, Charlottesville, Virginia',0 DB '805' DB 'Bakersfield, Ventura, Simi Valley, ' DB 'California',0 DB '806' DB 'Amarillo, ' DB 'Texas',0 DB '807' DB 'Thunder Bay, Kenora, All of northwestern Ontario, ' DB 'Canada',0 DB '808' DB 'Honolulu, All of ' DB 'Hawaii',0 DB '809' DB 'Bahamas, Bermuda, Puerto Rico, Virgin Islands',0 DB '812' DB 'Bloomington, Evansville, ' DB 'Indiana',0 DB '813' DB 'Tampa, St. Petersburg, Winter Haven, ' DB 'Florida' DB CR,LF,' Pursuit - FLTAM',0 DB '814' DB 'Altoona, Erie, ' DB 'Pennsylvania',0 DB '815' DB 'La Salle, Joliet, Rockford, ' DB 'Illinois' DB CR,LF,' Pursuit - ILCHI (add 1+areacode to number)',0 DB '816' DB 'Kansas City, Saint Joseph, ' DB 'Missouri',0 DB '817' DB 'Fort Worth, Temple, Waco, Texas' DB CR,LF,' Pursuit - TXDAL ' DB '(limited area; no extra prefix needed)',0 DB '818' DB 'San Fernando Valley, Pasadena, Burbank, Glendale, ' DB 'California' DB CR,LF,' Pursuit - CAGLE',0 DB '819' DB 'Malartic and Western Quebec, ' DB 'Canada',0 DB '871' DB 'Atlantic Ocean, satelite phone-access to yachts ' DB 'Atlantic Ocean',0 DB '872' DB 'Pacific Ocean, satelite phone-access to yachts ' DB 'Pacific Ocean',0 DB '900' DB 'Toll Reduced number',0 DB '901' DB 'Memphis, ' DB 'Tennessee',0 DB '902' DB 'Charlottetown, Halifax, Sidney ',CR,LF DB TAB,' All of Prince Edward Island and Nova Scotia, ' DB 'Canada',0 DB '904' DB 'Jacksonville, ' DB 'Florida',0 DB '905' DB 'Mexico DF',0 DB '906' DB 'Sault Ste. Marie, ' DB 'Michigan',0 DB '907' DB 'Anchorage, Fairbanks, Juneau, All of ' DB 'Alaska',0 DB '912' DB 'Waycross, Savanah, ' DB 'Georgia',0 DB '913' DB 'Ottawa, Topeka, ' DB 'Kansas',0 DB '914' DB 'Monroe, Mount Vernon, Poughkeepsie, ' DB 'New York',0 DB '915' DB 'El Paso, Texas',0 DB '916' DB 'Sacramento, Marysville, Grass Valley, ' DB 'California',0 DB '918' DB 'Tulsa, Muskogee, ' DB 'Oklahoma',0 DB '919' DB 'Greenville, Raleigh, Williamston,' DB 'Reserach Triangle Park, North Carolina' DB CR,LF,' Pursuit - NCRTP',0 DB 0 ; End of all entries END