Fixed several typos, changed example code
git-svn-id: svn://svn.cc65.org/cc65/trunk@1074 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -826,7 +826,7 @@ Here's a list of all control commands and a description, what they do:
|
|||||||
Example:
|
Example:
|
||||||
|
|
||||||
<tscreen><verb>
|
<tscreen><verb>
|
||||||
.include .concat ("myheader", ".", "inc)
|
.include .concat ("myheader", ".", "inc")
|
||||||
</verb></tscreen>
|
</verb></tscreen>
|
||||||
|
|
||||||
This is the same as the command
|
This is the same as the command
|
||||||
@@ -1664,7 +1664,7 @@ Here's a list of all control commands and a description, what they do:
|
|||||||
(the macro name) and optionally by a comma separated list of identifiers
|
(the macro name) and optionally by a comma separated list of identifiers
|
||||||
that are macro parameters.
|
that are macro parameters.
|
||||||
|
|
||||||
See section <ref id="macros" name="Macros">).
|
See section <ref id="macros" name="Macros">.
|
||||||
|
|
||||||
|
|
||||||
<sect1><tt>.MATCH</tt><label id=".MATCH"><p>
|
<sect1><tt>.MATCH</tt><label id=".MATCH"><p>
|
||||||
@@ -1711,7 +1711,7 @@ Here's a list of all control commands and a description, what they do:
|
|||||||
.endif
|
.endif
|
||||||
|
|
||||||
cmp #$80 ; Bit 7 into carry
|
cmp #$80 ; Bit 7 into carry
|
||||||
lsr a ; Shit carry into bit 7
|
lsr a ; Shift carry into bit 7
|
||||||
|
|
||||||
.endmacro
|
.endmacro
|
||||||
</verb></tscreen>
|
</verb></tscreen>
|
||||||
@@ -2402,30 +2402,27 @@ Now, with recursive macros, <tt><ref id=".IFBLANK" name=".IFBLANK"></tt> and
|
|||||||
Have a look at the inc16 macro above. Here is it again:
|
Have a look at the inc16 macro above. Here is it again:
|
||||||
|
|
||||||
<tscreen><verb>
|
<tscreen><verb>
|
||||||
.macro inc16 addr
|
.macro inc16 addr
|
||||||
clc
|
clc
|
||||||
lda addr
|
lda addr
|
||||||
adc #$01
|
adc #$01
|
||||||
sta addr
|
sta addr
|
||||||
lda addr+1
|
lda addr+1
|
||||||
adc #$00
|
adc #$00
|
||||||
sta addr+1
|
sta addr+1
|
||||||
.endmacro
|
.endmacro
|
||||||
</verb></tscreen>
|
</verb></tscreen>
|
||||||
|
|
||||||
If you have a closer look at the code, you will notice, that it could be
|
If you have a closer look at the code, you will notice, that it could be
|
||||||
written more efficiently, like this:
|
written more efficiently, like this:
|
||||||
|
|
||||||
<tscreen><verb>
|
<tscreen><verb>
|
||||||
.macro inc16 addr
|
.macro inc16 addr
|
||||||
clc
|
inc addr
|
||||||
lda addr
|
bne Skip
|
||||||
adc #$01
|
inc addr+1
|
||||||
sta addr
|
Skip:
|
||||||
bcc Skip
|
.endmacro
|
||||||
inc addr+1
|
|
||||||
Skip:
|
|
||||||
.endmacro
|
|
||||||
</verb></tscreen>
|
</verb></tscreen>
|
||||||
|
|
||||||
But imagine what happens, if you use this macro twice? Since the label
|
But imagine what happens, if you use this macro twice? Since the label
|
||||||
@@ -2437,12 +2434,9 @@ macro:
|
|||||||
<tscreen><verb>
|
<tscreen><verb>
|
||||||
.macro inc16 addr
|
.macro inc16 addr
|
||||||
.proc
|
.proc
|
||||||
clc
|
inc addr
|
||||||
lda addr
|
bne Skip
|
||||||
adc #$01
|
inc addr+1
|
||||||
sta addr
|
|
||||||
bcc Skip
|
|
||||||
inc addr+1
|
|
||||||
Skip:
|
Skip:
|
||||||
.endproc
|
.endproc
|
||||||
.endmacro
|
.endmacro
|
||||||
@@ -2474,7 +2468,7 @@ also solve the problem above by using <tt/.LOCAL/:
|
|||||||
|
|
||||||
Starting with version 2.5 of the assembler, there is a second macro type
|
Starting with version 2.5 of the assembler, there is a second macro type
|
||||||
available: C style macros using the <tt/.DEFINE/ directive. These macros are
|
available: C style macros using the <tt/.DEFINE/ directive. These macros are
|
||||||
similar to the classic macro type speified above, but behaviour is sometimes
|
similar to the classic macro type described above, but behaviour is sometimes
|
||||||
different:
|
different:
|
||||||
|
|
||||||
<itemize>
|
<itemize>
|
||||||
@@ -2735,7 +2729,7 @@ hear from you. Feel free to contact me by email
|
|||||||
|
|
||||||
<sect>Copyright<p>
|
<sect>Copyright<p>
|
||||||
|
|
||||||
ca65 (and all cc65 binutils) are (C) Copyright 1998-2000 Ullrich von
|
ca65 (and all cc65 binutils) are (C) Copyright 1998-2001 Ullrich von
|
||||||
Bassewitz. For usage of the binaries and/or sources the following
|
Bassewitz. For usage of the binaries and/or sources the following
|
||||||
conditions do apply:
|
conditions do apply:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user