From 192a6536f70475fcb4a5b3d8b816ad435c3efe0f Mon Sep 17 00:00:00 2001 From: cuz Date: Mon, 25 Nov 2002 15:03:54 +0000 Subject: [PATCH] Overhauled paragraph about register variables git-svn-id: svn://svn.cc65.org/cc65/trunk@1634 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- doc/coding.sgml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/coding.sgml b/doc/coding.sgml index ad45aad0a..23f04ee7e 100644 --- a/doc/coding.sgml +++ b/doc/coding.sgml @@ -308,12 +308,11 @@ easy to see, that - apart from the additional code that is needed to save and restore the values - you need to make heavy use of a variable to justify the overhead. -An exception are pointers, especially char pointers. The optimizer has code to -detect and transform the most common pointer operations if the pointer -variable is a register variable. Declaring heavily used character pointers as -register may give significant gains in speed and size. +As a general rule: Use register variables only for pointers that are +dereferenced several times in your function, or for heavily used induction +variables in a loop (with several 100 accesses). -And remember: Register variables must be enabled with