background image

Summary of Contents for 9835A

Page 1: ...HEWLETT PACKARD ...

Page 2: ...ranty includes labor parts and surface travel costs if any Equipment returned to Hewlett Packard for repair must be shipped freight prepaid Repairs necessitated by misuse of the equipment or by hardware software or interfacing not provided by Hewlett Packard are not covered by this warranty NO OTHER WARRANTY IS EXPRESSED OR IMPLIED INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABI...

Page 3: ...opment ROM HP 9835A Desktop Computer Hewlett Packard Desktop Computer Division 3404 East Harmony Road Fort Collins Colorado 80525 For World wide Sales and Service Offices see back of manual Copyright by Hewlett Packard Company 1979 ...

Page 4: ...naire in the back of this manual Your answers to the questions can assist in producing better more useful manuals Your feedback is our only way of knowing the validity of our manuals Please complete the questionnaire and mail it postage is already paid in the United States Thank you ...

Page 5: ...s solid borders indicate those manuals that are shipped with every System 35 r I Mass Storage I Techniques Manual L JI J I Mass Storage I LeriPhera a a Beginner s Guide Reference Guide r I I O Programming Owner s Manual 7 JV V Operating and I Programming Manual r I Assembly I tanguage Ma l J Preview System Test Manual r Plotter I Programming I L_ Manual_J _l I I Interface Manuals I L JI_J r I Peri...

Page 6: ...eation program and variable storage and utilities are the topics covered Chapter 5 Arithmetic Arithmetic operations are reviewed and the arithmetic utilities are discussed Floating point and BCD arithmetic are explained Chapter 6 Communicating between Basic and Assembly Language The techniques used to pass information to and from the assembly language programs are discussed Calling assem bly routi...

Page 7: ...ch 17 Names 17 Survey of Modules and Routines 18 Setting Aside Memory 19 Retrieving and Storing Modules 22 Chapter 3 The Processor and the Operating System Machine Architecture 25 Registers 26 General Memory Organization 28 Protected Memory 28 Base and Current Page 29 Data Structures 30 Integers 0 30 Strings 30 Full Precision Numbers 31 Short Precision Numbers 31 Machine Instructions 32 Operands 3...

Page 8: ... Storage 56 Modules 56 Variables 56 Data Generators 57 Repeating Instructions 59 Assembling 60 Effect of BASIC Environments 60 Source Listing Control 61 Page Format 62 Page Length 63 End of Page Control 63 Page Headings 64 Blank Line Generation 65 Non Listable Pseudo Instructions 65 Conditional Assembly 65 Relocation 68 Symbolic Operations 69 Pre Defined Symbols 69 Defining Your Own 71 Literals 72...

Page 9: ... Instruction 94 Thirteen Digit Dividends 95 Floating Point Division Example 96 Arithmetic Utilities 99 Utility ReI math 99 Utility Rel to int 102 Utility Rel to sho 103 Utility Int to rel 104 Utility Sho to rel 105 Chapter 6 Communication Between BASIC and Assembly Language The ICALL Statement 107 Corresponding Assembly Language Statements 108 Arguments 109 Blind Parameters 112 Getting Information...

Page 10: ...rammed I O 138 Interrupt I O 138 Priorities 140 Interrupt Service Routines and Linkage 140 Access 141 Utility Isr access 143 State Preservation and Restoration 0 145 Indirect Addressing in ISRs 146 Direct Memory Access DMA 147 DMA Registers 148 DMA Transfers 149 BASIC Branching on Interrupts 150 ON INT Statement 150 Signalling 151 Additional Pre Defined Symbols 0 153 Prioritizing ON INT Branches 1...

Page 11: ...Setting Break Points 174 Simple Pausing 174 Transfers 175 Environments 176 Data Locations 177 IBREAK Everywhere 178 Number of Break Points 179 Clearing Break Points 179 Interrogating Processor Bits 180 Protected Memory 180 Dumps 181 Value Checking 183 Functions 184 DECIMAL 184 OCTAL 184 IADR 185 IMEM 186 Patching 187 Chapter 9 Errors and Error Processing Types of Errors 189 Syntax Time and Assembl...

Page 12: ...ting Utilities 235 Appendix H 110 Sample Programs Handshake String Output 237 Handshake String Input 239 Interrupt String Output 241 Interrupt String Input 244 DMA String Output 247 DMA String Input 250 HP IB Outputl Input Drivers 253 Real Time Clock Example 257 Appendix I Demonstration Cartridge Using the tape 261 Typing Aids 261 Appendix J Error Messages 265 Mass Storage ROM Errors 269 Plotter R...

Page 13: ...General Information Chapter 1 Table of Contents Structure of the Manual 2 Purpose of the ROMs 2 ROM Installation 3 Buzzwords 4 Fundamental Syntax 6 ...

Page 14: ...t ROM Two physical ROMs This ROM is always provided with an Execution ROM together comprising HP product number 98339A and the three ROMs as a unit constitute the assembly language system of the 9835A B The Assembly Execution ROM HP product number 98338A One physical ROM Since this ROM is an integral part of the assembly language system the use of the capabilities in this ROM is incorporated into ...

Page 15: ...was chosen over the strict syntactical or semantical treatment of the individual statements and instructions As a consequence you may find this difficult to use as a quick reference for syntax and meaning of the individual commands To meet your needs for quick reference material an Assembly Language System QUick Reference Manual HP part number 09835 90081 is provided In addition you will find much...

Page 16: ...ter Insert the ROMs one at a time following this procedure you should orient the ROM so that its label reads the same way as the others in the drawer with the bottom of the lettering toward the front of the drawer Then insert it vertically in one of the unused slots Make sure that it slides in all the way to the bottom of the connector There are small raised ribs on both sides of each ROM which wi...

Page 17: ...4 expression may be a numeric expression or a string expression If numeric a decimal calculation is performed and the result is interpreted as an octal value if the result is not an octal representation or an integer an error results If a string expression is used the string must be interpretable as either an octal integer constant or a known assembly symbol see symbol above numeric expression ser...

Page 18: ... IS statement executed This is desig nated by having the msus be all ones Le equal to 1 object module a section of assembled code stored in the pa ticular region of memory set aside for it Though the source module for the object code may no longer be resident in memory when created the module was delimited by certain pseudo instructions NAM and END and is referenced by the name given to it by the ...

Page 19: ...ckets are optional items Ellipses mean that the previous item may be repeated indefinitely In addition the following convention is employed throughout the Assembly Language series of manuals Items contained in braces are syntax items considered as a unit The names inside are usually descriptive of the function intended for that item Whenever an item enclosed in braces appears in the text the notat...

Page 20: ...ntents Developing Routines for Later Use 7 Overview 9 Program Creation 9 Program Entry 14 Other Extensions 16 Modules Routines and Such 17 Names 17 Survey of Modules and Routines 18 Setting Aside Memory 19 Retrieving and Storing Modules 22 ...

Page 21: ...Most assembly language programs are written with the intent that they will be used many times not just at the time they are written It is for just such program development that the full capabilities of the assembly language system come into play The development comes in several stages Each stage has its unique requirements and the tools to meet those require ments The first stage is creation of th...

Page 22: ...ilities are not only provided but they are provided independent of the program development capabilities located in the Development ROM Each of the topics involved in these stages is discussed at length in this manual Figure 2 presents a graphical presentation of this overview Mass Storage Editing Capabilities SOllrce Capabilities of System 35 Statements of System 35 Source Program Creation Assembl...

Page 23: ...ay be any number of modules present at anyone time limited only by the amount of memory allocated for object code A routine is a callable section of a module It is analogous to the subprogram in BASIC It has a named entry point possibly a parameter list and if programmed correctly a return A module may contain any number of routines again limited only by the amount of memory allocated to hold the ...

Page 24: ...am s functions 1 NAM Multipl ication j Beginning of module Multiply LDA Integers LI1I I f fr l t I J j 1 C E t i i i E L IiA I i Mit E i l r O _ 1 LDE Input2 r 1 1 i AE Llii i I it l t BF 2 Cr E L DF i 1 J t E j e j t J r FET 1 r 2 r r i rit i l roo c r E t t ij r I r t pCiir t f 1 l i i 1 1 1 j C 3 t _ 1 i it i i I 1 t r 1i i it j if t i c i r ti i Cl dE r M i li i i tl E t t i t rnE r t j r C tr...

Page 25: ...r j fl let E r i i f t i cj i ri t 1 iE Cit C E i i r i t e t statemefits and are giv8 n es f ic t iM f i I t 1 Ci i i 1 t r i j rfiE I ll 1 t i I j r I Jt n l n b fe t h j p i I C i I i I 1 1 i i e f t 1 1e i i put p irOO r p i eT from BASIC and storing them where the routine can use them arithmetic accumulator and f j n II i fiU j t j i j e t j er H c hec k fOi O i f j 01 1 j t r t r rned L i ec...

Page 26: ...it will be in this example then the routine can be called and used as desired A typical call looks like 600 IeAll Multiply Ind x Dim8 sion Subscript t5 i IJ fir t t i At S C r f t i i ll The ICALL statement is fully discussed in Chapter 6 Thus the final result could easily be 10 40 OUF CE O iF CE 60 OUFCE 70 Oi iF CE C L i OUF CE 30 OUPCE 1 iU OU F CE 120 OUFCE 13 OUFCE i 40 CIL1F C E 15 i OUPCE N...

Page 27: ...Li C E 5 1 UJF CE 6 J UUF CE Integers BSS 2 if i it J t iFi t I xt f i t UB li j r Ii rr H iT ultiply LDA Integers L DB Input 1 L Iit I j it i At J C l t J i _ L Di i Inteqer L DE IrltE e l Tfi I r t E E i LliA I 1t E i E LI E Ci Jt t it i t c j jl j E f t i j 1 E i E Ct 1 t E ij Indicates entry point follows I j i C L t E it j r it r r L Y E t r 1 r E ssed in the order qiven by these 1 t E iYi t ...

Page 28: ...ing system that the line is an assembly language statement By looking at an example you can see what is meant 1 7 L ET H H3 20 LET f 20 F IHT fi B 50 ISGJRCE NO 60 ISOJRCE END x m ie Lines 10 20 30 and 70 are all recognizable as BASIC statements The keywords they use LET PRINT and END direct that certain actions take place Lines 40 50 and 60 are all assembly language statements this was indicated ...

Page 29: ...t is that there are two programs in one BASIC s and the assembler s So you can envision the example above as being this way BASIC LET fi 10 LET J 2 J F R I hT f1 J ASSEMBLER source You should note then that ISOURCE statements are not executable in the usual BASIC sense Their location in the program does not indicate the place where they will be executed Assembly instructions are not executed until...

Page 30: ...is is identical to the way the other BASIC statements perform The statements involved are IASSEMBLE IBREAK ICALL ICHANGE ICOM IDELETE IDUMP ILOAD INORMAL IPAUSE OFF IPAUSE ON ISTORE OFFI NT ONINT Also provided are four numeric functions DECIMAL IADR IMEM OCTAL The functions can be used wherever numeric functions in general may be used All of these statements except ICOM and ISOURCE and the functio...

Page 31: ... found in the Operating and Programming Manual and in the Mass Storage Techniques Manual The conventions are not any different than for files in general Names for modules are assigned with the creation of the source In the assembly language source code you have a NAM pseudo instruction This serves two purposes to designate the beginning of the module and to assign the module a name All of the asse...

Page 32: ...odule 5 ICOM region User I IDELETE module 1 ICOM size ICALL routine 1 ICALL routine 2 m rrm I CA L L r ou ti ne 3 ICALL routine 4 ICALL routine 5 ICALL routine 6 Figure 3 Overview of Routines and Modules Survey of Modules and Routines To sketch the functional relationships of modules and routines please refer to Figure 3 above Modules are stored in files and may be retrieved and placed in memory u...

Page 33: ...to pass send down to the routine itself What these arguments if any may be and what meaning they hold depends upon what you have in mind for that routine There are corresponding items in the assembly source code these are discussed in Chapter 6 Setting Aside Memory As indicated by Figure 3 you cannot load a module until there is an ICOM region into which to load it Neither can you assemble your so...

Page 34: ...e requirements of another option ROM do not interfere There may be any number of ICOM statements in a program The current size of the ICOM region is determined by the last one which appears in the program when the 8 key is pressed or the command RUN is executed For example suppose you have a program with the following statements in it ICCt 1 3 Ii Ii l A J i 3 J Upon pressing 8 the ICOM region woul...

Page 35: ...uence assures that an ICOM region of 2 000 words is in existence at the running of the program and one completely clear of any previously loaded modules When you are altering the size of the ICOM region the new size specified becomes the size of the region from the moment of running the program If the size being requested i s larger than that which already exists the additional space needed is req...

Page 36: ...n ing the module Combine the name with the mass storage unit specifier2 of the device to form a file specifier Then execute the statement I LJ n n J file specifier This retrieves ALL the modules in the file and stores them in the ICOM region If there are modules already loaded in the ICOM region these additional modules are added to them NOT written over them If an existing module in the ICOM area...

Page 37: ...the region is at the end If a module is being deleted or being moved as above and it contains an active interrupt service routine an error results number 193 If you desire at any time to delete all of the modules in your ICOM region you can do so by executing either of the following statements i L _ _ E J LJ t L t Sometimes you may desire to move modules in the opposite direction from memory to ma...

Page 38: ...Started In the case that you might want to store all of the routines currently in the ICOM region into a particular file you can use either of the following statements 1 r file specifier T c rC F E file specifier ...

Page 39: ...Structures Integers Strings Full Precision Numbers Short Precision Numbers Machine Instructions Operands Indirect Addressing Load Store Group Integer Math Group Branch Group Test Branch Group Test Alter Branch Group Shift Rotate Group Logical Group Stack Group BCD Math Group I O Group Miscellaneous 25 26 28 28 29 30 30 30 31 31 32 32 34 34 35 36 37 38 40 41 42 44 47 48 ...

Page 40: ...has its own set of instructions but all three work in conjunction It is not necessary in using the assembly system that you know on which chip a particular instruction resides In the presentation of the instruction set and for all practical purposes while working with the computer no distinction need be made between the proces sors and the entire instruction set may be considered as being resident...

