Intel 9800758-02 manual Figure E-2 /8085 Assembly Language Program

Page 91

BASIC-SO

Calling Non-BASIC-SO Subroutines

 

 

 

ASN8B.OY3

:Fl:USRASH.ASH

 

 

 

ISIS-II 8181/8185 "ACRO

ASSEHBLER. Y2.1

USRAS"

PACE

Lce 09J

SEQ

SOURCE STATE"ENT

 

 

1ASSE"BLER ROUTINE TO TEST BASIC USR

3RESULT=ARGA+ARCB+ARCC

4IGNORE OVERFLOW

 

 

 

S

 

NAHE

 

 

 

 

 

 

 

 

 

6

 

 

 

 

 

 

 

 

 

 

7

 

PUBLIC

 

 

 

 

 

 

 

 

 

8

 

CSEC

 

 

 

 

 

 

BBIS

El

 

9

USRAS .. :

POP

H

;RETURN

AOOR

 

BBBI

229BBB

D

IB

 

SHLO

RETADR

;5ET

ASIDE

 

BSB4

21BBBB

 

11

 

LX I

H.8

; SET TCTAL TO 8

BSB?

COICBB

C

12

 

CALL

AODDE

iAOD

ARCC

TO. TOTAL

BIBA

5B

 

13

 

"CY

D.B

i"OVE AOOR o.F ARCB TO DE

IBBB

59

 

14

 

"Cy

E.C

iAOD

ARCB

TO.

To.TAL

BBBC

COICBI

C

15

 

CALL

ADDDE

BBBF

01

 

16

 

PCP

o

; ADDRESS

OF

ARG.A

BBl8

CDICBB

C

17

 

CALL

AODOE

iADD

AReA

TO.

To.TAL

B813

EB

 

18

 

XCHG

 

;TOTAL

IN

DE

 

BB14

El

 

19

 

PCP

H

JADDR

o.F

RESULT

BUS

73

 

2B

 

"CY

PI. E

;LOW

BYTE

OF

RESULT

B81'

23

 

21

 

INX

H

 

 

 

 

 

BB17

72

o

22

 

"CY

H,D

;HI BYTE

OF

RESULT

BU8

2AIBBB

23

 

LHLD

RE"TADR

; RETURN

ADDRESS

BBlB

E9

 

24

 

PCHL

; RETURN

 

 

 

 

 

 

 

 

25

ADD 2 BVTES ADDRESSED BY DE TO HL

 

 

 

 

26

 

 

 

 

27

 

CHANCES A.D,E.H,L

 

 

 

 

 

BIIC

E5

 

28

ROODE:

PUSH

H

;SAVE

TOTAL

 

BII0

EB

 

29

 

XCHG

 

;AODR

IN

L

 

BIlE

5E

 

38

 

"o.Y

E.H

;LOW BYTE TO BE ADDED

BI IF

23

 

31

 

IN X

H

;HI BVTE TO. BE ADDED

B82B

5'

 

32

 

HOV

0,"

8121

El

 

33

 

PCP

H

;OLO

TOTAL

 

B822

19

 

34

 

DAD

o

; ADD

TO

TOTAL

B823

C9

 

3S

 

RET

 

 

 

 

 

 

 

 

 

36

DATA

AREA

 

 

 

 

 

 

 

 

 

37

 

OSEG

 

;SAVED

RETURN ADDRESS

BBBB

88BB

 

38

RETAOR:

OW

B

BBBB

 

C

39

 

END

USRASH

 

 

 

 

 

PUBLIC

SYMBOLS

 

 

 

 

 

 

 

 

 

 

USRASH

C BBBB

 

 

 

 

 

 

 

 

 

 

EXTERNAL SY"BCLS

USER S'/HBOLS

AODDE C BBIC RETAOR 0 BIBB USRAS" C BBBS

ASSE"BLY CO .. PLETE. NO ERRORS

Figure E-2. 8080/8085 Assembly Language Program

E-5

