DISAVR for Win32 1.01 beta released

Go To Last Post
28 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A long time ago, I wrote a disassembler called DISAVR which today can be found all over the internet.

However (!)- it lacks support for the Mega opcodes as well didn't like Windows too well (was written in DOS back in 1997).

After years of delay, I updated it over the last two days. I added support for all the missing instructions and cleaned up it's processing of Intel-Hex files.

There are still some issues to work out but I wanted to let it get out so others can benefit and possibly spot any bugs they might find. I've tested it thoroughly but it's hard by myself.

It does not support binary file types right now so you must supply an Intel-Hex formatted file.

It can handle program sizes upto 256k bytes of memory (i.e.- ATMEGA256 is supported already).

Enjoy and your comments are welcome.

Attachment(s): 

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

14 downloads. Has anyone tried it?

You should call it like this: "disavr test.hex > test.src". The outcome is output to the console.

here is a simple test to demonstrate:

	  ; Atmel Win32 AVR Disassembler v1.01
	  ;
         .cseg
         .org	0

          ldi    r16, 0xDF    ; 0000 ED0F
          out    SPL, r16     ; 0001 BF0D
          clr    r16          ; 0002 2700
          clr    YH           ; 0003 27DD
          ldi    YL, 0x60     ; 0004 E6C0
avr0005:  st     Y+, r16      ; 0005 9309
          cpi    YL, 0xD0     ; 0006 3DC0
           brlo  avr0005      ; 0007 F3E8
avr0008:  rjmp   $            ; 0008 CFFF

         .exit

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is great stuff, but I think you may add some parameters like ".include", ".device" - for generate asm code for some real mpu
Program can also "autodetect" type of mpu, using analyse of instruction set (and code size)...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hronik wrote:
This is great stuff, but I think you may add some parameters like ".include", ".device" - for generate asm code for some real mpu
Program can also "autodetect" type of mpu, using analyse of instruction set (and code size)...

if you are going to do this, it would also be usefull, to be able to over-ride the auto detection as it may at times get it wrong :) I personally don't mind software that makes assumptions (as this would be) about what you want it to do, as long as they can be over-ridden by the user who KNOWS what they want it to do :)

Phill.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The errors of autodeteсtion are inevitable, since one and the same code can work on the different chips. But it is possible to do so that the autodetection would issue the cheapest permissible mpu.
example:
1k code -> tiny1x or at1200;
"lpm" instruction found, port B only -> not at1200;
working with EEPROM registers -> not tiny11;
not works with RAM -> not tiny13;
variants: tiny12,tiny15;
result: tiny12.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know about anyone else, but I can usually remember what processor I used for a particular job. Anyhow, what's going to happen when the disassembler runs into an LPM instruction which is really a data word?

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
I don't know about anyone else, but I can usually remember what processor I used for a particular job. Anyhow, what's going to happen when the disassembler runs into an LPM instruction which is really a data word?

My thoughts exactly. The code as it comes out of the disassembler is ready for assembly unless it hit unknowns and left blanks.

I was going to .DB all unknown decodings and add binary file support with auto-detect for intel-hex else binary type detection.

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Any more comments?

1.02 will include:

auto binary / hex loading of file.
some hex file fixes to handle different data records (it doesn't right now)
possibly include a control-file support (dictate this address is always say transmit a byte, etc).

any other suggestions? I've been using it this week and the decoding of instructions looks good. It's a mess to decode the AVR instructions cause a few of the instructions like MUL weren't exactly thought out too well. They were added where they found room in my opinion.

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When I downloaded the above program and extract it double click I get a Dos box open quickly and then close.

If I copy a AVR hex file and put it on the program I can see the program disassembling the file then it just close; can some one help.

Node

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Node, read my 2nd posting above for it's usage.

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi sxpilot,

I haven't taken a look at your package yet, but I have a couple of quick questions:
What is the license for the software?
Can this be freely distributed?

Thanks
Eric

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No license, it is free for the community.

Hope it works well for you ;)

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The software disassemble my hex file starting at address 01CB. when I disassemble it in AVR Studio it started at address 0000. Can you explain why. There was a alot of data between address 0000 & 01CB as shown in Studio.

Node

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't understand your question but if you post your hex file I can explain.

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is my hex file

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not sure what the problem is. DISAVR did it's job.

Here is your code:

	  ; Atmel Win32 AVR Disassembler v1.01
	  ;
         .cseg
         .org	0
          in     ZH, SREG     ; 0000 B7FF
          rol    r16          ; 0001 1F00
          ret                 ; 0002 9508
          rjmp   avr035D      ; 0003 C359

           brlo  avrFFFFFFE5  ; 0004 F300
          cbi    PORTB, 0     ; 0005 98C0
          rjmp   avrFFE6      ; 0006 CFDF
          rcall  avrFFAE      ; 0007 DFA6
avr0008:  rcall  avr071C      ; 0008 D713
          rcall  avrFBC3      ; 0009 DBB9
avr000A:  rcall  avrFFC8      ; 000A DFBD
avr000B:  ldi    YL, 0x31     ; 000B E3C1
          ldi    YL, 0x75     ; 000C E7C5
          ldi    YL, 0xB9     ; 000D EBC9
          ldi    YL, 0xFD     ; 000E EFCD
           breq  avr000A      ; 000F F3D1
           brhc  avr000B      ; 0010 F7D5
          bst    YL, 4        ; 0011 FBCC
          sbrs   YH, 5        ; 0012 FFDD
          ldi    ZL, 0x41     ; 0013 E4E1
          cpc    ZL, r21      ; 0014 07E5
          sbc    ZL, r25      ; 0015 0BE9
          add    ZL, YH       ; 0016 0FED
          cpse   ZH, r17      ; 0017 13F1
          cp     ZH, r21      ; 0018 17F5
          sub    ZH, r25      ; 0019 1BF9
          adc    ZH, YH       ; 001A 1FFD
          and    r16, r17     ; 001B 2301
          eor    r16, r21     ; 001C 2705
          or     r16, r25     ; 001D 2B09
          mov    r16, YH      ; 001E 2F0D
          cpi    r17, 0x31    ; 001F 3311
          cpi    r17, 0x75    ; 0020 3715
          cpi    r17, 0xB9    ; 0021 3B19
          cpi    r17, 0xFD    ; 0022 3F1D
          ldi    r18, 0x71    ; 0023 E721
          sbci   ZL, 0x75     ; 0024 47E5
          sbci   r18, 0xB9    ; 0025 4B29
          sbci   r18, 0xFD    ; 0026 4F2D
          subi   r19, 0x31    ; 0027 5331
          subi   YL, 0x7C     ; 0028 57CC
          subi   r19, 0xB9    ; 0029 5B39
          subi   r19, 0xFD    ; 002A 5F3D
          ori    r20, 0x31    ; 002B 6341
          ori    YL, 0x7C     ; 002C 67CC
          ori    r20, 0xB9    ; 002D 6B49
          ori    r20, 0xFD    ; 002E 6F4D
          andi   r21, 0x31    ; 002F 7351
          andi   YL, 0x7C     ; 0030 77CC
          andi   r21, 0xB9    ; 0031 7B59
          andi   r21, 0xFD    ; 0032 7F5D
          std    Z+1, r22     ; 0033 8361
          std    Y+12, YL     ; 0034 87CC
          std    Y+17, r22    ; 0035 8B69
          std    Y+28, YL     ; 0036 8FCC
          st     Z+, r23      ; 0037 9371
avr0038:  sbiw   ZL, 0x15     ; 0038 9775
          sbis   PINA, 4      ; 0039 9BCC
          mul    r23, YH      ; 003A 9F7D
          std    Z+33, r24    ; 003B A381
          std    Z+45, r24    ; 003C A785
          std    Y+49, r24    ; 003D AB89
          std    Y+61, r24    ; 003E AF8D
          in     r25, DDRD    ; 003F B391
          in     r25, MCUCR   ; 0040 B795
          out    PINA, r25    ; 0041 BB99
          out    SPL, r25     ; 0042 BF9D
          rjmp   avr03E5      ; 0043 C3A1
          rjmp   avr07EA      ; 0044 C7A5
          rjmp   avrFBEF      ; 0045 CBA9
          rjmp   avrFFF4      ; 0046 CFAD
          rcall  avr03F9      ; 0047 D3B1
          rcall  avr07FE      ; 0048 D7B5
          rcall  avrFC03      ; 0049 DBB9
avr004A:  rcall  avr0008      ; 004A DFBD
          ldi    YL, 0x31     ; 004B E3C1
          ldi    YL, 0x75     ; 004C E7C5
