I've been writing code for different microcontrollers (8051, AVR, PIC, STM32) for several years. Usually I use C, but I also have basic knowledge about other languages, including assembly. Recently I began experimenting with vintage microprocessors, including 8080 and 6502. I've built few boards and done some experiments with running BASIC. Now I want to try to use 6502 as a controller in one of my "embedded" projects, just like modern MCU. Unfortunately I don't feel comfortable about writing large amount of code in assembly, so I'd prefer to stick with CC65. But first I need to clarify some things.
Writing C code for modern MCU is relatively easy. Compiler is aware of hardware. It knows what amounts of RAM and FLASH are available, i knows addresses of every port and control register.
I would like to know:
1) How to tell CC65 where the RAM begins and ends.
2) The same about EPROM.
3) How to define names pointing to ports and registers in address space. For example when I have latch register at 0xA000 and I would like to simply write new value by using something like NAME = 0x0F.
In brief: I would like to provide CC65 all the necessary information, to use my own 6502 based device like AVR or PIC microcontroller.