 | | Re: H8/300 Assembler/C interface
|
|
(...) -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 (25 years ago, 21-Apr-01, to lugnet.robotics.rcx)
|
| |
 | | 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 (...) (25 years ago, 21-Apr-01, to lugnet.robotics.rcx)
|
| |
 | | RE: H8/300 Assembler/C interface
|
|
(...) Geez Kekoa, get some sleep. The GCC makes the callee clean up the stack. My pbForth ROM interface routines assume that the caller cleans up the stack, just like your RCX library which must have been confusing for you :-) I'll post all this in (...) (25 years ago, 21-Apr-01, to lugnet.robotics.rcx)
|
| |
 | | Re: H8/300 Assembler/C interface
|
|
(...) A brief review of the ROM disassembly seems to indicate the routines in ROM save r0-r5 if necessary. For example, the routine at 070c saves all registers. Like you said, parameters are passed in r6 with extra parameters on the stack. The (...) (25 years ago, 20-Apr-01, to lugnet.robotics.rcx)
|
| |
 | | RE: H8/300 Assembler/C interface
|
|
One more question for Kekoa before I'm done... The RCX ROM routines take a parameter in r6, with additional params on the stack. Return value is in r6 too. Are all other registers considered volatile through the call, or do the ROM routines save (...) (25 years ago, 20-Apr-01, to lugnet.robotics.rcx)
|
| |
 | | Re: Interfacing Sharp's GP2D02 Distance Sensor to the RCX
|
|
(...) Hi All, Philo has a really excellent and well documented solution to the issue 'distance sensor at RCX'. quoting 'connect the analog output GP2D12 sensor using the simplest design possible ' visit: (URL) u.. Andreas (25 years ago, 20-Apr-01, to lugnet.robotics, lugnet.robotics.rcx)
|
| |
 | | Re: H8/300 Assembler/C interface
|
|
(...) No no no! Sorry. They are NOT split. Boy am I dumb. -Kekoa (25 years ago, 20-Apr-01, to lugnet.robotics.rcx)
|
| |
 | | RE: H8/300 Assembler/C interface
|
|
(...) Not to be too obtuse, but your first message says that long and float are never split across r2 and stack. So you're saying that they ARE split? That's fine, because it makes things a lot easier - not that any of my functions actually need to (...) (25 years ago, 20-Apr-01, to lugnet.robotics.rcx)
|
| |
 | | Re: H8/300 Assembler/C interface
|
|
(...) To be more specific, I wrote C code, then disassembled it. The C types "long" and "float" are both split. -Kekoa (25 years ago, 20-Apr-01, to lugnet.robotics.rcx)
|
| |
 | | Re: H8/300 Assembler/C interface
|
|
(...) I wrote C code and then disassembled it. :) -Kekoa (25 years ago, 20-Apr-01, to lugnet.robotics.rcx)
|