Page 41: ...ions Chapter 4 these names have been reserved and cannot be redefined while using the assem bly system The internal registers are Name A Ar2 B C Cb D Db Dmac Dmama Dmapa P Pa R R4 R5 R6 R7 Se Address Octal 0 20 23 1 16 13 17 13 15 14 13 2 11 3 4 5 6 7 24 Description Arithmetic accumulator BCD arithmetic accumulator Arithmetic accumulator Stack pointer Block bit for byte pointer in C use most signi...

Page 42: ...5 Map of Lowest Memory All of these registers can be referenced either by their names or by their actual addresses The two methods are equivalent though reference by name is recommended as a programming practice In addition to the above internal registers there are some external registers which reside in the computer read write memory They are Name Ar1 Base page Oper_1 Oper_2 Result Address octal ...

Page 43: ... the list in the previous section with a number of interspersed system reserved areas Figure 6 is a graphical presentation of this organization The immediately addressable memory consists of 65 536 words which is all that can be ad dressed by a 16 bit word the basic unit of memory in the system Note that the memory is divided into two blocks an upper block and a lower one This distinction between ...

Page 44: ...of ICOM at least 1710 words I 100000 and system needs 177617 177620 177701 177702 177703 177704 177705 177767 177770 177773 177774 177777 r reserved Base_page Oper_1 Op_er 2 Result reserved Ar1 reserved Figure 6 Memory Map Base and Current Page lower block upper block A concept that occasionally arises during discussion of the instructions and the assembler is that of the page the base and current...

Page 45: ...f how BASIC stores a value in each of its data types There are four data types in BASIC full precision numeric values short precision numeric values integers and strings Each is stored in its own unique structure Integers The simplest of the types is the integer A integer consists of a single word Values between 32 768 and 32 767 can be stored in the word Negative values are stored in two s com pl...

Page 46: ...ithmetic routines so that there is an implied decimal point following 01 Thus every mantissa value looks like Short Precision Numbers Short precision numeric values are stored as 6 digit BCD floating point numbers Unlike full precision they occupy two words each instead of four The first word contains a 7 bit exponent the sign of the mantissa and the two most significant mantissa digits The second...

Page 47: ... de pendent upon some condition Operations performing re arrangments of the bits in the A or B register Operations performing logical functions on the A or B regis ters Operations managing stacks Operations involving BCD arithmetic Operations specifically involving I O operations Some unclassifiable operations Most instructions require operands These operands have general forms which they may assu...

Page 48: ... a location the same as above except the intended location must be relocatable and within 32 and 31 words of the current instructions A register may be specified either through its absolute address or by its pre defined symbol The permissible registers are those with addresses between 0 and 7 inclusive These are registers A B P R R4 R5 R6 and R7 A number of instructions are followed by a value whi...

Page 49: ... below you can move information to and from the arithmetic accumulators the A and B registers You can also transfer the contents of one contiguous set of words in memory to another contiguous set Instruction LDF i location I r I L U b ocatton J TF location L I TB location I value FF value Description Loads register A with the contents of the specified location Loads register B with the contents of...

Page 50: ...ry from bits 14 or 15 but not both the Overflow flag is set in the processor Performs a two s complement of the A register Le one s complement incremented by 1 If a carry occurs the Extend flag in the processor is set If an overflow occurs a carry from bits 14 or 15 but not both the Overflow flag in the proces sor is set Performs a two s complement of the B register Le one s complement incremented...

Page 51: ...nt value of the P register i e the location of the JSM instruction itself is stored into the ad dress pOinted to by the R register Execution then proceeds to the specified location Returns from a subroutine value is added to the contents of the address pOinted to by the R register The results are stored in the P register i e specifying the next location for execution and the R register is decremen...

Page 52: ... register with the contents of the specified location Execution skips over the next word if the contents are unequal Skips to address if register A is O Skips to address if register B is O Skips to address if register A is not O Skips to address if register B is not O Skips to address if register A is 0 then increments A regard less The Extend and Overflow flags in the processor are not affected b...

Page 53: ...her be set S or cleared C after the test has been made Instruction I Z location L I IY Z location I r iF address 3F i F address C E F address B address C Fii y1 address F iry 1 address C Eq y1 address L Bt 1 address L C L_F i address L Fi address C Description Increment the contents of the specified location and skip execution of the next word if the result is O Decrement the contents of the speci...

Page 54: ...if the least significant bit of the A register is not O Skips to address if the least significant bit of the B register is notO Skips to address if the Overflow flag in the processor is set Skips to address if the Overflow flag in the processor is cleared Skips to address if the Extend flag in the processor is set Skips to address if the Extend flag in the processor is cleared NOTE The Extend and ...

Page 55: ...ming O Shifts the B register left the indicated number of bits with all vacated bit positions becoming O Shifts the Aregister right the indicated number of bits with the sign bit filling all vacated bit positions Arithmetic right Shifts the B register right the indicated number of bits with the sign bit filling all vacated positions Arithmetic right Rotates the A register right the indicated numbe...

Page 56: ... loca tion For each bit comparison a 1 results if both bits are 1 s a oresults otherwise The 16 bit result is left in A Logical inclusive or operation The contents of the A regis ter are compared bit by bit with the contents of the specified location For each bit comparison a 0 results if both bits are O s a 1 otherwise The 16 bit result is left in A Performs a one s complement of the A register i...

Page 57: ...i after the operand For with drawing instructions D is the default For example the following are equivalent Incrementing is specified by including I after the operand This is also the default for push ing instructions if neither I or D is included For example the following are equivalent F l jC h I When using the byte instructions PBC PBD WBC WBD the address pointed to by the C or D register must ...

Page 58: ...he byte is placed in the lower byte of the word in the stack if it is a 0 it is pushed into the upper byte Withdraws a word from the stack pointed to by the C register and stores it into register Withdraws a word from the stack pointed to by the D register and stores it into register Withdraws a byte from the stack pointed to by the Cb and C registers andplaces it into the lower byte right half of...

Page 59: ...ting point full precision values Signs and exponents are left strictly alone There is a flag in the processor called Decimal Carry which is set when an overflow occurs during a BCD operation A full discussion of BCD arithmetic techniques can be found in Chapter 5 Instruction Description Mantissa right shift on Arl The number of digits to be shifted is specified in the lower 4 bits 0 3 of the B reg...

Page 60: ...r one digit This is a circular hift with the digit in bits 0 3 of the A register forming a thir teenth digit The non digit part o the A register is cleared Le bits 4 15 and the Decimal Carry flag in the processor is cleared Mantissa right shift n Ar1 for one digit The twelfth digit is shifted into the A register bits 0 3 The non digit part of the A register is cleared Le bits 4 15 and the Decimal ...

Page 61: ... times is specified in the lower 4 bits 0 3 of the B register The result accumulates in Ar2 If intermediate overflows occur the number of times they occur appears in the lower 4 bits of the A register after the operation is complete The upper 12 bits of the A register are cleared along with Decimal Carry Fast divide The mantissas of Ar1 and Ar2 are added together until the first decimal overflow o...

Page 62: ...r details Skips to address if the Flag line is clear false The Flag line is associated with a peripheral on the current select code see Chapter 7 for details Skips to address if the Status line is set true The Status line is associated with a peripheral on the current select code see Chapter 7 for details Skips to address if the Status line is clear false The Status flag is associated with a perip...

Page 63: ...lent to LDA A The contents of any register can be treated as the current instruction and executed value is a numeric expression in the range 0 through 31 indicating the register to be used The register is left unchanged unless the instruction code causes it to be altered The next instruction to be executed is the one in the word following the EXE unless the code in the executed register causes a b...

Page 64: ... of BASIC Environments 60 Source Listing Control 61 Page Format 62 Page Length 63 End of Page Control 63 Page Headings 64 Blank Line Generation 65 Non Listable Pseudo Instructions 65 Conditional Assembly 65 Relocation 68 Symbolic Operations 69 Pre Defined Symbols 69 Defining Your Own 71 Literals 72 Evaluation of Literals 72 Nesting Literals 73 Nonsensical Uses of Literals 74 Literal Pools 74 Expre...

Page 65: ... them The answers to those questions form the underlying capabilities through which you write your applications These are things which nearly every assembly language program uses As essen tial as they are however none are difficult to master Program Entry You were introduced early in Chapter 2 to the integrated nature of the assembly language with its host language BASIC You know from that chapter...

Page 66: ... you were to change the above so that it read and then executed a statement GOTO Example the result would be to simply execute the END statement in line 70 That is because to BASIC the lines appear the same as or The BASIC label on an ISOURCE line finds its most useful characteristic in being able to be referenced as any other BASIC label on any other type of line may be with an EDIT com mand Thus...

Page 67: ...omment A label is always optional in the source but either an action or a comment must be present in every source line Actions An action in assembly language source is A machine instruction with any operand it may require These were discussed at some length in Chapter 3 A pseudo instruction with any operand it may require These are discussed under the topics to which they relate The actions contai...

Page 68: ...n the same module code There are other restrictions as well on the choosing of labels For instance there are symbols already defined by the assembler and you are not allowed to choose one of them as a label This is discussed at length in Symbolic Operations in this chapter Both a BASIC label AND an assembly language source label can appear in the same line and they are distinct from one another BA...

Page 69: ...ine your comment may fill up the remainder of the 160 characters left after the rest of the statement has been provided line number ISOURCE keyword label action Syntaxing t he Source When you are creating your source program you are either entering it from the keyboard or retrieving it from mass storage LINK or GET In either case as the statement is entered the 8 key on the keyboard is pressed or ...

Page 70: ...no label are considered the machine instruction or pseudo instruction and are capitalized The instruction will remain in the same column as it was entered and if possible a space is added after it Everything after the instruction or pseudO instruction is considered the operand for the instruction up until the exclamation point before the comment if any Any label sym bol in the operand will have it...

Page 71: ... Its module name must be the same as in the NAM pseudo instruction A module name follows the same rules for naming as do labels see above It is by the use of these two instructions that modules are created The source lines which appear between them comprise a single module and the name assigned to the module is the one with which the module is referenced with the ILOAD and ISTORE statement for exa...

Page 72: ...torage Variables Within a module you may want to set aside one or more words of memory for your use For example you might need a location to store a variable or keep a counter or save a register This is done with the BSS pseudo instruction number M t 1 where number is the number of words to be set aside number can be any absolute expres sion provided the expression evaluates to a positive integer ...

Page 73: ...locations for it Data Generators A data generator is very much like a BSS operation The funcHon as with the BSS is to set aside words of memory at a particular location in the object code But in addition the words are to be initialized to some value The initialization occurs at the same time the words are set aside Le at assemble time This is done using the DAT pseudo instruction which has the for...

Page 74: ...module the same as with any machine instruction The number of data words generated for each expression is dependent upon the result of the expression Result Words Full precision 4 Short precision 2 Decimal integer 1 Octal integer 1 Addressl 1 Literal 1 String actual length 2 characters per word If more than one expression is present the necessary data words are generated in the order in which they...

Page 75: ...g machine instruction to be duplicated in the object code expression number of times For example suppose you are writing a real time application where timing was critical and to make things work correctly you need 10 NOPs at a certain location Ordinarily you would type Ci i i f ir D I Ui ii C E j iC P i iF C r I Cli i C E i j f I H CE t iUi But all of this could be replaced with and the same effec...

Page 76: ... statement Only those modules are assembled any others which may be present in the source at the time are ignored If the ALL version of the statement is used with or without the optional word ALL every module present in the source is assembled An option falls into one of two categories listing directives and conditions for conditional assembly These are discussed separately below The options and t...

Page 77: ... octal representation Listings are not automatic They are obtained in one of two ways By using the LIST option in the IASSEMBLE statement This directs that a listing is desired for all the modules in the statement The statement wO lld look like the following examples By using the LST pseudo instruction in the source code itself Modules can be just partially listed if desired This kind of control i...

Page 78: ...of a module This initialization occurs for each module assembled so if you have more than one module indicated in your IASSEMBLE statement the counter is set at the beginning of the assembly for each This capability sees its greatest usefulness during debugging stages and while working with independently written sections of source code For example a number of people could be writing different sect...

Page 79: ... indicated by numeric expression which must be a positive value This value becomes the standard length of the listing pages specifying the number of source lines to be printed on a page during listings of the assembly source It is not necessary that thi value be the page length of the printing device being used though this is frequently the value selected If the option is omitted from the ASSEMBLE...

Page 80: ...es from the last page break forces a new page break Page Headings The heading for each listing page is 1 IJ1 11 E name where name is the name of the module currently being assembled This heading can have additional information added to it through the HED pseudo instruction This instruction has the form LJ comment When this instruction is encountered and a listing is being generated pagination imme...

Page 81: ...able Pseudo Instructions The following pseudo instructions do not appear in a listing i i F C Conditional Assembly For reasons of complexity or length it is occasionally desirable to selectively assemble only parts of a module This is particularly true during the debugging stage of longer complex assembly programs Conditional assembly is the ability to designate certain portions of a module for as...

Page 82: ...e IASSEMBLE statement The conditional assembly sections are delimited by pseudo instructions A conditional section begins with one of the following IFE IFe IFE IF IFH and it concludes with IF In addition to the lettered conditions a numeric condition can be tested by using an IFP pseudo instruction It has the form I FF absolute expression The condition is considered true if absolute expression eva...

Page 83: ...sume For instance if the source is c I DEBUGGING SECTIG 5e ISOURCE XTF ust be _ 1 Ie number 4 ISOURCE ADA 1 Then if is executed lines 430 through 460 480 and 490 are assembled but 520 through 550 are not Line 570 is assembled The one XIF actually affected both conditions This effect is more dramatically illustrated by IASSEMBLE lEJe where neither A nor B is set In this ase 480 490 520 through 550 ...

Page 84: ...enced For indirect addressing generated by the assembler this activity is automatic Some instructions permit you to specify an absolute machine address for its operand In those cases the assembler generates the code necessary to perform the reference to the absolute location For example if the instruction was assembled L Jj 1 r i which essentially says load register A with the contents of register...

