Subject:
|
Re: H8/300 Assembler/C interface
|
Newsgroups:
|
lugnet.robotics.rcx
|
Date:
|
Sat, 21 Apr 2001 06:08:37 GMT
|
Viewed:
|
1570 times
|
| |
| |
On Sat, 21 Apr 2001, Kekoa Proudfoot wrote:
> Not my GCC:
>
> 00000016 <_main>:
> 16: 6d f6 mov.w r6,@-e7 <-- save frame pointer
> 18: 0d 76 mov.w r7,r6 <-- new frame pointer
> 1a: 6b 00 00 00 mov.w @0x0:16,r0 <-- r0r1 is 1st long param
> 1e: 6b 01 00 00 mov.w @0x0:16,r1
> 22: 6b 02 00 00 mov.w @0x0:16,r2 <-- load 2nd long param
> 26: 6b 03 00 00 mov.w @0x0:16,r3
> 2a: 6d f3 mov.w r3,@-e7 <-- put 2nd long param on stack
> 2c: 6d f2 mov.w r2,@-e7
> 2e: 5e 00 00 00 jsr @0x0:0 <-- caller calls callee
> 32: 0d 10 mov.w r1,r0 <-- return lsw of long return value
> 34: 0b 87 adds #0x2,er7 <-- *** caller cleans up stack ***
> 36: 0b 87 adds #0x2,er7
> 38: 6d 76 mov.w @r7+,r6 <-- restore frame pointer
> 3a: 54 70 rts
>
> Nobody uses the frame pointer. There is a way to tell GCC not to generate
> it, but I forget the means. When you write your own routines, you can
> ignore the frame pointer and treat it as another register that needs
> saving if for some reason you need to use r6.
-fomit-frame-pointer, but it can cause problems debugging (obviously not
important here).
John A. Tamplin jat@jaet.org
770/436-5387 HOME 4116 Manson Ave
770/431-9459 FAX Smyrna, GA 30082-3723
|
|
Message is in Reply To:
| | Re: H8/300 Assembler/C interface
|
| (...) Not my GCC: 00000016 <_main>: 16: 6d f6 mov.w r6,@-e7 <-- save frame pointer 18: 0d 76 mov.w r7,r6 <-- new frame pointer 1a: 6b 00 00 00 mov.w @0x0:16,r0 <-- r0r1 is 1st long param 1e: 6b 01 00 00 mov.w @0x0:16,r1 22: 6b 02 00 00 mov.w (...) (24 years ago, 21-Apr-01, to lugnet.robotics.rcx)
|
20 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|