avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Problem with stack


From: v a
Subject: [avr-gcc-list] Problem with stack
Date: Tue, 13 Jun 2006 06:56:02 -0700 (PDT)

This is list file of function attached on mail.
The problem is on Line 34. Interrupts are restored before complete
modyfy on Stack registers and if interrupt occurred CPU is going to
hell.
Can anybody help me

Vasil Atanasov



   1                            .file   "sprintf1.c"
   2                            .arch atmega128
   3                    __SREG__ = 0x3f
   4                    __SP_H__ = 0x3e
   5                    __SP_L__ = 0x3d
   6                    __tmp_reg__ = 0
   7                    __zero_reg__ = 1
   8                            .global __do_copy_data
   9                            .global __do_clear_bss
  17                    .Ltext0:
  18                    .global sprintf1
  20                    sprintf1:
  21                    .LFB3:
  22                    .LM1:
  23                    /* prologue: frame size=14 */
  24 0000 0F93                  push r16
  25 0002 1F93                  push r17
  26 0004 CF93                  push r28
  27 0006 DF93                  push r29
  28 0008 CDB7                  in r28,__SP_L__
  29 000a DEB7                  in r29,__SP_H__
  30 000c 2E97                  sbiw r28,14
  31 000e 0FB6                  in __tmp_reg__,__SREG__
  32 0010 F894                  cli
  33 0012 DEBF                  out __SP_H__,r29
  34 0014 0FBE                  out __SREG__,__tmp_reg__
  35 0016 CDBF                  out __SP_L__,r28
  36                    /* prologue end (size=12) */
  37 0018 0D89                  ldd r16,Y+21
  38 001a 1E89                  ldd r17,Y+22
  39 001c 2F89                  ldd r18,Y+23
  40 001e 388D                  ldd r19,Y+24
  41                    .LM2:
  42 0020 86E0                  ldi r24,lo8(6)
  43 0022 8C83                  std Y+4,r24
  44                    .LM3:
  45 0024 1A83                  std Y+2,r17
  46 0026 0983                  std Y+1,r16
  47                    .LM4:
  48 0028 8FEF                  ldi r24,lo8(32767)
  49 002a 9FE7                  ldi r25,hi8(32767)
  50 002c 9E83                  std Y+6,r25
  51 002e 8D83                  std Y+5,r24
  52                    .LM5:
  53 0030 AE01                  movw r20,r28
  54 0032 475E                  subi r20,lo8(-(25))
  55 0034 5F4F                  sbci r21,hi8(-(25))
  56 0036 B901                  movw r22,r18
  57 0038 CE01                  movw r24,r28
  58 003a 0196                  adiw r24,1
  59 003c 0E94 0000             call vfprintf
  60                    .LM6:
  61 0040 EF81                  ldd r30,Y+7
  62 0042 F885                  ldd r31,Y+8
  63 0044 E00F                  add r30,r16
  64 0046 F11F                  adc r31,r17
  65 0048 1082                  st Z,__zero_reg__
  66                    /* epilogue: frame size=14 */
  67 004a 2E96                  adiw r28,14
  68 004c 0FB6                  in __tmp_reg__,__SREG__
  69 004e F894                  cli
  70 0050 DEBF                  out __SP_H__,r29
  71 0052 0FBE                  out __SREG__,__tmp_reg__
  72 0054 CDBF                  out __SP_L__,r28
  73 0056 DF91                  pop r29
  74 0058 CF91                  pop r28
  75 005a 1F91                  pop r17
  76 005c 0F91                  pop r16
  77 005e 0895                  ret
  78                    /* epilogue end (size=11) */
  79                    /* function sprintf1 size 48 (25) */
  80                    .LFE3:
  82                    .Letext0:
DEFINED SYMBOLS
                            *ABS*:00000000 sprintf1.c
C:\DOCUME~1\rnd\LOCALS~1\Temp/ccA3aaaa.s:3      *ABS*:0000003f
__SREG__
C:\DOCUME~1\rnd\LOCALS~1\Temp/ccA3aaaa.s:4      *ABS*:0000003e
__SP_H__
C:\DOCUME~1\rnd\LOCALS~1\Temp/ccA3aaaa.s:5      *ABS*:0000003d
__SP_L__
C:\DOCUME~1\rnd\LOCALS~1\Temp/ccA3aaaa.s:6      *ABS*:00000000
__tmp_reg__
C:\DOCUME~1\rnd\LOCALS~1\Temp/ccA3aaaa.s:7      *ABS*:00000001
__zero_reg__
C:\DOCUME~1\rnd\LOCALS~1\Temp/ccA3aaaa.s:20     .text:00000000
sprintf1

UNDEFINED SYMBOLS
__do_copy_data
__do_clear_bss
vfprintf


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Attachment: sprintf1.c
Description: 861451175-sprintf1.c

Attachment: sprintf1.lst
Description: 1197062657-sprintf1.lst


reply via email to

[Prev in Thread] Current Thread [Next in Thread]