Page 85: ...used as operands in machine instructions and in some pseudo instructions They can be part of expressions in an operand Pre Defined Symbols The assembler has pre defined a number of symbols and has reserved them as references to special locations in memory Each of the locations has a special meaning and function The symbols themselves are reserved meaning they cannot be re defined by using them as ...

Page 86: ... of the registers can be found in Chapter 2 A description of the function of the accumulators and pointers can be found in Chapter 3 as part of the discussion on machine instructions A discussion of the I O registers and symbols can be found in Chapter 7 The arithmetic registers are discussed in Chapter 5 Using a pre defined symbol in a machine instruction is the same as using its address For exam...

Page 87: ...entation or location in the object module To define a symbol using an EQU the form is label iJLJ expression the resulting symbol label has the same type as the expression see Expressions below and it has the same value as the result of the expression As an example assembling the statement ISGJRCE Ihree lU means that in all references in the module to the symbol Three it is the same as referring to...

Page 88: ...olic addressing without the symbol The form of a literal is expression expression JJ where expression may be any absolute or relocatable expression see Expressions below Evaluation of Literals When a literal is encountered in an operand three things occur 1 The literal is converted to its binary value If there is more than one expression in the literal then they are all converted 2 The binary valu...

Page 89: ...sing the literal method is easier and is more self documenting While the literal form strictly says load A with the contents of the address of the constant 1 it can also be read as load A with the constant 1 and this short hand version can be an excellent way of self documenting your programs not to mention the elimination of a lot of unnecessar y symbols Nesting Literals Since literals use expres...

Page 90: ...ess of the action when using the literal Literals can be a highly useful tool but only when properly employed Literal Pools Literals are assemble time constructs but they eventually resolve to an actual address in the object code That address points into a literal pool A literal pool is part of your module where the actual values of literals are stored There is automatically a literal pool assigne...

Page 91: ...problem Expressions Literals some pseudO instructions particularly EQU and a number of machine instructions all permit expressions to be used as an operand These expressions take one of two forms absolute or relocatable The type of an expression depends upon the type of the individual elements in it An element is of the type absolute if it is any of the following A decimal integer like 0 1 2 1 024...

Page 92: ...ion is any expression which contains An odd number of relocatable elements paired in sequence and by sign except the last which must be positive An odd number of relocatable elements as above in combination with any number of absolute elements Any combination of absolute or relocatable elements which does not result in either an abso lute or relocatable value by the rules above results in an error...

Page 93: ...ght Multiplication and division can only be used with elements that are of type absolute External Symbols and Elements There is an additional relocatable element called external It behaves in almost all respects as does any other relocatable element except that only one external item may appear in an expression Also the expressions containing relocatable relocatable are not allowed when one of the...

Page 94: ... addresses can be used just like absolutes However they remain defined from assembly to assembly By defining a machine address in one module with an EQU or SET it then oecomes available to you with the same value in other modules which you assemble For example if you were to assemble a module containing then RIOO is a machine address following the above rules just as if the assembler had pre defin...

Page 95: ...or using the utility Any special requirements which must be satisfied for the utility to work properly A step by step calling procedure for the utility The exit conditions Utilities are a form of subroutine so to execute them it is necessary to execute a jump to subroutine instruction JSM if you want the utility to return to the routine which calls it Most utilities execute a RET 1 instruction to ...

Page 96: ... approach Utilities which you use in a module must have their names in an EXT pseudo instruction for that module Otherwise the assembler is unable to tell that you meant a utility and not one of your own labels causing an undefined reference assembly error Appendix F contains a short description of the utilities and has cross references to the location in the manual of the full discussion on each ...

Page 97: ...of a variable passed as a parameter or existing in common Returns the value of a BASIC variable Data type conversion from integer to full precision Establishes hardware linkages for interrupts Prepares to read a physical record from mass storage Reads a physical record from mass storage Writes a physical record to mass storage Verifies a physical record was written to mass storage Changes or inter...

Page 98: ...82 Assembly Language Fundamentals ...

Page 99: ...r BCD 86 Floating Point Summations 88 Normalization 0 89 Rounding 0 89 Floating Point Multiplication 0 90 Floating Point Division 0 92 The FDV Instruction 94 Thirteen Digit Dividends 95 Floating Point Division Example 96 Arithmetic Utilities 99 Utility Rei_math 99 _ Utility Rei_to_int 0 102 Utility Rei_to_sho 0 103 Utility Int_to_rei 104 Utility Sho_to_rei 105 ...

Page 100: ...ine instructions involved with such arithmetic are reviewed Because the processor provides only rudimentary floating point operations and because com plete floating point operations e g subtract divide are not easy to write utilities have been provided to perform these calculations These utilities are discussed later in this chapter If you are not interested in doing your own BCD arithmetic it is ...

Page 101: ...ave not done so already you should familiarize yourself with the instructions before moving on in this chapter A description of the instructions can be found in Arithmetic Group in Chapter 3 BCD Registers There are two registers in the machine used for BCD arithmetic Arl and Ar2 These symbols are pre defined by the assembly language to the registers locations in memory see Chapter 3 The mnemonics ...

Page 102: ...ssas are represented in a sign magnitude format This means that the absolute value is stored as the actual mantissa and the sign of the mantissa is maintained separately Addition There is a one bit Decimal Carry DC flag within the processor which serves a BCD function similar to the Extend flag for binary addition DC is set to a one or zero depending upon the occurrence or absence of a carry from ...

Page 103: ...al point implied after D1 then the number must be less than 10 but greater than 0 and the ten s complement of a mantissa becomes M 10 M Accordingly all that is necessary to complement a floating point number is to complement the mantissa It is immaterial whether the mantissa is treated as a 12 digit integer or as a number between aand 10 the same sequence of digits results There are two instructio...

Page 104: ... Ar2 must be shifted to the right one place and the exponent adjusted If the signs of the numbers are different complement then add A further complementing action may be necessary if DC occurs then the result necessarily has the same sign as the number which was not complemeted if DC does not occur then the result must be complemented and then given the sign of the number which was complemented Th...

Page 105: ... 12 digit mantissa it is possible to offset the mantissa of the number with the smaller exponent For example suppose there are two numbers to be added X XXXXXXXXXXX E6 Y YYYYYYYYYYY E4 By shifting the smaller one to the right by 2 digits the difference between 6 and 4 it is possible to align the exponents X XXXXXXXXXXX E6 O OYYYYYYYYYYYY E6 z ZZZZZZZZZZZ E6 As can be readily seen from the example ...

Page 106: ...er Ar2 left leaving the number of shifts required in the B register as a binary number The maximum number of shifts NRM performs is 12 If NRM must do all twelve shifts Ar2 must have been O This is indicated by a value of 12 left in Band DC being set For any other shift count NRM will leave DC at O The rules for the normalization process are Execute the NRM instruction Follow this instruction by ad...

Page 107: ... of Ar2 Floating Point Multiplication Twelve digit BCD floating point multiplication is partially accomplished using the FMP instruc tion This instruction effectively multiplies the value in the Arl register by a digit contained in B and adds the result to a partial product in Ar2 Since in the full multiplication process exponents are merely added together that part of the process is trivial The u...

Page 108: ...ithin the assembly language to generate partial product 1 0 Z ABCD Ar2 must be cleared and Ar1 is loaded with ABCD Z is stored into B in bits 0 to 3 Then the FMP instruction is executed Ar1 is added to Ar2 Z times producing Z ABCD in Ar2 The overflow digit Zov ends up in the A register bits 0 to 3 The overflow digit could be any value from 0 to 9 each add could cause a carry and there can b up to ...

Page 109: ...h partial product The discarded digits can be inspected before they are permanently lost The MRY instruction causes the digit to be placed in the A register in bits 0 to 3 This provides an easy way for a rounding mechanism to check on those digits as they are discarded The rounding routine needs to save the last digit discarded for use in rounding in the event the last use of FMP produces no overf...

Page 110: ...f each mantissa is in the same place they can be dropped altogether For example 4 8 7 1 5 48 7 15 The algorithm can then consider both the divisor and the dividend as 12 digit integers The algorithm begins by placing the normalized values into the BCD arithmetic registers The divisor 1 5E2 in the example is transferred to register Ar1 The dividend 4 8E3 in the example is transferred to register Ar...

Page 111: ...mantissa of Ar2 the mantissa at this point is the remainder When shifting the remainder to the left multiplying it by 10 you are shifting the first digit out of Ar2 If this digit is zero this is not a problem But if the digit is non zero you can t ignore it during subtractions of the divisor This in effect means that you are dealing with a 13 digit dividend Since the machine instructions deal in 1...

Page 112: ... attempting to deal with those instances where the dividend has thirteen digits This situation arises when you shift the remainder left a place The most significant digit must be retained when it is non zero so that the subtractions are sub tracted from the proper amount This shifting can be accomplished with the MLY instruction With the way that the MLY instruc tion operates the left most digit D...

Page 113: ...d to be three uses of FDV for a certain quotient digit you form the quotient digit as Q B 1 B 1 value after 1st value after 2nd use of FDV use of FDV B value after final use of FDV If the same general situation produced a zero remainder then the quotient digit is formed as Q B 1 B 1 B 1 value after 1st value after 2nd value after final use of FDV use of FDV use of FDV Floating Point Division Examp...

Page 114: ...hm itself as appropriate SOURCE Quotie t 3 SOURCE Quotient 4 SGJRCE QuotIent r r C1tJ C t 1 1 C l JF C t L i 1 i i 1 IH Digit counter t i _ 1 tor quotient word for quotient word 2 for quotient word n quotiEfi word 4 for quotient word 1 START OF DIVISION LOOP It 3 r r E rnl r i 3 1 i r ZE tH C nplemEfit the dividend Initializes digit CC0nt to Initialize FIN repE ition counter to ORKS ON NEXT QUOTIE...

Page 115: ...etic C i j t t ISOj lt Fdv c r I JLiF C E I C Ie iPC F I i F c E T 1 C i it t i j L F Ii i c CI 1 1 fi D E I i J i _ il J D C l i i i l 1 i i n i t cft r j i lrl iC i i j J j i l t t i l l _ l i t i il l 1 Y l t ...

Page 116: ...e accessed There are also utilities for the conver sion of numerical data types UTILITY ReI math The Rei_math utility provides access to all of the system floating point routines and functions General Procedure The utility is told the execution address of the desired routine or function and is also told the number of parameters The parameters are floating point values stored in full precision form...

Page 117: ...n the proper addresses as above 2 Load register A with the number of parameters required for the routine or function see the table on next page Note that some routines require this number to be com plemented 3 Load register B with the execution address of the routine or function see the table on the next page 4 Call the utility Exit Conditions The result is placed into the 4 words starting at the ...

Page 118: ...78 2 A8S 326228 1 SGN 334418 1 PI 360578 0 RND 333778 0 RES 360778 0 typ 67338 1 SIN 340038 1 COS 340148 1 TAN 337418 1 ASN 340258 1 ACS 340408 1 ATN 337518 1 ERRLl 617658 0 ERRNI 617538 0 DECIMALl 1620268 1 IADR 1621678 2 IMEM 1621508 2 OCTAL 1621058 1 AND 316328 2 OR 316478 2 EXOR 316158 2 NOT 316618 1 Less Than 316678 2 Less Than or Equal To 316758 2 Not Equal 317278 2 Equal 317178 2 Greater Th...

Page 119: ...f the example the call to the Error_exit utility page 191 is made when register A is not zero When this occurs A contains the error number of the error encountered ready made for calling the Error_exit utility UTILITY Rei to int The Rei_to_int utility provides for the conversion of a full precision value into an integer General Procedure The utility is given the address of the location of th e ful...

Page 120: ...o utility provides for the conversion of a full precision value into a short precision one General Procedure The utility is given the address of the location of the full precision value and the address of the location wher the short precision value is to be stored Special Requirements A short precision value requires 2 words to be stored Calling Procedure 1 Store the address of the full precision ...

Page 121: ...dress of the location of the integer and the address where the full precision value is to be stored Special Requirements None Calling Procedure 1 Store the address of the integer into register Oper_1 2 Store the address of the storage area for the full precision value into register Result 3 Call the utility Exit Conditions No special exit conditions An example 1 C E i i l i i r c r _ r r 1 ...

Page 122: ...s of the location of the short precision value and the address of where the full precision value is to be stored Special Requirements None Calling Procedure 1 Store the address of the short precision value into register Oper_1 2 Store the address of the storage area for the full precision value into register Result 3 Call the utility Exit Conditions No special exit conditions An example ...

Page 123: ...106 Arithmetic ...

Page 124: ...s 112 Getting Information on Arguments 113 Utility Get_info 114 Retrieving the Value of an Argument 116 Utility Get_value 117 Utility Get_element 118 Utility Get_bytes 119 Utility Get_elem_bytes 120 Changing the Value of an Argument 122 Utility Put_value 122 Utility Put_element 123 Utility Put_bytes 124 Utility Put_elem_bytes 125 Using Common 127 Busy bits 130 Utility Busy 131 ...

Page 125: ...tement also provides a means to pass data between BASIC and assembly programs through its argu ment list Data can also be passed through common The ICALL Statement There are two ways to execute an assembly language routine One way is as an interrupt service routine when an interrupt occurs on the select code to which the service routine has been linked This way is discussed in Chapter 7 The other ...

Page 126: ... a routine whether it be from a program or from the keyboard its object code must currently reside in the ICOM region Corresponding Assembly Language Statements When the ICALL is executed it references a routine in the object code When the module containing the routine was assembled it declared that routine name as a subroutine entry point Subroutine and routine are synonymous in this context This...

Page 127: ...ameter declaration is an assembly pseudo instruction by which a parameter is created When a routine is to be called with arguments a parameter declaration pseudo instruction is required for each one of the arguments These declarations appear between the SUB pseudo instruction and the instruction containing the routine name Thus when there is a call like the corresponding assembly language entry lo...

Page 128: ... always full precision When an array is to be passed the declaration is followed by an array identifier Thus when arrays are involved the declarations appear as meaning an integer array meaning a full precision array meaning a short precision array meaning a string array File numbers do not come in arrays so that declaration FIL cannot be followed by an array identifier Since the example call abov...

