![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
Microcontrollers ApNote AP1640 : Additional file AP164002.EXE available ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family ADIS16X allows the analysis of program code for the 16-bit microcontrollers of the C16X family. Program code in different formats can be loaded and displayed in Disassembler or Hex-dump format. Single instructions can be input using the built-in One-Line Assembler. Program code can be written into a Log-file in a list or assembler source format. SFR and bit symbol operation is provided using a symbol definition file. Richard Schmid, Microcontroller Product Definition, Siemens Munich Semiconductor Group 11.97, Rel. 02 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family Contents 1 2 3 4 5 6 6.1 6.2 6.3 7 7.1 7.2 7.3 8 9 A B C Page Starting of ADIS16X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Main Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Basic Function 11 11 12 12 Basic Function AP1640 ApNote - Revision History Actual Revision : 11.97 Rel. 02 Page of Page of actual Rev. prev.Rel. Previous Revision : 10.97 Rel. 01 (Original Version) Subjects (changes since last release) AP164002.EXE : new version of ADIS16X.EXE (V3.03) included; operand decoding of JNB, JBC, JNB, and JNBS instructions corrected. Semiconductor Group 2 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family 1 Starting of ADIS16X The program ADIS16X.EXE is an MS-DOS program. It can be started under MS-DOS or in an MSDOS window of a Windows operating system. If no parameter is added ADIS16X comes up in a 25line/80-columns text mode. It is also possible to initiate the program using a 43- or 50-line text mode. This mode is selected calling the program by ADIS16X /43 . After ADIS16X has been started the title screen is displayed. Pressing any further key will turn on the main menu screen. When ADIS16X is loaded, the program searches for a file called ADIS16X.SYM, which contains the device, the special function register, and the bit symbol definitions. If this file is not present in the directory where ADIS16X is located and started, ADIS16X will operate without any microcontroller specific register or bit symbol. This capability of symbol definitions in an external file allows a very flexible adaption of ADIS16X to all types of the C166 family microcontrollers with their different SFR and bit symbols. The syntax of the symbol definition file is shown in appendix C of this ApNote. Depending on the available main memory resources of the PC, ADIS16X allocates a memory buffer for its operation with up to 256 KByte in portions of 64K Bytes. Therefore, the memory buffer for ADIS16X starts at 00000H up to at maximum 3FFFFH in quantities of 64 Kbyte pages. Important : C166 data can be only handled within this absolute memory address area. Semiconductor Group 3 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family 2 Main Menu Figure 1 shows the main menu in 25-line mode. Figure 1 : Main Menu of ADIS16X The main menu screen of ADIS16X is divided into three sections : - The upper area of the screen (3 lines), the help area, shows the actual available basic functions of the program and the related keys which are used to select these basic functions. - The middle area of the screen, the display area, is used to display the contents of the 256K byte memory buffer in the Disassembler or Hex-dump menu. The number of text lines of this area depends on the text mode, in which ADIS16X is started (16, 34, or 41 lines). - The lower area of the screen (2 lines), the status area, is used to display status information and error messages (see Appendix A). File names and addresses are also input in this screen area. The right part of the status area shows the actual selected type of microcontroller, as defined in the symbol definition file, and the state of the Log-File (closed or open). The seven basic functions of ADIS16X can be selected from the main menu. These basic functions are assigned to function keys F1 to F7 as follows : Pressing Semiconductor Group 4 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family 3 Basic Function ADIS16X provides a 256K byte memory buffer which is assigned to be used as program memory buffer for instructions or data, which are generated by assembler and compiler programs. These instructions and data are normally stored with absolute addresses in data files using different formats. Figure 2 shows the types of data formats which can be loaded by ADIS16X. HEX- and OBJ-file formats are the Intel type of format. Figure 2 : Data File Load Selection Window Pressing Semiconductor Group 5 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family 4 Basic Function This function allows to generate data files with the content of the memory buffer. It is invoked by pressing Semiconductor Group 6 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family 5 Basic Function This function allows to select a microcontroller device with its related SFR- and bit symbols. This function is only available, if the device with its symbols has been defined in the symbol definition file ADIS51.SYM. In the example of figure 3 three devices have been defined. Figure 3 : Microcontroller Type Selection Window After the selection of the microcontroller type the name of the microcontroller is displayed in the right corner of the status area. Also all SFR and bit symbols, which are defined for the selected type of MCU in the symbol definition file ADIS51.SYM, are activated. Semiconductor Group 7 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family 6 6.1 Basic Function After pressing It is not possible to move the scrollbar in the screen area directly to an address which is less than the start address. For this operation a new start address must be defined (using Figure 4 : Disassembler/One-Line Assembler Menu of ADIS16X Semiconductor Group 8 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family The one-line assembler capability accepts opcodes and operands as input of instructions as they are defined in Appendix B. For the one-line assembler byte and word values for an instruction can be input either in decimal or hexadecimal notation, but they are always output as hexadecimal values. If SFRs and bit symbols are defined for the active microcontroller device (see chapter 5), the disassembler displays SFR addresses and bit addresses with its symbol. The one-line assembler also accepts symbol names as an input for an operands. SFR and bit symbol output/input can be switched off by an option (see chapter 8). After an instruction has been modified or input by using the cursor left/right keys and the Input of a New Address Pressing the The Log-file generation capability in the disassembler menu allows to write disassembler data from the memory buffer into an ASCII file. The disassembler data is written in the Log-file in a listing format as shown in the Log-file example 1 on the next page. The data in the first part of the Log-file example 1 has been generated with DPPi and symbols decoding enabled. For the second part DPPi and symbols decoding has been disabled. Semiconductor Group 9 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family Log-File Example 1 : Disassembler Output ========================================================================== ADIS16X V3.0 - LOG-File ========================================================================== ; ; Log-File output with DPPi decoding and symbols decoding enabled (C167) ; 08000 : A5 5A A5 A5 DISWDT 08004 : E6 0A 00 FA MOV STKOV,#0FA00H 08008 : E6 0B 40 FA MOV STKUN,#0FA40H 0800C : E6 09 3E FA MOV SP,#0FA3EH 08010 : E6 08 00 FD MOV CP,#0FD00H 08014 : E6 03 03 00 MOV DPP3,#0003H 08018 : E6 02 02 00 MOV DPP2,#0002H 0801C : E6 01 01 00 MOV DPP1,#0001H 08020 : E6 00 03 00 MOV DPP0,#0003H 08024 : 9E 86 BCLR ALECTL0 08026 : CF E2 BSET P3.12 08028 : CF E3 BSET DP3.12 0802A : DF E2 BSET P3.13 0802C : DF E3 BSET DP3.13 0802E : 0E 10 BCLR 10H.0 08030 : 1F 10 BSET 10H.1 08032 : FA 00 36 80 JMPS 0,8036H 08036 : B5 4A B5 B5 EINIT 0803A : F6 F0 48 FD MOV DPP3:3D48H,R0 0803E : F2 5E 48 FD MOV S1BG,DPP3:3D48H ; ; Log-File output with DPPi decoding and symbols decoding disabled (C167) ; 08000 : A5 5A A5 A5 DISWDT 08004 : E6 0A 00 FA MOV 0AH,#0FA00H 08008 : E6 0B 40 FA MOV 0BH,#0FA40H 0800C : E6 09 3E FA MOV 09H,#0FA3EH 08010 : E6 08 00 FD MOV 08H,#0FD00H 08014 : E6 03 03 00 MOV 03H,#0003H 08018 : E6 02 02 00 MOV 02H,#0002H 0801C : E6 01 01 00 MOV 01H,#0001H 08020 : E6 00 03 00 MOV 00H,#0003H 08024 : 9E 86 BCLR 86H.9 08026 : CF E2 BSET 0E2H.12 08028 : CF E3 BSET 0E3H.12 0802A : DF E2 BSET 0E2H.13 0802C : DF E3 BSET 0E3H.13 0802E : 0E 10 BCLR 10H.0 08030 : 1F 10 BSET 10H.1 08032 : FA 00 36 80 JMPS 0,8036H 08036 : B5 4A B5 B5 EINIT 0803A : F6 F0 48 FD MOV 0FD48H,R0 0803E : F2 5E 48 FD MOV S1BG,0FD48H If data shall be written into a Log-file by pressing Semiconductor Group 10 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family 7 7.1 Basic Function Pressing Figure 5 shows an example of a Hex-dump screen Figure 5 : Hex-Dump Function of ADIS16X Semiconductor Group 11 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family The Hex-dump function is left by pressing Pressing the The Log-file generation capability in the Hex-dump menu allows to write data from the memory buffer in hex notation into an ASCII file. The format of the hex data includes memory buffer addresses and hex data with 16 bytes in one row, as hexadecimal and ASCII characters. The Log-file example 2 below shows the Hex-dump log file output of the data as shown in figure 5. Log-File Example 2 : Hex-Dump Output ========================================================================== ADIS16X V3.0 - LOG-File ========================================================================== 08000: 08010: 08020: 08030: 08040: 08050: 08060: 08070: 08080: 08090: 080A0: 080B0: 080C0: 080D0: 080E0: 080F0: A5 E6 E6 1F 8A 9C FD E6 F6 48 7E BA 4D 20 20 EC 5A 08 00 10 80 80 90 F1 F0 FD B9 FE 4F 31 2F F0 A5 00 03 FA CA EA 6F 48 48 E6 CC 7E 4E 39 20 EC A5 FD 00 00 00 00 A4 00 FD DC 00 BA 31 39 65 F0 E6 E6 9E 36 AA EE CC F6 E6 11 F6 CB 36 30 72 EC 0A 03 86 80 80 80 00 F0 24 80 F0 00 36 20 74 F0 00 03 CF B5 CA FB 9A 0E 00 7F B8 E6 20 53 65 C6 FA 00 E2 4A 00 88 E2 FE 00 B9 FE BA 56 69 63 08 E6 E6 CF B5 AA E6 FD 5B CB CC CB 04 31 65 20 00 0B 02 E3 B5 80 24 90 11 00 00 00 00 2E 6D 47 FD 40 02 DF CA E6 00 6E F2 8F CB 9A 7E 32 65 6D C6 FA 00 E2 00 F0 00 A4 F0 E2 00 BA BA 37 6E 62 03 E6 E6 DF 58 AA CC F2 0E 8F 9A FE 6F 20 73 48 03 09 01 E3 80 00 00 F0 FE E3 B9 70 BA 28 20 00 00 3E 01 0E CA CA 8A 48 28 F2 FE F2 CB 63 41 E0 C6 FA 00 10 00 00 E2 FE 01 5E 70 F0 00 29 47 00 02 Zae..uae.@uae.>u ae..yae...ae...ae... ae...*IaIaaa.. ..u.6_JE.X_E. S_E._E._ae.E. oe_e.i_uae$..I.Sa y_oI.ay_noH aenH.o.[.o.(. oHyae$..E._a_ao^ HyaeU._-I.E.p ~I.oE.po ~E.ae..~oE. MON166 V1.27 (c) 1990 Siemens AG / ertec GmbH.a. iiiAE..yAE...AE. If data shall be written into a Log-file by pressing Semiconductor Group 12 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family 8 Basic Function This function can be used to get an information about the usage of the memory buffer after a data file has been loaded into the memory buffer (basic function Figure 6 : Memory Buffer Usage Window Semiconductor Group 13 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family 9 Basic Function With this function three options can be selected. Pressing the keys <1> to <3> always toggles the related option. The displayed value is always active (see figure 7). Pressing another key closes the options window again. Figure 7 : Options Window The first option can be used to enable/disable SFR- and bit-symbols in disassembler outputs and one-line ssembler inputs. The symbols must be defined in an external symbol definition file (ADIS16X.SYM). The second option allows to switch on/off the DPPi decoding of instructions when they are displayed in the disassembler menu or written in a Log-file. An instruction "MOV DPP1,#0001H" is disassembled as "MOV 01H,#0001H" when option 2 is disabled. If the third option is enabled, every load of a data file is preceeded by a memory buffer clear operation (256K memory buffer is loaded with 00H). This memory buffer clear operation can be disabled. Semiconductor Group 14 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family Appendix A Error and Status Messages Cause Input of an invalid file name or file does not exist During loading of a data file a checksum error has been detected. The data file load operation is aborted. During the reading of a data file no absolute located code/data information has been detected and loaded into the memory buffer. Probably the data file has a wrong format. During loading of a OBJ or IEEE data file a wrong file format has been detected. The load operation has been aborted. During loading of a data file a non existing memory buffer address has been requested. The load operation has been aborted. The character which has been input is invald and was not accepted. Invalid address (only hexadecimal values allowed). An invalid instruction has been input; the one-line assembler cannot disassemble the instruction (instruction format see Appendix B). For further disassembling of the memory buffer a new start address must be input (using Error-/Status Message File access error Checksum error No absolute code/data has been loaded Invalid OBJ-file format Invalid IEEE-file format or Code memory is not available at this address Invalid input Invalid address Invalid instruction Display buffer exceeded Code memory limit reached End of code memory - input lower address Disassembler start address reached Start address is greater than end address xxx-File name is loaded File name is created Log-File is created Odd address - corrected to next even ddress Symbol definition file: not available or invalid format MCU selection is not available - no MCU-type defined File exists ! Overwrite/Append/Cancel ? A file (data or Log-file) to be written already exyists or is open. The file can be closed, overwritten, appended or the action can be cancelled. Semiconductor Group 15 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family B One-Line Assembler Formats Operands Rw,Rw Rw,[Rwi] Rw,[Rwi+] Rw,#data3 reg,#data16 reg,mem mem,reg (not for CMP) Rb,Rb Rb,[Rwi] Rb,[Rwi+] Rb,#data3 reg,#data8 reg,mem mem,reg (not for CMPB) Rw,Rw MOVBS, MOVBZ Rb bitaddr bitaddr,bitaddr JMPA, CALLA JMPI, CALLI JMPS, CALLS bitoff,#mask8, #data8 Rw,#data4 Rw,#data16 Rw,mem Rw,Rw Rw,#data4 Rw,Rw Rw,#data4 Rw,[Rw] Rw,[Rw+] Rw,[Rw+#data16] [Rw],Rw [Rw],[Rw] [Rw],[Rw+] [Rw+],[Rw] [-Rw],Rw [Rw+#data16],Rw [Rw],mem mem,[Rw] reg,#data16 reg,mem mem,reg JMPR CALLR TRAP PCALL JB, JBC, JNB, JNBS POP, PUSH, RETP SCXT RET, RETS, RETI, SRST, IDLE, PWRDN, SRVWDT,EINIT, DISWDT, NOP ATOMIC EXTR EXTP EXTPR EXTS EXTSR 1) 1) 1) 1) 1) 1) Opcodes ADD, ADDC; SUB, SUBC, AND, OR, XOR, CMP Opcodes MOVB Operands Rb,Rb Rb,#data4 Rb,[Rw] Rb,[Rw+] Rb,[Rw+#data16] [Rw],Rb [Rw],[Rw] [Rw],[Rw+] [Rw+],[Rw] [-Rw],Rb [Rw+#data16],Rb [Rw],mem mem,[Rw] reg,#data8 reg,mem mem,reg Rb,Rb reg,mem mem,reg cc,caddr cc,[Rw] seg,caddr cc,rel rel #trap7 reg,caddr bitaddr,rel reg reg,#data16 reg,mem no operands ADDB, ADDCB, SUBB, SUBCB, ANDB, ORB, 'XORB, CMPB MUL, MULU PRIOR CPLB, NEGB BCLR, BSET BCLR, BSET BMOV, BMOVN, BAND, BCMP, BOR, BXOR BFLDL, BFLDH CMPD1, CMPD2, CMPI1, CMPI2 SHL,SHR,ROL, ROR, ASHR MOV #data2 Rw,#data2 pag,#data2 Rw,#data2 segm,#data2 1) These instructions are not available for the C166 Semiconductor Group 16 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family The operands shown in the table on the previous page are abbreviations for the following inputs : Rw Rwi Rb data2 data3 data4 trap7 data8,mask8 data12 data16 SFR SFRb SFB SFRb.x data8.x Rw.x cc caddr rel pag seg segm DPPi R0-R15 R0-R3 RL0-RH7 1-4 or 1H-4H 0-7 or 0H-7H 0-15 or 00H-0FH 0-127 or 00H-7FH 0-255 or 00H-0FFH 0-4095 or 000H-7FFH 0-65535 or 0000H-0FFFFH symbol of a special function registers (SFR) symbol of a bitadressable SFR symbol of a bitadressable Bits bit x of a bitadressable SFR (x=0-15) bit x of a bitadressable SFR witrh the address data8 (x=0-15) bit x of the registers R0-R15 (x,x=0-15) symbol of a condition codes (z.B. CC_EQ) absolute jump address : 0-65535 or 0000H-0FFFFH relative jump address : 0-65535 or 0000H-0FFFFH 10-bit page number : 0-1023 or 00H-3FFH absolute segment address : 0-3 or 0H-3H absolute segment address : 0-255 or 00H-0FFH data pointer DPP0-DPP3 (i=0-3) The following operands are abbreviations for several inputs shown above : reg = Rw (for word instructions) Rb (for byte instructions) SFR data8 SFR data16 DPPi:data16 Rw SFRb data8 data12 SFB SFRb.x data8.x Rw.x or or or or or or or or or or or mem = bitoff = bitaddr = Generally, numbers can be input as decimal or hexadecimal values. For hexadecimal values the standard convention is valid : a "0" must preceed the value if the hexadecimal value begins with a letter ("A" - "F"); the hexadecimal value ends with a "H". Inputs for the assembler are not case sensitive. Semiconductor Group 17 of 18 AP1640 11.97 ADIS16X - Disassembler with One-Line Assembler for the C16X 16-Bit Microcontroller Family C Definition of the Symbol Definition File ;============================================================================== ; Symbol Definition File for ADIS16X V3.0 - Rules ;============================================================================== ; ; The symbol definition file for the ADIS16X V3.0 Disassembler allows to ; define symbols for SFR's and bits of the SFR's for up to 15 different ; 80C16X compatible microcontrollers. Such a symbol definition file is ; build up according the following rules : ; ; 1. Comment lines have a ";" in the first row of a line. All following ; characters in this line are ignored. ; ; 2. Empty lines (with 0DH, 0AH) can be inserted everywhere. ; ; 3. The definition file has 4 sections. Each section is validated by ; a keyword. The keywords of these sections are : ; Keyword "[MCU]" --> MCU-Section: defines the names of the MCUs ; Keyword "[SFR]" --> SFR-Section: defines the names of the Special ; Function Registers ; Keyword "[ESFR]"--> ESFR-Section: defines the names of the Extended ; Special Function Registers ; Keyword "[SFB]" --> SFB-Section: defines the names of the bits of the ; Special Function Registers. ; The keywords must be placed in the first row of a line. ; ; 4. Definitions in the MCU-Section : ; "xxxxxxx hhhh" : "xxxxxxx" starts in the first row of a column and ; is the (short-)name of the microcontroller; ; (max. 7 ASCII characters) ; "hhhh" is a 4-digit hexword, coded with a "1" in one ; of the 15 bit positions, starting with bit position ; 0; this hexword is separated from the name with ex; actly one blank character; ; The lines in the MCU-Section shall be ordered by ascending bit ; positions of "hhhh". A "1" in the highest bit position indicates that ; the MCU is using ESFR register. ; ; 5. Definitions in the SFR-/ESFR-/SFB-Sections : ; Lines of the SFR-/ESFR-Sections have exactly 3 parts, separated each ; by one blank character. ; "aa xxxxxxxx hhhh" :"aa" is a 2-digit hexbyte value, which defines ; the 8-bit address of a SFR or ESFR and starts in ; the first row of a column; ; "xxxxxxxx" is the name of the SFR/ESFR with the ; address "aa"; (max. 8 ASCII characters); ; "hhhh" is a 4-digit hexword; a "1" in a dedicated ; bit position defines, that the symbol 'xxxxxxx' ; is valid for the MCU, which has also a "1" de; fined at the same bit position in the MCU-Section ; ; 6. Definitions in SFB-Sections : ; Lines of this section are build up in a similar way as in the SFR-/ ; ESFR-Section. The difference is that the bitaddress is decoded in a ; 16-bit value. ; "aabb xxxxxxx hhhh" : "aabb" is a 4-digit hexbyte value, which con; tains the bit position (aa) and the 8-bit ; address bb of the bitaddressable SFR-/ESFR. ; "aabb" starts in the first row of a column. ; "xxxxxxx" is the name of the bit symbol ; (8 ASCII characters); ; "hhhh" is a 4-digit hexword; a "1" in a dedi; cated bit position defines, that the symbol ; 'xxxxxxx' is valid for the MCU, which has also ; a "1" defined at the same bit position in the ; MCU-Section ;============================================================================== ; Note : The file AP164001.EXE includes an example for a symbol definition file. Semiconductor Group 18 of 18 AP1640 11.97 |
Price & Availability of AP164002
![]() |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |