Home

MCS-86 Assembly Language Converter Operating

image

Contents

1. 0 4 5 8007 5 e 30 SUB C P DEFINE 1 151 ITEXT 31 CPI 1 SIF CILENIA LIST EQ 3 THEN i 32 JNZ 5013 SDEF INE 112 33 NOPE MVI ALO MACRO 34 RET 35 MATCH MVI 1 SWHILE D QENLII LIST 3 4 35 RET IDEFFNS 1143U8STRI1 LIST 1 1 37 END LIST I ASUBSTRE VE IST 2 9999 33 e i 2 e 503 3 RES POINTS TU TABLE SIART 5 50 15 IF RES 1 THEN B REG INDEX 27 3 AR3 IN TABLE 10 254 5 rj IF A RES 2 THEN SEARCH ARGUMENT NOT FOUND 1 ORS 19994 3 BCRG gt MON 25 9 SET LOWER INDEX LIMIT TO 9 2 EE MOV AL DH ADD LOWER UPPER INDEX LIMITS 12 ADD A5 65 DIVIDE BY 2 TO 537 e 11 RoR MIDWAY IN RANGE 12 40V TH AU SAVE INDEX OF MIDDLE IN B 13 ADD A B ADO START ADDRESS OF TABLE 13 SHORT 1 NO CARRY TO SKIP H 1 INC 84 5 MON Bap AL RESTORE VOW POINT TO MID TABLE 7 MOV 4 841 2040 CHAR FROM TABLE 13 CMP AL Du SAME AS SEARCH ARI 13 JB SHORT 0 NO SOJGHT CHAR IS GREATER e 2 22 SHORT MATIH_ iYZS AATCH FOUND 21 MOV DH CH iNO SOUGHT CHAR 15 855 22 JM SAORI a2 e 23 ads 2 CH CURRENT INDEX BECOMES LOWER INDEX 24 E 404 Au BG RESET 4 TO START 23 348 A CH DE TABLE 25 Jag SdORT 2 3 242 CARRY TO SKIP 4 27 042 23 223 3 AL RESET e 23 A DH LIMITS DIFFER 37 1 33 5 8 31
2. od ux P PERDRE EM PRSE 2 5 CHAPTER 3 EDITING CONVERTER OUTPUT Interpreting the PRINT 3 1 8086 Checklist 3 2 Initializing Registers 3 2 Absolute Addressing 3 2 Relative Addressing 3 2 IDier TUIS oe ora me Dee 3 3 PL M 86 Linkage Conventions 3 6 Case 1 When PL M Calls 3 6 Case 2 When Your Converted Program Calls 3 7 Caution Messages o we ke E G 3 7 Caution Message Descriptions 3 9 APPENDIX A INSTRUCTION MAPPING APPENDIX B CONVERSION OF EXPRESSIONS IN CONTEXT APPENDIX C ASSEMBLER DIRECTIVES MAPPING APPENDIX D RESERVED NAMES APPENDIX E MACRO CONSTRUCT CONVERSION APPENDIX F SAMPLE CONVERSION AND LISTINGS APPENDIX G RELOCATION AND LINKAGE ERRORS AND WARNINGS INDEX TITLE PAGE 1 8080 8086 Flag Correspondence 1 9 2 Flag Settings That Change If APPROX Is Specified 1 12 1 3 CONV86 Output Files 1 13 2 1 CONV86 Controls and Defaults 2 1 2 2 File Types and File Names in CONV86 Fatal I O Errors 2 6 FIGURE TITLE PAGE 1 1 From 8080 8085 Assembly Language Source File to 8086 Execution 1 2 1 2 CONV86 Input and Output Files 1 2 1 3 Sample PRINT Fi
3. Au 32 INZ E iDIFfZRENCZ SO RIPIAT TABLES 3JBDOIVISION 33 422 zi 494 1243 SREZIJA3 AS I 2 NOT FOJND 34 ast 35 MOY K SRETJA4 A3 1 FOUND 35 RST 37 A85_ ENDS END 33 The CONV86 PRINT listing ends with a count of the number of caution messages generated including multiple occurrences of the same caution CAJTION 5 nd an end of conversion message END 4543 5 35 CONIZRSION The source and converted files are listed separately Each line in the converted listing is numbered the same as the source line from which it was derived This means that The standard prologue whether resulting from the REL or ABS control has no line numbers Ifthe same input line is converted to several output lines each output line has the same number as the input line Embedded caution messages are generated only the 8086 code for the PRINT file and immediately follow the lines to which they apply The only exception to this is Caution Message 10 which applies to symbols defined In included filas Caution Message No 10 appears at the end of the 8086 PRINT listing Caution messages do not appear in the OUTPUT file Figure 3 1 Annotated PRINT File 3 1 Editing Converter Output 3 2 8086 Checklist Caution messages and the modifications they may require are described later in this chapter This section provides a list of items that you should check yourself 1 Init
4. 36 SYMBOLIC EXPRESSION MAY BE CONTEXTUALLY INVALID FOR ASM86 symbolic expression has been encountered in a context in which the 8086 assembler allows expressions containing only two type of operands a Numeric constants and b Macro symbols preceded or followed by a that evaluate to numeric constants If the expression contains symbols which do not conform to b above they must be replaced by their numeric values or redefined via the SET macro Following are instruction mappings from 8080 8085 to 8086 assembly language Operands are mapped according to Appendix B Operand designations are as follows ib byte immediate mn near memory iw word immediate rb byte register mb byte memory rw word register mw word memory Similarly ib refers to the mapping of ib iw refers to the mapping of iw and so on Thus if B rb then rb CH But if B rw thenrw CX Constructs of the form L__n are generated internally by CONV86 for use as labels in mappings of conditional CALLs conditional RETurns conditional JMPs wem oe aan aa CRIER rb AND AL rb ANI rb AND AL ib CALL mn CALL mn CC mn JNBSHORTL n L_n inserted as label for CALL mn instruction following CALL JNSSHORTL n L inserted as label for CALL mn instruction following CALL CNC mn JNAE SHORTL n L n inserted as lab
5. 1 18 HARA AE RR REAR AR EERE NEHER EER EER REREAD ERED 19 A PW M callable subroutines 20 CALL SORTI A1 N 21 Sorts the array 1 containing N words 22 At entry BC points to the array Ai and 23 DE points to N Two pointers to elements are 24 ineremented two Loops The outer loop steps DE 25 through the elements of Ai The inner Loop steps 26 HL through the elements of that follow DE At 27 each step of the inner Loop the items at HL and DE 28 s are exchanged if required so that at the end of 29 gt the inner Loop the item at DE is Larger tha all 30 the items that follow it The item at DE is then in 31 its proper position so DE is inzremented to 32 complete one iteration of the outer loop 33 QERRRRRRAGRRERRERERERRRRRRERERERERRARRRRRERRERAERRRARRRRRRRERRRSRAAE 34 Data area follows ons 35 ABS 9 ENDS 36 DATA SEGMENT WORD PUBLIC 0000 12 37 TEST_ DB 2 DUP 17 2 38 Begin code area 39 ENDS 50 CODE SEGMENT WORD PUBLIC CODE 44 PUBLIC SORT 42 43 Test address of the Last element of Ai 0000 44 SORT 0000 5B 45 BX s CODE INSERTED TO 0001 59 46 POP 3 228 RETRIEVE PL M 86 0002 5 17 DX 3 STACK PARAMETERS Figure F 3A MCS 86 Macro Assembler Listing of Conversion of 8080 Sort Routine F 9 Sample Conversion amp Listings CONV86 M 5 86 MACRO ASSEMBLER SORT80 LOC OBJ LINE
6. 86 5 80 ASM86 CONVERTER 10 2 11 each step oft 12 are exchanged 13 the inner Loop 14 the items that 15 H 16 17 s 18 Data area fo 19 ABS 0 ENDS 19 DATA SEGMENT 20 TEST_ DB 21 Begin code 22 DATA ENDS 22 CODE SEGMENT 23 PUBLIC 25 DEFINE SWAP H theough the elements of that follow DE At he inner Loop the items at HL and DE if required so that at the end of the item at DE is Larger tha all follow it The item at DE is then in Llows WORD PUBLIC DATA 2 DUP 7 area WORD PUBLIC CODE SORT 4 its proper position so DE is incremented to complete one iteration of the outer Loop BRRRERRRRERRRRRRRRRRAREDRRARRRRRARSERSRRBRARRRRARRRRRERRERERARSA 25 This macro swaps two bytes pointed to by HL and DE 26 MOV 26 005 27 MOV 28 MOV 29 XCHG 30 MOV 31 XCHS 32 33 Test address 34 SORT XCHG 35 MOV 36 LAHE 36 INC 36 SAHF 37 MOV 38 XCHG 39 AHF 39 DEC 39 SAHF 40 40 ADD 40 RCR 40 SAB 50 41 L AHF Y 1 ADD 41 RCR 41 SAHF 51 RCL 42 MOV 13 2 OUTER L00P z 44 MOV 45 MOV 46 OUTTST MOV 47 SUB 48 MOV 49 SBB 50 JNB 50 RET Figure 2 86 PRINT File Conversion of 8080 Sort Routine F 6 SI DX DSxM SI CL MIBX Mi Ai BX DX Mi BX CL BX DX of the last element of BX DX D M BX BX DH M BX BX DX BX BX BX SI 1 SI 1 BX CX SI 1 51 1 WORD PTRITEST_ B
7. BH L gt BL Operand mb M gt M BX Context rw Operand rw B gt CX D gt DX H gt BX SP gt SP PSW gt AX 86 This shows how 8080 8085 assembler directives are converted by 86 into 8086 assembler directives Expression mapping is described in Appendix B Context symbols for instance and so on used as directive operands are mapped according to Appendix B certain cases EQU macro call and SET it is possible to determine that assignment is being made to a byte or word register In such cases the appropriate rb or rw expression conversion is performed The STKLN expression is converted in the prologue see Chapter 1 Functional Mapping Table 1 Assembler Directives Mapping 8080 8085 8086 ASEG prev seg ENDS ABS 0 SEGMENT BYTE ATO prev seg ENDS CODE SEGMENT WORD PUBLIC CODE Deo DB prev seg ENDS DATA SEGMENT WORD PUBLIC DW expr list prev seg ENDS END mn wem o _ PUBLIC name list PUBLIC name list STKLN expr a SET b deleted If the REL control a default is used STKLN converts to informa tion in the prologue Refer to Chapter 1 Functional Mapping SET a b If the symbol being defined is never setto a non constant PURGE If the symbol being defined is ever _ b set to a non constant and the
8. CURRENT SEGMENT UNKNOWN CANNOT GENERATE ENDS SYMBOL NAME TOO LONG CONDITIONAL ASSEMBLY GENERATED UNKNOWN INSTRUCTION ASSUMED TO BE MACRO GENERATED LABEL MIGHT NEED DECLARED LOCAL NO COND CONTROL DELETED NO MACRODEBUG CONTROL DELETED METACHARACTER OR PARENTHESIS FOUND IN IRPC STRING EXPRESSION ASSUMED TO BE A CONSTANT SYMBOLIC EXPRESSION MAY BE CONTEXTUALLY INVALID FOR ASM86 86 Editing Converter Output Caution Message Descriptions 1 REGISTER USED IN WORD CONTEXT VERSA register variable defined in an EQU directive or as macro parameter has been classed as BYTE or WORD according to its predominant usage In this statement the register variable appears in the opposite context This is unacceptable for the 8086 since byte and word register mnemonics are dif ferent You should insert the appropriate register mnemonic 8080 REGISTER MNEMONIC APPEARING IN IRPC STRING The parameter of this IRPC directive is used in a register context Since 8086 register mnemonics are two characters long you should change the IRPC direc tive possibly to an equivalent IRP MACRO PARAMETER BOTH CONCATENATED AND USED AS PARAMETER One of the arguments of this macro is both concatenated and used as a register You may need to manually convert the mnemonics yourself EXPANDED NAME MAY BE RESERVED WHEN CONCATENATED One of the arguments of this macro is concatenated You should examine the r
9. How Are 8080 8085 Assembler Directives Mapped into 8086 Assembler Directives 1 10 How Are 8080 8085 Assembler Controls Mapped 1 10 How Does CON V86 Handle 8086 Reserved Names syz aus D 1 10 Functional Equivalence 1 11 What Is Functional Equivalence 1 11 What About Program Execution Time 1 11 What Happens to Software Timing Delays in CONVeIsion coo sss aan 1 11 Does the 8086 Code Produced Set Flags Exactly ason the 30807 irre 1 11 How Does the EXACT Control Preserve Flag Semantics use ea 1 12 Editing CONV86 Output for 8086 Assembly 1 13 What Output Files Does CONV86 Create 1 13 What Are Caution Messages 1 13 Does a Caution Message Necessarily Mean a Manual Edit 1 13 Do Caution Messages Identify Manual Editing 1 13 CONTENTS CHAPTER 2 PAGE OPERATING THE CONVERTER Source File Requirements 2 1 CONV86 Controls and Defaults 2 1 EXamplES ser E Pu P PRAE Mae s 2 3 Example 1 Full Default Saves Flags and Belocatabilii secet Sv eR ves it 2 3 Example 2 Absolute Code with No Flags Saved 2 4 Example 3 Absolute Code with Flags Saved 2 4 Example 4 Relocatable Code with No Flags Saved 2 4 Example 5 Prompting and Continuation Lines 2 5 Example 6 Overriding Controls 2 5 Console
10. 8080 8086 differences 1 12 functional equivalence 1 11 functional mapping 1 6 INCLUDED control CONV 86 2 3 instruction mapping A 1 instruction queue 8086 1 11 interrupts 3 3 label insertion by CONV86 3 2 1 label insertion by user 3 3 macro call 1 3 macro conversion 1 3 1 macro definition 1 3 MACROFILE control ASM80 1 10 manual editing 1 3 1 13 3 1 F 1 MODSS control ASMS80 1 10 INDEX NOMACROFILE control ASM80 1 10 NOOUTPUT control CONV 86 2 2 NOPAGING control CONV86 2 2 NOPRINT control CONV 86 2 2 NOSOURCELIST control 86 1 1 2 3 NOTINCLUDED control CONV86 2 3 operand mapping 1 OUTPUT control 86 2 2 overriding controls CONV 86 2 5 overriding symbol types 1 10 3 9 3 10 3 11 PAGELENGTH control CONV86 2 2 PAGEWIDTH control CONV 86 2 2 pipeline 8086 1 11 PL M linkage conventions 8080 amp 8086 3 6 PL M parameter passing 8080 amp 8086 3 6 PRINT control CONV 86 2 2 PRINT file sample 1 4 3 1 program listings 1 5 F 2 F 5 F 9 F 12 prologues 8086 1 6 prompting 2 5 register initialization 8086 3 2 register mapping 1 8 REL control CONV86 1 6 2 3 3 2 3 11 relative addressing 3 2 relocation amp linkage 8086 errors warnings 1 6 1 requirements for conversion 1 1 1 3 3 1 reserved names 1 10 D 1 SOURCELIST control CONV86 1 1 2 3 stack 86 handling of 1 8 st
11. ASSUME is needed since this routine 18 doesn t reference DATA segment 19 ASSUME CS CGROUP 20 CODE SEGMENT PUBLIC CODE 21 PUBLIC SORT 0000 22 SORT PROC NEAR 00087 23 ADDR 1 EQU WORD PTR IBP 5 first parameter 0004 24 ADDR_N EQU WORD PTR BP second parameter 9000 55 25 PUSH 3 use BP to accesss parameters 0001 8BEC 26 MOV BP SP 0003 887606 21 MOV SI ADDR_A1 28 s Outer Loopy DO SI Ai BY 2 WHILE SI lt CX 0006 8B5E04 29 MOV BX ADDR_N 0009 8BOF 30 MOV CX BX CX 000 03 9 31 ADD CX CX 2 000D 03CE 32 ADD CX SI Ai 000F 33 OUTTST 9000F 3BF1 34 CMP SI CX IF SI gt CX THEN RETURN 0011 731B 35 JAE 36 z Inner Loop DO DI SI 2 WHILE DI lt CX 0013 8DTC02 37 LEA DI SI 2 DI SI 2 0016 38 INTST 0016 3BF9 39 DI CX IF DI gt CX 0018 730F 40 JAE OUTINC THEN exit inner Loop 001A 8BO4 41 MOV AX 251 IF 51 un 25 AX 3DI lt AT DI 001 7304 43 JNB ININC 0020 8705 44 XCHG DI THEN EXCHANGE A1 01 0022 8904 45 MOV LSI AX WITH 1 51 0024 46 NINC 0024 83 702 47 ADD DI 2 0027 EBED 48 JMP INTST 0029 4g OUTINC Figure F 4A MCS 86 Macro Assembler Listing of Originally Coded 8086 Sort Routine 86 Sample Conversion amp Listings 5 86 MACRO ASSEMBLER SORT36 400 OBJ LINE SOURCE 0029 83 702 50 ADD DI 2 002 1 51 OUTTST 002 52 EXIT2X 0025 5D 53 POP BP 0028 C20400 54 4 55 S
12. OF BINARY RESULT ORG MOV AND MOV MON AND ROL ADD RO ADD ENDS END LOW NIBBLE OF C 12 39 IS 49994 AL C AL ofd DL A Ns CH AL OFH DH AG 85 1 AL 1 DH A51 UB BCDBIN QO G OVI 4 GQ IV M QO OU Ew IN ID BJ IV IV I ERRORS FOUND BCDMCS V2 0 ASSEMBLY IE 4207 85 BCDMCS SER BCDACS 98J F1 BCDACS 536 PRINrT rF1 BCDACS 35 MB F1 35 LINE 83036 ASSUME 25 485 2 03 48 SEGMENT BYTE AT D ORG 49224 THIS ROUTING ASSJMES TEN 3 JNIT 2 ROUTIdZ PACES BINARI 4OV AND 27274 AAD 5495 ZNO 5 2 ON 22 99 hg O d Go ur Eas ly AL lt ERRORS FOJND B AND ASSUMED TO BE LEFT IN ACCUMULATOR COLLINS VOW NIBBLE OF B RES RES TRRSLEVANT 2041145 DIGIT GARBAGE TO ACC MASK OUT GARBAGE SAVE UNIT S DIGIT IN E 3 TEN S DIGIT k GARBAGE MASK OUT SARBAGE 25 TEN S DIGIT IN D z 2 S U TEN S 1 04 1 00 5 TEN S 10 TEN S 1O4TEN S UNIT S BIN REP IN ACC 1188 6 NIBBLE IN Figure 1 4 Program Listings Original 8080 top Converted 8080 middle Original 8086 bottom Overview of Conversion 1 6 Functional Mapping What Are the 8086 Assembly Language Prologues Generated by CONV86 The mai
13. SET is not self relative Ty e eS T EQU If the symbol being defined is ever PURGE a set to a non constant and the set a EQU T_a is self relative e g X SET X 5 PURGE T__a APPENDIX C ASSEMBLER DIRECTIVES MAPPING 1 Assembler Directives Mapping CONV86 Table C 1 Assembler Directives Mapping Cont d 8080 8085 DEFINE a b All local labels for the macro c LOCAL c are moved to the local list in the macro definition with blanks replacing commas LOCAL statements disappear The word LOCAL is not produced if there are no local labels The parentheses around b are omitted when the parameter list is null If this directive closes a macro If this directive closes a REPT IRP or IRPC definition mcall b mcall b The parentheses omitted when the parameter list is null 9e ARP a b c 9e local labels for the macro c are moved to the local list in is macro definition with blanks replacing commas LOCAL statements disappear IRPC a b 9eIRPC a b c 9e local labels for the macro c are moved to the local list in the macro definition with blanks replacing commas LOCAL statements disappear REPTta c All local labels for the macro c are moved to the local list in the macro definition with blanks replacing
14. WORD XLAT The names CGROUP CODE CONST DATA and DGROUP are reserved by CONVS6 to set up PL M 86 environment The assembler reserved symbols and SEG are not permitted as user mnemonics APPENDIX MACRO CONSTRUCT CONVERSION macro definitions and calls will be translated to their 8086 macro processing language equivalents However macro related constructs require special conversion The following 8080 8085 macro constructs are converted to their 8086 equivalent as shown Table E 1 Macro Construct Conversion 8080 8086 CONSTRUCT EQUIVALENT NOTES Within macro definition body 261 When quoted or within a list or IRPC string NUL operand EQS operand 960 Within any expression lt list gt list Within any macro argument field but lt gt is stripped when Surrounding an IRPC string KU Within lt gt or in macro call parameter macro definition IF expression or body or SET body 261 Within lt gt or in macro call parameter macro definition IF expression or body or SET body expression expression Within macro argument field symbol symbol When symbol is a macro parameter and is being passed to another macro in an argu ment field that does not use symbol symbol When symbol is a parameter or local symbol in a macro definition a macro itself or defined with directive Within quotes when not causing concatenation Concatenation
15. and calls will be converted to their 8086 equivalents However macro related constructs require special conversion Appendix E lists all of these constructs and shows how they are mapped NOTE ASM86 may misinterpret metacharacters or unmatched parentheses appearing in comments as macro invocations What Hardware Software Is Needed for Conversion You need an Intellec microcomputer development system with 64K bytes of RAM and at least one diskette unit The CONV86 program occupies a single diskette and runs under ISIS II During execution CONV86 creates a work file CONV86 TMP which requires seven bytes for each line of 8080 8085 code processed Upon normal termination CONV86 deletes this temporary file How Much Manual Editing of CONV86 Output Is Necessary Anywhere from none to a considerable amount depending on the nature of the 8080 8085 source file In general the following kinds of source code are better implemented on the 8086 by recoding from scratch in 8086 assembly language rather than by converting from 8080 e Tricky code that modifies itself e Code that uses operation mnemonics as operands for example the instruction MVI C MOV A B the intent of this instruction is to load C with the opcode for MOV A B e Programs relying heavily on the 8085 instructions RIM and SIM Read Set Interrupt Mask should be recoded from scratch in 8086 rather than converted The 8086 has no functional counterparts for these
16. commas LOCAL statements disappear APPENDIX D RESERVED NAMES name appearing in an 8080 8085 expression may have a special 8086 interpreta tion for instance AL or TEST or it may be reserved for segment or group for instance CODE Except for STACK which is converted to STACK__BASE each such name is automatically converted by 86 by appending an underscore to it for instance AL or TEST The 8080 reserved word MEMORY is treated specially The following ASM86 reserved names are modified by CON V86 AAA AAD AAM AAS ABS AH AL ASSUME AT AX BH BL BP BX BYTE CBW CH CL CLC CLD CLI CMPS CODEMARCO COMMON CS CWD CX DAS DD DEC DEFINE DH DIV DL DUP DWORD DX ELSE ELSEIF ENDIF ENDM ENDP ENDS EQS ES ESC EVAL EXIT FAR GES GROUP GTS IDIV IMUL INC INCHAR INT INTO IRET JA JAE JB JBE JCXZ JE JG JGE JL JLE JNA JNAE JNR JNBE JNE JNG JNGE JNL JNLE JNO JNP JNS JO JS LABEL LAHF LDS LEA LEN LENGTH LES LOCK LODS LOOP LOOPE LOOPNE LOOPNZ LOOPZ LTS MASK MATCH METACHAR MODRM MOVS MUL Table D 1 Reserved Names NEAR NEG NES NIL NOSEGFIX NOTHING OFFSET PARA POPF PREFX PROC PROCLEN PIR PURGE PUSHF RCL RCR RECORD RELB RELW REP REPE REPEAT REPNE REPNZ REPZ ROL SAHF SAL SAR SCAS SEG SEGFIX SEGMENT SHORT 5 SIZE SS STD STI STOS STRUC SUBSTR TEST THIS TYPE WHILE WIDTH
17. expression evaluation This section lists all possible caution messages The next section lists caution message descriptions and indicates what manual editing of the output file may be necessary The entire list of caution messages is as follows note that caution messages 9 15 26 and 29 do not exist 1 BYTE REGISTER USED IN WORD CONTEXT OR VICE VERSA 2 8080 REGISTER MNEMONIC APPEARING IN IRPC STRING 3 MACRO PARAMETER BOTH CONCATENATED AND USED AS PARAMETER 4 EXPANDED NAME MAY BE RESERVED WHEN CONCATENATED 5 MACRO PARAMETER USED IN BOTH BYTE AND WORD CONTEXTS 6 EQU D OR SET REGISTER SYMBOL USED IN BOTH BYTE AND WORD CONTEXTS 7 MULTIPLY DEFINED EQU MAY BE ASSIGNED PROPER TYPE 8 UNKNOWN STATEMENT 10 ASSIGNED TO INCLUDED SYMBOL MAY NOT AGREE WITH DEFINITION 11 TRANSLATION OF NOP MAY YIELD DESIRED RESULTS 12 TRANSLATION OF RST MAY NOT YIELD DESIRED RESULTS 13 8085 SPECIFIC INSTRUCTION CANNOT BE TRANSLATED 14 FORWARD REFERENCE A SYMBOL WHICH IS A REGISTER OR BX CANNOT BE CORRECTLY ASSEMBLED Converter Output 86 3 8 16 17 18 19 20 21 22 23 24 25 27 28 30 31 32 33 34 35 36 EXPRESSION ASSUMED TO BE A VARIABLE ADDRESS EXPRESSION MAY BE INVALID FOR 8086 INSTRUCTION AS OPERAND CANNOT BE TRANSLATED REGISTER USED IN UNKNOWN CONTEXT OUTPUT LINE TOO LONG TRUNCATED LABEL ASSUMED TO BE NEAR NOMACROFILE CONTROL DELETED MOD85 CONTROL DELETED SOURCE LINE TOO LONG IGNORED
18. immediate mb byte memory mw word memory mn near memory rb byte register rw word register M is defined to be a byte located at absolute location 0 In contexts 3 and 5 below forward referenced memory items treated as unknown 1 Context ib e ib expr expr Operand iw expr gt LOW expr Operand mn mw mb or unknown If REL control then expr gt LOW DGROUP expr If ABS control then expr gt LOW expr 2 Context iw e Operand ib or iw expr gt expr e Operand mb mw mn or unknown If REL control then expr OFFSET DGROUP expr If ABS control then expr gt OFFSET expr 3 Context mb mb expr gt expr e Operand mn or mw unknown expr gt BYTE PTR expr e Operand ib or iw expr gt M expr 4 Context mn e Operand mn expr gt expr e Operand mb or mw or unknown expr gt NEAR PTR expr e Operand ib or iw expr gt NEAR PTR M expr 5 Context mw e Operand mw expr gt expr e Operand mb or mn unknown expr gt WORD PTR expr e Operand ib or iw expr gt WORD PTR 1 mn mw and mb are illegal in 8080 in this context but give an implicit LOW 2 unknown generates Caution Message 17 1 Conversion of Expressions in Context Context rb Operand rb A gt AL B gt C CL D gt DH gt DL H gt
19. is expected then it was originally expected in B C Therefore the converted assembly language program is accessing the single argument from the 8086 CX register This means that you need to insert the instruction POP CX Retrieve only PL M 86 argument immediately after POP BX the return address in order for the converted 8086 assembly language program to access the single argument as intended e If two arguments are expected then they were originally expected in B C and D E Therefore the converted assembly language program accesses its arguments from the 8086 CX and DX registers Since PL M 86 passes these arguments on the stack in order this means that you need to insert the instructions POP DX Retrieve second PL M 86 argument POP CX Retrieve first PL M 86 argument immediately after POP BX the return address in order for the converted 8086 assembly language program to access the two arguments as intended e If more than two arguments are expected the remainder are in the stack where the converted assembly language program expects them and there is no problem The last two arguments are accessed as described in the preceding paragraph 3 PUSH the return address back on the stack immediately after accessing the arguments as just described If BX was used in Step 1 above to retain the return address then you need to insert the instruction PUSH BX Replace return address on stack immediately following y
20. manuals Each reply will be carefully reviewed by the responsible person vents and suggestions become the property of Intel Corporation POSTAGE NECESSARY IF MAILED IN U S A BUSINESS REPLY MAIL FIRST CLASS PERMIT NO 1040 SANTA CLARA CA POSTAGE WILL BE PAID BY ADDRESSEE Intel Corporation Attn Technical Publications M S 6 2000 3065 Bowers Avenue Santa Clara CA 95051 intel INTEL CORPORATION 3065 Bowers Avenue Santa Clara CA 95051 408 987 8080 Printed in 5
21. original 8080 program used the STKLN directive to set the stack size Otherwise expr is a constant expression or program label that your original 8080 program used to set SP For constants or expressions you should check that these values are really what you want You should check every instance in your program where SP is loaded to ensure that the stack reinitialization has the intended effect in your converted program Absolute Addressing Absolute addresses should be checked for correctness This includes ORGs in the absolute segment LHLD and LDA from a constant location and immediate operations such as LXI whose constant operands represent addresses Remember that 8086 instruction lengths are generally dif ferent from those of their 8080 8085 counterparts Relative Addressing Relative addressing should be checked since the number of bytes between instructions will in general increase in going from 8080 8085 to 8086 In some instances 86 generates and inserts a label of the form L n for a displaced reference as in the following 86 86 Converter Output 8080 Source MCS 86 CONV86 Generated PRINT File In some instances however 86 does not generate such a label as in the following 8080 Source MCS 86 CONV86 Generated PRINT File MOV A C HQ 43 342 2 T oL ADDRESS EXPRESSION a 1011110185 RI Ob
22. subroutine CALS SORTi A1 N Sorts the array Al containing N words At entry BC points to the array 1 and DE points to N Two pointers to elenents of Ai incremented in two loops The outer Loop steps DE through the elements of Al Tne inner loop steps Hu through the elements of 1 that follow DE At each step of the inner loop the items at HL and DE ace exchanged if required so that at the end of the innes loop the item at 05 is Larger tha 311 the items that follow it The iten at 05 is then in its proper position so DE inerenented to complete one iteration of tne outer Loop KE 3355354 Data area follows 4 av de as Ay 4 As da DSEG TEST DS 2 Bezin code area CSEG PUBLIC SORT SWAP MACRO macro swaps two bytes pointed H and DE DAX D MOV C M MOV MA XCHG MOV M C XCHS Test address of tne Last slement of Al SORT ACHS 3 TEST 4 1 2 Ai MOV INX H MOY D M XCHG 3 DCX d E 1 DAD H 2 DAD Al SHLD TEST TEST Figure F 1A 8080 Sort Routine Source File F 2 86 Sample Conversion amp Listings OUTER DO DE Ai TO TEST BY 2 MOV ELC BC CONTAINS MOV D B 097157 DA TEST IF DS gt TEST THEN RETURN SUB TEST 1 5 D RC INNER LOOP DO HL DE 2 TO TEST BY 2 MOV L MOV H D REPT 2 INX 4 ENDM
23. symbol definitions and attributes The maximum nesting level for included files is four How Does CONV86 Handle 8086 Reserved Names Whenever CONV86 encounters an 8086 reserved name such as AL TEST or LOOP in an 8080 8085 source 86 appends underscore to the name thus obtaining AL_ TEST__ or LOOP__ The only exception to this rule is STACK which is converted to STACK__BASE Asa result you don t need to be concerned about any 8086 reserved names that might be hiding in your 8080 8085 source files Appendix D gives a complete list of 8086 reserved names 86 CONV86 Overview of Conversion Functional Equivalence What Is Functional Equivalence The ideal conversion results in total functional equivalence which means that the converted 8086 source file when assembled linked located and run performs the equivalent function of the input 8080 8085 source file 86 cannot infer the intent of your source program While CONV86 cannot usually achieve functional equivalence on a per pro gram basis CONV86 can in almost every instance achieve functional equivalence on a line by line basis This means that CONV86 attempts to map each 8080 8085 instruction directive or control into its 8086 counterpart if it exists Using the instruction mapping of Appendix A the operand expression mapping of Appendix B and the directive mapping of Appendix C CONV86 achieves line by lin
24. 0 CODE CONST DATA STACK MEMORY DGROUP GROUP ABS__0 CODE CONST DATA STACK MEMORY ASSUME DS DGROUP CS CGROUP SS DGROUP CODE SEGMENT WORD PUBLIC CODE CODE ENDS CONST SEGMENT WORD PUBLIC CONST CONST ENDS DATA SEGMENT WORD PUBLIC DATA ENDS STACK SEGMENT WORD STACK STACK DB DUP 86 86 Overview of Conversion STACK_BASE LABEL STACK ENDS MEMORY SEGMENT WORD MEMORY MEMORY MEMORY__ LABEL BYTE MEMORY ENDS ABS 0 SEGMENT BYTEATO M LABEL BYTE 7e DEFINE REPT LOCALS BODY LOCAL MACRO DEFINE MACRO LOCAL 5 96 BODY REPEAT N MACRO DEFINE IRP PARM PLIST LOCALS BODY LOCAL MACRO LIST 95 DEFINE MACRO LOCAL LOCALS BODY DEFINE LIST PLIST IF RLEN LIST EQ 0 THEN DEFINE PARM 0 MACRO ELSE WHILE LEN LIST NE 0 MATCH PARM LIST LIST MACRO Fi DEFINE IRPC PARM TEXT LOCALS BODY LOCAL MACRO LIST DEFINE MACRO LOCAL LOCALS BODY DEFINE LIST TEXT IF YLEN LIST EQ 0 THEN DEFINE PARM 0 ELSE WHILE LEN LIST NE 0 DEFINE PARM SUBSTR LIST 1 1 DEFINE LIST SUBSTR LIST 2 9999 MACRO F1 The statement DB n DUP in the STACK segment only appears when the 8080 source file contains aSTKLN directive In that case n corresponds to the operand of the 8080 STKLN directive These statements help t
25. 080 source file and 8086 source file with embedded cautions are written to the file F1 MYASM LST e The converted file without embedded caution messages is placed in the file F1 MYASM A86 Blanks appear in the title and date fields of page headers e Page lengths default to 60 lines per page e Page widths line lengths default to 120 characters not including carriage return or line feed e Flag setting semantics preserved for all instructions e The prologue generated in the OUTPUT file F1 MYASM A86 will cause the MCS 86 Assembler to generate relocatable object modules suitable for linking with other assemblies or PL M 86 object modules e The temporary workfile CONV86 TMP is created on and deleted from diskette unit 1 the default Example 2 Absolute Code with No Flags Saved If in Example 1 you had entered the command CONV86 F1 MYASM A80 ABS APPROX then the results would differ as follows Full flag setting semantics are not preserved for DAD DCX INX PUSH PSW or POPPSW e A standard 8086 assembly language absolute prologue is generated in the converted code This prologue is not compatible with PL M 86 but is com patible with other 8086 assemblies Your MCS 86 Assembler object file will not be relocatable Example 3 Absolute Code with Flags Saved The invoking command CONV86 F1 MYASM A80 ABS generates an absolute prologue and defaults to EXACT Example 4 Relocatable Code with No F
26. 35 z set DE Previous DE HL 2 Previous HL 136 ININC 137 DEC DX 138 INC BX 139 JMP INTST 140 End of outer Loops Set DE DE 2 141 1 OUTINC 142 2 183 3 144 3 INC DX 145 3 146 3 INC DX 147 3 148 JMP OUTTST 149 CODE ENDS 150 END NO ERRORS FOUND Figure F 3C MCS 86 Macro Assembler Listing of Conversion of 8080 Sort Routine Sample Conversion amp Listings 86 5 85 MACRO ASSEMBLER SORT36 5 5 MCS 36 MACRO ASSEMBLER V2 0 ASSEMBLY Of MODULE 598185 OBJECT MODULE PLACED IN F1 SORT35 0BJ ASSEMBLER INVOKED BY F3 ASM86 F1 SORT35 F 12 OBJ LINE SOURCE 1 LEER FEED ZZ 2 A PL M callable subroutine 3 CALL SORT A1 N Sorts the array 1 containing N words 5 At entry the address of and the address of 1 6 are on the stack Two pointers to elements of 1 T are kept in the SI and DI registers These pointers 8 ineremented in two loops The outer Loop steps 9 SI through the elements of 1 The inner Loop steps 10 through the elements of 1 that follow 51 At each 11 step of the inner loop the item at SI is larger than 12 all the items that follow it The item at SI is then 13 its proper position so SI is ineremented to 14 complete one iteration of the outer Loop 15 ES DEZE DEI ET i 16 CGROUP GROUP CODE 17 No DS
27. 4001 5 3 4003 5F 9 4004 78 10 4005 5 11 4007 57 12 4008 97 13 4099 97 14 400A 32 15 4008 97 15 400C 83 17 13 PUBLIC SYMBOLS EXTERNAL SYMBOLS USER SYMBOLS BCDBIN A 4090 ASSEMBLY COMPLETE NO MCS 86 MACRO ISIS II OBJECT 00 OBJ MCS 86 MACRO ASSEMBLER ISIS II MCS 35 200 OBJ 38 1 25926 052 555 1 10 ASSEMBLER MCS 35 MACRO ASSEMBLER V2 0 ASSEMBLY MODULE ASSEMBLER INVOKED BY ASSEMBLY COMPLETE MACRO ASSE OBJECT MODULE PLACED IN ASSEMBLER INVOKED BY ASM ASSEMBLER V2 0 MODULE PA 2 SOURCE STATEMENT THIS ROUTINE CONVERTS BCD TO BINARY FOLLOWS BCD TEN S DIGIT IN LOW NIBBUc OF REG 3 BCD UNIT S DIGIT LOW NIBBLE OF C RES HIGH NIBBLES Of B AND ASSUMED TO BE IRRELEVANT BINARY RESULT 19 99 IS LEFT IN ACCUMULATOR ORG 4099H BCDBIN MOV A C SUNIT S DIGIT k GARBAGE TO ACC ANT JH sMASK OUT GARBAGE MOV SAVE UNIT S DIGIT IN 100 MOV A B 3TEN S DIGIT amp GARBAGE TO ACC ANT IFA MASK OUT 3ARBASE MOV D A SAVE 15845 DIGIT IN D LOW RUC 2 TEN S RUC s4RTENTS ADD D 5 TEN S RUC 19 TEN S ADD E 10F TEN S UNIT S BIN REP IN ACC END BCDBIN MODULS BCDBIN PLACZO IN PI BCDBIN OBJ ASM85 F1 BCDBIN S36 PRINT F1 BCDBIN 36 LINE SOURCE ASSUME ABS 2 SEGMENT if ABEL DS ABS_ I CS AB3_ BYTE AT 9 BYTE THIS ROJTINE CONVERTS BCD TO BINARY AS BCD TEN S DISIT IN BCD JNIT S DISIT IN HISH NIBBLES
28. BL DE 2 IF HL gt TEST THEN GOTO OUTINC INTST LDA TEST SUB t TEST 1 SBB H JC OUTINC IF 41185 lt A1 DE THEN GOTO ININC a side effect HL and DE are ino emented by 1 to point to the nigh bytes of their array elements SUB M IRPC Z DH INX z ENDM DAX D 588 M INC ININC Figure F 1B 8080 Sort Routine Source File F 3 Sample Conversion amp Listings CONV86 Exchange AIDE with Leave Hz and DE pointing to HIGH bytes SWAP IRP Z lt D H gt DCX 7 53 Put 12 D and H in their plaze ENDM Exchange Low bytes SWAP Point and DE to high bytes 2 04 INX Z ENDM DE an point to HIGH bytes For the next iteration set DS Previous DE HL 2 Previous HL ININC DCX D NX 4 JAP INTs End of outer Loop 525 DE DE 2 OUTING 2 INX D N DM JAP END Figure F 1C 8080 Sort Routine Source File CONV86 ASM30 TO ASM35 CONVERTER ISIS II TO ASM35 CONVERSION Of FILE F1 SORTB0 ASM85 PLACED IN F1 SORTS0 A86 CONVERTER V2 0 INVOKED BY F12CONV85 F1 SORT830 NOSOURCELIST 8086 PROGRAM 1 WO OOo 74 Ov UI EW o WORKFILES F1 F1 NOOBJECT CGROUP GROUP ABS O CODE CONST DATA STACK MEMORY DGROUP GROUP ABS_9 CODE CONST DATA STACK MEMORY ASSUME DS DGROUP CS CGROUP SS2DGROUP CONST SEGMENT WORD PUBLIC CONST CONST ENDS STACK SEGMENT WORD STACK STACK STACK BASE LABEL
29. BLENISHLIST 50 3 OEFINE i 4PARM BMACRO ELSE 1 o AWHILE 1 157 9 SMATCHISZAARM UIST 11 IST MACRO amp FI LADEFINE DIREC 004 51 8007 LOCAL MACRO LIST A DEFIAE amp MACRO LOCAL PLACALS 8007 o LADEFINE 1521517 RIE IALENIAFLIST ZQ Th BDEFINE 1 1 e MACRO WHILE TRLENIS LIST 149484 15SUBSTRL LIST 1 12 1 137 14308STRI IST 2 9293 e BMACRO 1 THIS ROUTINE CONVERTS BCD TO BINARYNAS FOLLOWS 2 BCD TEN S DIGIT IN SOW NIBBLE Of 8 REG e 3 BCD UNIT S DIGIT IN LOW NIBBLE OFLC 823 4 HI3d NIBBLES B AND C ASSUMED TD B RRELSVANS 5 BINARY RESULT 12 99 IS IN ACUMULATOR o 5 ORS 49224 7 BCUBIN MOV 15283 UNII S DIGIT 3 SARBAGE TO ACC 3 AND A MASK OUT SARBARE to Source File Line Numbers 3 407 2a L SAJE UNIT S OIBIT IN E ILOW 19 AO y Au CH 2 TENTS DESIT amp BARBASE TO ACC 11 AND Aa IPH Absolute ABS 5 o 12 MOV DH AL 8086 Segment is S oIG T IN D 1 04 13 40 1 Pseudo 8080 14 RO Au Environment 15 ADO 25475465 15 17 212978585 5 422 IN ACC 13 13 F1 8CDBIN S86 Should Assemble o 540 27 A341 72 45485 09443451004 e Figure 1 3 Sample PRINT File 1 4 CONV86 Overview of Conversion 5 80 F1 BCDBIN S30 ISIS II 8080 8085 MACRO LOC OBJ SEQ 1 2 3 4 5 4000 5 4009 79 l
30. BYTE STACK ENDS MEMORY SEGMENT WORD MEMORY MEMORI MEMORY LABEL MEMORY ENDS ABS 9 SEGMENT BITE AT 0 M LABEL BYTE DEFINE REPT N LOCALS BODY LOCAL MACRO B DEFINE MACRO LOCAL LOCALS 1 4BODY 4N 1 B DEFINE IRP PARM PLIST LOCALS BODY LOCAL MACRO LIST Z DEFINE MACRO LOCAL ZLOCALS BODY DEFINE LIST PLIST L EN LIST EQ 0 THEN 3DEFINE PARM i10 ELSE 1 WHIL E IALENIA LIST NE 0 1 MATCHL PARM LIST 12 15 7 FI oEFINE PARM TEXT LOCALS BODY LOCAL MACRO LIST 0EFINE 1 MACRO LOCAL LOCALS 1 BODY DEFINE IST 12 SIF ISLENIBHLIST EQ 0 THEN BDEFINE PARM 140 ELSE 4 14LENIF LIST NE 0 1 1 IA SUBSTRI 4 LIST 1 1 1DEFINE t IST SUBSTRIS FLIST 2 9999 FI F 43 1111 SER ZI 581 1422 1 255553555555 555552585535 A PL M callable subroutines CALL SORTI A1 N Sorts the array containing N words At entry BC points to the array At and DE points to N Two pointers to elements of Ai are incremented in two Loops The outer loop steps DE through the elements of Ai The inrer loop steps Be 9 Figure F 2A 86 PRINT File Conversion of 8080 Sort Routine Sample Conversion amp Listings Sample Conversion amp Listings
31. EACH AL 86 does not attempt to evaluate the expression or insert a label although Caution Message 17 is issued for a possible displaced reference Thus it is up to you to insert a label At the same time since the jump forward is less than 127 bytes the SHORT label attribute can be used as follows CONV86 OUTPUT File ALCL AL CL 3 3 2 2 7 ME SHORT LASZLO 75h 3 78H 10111101B 10111101E AL LASZLO OT AL Before Your Edit After Your Edit In general you should check all relative addressing 4 Interrupts Figure 3 2 shows how interrupt service routines on the 8080 8085 can be converted to interrupt service routines on the 8086 The principal difference between the two schemes is that on the 8080 8085 con trol traps to location 8 N where executable code resides whereas on the 8086 control traps to the location pointed to by the 16 bit offset and 16 bit base values stored at location 4 N 3 3 Editing Converter Output 86 8080 8085 8086 EXTERNAL INTERRUPT N EXTERNAL INTERRUPTN e BYTES 16 BIT BASE 16 BIT BASE CIIIIII OOUOOPO z eo m eme OOOOOOOO cccccccc DUODUDO DO NNNNNNNN 5 x m SERVICE ROUTINE CONVERTED USER WRITTEN EINTERRUPT SERVICE ROUTINE Figure 3 2 Converting Your Interrupt Pro
32. File 8080 PROGRAM THIS ROUTINE CONVERTS BCD TO BINARY AS FOLLOWS 1 2 BCD TEN S DIGIT LOW NIBBLE OF B REG 3 BCD 9281143 DIGIT IN LOW NIBBLE OF RES 3 4 HISA NIBBLES OF B AND C ASSUMED TO BS IRRELEVANT 2 5 BINARY RESULT 12 99 IS LEFI IN ACCUMULATOR Sel 6 ORG 4900H 28 7 BCDBIN MOV A C UNIT S DIGIT GARBAGE TO ACC 2e 3 ANI MASX OUT GARBASE se 9 MOV amp SAVE UNIT S DIGIT IN 1508 3 19 MOV A B TEN S DIGIT GARBAGE ACC oS 11 ANI JFH MASK OUT SARBASE 5 12 MOV D A SAVE 5 DISIT IN D 1508 58 13 RLC 2 12 4 5 14 RUC U TEN S 8 15 ADD D 558 S 15 RC 212 45 17 ADD 210 845 UNIT S BIN REP IN ACC 13 END These headings identify the source and output program listings in the PRINT file If the NOSOURCELIST control is in effect the source ASM3 5 35 CONVERTER program does not appear in the RINT file 3935 PROGRAM ASSUME DS ABS 2 CS3 ABS3 2 o ABS 2 SEGMENT BYTE 9 M ABE BYTE oOEFINE REPT IN LOCALS LOCAL MACRO e MACRO LOCAL LOCALS 1BODY 4 TIMACRO DEFINE ZIRP PARM P IST LOCALS BODY LOCAL MACRO LIST MACRO LOCA BUOCALS 8007 DEFINE LIST IKPLIST BIE I
33. MCS 86 ASSEMBLY LANGUAGE CONVERTER OPERATING INSTRUCTIONS FOR ISIS II USERS Manual Order No 9800642 02 Copyright 1979 Intel Corporation Intel Corporation 3065 Bowers Avenue Santa Clara California 95051 Additional copies of this manual or other Intel literature may be obtained from Literature Department Intel Corporation 3065 Bowers Avenue Santa Clara CA 95051 The information in this document is subject to change without notice Intel Corporation makes no warranty of any kind with regard to this material including but not limited to the implied warranties of merchantability and fitness for a particular purpose Intel Corporation assumes no responsibility for any errors that may appear in this document Intel Corporation makes no commitment to update nor to keep current the information contained in this document Intel Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in an Intel product No other circuit patent licenses are implied Intel software products are copyrighted by and shall remain the property of Intel Corporation Use duplication or disclosure is subject to restrictions stated in Intel s software license or as defined in ASPR 7 104 9 9 No part of this document may be copied or reproduced in any form or by any means without the prior written consent of Intel Corporation The following are trademarks of Intel Corporation and may be used only to identi
34. MCS 86 Macro Assembly Language This construct is not detected by CONV S86 but it is flagged as an error by 5 86 alerting you about the problem The 8080 8085 assembler control MACROFILE is not converted correctly if its optional argument is not present CONV86 does not issue a caution for this condi tion and ASMS6 processing of the converter output file is terminated by a fatal error BAD WORKFILE COMMAND This problem can be corrected by editing the converter output file or removing the MACROFILE control from the 8080 8085 source file before it is converted 2 OPERATING THE CONVERTER Source File Requirements Before operating the converter program 86 you should ensure that the main source file and all included source files meet the following requirements 1 The source file must be capable of being assembled without errors by the ISIS II 8080 8085 Assembler 2 Diskettes containing files INCLUDEd by the main source file must be mounted on their indicated diskette drives 3 The maximum source line length is 129 characters not including carriage return and line feed characters Longer lines are converted to comments and flagged with a caution message 4 The maximum number of symbols allowed per conversion is approximately 600 Programs having more than 600 symbols must be divided into smaller programs CONV86 Controls and Defaults If the above requirements are met you can invoke the conver
35. ORT ENDP 56 CODE ENDS 57 END ASSEMBLY COMPLETE ERRORS FOUND Figure F 4B MCS 86 Macro Assembler Listing of Originally Coded 8086 Sort Routine F 13 Because of the way 86 sets up multiple segments beginning at absolute location 0 as described in Chapter 1 under Functional Mapping MCS 86 linkage and relocation tools will issue warnings errors as shown in Table G 1 You can safely ignore these warnings errors when they specifically apply to intentional segment overlap Table G 1 MCS 86 Relocation and Linkage Warnings Errors for Segment Overlap WARNING 14 GROUP ENLARGED FILE filename GROUP groupname MCS 86 MODULE modname LINKER WARNING 28 POSSIBLE OVERLAP FILE filename MODULE modname SEGMENT ABS 0 CLASS APPENDIX G RELOCATION AND LINKAGE ERRORS AND WARNINGS ABS control CONV86 1 6 2 3 absolute addressing 3 2 APPROX control CON V86 1 11 2 2 caution messages 1 13 3 7 comments mapping of 1 10 continuation lines in CON V86 command 2 5 in PRINT file 3 1 controls ASM80 mapping C 1 controls 86 2 1 conversions sample 1 3 3 1 F 5 cross development 8080 8085 to 8086 1 2 DATE control CONV86 2 2 directives mapping C 1 displaced reference 3 2 3 3 3 10 EXACT control CONV86 1 12 2 2 expressions conversion of B 1 files 86 1 2 1 13 files cross development 1 2 flags mapping of 1 9 flag semantics
36. SOURCE 0003 53 48 PUSH BX 308 SCHAPTER 3 0904 87DA 49 XCHG BX DX 2 TEST IN 1 2 0006 84970000 R 50 MOV DL M BX 900A 43 51 INC BX 000 8 70000 R 52 MOV DH M BX 000F 87DA 53 XCHG BX DX 2 IN 0011 YB 54 DEC BX 1 0012 03DB 55 ADD BX BX 2 9014 0309 56 ADD BX CX Al 0016 891 0000 R 51 MOV WORD PTRITEST_ BX 2 58 OUTER LOOP DO DE 1 TEST BY 2 001A 8AD1 59 MOV DL Ci BC CONTAINS AI 001C 8AF5 60 MOV DH CH 0918 A00009 R 61 OUTTST MOY An TEST_ IF DE gt TEST THEN RETURN 0021 2AC2 62 SUB Le DS 0923 4001090 R 63 MOV AL TEST_ 1 0026 1465 64 SBB 0028 7301 65 JNB SHORT 2 1 002A C3 65 RET 0028 57 Lots 68 INNER LOOP DO HL DE 2 TO TEST BY 2 69 MOV BL DU 0020 19 MOY BH DH 11 1 12 2 13 3 002F 43 14 3 INC BX 15 3 0030 43 16 3 INC BX IT 3 18 DE 2 13 IF HE gt TEST THEN GOTO OUTINC 0031 400000 R 80 INTST MOV AL TEST_ 9034 2AC3 81 SUB AL Ba 0036 A00100 R 82 MOV n TEST_ 1 0039 1AC7 83 SBB BH 003B 7242 84 JB SHORT OUTINC 85 IF AT HL lt AILDE THEN GOTO ININC 85 As a side effect Hu and DE are incremented by 1 87 point to the nigh bytes of their array elements 003D 8BF2 88 MOV SI DX 003F AC 89 005 DSsM SI 9040 24879000 R 90 SUB AX Mi BX 0044 OF 91 5 The invocation reguires manual editing 0045 42 92 INC DX The LAHF and exact mapping is reguire
37. X DO DE 1 BY 2 DL CL DH CH AL TEST_ AL DL AL TEST_ 1 AL DH SHORT amp 1 1 aa es Ge TEST BC N 1 2 CONTAINS AI DE gt TEST THEN RETURN CONV86 Sample Conversion amp Listings ASM80 TO ASM86 CONVERTER 50 51 52 53 54 55 55 55 56 57 58 59 60 61 62 63 64 65 66 67 67 68 69 L 1 INNER 00Pz DO Hi DE 2 TO TEST BY 2 IF H INTST MOV BL DL MOV BH DH ZREPT 12 131 AHF INC BX SAHE HL DE 2 gt TEST THEN GOTO OUTINC MOV AL TEST_ SUB s BL MOV AL 1 SBB Au BH JB SHORT OUTINC IF A1 HL lt A1IDE THEN GOTO ININC a side effect and DE are incremented by 1 to point to the nigh bytes of array elements CAUTION 002 10 70 10 11 12 12 3 14 15 16 TT 18 19 19 19 80 81 82 83 84 85 MOV SI DX LODS DS MSI SUB AL BX 12 08 3080 REGISTER MNEMONIC APPEARING IN STRING INC 7 MOV SI DX 2005 DS MS SBB AL Mi BX JAE SHORT ININC Exchange AIDE with AIHL Leave HL and DE pointing to HIGH bytes SWAP 1Z IDX BX 121 DEC 2 SAHF Put 12 D and H in their place Exchange Low bytes Point CAUTION 002 86 86 87 88 89 90 90 90 91 91 set DE NINC SSWAP and DE to
38. ack segment 8086 1 7 STKLN directive 8080 1 7 C 1 symbol typing 1 9 timing delays software 1 11 TITLE control CONV86 2 2 WORKFILES control ASM80 1 10 WORKFILES control CONV 86 2 3 Index 1 Notes Notes Notes Notes Notes MCS 86 Assembly Language Conve Operating Instructions for ISIS II Us 980064 REQUEST FOR READER S COMMENTS The Microcomputer Division Technical Publications Department attempts to provide documents that m the needs of all Intel product users This form lets you participate directly in the documentation proces Please restrict your comments to the usability accuracy readability organization and completenes this document 1 Please specify by page any errors you found in this manual 2 Does the document cover the information you expected or required Please make suggestions improvement 3 15 this the right type of document for your needs Is it at the right level What other type documents are needed 4 Did you have any difficulty understanding descriptions or wording Where 5 Pleaserate this document on a scale of 1 to 10 with 10 being the best rating OO TITLE COMPANY NAME DEPARTMENT ADDRESS A s cs ecco oc c STATE ZIPCODE Please check here if you require a written reply LIKE YOUR COMMENTS jocument is one of a series describing Intel products Your comments on the back of this form will us produce better
39. amp DON T NEED FLASS PRESERVED o If NOPAGING has not been requested in the invoking statement each page 8282 PROGRAM begins with a hesding The title and date or blanks printed in the heading are mand The top of the first page shows the name of the ile being converted the mand top o ri 5 name o conve 10 BENARY SEARCH ROUTINE name of the OUTPUT file and the Invoking command 2 z E RES CONTAINS SEARCH ARGUMENT 3 D RES CONTAINS TABLE LENGTH 11 255 4 H REG POINT 8 5 SRESULTS IF A 7 ORG 10028 8 SCRG MYI C 9 3 MOV 4 0 3336 PROGRAM 10 ADD C 11 RAR ASSUME 25 485_ 05 485_ 7 12 MOV 3 A ABS 2 SEGMENT BYTE AT 9 13 ADD M LABEL BYTE 14 INC e IREPT 14 LOCALS BODY LOCAL MACRO 15 INR H ogPINZ MACRO LOCAL 004 5 BODY 15 A 1484 17 MOV A M i DEFINE IRP PARM PLIST LOCALS iBODY MACRO UIST e 18 CMP SPOEFINE LOCAL 0CA S 180DY 19 0 SADEFINE 15 15 92 157 29 92 S LEN VAS IST EQ 9 THEN 21 Mov 2 B 2 1 120 22 JMP MACRO 23 29 MOV 2 56 1 P 24 MOV 1 5 AWHILE 19 646 NE 9 i 25 SUB 8 157 124 157 25 JNC 44 21 DCR H FI 28 MOV L A 2 LOCALS BODY LOCA MACRO LIST i 29 MOV 4 0 P bEFINE
40. ating Instructions for ISIS II Users Order No 9800641 MCS 86 Software Development Utilities Operating Instructions for ISIS II Users Order No 9800639 e 515 1 PL M 86 Compiler Operator s Manual Order No 9800478 Hi CHAPTER 1 PAGE AN OVERVIEW OF CONVERSION Conversion and ev ee 1 1 What Is Conversion 1 1 oi chon ar man SUR ae 1 1 What Preparation Does 86 Require of C ode coss stus uim os 1 1 What About 27 1 3 What Hardware Software Is Needed COP Conversion una 1 3 How Much Manual Editing of CONV86 Output Is Necessary 1 3 What Advantage Is There in Rewriting Programs in 8086 Assembly Language Rather Than Converting ar aca cn conan AR RC 1 3 Functional Mapping 1 6 What Are the 8086 Assembly Language Prologues Generated by CONV86 1 6 What If a Converted Program Exceeds 64 1 7 How Does CONV86 Handle the Stack 1 8 How Are the 8080 8085 Registers Mapped into 8086 Registers 1 8 How Are the 8080 Flags Mapped into 8086 Flags 1 9 How Are the 8080 8085 Instructions Mapped into 8086 Instructions 1 9 How Are 8080 Operands Expressions Converted 8086 Operands Expressions 1 9 How Are Comments Mapped 1 10
41. cedures ABSOLUTE LOCATIONS 00H 7FH ARE INTEL RESERVED USER INITIALIZED OFFSET amp BASE VALUES POINT TO CALLING SEQUENCE USER INSERTED CALLING SEQUENCE INVOKES CONVERTED USER WRITTEN INTERRUPT VECTOR INSTRUCTION SEQUENCE CONVERTED INTERRUPT VECTOR INSTRUCTION SEQUENCE REQUIRES USER INSERTED PROCEDURE DEFINITION 3 4 86 Editing Converter Output You can convert your 8080 interrupt service routines as follows 1 Insert at a convenient place in your 8086 source code the following calling sequence using your own label be sure not to use a reserved name given in Appendix D INTSEQ PUSH ES PUSH DS PUSH PUSH PUSH DX PUSH BX PUSH 5 PUSH DI CALL INTER INTER used here for example in Figure 3 2 POP DI POP SI POP BX POP DX POP CX POP AX POP DS POP ES IRET Note that this is IRET and not 2 Insert the following initialization sequence for absolute location 4 N in the ABS O segment 4 N N is the interrupt number on the 8086 INTSEQ used here for example above DD CGROUP INTSEQ If REL control was used DD INTSEQ ABS control was used 3 Sandwich the converted code from INTER used here for example in Figure 3 2 between PROC and ENDP statements as follows INTER PROC NEAR Nothing special about the word INTER converted code INTER Nothing special about the word INTER While these steps are general enough to cover virtually an
42. characters and has been mapped into a com ment in both 8080 8085 and 8086 output files You can either recode the source line and reconvert the source file using CONV86 you can insert 8086 code in the OUTPUT file to accomplish the intent of the source line Editing Converter Output 25 27 28 30 31 32 33 34 CURRENT SEGMENT UNKNOWN CANNOT GENERATE ENDS An END or SEG directive in 8086 implies a preceding ENDS directive to close the currently open segment This segment is unknown You should insert an ENDS directive of the appropriate type SYMBOL NAME TOO LONG Symbol names in 8086 cannot exceed 31 characters CONDITIONAL ASSEMBLY GENERATED 86 has assumed that it is possible that the operand of this PUSH or POP instruction is the PSW Conditional assembler directives have been generated to take this possibility into account If you know the operand is the PSW you can substitute the appropriate mapping from Appendix A for e POPPSW Using EXACT Control e POPPSW Using APPROX Control e PUSHPSW Using EXACT Control e PUSHPSW Using APPROX Control On the other hand if you know the operand is definitely not the PSW you can substitute the appropriate mapping from Appendix A for e POP rw Using either EXACT or APPROX e PUSH rw Using either EXACT or APPROX If you cannot determine whether the operand is the PSW you should desk check or single step your source program until you are able to make t
43. d 0046 43 93 INC BX 0047 94 0048 2 95 MOY SI DX 96 LODS 5 gt 5 004B 14870000 91 SBB AL M BX 732A 98 JAE SHORT ININC 99 Exchange AIDE with AIHL Leave HL and DE 100 pointing to HIGH bytes 101 1 Figure F 3B MCS 86 Macro Assembler Listing of Conversion of 8080 Sort Routine F 10 86 MCS 86 MACRO ASSEMBLER LOC 0051 0053 0054 0058 005C 005E 0062 0064 9065 0066 0068 9069 006D 0071 0973 0077 0979 4 007A t 007B 007B 007C 007D 007F 00 0080 0081 ASSEMBLY COMPLETE OBJ 8BF2 AC 8 8 0000 88870000 R 87DA 888F0000 R 87DA 4A 4B 8BF2 AC 8 8 0000 88870000 87DA 888F0000 R 87DA 42 IRPC call removed 43 Expanded by hand YA 43 EBB2 42 EB9B Sample Conversion amp Listings SORT80 WINE SOURCE 102 1 MOV SI DX 103 1 005 5 511 104 1 MOV Cu MBX 105 1 MOV MBX Ai 106 1 XCHG BX DX 107 1 MOV MBX CL 198 1 XCHG BX DX 109 1 110 1 111 2 112 2 113 2 114 4 115 4 116 4 117 4 DEC DX 118 4 119 4 120 4 DEC BX 121 3 Exchange Low bytes 122 1 123 1 MOV SI DX 124 1 LODS DS M SI 125 1 MOV 1 BX 126 1 MOV MBX AL 127 1 XCHG BX DX 128 1 MOV CL 129 1 XCHG BX DX 130 1 13 3 Point H and DE to high bytes 132 INC DX 133 INC BX 134 DE point to HIGH bytes For the next iteration 1
44. e source file and must be mapped into 8086 relocation features See Functional Mapping in Chapter 1 specifies that this module is absolute and not relocatable and hence not to be linked to PL M 86 module If ABS and NOTINCLUDED are both in effect NOTINCLUDED 5 a default then the standard logue generated is not compatible with PL M 86 but is compatible with other 8086 assemblies See Functional Mapping in Chapter 1 for description of standard prologues WORKFILES Fn specifies that the single temporary workfile CONV86 TMP is to be created on and subsequently deleted from diskette unit Fn where n defaults to the source file diskette unit number if the WORKFILES con trol is omitted The single workfile created the plural WORKFILES is used for consistency with other programs requires seven 7 bytes for each source line SOURCELIST specifies that the 8080 8085 source program is to be listed in the PRINT file overridden by NOPRINT NOSOURCELIST specifies that the 8080 8085 source program is not to be listed in the PRINT file Examples Example 1 Full Default Saves Flags and Relocatability Suppose 86 resides on diskette unit 0 and that the program to be converted is 2 3 Operating the Converter 86 2 4 named MY ASM A80 and resides on diskette unit 1 Then the command 86 F1 MYASM A80 invokes the converter and results in the following controls e The 8
45. e functional equivalence Problems encountered in achieving program functional equivalence arise from Symbol typing ambiguities overridden symbol types might not yield the desired 8086 source code CONV86 flags potential problems of this sort with caution messages e Machine dependent sequences such as software timing delays or other sequences which depend on instruction length or clock periods What About Program Execution Time The 8086 assembly language instructions produced by CONV86 require in general more clock periods than did the original 8080 8085 instructions Thus the 8086 code produced is less efficient in terms of instruction cycles However since the 8086 can be driven by a faster clock this loss of instruction cycle efficiency is offset What Happens to Software Timing Delays in Conversion You should examine the 8086 code derived from timing delay loops Then taking in to consideration the number of cycles for each 8086 instruction involved as well as the bandwidth frequency of your 8086 clock you can manually edit the 8086 source code to preserve your timing delays You should also take into account the 8086 instruction queue pipeline which contains six prefetched bytes of in line code Does the 8086 Code Produced Set Flags Exactly as on the 80807 Yes unless you specify the APPROX control when you run CONV86 Table 1 2 shows the five 8080 instructions whose 8086 counterparts set flags differently
46. el for CALL mn instruction following CALL CNZ mn JZ SHORTL n L n inserted as label for CALL mn instruction following CALL CP mn JS SHORTL n L_n inserted as label for CALL mn instruction following CALL CPE mn JNPSHORTL n L n inserted as label for CALL mn instruction following CALL CPO mn JP SHORT L__n L_n inserted as label for CALL mn instruction following CALL CZ JNZ SHORT L__n L_n inserted as label for CALL mn instruction following CALL APPENDIX A INSTRUCTION MAPPING 1 Instruction Mapping A 2 oa SSS ADD BX rw Using APPROX Control DAD rw LAHF Using EXACT Control ADD BX rw RCR 51 SAHF RCL 51 1 Using EXACT Control POCO EC Using EXACT Control CONV86 86 Instruction Mapping 8080 8085 8086 JC mn JB SHORT mn For forward short branch JC mn For backward short branch JC mn JAE SHORT L_n Otherwise JMP mn JM mn JS SHORT mn For forward short branch JMP mn For forward short branch JAE mn For backward short branch Forbackward shortbranch JNZ mn JZ SHORT L_n Otherwise 5 5 For forward short branch JP mn JS SHORT L__n Otherwise JMP mn JP SHORT mn For forward short branch JPE mn JNP SHORTL n Otherwise JMP mn JPOmn JNP SHORT mn For forward short branch JPO mn For backward
47. emaining two occurrences of LASZLO are overridden as follows 8086 MOV AL LASZLO Load AL with byte at LASZLO MOV BX WORD PTR LASZLO Load BX with word at LASZLO JMP NEAR PTR LASZLO Jump to symbolic location LASZLO How Are Comments Mapped Comments are mapped unchanged However metacharacters or unmatched parentheses in 8080 source comments may be misinterpreted by ASM86 How Are 8080 8085 Assembler Directives Mapped Into 8086 Assembler Directives Appendix C shows the assembler directive mapping Operands expressions of all directives are mapped according to Appendix B How Are 8080 8085 Assembler Controls Mapped CONV86 deletes the MOD85 NOMACROFILE COND NOCOND MACRODEBUG and NOMACRODEBUG controls and issues corresponding cau tion messages The MACROFILE Fn control specified with its argument will be converted to WORKFILES Fn Fn The MACROFILE control will not be converted cor rectly if you have not specified it with its optional argument Such a control can be deleted from the 8080 8085 source file or from the converter output file All other 8080 8085 assembler controls are copied unchanged to the 8086 output file The only 8080 8085 assembler control interpreted by the converter is the INCLUDE control which causes included files to be processed in the first pass Included files are neither listed nor converted when the main source file is converted they are pro cessed in order to evaluate
48. en hand translate the expression to a valid MCS 86 expression that corresponds to the original intent 18 INSTRUCTION AS OPERAND CANNOT BE TRANSLATED 8080 8085 instructions are not permitted as operands in your source file 19 REGISTER USED IN UNKNOWN CONTEXT A register was used in an unknown context such as REG If this directive appears in an INCLUDE file which does not reference REG conversion of the INCLUDE file will result in a type ambiguity for B That is CONV86 will not know at the time of the INCLUDE file s conversion whether B maps into CH or CX You should check to see whether you want B to map into a byte register or a word register and change the converter s mapping accordingly 20 OUTPUT LINE TOO LONG TRUNCATED An output line has exceeded 129 characters and has been truncated You should recode the line in 8086 accordingly 21 LABEL ASSUMED TO BE NEAR CONV86 has been unable to determine how this label is used it is assumed to be of type NEAR Since CONV86 has no information on how to type this symbol you should check its usage and change its type accordingly 22 NOMACROFILE CONTROL DELETED No corresponding control exists for the 8086 assembler No manual editing 15 required for this caution 23 85 CONTROL DELETED No corresponding control exists for the 8086 assembler No manual editing is required for this caution 24 SOURCE LINE TOO LONG IGNORED The current source line exceeds 129
49. esulting symbol and see if it corresponds to the intent of the 8080 8085 source code You should also check to see if the resulting concatenated name is reserved A list of reserved symbols appears in Appendix D MACRO PARAMETER USED IN BOTH BYTE AND WORD CONTEXTS A macro argument is used in both byte and word register contexts Since the argument can be of only one type you should manually alter the macro or over ride the argument type EQU D OR SET REGISTER SYMBOL USED IN BOTH BYTE AND WORD CONTEXTS An EQU or SET symbol is used in both byte register and word register contexts You should manually insert the appropriate register mnemonic s You may need to use two EQUs one for byte usage and one for word usage MULTIPLY DEFINED EQU MAY NOT BE ASSIGNED PROPER TYPE An EQU symbol has been multiply defined perhaps due to conditional com pilation You should eliminate the excess definition s and redefine as necessary CON V86 may have assigned the wrong type UNKNOWN STATEMENT The converter is unable to recognize this statement possibly because its mnemonic is a macro parameter You should either recode the 8080 source to produce recognizable statements legal instructions and submit the recoded 8080 file to CONV86 or else simply insert the appropriate 8086 source code in the OUTPUT file 3 9 Editing Converter Output 10 11 12 13 16 17 TYPE ASSIGNED TO INCLUDED SYMBOL MAY NOT AGREE WITH DEFINITION The
50. fy Intel products i ISBC Multimodule ICE Library Manager PROMPT iCS MCS Promware Insite Megachassis RMX Intel Micromap UPI Intelevision Multibus pScope Intellec and the combination of ICE iCS iSBC MCS or RMX and a numerical suffix A175 280 7 5 FL This manual describes how the ISIS II user who is familiar with 8080 8085 assembly language can convert 8080 8085 source files to 8086 assembly language source files which can then be assembled linked located and run to perform their equivalent 8080 8085 functions on the upwardly compatible 16 bit 8086 Chapter 1 describes the scope and environment of conversion Chapter 2 describes how to operate the converter program CONV86 Chapter 3 describes how to edit converter output to obtain MCS 86 source files Appendices describe the instruction operand expression and directive mappings reserved names and sample conversions with 8080 8085 and MCS 86 Macro Assembler listings of source and output files The following publications contain detailed information on 8080 8085 and MCS 86 software related to this manual 8080 8085 Assembly Language Programming Manual Order No 9800301 1515 11 8080 8085 Macro Assembler Operator s Manual Order No 9800292 e 1515 11 User s Guide Order No 9800306 e 8086 Family User s Manual Order No 9800722 e MCS 86 Macro Assembly Language Reference Manual Order No 9800640 MCS 86 Macro Assembler Oper
51. g CONV86 F1 MYASM 80 8 DATE 10 5 39 4 TITLE CONVERSION TEST 78 PROJECT AXOLOTL 4 If you happen to notice at this point that the wrong information has been entered that is the 39 and 78 have been interchanged there is no problem since prompting is still in effect On subsequent continuation lines you can enter DATE 10 5 78 4 TITLEUCONVERSION TEST 39 PROJECT AXOLOTL 8 xk Controls can be entered in any order and overridden in any order as many times as necessary For this reason it is good practice to end every line with an unquoted ampersand When you are Satisfied that the controls are correct you can end the command with the last line consisting of a lone carriage return Console Output When you have entered the command invoking CONV86 the converter responds with the message 1515 11 ASM80 TO ASM86 CONVERTER Vx y where x y is the version designation Normal termination of the converter causes it to issue the message ASM80 TO ASM86 CONVERSION COMPLETE nnnnn CAUTIONS ISSUED 2 5 Operating the Converter 86 where nnnnn is the number of messages generated for the run Caution messages are described in Chapter 3 CONV86 terminates abnormaly aborts if I O or other fatal errors occur during execution or if CONV86 has not been properly invoked Fatal I O console messages are of the form ASM80 TO 86 1 0 ERROR FILE file type NAME file name ERROR error me
52. guities such as a symbol used both as a byte and a word or to possible dis placed references such as exp In the latter case the displacement exp usually increases in going from the 8080 to the 8086 Chapter 3 describes caution messages and identifies what if anything you need to do to your 8086 source file Does a Caution Message Necessarily Mean a Manual Edit No In some instances such as displaced references CONV86 cannot be sure if an error exists In other instances such as MOD85 CONTROL DELETED the con verter is simply informing you of a deliberately omitted source file control Never theless all caution messages and the lines to which they apply demand scrutiny Caution Messages Identify All Manual Editing No Since 86 cannot infer the intent of a source program you must be the final judge as to whether the 8086 source code produced will do a satisfactory job In particular you should be alert to machine dependent sequences of instructions bearing in mind that instruction sizes lengths and execution time clocks will change in going from the 8080 8085 to the 8086 Also certain 8080 8085 Assembly Language constructs not valid in the MCS 86 Macro Assembly Language not detected by 86 These constructs flagged as errors by ASM86 For example a nested macro definition that uses the same macro name a valid construct in the 8080 8085 Assembly Language is invalid in the
53. hat deter mination Otherwise the conditional assembly statements placed by CONV86 in your OUTPUT file will not assemble under version V2 0 of the MCS 86 Macro Assembler UNKNOWN INSTRUCTION ASSUMED TO BE A MACRO The converter is unable to recognize this statement and has assumed that it is a macro call You should verify this assumption and recode if necessary GENERATED LABEL MIGHT NEED TO DECLARED LOCAL The converter has generated a label within a macro definition This label must be made local if the macro is invoked more than once NO COND CONTROL DELETED No corresponding control exists for the 8086 assembler No manual editing is required for this caution NO MACRODEBUG CONTROL DELETED No corresponding control exists for the 8086 assembler No manual editing is required for this caution METACHARACTER OR PARENTHESIS FOUND IN IRPC STRING A or 9 character was left in an IRPC string but will not be correctly interpreted by the 8086 assembler This requires your attention CONV86 86 Editing Converter Output 35 EXPRESSION ASSUMED BE CONSTANT CONV86 has not been able to determine what type of expression is in this instruction 86 has assumed that the expression is a numeric constant If this assumption is incorrect you should examine the resulting 8086 statement and the mapped expression to suit your intent You may find helpful to insert additional labels
54. high bytes ZI RPC Z DH 8080 REGISTER MNEMONIC APPEARING IN STRING LAHE INC 57 SAHF H amp L point to HIGH bytes For the next iteration Previous DE Hi 2 Previous Hi DEC DX SAHF L AHF INC BX Figure F 2C CONV86 PRINT File Conversion of 8080 Sort Routine F 7 Sample Conversion amp Listings CONV86 5 80 TO ASM86 CONVERTER 91 92 93 94 95 95 95 96 97 98 98 SAHF JMP INTST End of outer Loop Set DE DE 2 OUTINC CODE 2 CAUTIONIS LARF INC SAHF JMP ENDS END T i2 ili DX OUTTST END OF ASM80 TO ASM86 CONVERSION Figure F 2D CONV86 PRINT File Conversion of 8080 Sort Routine 86 Sample Conversion amp Listings MCS 85 MACRO ASSEMBLER SORT39 ISIS II 5 36 MACRO ASSEMBLER V2 9 ASSEMBLY OF MODULE SORT3O NO OBJECT MODULE REQUESTED ASSEMBLER INVOKED BY F3 ASM35 gt f1 SORT30 A35 OBJ LINE SOURCE 1 WORKFILESI F1 F1 NOOBJECT 2 CGROUP GROUP ABS_0 CODE CONST DATA STACK MEMORY 3 DGROUP GROUP ABS_0 CODE CONST DATA STACK MEMORY 4 ASSUME DS gt DGROUP CS CGROUP SS2DGROUP 5 CONST SEGMENT WORD PUBLIC CONST 5 CONST ENDS T STACK SEGMENT WORD STACK STACK 0000 8 STACK_BASE LABEL BYTE STACK ENDS 10 MEMORY SEGMENT WORD MEMORY MEMORY 0900 11 MEMORY LABEL BYTE 12 MEMORY ENDS 13 5 0 SEGMENT BYTE AT 0 0000 14 M ABEL BYTE 15 16 1 17
55. ializing Registers Before your converted program can be assembled for subsequent linking locating and execution you must insert register initializa tion code at the entry point to your main program The register initialization code that you insert must be the first sequence of instructions executed by your program If you omit this code from your main program neither the segment registers nor the stack pointer SP can be depended on to contain meaningful data and the results are unpredictable The code that you insert follows Note that expr should not be coded verbatim what you substitute for expr depends on whether you converted using the ABS or REL control REL is the default and how your 8080 8085 program initialized SP mainentrypoint CLI First instruction to be executed in your main program MOV AX CS Use CS to initialize MOV DS AX data segment register MOV ES AX extra segment register MOV SS AX stack segment register LEASP expr Seebelow for what to code for expr STI Enable interrupts where mainentrypoint 15 the symbolic location of the first instruction to be executed in your main program If in your original 8080 program development you used the 8080 LOCATE control RESTARTO to have the locater insert code to jump to the entry point of your main module when the 8080 was reset the corresponding 86 control is BOOTSTRAP expr is STACK BASE if you converted using the REL control and your
56. if AP PROX is specified The EXACT control a default forces all flag settings to be preserved Total functional equivalence on a per program basis would constrain instruction sequence sizes and clocks to be preserved Overview of Conversion Table 1 2 Flag Settings That Change If APPROX Is Specified Source Equivalent 8080 8080 Flags Affected 8086 8086 Flags Affected Instruction Instruction DAD ADD __ AF CF PF SF ZF INX none INC AF PF SF ZF DCX none DEC AF PF SF ZF PUSH PSW none saved in stack PUSH AX none POP PSW Z S P CY AC POP AX ISEE NOTE 1 NOTE 1 No flags are set if APPROX is specified EXACT sets AF SF and ZF but not OF How Does the EXACT Control Preserve Flag Semantics By inserting the LAHF load AH with flags and SAHF store flags from AH in structions before and after the 8086 counterpart of the 8080 instruction being con verted For example the 8080 instruction INX B increments the 16 bit register pair without affecting any 8080 8085 flags whereas the 8086 instruction INC CX not only increments the 16 bit register CX on the 8086 but also can affect four rele vant flags Auxiliary carry flag AF e Parity flag PF e Sign flag SF Zero flag ZF If your program is not concerned with these flag settings then the APPROX mapp ing will suffice 8080 8086 INX B APPROX INC CX However if your program flow depends on the settings of a
57. instructions It is therefore recommended that source files not be blindly submitted for conver sion Each source file under consideration for conversion should be carefully examined for these problem areas What Advantage Is There in Rewriting Programs in 8086 Assembly Language Rather Than Converting 86 converts most 8080 8085 assembly language source programs adequately You can take advantage of the more powerful 8086 by coding some routines directly in 8086 assembly language For example Figure 1 4 shows assembled program listings for e 8080 Assembly of BCDBIN 13 bytes 8080 object code e 5 86 Assembly of Conversion of BCDBIN 22 bytes 8086 object code e MCS 86 Assembly of BCDMCS Original 8086 Source 7 bytes 8086 object code Recallthat the PRINT file for the conversion of BCDBIN isshown in Figure 1 3 Overview of Conversion 86 CONVERTER PRINT File F1 BCDBIN CNV 5 80 TO 5 86 CONVERTER BCD TO BINARY ROUTINE Title from Invoking Command ISIS II 5 30 ASM35 CONVERSION OF FILE F1 BCDBIN S39 ASM86 PLACED IN Fi BCOBIN SSS RIER V2 3089 SOURCE FILE PRINTI F1 BCOBIN CNV amp CONVERSION AND CAUTIONS OUTPUTI F1 BCDBIN S86 amp 3985 CODE SENERATED TITS EL BCD TO BINARY ROUTINE amp MAX 39 CHARS APPROX amp DON T CARE ABOUT FLAG SEMANTICS FOR THIS ABS DON T CARE ABOUT RELOCATABILITY OR PL M FOR THIS Invoking Command Copy of Source
58. ional directives Remove conditional directives Examine correct file name Refer to beginning of Chapter 2 Reduce length s of DATA TITLE strings Refer to Controls description Reenter with carriage return Refer to Controls description Reduce the number of symbols used in your program Check for recursive macro calls reduce the number of nested macro calls E 3 EDITING CONVERTER Interpreting the PRINT File After you have run 86 and it has terminated normally you should examine the PRINT file As shown in Figure 3 1 the PRINT file consists of copy of the 8080 8085 assembly language source file NOSOURCELIST control was specified e MCS 86 assembly language source code with embedded caution messages Using the PRINT file as a reference you can manually edit the OUTPUT file to obtain 8086 source code that can be assembled by the MCS 86 Macro Assembler unless the 5 82 5 85 CONVERTER 3939 BINARY SEARCH ROUTINE 2 ISIS II ASH30 TO ASMB5 CONVERSION OF FILE 284 BINSCH S39 ASM86 PLACED FN gt BINSCH S3S CONVERTER V2 0 INVOKED BY CONV86 FR BINSCH SBO amp 3230 SOURCE FILE PRINTi FU BINSCH CNV amp CONVERSION AND CAUTIONS e OUTPUTI H BIHSCH S85 MCS 36 SOURCE ONLY TII E 3082 BINARY SEARCH ROUTINE amp 39 CHAR ABS amp DON T NEED RELWOCATABILITY OR PL M 3 INTERFACE e APPROX
59. l Order No 9800640 If you need to reorganize your converted program you can place your data in one segment or group based at absolute location 0 and place your code in another seg ment or group located above the data segment or group You should pay particular attention to absolute addresses and pointers address values stored as data in this case to ensure that your program accesses its data as originally intended How Does CONV86 Handle the Stack If present STKLN is converted to n DUP in the STACK segment where n is taken from the operand of STKLN The reserved name STACK is con verted to STACK__BASE See also Initializing Registers under 8086 Checklist in Chapter 3 How Are the 8080 8085 Registers Mapped into 8086 Registers Byte registers are mapped as follows 8080 8085 8086 Word registers are mapped as follows 8080 8085 8086 AX PSW B D DX H BX SP SP 86 Overview of Conversion How Are the 8080 Flags Mapped into the 8086 Flags The 8080 flags correspond to subset of the 8086 flags as shown in Table 1 1 Table 1 1 8080 8086 Flag Correspondence 8080 8086 1 Four 8086 flags do not concern us here DF direction IF interrupt enable OF overflow and trap Auxiliary carry Carry Zero Sign Parity How Are 8080 8085 Instructions Mapped into 8086 Instructions Appendix A shows how all i
60. lags Saved The invoking command CONV86 F1 MYASM A80 APPROX does not preserve flag semantics for the five instructions just mentioned and defaults to REL NOTE In the following examples the double asterisks indicating prompting are generated internally and not by the user CONV86 Operating the Converter 5 Prompting and Continuation Lines You need not enter the entire invoking command on a single line If you wish to con tinue the command on one or more subsequent lines you must enter an ampersand amp as the last character of the current line Characters entered following the amper sand and preceding the carriage return are comments they are by CONV86 in the PRINT file header but are not processed The converter then prompts for more command input with a double asterisk CONV86 F1 MYASM A80 4 source file is MYASM A80 on disk drive 1 10 5 78 amp date cannot exceed 9 chars excluding quotes TITLE CONVERSION TEST 39 PROJECT AXOLOTL 4 40 chars The date and title are included in the PRINT file headers as shown in Figure 1 3 Chapter 1 The remaining controls default as in Example 1 Example 6 Overriding Controls It may happen that you have entered a control incorrectly or for some other reason wish to override a previously entered control You can override any previously entered controls so long as prompting is in effect Suppose you have entered the followin
61. le 1 4 1 4 Program Listings Original 8080 Converted 8080 Original 8086 1 5 3 1 Annotated PRINT File 3 1 3 2 Converting Your Interrupt Procedures 3 4 TABLES TABLE TITLE PAGE 1 Assembler Directives Mapping 1 D 1 Reserved D 1 E 1 Macro Construct Conversion E 1 G 1 MCS 86 Relocation and Linkage Warnings Errors for Segment Overlap 1 FIGURES FIGURE TITLE PAGE F 1 8080 Sort Routine Source File F 2 F 2 CONV86 PRINT File of Conversion of 8080 Sort ROULE Du ie se odes 5 F 3 MCS 86 Macro Assembler Listing of Conversion of 8080 Sort Routine F 9 F 4 MCS 86 Macro Assembler Listing of Originally Coded 8086 Sort Routine F 12 CHAPTER 1 AN OVERVIEW OF CONVERSION Conversion and You What Is Conversion Conversion is a Way for you to obtain MCS 86 source files from your error free 8080 8085 assembly language source files Recall that an assembly language source file consists of assembler control statements assembler directives and assembly language instructions Figure 1 1 shows the role of conversion in 8080 8085 t0 8086 software development Conversion consists of two phases 1 Operating the program CONV86 under ISIS II As shown in Figure 1 2 CONV86 accepts as input an error free 8080 8085 assembly language source file and optional cont
62. n source file of your 8080 8085 program should be converted using the defaulted control NOTINCLUDED If NOTINCLUDED is in effect the con verted file begins with a converter generated prologue The prologue generated by the converter depends on whether the ABS or REL control is specified when CONV86 is run REL 15 the default If the ABS control is specified for subsequent absolute loading by 8086 relocation and linkage CONV86 generates as a prologue ASSUME DS ABS 0 CS ABS 0 ABS 0 SEGMENT M LABEL BYTE DEFINE REPT LOCALS BODY LOCAL MACRO DEFINE MACRO LOCAL 5 BODY 9e REPEAT N MACRO DEFINE IRP PARM PLIST LOCALS BODY LOCAL MACRO LIST DEFINE MACRO LOCAL LOCALS BODY DEFINE LIST PLIST AF LEN LIST EQ 0 THEN DEFINE PARM 0 MACRO ELSE WHILE LEN LIST NE 0 MATCH PARM LIST LIST MACRO Fl DEFINE PARM TEXT LOCALS BODY LOCAL MACRO LIST DEFINE MACRO LOCAL LOCALS BODY DEFINE LIST TEXT elF LEN LIST EQ 0 THEN DEFINE PARM 0 MACRO ELSE WHILE LEN LIST NE 0 DEFINE PARM SUBSTR LIST 1 1 DEFINE LIST SUBSTR LIST 2 9999 MACRO FI If the REL control is specified for converting 8080 8085 source files with relocatability features and or for subsequent linking to PL M 86 modules CONV86 generates as a prologue CGROUP GROUP ABS__
63. nstructions are mapped But first consider that it is not enough simply to map an 8080 instruction mnemonic directly into an 8086 instruc tion mnemonic because the instruction operands must be examined as well How Are 8080 Operands Expressions Converted to 8086 Operands Expressions 8086 Assembly Language is a typed language whereas 8080 8085 is not Thus 86 must assign type BYTE WORD NEAR to each symbol en countered in your 8080 8085 source file Each symbol is typed according to its most frequent usage After each symbol has been assigned a type at the end of the first pass of 86 86 can explicitly override the type in 8086 source code when necessary Appendix B describes the conversion of 8080 expressions into 8086 expressions as a function of the context and the operand or expression type For example during its first pass in converting your 8080 source file CONV86 may find the symbol LASZLO used in three different contexts 8080 LDA LASZLO Load accumulator with byte at LASZLO LHLD LASZLO Load H L with word at LASZLO JMP LASZLO Jump to symbolic location LASZLO 1 9 Overview of Conversion Since all three usages of the same symbol are permitted in 8080 8085 assembly language but since 8086 assembly language permits a symbol to be of only one type BYTE WORD NEAR then 86 must assign a single type to LASZLO In this case LASZLO is assigned type BYTE and the r
64. ny of the four flags men tioned you will want to ensure that in your 8086 program these flags are saved before INC CX is executed and restored after INC CX is executed The EXACT control does this for you as follows 8080 8086 COMMENTS INX B EXACT Load flags into INC CX SAHF Store flags from AH Similar flag preserving code results from EXACT conversion of the 8080 8085 instructions DCX DAD PUSH PSW and POP PSW When in doubt let CONV86 default to the EXACT control More 8086 source code is generated than for APPROX but the code can be counted on to preserve the flag setting semantics of your 8080 8085 program 86 CONV86 Overview of Conversion Editing CONV86 Output for 8086 Assembly What Output Files Does CONV86 Create Table 1 3 shows CONV86 output files their default extensions and uses Table 1 3 CONV86 Output Files File Designation in Invoking Command Default File Name Contents and Use OUTPUT Fs source A86 Machine readable 8086 source file to be manually edited according to caution messages in PRINT file Fs source LST 1 Optional copy of 8080 8085 source 2 Human readable 8086 source file with embedded caution messages for manually editing OUTPUT file What Are Caution Messages In general CON V86 issues a caution message when it detects a potential problem in the converted 8086 source code Caution messages can alert you to possible symbol type ambi
65. o set up a pseudo 8080 environment since an 8086 segment cannot exceed 64K bytes The register mappings help to complete the pseudo 8080 environment NOTE If more than one module is linked multiple ABS 0 segments will cause LINK86 to issue error messages concerning SEGMENT OVERLAP These errors are nonfatal and can be ignored but you should check your 8080 ASEG now the 8086 ABS__0 segment to make sure that you intend the overlap to occur See Appendix G for further details What If a Converted Program Exceeds 64K If your 8080 object file exceeds 50K bytes then there is a chance that your converted source file when assembled will exceed 64K bytes and therefore will be too large to fit into a single 8086 segment To determine this you must first convert your 8080 source file including required manual editing of 8086 source code and then assem ble under the MCS 86 Assembler An error message will inform you if the resulting MCS 86 object file exceeds 64K bytes Overview of Conversion 86 If your converted program exceeds 64K bytes you must reorganize your MCS 86 source code into two or more segments or else optimize your converted program by recoding portions directly in more efficient MCS 86 source code reorganize your converted program into two or more segments you Will need to change the GROUP SEGMENT and ASSUME assembler directives as described in the manual MCS 86 Macro Assembly Language Reference Manua
66. our argument accessing sequence of POPs 4 PL M 86 expects the return value a one word pointer or data item of the assembly language program to be in the AX register If the return value is a byte it is expected in AL CONV86 Editing Converter Output Case 2 When Your Converted Program Calls If your 8080 8085 source program calls another routine written either in MCS 86 Macro Assembly Language or PL M 86 which expects arguments to be passed on the stack you need to insert 8086 source code in your converted program If your original 8080 source program passed only one argument to the CALLed routine that argument was passed in the B C register pair Hence you need to insert PUSH CX Push B C argument on stack immediately before the CALL If your original 8080 source program passed two or more arguments to the CALLed routine those arguments were passed in the B C register pair in the D E register pair and remaining arguments on the stack Hence you need to insert PUSH CX Push B C argument on stack PUSH DX Push D E argument on stack immediately before the CALL The remaining arguments if any are already on the stack in the correct order PL M 86 return values are placed in AX or AL as described in Case 1 Caution Messages Caution messages do not necessarily imply manual editing but they do demand scrutiny In many cases CON V86 cannot be sure if an error actually exists as for instance in
67. rols and produces as output optional PRINT and OUT PUT files The OUTPUT file contains machine readable 8086 assembly language source code generated by CONV86 The PRINT file is human readable and contains Input 8080 8085 assembly language source code optionally controlled by SOURCELIST NOSOURCELIST converter control e Output 8086 assembly language source code with embedded diagnostic caution messages Chapter 2 describes how to operate CON V86 under 1515 11 2 Manually editing using the ISIS II text editor the OUTPUT file as indicated by the caution messages in the PRINT file Chapter 3 describes how to edit CONV86 output according to the caution messages generated Some machine dependent sequences such as software timing delays are not detected by CONV86 but still require manual editing Recall that in going from the 8080 to the 8086 both the instruction size length and time clocks change Figure 1 1 shows both phases of conversion as well as subsequent assembling link ing and absolute loading required for execution of your program Figure 1 3 shows the format of the PRINT file and highlights features of conver sion discussed here and elsewhere in this manual Why Convert If you want to capitalize on your software investment in the 8080 8085 and if your 8080 8085 source files are tried and true then conversion may offer you a con siderable head start in your software development effort for
68. rw IF EQS Using EXACT Control when rw rw AX could be PSW LAHF XCHG AL AH PUSH rw XCHG AL AH ELSE PUSH rw JNB SHORT L_n L n inserted as label RET instruction following RET for ROL AL 1 JNS SHORT L_n L_n inserted as label RET instruction following RET JNAE SHORT L__n L_n inserted as label RET instruction following RET JZ SHORT L__n L_n inserted as label RET instruction following RET JS SHORTL n L_n inserted as label RET instruction following RET JNP SHORTL n L n inserted as label RET instruction following RET JP SHORTL n L inserted as label RET instruction following RET INT ib JNZSHORTL n LL inserted as label RET instruction following RET for for for for for for for A 5 Instruction Mapping 6 a wm _ sns ww ws Lm meme MOV DS DI AL m s sma sma _ _ mman ea Cow ea _ XTHL POP SI XCHG BX SI PUSH SI 86 APPENDIX CONVERSION EXPRESSIONS CONTEXT The following describes how 8080 8085 expressions are converted to 8086 expres sions according to the context in which an operand or expression occurs The context is simply what 86 infers from the use of the operand in the instruction ib byte immediate iw word
69. short branch JPO mn JPSHORTL n Otherwise JMP mn JZ mn JZ SHORT mn For forward short branch JZ mn For backward short branch JZ mn JNZ SHORTL n Otherwise JMP mn A 3 Instruction Mapping mb MOVALmb AL MOVALmb ii LODS DS MISI LL wmm ____ Tome mem _ LL s me For EXACT or APPROX when rw is definitely not PSW POP PSW POP AX Using APPROX Control XCHG AL AH POP PSW POP AX Using EXACT Control XCHG AL AH SAHF IF EQS Using APPROX when rw rw AX THEN could be PSW POP rw XCHG AL AH JELSE POP rw IF EQS rw AX POP rw XCHG AL AH SAHF JELSE POPrw Using EXACT Control when rw could be PSW 86 86 8080 8085 PUSH rw PUSH PSW PUSH PSW PUSH rw PUSH rw RAL RAR RC RET RLC RNC RNZ RRC RST ib RZ RCL AL 1 RCR AL 1 Instruction Mapping PUSH rw For EXACT APPROX when rw is definitely not PSW LAHF Using EXACT Control XCHG AL AH PUSH AX XCHG AL AH XCHG AL AH Using APPROX Control PUSH AX XCHG AL AH SIF EQS Using APPROX Control when rw rw AX THEN could be PSW XCHG AL AH PUSH rw XCHG AL AH ELSE PUSH
70. specified symbol is defined in an INCLUDE file When the INCLUDE file is converted the usage of the symbol may not be the same as inferred by CONVS6 here You should convert the INCLUDE file and examine the type CONV86 has assigned to it there and then ensure that both usages are the same If they are not you should override the assigned usage in either file so as to make their types identical TRANSLATION OF NOP MAY NOT YIELD DESIRED RESULTS An NOP instruction has been converted XCHG AX AX This may not be the desired mapping as it assembles into a one byte instruction 3 clocks TRANSLATION OF RST MAY NOT YIELD DESIRED RESULTS An RST instruction has been converted to an INT instruction for the 8086 You should verify that the original intent of the RST instruction was to cause an interrupt You should examine the operand carefully to ensure that the instruc tion traps to the desired absolute address and that the intended routine to be trapped to will be bound to loaded at that address 8085 SPECIFIC INSTRUCTION CANNOT BE TRANSLATED The 8086 has no counterpart for RIM or SIM You should recode according to the 8086 interrupt scheme as described in the 8086 Family User s Manual under Interrupts FORWARD REFERENCE TO A SYMBOL WHICH IS REGISTER BX CANNOT CORRECTLY ASSEMBLED The 8086 assembler does not accept forward references to registers You should move your register EQUs to the beginning of yo
71. ssage CONVERSION TERMINATED Table 2 2 shows the relationship between file type and file name Table 2 2 File types and File names in CON V86 Fatal I O Errors FILE TYPE FILE NAME LIST Specified by PRINT control OUTPUT Specified by OUTPUT control or default SOURCE Specified by source field of command INCLUD Specified by ASM80 INCLUDE control TEMP CONV86 TMP temporary work file Cl Refers to console input device Error message 15 one of the following 04 ILLEGAL FILENAME SPECIFICATION 05 ILLEGAL OR UNRECOGNIZED DEVICE SPECIFICATION IN FILENAME 12 ATTEMPT TO OPEN AN ALREADY OPEN FILE 13 NO SUCH FILE 14 FILE IS WRITE PROTECTED 19 FILE IS NOT ON A DIRECT ACCESS DEVICE 22 DEVICE NAME NOT COMPATIBLE WITH INTENDED FILE USE 23 FILENAME REQUIRED ON DIRECT ACCESS FILE 28 NULL FILE EXTENSION 254 ATTEMPT TO READ PAST EOF Fatal errors other than I O result in the following console display ASM80 TO 86 FATAL ERROR message CONVERSION TERMINATED 86 Operating the Converter Messages corresponding to 1 0 fatal errors are as follows MESSAGE CONDITIONALLY ASSEMBLED MACRO CONDITIONALLY ASSEMBLED ENDM INVALID FILENAME INVALID CONTROL FORMAT CONTROL STRING TOO LONG INVALID CONTROL VALUE INVOCATION COMMAND DOES NOT END WITH CR lt LF gt UNKNOWN CONTROL INSUFFICIENT MEMORY FOR DICTIONARY MAXIMUM MACRO NESTING LEVEL EXCEEDED ACTION Remove condit
72. ter under ISIS II by entering the command Fn CONV86 source controls where source is the name of the file to be converted and controls are as described in Table 2 1 Table 2 1 CONV86 Controls and Defaults PRINT path name NOPRINT PRINT Fs source LST OUTPUT path name NOOUTPUT OUTPUT Fs source A86 DATE date DATE TITLE title TITLE gt PAGELENGTH n NOPAGING PAGELENGTH 60 PAGEWIDTH n PAGEWIDTH 120 EXACT APPROX EXACT INCLUDED NOTINCLUDED NOTINCLUDED ABS REL e REL WORKFILES Fn WORKFILES Fs SOURCELIST NOSOURCELIST SOURCELIST 2 1 Operating the Converter 86 where 5 specifies the diskette unit on which the source file resides PRINT specifies an ISIS II path name file or device designation for a of your 8080 8085 source code together with generated 8086 source code and embedded caution messages NOPRINT specifies that the PRINT file 15 not to be created OUTPUT specifies an ISIS II path name for the output 8086 source code Refer to Table 1 3 86 Output Files NOOUTPUT specifies that the OUTPUT file is not to be created DATE specifies a date or other information of up to nine characters to be printed in the page header of the PRINT file TITLE specifies a title or other information of up to 40 characters to be printed in the page header of the PRINT file PAGELENGTH n specifies the number of lines per output page in
73. the PRINT file The minimum is four lines per page there is no effective maximum NOPAGING specifies no forms control and 15 equivalent PAGELENGTH 65535 PAGEWIDTH n specifies the number of characters per output line in the PRINT file The minimum is 60 characters per line there is no effective maximum EXACT specifies that full flag setting semantics are to be preserved in conver sion This control affects conversion of the DAD DCX INX POP PSW and PUSH PSW APPROX specifies that full flag setting semantics are not to be preserved for the instructions DAD DCX INX POP PSW and PUSH PSW Refer to 2 2 86 Operating the Converter Chapter 1 Functional Equivalence for a description of flag preservation INCLUDED specifies that this module is included in another module for assembly This control suppresses generation of a standard prologue NOTINCLUDED REL ABS specifies that this module is not included in another module for assembly The converter therefore generates a standard prologue Refer to Chapter 1 Functional Mapping for a description of prologues specifies that this module will subsequently be assembled relocatable format and or linked to a PL M 86 module If REL and NOTINCLUDED are both specified or defaulted to both are defaults the standard prologue generated 15 compatible with PL M 86 and informs the converter that 8080 relocation capabilities are present in th
74. the upwardly compatible 8086 What Preparation Does CONV86 Require of Source Code You must ensure that all 8080 8085 source files to be converted can be assembled without error by the ISIS II 8080 8085 assembler No source line can be longer than 129 characters excluding carriage return and line feed If your program contains more than 600 symbols you must break your program down into smaller programs even if you have 64K RAM Overview of Conversion 86 USER INTERFACE TOOL FILES REFERENCES 8080 8085 ERROR FREE SOURCE INVOKE CONTROLS INTELLEC CONV86 FILE CHAPTER 2 SOFTWARE ENGINEER INTELLEC CHAPTER3 MCS 86 ASSEMBLER OPERATING INSTRUCTIONS FOR ISIS II USERS ORDER NO 9800641 INVOKE CONTROLS MCS 86 ASSEMBLER INTELLEC MCS 86 RELOCATION AND MCS 86 SOFTWARE DEVELOPMENT INVOKE CONTROLS INTELLEC UTILITIES FOR 1515 11 USERS ORDER NO 9800639 LINKAGE MCS 86 XECUTABLE PROGRAM Figure 1 1 From 8080 8085 Assembly Language Source File to 8086 Execution MCS 86 OUTPUT INCLUDE SOURCE FILE FILE S FILE EDIT UNDER 1515 11 8080 85 I 7 CONV86 m 8080 8085 SOURCE FILE 8080 85 PRINT FILE SOURCE MCS 86 USE AS REFERENCE TO EDIT OUTPUT F FILE SOURCE ILE DELETED WITH CAUTIONS Figure 1 2 CONV86 Input and Output Files 86 Overview of Conversion What About Macros All macro definitions
75. translation E 1 APPENDIX SAMPLE CONVERSION AND LISTINGS This appendix consists of Figure F 1 8080 Sort Routine Source File Figure F 2 CONV86 PRINT File of Conversion of 8080 Sort Routine Figure F 3 MCS 86 Macro Assembler Listing of Conversion of 8080 Sort Routine Figure F 4 MCS 86 Macro Assembler Listing of Originally Coded 8086 Sort Routine Please note that the CONV86 OUTPUT file was edited before submitting it to ASM86 for assembly The OUTPUT file was edited as follows l To retrieve PL M 86 stack parameters code corresponding to lines 44 47 in Figure F 3 was inserted as described in Chapter 3 To correct incomplete register mapping due to mnemonics appearing in an IRPC string IRPC calls have been deleted at lines 69 and 85 in Figure F 2 and the code has been expanded by hand to that at lines 91 94 and 132 133 in Figure F 3 This edit is in response to the converter generated caution For space time considerations only the necessary LAHF SAHF instructions were retained from the OUTPUT file Since the file was converted using the default control EXACT flag preserving code for all occurrences of DAD DCX INX and PUSH POP PSW was generated You can determine which flag preserving code has been retained by comparing Figures F 2 and F 3 F 1 Sample Conversion amp Listings 86 MACROFILEI Fir NOOBJECT ERRRERRARERRRARRRERRSRRRRRRRAA ERRRRARARARRRRRRRERERRRRERRARARA A PL M callable
76. ur file EXPRESSION ASSUMED TO BE A VARIABLE CONV86 has not been able to determine what type of expression is in this instruction CONV86 has assumed that the expression is a variable If this assumption is incorrect you should examine the resulting 8086 statement and recode the mapped expression to suit your intent You may find it helpful to insert additional labels ADDRESS EXPRESSION MAY BE INVALID FOR 8086 Case 1 Displaced Reference CONV86 may not have mapped a displaced symbol reference for instance BAZ FOO N correctly You can manually check the mapped displace ment You may find it simpler and safer to insert additional labels or variables rather than manually calculating displacements Case 2 HIGH LOW Applied to Symbolic Address Expressions You should check the symbols operated on by the HIGH LOW functions to ensure that their alignments in 8086 memory correspond to their 8080 page alignments CONV86 86 Editing Converter Output In addition if you converted using the REL control a default you should insert a group override prefix as follows Before Your Editing After Your Editing LOW expr LOW DGROUP expr HIGH expr HIGH DGROUP expr Case 3 Overly Complex Expressions It is possible that an overly complex 8080 expression has resulted in unaccept able MCS 86 source code in your OUTPUT file You should examine the original 8080 expression carefully to determine its intent and th
77. y application you may find that as you become familiar with the 8086 you can recode your interrupt service routines in MCS 86 Macro Assembly Language to obtain optimal code more suited to your application 3 5 Editing Converter Output 3 6 PL M 86 Linkage Conventions The only PL M 86 model of computation relevant to conversion is the SMALL model Case 1 When PL M Calls Converted assembly language programs called from PL M programs must be changed if any parameters are passed since PL M 80 passes parameters in registers and on the stack and PL M 86 passes all parameters on the stack PL M 86 parameter passing is as follows e Arguments are pushed on the stack in left to right order and therefore occupy successively lower memory locations The return address is pushed on the stack last e Each argument occupies two bytes One byte arguments are passed in the lower half least significant byte of a word Therefore converted 8086 assembly language programs called from PL M 86 pro grams need to access arguments from the stack and not from registers However since the calling PL M 86 program has pushed the return address on the stack last the called 8086 assembly language program needs to 1 POP the return address to any convenient word register such as BX 2 POP arguments as needed into their 8086 register counterparts as follows e If no arguments are expected POP no further Go to Step 3 below e If one argument

Download Pdf Manuals

image

Related Search

Related Contents

Guia del Usuario Operación Windows XP  PD1420L - Black & Decker Service Technical Home Page  Intermec PD43  User Manual  Aluratek AEBK08FB User's Manual  Über MediaCentral  Manuale Utente di Avigilon Control Center Client  

Copyright © All rights reserved.
Failed to retrieve file