Page 129: ...here do not apply just to simple variables arrays and constants They also apply to single elements of arrays and expressions If you have a STH parameter declaration for example any of the following would be valid as arguments in the ICALL statement It is similar for numerical expressions The number of arguments passed 9Y an ICALL statement must be no more than the number of parameter declarations ...

Page 130: ... the ANY parameter declaration The ANY declaration is blind to the type of the corresponding argument in the ICALL statement When used it accepts any type of argument as valid string full precision short precision integer file number array The descriptor for the argument is stored in the three words set aside just as in the other declarations Now if your entry looks like ISCD E SUB ISOURCE ANY IS ...

Page 131: ... is in the following form Word Description o Argument type see description later 1 Number of dimensions O for non arrays 2 Size in number of bytes dimensioned length for strings for arrays only 3 Total number of elements in arrayl 4 Lower bound of first dimension1 5 Absolute size of first dimension upper bound lower 1 6 Lower bound of second dimension if any 7 Absolute size of second dimension 8 L...

Page 132: ...11 Integer array element 12 String array 13 Full precision array 14 Short precision array 15 Integer array 16 File number The size in bytes will be one of the following values For an integer Short precision Full precision String variables String expressions 2 4 8 dimensioned length actual length The utility which retrieves all this information is called Get_info UTILITY Get info General Procedure ...

Page 133: ...e address of the parameter declaration corresponding to the desired argument 3 Call the utility Exit Conditions There are no error exits from the utility It always returns to the instruction following the JSM Since there are no error exits and there is no requirement that there be as many arguments as there are parameter declarations an argument must actually have been passed by the ICALL in order...

Page 134: ...otentiality can be addressed in one of two ways Advise the BASIC user against using a REDIM on the array between executions of the routine or routines involved Call the Get_info utility each time the array is accessed Similar problems exist when a BASIC subprogram is called recursively and the subprogram uses a local array as an argument in an ICALL or when a subprogram calls a routine and later e...

Page 135: ... hold the value The size of the storage area must be for a file number for an integer value for a short precision value for a full precision value for a string 1 word 1 word 2 words 4 words maximum length in bytes 2 1 word 1 additional word if the string length is odd An argument must have been passed by the ICALL for the utility to work properly Calling Procedure 1 Load register A with the addres...

Page 136: ...efore calling this utility The offset of the element in the array must be correct in the array information word 16 returned by Get_info It should be remembered that the offset of the element is dependent upon the number of dimensions in the array and the length of each A calcula tion may be necessary to arrive at the offset when accessing multiple dimension arrays The offset is in terms of number ...

Page 137: ...bstring must be large enough to hold all of the substring This includes not only the string itself but also two extra words Remember a word holds two characters A string must have been passed by the ICALL for the utility to work properly Calling Procedure 1 Store the number of the sta rting byte of the substring desired into the first word of the storage area set aside for the substring Note that ...

Page 138: ...tring are numbered starting with 0 and bytes 0 and 1 contain the length of the string see Data Structures in Chapter 3 UTILITY Get_elem_bytes General Procedure This is a combination of the Get_element and Get_bytes utilities This utility retrieves a substring of an element of a string array passed as an argument The utility is given the starting byte and the number of bytes to be retrieved Special...

Page 139: ... returns to the instruction following the call The substring is returned starting with the third word of the storage area Note since the second word contains the length of the substring you have a string data structure starting with the second word For example DAT 2 DAT 10 I 3Cd C E E 5 lJt tt y l r j i tt r 3 i JE a f E I CUPCE An a i nf0 IS 30 I CUFCE E i eiii r t EOU AtT i nf0 16 E1E mE nt off ...

Page 140: ... passed as arguments either as simple variables or as individual elements of arrays passed as arguments Put_elem_bytes Substrings of elements from string arrays passed as arguments How each of these utilities is used is described in the immediately following pages UTILITY Put value General Procedure The utility is given the address of the parameter declaration and the address of the value It chang...

Page 141: ...priate data structure for the data type of the argument see Data Structures in Chapter 3 The array information must be retrieved with the Get_info utility before calling this utility The offset of the element in the array must be correct in the array information for the array word 16 returned by Get_info It should be remembered that the relative element number of the element is dependent upon the ...

Page 142: ...rt of a string variable or an individual element of a string array having been given the starting byte and the number of bytes to be changed as well as the new characters Special Requirements The bytes to be transferred are preceded by two words in the storage area The two words contain the starting byte for the substring and the number of bytes to be transferred A string variable or an element of...

Page 143: ...ILITY Put_elem_bytes General Procedure This is a combination of the Put element and Put bytes utilities This utility changes a substring of an element in a string array which has been passed as an argument The utility is given the starting byte and the number of bytes to be transferred Special Requirements The bytes to be transferred are preceded by two words in the storage area The two words cont...

Page 144: ... utility see description of that utility 6 Call the utility Exit Conditions There are no error exits from the utility It always returns to the instruction following the call For example 1st c iracter ignore length Transfer 10 cha acters Substring storage area ISOURCE Array info BSS 30 EQU Array info 16 ISOURCE Parameter STR L i i f ro i j i j f L Ii J3 F J i l i l i t ro Info alrs dy saved JSM Put...

Page 145: ...storage location Band Yare the same and C and Z are the same The same kind of operation is available in your assembly language routines with the COM pseudo instruction As with the SUB pseudo instruction the COM only serves as a preface It is followed by one or more parameter declarations of the same types as in the SUB T 1 i i F E I The FIL is not permitted since there is no corresponding item wit...

Page 146: ...nfo Get value Get element Get_bytes Get_elem_ bytes Put value Put element Put_bytes Put elem_ bytes The utilities are called in the same fashion and are subject to the same restrictions See the description of the utilities in the preceding sections of this chapter to determine how they are used The item pseudo instructions used with the COM pseudo instruction can have their own labels just as the ...

Page 147: ...et If the variable is output ting its value in the I O operation then its write busy bit is set If a variable is not involved in a pending I O operation both bits are cleared When the I O operation is completed the busy bits for the variables involved are cleared When an I O operation is encountered during execution of BASIC statements the appropriate busy bits are set and a request is made by the...

Page 148: ... routine and permit the operating system a chance to perform the 1 0 operation and clear the busy bits For example 340 IF Bus THEN 330 If the Sort routine exits setting Busy to 0 if a busy condition is not encountered and to non zero otherwise this is a tight loop which keeps trying to execute Sort until the common variables which are busy become un busy and it can proceed on its way By exiting th...

Page 149: ...d busy bit is in bit oand the write busy bit is in bit 1 The other bits are not disturbed In the following example if any of the busy bits among three common variables is set a flag is set and the routine is exitted ISrnJRCE V riab121 INT ISOURCE Variable2 SHO ISOURCE Variable3 REL I Ci JF C E its Ii j r I QURCE 01 1 L DE lx i b e 1 I OUF CE I Di iF CE I Oi JF CE I CUPCE ISCURC E I CitJ I C E I OU...

Page 150: ...132 Communication Between BASIC and Assembly Language ...

Page 151: ... Memory Access DMA 147 DMA Registers 148 DMA Transfers 149 BASIC Branching on Interrupts 150 ON INT Statement 150 Signalling 151 Additional Pre Defined Symbols 153 Prioritizing ON INT Branches 153 Environmental Considerations 155 Disabling ON INT Branching 156 Mass Storage Activities 156 Reading from Mass Storage 157 Utility Mm_read_start 158 Utility Mm_read_ xfer 159 Writing to Mass Storage 160 U...

Page 152: ...evices dealt with are those which communicate via the various interface cards e g HP98032 HPIB etc The types of I O which the assembly language supports are programmed handshake type interrupt and direct memory access or DMA A number of detailed examples have been provided demonstrating the various types of I O on different interfaces These examples can be found in Appendix H Peripheral Processor ...

Page 153: ... types of transfers Individual I O operations Le exchanges of single words occur between the processor and one interface at a time although interrupt and DMA modes of operation can be programmed to allow automatic interleaving of individual operations A peripheral is addressed through a select code and a transfer occurs through four special registers reserved for the purpose These will each be dis...

Page 154: ...n Secondary Status Out The R4 register then is almost always used for data transfers R5 is always used for status and control information The secondary registers R6 and R7 perform the indicated functions only nominally The exact interpretation as to how the register is used depends upon the interface card being used see the Interfacing Concepts manual for details In order to give some specific exa...

Page 155: ...ssembler for the Peripheral Address register Status and Control Registers The primary purpose of any interface is to allow data to be exchanged between the computer and the peripheral device to which it is connected But HP s 98030 series of interface cards are even more versatile possessing a programmable capability of their own This in turn provides optional capabilities with the card that can be...

Page 156: ...nected For example if a peripheral device has a line coming from it that indicates its power is on it could be connected to the Status line in the interface Then the program could quickly determine whether the device is turned on or off As another example a printer might have the Status line connected to the out of paper indicator should it have one to indicate to the program when it is inoperable...

Page 157: ...r and when it has not finished with the previous transfer With sufficient checks of Flag and Status before and between I O operations it is possible to eliminate initiating an I O operation to an interface which isn t ready for it For example a simple output driver for the 98032 interface is I C tJI C E i F 3 C l t i il r i r i j lE 3 1 ISOURCE SSS 3 C ck f f r E j Li iCtf t J fjE i I ISOURCE LDA ...

Page 158: ...line BASIC branch indicating to BASIC that some condition occurred discussed below 4 The service routine returns the processor to the interrupted routine so that the original process can resume The uses for interrupt I O are so diverse that it is difficult to generalize about them However one particular use is fairly well defined and of general applicability data transfers Interrupt I O is normall...

Page 159: ...inked with a select code by the Isr_access utility described later This linkage establishes where the interrupt service routine resides and to which select code it applies An interrupt service routine may be placed anywhere in the ICOM region The routine typically does one or more of the following Talks to the interface i e satisfies or acknowledges the interface s interrupt Passes data to or retr...

Page 160: ...anism which regulates the use of DMA and also interrupt transfers either grants or does not grant what is called access Before starting either an interrupt or DMA operation access should be requested from the operating system Another example suppose a device operating on a high priority select code has a relatively slow data rate This is an ideal situation in which to use interrupt driven I O Supp...

Page 161: ...onous access since DMA s cycle stealing causes the processor to run slower and could thus compromise a synchronous process Synchronous access on a low priority select code in conjunction with asynchronous access on a high priority select code is conflicting since the asynchronous device could interrupt the synchronous ISR thus compromising the timing requirements of the synchronous device Synchron...

Page 162: ...nkage between an interrupt service routine lSR and a select code Pressing RESET CONnll STOP I during execu tion of the utility may cause a SCRATCH A to be issued General Procedure The utility is told where the ISR resides and what kind of access is required If access is granted it re turns successfully If access is not granted immediately it keeps trying periodically until it is successful or unti...

Page 163: ...te Access code 0 abortive access should be used with caution An interrupt routine with abortive access can exist on the same priority level as an interrupt routine with synchronous access If the abortive routine is in progress when an interrupt occurs requiring the synchronous service routine the abortive routine will finish before the synchronous routine can be serviced The timing requirements of...

Page 164: ...ed and an interrupt service routine is called the processor automati cally saves the state of some of the registers so that their values can be restored upon return from the ISR Other registers are left alone and if your service routine uses them it is up to your ISR to save them and restore them before returning from the ISR The registers which are automatically preserved are A B C Cb P Pa Also t...

Page 165: ...xecuted Tfi i 3 5 L In i 4B Then before the ISR exits and after the affected instructions have been executed the follow ing sequence must be executed Indirect Addressing in ISRs Indirect addressing in ISRs can produce anomalies unless the following rules are followed 1 If indirect addressing is employed with the operand being an address in the ICOM region one of the processor registers must be pre...

Page 166: ... the process is automatic it is done under processor control regulated by the interface Since only the 98032A interface supports DMA the following discussion is in terms of that interface To the peripheral the DMA operation appears as programmed I O The transfer however is actually performed by special DMA hardware Information regarding the transfer is stored in the DMA registers for the DMA hardw...

Page 167: ...bus takes its address from the Dmapa register rather than Pa as in other I O transfers The value is supplied to Dmapa by the Isr_access utility when it grants DMA access Dmama contains the address of the first word in memory Le lowest address where the data transferred is or will be stored After each word transferred this register is automatically incremented Dmac is the count register for a DMA t...

Page 168: ...ourth the OMA requests are enabled using the instruction Fifth a Start OMA command is given to the interface using programmed I O With the 98032 interface this command is the value 3208 using the Primary Control register R5 0ut Finally when the OMA transfer is complete the interface generates an interrupt which causes the processor to branch to the designated ISR This ISR should disable the card a...

Page 169: ...ier Whenever an interrupt is signalled from an ISR for a particular select code if ON INT has been executed for that select code then at the end of execution of the BASIC line which was executing when the signal came the indicated branch in the ON INT is taken In the GOTO version the branch is absolute which is to say that the program goes to the line indicated and picks up its execution there for...

Page 170: ...Points Simple Pausing Transfers Environments Data Locations IBREAK Everywhere Number of Break Points Clearing Break Points Interrogating Processor Bits Protected Memory Dumps Value Checking Functions DECIMAL OCTAL IADR IMEM Patching 170 170 174 174 175 176 177 178 179 179 180 180 181 183 184 184 184 185 186 187 ...

Page 171: ...nterrupt is signalled for that select code In actuality an interrupt may not have occurred on that select code at all Conversely an interrupt may occur on the select code but BASIC and its ON INT condition may never hear about it It is necessary for the ISH which does the actual handling of an interrppt to inform or signal the operating system that the interrupt occurred and trigger the c N INT co...

Page 172: ...y be a literal For example would signal select code 5 When you want to signal a select code after others have already been signalled a slightly different instruction sequence is required I Ol H E I ClUF CE I3C1UkCE I OUPCE r CUF CE T OUF CE I Ol IkCE I OUF CE LDB I x _P I 1 LDA 10 t TA t I AIlE 3 LIlA j 1 a k DIk TOP Mask is the same as above Or in the select code As a further example suppose you ...