avr004D:  ldi    YL, 0xB9     ; 004D EBC9
          ldi    YL, 0xFD     ; 004E EFCD
           breq  avr004A      ; 004F F3D1
           brhc  avr004D      ; 0050 F7E5
          bst    YH, 1        ; 0051 FBD9
          sbrs   YL, 2        ; 0052 FFCA
          fmuls  r22, r17     ; 0053 03E1
          cpc    ZL, r21      ; 0054 07E5
          ldi    ZL, 0x89     ; 0055 E8E9
          add    ZL, YH       ; 0056 0FED
          ldi    ZH, 0xD1     ; 0057 EDF1
          cp     ZH, r21      ; 0058 17F5
          sub    ZH, r25      ; 0059 1BF9
          rol    YL           ; 005A 1FCC
          and    r16, r17     ; 005B 2301
          eor    r16, r21     ; 005C 2705
          or     r16, r25     ; 005D 2B09
avr005E:  mov    YL, YL       ; 005E 2FCC
          cpi    r17, 0x31    ; 005F 3311
avr0060:  rcall  avr01EB      ; 0060 D18A
          rcall  avr0295      ; 0061 D233
          cli                 ; 0062 94F8
          cli                 ; 0063 94F8
          dec    r17          ; 0064 951A
           brne  avr0060      ; 0065 F7D1
          rjmp   avr0038      ; 0066 CFD1
          rjmp   avr0079      ; 0067 C011
          rjmp   avr00EB      ; 0068 C082
          rjmp   avr00AF      ; 0069 C045
          rjmp   avr00C2      ; 006A C057
          rjmp   avr01B0      ; 006B C144
          rjmp   avr00C9      ; 006C C05C
          ldi    r16, 0x18    ; 006D E108
          rcall  avr023D      ; 006E D1CE
          sbi    DDRD, 4      ; 006F 9A8C
          sbi    PORTD, 4     ; 0070 9A94
avr0071:  rcall  avr01EB      ; 0071 D179
          cli                 ; 0072 94F8
          rcall  avr01EB      ; 0073 D177
          rcall  avr0295      ; 0074 D220
          ldi    XL, 0x65     ; 0075 E6A5
          ld     r17, X+      ; 0076 911D
          st     Y+, r17      ; 0077 9319
           brne  avr0071      ; 0078 F7C1
avr0079:  ldi    XL, 0x64     ; 0079 E6A4
          ld     r17, X+      ; 007A 911D
          cpi    r17, 0x1A    ; 007B 311A
           breq  avr007E      ; 007C F009
          rjmp   avr005E      ; 007D CFE0
avr007E:  sbis   PIND, 0      ; 007E 9B80
          rjmp   avr007E      ; 007F CFFE
avr0080:  sbic   PIND, 0      ; 0080 9980
          rjmp   avr0080      ; 0081 CFFE
          sbi    DDRD, 5      ; 0082 9A8D
          cbi    PORTD, 5     ; 0083 9895
          ldi    r16, 0x25    ; 0084 E205
          rcall  avr023D      ; 0085 D1B7
          sbi    DDRD, 5      ; 0086 9A8D
          sbi    PORTD, 5     ; 0087 9A95
          rcall  avr01EB      ; 0088 D162
          nop                 ; 0089 0000
          rcall  avr01EB      ; 008A D160
          rcall  avr01EB      ; 008B D15F
          rcall  avr0295      ; 008C D208
          rcall  avr01EB      ; 008D D15D
          rcall  avr01EB      ; 008E D15C
          cli                 ; 008F 94F8
          rcall  avr01EB      ; 0090 D15A
          rcall  avr01EB      ; 0091 D159
          rcall  avr01EB      ; 0092 D158
          rcall  avr0295      ; 0093 D201
          rcall  avr01EB      ; 0094 D156
          rcall  avr0295      ; 0095 D1FF
avr0096:  sbis   PIND, 0      ; 0096 9B80
          rjmp   avr0096      ; 0097 CFFE
avr0098:  sbic   PIND, 0      ; 0098 9980
          rjmp   avr0098      ; 0099 CFFE
          sbi    DDRD, 5      ; 009A 9A8D
          cbi    PORTD, 5     ; 009B 9895
          ldi    r16, 0x0E    ; 009C E00E
          rcall  avr023D      ; 009D D19F
          sbi    DDRD, 5      ; 009E 9A8D
          sbi    PORTD, 5     ; 009F 9A95
          rcall  avr01EB      ; 00A0 D14A
          cli                 ; 00A1 94F8
avr00A2:  sbis   PIND, 0      ; 00A2 9B80
          rjmp   avr00A2      ; 00A3 CFFE
avr00A4:  sbic   PIND, 0      ; 00A4 9980
          rjmp   avr00A4      ; 00A5 CFFE
          sbi    DDRD, 5      ; 00A6 9A8D
          cbi    PORTD, 5     ; 00A7 9895
          ldi    r16, 0x01    ; 00A8 E001
          rcall  avr023D      ; 00A9 D193
          sbi    DDRD, 5      ; 00AA 9A8D
          sbi    PORTD, 5     ; 00AB 9A95
          cli                 ; 00AC 94F8
          ldi    r17, 0x0D    ; 00AD E01D
          rjmp   avr005E      ; 00AE CFAF
avr00AF:  ldi    XL, 0x64     ; 00AF E6A4
          ld     r17, X+      ; 00B0 911D
          cpi    r17, 0x11    ; 00B1 3111
           breq  avr00B4      ; 00B2 F009
          rjmp   avr005E      ; 00B3 CFAA
avr00B4:  ldi    r17, 0x11    ; 00B4 E111
avr00B5:  sbis   PIND, 0      ; 00B5 9B80
          rjmp   avr00B5      ; 00B6 CFFE
avr00B7:  sbic   PIND, 0      ; 00B7 9980
          rjmp   avr00B7      ; 00B8 CFFE
          sbi    DDRD, 5      ; 00B9 9A8D
          cbi    PORTD, 5     ; 00BA 9895
          ldi    r16, 0x00    ; 00BB E000
          rcall  avr023D      ; 00BC D180
          sbi    DDRD, 5      ; 00BD 9A8D
          sbi    PORTD, 5     ; 00BE 9A95
          dec    r17          ; 00BF 951A
           brne  avr00B5      ; 00C0 F7A1
          rjmp   avr0038      ; 00C1 CF76
avr00C2:  ldi    XL, 0xB8     ; 00C2 EBA8
          ldi    r17, 0x08    ; 00C3 E018
          ldi    r19, 0x00    ; 00C4 E030
avr00C5:  st     X+, r19      ; 00C5 933D
          dec    r17          ; 00C6 951A
           brne  avr00C5      ; 00C7 F7E9
          rjmp   avr0038      ; 00C8 CF6F
avr00C9:  ldi    r17, 0x04    ; 00C9 E014
          ldi    XL, 0xB4     ; 00CA EBA4
avr00CB:  rcall  avr01EB      ; 00CB D11F
          rcall  avr0295      ; 00CC D1C8
          st     X+, r16      ; 00CD 930D
          dec    r17          ; 00CE 951A
           brne  avr00CB      ; 00CF F7D9
          ldi    r17, 0x05    ; 00D0 E015
avr00D1:  rcall  avr01EB      ; 00D1 D119
          rcall  avr0295      ; 00D2 D1C2
          dec    r17          ; 00D3 951A
           brne  avr00D1      ; 00D4 F7E1
          sbi    DDRD, 5      ; 00D5 9A8D
          cbi    PORTD, 5     ; 00D6 9895
          ldi    r18, 0x08    ; 00D7 E028
          ldi    XL, 0xB4     ; 00D8 EBA4
          ldi    r17, 0x04    ; 00D9 E014
avr00DA:  ld     r16, X+      ; 00DA 910D
          rcall  avr02B4      ; 00DB D1D8
          inc    r18          ; 00DC 9523
          dec    r17          ; 00DD 951A
           brne  avr00DA      ; 00DE F7D9
          ldi    r16, 0x90    ; 00DF E900
          rcall  avr0202      ; 00E0 D121
          rcall  avr0299      ; 00E1 D1B7
          rcall  avr0299      ; 00E2 D1B6
          cli                 ; 00E3 94F8
          ldi    r16, 0x20    ; 00E4 E200
          rcall  avr0202      ; 00E5 D11C
          rcall  avr0299      ; 00E6 D1B2
          rcall  avr0299      ; 00E7 D1B1
          sbi    DDRD, 5      ; 00E8 9A8D
          sbi    PORTD, 5     ; 00E9 9A95
          rjmp   avr0038      ; 00EA CF4D
avr00EB:  ldi    XL, 0x64     ; 00EB E6A4
          ld     r17, X+      ; 00EC 911D
          ldi    XL, 0x65     ; 00ED E6A5
avr00EE:  rcall  avr01EB      ; 00EE D0FC
          rcall  avr0295      ; 00EF D1A5
          st     X+, r16      ; 00F0 930D
          dec    r17          ; 00F1 951A
           brne  avr00EE      ; 00F2 F7D9
          rcall  avr01EB      ; 00F3 D0F7
          rcall  avr0295      ; 00F4 D1A0
          rcall  avr01EB      ; 00F5 D0F5
          sbi    DDRD, 5      ; 00F6 9A8D
          cbi    PORTD, 5     ; 00F7 9895
          ldi    XL, 0x65     ; 00F8 E6A5
          ld     r16, X+      ; 00F9 910D
          cpi    r16, 0x7E    ; 00FA 370E
           brne  avr00FE      ; 00FB F411
          ldi    XL, 0x7A     ; 00FC E7AA
          rjmp   avr00FF      ; 00FD C001
avr00FE:  ldi    XL, 0x68     ; 00FE E6A8
avr00FF:  ldi    YL, 0xB8     ; 00FF EBC8
          ldi    r17, 0x08    ; 0100 E018
avr0101:  ld     r16, X+      ; 0101 910D
          ld     r19, Y+      ; 0102 9139
          cp     r19, r16     ; 0103 1730
           brne  avr0111      ; 0104 F461
          dec    r17          ; 0105 951A
           brne  avr0101      ; 0106 F7D1
          cli                 ; 0107 94F8
          ldi    r17, 0x05    ; 0108 E015
avr0109:  rcall  avr01EB      ; 0109 D0E1
          dec    r17          ; 010A 951A
           brne  avr0109      ; 010B F7E9
          rcall  avr0295      ; 010C D188
          rcall  avr0295      ; 010D D187
          rcall  avr0295      ; 010E D186
          rcall  avr0295      ; 010F D185
          rjmp   avr0149      ; 0110 C038
avr0111:  sbis   PIND, 6      ; 0111 9B86
          rjmp   avr0111      ; 0112 CFFE
          ldi    r19, 0x01    ; 0113 E031
          rcall  avr029D      ; 0114 D188
          sbis   PIND, 6      ; 0115 9B86
          rjmp   avr0111      ; 0116 CFFA
          sbi    DDRD, 6      ; 0117 9A8E
          cbi    PORTD, 6     ; 0118 9896
          sbi    DDRB, 1      ; 0119 9AB9
          cbi    PORTB, 1     ; 011A 98C1
          sbi    DDRB, 0      ; 011B 9AB8
          cbi    PORTB, 0     ; 011C 98C0
          rcall  avr0299      ; 011D D17B
          ldi    r18, 0x08    ; 011E E028
          rcall  avr02BE      ; 011F D19E
          rcall  avr02C6      ; 0120 D1A5
          ldi    r18, 0x09    ; 0121 E029
          rcall  avr02BE      ; 0122 D19B
          rcall  avr02C6      ; 0123 D1A2
          ldi    r18, 0x0A    ; 0124 E02A
          rcall  avr02BE      ; 0125 D198
          rcall  avr02C6      ; 0126 D19F
          ldi    r18, 0x0B    ; 0127 E02B
          rcall  avr02BE      ; 0128 D195
          rcall  avr02C6      ; 0129 D19C
          cpi    r20, 0x55    ; 012A 3545
           breq  avr0143      ; 012B F0B9
          ldi    r17, 0x05    ; 012C E015
          ldi    XL, 0x60     ; 012D E6A0
avr012E:  ld     r16, X+      ; 012E 910D
          rcall  avr02C6      ; 012F D196
          dec    r17          ; 0130 951A
           brne  avr012E      ; 0131 F7E1
          ldi    r25, 0x20    ; 0132 E290
          rcall  avr0296      ; 0133 D162
          ldi    XL, 0x64     ; 0134 E6A4
          ld     r17, X+      ; 0135 911D
          ldi    XL, 0x65     ; 0136 E6A5
avr0137:  ld     r16, X+      ; 0137 910D
          rcall  avr02C6      ; 0138 D18D
          dec    r17          ; 0139 951A
           brne  avr0137      ; 013A F7E1
          rcall  avr0299      ; 013B D15D
          cbi    DDRB, 1      ; 013C 98B9
          sbi    PORTB, 1     ; 013D 9AC1
          cbi    DDRB, 0      ; 013E 98B8
          sbi    PORTB, 0     ; 013F 9AC0
          ldi    XL, 0xC0     ; 0140 ECA0
          ldi    r17, 0x0D    ; 0141 E01D
          nop                 ; 0142 0000
avr0143:  rcall  avr02E0      ; 0143 D19C
          st     X+, r16      ; 0144 930D
          dec    r17          ; 0145 951A
           brne  avr0143      ; 0146 F7E1
          cbi    DDRD, 6      ; 0147 988E
          sbi    PORTD, 6     ; 0148 9A96
avr0149:  ldi    r16, 0x54    ; 0149 E504
          rcall  avr0202      ; 014A D0B7
          rcall  avr02A2      ; 014B D156
          ldi    r17, 0x0D    ; 014C E01D
          ldi    XL, 0xC0     ; 014D ECA0
avr014E:  ld     r16, X+      ; 014E 910D
          rcall  avr0202      ; 014F D0B2
          rcall  avr0299      ; 0150 D148
          rcall  avr0299      ; 0151 D147
          dec    r17          ; 0152 951A
           brne  avr014E      ; 0153 F7D1
          ldi    r16, 0x90    ; 0154 E900
          rcall  avr0202      ; 0155 D0AC
          rcall  avr0299      ; 0156 D142
          nop                 ; 0157 0000
          rcall  avr0299      ; 0158 D140
          ldi    r16, 0x20    ; 0159 E200
          rcall  avr0202      ; 015A D0A7
          rcall  avr0299      ; 015B D13D
          rcall  avr0299      ; 015C D13C
          sbi    DDRD, 5      ; 015D 9A8D
          sbi    PORTD, 5     ; 015E 9A95
          ldi    XL, 0x68     ; 015F E6A8
          ldi    YL, 0xB8     ; 0160 EBC8
          ldi    r17, 0x08    ; 0161 E018
avr0162:  ld     r16, X+      ; 0162 910D
          st     Y+, r16      ; 0163 9309
          dec    r17          ; 0164 951A
           brne  avr0162      ; 0165 F7E1
          rjmp   avr0038      ; 0166 CED1
avr0167:  rcall  avr01EB      ; 0167 D083
          rcall  avr0295      ; 0168 D12C
          dec    r17          ; 0169 951A
          rcall  avr01EB      ; 016A D080
          rcall  avr0295      ; 016B D129
          dec    r17          ; 016C 951A
          cpi    r16, 0xAF    ; 016D 3A0F
           brne  avr017E      ; 016E F479
          rcall  avr01EB      ; 016F D07B
          rcall  avr0295      ; 0170 D124
          dec    r17          ; 0171 951A
          cpi    r16, 0xED    ; 0172 3E0D
           breq  avr0175      ; 0173 F009
avr0174:  rjmp   avr005E      ; 0174 CEE9
avr0175:  rcall  avr01EB      ; 0175 D075
          rcall  avr0295      ; 0176 D11E
          dec    r17          ; 0177 951A
           brne  avr0175      ; 0178 F7E1
          ldi    r16, 0x90    ; 0179 E900
          rcall  avr0232      ; 017A D0B7
          ldi    r16, 0x20    ; 017B E200
          rcall  avr0232      ; 017C D0B5
          rjmp   avr0038      ; 017D CEBA
avr017E:  cpi    r16, 0x5F    ; 017E 350F
           brne  avr0174      ; 017F F7A1
          rcall  avr01EB      ; 0180 D06A
          rcall  avr0295      ; 0181 D113
          nop                 ; 0182 0000
          dec    r17          ; 0183 951A
          cpi    r16, 0x65    ; 0184 3605
           breq  avr0187      ; 0185 F009
          rjmp   avr005E      ; 0186 CED7
avr0187:  rcall  avr01EB      ; 0187 D063
          rcall  avr0295      ; 0188 D10C
          dec    r17          ; 0189 951A
           brne  avr0187      ; 018A F7E1
          ldi    r16, 0x90    ; 018B E900
          rcall  avr0232      ; 018C D0A5
          ldi    r16, 0xA0    ; 018D EA00
          rcall  avr0232      ; 018E D0A3
          rjmp   avr0038      ; 018F CEA8
          cli                 ; 0190 94F8
          rcall  avr01EB      ; 0191 D059
          rcall  avr0295      ; 0192 D102
          nop                 ; 0193 0000
          dec    r17          ; 0194 951A
          cpi    r16, 0x65    ; 0195 3605
avr0196:  rcall  avr01EB      ; 0196 D054
          rcall  avr0295      ; 0197 D0FD
          dec    r17          ; 0198 951A
          rcall  avr01EB      ; 0199 D051
          rcall  avr0295      ; 019A D0FA
          dec    r17          ; 019B 951A
          rcall  avr01EB      ; 019C D04E
          rcall  avr0295      ; 019D D0F7
          dec    r17          ; 019E 951A
          rcall  avr01EB      ; 019F D04B
          rcall  avr0295      ; 01A0 D0F4
          dec    r17          ; 01A1 951A
          cpi    r16, 0x01    ; 01A2 3001
           breq  avr01A9      ; 01A3 F029
          rjmp   avr005E      ; 01A4 CEB9
          nop                 ; 01A5 0000
          cli                 ; 01A6 94F8
          nop                 ; 01A7 0000
          cli                 ; 01A8 94F8
avr01A9:  rcall  avr01EB      ; 01A9 D041
          rcall  avr0295      ; 01AA D0EA
          dec    r17          ; 01AB 951A
          cpi    r16, 0xA4    ; 01AC 3A04
           brlo  avr01AF      ; 01AD F008
          ldi    r20, 0x55    ; 01AE E545
avr01AF:  rjmp   avr005E      ; 01AF CEAE
avr01B0:  ldi    XL, 0x64     ; 01B0 E6A4
          ld     r17, X+      ; 01B1 911D
          rcall  avr01EB      ; 01B2 D038
          rcall  avr0295      ; 01B3 D0E1
          dec    r17          ; 01B4 951A
          cpi    r16, 0x09    ; 01B5 3009
           breq  avr0196      ; 01B6 F2F9
          rjmp   avr005E      ; 01B7 CEA6
          rcall  avr01EB      ; 01B8 D032
          rcall  avr0295      ; 01B9 D0DB
          dec    r17          ; 01BA 951A
          rcall  avr01EB      ; 01BB D02F
          rcall  avr0295      ; 01BC D0D8
          dec    r17          ; 01BD 951A
          cpi    r16, 0x42    ; 01BE 3402
           breq  avr01C4      ; 01BF F021
          cpi    r16, 0x40    ; 01C0 3400
           brne  avr01C3      ; 01C1 F409
          rjmp   avr0167      ; 01C2 CFA4
avr01C3:  rjmp   avr005E      ; 01C3 CE9A
avr01C4:  rcall  avr01EB      ; 01C4 D026
          rcall  avr0295      ; 01C5 D0CF
          dec    r17          ; 01C6 951A
          cpi    r17, 0x08    ; 01C7 3018
           brne  avr01C4      ; 01C8 F7D9
avr01C9:  sbis   PIND, 0      ; 01C9 9B80
          rjmp   avr01C9      ; 01CA CFFE
avr01CB:  sbic   PIND, 0      ; 01CB 9980
          rjmp   avr01CB      ; 01CC CFFE
          ldi    r25, 0x1E    ; 01CD E19E
          rcall  avr0296      ; 01CE D0C7
          sbi    DDRD, 5      ; 01CF 9A8D
          cbi    PORTD, 5     ; 01D0 9895
          sbi    DDRD, 4      ; 01D1 9A8C
          sbi    PORTD, 4     ; 01D2 9A94
          ldi    r25, 0x82    ; 01D3 E892
          rcall  avr0296      ; 01D4 D0C1
          ldi    r25, 0x82    ; 01D5 E892
          rcall  avr0296      ; 01D6 D0BF
          nop                 ; 01D7 0000
          sbi    PORTD, 4     ; 01D8 9A94
          cbi    DDRD, 4      ; 01D9 988C
          sbi    DDRD, 5      ; 01DA 9A8D
          sbi    PORTD, 5     ; 01DB 9A95
          ldi    r25, 0x0E    ; 01DC E09E
          rcall  avr0296      ; 01DD D0B8
avr01DE:  sbis   PIND, 0      ; 01DE 9B80
          rjmp   avr01DE      ; 01DF CFFE
          rcall  avr0295      ; 01E0 D0B4
          dec    r17          ; 01E1 951A
           brne  avr01C9      ; 01E2 F731
          nop                 ; 01E3 0000
          nop                 ; 01E4 0000
          ldi    r16, 0x90    ; 01E5 E900
          rcall  avr0232      ; 01E6 D04B
          ldi    r16, 0xA0    ; 01E7 EA00
          rcall  avr0232      ; 01E8 D049
          cli                 ; 01E9 94F8
          rjmp   avr0038      ; 01EA CE4D
avr01EB:  sbis   PIND, 0      ; 01EB 9B80
          rjmp   avr01EB      ; 01EC CFFE
avr01ED:  sbic   PIND, 0      ; 01ED 9980
          rjmp   avr01ED      ; 01EE CFFE
          ldi    r25, 0x10    ; 01EF E190
avr01F0:  dec    r25          ; 01F0 959A
           brne  avr01F0      ; 01F1 F7F1
          ldi    r16, 0x01    ; 01F2 E001
avr01F3:  ldi    r25, 0x40    ; 01F3 E490
avr01F4:  dec    r25          ; 01F4 959A
           brne  avr01F4      ; 01F5 F7F1
          in     r24, PIND    ; 01F6 B380
          lsr    r24          ; 01F7 9586
          rol    r16          ; 01F8 1F00
           brsh  avr01F3      ; 01F9 F7C8
          com    r16          ; 01FA 9500
          nop                 ; 01FB 0000
          ldi    r25, 0x20    ; 01FC E290
avr01FD:  dec    r25          ; 01FD 959A
           brne  avr01FD      ; 01FE F7F1
avr01FF:  sbis   PIND, 0      ; 01FF 9B80
          rjmp   avr01FF      ; 0200 CFFE
          ret                 ; 0201 9508
avr0202:  sbis   PIND, 0      ; 0202 9B80
          rjmp   avr0202      ; 0203 CFFE
          sbi    DDRD, 0      ; 0204 9A88
          ldi    r25, 0x08    ; 0205 E098
          rcall  avr0296      ; 0206 D08F
          rjmp   avr0208      ; 0207 C000
avr0208:  cbi    PORTD, 0     ; 0208 9890
          ldi    r18, 0x08    ; 0209 E028
          clr    r24          ; 020A 2788
          ldi    r19, 0x3B    ; 020B E33B
          nop                 ; 020C 0000
avr020D:  mov    r25, r19     ; 020D 2F93
          rcall  avr0296      ; 020E D087
          nop                 ; 020F 0000
          rol    r16          ; 0210 1F00
           brlo  avr0230      ; 0211 F0F0
          nop                 ; 0212 0000
          sbi    PORTD, 0     ; 0213 9A90
          rjmp   avr0215      ; 0214 C000
avr0215:  adc    r24, r25     ; 0215 1F89
          andi   r24, 0x01    ; 0216 7081
          ldi    r19, 0x38    ; 0217 E338
          nop                 ; 0218 0000
          dec    r18          ; 0219 952A
           brne  avr020D      ; 021A F791
          ldi    r25, 0x38    ; 021B E398
          nop                 ; 021C 0000
          nop                 ; 021D 0000
          rcall  avr0296      ; 021E D077
          rjmp   avr0220      ; 021F C000
avr0220:  ror    r24          ; 0220 9587
           brlo  avr022E      ; 0221 F060
          nop                 ; 0222 0000
          sbi    PORTD, 0     ; 0223 9A90
          rjmp   avr0225      ; 0224 C000
avr0225:  ldi    r25, 0x1E    ; 0225 E19E
          nop                 ; 0226 0000
          nop                 ; 0227 0000
          rcall  avr0296      ; 0228 D06D
          nop                 ; 0229 0000
          rjmp   avr022B      ; 022A C000
avr022B:  sbi    PORTD, 0     ; 022B 9A90
          cbi    DDRD, 0      ; 022C 9888
          ret                 ; 022D 9508
avr022E:  cbi    PORTD, 0     ; 022E 9890
          rjmp   avr0225      ; 022F CFF5
avr0230:  cbi    PORTD, 0     ; 0230 9890
          rjmp   avr0215      ; 0231 CFE3
avr0232:  sbis   PIND, 0      ; 0232 9B80
          rjmp   avr0232      ; 0233 CFFE
avr0234:  sbic   PIND, 0      ; 0234 9980
          rjmp   avr0234      ; 0235 CFFE
          sbi    DDRD, 5      ; 0236 9A8D
          cbi    PORTD, 5     ; 0237 9895
          nop                 ; 0238 0000
          rcall  avr023D      ; 0239 D003
          sbi    DDRD, 5      ; 023A 9A8D
          sbi    PORTD, 5     ; 023B 9A95
          ret                 ; 023C 9508
avr023D:  sbis   PIND, 0      ; 023D 9B80
          rjmp   avr023D      ; 023E CFFE
          sbi    DDRD, 0      ; 023F 9A88
          ldi    r25, 0x02    ; 0240 E092
          rcall  avr0296      ; 0241 D054
          rjmp   avr0243      ; 0242 C000
avr0243:  cbi    PORTD, 0     ; 0243 9890
          ldi    r18, 0x08    ; 0244 E028
          clr    r24          ; 0245 2788
          ldi    r19, 0x28    ; 0246 E238
          nop                 ; 0247 0000
avr0248:  mov    r25, r19     ; 0248 2F93
          rcall  avr0296      ; 0249 D04C
          nop                 ; 024A 0000
          rol    r16          ; 024B 1F00
           brlo  avr0268      ; 024C F0D8
          nop                 ; 024D 0000
          sbi    PORTD, 0     ; 024E 9A90
          rjmp   avr0250      ; 024F C000
avr0250:  adc    r24, r25     ; 0250 1F89
          andi   r24, 0x01    ; 0251 7081
          ldi    r19, 0x38    ; 0252 E338
          nop                 ; 0253 0000
          nop                 ; 0254 0000
          dec    r18          ; 0255 952A
           brne  avr0248      ; 0256 F789
          ldi    r25, 0x38    ; 0257 E398
          rcall  avr0296      ; 0258 D03D
          rjmp   avr025A      ; 0259 C000
avr025A:  ror    r24          ; 025A 9587
           brlo  avr0266      ; 025B F050
          nop                 ; 025C 0000
          sbi    PORTD, 0     ; 025D 9A90
          rjmp   avr025F      ; 025E C000
avr025F:  ldi    r25, 0x1E    ; 025F E19E
          rcall  avr0296      ; 0260 D035
          nop                 ; 0261 0000
          rjmp   avr0263      ; 0262 C000
avr0263:  sbi    PORTD, 0     ; 0263 9A90
          cbi    DDRD, 0      ; 0264 9888
          ret                 ; 0265 9508
avr0266:  cbi    PORTD, 0     ; 0266 9890
          rjmp   avr025F      ; 0267 CFF7
avr0268:  cbi    PORTD, 0     ; 0268 9890
          rjmp   avr0250      ; 0269 CFE6
avr026A:  sbis   PIND, 4      ; 026A 9B84
          rjmp   avr026A      ; 026B CFFE
          sbi    DDRD, 4      ; 026C 9A8C
          ldi    r25, 0x04    ; 026D E094
          rcall  avr0296      ; 026E D027
          rjmp   avr0270      ; 026F C000
avr0270:  cbi    PORTD, 4     ; 0270 9894
          rjmp   avr0272      ; 0271 C000
avr0272:  rjmp   avr0273      ; 0272 C000
avr0273:  nop                 ; 0273 0000
          ldi    r18, 0x08    ; 0274 E028
          clr    r24          ; 0275 2788
avr0276:  ldi    r25, 0x18    ; 0276 E198
          rcall  avr0296      ; 0277 D01E
          nop                 ; 0278 0000
          rol    r16          ; 0279 1F00
           brlo  avr0293      ; 027A F0C0
          nop                 ; 027B 0000
          sbi    PORTD, 4     ; 027C 9A94
          rjmp   avr027E      ; 027D C000
avr027E:  adc    r24, r25     ; 027E 1F89
          andi   r24, 0x01    ; 027F 7081
          dec    r18          ; 0280 952A
           brne  avr0276      ; 0281 F7A1
          ldi    r25, 0x18    ; 0282 E198
          rcall  avr0296      ; 0283 D012
          rjmp   avr0285      ; 0284 C000
avr0285:  ror    r24          ; 0285 9587
           brlo  avr0291      ; 0286 F050
          nop                 ; 0287 0000
          sbi    PORTD, 4     ; 0288 9A94
          rjmp   avr028A      ; 0289 C000
avr028A:  ldi    r25, 0x32    ; 028A E392
          rcall  avr0296      ; 028B D00A
          nop                 ; 028C 0000
          rjmp   avr028E      ; 028D C000
avr028E:  sbi    PORTD, 4     ; 028E 9A94
          cbi    DDRD, 4      ; 028F 988C
          ret                 ; 0290 9508
avr0291:  cbi    PORTD, 4     ; 0291 9894
          rjmp   avr028A      ; 0292 CFF7
avr0293:  cbi    PORTD, 4     ; 0293 9894
          rjmp   avr027E      ; 0294 CFE9
avr0295:  ldi    r25, 0x80    ; 0295 E890
avr0296:  dec    r25          ; 0296 959A
           brne  avr0296      ; 0297 F7F1
          ret                 ; 0298 9508
avr0299:  ldi    r25, 0xA0    ; 0299 EA90
          rjmp   avr0296      ; 029A CFFB
avr029B:  ldi    r25, 0x20    ; 029B E290
          rjmp   avr0296      ; 029C CFF9
avr029D:  rcall  avr029B      ; 029D DFFD
          dec    r19          ; 029E 953A
           brne  avr029D      ; 029F F7E9
          rcall  avr0299      ; 02A0 DFF8
          ret                 ; 02A1 9508
avr02A2:  ldi    r22, 0xFF    ; 02A2 EF6F
          ldi    r24, 0x00    ; 02A3 E080
          lsr    r22          ; 02A4 9566
           brlo  avr02A6      ; 02A5 F000
avr02A6:  lsr    r22          ; 02A6 9566
           brsh  avr02AA      ; 02A7 F410
          nop                 ; 02A8 0000
          rjmp   avr02AA      ; 02A9 C000
avr02AA:  inc    r22          ; 02AA 9563
          inc    r24          ; 02AB 9583
avr02AC:  nop                 ; 02AC 0000
          dec    r22          ; 02AD 956A
           brne  avr02AC      ; 02AE F7E9
          nop                 ; 02AF 0000
          ldi    r22, 0x3F    ; 02B0 E36F
          dec    r24          ; 02B1 958A
           brne  avr02AC      ; 02B2 F7C9
          ret                 ; 02B3 9508
avr02B4:  sbic   EECR, 1      ; 02B4 99E1
          rjmp   avr02B4      ; 02B5 CFFE
          ldi    r19, 0x00    ; 02B6 E030
          out    EECR, r19    ; 02B7 BB3C
          out    EEARL, r18   ; 02B8 BB2E
          out    EEDR, r16    ; 02B9 BB0D
          ldi    r19, 0x04    ; 02BA E034
          out    EECR, r19    ; 02BB BB3C
          sbi    EECR, 1      ; 02BC 9AE1
          ret                 ; 02BD 9508
avr02BE:  sbic   EECR, 1      ; 02BE 99E1
          rjmp   avr02BE      ; 02BF CFFE
          out    EEARL, r18   ; 02C0 BB2E
          ldi    r19, 0x00    ; 02C1 E030
          out    EECR, r19    ; 02C2 BB3C
          sbi    EECR, 0      ; 02C3 9AE0
          in     r16, EEDR    ; 02C4 B30D
          ret                 ; 02C5 9508
avr02C6:  ldi    r18, 0x08    ; 02C6 E028
avr02C7:  ldi    r25, 0x10    ; 02C7 E190
          rcall  avr0296      ; 02C8 DFCD
          rol    r16          ; 02C9 1F00
           brlo  avr02CD      ; 02CA F010
          cbi    PORTB, 0     ; 02CB 98C0
          rjmp   avr02CE      ; 02CC C001
avr02CD:  sbi    PORTB, 0     ; 02CD 9AC0
avr02CE:  ldi    r25, 0x20    ; 02CE E290
          rcall  avr0296      ; 02CF DFC6
          sbi    PORTB, 1     ; 02D0 9AC1
          ldi    r25, 0x20    ; 02D1 E290
          rcall  avr0296      ; 02D2 DFC3
          cbi    PORTB, 1     ; 02D3 98C1
          ldi    r25, 0x20    ; 02D4 E290
          rcall  avr0296      ; 02D5 DFC0
          dec    r18          ; 02D6 952A
           brne  avr02C7      ; 02D7 F779
          ldi    r25, 0x46    ; 02D8 E496
          rcall  avr0296      ; 02D9 DFBC
          ret                 ; 02DA 9508
          cli                 ; 02DB 94F8
          rol    r16          ; 02DC 1F00
           brlo  avr02CD      ; 02DD F378
          cbi    PORTB, 0     ; 02DE 98C0
          rjmp   avr02CE      ; 02DF CFEE
avr02E0:  ldi    r16, 0x01    ; 02E0 E001
avr02E1:  sbic   PINB, 1      ; 02E1 99B1
          rjmp   avr02E1      ; 02E2 CFFE
avr02E3:  sbis   PINB, 1      ; 02E3 9BB1
          rjmp   avr02E3      ; 02E4 CFFE
          clc                 ; 02E5 9488
          sbic   PINB, 0      ; 02E6 99B0
          sec                 ; 02E7 9408
          rol    r16          ; 02E8 1F00
           brsh  avr02E1      ; 02E9 F7B8
          ret                 ; 02EA 9508
          rol    r16          ; 02EB 1F00
           brlo  avr02CD      ; 02EC F300
          cbi    PORTB, 0     ; 02ED 98C0
          rjmp   avr02CE      ; 02EE CFDF
          rcall  avr0296      ; 02EF DFA6
          nop                 ; 02F0 0000
          rol    r16          ; 02F1 1F00
          ret                 ; 02F2 9508

         .exit

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have DISavr my hex program, but I sometimes get ? in my code. See the example.

ldi r16, 0x00 ; 045B E000
out ?0x01?, r16 ; 045C B901
ldi r16, 0x01 ; 045D E001
out ?0x00?, r16 ; 045E B900
ldi r16, 0x00 ; 045F E000

What is the problem over here?? Please advise.
Thanx in advance.

By the way: Great program!!!
Regards, Alex

Cheers,

Alex van der Lans

You can find me @ skype as: alex1678

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The ?? means that the IO selection 0xB9 isn't plugged into a table inside the .exe. A future version could allow people to keep the IO register table in a text-file because Atmel has added many IOs that were not around in 1997.

I've added more to the table but it's a pain because some are double-mapped as I recall.

You could lookup 0xB9 yourself and change this in your program to reflect the ?0x01?. The code is still correct.

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This may help other down stream.

I will use file name g.hex as an examlpe.

Download the program, and put it in it own folder. Put the hex file you want to disassemble in that folder as well.

Open "Command Prompt" type

c:\ disavr g.hex > g.src

A file will be made in the folder called g.src, change the name to g.asm, open in your text editor and make what ever changes you require. On the top of the file you have to put in your ".include ????def" for the Micro the hex file was made for. Save using a different name. eg: h.asm

Open AVR studio under Project menu >>new project select the h.asm file you saved. Scroll and see that your changes you made are there. Now compile you will get the modified h.hex

Hope this helps.

Node

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

this file is corrupt, can anyone else upload it or provide a link?

thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was able to fix the zip archive using the free zipfix program, but it only has an EXE inside. I'd love to get the source!

http://www.ericengler.com/downlo...

Eric

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SxPilot450, I hope you don't get mad.
I wrote an envelope code around your program to list real byte address on the code and the ASCII representation of that particular line of code plus the next 7 lines. It becomes easier to find DATA strings after disassembly. My DisAVRex (DisAVR EXtented) just calls your program then adds the extra text on each line. Perhaps in the future you could update your program (already very good) to do something like that.

Thanks a lot for your disassembler.
WagnerLip

http://www.ustr.net/avrfiles/disavrex.rar

Wagner Lipnharski
Orlando Florida USA

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

wagnerlip wrote:
SxPilot450, I hope you don't get mad.
I wrote an envelope code around your program to list real byte address on the code and the ASCII representation of that particular line of code plus the next 7 lines. It becomes easier to find DATA strings after disassembly. My DisAVRex (DisAVR EXtented) just calls your program then adds the extra text on each line. Perhaps in the future you could update your program (already very good) to do something like that.

Thanks a lot for your disassembler.
WagnerLip

Hi, no problem WagnerLip.

Nice touch ;).

http://www.ustr.net/avrfiles/disavrex.rar

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

can u plz help me convert this to asm.. i m unable to find a converter

:1000000012C0189518951895189518951895189563
:100010001895189518951895189518951895189578
:100020001895189518958FED8DBFC0ECE4EB4E2E0A
:10003000DD275D2EEEE7F0E0A0E6B0E088278D93A7
:100040003197E9F784B7082E877F84BF8FE181BDA0
:1000500087E081BD66248FE787BB80E088BB83E8AB
:100060008FBD82E08EBD80E090E090934B00809346
:100070004A0082E08EBDE0EFF1E0BED081E090E08A
:10008000A4E68D939C93A4E60D911C91073050E05B
:10009000150710F009F00CC0B2D0A4E6AD90A8E6A8
:1000A000AA0DDCD00C92A8D0A4E6ACD008F4EBCF1B
:1000B000A6E6D8D0E1E0F0E0B3D0E9E0F0E0A2E7D6
:1000C00091E0F1D080917200815080937200E9E05C
:1000D000F0E0A2E791E07BE7D5D0009172000F3904
:1000E00008F00AC080E090E090934B0080934A00B3
:1000F00085B7816285BF889581E090E0A6E68D9303
:100100009C93A6E60D911C91073050E0150710F066
:1001100009F06DC0A6E6AD90A8E6AA0D8C9180937B
:100120007100A1E78C9188BB88EC90E088D08AE0D0
:1001300090E0A4E68D939C93A4E60D911C910E3F54
:1001400053E0150708F021C0A4E65CD0A4E68D9129
:100150009C9190934B0080934A00A4E60D911C91D2
:10016000083750E0150708F006C08EE090E0A0E6E2
:100170008D939C9305C088E090E0A0E68D939C93BE
:10018000A0E68D919C915BD0D7CF88EC90E057D0C2
:10019000A4E60D911C910A3050E0150710F009F00B
:1001A00001C021C0A4E635D0A4E68D919C91909326
:1001B0004B0080934A00A4E60D911C910A3550E053
:1001C000150708F006C08EE090E0A0E68D939C93A2
:1001D00005C088E090E0A0E68D939C93A0E68D9109
:1001E0009C912DD0D5CFA6E60DD008F48ACF65CF4F
:1001F00001020403060507008E2E9F2E0895E82DA8
:10020000F92D0895ED91FC91EF5FFF4FFC93EE9374
:100210000895ED91FC91E150F040FC93EE93089528
:1002200088EE93E00CD03197D9F708953197F1F724
:100230000895689462F80895E89462F80895EF9339
:10024000FF93EE27E82BE92B31F0EAEFF0E031974E
:10025000F1F70197D1F7FF91EF910895C895319685
:100260000020089582E001C084E099279D938A953B
:10027000E9F70895E199FECFEEBB3196089591E03C
:1002800001C092E07B3751F47FB7F894F3DF8D9192
:100290008DBBE29AE19A9A95C9F77FBF77270895B7
:1002A00091E001C092E0E6DFE09A8DB38D939A95DC
:0402B000D1F70895E5
:00000001FF

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did you read this thread? It's about a tool called "disavr". I just ran your hex through this and got:

	  ; Atmel Win32 AVR Disassembler v1.01
	  ;
         .cseg
         .org	0

          rjmp   avr0013      ; 0000 C012
          reti                ; 0001 9518
          reti                ; 0002 9518
          reti                ; 0003 9518
          reti                ; 0004 9518
          reti                ; 0005 9518
          reti                ; 0006 9518
          reti                ; 0007 9518
          reti                ; 0008 9518
          reti                ; 0009 9518
          reti                ; 000A 9518
          reti                ; 000B 9518
          reti                ; 000C 9518
          reti                ; 000D 9518
          reti                ; 000E 9518
          reti                ; 000F 9518
          reti                ; 0010 9518
          reti                ; 0011 9518
          reti                ; 0012 9518
avr0013:  ldi    r24, 0xDF    ; 0013 ED8F
          out    SPL, r24     ; 0014 BF8D
          ldi    YL, 0xC0     ; 0015 ECC0
          ldi    ZL, 0xB4     ; 0016 EBE4
          mov    r4, ZL       ; 0017 2E4E
          clr    YH           ; 0018 27DD
          mov    r5, YH       ; 0019 2E5D
          ldi    ZL, 0x7E     ; 001A E7EE
          ldi    ZH, 0x00     ; 001B E0F0
          ldi    XL, 0x60     ; 001C E6A0
          ldi    XH, 0x00     ; 001D E0B0
          clr    r24          ; 001E 2788
