We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8638b9c commit 9bb3a72Copy full SHA for 9bb3a72
1 file changed
docs/developer/sdcc.md
@@ -81,6 +81,26 @@ some registers:
81
void f(void) __preserves_regs(b, c, iyl, iyh);
82
83
84
+#### Direct memory access
85
+
86
+To access a memory location without using a pointer variable it is possible
87
+to do things like this:
88
89
+```c
90
+#define ODR (*((unsigned char *)0x5005))
91
+#define bitSet(value, bit) ((value) |= (1 << (bit)))
92
93
+void main()
94
+{
95
96
+ bitSet(ODR, 3);
97
98
+ *((unsigned char *) 0x5005) |= 4;
99
+}
100
+```
101
102
103
104
### Notes on SDCC
105
106
The linker `sdld` does not automatically link the object file for main.c if it
0 commit comments