Page 173: ...rity is set to O When a BASIC line finishes and there is at least one ON INT branch pending which is greater than the system priority then the system takes the branch associated with the ON INTwith the greatest priority The values assigned to priority may be any integer numeric expression from 1 to 15 If priority is omitted is assumed If the ON INT branch to be executed is a GOTO then the system p...

Page 174: ...n the program an interrupt had been received from all four of the interfaces involved Then the process of dealing with them pro ceeds like this EVENT Reaches end of current BASIC line Finishes Routine 7 NEXT ACTION SYSTEM PRIORITY GOSUB Routine 7 Changes from ato 15 GOSUB Routine 5 Changes from 15 to 9 Suppose at this point another interrupt is received from select code 7 EVENT NEXT ACTION SYSTEM ...

Page 175: ...the execution returns to the main program Similarly if you define an ON INT in a subprogram it is effective only while the program is executing that subprogram A side effect occurs here when you use the CALL version of an ON INT By calling the subprogram with an ON INT you have the effect of locking out the other interrupts except those which are executed in the subprogram itself and other CALL ve...

Page 176: ...as no effect The DISABLE and ENABLE statements work the same way for the ON INT statements as they do for the ON KEY statements They should not be confused with the DIR and EIR machine instructions which disable and enable the interrupt system Mass Storage Activities For devices meeting the operating system s criteria for mass storage peripherals the reading and writing of records is simple If a d...

Page 177: ... like this Mm read start Mm read xfer User Space The utilities accomplish their purposes with the help of two locations containing vital informa tion for their use The first is the Mass Storage Descriptor MSD and the second is the Mass Storage Transfer Identifier MSTID The MSD is three words in the ICOM region which contains the following information WORD o MSUS lower 16 bits of record number 2 do...

Page 178: ...e and try again later UTILITY Mm read start General Procedure The record number is determined then the transfer of the record s contents is made from the device to the device buffer If the buffer allocation causes a memory overflow there is an error Special Requirements The record number and msus must be loaded into the MSD in ad vance of the call There must be a stable location not changed by oth...

Page 179: ...ot be completed on the first or subsequent calls see exit conditions In that case to successfully complete the transfer all three steps must be repeated Exit Conditions RET 1 Occurs when the transfer is not completed It is up to y ur routine at this point to decide whether another attempt should be made immediately or whether some thing else should be executed and to come back later RET 2 Occurs w...

Page 180: ... get the data from the user space into the device buffer and then to transfer the data from the buffer to the mass storage device the Mm_write_start utility is used Then a test can be made to determine when the transfer is complete by using the Mm_write_test utility As with the reading utilities these utilities accomplish their purposes with the help of the same two locations MSD and MSTID They co...

Page 181: ...lling Procedure 1 Store the data to be transferred in its location Store the msus and record number into the MSD area 2 Load register A with the address of the MSD area 3 Load register B with the address of the data location 4 Call the utility Exit Conditions RET 1 Occurs if there is a memory overflow during execution of the utility RET 2 Occurs if all went normally Register A contains the MSTID T...

Page 182: ...tine at this point to decide whether another test should be made immediately or whether something else should be executed and to come back later RET 2 Occurs when the transfer is complete If register A contains a non zero value an error occurred and A is the error number In addition to mass storage errors 80 through 99 error 19 is returned if the MSTID parameter is invalid CAUTION Pressing RESET I...

Page 183: ...bits of the address of the first physical record in the file 1 Number of logical records in the file 2 Current physical record number Le an offset from the file s beginning 3 Current word in physical record 4 Size of a logical record in words 5 Mass storage unit specifier msus 6 Buffer address 7 Check read status 0 off 1 on 8 Highest 7 bits of the first physical record in the file 9 Reserved by th...

Page 184: ... for the utility to store the information from the descriptor Call Procedure 1 Load register A with the address of the ten word area where you desire the information to be stored 2 Load register B with the file number an integer from 1 to 10 3 Call the utility Exit Conditions RET 1 Occurs if the file has not been assigned by a BASIC ASSIGN statement RET 2 Occurs if all went normally Here is an exa...

Page 185: ...on or file difficulties may ensue Most of the information is normally returned by the Get_file_info utility and only a couple of words are changed to change the pointer in the file e g the current record and word numbers Only words 2 3 and 7 should be changed in the descriptor Calling Procedure 1 Load register A with the address of the ten word area where the information is stored 2 Load register ...

Page 186: ...17 for the utility to work properly Neither the previous nor the selcted printer should be on HPIB device Calling Procedure 1 Load register A with the desired select code 2 Load register B with the desied printer width 3 Call the utility Exit Conditions There are no error exits from the utility so it always returns to the instruc tion following the call Register A contains the value of the previou...

Page 187: ...g and it prints that string to the standard system printer Special Requirements The string to be printed must be in standard string format see Data Structures in Chapter 3 The string must be no longer than 506 characters Calling Procedure 1 Load register A with the address of the string to be printed 2 Call the utility Exit Conditions RET 1 If a memory overflow occurs during execution of the utili...

Page 188: ...168 I O Handling ...

Page 189: ...ms during their development stages These tools are for run time debugging so your source code must have been assembled into object code and stored in the ICOM region before attempting to use any of the debugging features detailed in this chapter There are three classes into which these tools fall stepping through programs dumps and value checking There is also an additional capability provided for...

Page 190: ...se You can also establish different routines for different break points adding to the flexibility Individual Instruction Execution Normally all BASIC lines including the ICALL statement act as a unit That is to say whenever you press the 8 key the line which is currently executing is allowed to finish before the program is actually interrupted Thus if you press 8 during execution of the line L 2iU...

Page 191: ...ctal value of that operand is displayed this is because the reverse assembly process has no way of knowing what symbols you might have used to assemble the instruction originally After pressing 8 should you press B execution resumes normally It is notnecessary for you to do anything such as cleaning up the registers etc for execution to resume as if you had never interrupted it After pressing 8 yo...

Page 192: ...re not stepped instruction by instruction but rather as a unit The I slip I key performs in BASIC just as before Keeping the I STEP I key depressed causes repeated execution of the stepping function the same as in BASIC By way of example suppose you had the following source code 4a IHS Ertf LE E t r c t 5a Loop LINPUT H 7a IeALL E ract A 1 20 I OUFCE 130 IS UF E String 140 ISOUFCE SUB i 50 I OtF C...

Page 193: ...SCURCE 300 00076 067774 ISOURCE 260 00072 074760 IS RCE Loop 270 00073 012016 ISCUFCE 290 00075 054001 ISOUFCE 300 e 076 067774 ISOURCE 260 00072 074760 ISOUPCE Loop 270 00073 012016 ISOURCE 290 00075 054001 ISOURCE 300 00076 067774 ISOURCE 260 00072 074760 18JURCE Loop 270 00 7 H 2 il6 I CIi JPCE 290 00075 054001 ISOU E 00 00076 067774 ISOURCE 260 00072 074760 ISOUPCE Loop 270 00073 012016 ISOUPC...

Page 194: ... executing without interrup tion but line 140 s call to Sortn would be executed instruction by instruction Executing IPAUSE ON when the facility is already in effect causes no change Similarly execut ing IPAUSE OFF when the facility is already off causes no change Both IPAUSE ON and IPAUSE OFF can be executed from the keyboard Setting Break Points It is possible to define points in an assembly lan...

Page 195: ... address using whatever the value of Hook is when the statement is executed You can also specify the number of occurrences of reaching a break point before pausing should come into effect This is done by executing 1 1 F E I j address counter where counter is a numeric expression any variables within counter are BASIC variables A pause occurs when address has been reached counter number of times co...

Page 196: ...tine is terminated counter performs the same as in the simple pausing form In the GOSUB and GOTO forms there is an environmental restriction The line identifier must be in the same BASIC environment Le main program or subprogram as that in which the IBREAK statement is executed More on this in Environments below Environments The GOSUB and GOTO types of break points are related to the BASIC environ...

Page 197: ... to be cleared If no program is executing when an IBREAK is executed from the keyboard then the main program is considered to be the environment for the break point If the program is replaced as with a GET or a LOAD then the break point is cleared Data Locations Break points can also be established for data locations This is done with In this case address is presumed to be a data location referenc...

Page 198: ...t just as you can with the non DATA form And so you can H i rr address counter C C LJ r line identifier I FH E r i J l address counter i r line identifier They operate in an identical fashion to transfers of the non DATA type and are under the same environmental restrictions In order to determine whether an address is being referenced each instruction is interpreted that is analyzed for its compon...

Page 199: ...A with the same address as specified in an already effective IBREAK or IBREAK DATA statement causes the newly executed statement to override the previous one While there may be an IBREAK and IBREAK DATA both for the same address the capability is not a useful one Clearing Break Points There are a number of ways that break points can be cleared One way as has already been mentioned is leaving the B...

Page 200: ... allowed memory then an error results number 187 The same is true if an IBREAK DATA statement is in effect Access means jumping to or writing into memory The allowed memory is The ICOM region BASIC s value area the region where BASIC variables are stored BASIC s common area the region where BASIC common variables are stored The processor registers The temporary values stored in the base page pre d...

Page 201: ...executed from the keyboard perhaps during a pause caused by stepping or IBREAK Any number of Iocation s can be specified They can take a number of forms The simplest is address Thus IDUMP address prints the contents of address to the current system printer The contents are printed in their octal representation location can specify a whole range ofaddresses by using the form address Tel address Wit...

Page 202: ...cimal representation base IO I E for hexadecimal representation base I6 c r for octal representation base B Thus the general form of location is mode selection address r C address As an example of all this take the example program at the beginning of the chapter If a couple of statements are added so that the main BASIC program reads 10 DE fit 10 J 2 1 Icm H O 0 Ifi El mlE E tr 3 c t 40 IBREAK loo...

Page 203: ...hecking Value checking is a method of tracing the value of variables in your assembly language program using the interactive capabilities of the 9835A B You already have been introduced to break points and dumps in earlier sections The capability of value checking serves as a useful adjunct to these procedures The value checking of assembly variables is similar to the monitoring of variables in BA...

Page 204: ...imal value Being a function it can be used anywhere any other BASIC numeric function can be used Often you will find it useful in PRINT statements which are a part of subroutines called by break points OCTAL This function is the converse of the DECIMAL function Its role is to convert decimal values into their octal base B representation The function has the form iJCTRL decimal value This can be us...

Page 205: ...hmetic suggests that the result of 178 1 be 208 To get the proper octal result the procedure is Note also that the expression still does not yield 20 IADR This function yields the numeric value in octal representation of an assembled location The form is 1 II JF assembled location As an example take the case of the example program at the beginning of this chapter The result of is 76 This function ...

Page 206: ...ner perhaps in a PRINT statement you can ease the burden of checking variables from the keyboard You can even use the value returned as a comparison against some set of limits so that you print only when the value exceeds those limits There are many other possibilities for use Interrogating Registers and Flags Interrogating the processor register A B P R Pa Cb Db Dmapa Dmama Dmac C D Ar2 SE and Ar...

Page 207: ...umstances which arise that occasionally suggest patching as the most profitable course of action To change a particular location in memory in the 9835A B is not difficult The statement to use is r E assembled location r octal expression After execution of the statement the specified assembled location contains the specified octal value Changing the contents of a register is a common use of this fa...

Page 208: ...188 Debugging ...

Page 209: ...ors and Error Processing Chapter 9 Table of Contents Types of Errors Syntax Time and Assembly Time Errors Run Time Errors Utility Error_exit Run Time Messages Assembly Time Messages 189 189 190 191 193 195 ...

Page 210: ...d of approaching the problem of error processing and there is no way to anticipate all of them Even so the following should offer some assistance in identifying the source of an error Not every machine error is covered here oniy those directly related to writing or accessing assembly language routines A complete listing of error messages though not in the same detail as in this chapter can be foun...

Page 211: ...rinted on the current system printer Included is the message followed by the error type The message follows the listing of the individual errors The total number of errors is also printed An explanation of the individual assembly time errors can be found at the end of this chapter Run Time Errors Run time errors can sometimes be anticipated They come at two distinct times and your error processing...

Page 212: ...ity provides you with the capability of aborting an assembly language routine by creating a BASIC error Two types of BASIC errors can be created recoverable which can be trapped by a BASIC ON ERROR statement and non recoverable or fatal which cannot be trapped General Procedure The utility is given the number of the error to be created Then the utility is called with the JSM instruction but no ret...

Page 213: ... suppose somewhere in one of your assembly routines you wanted to abort the routine if a certain variable Flag is non zero at a certain point Suppose also that the variable when non zero contained the error number then your program could look like ISQURCE LDA Flag I Qi JRC E ZA it 2 ISQURCE J8M E ror exit Similarly there are some utilities which when an error is encountered return an error number ...

Page 214: ...e current ICOM region either collectively or individually Improper argument in DECIMAL or OCTAL function The OCTAL function has a range from 65535 to 65535 The DECIMAL function has a range for its arguments of 1777778 to 1777778 Break Table overflow A maximum of eight breaks can be established with the IBREAK statements and be in effect at one time If eight breaks are in effect then to allow other...

Page 215: ...one which is missing from memory E F CiF 1 3 2 Errors in assembly At least one error was encountered while assembling one of the modules in your IASSEMBLE statement F 1 1 f 1 3 Attempt to move or delete module containing an active interrupt service routine This is the result of trying to reduce the size of the ICOM region or to eliminate it or trying to delete a module when one of the affected mod...

Page 216: ...a tions in the assembly routine Assembly Time Messages The following is a list of the assembler error messages you may receive while assembling a module All of these errors cause a fatal error which means that the assembly produced no object code After the error has been corrected it is necessary to re assemble the module containing the error A possible corrective action or actions is included in ...

Page 217: ...e current main BASIC program with a new ICOM statement increasing the ICOM size or you must rearrange your assembly so that the module fits This latter course can include deleting other modules or rewriting the abortive module so that it requires less memory Operand out of range Some instructions using indirection require a relocatable expression to evaluate to an address within 512 words of the c...