Image 91
Contents BASIC-SO Reference Manual A108/0979/7500 FL Preface Page Contents Illustrations Invoking BASIC-80 Chapter Introduction to BASIC-80Filename ExamplesIntroduction to BASIC-80 Basic filename MEMTOPaddressDeleting a File Listing the Directory of a DiskRenaming a File Changing File AttributesSave LP ,A You can now run, list, or edit the programStatements CommandsBASIC-80 Statements BASIC-80 Commands ContdBASIC-80 Functions BASIC-80 Statements ContdBASIC-80 Functions Contd Functions Representing DataHexadecimal Integer Constants ConstantsInteger Constants Decimal Integer ConstantsSingle-Precision Floating-Point Constants Octal Integer ConstantsDouble-Precision Floating-Point Constants $ = Enter next data string String ConstantsString Variables This is a string constantYI,1 L4! = Csng l4String Arrays BASIC-SO Operators in Order of Precedence Contd Arithmetic OperatorsString Expressions Logical OperatorsString Operator Numeric ExpressionsEntering and Editing Programs 30 A--=8xx*522537 Control-R a = 8*37 30 A=8*5230 A=8 30 A=8*52 30 A=8*37If AB then SubcommandCommand 3D press 3, then D results Integer DIf AB then 120 Else Null SET At this point, the other editing subcommands may be used Syntax of the X subcommand isPrint Undefined SET. Enter a L Print Undefined SET The E subcommand is enteredInteger C character character Move the cursor to PRINT. Enter 2C RE LSyntax Error Messages BASIC-80 Error MessagesOverflow, Underflow, and Divide-by-Zero Error Trapping Trace Facility If line 40 is replaced with Error SimulationError Handling Restarting Program ExecutionOpen 1,#1,F1DATES Opening a Sequential FileIf executed four times, it would read all eight values Refer to for further details of Print UsingWriting to a Sequential File Reading from a Sequential FileValue of R$ would be Closing a Sequential FileDefining a Random 1/0 Field-FIELD BuffersField #3, 20 AS N$ Field #3, 20 AS N$, 9 AS SS$ Disk File Input/OutputTo read the next record Opening and Closing a Random Disk FileReading from a Random 1/0 File Any of the parameters can be variablesDouble-precision value Writing to a Random 1/0 FileInteger Single-precision valueMKI$ Clear expression,address Attrib Fdrive numberfilename, W1Attrib Fdrive numberfilename, WO Auto first lineJ, incrementClose Commands and StatementsRules for function name are the same as for variable name DEF FNXDefsng Defdbl Defstr Defint Delete DIMEND ErrorDIR EditFOR-NEXT-STEP Error expressionExit FieldGET I file number ,record number GETGosub For variable=expression to expression Step expressionInput IF-THEN-ELSEGoto List KillLET Line InputLoad LSET, RsetNEW Merge9 16 NextOn ... Goto On ... GosubOpen OUT Option BasePoke Print Print UsingString Fields If X$=SEVEN and Y$=EIGHT, the results of line 40 would be Numeric fieldsPUT PrunRead RandomizeREM Return Resume60 END SaveRUN line numberlstring expression ,F Line number RUN filename? 5,8,2 TRON, TroffWidth WaitATN ABSCint CHR$Functions AO/o = CsngCVI CVS 10 A# = 1.00/3.00EOF DskfOk· FIXINP HexsInputs Instr INTLEFT$ LOG LENLOC LOFMKI$ MKS$ MKD$ MID$OCT$ RIGHT$ string,integer RightsPeek expression POS integer10 a =1 SGNSIN SpacesSQRexpression SPCSPC integer If A$ = 2 then Print Correct Else GotoTAB expression STR$ expressionTAN expression 60 AO/o = Here is an example of how the USRn statement is usedTable A-I. BASIC-80 Error Codes Appendix a BASIC-SO Error CodesTable A-I. BASIC-SO Error Codes Contd Appendix B BASIC-SO Reserved Words Page To resume program execution after it is stopped by To halt program execution and return to commandLevel To tab across the linePage Appendix D Ascii Codes Table D-l. Ascii Code ListBEL Table D-2. Ascii Code DefinitionAppendixe Calling Subroutines Figure B-1. Internal Representation of Numbers and Strings RESULT=USR%1VARPTRA, VARPTRB, VARPTRC» PRINTA+B+C= Result Some Real ExamplesFigure E-2 /8085 Assembly Language Program Figure E-3. PL/M-80 Program Appendix F RMX/SO BASIC-SO ISIS-II BASIC-SO Initializing the Predefined RMX/SO BASIC-SO ConfigurationOOOOH-OFFFH Table F-l. Sample Configuration Jumper WiringBASIC-80 Executable Files Generating Boot-Loaded and PROM-Based VersionsBASIC-80 Source Files BASIC-80 Object FilesGenerating a Boot-Loaded RMX/80 BASIC-80 This option enables your user-written I/O drivers if you That are not boot loadedThis option is used to allocate memory. It is 1 if the boot Setting baud rates, refer to the RMX/SO Users GuideISBC 80/20-4 Generating a PROM-Based RMX/80 BASIC-80 Prom F1 RMX820.L1BSTART, & FOBASCM.OBJ,& FORMXBAS.LlB F1 DFSDIR. L1BDIRECTORY ,RENAM E,& F1 MTI810.L1B ISBC SO/10 System Clock Configuring DFS on an iSBC 80/10Adding BASIC-SO to an Existing RMX/SO Configuration Configuration RequirementsPublic Variables Open 0,#1, L1LlST Adding User-Written I/O Drivers to RMX/SO BASIC-SOFigure F-S. Sample User-Written 1/0 Driver Routine Burning a BASIC-80 Program Into Prom Altering BASIC-80 WorkspaceBaprom F1HEATER.BAS Page Index Ase BASIC-80 RIGHT$,7-1O Request for Readerscomments 111111