home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
GENASM
/
AREACD21.LBR
/
AREACD21.AQM
/
AREACD21.ASM
Wrap
Assembly Source File
|
2000-06-30
|
17KB
|
484 lines
; AREACODE.ASM Ver 2.1 as of December 10, 1986
; When updating, change SIGNON: message at start of data area
;
; Ver. 2.1 Colorado is getting a new area code. Beginning
; in the first quarter of 1988, then new "719" code
; will cover Colorado Springs, Pueblo, Leadville and
; Alamosa.
;
; The "303" areacode will include Denver, Boulder and
; Fort Collins.
;
; This information provided by Mountain Bell,
; Colorados's primary local telphone company.
; - Bob Paddock
;
;
; Ver. 2.0 added current areacodes and provided an interactive
; mode so if user didn't specify on command line, entries could
; be made without re-executing program.
; - Michael Conley
; - Theodore C. Hanf
;
; Ver. 1.3 added LA suburbs area code 818, added periods to
; messages (why not?), deleted double entry for area code 809,
; removed ungrammatical comma from ASCII string at MSG2: and
; added a space before the `$' in MSG2: so the first space in
; messages could be removed, providing an extra space for text
; without changing the SCAN3: routine's 58-character bias.
; - Bruce Morgen
;
; Ver. 1.2 added 718 area code for New York City, and fixed bug
; in area code 604-804 Harry Kaemmerer
;
; Ver. 1.1 update of area codes for new U.S. areas, Mexico, &
; Eastern Canada. Harvey G. Lord, Storrs, CT 06268
;
; Ver. 1.0 - January 2, 1981 by Kelly Smith
;
;-------------------------------------------------------------------
; AREACODE is used to display the region and state, specified
; by the user...very handy, when someone leaves a area code
; number on a CBBS, but no city or state reference. Simple
; enough to use, just type AREACODE nnn<cr> (where 'nnn' is a
; three digit area code), and in return, you get a
; geographical region by city(s), and state. Sorry if your
; particular city is not represented, and feel free to add it
; as required...
;
; Typing just AREACODE from command level puts the user in
; interactive mode, and areacodes may be entered repeatedly.
; This is not the most 'elegant' search routine that I could
; have used in implementing this program, but it is
; fast...it's best described as a "forward scanning/side
; checking mess"...if you don't find it matching on first
; character, drop to the next possible match...
;-------------------------------------------------------------------
BASE EQU 0 ; CP/M system base address
BDOS EQU BASE+5 ; BDOS entry address
TBUFF EQU BASE+80H ; temporary (command) buffer
;
PRNSTG EQU 9 ; print string (ending in '$') function
LINPUT EQU 10 ; CPM edited input function
;
LF EQU 0AH ; ASCII line feed
CR EQU 0DH ; ASCII carriage return
;
ORG BASE+100H
;
LXI H,0 ; make local stack, so no warm boot
DAD SP
SHLD OLDSTK
LXI SP,STACK ; old stack saved, make new stack
;
BEGIN:
LDA TBUFF + 2 ; need help?
CPI '?'
JNZ START
XRA A
STA TBUFF ; clear the pointer
LXI D,HLPMSG
CALL SPRINT
START:
LXI H,TBUFF ; point to area code length
MVI D,0 ; clear D Reg.
MOV A,M ; get it...
ADI 1 ; adjust buffer pointer +1
MOV E,A
DAD D ; point 1 past area code number
MVI M,'$' ; tag with 'end of string'
LXI D,TBUFF ; check for valid entry
LDAX D ; must be NON-ZERO to be correct
ORA A
JNZ INPOK
LXI D,SIGNON ; Signon message runs ONLY in interactive mode
CALL SPRINT
MVI A,0FFH
STA ACTIVE
NOINP: ; nothing on input / interactive mode
LXI D,MSG4
CALL SPRINT
LXI D,TBUFF
MVI A,3
STA TBUFF
MVI C,LINPUT
CALL BDOS
LDA TBUFF+1 ; no characters
MOV B,A
ORA A
JZ NOMORE ; then exit
MOV A,B
INR A
STA TBUFF ; put number of chars in buffer pointer
MVI A,32
STA TBUFF+1
JMP BEGIN
;
INPOK:
PUSH D
LXI D,MSG1 ; "Area code"
CALL SPRINT
POP D ; point at area code again
CALL SPRINT ; o.k., so far...print whatver was input
LXI D,MSG2 ; ", is "
CALL SPRINT
MVI B,0 ; clear character position counter
LXI D,TBUFF+2 ; point to area code
LXI H,TABLE ; point to area code table
SCAN: LDAX D ; get first character of area code for match
CMP M ; does it match any first character in table?
JNZ SCAN3 ; if no match, advance 58 characters in table
SCAN1: INX D ; bump for next area code character
INX H ; bump to second character in area code table
INR B ; bump character position counter
MOV A,B ; has character counter gone three positions?
CPI 3
JNZ SCAN2 ; match next character, if not at position 3
DCX D ; adjust character position for subsequent match
DCX H
LDAX D ; get last in entered area code
CMP M ; match to last character in area code table?
JZ MATCH ; if last character matches, display region, and state
INX D ; no match, bump both pointers
INX H
SCAN2: LDAX D ; get next character to match
CMP M ; any match yet?
JNZ BACKUP ; back-up, if no match on current position
MOV A,B ; are we at final character position?
CPI 3
JZ MATCH ; if so, we have final match
JMP SCAN ; not final position, try again...
BACKUP: DCX D ; back-up to start of entered area code
DCX H ; back-up to start of current area code in table
DCR B ; de-bump character position counter
JNZ BACKUP ; loop until we are at start of string
SCAN3: PUSH D ; save pointer to entered area code
LXI D,58 ; make 58 character bias
DAD D ; add bias to area code table pointer
POP D ; recover pointer to entered area code
MOV A,M ; have we hit "EOF" in area code table column?
CPI 'Z'-40H
JNZ SCAN ; if not, try next string for a match...
NOMACH: LXI D,MSG3 ; "NOT a valid area code"
CALL SPRINT
JMP EXIT
;
MATCH: INX H ; bump for region and state table location
XCHG ; swap to D&E Regs.
CALL SPRINT
JMP EXIT
;
EXIT:
LDA ACTIVE ; are we interactive
ORA A ; no/ exit
JNZ NOINP ; yes, go get next one
NOMORE: ; no input, user is thru
LXI D,CRLF ; keep it neat...
CALL SPRINT
;
LHLD OLDSTK ; get old CP/M stack
SPHL ; restore stack pointer, so no warm boot
RET ; return to CP/M...
;
SPRINT: ; print message string
MVI C,PRNSTG ; print string (until '$') function
JMP BDOS
;
;-------------------------------------------------------------------------
SIGNON: DB CR,LF
DB ' AREACODE version 2.1 updated 12/10/86',cr,lf
DB ' Interactive mode - <RETURN> to exit or ? for help.',CR,LF,'$'
MSG1: DB CR
DB ' Area code$'
MSG2: DB ' is $'
MSG3: DB 'NOT listed in the program.',CR,'$'
MSG4: DB CR,LF,LF
DB ' Area code to search for: $'
CRLF: DB CR,LF,'$'
;
HLPMSG: DB CR,LF
DB ' AREACODE searches a list of areacodes and reports',CR,LF
DB ' the region where the entry is found.',CR,LF,LF
DB ' The program does NOT provide the areacode for a chosen',CR,LF
DB ' City or State.',CR,LF,LF
DB ' You may invoke AREACODE in two ways:',CR,LF,LF
DB ' From the CP/M command line, type AREACODE ### and one',CR,LF
DB ' areacode will be searched, then the program will exit.',CR,LF
DB ' If you type AREACODE with no number, you''ll enter the',CR,LF
DB ' interactive mode and remain in the program until you',CR,LF
DB ' key <RETURN> by itself to exit.',CR,LF,LF,'$'
ACTIVE: DB 0 ; flag for interactive mode
OLDSTK: DS 2 ; storage for "old" CP/M stack pointer
DS 20 ; storage for "local" stack
STACK:
;-------------------------------------------------------------------------
; storage for area code, region, state etc.
;
TABLE: DB '205'
DB 'all regions, Alabama. $'
DB '907'
DB 'all regions, Alaska. $'
DB '602'
DB 'all regions, Arizona. $'
DB '213'
DB 'Los Angeles, California. $'
DB '818'
DB 'the suburban area near Los Angeles, California. $'
DB '805'
DB 'Bakersfield, Ventura, and Simi Valley, California. $'
DB '707'
DB 'Eureka, Napa, and Santa Rosa, California. $'
DB '209'
DB 'Fresno and Stockton, California. $'
DB '415'
DB 'Oakland and San Francisco, California. $'
DB '714'
DB 'Orange and Palm Springs, California. $'
DB '619'
DB 'San Diego and the Imperial Valley, California. $'
DB '916'
DB 'Sacramento and South Tahoe, California. $'
DB '408'
DB 'San Jose and Sunnyvale, California. $'
DB '709'
DB 'all regions, Newfoundland and Labrador, Canada. $'
DB '506'
DB 'all regions, New Brunswick, Canada. $'
DB '902'
DB 'Prince Edward Island and Nova Scotia, Canada. $'
DB '519'
DB 'London and Southwestern Ontario, Canada. $'
DB '514'
DB 'Montreal, Canada. $'
DB '705'
DB 'North Bay and Northeastern Ontario, Canada. $'
DB '807'
DB 'Thunder Bay and Northwestern Ontario, Canada. $'
DB '613'
DB 'Ottawa and Eastern Ontario, Canada. $'
DB '418'
DB 'Quebec City and Southeastern Quebec, Canada. $'
DB '819'
DB 'Malartic and Western Quebec, Canada. $'
DB '416'
DB 'Toronto, Ontario, Canada. $'
DB '204'
DB 'all regions, Manitoba, Canada. $'
DB '306'
DB 'all regions, Saskatchewan, Canada. $'
DB '403'
DB 'all regions, Alberta, Yukon and NWT, Canada. $'
DB '604'
DB 'all regions, British Columbia, Canada. $'
DB '303'
DB 'Denver, Boulder and Fort Collins, Colorado. $'
DB '719'
DB 'Colorado Springs, Pueblo, Leadville, Alamosa, Colorado$'
DB '203'
DB 'all regions, Connecticut. $'
DB '302'
DB 'all regions, Delaware. $'
DB '202'
DB 'Washington, District of Columbia. $'
DB '813'
DB 'Avon Park, Fort Myers, and Winter Haven, Florida. $'
DB '305'
DB 'Fort Lauderdale, Key West, Miami and Florida. $'
DB '904'
DB 'Jacksonville, Florida. $'
DB '404'
DB 'Atlanta and Rome, Georgia. $'
DB '912'
DB 'Waycross and Savannah, Georgia. $'
DB '808'
DB 'all regions, Hawaii. $'
DB '208'
DB 'all regions, Idaho. $'
DB '618'
DB 'Alton, Mount Vernon, and Centralia, Illinois. $'
DB '312'
DB 'Aurora, Chicago, Elgin, and Highland Park, Illinois. $'
DB '217'
DB 'Casey and Springfield, Illinois. $'
DB '815'
DB 'La Salle, Joliet, and Rockford, Illinois. $'
DB '309'
DB 'Peoria, Illinois. $'
DB '812'
DB 'Evansville, Indiana. $'
DB '219'
DB 'Gary, Hammond, Michigan City, and South Bend, Indiana.$'
DB '317'
DB 'Indianapolis and Kokomo, Indiana. $'
DB '712'
DB 'Council Bluffs, Iowa. $'
DB '515'
DB 'Des Moines and Mason City, Iowa. $'
DB '319'
DB 'Dubuque, Iowa. $'
DB '316'
DB 'Dodge City and Wichita, Kansas. $'
DB '913'
DB 'Ottawa and Topeka, Kansas. $'
DB '606'
DB 'Ashland and Winchester, Kentucky. $'
DB '502'
DB 'Louisville, Paducah, and Shelbyville, Kentucky. $'
DB '504'
DB 'Baton Rouge and New Orleans, Louisiana. $'
DB '318'
DB 'Lake Charles and Shreveport, Louisiana. $'
DB '207'
DB 'all regions, Maine. $'
DB '301'
DB 'all regions, Maryland. $'
DB '617'
DB 'Boston, Framingham, and New Bedford, Massachusetts. $'
DB '413'
DB 'Springfield, Massachusetts. $'
DB '011'
DB 'the International Access Code. $'
DB '525'
DB 'the Country and City code for Mexico City, Mexico. $'
DB '170'
DB 'Northwest Mexico. $'
DB '190'
DB 'Mexico City, Mexico. $'
DB '313'
DB 'Detroit, Adrian, and Ann Arbor, Michigan. $'
DB '616'
DB 'Battle Creek, Cadillac, and Grand Rapids, Michigan. $'
DB '517'
DB 'Lansing and Saginaw, Michigan. $'
DB '906'
DB 'Sault Ste. Marie, Michigan. $'
DB '507'
DB 'Albert Lea and Rochester, Minnesota. $'
DB '218'
DB 'Duluth, Minnesota. $'
DB '612'
DB 'Minneapolis and Saint Paul, Minnesota. $'
DB '601'
DB 'all regions, Mississippi. $'
DB '417'
DB 'Joplin and Springfield, Missouri. $'
DB '816'
DB 'Kansas City and Saint Joseph, Missouri. $'
DB '314'
DB 'Saint Louis, Missouri. $'
DB '406'
DB 'all regions, Montana. $'
DB '402'
DB 'Lincoln and Omaha, Nebraska. $'
DB '308'
DB 'North Platte and Scottsbluff, Nebraska. $'
DB '702'
DB 'all regions, Nevada. $'
DB '603'
DB 'all regions, New Hampshire. $'
DB '609'
DB 'Atlantic City, Camden, and Trenton, New Jersey. $'
DB '201'
DB 'Hackensack, Morristown, and Newark, New Jersey. $'
DB '505'
DB 'all regions, New Mexico. $'
DB '518'
DB 'Albany, Greenwich, and Schenectady, New York. $'
DB '716'
DB 'Buffalo, Niagara Falls, and Rochester, New York. $'
DB '607'
DB 'Elmira, Ithaca, and Stamford, New York. $'
DB '516'
DB 'Hempstead, New York. $'
DB '914'
DB 'Monroe, Mount Vernon, and Poughkeepsie, New York. $'
DB '212'
DB 'New York City (Manhatten and Bronx) New York. $'
DB '718'
DB 'New York City (Queens, Brooklyn and Staten Island) NY.$'
DB '315'
DB 'Syracuse and Utica, New York. $'
DB '704'
DB 'Charlotte and Salisbury, North Carolina. $'
DB '919'
DB 'Greenville, Raleigh, and Williamston, North Carolina. $'
DB '701'
DB 'all regions, North Dakota. $'
DB '216'
DB 'Akron, Cleveland, Massillon, and Youngstown, Ohio. $'
DB '513'
DB 'Cincinnati and Dayton, Ohio. $'
DB '614'
DB 'Columbus, Marietta, and Newark, Ohio. $'
DB '419'
DB 'Toldeo, Ohio. $'
DB '918'
DB 'Muskogee and Tulsa, Oklahoma. $'
DB '405'
DB 'Oklahoma City, Oklahoma. $'
DB '503'
DB 'all regions, Oregon. $'
DB '215'
DB 'Allentown, Chester, and Philadelphia, Pennsylvania. $'
DB '814'
DB 'Altoona, Erie, and Punxsutawney, Pennsylvania. $'
DB '412'
DB 'Pittsburgh, Indiana, and Rochester, Pennsylvania. $'
DB '717'
DB 'Harrisburg, Scranton, and Wilkes-Barre, Pennsylvania. $'
DB '809'
DB 'Bahamas, Bermuda, Puerto Rico, and the Virgin Islands.$'
DB '401'
DB 'all regions, Rhode Island. $'
DB '803'
DB 'all regions, South Carolina. $'
DB '605'
DB 'all regions, South Dakota. $'
DB '615'
DB 'Chattanooga and Nashville, Tennessee. $'
DB '901'
DB 'Memphis, Tennesee. $'
DB '806'
DB 'Amarillo, Texas. $'
DB '512'
DB 'Austin, Corpus Christi, and San Antonio, Texas. $'
DB '214'
DB 'Dallas, Texas. $'
DB '713'
DB 'Houston, Texas. $'
DB '409'
DB 'Galveston, Texas. $'
DB '817'
DB 'Fort Worth, Temple, and Waco, Texas. $'
DB '915'
DB 'El Paso, Texas. $'
DB '801'
DB 'all regions, Utah. $'
DB '802'
DB 'all regions, Vermont. $'
DB '804'
DB 'Charlottesville, Norfolk, and Richmond, Virginia. $'
DB '703'
DB 'Fredericksburg, Roanoke, and Winchester, Virginia. $'
DB '509'
DB 'Pullman, Spokane, and Walla Walla, Washington. $'
DB '206'
DB 'Seattle, Tacoma, and Vancouver, Washington. $'
DB '304'
DB 'all regions, West Virginia. $'
DB '608'
DB 'Beloit and Madison, Wisconsin. $'
DB '715'
DB 'Eau Claire and Wausau, Wisconsin. $'
DB '414'
DB 'Green Bay, Milwaukee, and Racine, Wisconsin. $'
DB '307'
DB 'all regions, Wyoming. $'
DB 'Z'-40H ; "EOF"
DB 'Z'-40H ; "EOF"
DB 'Z'-40H ; "EOF"
;
END