Page 218: ...that a constant is allowed by the instruction Undefined symbol By the end of the assembly all symbols must have been defined either by use as a label on an instruction or as a symbol associated with a value through an EQU EXT or SET pseudo instruction A symbol not so defined except those pre defined by the assembler and used in the assem bly causes this error Check the spelling of all undefined sy...

Page 219: ...198 Errors and Error Processing ...

Page 220: ...ilities Appendix G Writing Utilities Appendix H 110 Sample Programs Handshake String Output Handshake String Input Interrupt String Output Interrupt String Input DMA String Output DMA String Input HP IB Outputl Input Drivers Real Time Clock Example Appendix I Demonstration Cartridge Using the tape Typing Aids Appendix J Error Messages Mass Storage ROM Errors Plotter ROM Errors Assembly Language RO...

Page 221: ...Appendix A ASCII Character Set The following table and chart show the ASCII character set and the keypresses necessary to obtain the ASCII character codes 199 ...

Page 222: ...NTL 0 DCl Device Control DC2 Device Control CONnie DC3 Device Control ICONTLI DC4 Device Control IC L 0 NAK Negative Acknowledgement ICONnl SYN Synchronous Idle IC 0 ETB End of Text Block ICONTLI CAN Cancel 0 EM End of Media ICONnl0 SUB Substitute ICONT LI ESC Escape O FS File Separator ICONnl8CJ GS Group Separator CONTLIG RS Record Separator ICONTL 8 US Unit Separator ICONTL 8w 1 Assumes CAPS mod...

Page 223: ...D Comma 0 Minus Sign Dash G Period CJ Forward Slash CD 0 CD 1 CD 2 m 3 m 4 CD Numerics 5 m 6 GJ 7 CD 8 CD 9 CD Colon ao Semicolon 0 Less Than ao Equal CD Greater Than 8CJ Question Mark 8CD 1 Assumes CAPS mode multiple keys must be pressed simultaneously Also can be found among calculator keys Octal Decimal Code Code 40 32 41 33 42 34 43 35 44 36 45 37 46 38 47 39 50 40 51 41 52 42 53 43 54 44 55 4...

Page 224: ... am Reverse Slash Inaccessible from Keyboard Right Bracket am i UpArrow 0 Underscore 8 Assumes CAPS mode multiple keys must be pressed simultaneously Also can be found among calculator keys Octal Decimal Code Code 100 64 101 65 102 66 103 67 104 68 105 69 106 70 107 71 110 72 111 73 112 74 113 75 114 76 115 77 116 78 117 79 120 80 121 81 122 82 123 83 124 84 125 85 126 86 127 87 130 88 131 89 132 ...

Page 225: ...103 h 80 150 104 i 80 151 105 j 80 152 106 k 80 153 107 1 8eg 154 108 Noncapital m Letters 8 155 109 n 80 156 110 0 8 157 111 P 80 160 112 q 8 161 113 r 80 162 114 s 80 163 115 t 80 164 116 u 8 165 117 v 80 166 118 w 8 167 119 x 80 170 120 Y 88 171 121 z 80 172 122 Left Brace 173 123 I Vertical Line 174 124 Right Brace Inaccessible from Keyboard 175 125 tV Tilde 176 126 DEL Delete 177 127 I Assume...

Page 226: ...8 56 00111001 071 39 57 00111010 072 3A 58 00111011 073 3B 59 00111100 074 3C 60 00111101 075 30 61 00111110 076 3E 62 00111111 077 3F 63 ASCU EQUIVALENT FORMS Chat 8 y Oct Hex Dec 01000000 100 40 64 A 01000001 101 41 65 B 01000010 102 42 66 C 01000011 103 43 67 o 01000100 104 44 68 E 01000101 105 45 69 01000110 106 46 70 G 01000111 107 47 71 H 01001000 l10 48 72 01001001 111 49 73 01001010 112 4A...

Page 227: ... 003400 000007 026000 000054 BS 004000 000010 026400 000055 HT 004400 000011 027000 000056 LF 005000 000012 027400 000057 VT 005400 000013 0 030000 000060 FF 006000 000014 1 030400 000061 CR 006400 000015 2 031000 000062 SO 007000 000016 3 031400 000063 SI 007400 000017 4 032000 000064 DLE 010000 000020 5 032400 000065 DC1 010400 000021 6 033000 000066 DC2 011000 000022 7 033400 000067 DC3 011400 ...

Page 228: ... 050400 000121 I 066000 000154 R 051000 000122 m 066400 000155 S 051400 000123 n 067000 000156 T 052000 000124 0 067400 000157 U 052400 000125 p 070000 000160 V 053000 000126 q 070400 000161 W 053400 000127 r 071000 000162 X 054000 000130 5 071400 000163 Y 054400 000131 t 072000 000164 Z 055000 000132 u 072400 000165 055400 000133 v 073000 000166 056000 000134 w 073400 000167 056400 000135 x 07400...

Page 229: ...low is a carry from bit 15 or 14 but not both Extend and Overflow are bits in the pro cessor Specifying register R4 R5 R6 or R7 as the location causes an input 110 bus cycle to the interface addressed by the Pa register Indirect addressing may be specified loc must be on base or current page ADB loc I Integer Math Adds the contents of the specified location to the 35 contents of register B The res...

Page 230: ...s exactly equivalent to SAR 41 16 CLB Shift Clears register B This is exactly equivalent to SBR 41 16 CLR n Load Store Clears the specified number of words beginning 34 at the location pOinted at by the A register A maximum of 16 words may be cleared CMA Memory Perform a one s complement of the A register bit 41 by bit inversion of all 16 bits CMB Memory Perform a one s complement of the B registe...

Page 231: ...referencing stack instructions Disables Data Request Cancels the DMA instruction Disables the interrupt system Cancels the EIR instruction Enables the DMA mode Cancels the DDR instruction Mantissa right shift of Arl for one digit The twelfth digit is shifted into bits 0 3 of the A regis ter The non digit part of the A register is cleared bits 4 15 and the Decimal Carry bit in the pro cessor is cle...

Page 232: ...ultiplication by re 46 peated additions The mantissa of Arl is added to Ar2 along with Decimal carry a specified number of times The number of times is specified in the lower 4 bits 0 3 of the B register The result ac cumulates in Ar2 If intermediate overflows occur the number of times they occur appears in the lower 4 bits of the A register after the operation is complete The upper 12 bits of the...

Page 233: ...ion then proceeds to the specified lo cation Return from the subroutine is effected by the RET instruction Indirect addressing may be specified loc must be on base or current page LOA Ioc Load Store Loads register A with the con ten ts of the 34 specified location Specifying register R4 R5 R6 or R7 causes an input I O bus cycle to the interface addressed by the Pa register Indirect addressing may ...

Page 234: ...o 2 The digits are then right shifted for the re maining number of digits specified The twelfth digit is lost on each shift except for the last shift and the vacated digits are zero filled 3 Finally the last right shifting takes place with the twelfth digit shifting into the lower 4 bits 0 3 of the A register The Decimal Carry bit in the processor is cleared and the non digit part of the A registe...

Page 235: ...mber of shifts required is stored in the first 4 bits 0 3 of the B register If 12 shifts are re quired the Decimal Carry bit in the processor is set otherwise the Decimal Carry bit is cleared The exponent is not altered Pushes the lower byte right half of the specified register onto the stack pointed at by the Cb and C registers Specifying register R4 R5 R6 or R7 causes an input I O bus cycle to t...

Page 236: ...ister Incrementing or decrementing the 0 register may be specified Incrementing is the default reg must be in the range of 0 through 7 The incrementing or decrementing action taken place before pushing 43 Rotates the A register left the indicated number of 40 bits Bit 15 rotates into bit 0 left circular Maximum rotation of 16 bits Rotates the A register right the indicated number 40 of bits Bit 0 ...

Page 237: ... is not O Setting or clearing the bit after the test can be specified adrs must be within 32 and 31 the current location RZA adrs Test Branch Skips to adrs if register A isnot O adrs must be 37 within 32 and 31 of the current location RZB adrs Test Branch Skips to adrs if register B is not O adrs must be 37 within 32 and 31 of the current location SAL n Shift Rotate Shifts the A register left the ...

Page 238: ...hifts the B register right the indicated number of bits with all vacated bit positions becoming O Maximum shift is 16 bits Skips to adrs if Decimal Carry is clear Decimal carry is a single bit in the processor which may have been set by certain arithmetic operations adrs must be within 32 and 31 of the cur rent location Sets DMA inwards Reads from peripheral writes to memory Sets DMA outwards Read...

Page 239: ...be within 32 and 31 of the current location SIA adrs Test Branch Skips to adrs if register A is 0 then increments 37 register A by 1 Extend and Overflow are not af fected by the incrementing action even if a carry or overflow occurs adrs must be within 32 and 31 of the current location SIB adrs Test Branch Skips to adrs if register B is 0 then increment 37 register B by 1 Extend and Overflow are n...

Page 240: ... be within 32 and 31 of the current location SSS adrs I O Skips to adrs if the Status line is true set The 47 status line is the one associated with the peripheral on the current select code pointed to by the Pa register adrs must be within 32 and 31 of the current location STA T Ioc I Load Store Stores the contents of the A register into the 34 spcified location Specifying register R4 R5 R6 or R7...

Page 241: ...C reg J Stack Withdraws a byte from the stack pointed at by the 43 reg Cb and C registers and places it into the lower byte right half of the speCified register Specifying register R4 R5 R6 or R7 causes an output 110 bus cycle to the interface addressed by the Pa register Incrementing or decrementing the C register can be specified Decrementing is the default reg must l e in the range of 0 through...

Page 242: ...r decrementing action takes place after the withdrawal Withdraws a full word from the stack pointed at by the D register and places it into the specified register Specifying register R4 RS R6 or R7 causes an output 110 bus cycle to the interface addressed by the Pa register Incrementing or decrementing of the 0 register can be specified Decrementing is the default reg must be in the range of 0 thr...

Page 243: ...0 0 0 0 I register 14 1 0 1 0 0 0 1 O O O O 1 37 13B 1 0 1 0 0 0 0 0 0 0 0 0 2 13B note 2 g I 0 1 0 0 0 0 0 0 i 1 B c 25 1 Blc 14 address o B c 23 I 1 0 1 1 0 1 1 0 0 0 0 1 32 1 0 1 1 1 0 0 0 1 1 1 1 65 2T note 3 1 0 1 1 0 0 0 0 0 0 0 0 62 4B note 4 1 0 1 1 0 1 0 0 0 0 0 0 33 4B note 4 o 0 1 0 0 0 0 0 0 0 0 0 28 o 0 0 0 0 0 0 0 0 0 0 0 11 o 0 1 1 0 1 0 0 0 0 0 0 23 Z note 5 1 0 0 1 Va 1 1 0 0 23 1...

Page 244: ...0 ________ _ o 0 0 0 0 1 0 0 0 0 OIl g g 1 gI 0 i I I o 0 1 I o 1 1 1 1 I oE_ r I o 0 1 I o 1 1 11 0 1 f i o 0 1 I o 1 1 1 _ I o 1 1 0 0 0 0 loE n l Timing 25 n n 9 25 n n 9 16 14 14 14 14 14 14 n 9 14 n 9 n 9 14 14 n 9 14 12 12 14 14 14 14 14 14 14 14 14 14 14 14 14 19 19 14 14 9 9 23 23 23 23 12n 21 l WWD r XFRn Notes on bit patterns B C Base Page Current Page C S Clear Set D I Direct Indirect H...

Page 245: ... Patterns Bit Pattern 10 9 8 7 6 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 Address Field 0 0 0 0 0 0 0 Register Address 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 E o 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 0 0 0 1 0 1 0 u L c 0 0 0 0 0 1 1o 1 1 P w c o I Register Address 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 Y x 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 N of words 0 1 1 1 0 0 0 binary n 1 0 1 1 0 1 0 0 0 0 ...

Page 246: ... Pseudo Instructions The following table lists the available assembler pseudo instructions with a short description of each and the page number of the more detailed description listed elsewhere in this manual 223 ...

Page 247: ...ntry points Specifies a subroutine declaration to be a file number Source listing control for top of page with change of heading Beginning of conditional assembly Specifies a common or subroutine declaration to be an integer Reserve memory for literals and links Source listing control for enabling the listing Designates the beginning of a module Specifies a common or subroutine declaration to be f...

Page 248: ...a label for a particular machine instruc tion in which case the address of the associated instruction is used or an assembler defined symbol in which case the associated absolute address is used or a symbol defined by an EQU instruction in which case the associated value is used expression may be a numeric expression or a string expression If numeric a decimal calculation is performed and the resu...

Page 249: ...5 J H assembled location IASSEMBLE pages 60 67 LJ E module module JJ option L option JJJ 1 H U lL L J option option JJJ where module is the name of an existing module in the source program option may be any of the following IT l iF numeric expression ...

Page 250: ...he name of a BASIC subprogram counter is a numeric expression line identifier is a line in the BASIC program ICALL pages 107 111 1 routine data item data item where routine is the label associated with a SUB pseudo instruction sequence and data item takes on the same forms and attributes as parameters in BASIC s CALL statement ICHANGE page 187 i i assembled location octal expression ICOM pages 19 ...

Page 251: ...oWing forms f i C for ASCII character representation BI for binary representation for decimal representation for hexadecimal representation iJCT for octal representation ILOAD page 22 L C H nJ file specifier where file specifier is of the same form as elsewhere in BASIC see Mass Storage Techniques manual or Operating and Programming manual IMEM Function page 186 Li iL i assembled location INORMAL ...

Page 252: ...ion pseudo instruction or data generator comment is any combination of characters ISTORE pages 23 24 where module module JJ file specifier U i J _ J file specifier module is the name of a module currently existing in the ICOM region file specifier is of the same form as elsewhere in BASIC see the Mass Storage Techniques manual or the Operating and Programming manual LITERALS pages 72 75 expression...

Page 253: ...230 Appendix D Assembly Language BASIC Language Extensions Formal Syntax ...

