This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Declare function that doesn't automatically save register when called.

Hi all, In Keil C51 compiler, is there any way to declare a function that doesn't automatically save registers (acc, b, dptr, r0-r7...) when called? I want to do it manually. In SDCC, I can use the attribute "_naked" or use #pragma callee_saves". Thanks,

Parents
  • A "driver" can be ....

    "Driver" is, I agree, a very ambigous name. When I hear "driver" I 'see' a "driver" that is 'device independent as in "assign output to driver 3".

    Some would name "set a byte in x and it will be output on the serial port", a driver, I would not.

    However, from the original post I surmise that the OP is talking about a driver similar to the first one (RTOS approach).

    Modularity is a good idea even in small systems. There's no particular reason to embed direct register writes all over your code
    Now, while I wholehardedly agree with you on this point, locating all related to a given I/O in a single, separate module would not make me call it a driver.

    Erik

Reply
  • A "driver" can be ....

    "Driver" is, I agree, a very ambigous name. When I hear "driver" I 'see' a "driver" that is 'device independent as in "assign output to driver 3".

    Some would name "set a byte in x and it will be output on the serial port", a driver, I would not.

    However, from the original post I surmise that the OP is talking about a driver similar to the first one (RTOS approach).

    Modularity is a good idea even in small systems. There's no particular reason to embed direct register writes all over your code
    Now, while I wholehardedly agree with you on this point, locating all related to a given I/O in a single, separate module would not make me call it a driver.

    Erik

Children
No data