avr001F:  st     X+, r24      ; 001F 938D
          sbiw   ZL, 0x01     ; 0020 9731
           brne  avr001F      ; 0021 F7E9
          in     r24, MCUCSR  ; 0022 B784
          mov    r0, r24      ; 0023 2E08
          andi   r24, 0xF7    ; 0024 7F87
          out    MCUCSR, r24  ; 0025 BF84
          ldi    r24, 0x1F    ; 0026 E18F
          out    WDTCR, r24   ; 0027 BD81
          ldi    r24, 0x07    ; 0028 E087
          out    WDTCR, r24   ; 0029 BD81
          clr    r6           ; 002A 2466
          ldi    r24, 0x7F    ; 002B E78F
          out    DDRB, r24    ; 002C BB87
          ldi    r24, 0x00    ; 002D E080
          out    PORTB, r24   ; 002E BB88
          ldi    r24, 0x83    ; 002F E883
          out    TCCR1A, r24  ; 0030 BD8F
          ldi    r24, 0x02    ; 0031 E082
          out    TCCR1B, r24  ; 0032 BD8E
          ldi    r24, 0x00    ; 0033 E080
          ldi    r25, 0x00    ; 0034 E090
          sts    0x004B, r25  ; 0035 9390 004B
          sts    0x004A, r24  ; 0037 9380 004A
          ldi    r24, 0x02    ; 0039 E082
          out    TCCR1B, r24  ; 003A BD8E
          ldi    ZL, 0xF0     ; 003B EFE0
          ldi    ZH, 0x01     ; 003C E0F1
          rcall  avr00FC      ; 003D D0BE
          ldi    r24, 0x01    ; 003E E081
          ldi    r25, 0x00    ; 003F E090
          ldi    XL, 0x64     ; 0040 E6A4
          st     X+, r24      ; 0041 938D
          st     X, r25       ; 0042 939C
avr0043:  ldi    XL, 0x64     ; 0043 E6A4
          ld     r16, X+      ; 0044 910D
          ld     r17, X       ; 0045 911C
          cpi    r16, 0x07    ; 0046 3007
          ldi    r21, 0x00    ; 0047 E050
          cpc    r17, r21     ; 0048 0715
           brlo  avr004C      ; 0049 F010
           breq  avr004C      ; 004A F009
          rjmp   avr0058      ; 004B C00C
avr004C:  rcall  avr00FF      ; 004C D0B2
          ldi    XL, 0x64     ; 004D E6A4
          ld     r10, X+      ; 004E 90AD
          ldi    XL, 0x68     ; 004F E6A8
          add    XL, r10      ; 0050 0DAA
          rcall  avr012E      ; 0051 D0DC
          st     X, r0        ; 0052 920C
          rcall  avr00FC      ; 0053 D0A8
          ldi    XL, 0x64     ; 0054 E6A4
          rcall  avr0102      ; 0055 D0AC
           brsh  avr0058      ; 0056 F408
          rjmp   avr0043      ; 0057 CFEB
avr0058:  ldi    XL, 0x66     ; 0058 E6A6
          rcall  avr0132      ; 0059 D0D8
          ldi    ZL, 0x01     ; 005A E0E1
          ldi    ZH, 0x00     ; 005B E0F0
          rcall  avr0110      ; 005C D0B3
avr005D:  ldi    ZL, 0x09     ; 005D E0E9
          ldi    ZH, 0x00     ; 005E E0F0
          ldi    XL, 0x72     ; 005F E7A2
          ldi    r25, 0x01    ; 0060 E091
          rcall  avr0153      ; 0061 D0F1
          lds    r24, 0x0072  ; 0062 9180 0072
          subi   r24, 0x01    ; 0064 5081
          sts    0x0072, r24  ; 0065 9380 0072
          ldi    ZL, 0x09     ; 0067 E0E9
          ldi    ZH, 0x00     ; 0068 E0F0
          ldi    XL, 0x72     ; 0069 E7A2
          ldi    r25, 0x01    ; 006A E091
          ldi    r23, 0x7B    ; 006B E77B
          rcall  avr0142      ; 006C D0D5
          lds    r16, 0x0072  ; 006D 9100 0072
          cpi    r16, 0x9F    ; 006F 390F
           brlo  avr0072      ; 0070 F008
          rjmp   avr007C      ; 0071 C00A
avr0072:  ldi    r24, 0x00    ; 0072 E080
          ldi    r25, 0x00    ; 0073 E090
          sts    0x004B, r25  ; 0074 9390 004B
          sts    0x004A, r24  ; 0076 9380 004A
          in     r24, MCUCR   ; 0078 B785
          ori    r24, 0x21    ; 0079 6281
          out    MCUCR, r24   ; 007A BF85
          sleep               ; 007B 9588
avr007C:  ldi    r24, 0x01    ; 007C E081
          ldi    r25, 0x00    ; 007D E090
          ldi    XL, 0x66     ; 007E E6A6
          st     X+, r24      ; 007F 938D
          st     X, r25       ; 0080 939C
avr0081:  ldi    XL, 0x66     ; 0081 E6A6
          ld     r16, X+      ; 0082 910D
          ld     r17, X       ; 0083 911C
          cpi    r16, 0x07    ; 0084 3007
          ldi    r21, 0x00    ; 0085 E050
          cpc    r17, r21     ; 0086 0715
           brlo  avr008A      ; 0087 F010
           breq  avr008A      ; 0088 F009
          rjmp   avr00F7      ; 0089 C06D
avr008A:  ldi    XL, 0x66     ; 008A E6A6
          ld     r10, X+      ; 008B 90AD
          ldi    XL, 0x68     ; 008C E6A8
          add    XL, r10      ; 008D 0DAA
          ld     r24, X       ; 008E 918C
          sts    0x0071, r24  ; 008F 9380 0071
          ldi    XL, 0x71     ; 0091 E7A1
          ld     r24, X       ; 0092 918C
          out    PORTB, r24   ; 0093 BB88
          ldi    r24, 0xC8    ; 0094 EC88
          ldi    r25, 0x00    ; 0095 E090
          rcall  avr011F      ; 0096 D088
          ldi    r24, 0x0A    ; 0097 E08A
          ldi    r25, 0x00    ; 0098 E090
          ldi    XL, 0x64     ; 0099 E6A4
          st     X+, r24      ; 009A 938D
          st     X, r25       ; 009B 939C
avr009C:  ldi    XL, 0x64     ; 009C E6A4
          ld     r16, X+      ; 009D 910D
          ld     r17, X       ; 009E 911C
          cpi    r16, 0xFE    ; 009F 3F0E
          ldi    r21, 0x03    ; 00A0 E053
          cpc    r17, r21     ; 00A1 0715
           brlo  avr00A4      ; 00A2 F008
          rjmp   avr00C5      ; 00A3 C021
avr00A4:  ldi    XL, 0x64     ; 00A4 E6A4
          rcall  avr0102      ; 00A5 D05C
          ldi    XL, 0x64     ; 00A6 E6A4
          ld     r24, X+      ; 00A7 918D
          ld     r25, X       ; 00A8 919C
          sts    0x004B, r25  ; 00A9 9390 004B
          sts    0x004A, r24  ; 00AB 9380 004A
          ldi    XL, 0x64     ; 00AD E6A4
          ld     r16, X+      ; 00AE 910D
          ld     r17, X       ; 00AF 911C
          cpi    r16, 0x78    ; 00B0 3708
          ldi    r21, 0x00    ; 00B1 E050
          cpc    r17, r21     ; 00B2 0715
           brlo  avr00B5      ; 00B3 F008
          rjmp   avr00BB      ; 00B4 C006
avr00B5:  ldi    r24, 0x0E    ; 00B5 E08E
          ldi    r25, 0x00    ; 00B6 E090
          ldi    XL, 0x60     ; 00B7 E6A0
          st     X+, r24      ; 00B8 938D
          st     X, r25       ; 00B9 939C
          rjmp   avr00C0      ; 00BA C005
avr00BB:  ldi    r24, 0x08    ; 00BB E088
          ldi    r25, 0x00    ; 00BC E090
          ldi    XL, 0x60     ; 00BD E6A0
          st     X+, r24      ; 00BE 938D
          st     X, r25       ; 00BF 939C
avr00C0:  ldi    XL, 0x60     ; 00C0 E6A0
          ld     r24, X+      ; 00C1 918D
          ld     r25, X       ; 00C2 919C
          rcall  avr011F      ; 00C3 D05B
          rjmp   avr009C      ; 00C4 CFD7
avr00C5:  ldi    r24, 0xC8    ; 00C5 EC88
          ldi    r25, 0x00    ; 00C6 E090
          rcall  avr011F      ; 00C7 D057
avr00C8:  ldi    XL, 0x64     ; 00C8 E6A4
          ld     r16, X+      ; 00C9 910D
          ld     r17, X       ; 00CA 911C
          cpi    r16, 0x0A    ; 00CB 300A
          ldi    r21, 0x00    ; 00CC E050
          cpc    r17, r21     ; 00CD 0715
           brlo  avr00D1      ; 00CE F010
           breq  avr00D1      ; 00CF F009
          rjmp   avr00D2      ; 00D0 C001
avr00D1:  rjmp   avr00F3      ; 00D1 C021
avr00D2:  ldi    XL, 0x64     ; 00D2 E6A4
          rcall  avr0109      ; 00D3 D035
          ldi    XL, 0x64     ; 00D4 E6A4
          ld     r24, X+      ; 00D5 918D
          ld     r25, X       ; 00D6 919C
          sts    0x004B, r25  ; 00D7 9390 004B
          sts    0x004A, r24  ; 00D9 9380 004A
          ldi    XL, 0x64     ; 00DB E6A4
          ld     r16, X+      ; 00DC 910D
          ld     r17, X       ; 00DD 911C
          cpi    r16, 0x5A    ; 00DE 350A
          ldi    r21, 0x00    ; 00DF E050
          cpc    r17, r21     ; 00E0 0715
           brlo  avr00E3      ; 00E1 F008
          rjmp   avr00E9      ; 00E2 C006
avr00E3:  ldi    r24, 0x0E    ; 00E3 E08E
          ldi    r25, 0x00    ; 00E4 E090
          ldi    XL, 0x60     ; 00E5 E6A0
          st     X+, r24      ; 00E6 938D
          st     X, r25       ; 00E7 939C
          rjmp   avr00EE      ; 00E8 C005
avr00E9:  ldi    r24, 0x08    ; 00E9 E088
          ldi    r25, 0x00    ; 00EA E090
          ldi    XL, 0x60     ; 00EB E6A0
          st     X+, r24      ; 00EC 938D
          st     X, r25       ; 00ED 939C
avr00EE:  ldi    XL, 0x60     ; 00EE E6A0
          ld     r24, X+      ; 00EF 918D
          ld     r25, X       ; 00F0 919C
          rcall  avr011F      ; 00F1 D02D
          rjmp   avr00C8      ; 00F2 CFD5
avr00F3:  ldi    XL, 0x66     ; 00F3 E6A6
          rcall  avr0102      ; 00F4 D00D
           brsh  avr00F7      ; 00F5 F408
          rjmp   avr0081      ; 00F6 CF8A
avr00F7:  rjmp   avr005D      ; 00F7 CF65
          muls   r16, r17     ; 00F8 0201
          mulsu  r16, r20     ; 00F9 0304
          cpc    r16, r6      ; 00FA 0506
                              ; 00FB 0007
avr00FC:  mov    r8, ZL       ; 00FC 2E8E
          mov    r9, ZH       ; 00FD 2E9F
          ret                 ; 00FE 9508
avr00FF:  mov    ZL, r8       ; 00FF 2DE8
          mov    ZH, r9       ; 0100 2DF9
          ret                 ; 0101 9508
avr0102:  ld     ZL, X+       ; 0102 91ED
          ld     ZH, X        ; 0103 91FC
          subi   ZL, 0xFF     ; 0104 5FEF
          sbci   ZH, 0xFF     ; 0105 4FFF
          st     X, ZH        ; 0106 93FC
          st     -X, ZL       ; 0107 93EE
          ret                 ; 0108 9508
avr0109:  ld     ZL, X+       ; 0109 91ED
          ld     ZH, X        ; 010A 91FC
          subi   ZL, 0x01     ; 010B 50E1
          sbci   ZH, 0x00     ; 010C 40F0
          st     X, ZH        ; 010D 93FC
          st     -X, ZL       ; 010E 93EE
          ret                 ; 010F 9508
avr0110:  ldi    r24, 0xE8    ; 0110 EE88
          ldi    r25, 0x03    ; 0111 E093
          rcall  avr011F      ; 0112 D00C
          sbiw   ZL, 0x01     ; 0113 9731
           brne  avr0110      ; 0114 F7D9
          ret                 ; 0115 9508
avr0116:  sbiw   ZL, 0x01     ; 0116 9731
           brne  avr0116      ; 0117 F7F1
          ret                 ; 0118 9508
          set                 ; 0119 9468
          bld    r6, 2        ; 011A F862
          ret                 ; 011B 9508
          clt                 ; 011C 94E8
          bld    r6, 2        ; 011D F862
          ret                 ; 011E 9508
avr011F:  push   ZL           ; 011F 93EF
          push   ZH           ; 0120 93FF
          clr    ZL           ; 0121 27EE
          or     ZL, r24      ; 0122 2BE8
          or     ZL, r25      ; 0123 2BE9
           breq  avr012B      ; 0124 F031
avr0125:  ldi    ZL, 0xFA     ; 0125 EFEA
          ldi    ZH, 0x00     ; 0126 E0F0
avr0127:  sbiw   ZL, 0x01     ; 0127 9731
           brne  avr0127      ; 0128 F7F1
          sbiw   r24, 0x01    ; 0129 9701
           brne  avr0125      ; 012A F7D1
avr012B:  pop    ZH           ; 012B 91FF
          pop    ZL           ; 012C 91EF
          ret                 ; 012D 9508
avr012E:  lpm                 ; 012E 95C8
          adiw   ZL, 0x01     ; 012F 9631
          tst    r0           ; 0130 2000
          ret                 ; 0131 9508
avr0132:  ldi    r24, 0x02    ; 0132 E082
          rjmp   avr0135      ; 0133 C001
          ldi    r24, 0x04    ; 0134 E084
avr0135:  clr    r25          ; 0135 2799
avr0136:  st     X+, r25      ; 0136 939D
          dec    r24          ; 0137 958A
           brne  avr0136      ; 0138 F7E9
          ret                 ; 0139 9508
avr013A:  sbic   EECR, 1      ; 013A 99E1
          rjmp   avr013A      ; 013B CFFE
          out    EEARL, ZL    ; 013C BBEE
          adiw   ZL, 0x01     ; 013D 9631
          ret                 ; 013E 9508
          ldi    r25, 0x01    ; 013F E091
          rjmp   avr0142      ; 0140 C001
          ldi    r25, 0x02    ; 0141 E092
avr0142:  cpi    r23, 0x7B    ; 0142 377B
           brne  avr014E      ; 0143 F451
          in     r23, SREG    ; 0144 B77F
          cli                 ; 0145 94F8
avr0146:  rcall  avr013A      ; 0146 DFF3
          ld     r24, X+      ; 0147 918D
          out    EEDR, r24    ; 0148 BB8D
          sbi    EECR, 2      ; 0149 9AE2
          sbi    EECR, 1      ; 014A 9AE1
          dec    r25          ; 014B 959A
           brne  avr0146      ; 014C F7C9
          out    SREG, r23    ; 014D BF7F
avr014E:  clr    r23          ; 014E 2777
          ret                 ; 014F 9508
          ldi    r25, 0x01    ; 0150 E091
          rjmp   avr0153      ; 0151 C001
          ldi    r25, 0x02    ; 0152 E092
avr0153:  rcall  avr013A      ; 0153 DFE6
          sbi    EECR, 0      ; 0154 9AE0
          in     r24, EEDR    ; 0155 B38D
          st     X+, r24      ; 0156 938D
          dec    r25          ; 0157 959A
           brne  avr0153      ; 0158 F7D1
          ret                 ; 0159 9508

         .exit

Pretty meaningless without comments isn't it?

By the way you do have a legal right to disassemble this code don't you?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thnx yes i do.. actually i needed da sftware n i wsnt getting it.. finally i did.. thnx

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can I use DISAVR for WIndows 7(64- bit)?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SxPilot450,

For some dumb reason of not doing backups often, I need to rebuild an assembly source file from the only traces of a code that survived a HardDisk crash, the flash memory of an AVR AtMega48... :oops: For Pete's sake I didn't lock the flash. I used my DISAVREX encapsulating your DISAVR (v3.20).

Headhaches a bunch, all night long :(

Please allow me to make a strong request. Do not convert mapped I/O address (IN/OUT and I/O references) to any known I/O names table you have inside the program, just leave it alone as "P$nn".

As for example, finding 0xB520 in the hex file, do not convert to "IN R18, UBRRH", since I/O address $20 is UBRRH for AtMega16, but "EEDR" for AtMega48.

For some reason, the v3.20 uses a lot of I/O names matching I/O address for AtMega16, and that causes lots of confusion for other AVRs.

As the DISAVR does not have a way to deal with a parameter of AVR model, the best is to leave it as "IN R18, P$20" it will be Okay, since any find/replace in the editor could simply replace "P$" for "$" ($20) if wanting to leave the pure hexa I/O address, or replacing "P$20" for the correct I/O name for the particular processor being used.

I could upgrade my own DISAVREX to do it, it could receive an "AVR model" parameter at the command line execution, and it will replace all the P$nn for the correct I/O names on the fly, while doing the other things it does (adding flash byte address and ASCII representation at the comments area, and tabing/spacing larger for easier reading).

*----*

The instruction "movw Rd, Rs" is being created without the middle comma ","
it appears like this: "movw Rd Rs".

*----*

The instruction 0xCFFF, Rjmp to itself, is being created as "RJMP $". Some assemblers understand "$" as the actual address counter, but AVRStudio (AVRASM2) does not, it requires to be "RJMP PC".

Thanks again for the DISAVR, great tool. :D

Wagner

Wagner Lipnharski
Orlando Florida USA