Page 254: ...ost significant bit of address 138 Stack pointer Block bit for byte pointer in D second most significant bit of address 138 DMA count register DMA memory address register DMA peripheral register lower 4 bits of address 138 Reserved symbols for use with interrupt service routines Arithmetic utility operand address registers Program counter Peripheral address register lower 4 bits of address 118 Ret...

Page 255: ...eserved at least 1710 words user data ICOM area reserved Return stack reserved Base_page Oper 1 Oper 2 Result reserved Ar1 reserved in octal representation starting address dependent upon system needs Cb Db address dependent upon starting address and length of ICOM A B P R R4 R5 R6 R7 reserved reserved I I l Dmama Dmac C 0 Ar2 Se reserved I Pa I Omapa address o 2 3 4 5 6 7 10 11 12 13 14 15 16 17 ...

Page 256: ... storage unit specifier word 6 buffer address word 7 check read O off 1 on word 8 high 7 bits of file address word 9 reserved by system Storage area must be at least 3 words simple variables 18 words arrays for arrays add 3 words for each 64K bytes in your machine s memory Array info obtained by Get info utility Relative element number must be stored in array pointer word 16 of array info Storage ...

Page 257: ...ng to the standard printer 167 string RET 2 I STOP I pressed RET 3 normal Put_bytes address of address of RET 1 Storage area same as Get_bytes Replaces substrings or parts of arguments 124 storage area parameter Put elem_bytes address of address of RET 1 Same as Get elem_bytes Same as Put_bytes used for accessing elements of 125 storage area array info string arrays Put element address of address ...

Page 258: ... of security for the code in the routine from the casual user The following must be done to make a section of code into a utility 1 The entry point for the utility must consist of the instruction 2 Each exit point from the utility must consist of the following instructions i LJ I i i n n may be any number 32 through 31 dep nding upon the desired returning point For example here is a simple utility...

Page 259: ...an make your ill actions in debugging simpler If you already know what a section does and don t want to have to step through each instruction in that section each time it is encountered you can make it into a utility as above Then whenever it is encountered the section is stepped through as if it were a single statement Utilities and calls to utilities are not allowed in interrupt service routines...

Page 260: ...Appendix H I O Sample Programs 30 INTERFRCE CARDS RPPLICRBLE ARE l i t 1 1 1 v SOURCE 01 F c CURCE U JF C E C U C i bU SOURCE 500 SU JRCE j I T F SF j F i n r I iE CL C Ci ct t 1 237 ...

Page 261: ...T THE STRING PAFAMETER TF T jE TJ I f Tf E THEi E TC GET THE NEXT C F PJR OUTPUT FETUFN TO I HSIC l OUFCE ISCIiJRCE l OUFCE lS0UFCE I OUFCE I Cli JFCE I OUFCE SUBROUTINE TO C TPUT ONE C R8 TEF n GPIO LIKE CRFli 7 20 j 4 j ISOUFCE I OUF CE I CIURC E I Oi JFC C 780 ISOUFCE I OUF CE I CilJRCE Lil H F i 810 ISOUFCE I CHARACTER IS PASSED IN H F C j ir i t n i 4 TA F F ET SKIP IF CARD IS DOWN ELSE WAIT ...

Page 262: ... INTERFACE CARDS A LICABLE ARE j60 b SERIAL INTERFP E 110 INTEGER SelE t code HOLD T SELECT lUD 1 t HOLD SELECT CODE EQJATES W L E CRS ARE IGNORED i i i l i l il i j INIIIHL1 E THE STRING LENGTH f _ Ll l T l U TO ru BYIL INTO i lr C BL ...

Page 263: ... I O Sample Programs OU C OUi CE SIGNRL THIS S RN INPUT i i jr j iHj j HHt E i i rUie J TO c Cn 1F E T E TF CHRRIHGE RETURN r E I C J OFE IT u C PUi CHHFHCTEF IN STRING AND BUMP STRING LLNGi W HHVE WE INFUT 160 CHHFS ...

Page 264: ...L iG CE 330 SOURCE BVTE POINTER FOk ISR TE lF FOF L F TEJ 1F F OF I FO EQUATES FOR CR LF 98032 INTERRUPT ENABLE MASK 340 SOURCE ROUTINE TO OUTPUT A STRING FOLLOWED BY CR LF TO A GPIO LIKE INTERF0 E USING INTERRUPT b0 SOUkCE ENTRy uINi Out t SOURCE P AMETERS 1 INTEGER CONTAIN NG SELECT CODE j i 14 410 SOURCE 440 SOURCE 46U 4 70 49U SOURCE SiCI 57 1 Oi JF CF DiJRC OUF CE C iJF 1 S8U SOURCE SOUF CE O...

Page 265: ... i n TPT n F i n i ii ii TE T UP BYTE POINTER FOR D TO GET LHH FROM STRl BE H E Ht fD rrUD Te j C 1 u I F iIL C FTF r T P i SEND n E DATH BYTE TO CRRr RESAVE BYTE POINTER it i t DEPENDING ON WHETHER THE SELECT CODE IS OR LOW CALL THE CORRECT TERMINATION F CUT I r E AND NOW TRIGGER AN END CF CORFECT MASK WOFD MUST BE CALCULATED BY A COMPUTED SHIFT INSTRUCTION A E TH 13 IA ANR U3E MAGIC CODE TC TRIG...

Page 266: ...Appendix H I O Sample Programs 243 ...

Page 267: ...ICALL F E 3 d _ r E U Inpi tS 220 DI P II HlPUT Cm 1PLETE TPH jG Input i Fit i Enter _ qpi o_ i nt 26 J OUF CE OURCE E r C t t i OJ J FltJt t t t Er r cij _E j t I f t C CE 29 1 3 Xi 310 i 36l1 f 2 3 i SOURCE Select code BS OURCE i 5 CHJRCE Cr EQU l3 SOURCE Lf EQU 10 QURCE En i 1 E f 5k EOU 0 m SCiURC E 30URCE 30URCE OUF CE F CiiJT H1E TO HjF UT i i n If c IHTEPFACE U3ING IHTERRUPT RESERVED TO HOL...

Page 268: ...Er r 0t e i i CIi JRCE P r ri tr Tf OURCE F e id e iJ 1t LDf1 t r i 1 i SOUPCE LDB Parm str OURCE OUF TE IURCE OUF CE SOUF CE SOURCE OUF CE OURCE SOUF CE OUF CE OURCE OURCE OUPCE OUF CE ET L DA 34B TA F L_I1i i CBL L I1A F 4 LIlA C TA B te pDinter LIlA t to inq i iDA i Hi St r i r CPA 160 SOURCE JMP Terminate SOURCE another STA R7 SOURCE JMP Exit OURCE SOURCE Terminate LDA 0 SOURCE STA R5 OURCE OU...

Page 269: ...E SOUFCE OUF CE OUF CE OUF CE 30UF CE OUPCE 30UPCE OUf CE OUFCE b 1 OUF CE OUF CE LDfi F j ADH 1 TA LDfi TH AND NOW TRIGGER AN END OF LINE BRANCH TO DO THIS THE COPFECT MH3K WC D MUST BE CHLCULHTED BY H COMFUTED SHIFT IN3TRUCTION HND USE MAGIC CODE TO TRIO ER THE EOL BFA0 H RETUPN FROM INTERRUPT BIT MHSK FOF IN3TFUCTION ...

Page 270: ...RCE NHM Uutp t_gpi SOUPCE EXT SOURCE Select code B 1 Oi JRCE i i 1 j 340 SOURCE TO HOLD SELECT CODE RESERVED F 16U CHAR STFING RESERVED TO EXPAND STRING T E i lF n F I F TE i iF FOF I F EQUATES FC CR LF ROUTINE TO TFUT A STFI FOL L OWED BY CR LF TO A GPIO LIKE 37U SOURCE 39U SOURCE OL W CE Oi JFCE 420 3C RCE 46j 470 r II I l i i _ i r 1 r t 01 1 570 Oi iFCE OURCE QUF CE OUFCE Ot RCE OUF CE OUFCE O...

Page 271: ... t i n i TA Ii L DH L f F L m A D LDfl c C PL W A D TCB SIB 4 iBC fl D Pl W H D F I B L Df 1 t i n l L DA En3 b 1 E 1 r i F 5 I t 1A PET USE C FOR THE BYTE POINT8 NOW COM JTE A WOPD POINTER TO WHERE TO PLACE THE L F NOW LOOP TO COpy F1L L BYTES 1 SET UP I F1 CONTROL REGISTERS COI H rr I CHflF l 1 DMAF1 DF1TA F1DDRE S 1 3ET I A jTWARDS ENF1BL E THE CARD TO INTERRUPT 1 GO BACK TO BASIC 1010 102 1 1 ...

Page 272: ...I 1350 I OU CE TA 1 6C 1 I OUPCE L Dfi 1 7 1 I OI JPCE nA 1 3 0 I OUPCE PET 139 1 I30UI CE b1 1 BL 1 400 I OU CE 141 0 ISOUF CE Elm Eo1 m k I T p I t 10 1 I T J Eo 1 m B I Ii I 1 1 fl 9 I I I i IEi 5 35B Oi t PI It _qpi Ct dm L Appendix H I O Sample Programs 249 f1 E TH I t 1A t AND USE MAGIC CODE TO TF IGGEP THE ECrL n Ar 1CH PETUF h FPor 1 I HTEF PUF T BIT MASt FOP INSTRUCTIOH ...

Page 273: ... AND HDlii ES jO I I 1 2E1 1 OTO H i j 230 I r dOi IC lLL F l d _r e u j t Input 4i j DE F HiPUT CCit 1F l E T E TRH G Inpi it l 260 27 j 90 30Ci NAM Enter gpl dff8 SOURCE EXT Get 81ue SOURCE Select code BSS OUF CE Ee OUF CE a E 5 3 SOURCE ilue Error Qvi Isr acc ss F E EV EIi TO i nL Ii EL ECT CODE RESERVED FOR 160 C R STRING RESERVED FOR EXPHNDED STRING l E 1P F OF E F b SOURCE I ROJTINES TO INPU...

Page 274: ...j q f Dr 1 l r jl rI 1 er t L r f i rE l fq L DE c C p i m J 1 Put 1 j e rA r ri LIiFl T rf t i L Ii B P t tr y J t l I i i iE F ET 1 B 1 Appendix H I O Sample Programs 251 CHECK FUP VALID PANGE 1 14 CHECK IT FCiR RANGE SEE IF CARD IS UK FIRST CUPY SELECT CUDE l PA SKIP IF CARD IS OK EU E GIVE EF ROR 164 IF COULDN T GET IT RETPY INITIALIZE DMA REGISTERS i JF CT FCiP C iF D n iFT F IF T Il 1F JT OP...

Page 275: ...L L ItA 3tt j n9 TCA IA 4 L JL m B I F DC B I RIA 2 L DA t r i r LIIB F I rn 1 t y t l Pi t 1 81 UE RET LItA 35B TA 1f fo 35 L ItA 34B 3TA 35 B LDA Dr e F DA 1 TCA ADA t t i 1 1 3TA tI i n i LDA 0 STA J 5 ItItR L Dr I p ADA SAP 3 JSM End isr low I Jt 1F 2 J t 1 Er il Li r _hi 9h I LIlA Pa I iDA 1 lOJ td 1 LIIE 1 E E f1 T1 Ee 1 iI I k L I1B I r p L I1fl 10 3 t HA B I ADE L DA Eo1 ril i k DIJ ICIF T...

Page 276: ...000 250 INTEGER Se lect code 26 DUI Crnd 160 Data 160 a t 160 2 0 I A Et lBLE 2 0 H 1F I iT HPIB ELECT CODE S lE Ct COdE 290 ON KEY 0 GOSUB Output 300 rn KEY 1 Ga UB Enter 3H3 PRHH E O OI JTPUT 1 1 E ITER 2 1 DI p I DLE 0 C OTO 3 0 40 Output Ga UB Linput emd 350 LIt Wi JT ItDATfl TO EHri It LL3 t iL 60 37 1 a3 i i pi t o t i iE e T rnd D a ta F ETUF H 390 Enter GOSUB Linr t_emd 400 rCAlL Hpib ente...

Page 277: ... iF E ET I EL SE GIVE EPROR 501 OI TF t IT H B TE SEE IF DONE WITH STFING DONE SO GO RPC TO BASIC CAL L SETUF ROUTINE IS THERE H DATH PF AMETER NO l EN I D DONE 1 11 II E I F E r 1 H L E TE iE LDA 502 EU3E GIVE EPROR 502 104 i 15C i 60 1 1 0 1 J i 10 30 11 jO 111 1 l12 j 11 0 17 oJ i I 11 30 12 3fi i 1 3 i22 i L DA 0 CLE AP DATH STPING CC0NTER SOUFCE rA IL t i LDH D3 i i ADr 1 1 T i C CBL SOUPCE E...

Page 278: ... VERIFY IT IS A 98 84A INTERFACE LDH SEE IF THERE IS ANYTHING LDA t t 1 4 AND 100B C BL SFC FET 1 OUTPUT IF NOT SKIP MAKE Sl8E I AM ACTI cor 1TROLLEF I IP IF E ELSE GIVE ERROR 500 NOW OUTPUT THE CCMMA OS SEND GJT CMD b fIL t 10T ET 740 SOURCE STAnJS SEQUENCE FOR 98034 C D NOTE THAT THIS SEQUENCE 750 SOURCE COULD FORCE THE CARD TO VIOLHTE THE IFC TIME SPECS IF 760 SOURCE THE PJLLOWING CONDITIO 3 E ...

Page 279: ...C WCE ISOUPCE I OURCE I OUF CE ISOUF CE I aJUF CE I Ci JF C E I C tJF C t I oUF E ISOUPCE ISOUFCE ISOUF CE I CIi mCE CPA 6UB Jt 1P 3 L IIA 1 E F C DIP FC LIlA R6 FC L IJi 1 R6 nA i 3 tu 2 3FC LDA P6 r i 1 1 t t i F C LDf i F6 Eli TH St tu 4 FET 1 am Hp ib FOF E At IPL E THE THPE CAF TFUDGE GET THE CAPD INTO IT S STHTUS SEQUE E MAKE SURE IT IS A 98f 134 llE IF HOT C II E ERPOP 164 THIS 13 THE CRITI...

Page 280: ...E E01 m t k SET Eol ma k 2 EOl BRAHCHES 320 I30URCE Ct EQU 13 OTHER EQUATE3 330 I30URCE If EQU 10 340 I30UPCE 3tring BSS 20 AREA TO HOLD TIME OF DAY 356 ISOURCE Oi d_pi BSS 1 nom mFm 3 TO HOLD CURREt H 360 ISOU CE Old pi BSS 1 PRHHER IS AND PRINTER L JIDTH 376 I 30URCE 6 3 n i 466 410 420 43 3 440 456 460 476 49 3 506 510 526 546 550 576 5 36 5 30 666 610 I30URCE SUB I DURCE Set up_c 1oc k LDA e 1...

Page 281: ...20 SOURCE 1 210 L l Ji i i j LDH Str i n J FiL ADH 1 BL S3M Printer select TA Ci j LDf i 3t r in E t l Pr nt_ tt i n J n F t lemc L I fi 2 LDB I T i Si J LDH iU3B TA I AllF STfRT INnJT OPEPHTION GET THE NEXT BYTE ELSE PUT CHARACTER INTO STRI0 AND BUMP CCUNT JUMP IFMEMCRY O PR_OW I Gi DRE TOP E F E ET lPR Ir nER I PESTOPE THE A INTEP 1 SIGNAL CAPD THAT WE GOT THE INTEPRL T BY DISABLING AND THEN PE ...

Page 282: ...Appendix H I O Sample Programs 259 i i i 1 11 itJ C F ...

Page 283: ...260 Appendix H I O Sample Programs ...

Page 284: ...Using the Tape To run any of the demonstration programs execute the statement A set of instructions is displayed which can then be followed interactively Typing Aids The starting and final cursor positions of the typing aids were chosen with assembly listings in mind The intent in selecting these positions was to make it easy to enter source as it would appear when listed within an assembly listin...

Page 285: ...LEAR LINE CLEAR LINE CLEAR LINE i i i t E 12 used by other keys 13 L i _ r a followed by next line a 14 Undefined 15 Undefined 16 Undefined 17 18 CLEAR LINE i J a 51 home home home home home 11 30 41 home 53 6 over second quote mark in insert character mode 7 over second quote mark in insert character mode 7 over second quote mark in insert character mode 8 over second quote mark in insert charact...

Page 286: ...mark in insert character mode home current 1 current current home 10 over second quote mark in insert character mode current 4 over second quote mark in insert character mode current 3 current 4 18 over second quote mark in insert character mode home 13 home home home home 6 8 over second quote mark in insert character mode 9 over second quote mark in insert character mode 1 For example in the ins...

Page 287: ...264 Appendix I Demonstration Cartridge ...

Page 288: ...n current program segment Improper return Abnormal program termination no END or STOP statement Improper FOR NEXT matching Undefined function or subroutine Improper parameter matching Improper number of parameters String value required Numeric value required Attempt to redeclare variable Array dimensions not specified Multiple OPTION BASE statement or OPTION BASE statement preceded by variable dec...

Page 289: ...wer LOG or LGT of negative number LOG or LGT of zero SQR of negative number Division by zero or X MOD Y with Y 0 String does not represent valid number or string response when numeric data required Improper argument for NUM CHR or RPT function Referenced line is not IMAGE statement Improper format string Out of DATA EDIT string longer than 160 characters I O function not allowed Function subprogra...

Page 290: ...ifier l i Improper file name Duplicate file name Directory overflow File name is undefined Mass Storage ROM is misSing l Improper file type PhYSical or logical end of file found PhYSical or logical end of record round in random mode Defined record size is too small for data item File is protected or wrong protect code specified 1 l _ l The number of physical records is greater than 32 767 Medium o...

Page 291: ...G list is string but IMAGE specifier is numeric Item in PRINT USING list is numeric but IMAGE specifier is string Numeric field specifier wider than printer width Item in PRINT USING list has no corresponding IMAGE specifier See I O ROM errors Unused 1 1 1 1 1 See Plotter ROM errors Unused See I O ROM errors Unused See Assembly Language ROM errors _ oN ili c octal number octal number This error in...

Page 292: ...ess or controller power off Incorrect device type in mass storage unit specifier Drive missing or power off Disk system error Incorrect unit code in mass storage unit specifier Unused 1 1 Unused Plotter ROM Errors Plotter type specification not recognized 1 I Plotter has not been specified Unused LIMIT specifications out of range 11 4 11 Unused ...

Page 293: ...ction not in ICOM region Label used in an assembled location not found Doubly defined entry point or routine Missing ICOM statement Module not found Errors in assembly Attempt to move or delete module containing an active interrupt service routine Address out of range in IDUMP statement Routine not found Unsatisfied externals Missing COM statement BASIC s common area does not correspond to assembl...

Page 294: ...d label END instruction missing or module name does not match Expression evaluation error Literal pools full or out of range ICOM region overflow Operand out of range Argument declaration pseudo instruction out of sequence Incorrect type of operand used Undefined symbol ...

Page 295: ...272 Appendix J Error Messages ...

Page 296: ...upon response time On Site Service There is no need to package your equipment and return it to HP Fast and efficient modular replacement at your location saves you both time and money A Complete Package A single charge covers labor parts and transportation Regular Maintenance Periodic visits are included per factory recommendations to keep your equipment in optimum operating condition Individualiz...

Page 297: ...EFROST Telex 33569 34164 TeI 7 Alexandra P O Box 58 ZAMBIA 5lll00r Blue Star ltd Cable BASTEL Tel Aviv KOREA Telex 3858 R J Tilbury mbial lid Teachers Union Building 7HnStrell JAPAN Samsung Electronics Co ltd AnaIyticaI edicaI Only P O Box 2792 495 499 BouIK ary Strael P O Box 506 V wa Hewlett Packard lid 15111 Floor Daeyongak Bldg Medical Supplies N l Ltd Telex HPSG RS 21486 Luaak 1 Queensland 40...

Page 298: ...wlett Packard AiS GERMAN FEDERAL REPUBLIC Telex 213405 hewp ir Tel 272093 5 Establishment Branch Tunis SOCIALIST COUNTRIES a Datavej 52 Hewlett Packard GmbH IRELAND Telex 23739 P O Box 2728 Tel 253 821 NOT SHOWN PLEASE DK 3460 Birkerocl Vertriebszentrale Frankfurt Hewlett Packard ltd Cable GEREP GASA Riyadh Telex 12319 CABAM TN CONTACT Tel 02 816640 Berner StrilSS8 117 King Street lane Cogedir Tel...

Page 299: ......

Page 300: ...ng elements from retrieving substrings from system information about 122 109 113 124 129 115 118 121 113 Assembled location 225 Assembled location definition 4 Assembling process 60 error 194 Assembly Development ROM 261 Execution ROM 261 Language ROMs 268 conditional definition 4 Asynchronous access 142 b BASIC General 8 9 11 12 122 174 assembly language extensions 13 assembly source entry 14 bra...

Page 301: ...221 222 CMB 0 41 208 221 222 CMX 45 86 208 221 222 CMY 46 86 208 221 222 COM pseudo instruction 59 128 129 195 196 224 statement 115 128 195 267 270 CONTINUE key 111 171 175 COS function 101 CPA CPB 0 Clock times Code 37 208 221 222 37 208 221 222 221 object 5 7 8 9 14 60 68 source 5 60 189 Commands AUTO 0 11 14 EDIT 0 0 0 11 11 14 14 53 REN 0 266 SCRATCH A 21 143 159 162 194 SCRATCH C 21 193 Comm...

Page 302: ...ility 81 186 191 Errors assembly language 270 270 assembly time 190 Index 279 files 267 mass storage 269 269 messages General 265 assembly time 193 271 run time 193 processing 189 run time 190 syntax time 189 Exclamation point 53 Expressions General 75 196 absolute defined 75 external 196 octal defined 5 relocatable 196 relocatable defined 75 type of result 76 Extend flag 35 38 39 145 180 186 207 ...

Page 303: ...42 146 Test Alter Branch 38 Test Branch 37 h HED 64 65 224 HEX declaration 182 I I O ROM 268 bus 47 bus cycles 25 33 187 group 47 interrupt 133 138 operations relation to busy bits 130 programmed 133 138 registers 26 26 70 187 231 sample programs 237 IADR 16 101 169 184 185 226 IASSEMBLE 12 16 20 60 62 65 190 194 226 IASSEMBLE ALL 60 IBREAK 16 169 174 179 181 186 193 227 270 IBREAK ALL 169 178 227...

Page 304: ...9 OIR 47 156 209 OMA 47 149 209 DRS 45 209 OSZ 38 209 EIR 47 156 209 EQU 4 225 EXE 47 210 FOV 46 94 210 FMP 46 90 91 92 210 FXA 46 87 89 90 210 lOR 41 210 ISZ 38 211 Index 281 JMP 36 211 JSM 36 79 211 214 LOA 34 211 213 LOB 34 211 MLY 45 211 MPY 35 212 MRX 44 87 89 91 212 MRY 45 87 89 91 92 212 MWA 46 90 213 NOP 47 213 NRM 45 89 213 PBC 43 213 PBO 43 213 PWC 43 213 PWO 43 213 RAL 40 213 RAR 40 213...

Page 305: ...errors in 194 ANY 128 linkage 141 152 BSS 56 57 75 reserved symb 231 COM 59 128 129 195 196 reserved symbols 69 DAT 57 state in 145 END 5 11 17 55 59 195 271 Interrupts ENT 77 78 194 General 209 221 EQU 59 75 197 execution time 221 EXE 196 lockout time 221 EXT 59 77 78 80 195 197 related machine instructions 47 HED 64 65 Isr_access utility 81 143 149 IFA 66 IFB 66 IFC 66 IFD 66 IFE 66 IFF 66 IFG 6...

Page 306: ...91 92 212 221 222 MWA 46 90 213 221 222 Machine address 78 Machine architecture 25 26 Machine code 33 Maintenance agreements 273 Mantissa shifting 44 45 Manual Assembly Language Quick Reference 2 Interfacing Concepts 134 135 136 Mass Storage Techniques 5 17 228 229 Operating and Programming 17 21 228 229 structure 2 Mass storage General 8 22 53 56 156 Descriptor MSD 157 160 161 163 ROM 269 Transfe...

Page 307: ...F INT 16 156 191 Print_string utility 81 167 ON ERROR 191 192 Printer_select utility 81 166 ON INT 16 150 Priorities for select codes 140 ON declarations 267 Processors OPRM file type 19 22 23 Binary Processor Chip BPC 25 26 OPTION BASE 265 Extended Math Chip EMC 25 OR 101 General 142 Object Input Output Controller lOC 25 26 code 7 8 9 14 60 68 bus 25 modules 8 instructions 25 modules defined 5 Pr...

Page 308: ...CH A 21 143 159 162 194 installation 3 SCRATCH C 21 193 requirements of other 20 SDC 46 216 221 222 RPT 266 SDI 47 148 149 216 221 222 RUN SDO 47 148 149 216 222 command 20 SDP 221 key 20 111 SDS 46 85 216 221 222 RZA 37 215 221 222 SEC 39 216 221 222 RZB 37 215 221 222 SES 39 217 221 222 Registers SET 71 72 75 197 General 26 33 37 38 40 44 48 70 135 SFC 47 137 217 221 222 180 207 208 221 231 SFS ...

Page 309: ...R 265 GET 53 177 268 IASSEMBLE 12 16 20 60 62 65 190 194 226 IASSEMBLE ALL 60 IBREAK 16 169 174 179 181 186 193 227 270 IBREAK ALL 169 178 227 IBREAK DATA 169 177 179 180 193 227 ICALL 12 16 18 19 107 108 115 117 123 131 172 227 ICHANGE 16 169 187 227 ICOM 12 16 18 19 21 23 193 196 227 270 271 IDELETE 16 18 22 227 IDELETE ALL 227 IDUMP 16 169 181 186 194 228 270 ILOAD 14 16 18 20 22 55 171 194 228...

Page 310: ...t elem bytes 81 116 120 128 Get element 81 116 118 121 128 Get file info 81 164 Get info 81 114 118 121 123 128 Get value 81 116 117 118 119 128 Int to reI 81 104 Isr acCess 1 81 143 149 Index 287 Mm read start 81 156 157 158 159 Mm read xfer 81 156 157 158 159 Mm write start 81 156 160 161 Mm write test 81 156 160 161 Print string 81 167 Printer select 81 166 Put bytes 81 122 124 125 128 Put elem...

Page 311: ...sed in preparing updates to the publica tions Please complete the questionnaire fold it up and return it to us Feel free to mark more than one box to a question and to make any additional comments If you prefer not to give us your name just leave the last part name and ad dress blank All comments and sugges tions become the property of HP ...

Page 312: ...ducation 0 General Computation and Data AnalysiS 0 Data Acquisition and Control 0 Engineering 0 Medicine What kind What kind 0 Interfacing 0 Other Please name 4 What best describes your level of involvement with the eqUipment 0 Run programs written by others 0 Write complex programs 0 Write simple programs 0 Hobbyist 0 Do simple calculations 0 Other 0 Do applications programming 5 What type of bin...

Page 313: ...P NECESSARY IF MAILED IN THE UNITED STATES POSTAGE WILL BE PAID BY HEWLETT PACKARD COMPANY DESKTOP COMPUTER DIVISION 3404 EAST HARMONY ROAD FORT COLLINS COLORADO 80525 A TN CO l OLLEq DOCUME JTATION FIRST CLASS PERMIT NO 37 LOVELAND COLO ...

Page 314: ...bly Attempt to move or delete module containing an active interrupt service routine Address out of range in IDUMP statement Routine not found Unsatisfied externals Missing COM statement BASIC s common area does not correspond to assembly module requirements Insufficient number of BASIC COM items Assembly Time Errors Doubly defined label END instruction missing or module name does not match Express...

Page 315: ...Part No 09835 90083 Microfiche No 09835 99083 HEWLETTjfPACKARD Printed in U S A February I 1979 0 o 3 ...

Reviews: