Sanyo VPC-S - 7. Sanyo Digital Cameras User Manuals. Sanyo DSC S1 manuals will be available soon. Leaflet English. Sanyo DSC S5 manuals will be available soon. Sanyo DSC S4 manuals will be available soon.
Sanyo DSC S3 manuals will be available soon. User Manual English. Leaflet English User Manual English. Sanyo VPC-S manuals will be available soon. Sanyo VCB manuals will be available soon. Sanyo VCBT manuals will be available soon. User Manual English Leaflet English. Sanyo VPC-E1 manuals will be available soon. Sanyo VPC E manuals will be available soon. Sanyo VPC-T manuals will be available soon. Sanyo VPC-E manuals will be available soon. VPC-S - 7.
Sanyo VPC-E6 manuals will be available soon. Sanyo VPC-E60 manuals will be available soon. Sanyo VPC-E7 manuals will be available soon. Sanyo VPC-J2 manuals will be available soon. Control commands A16 A8 ADDR ALIGN BSS BYTE CASE CODE DATA DBYT DWORD ELSE END ENDIF ENUM ERROR FATAL FOPT I16 I8 IF IFDEF IFP02 IFP IFPC02 IFPSC02 IFREF LIST LOCAL MACRO ORG OUT P02 P PC02 PDTV PROC PSC02 REFTO RELOC RES SCOPE SET SMART TAG UNION WORD Macros Macro packages Predefined constants Structs and unions ORG keyword TAG keyword Porting sources from other assemblers Copyright 1.
Overview ca65 is a replacement for the ra65 assembler that was part of the cc65 C compiler, originally developed by John R. Some parts of the assembler code generation and some routines for symbol table handling are taken from an older crossassembler named a written by me a long time ago.
The assembler must support macros. Macros are not essential, but they make some things easier, especially when you use the assembler in the backend of a compiler. The assembler must support the newer 65C02 and CPUs. I have been thinking about a backend for the C compiler, and even my old a assembler had support for these CPUs, so this wasn't really a problem.
The assembler must produce relocatable code. This is necessary for the compiler support, and it is more convenient.
Conditional assembly must be supported. This is a must for bigger projects written in assembler like Elite The assembler must support segments, and it must support more than three segments this is the count, most other assemblers support.
Having more than one code segments helps developing code for systems with a divided ROM area like the C The linker must be able to resolve arbitrary expressions. It should be able to get things like. True lexical nesting for symbols. This is very convenient for larger assembly projects. I liked the idea of "options" as Anre Fachats. The assembler will be a one pass assembler. There was no real need for this decision, but I've written several multipass assemblers, and it started to get boring.
A one pass assembler needs much more elaborated data structures, and because of that it's much more fun:- Non-GPLed code that may be used in any project without restrictions or fear of "GPL infecting" other code.
Name a directory which is searched for binary include files. The option may be used more than once to specify more than one directory to search. The current directory is always searched first before considering any additional directories. See also the section about search paths.
Tells the assembler to generate a file containing the dependency list for the assembled module in makefile syntax. The output is written to a file with the given name. The output does not include files passed via debug information to the assembler. The output does include files passed via debug information to the assembler. Enable an emulation feature. This is identical as using. FEATURE in the source with two exceptions: Feature names must be lower case, and each feature must be specified by using an extra --feature option, comma separated lists are not allowed.
See the discussion of the. When this option or the equivalent control command. DEBUGINFO is used, the assembler will add a section to the object file that contains all symbols including local ones together with the symbol values and source file positions. This option makes the assembler case insensitive on identifiers and labels.
This option will override the default, but may itself be overridden by the. CASE control command. Generate an assembler listing with the given name. A listing file will never be generated in case of assembly errors.
Disable warnings about a large combined alignment. ALIGN directive for further information. Set the maximum number of bytes printed in the listing for one line of input.
See the. The value zero can be used to encode an unlimited number of printed bytes. The default output name is the name of the input file with the extension replaced by ". If you don't like that, you may give another name with the -o option.
The output file will be placed in the same directory as the source file, or, if -o is given, the full path in this name is used. Relax some checks done by the assembler. This will allow code that is an error in most cases and flagged as such by the assembler, but can be valid in special situations. Examples are: Short branches between two different segments. Byte sized address loads where the address is not a zeropage address.
In smart mode enabled by -s or the. If the operand of such an instruction cannot be evaluated by the assembler for example, because the operand is an imported symbol , a warning is issued.
Beware: Since the assembler cannot trace the execution flow this may lead to false results in some cases. If in doubt, use the. Smart mode is off by default. Set the target system. This will enable translation of character strings and character constants into the character set of the target platform.
The default for the target system is "none", which means that no translation will take place. The assembler supports the same target systems as the compiler, see there for a list. Depending on the target, the default CPU type is also set. This can be overriden by using the --cpu option. Increase the assembler verbosity. Usually only needed for debugging purposes. You may use this option more than one time for even more verbose output.
This option allows you to define symbols on the command line. Without a value, the symbol is defined with the value zero. Name a directory which is searched for include files.
Mark symbols that are not defined in the sources as imported symbols. This should be used with care since it delays error messages about typos and such until the linker is run. The compiler uses the equivalent of this switch.
However, the compiler is supposed to generate code that runs through the assembler without problems, something which is not always true for assembler programmers. Print the version number of the assembler. If you send any suggestions or bugfixes, please include the version number. Set the warning level for the assembler. Using -W2 the assembler will even warn about such things like unused imported symbols. The default warning level is 1, and it would probably be silly to set it to something lower.
The current file's directory. Any directory added with the -I option on the command line. An optionally compiled-in directory. Any directory added with the --bin-include-dir option on the command line.
One line may contain a label which is identified by a colon , and, in addition to the label, an assembler mnemonic, a macro, or a control command see section Control Commands for supported control commands. Everything after a semicolon is handled as a comment that is, it is ignored. P02 command was given.
PDTV command was given. PSC02 command was given. PC02 command was given. P command was given. Since these instructions are illegal, there are no official mnemonics for them. Please note that only the ones marked as "stable" are supported.
The following table uses information from the mentioned web page, for more information, see there. All branch instruction allow now 16 bit offsets. To use a 16 bit branch you have to prefix these with an "L" e. This might change at a later implementation of the assembler.
It is available in the Apple ][ ROM. The following is special in sweet16 mode:. The ' ' character denotes indirect addressing and is no longer available for cheap local labels. If you need cheap local labels, you will have to switch to another lead character using the. Registers are specified using R In sweet16 mode, these identifiers are reserved words. Please note that the assembler does neither supply the interpreter needed for SWEET 16 code, nor the zero page locations needed for the SWEET 16 registers, nor does it call the interpreter.
All this must be done by your program. Apple ][ programmers do probably know how to use sweet16 mode. There are currently no octal values and no floats. Please note that when using the conditional directives.
IF and friends , the input must consist of valid assembler tokens, even in. IF branches that are not assembled. The reason for this behaviour is that the assembler must still be able to detect the ending tokens like. ENDIF , so conversion of the input stream into tokens still takes place.
As a consequence conditional assembly directives may not be used to prevent normal text used as a comment or similar from being assembled. All expressions are evaluated with at least 32 bit precision.
An expression may contain constant values and any combination of internal and external symbols. Expressions that cannot be evaluated at assembly time are stored inside the object file for evaluation by the linker. Expressions referencing imported symbols must always be evaluated by the linker. Sometimes, the assembler must know about the size of the value that is the result of an expression. This is usually the case, if a decision has to be made, to generate a zero page or an absolute memory references.
In this case, the assembler has to make some assumptions about the result of an expression:. If the result of an expression is constant, the actual value is checked to see if it's a byte sized expression or not. If this is not the case, and the expression contains a symbol, explicitly declared as zero page symbol by one of the. If the expression contains symbols that are not defined, and these symbols are local symbols, the enclosing scopes are searched for a symbol with the same name.
If one exists and this symbol is defined, its attributes are used to determine the result size. In all other cases the expression is assumed to be word sized. Note: If the assembler is not able to evaluate the expression at assembly time, the linker will evaluate it and check for range errors as soon as the result is known. In the context of a boolean expression, any non zero value is evaluated as true, any other value to false. The result of a boolean expression is 1 if it's true, and zero if it's false.
There are boolean operators with extreme low precedence with version 2. AND and. OR operators are shortcut operators. That is, if the result of the expression is already known, after evaluating the left hand side, the right hand side is not evaluated. Sometimes an expression must evaluate to a constant without looking at any further input.
One such example is the. IF command that decides if parts of the code are assembled or not. An expression used in the. IF command cannot reference a symbol defined later, because the decision about the. IF must be made at the point when it is read. If the expression used in such a context contains only constant numerical values, there is no problem. When unresolvable symbols are involved it may get harder for the assembler to determine if the expression is actually constant, and it is even possible to create expressions that aren't recognized as constant.
Simplifying the expressions will often help. In cases where the result of the expression is not needed immediately, the assembler will delay evaluation until all input is read, at which point all symbols are known. So using arbitrary complex constant expressions is no problem in most cases.
AND Boolean and 5. XOR Boolean xor 5. OR Boolean or 6! NOT Boolean not 7 Available operators, sorted by precedence. A symbol or label is an identifier that starts with a letter and is followed by letters and digits.
Use of identifiers consisting of a single character will not work in all cases, because some of these identifiers are reserved keywords for example "A" is not a valid identifier for a label, because it is the keyword for the accumulator. The assembler allows you to use symbols instead of naked values to make the source more readable. There are a lot of different ways to define and use symbols and labels, giving a lot of flexibility. The label assignment operator is almost identical, but causes the symbol to be marked as a label, so it may be handled differently in a debugger:.
Within macros and other control structures. This can be achieved by the. SET operator. It creates a symbol that may get assigned a different value later:.
Since the value of the symbol can change later, it must be possible to evaluate it when used no delayed evaluation as with normal symbols.
So the expression used as the value must be constant. Following is an example for a macro that generates a different label each time it is used. It uses the. A label is defined by writing the name of the label at the start of the line before any instruction mnemonic, macro or pseudo directive , followed by a colon. This will declare a symbol with the given name and the value of the current program counter. Using the.
PROC directive, it is possible to create regions of code where the names of labels and symbols are local to this region. They are not known outside of this region and cannot be accessed from there. See the description of the. PROC directive for more information. Cheap local labels are defined like standard labels, but the name of the label must begin with a special symbol usually ' ', but this can be changed by the. Cheap local labels are visible only between two non cheap labels.
As soon as a standard symbol is encountered this may also be a local symbol if inside a region defined with the. PROC directive , the cheap local symbol goes out of scope. You may use cheap local labels as an easy way to reuse common label names like "Loop". Here is an example:. If you really want to write messy code, there are also unnamed labels.
These labels do not have a name you guessed that already, didn't you? A colon is used to mark the absence of the name. Unnamed labels may be accessed by using the colon plus several minus or plus characters as a label designator. An example will help to understand this:. As you can see from the example, unnamed labels will make even short sections of code hard to understand, because you have to count labels to find branch targets this is the reason why I for my part do prefer the "cheap" local labels.
Nevertheless, unnamed labels are convenient in some situations, so it's your decision. Note: Scopes organize named symbols, not unnamed ones, so scopes don't have an effect on unnamed labels. While there are drawbacks with this approach, it may be handy in a few rare situations. One of the advantages is that you can use it to define string constants this is not possible with the other symbol types. Please note:. DEFINE style macros do token replacements on a low level, so the names do not adhere to scoping, diagnostics may be misleading, there are no symbols to look up in the map file, and there is no debug info.
Especially the first problem in the list can lead to very nasty programming errors. Because of these problems, the general advice is, NOT do use.
DEBUGINFO is enabled or -g is given on the command line , global, local and cheap local labels are written to the object file and will be available in the symbol file via the linker. Unnamed labels are not written to the object file, because they don't have a name which would allow to access them.
All non cheap local symbols that are declared outside of any nested scopes are in global scope. A special scope is the scope for cheap local symbols. It lasts from one non local symbol to the next one, without any provisions made by the programmer.
All other scopes differ in usage but use the same concept internally. A nested scoped for generic use is started with. SCOPE and closed with. The scope can have a name, in which case it is accessible from the outside by using explicit scopes.
If the scope does not have a name, all symbols created within the scope are local to the scope, and aren't accessible from the outside.
A nested scope can access symbols from the local or from enclosing scopes by name without using explicit scope names. In some cases there may be ambiguities, for example if there is a reference to a local symbol that is not yet defined, but a symbol with the same name exists in outer scopes:. In the example above, the lda instruction will load the value 3 into the accumulator, because foo is redefined in the scope. In fact, the assembler will not use absolute mode by default, but it will search through the enclosing scopes for a symbol with the given name.
If one is found, the address size of this symbol is used. This may lead to errors:. In this case, when the assembler sees the symbol foo in the lda instruction, it will search for an already defined symbol foo. It will find foo in scope outer , and a close look reveals that it is a zeropage symbol. So the assembler will use zeropage addressing mode. If foo is redefined later in scope inner , the assembler tries to change the address in the lda instruction already translated, but since the new value needs absolute addressing mode, this fails, and an error message "Range error" is output.
Of course the most simple solution for the problem is to move the definition of foo in scope inner upwards, so it precedes its use.
There may be rare cases when this cannot be done. In these cases, you can use one of the address size override operators:. This will cause the lda instruction to be translated using absolute addressing mode, which means changing the symbol reference later does not cause any errors.
A nested procedure is created by use of. It differs from a. SCOPE in that it must have a name, and a it will introduce a symbol with this name in the enclosing scope. This is the reason why a procedure must have a name.
If you want a scope without a name, use. Note: As you can see from the example above, scopes and symbols live in different namespaces. There can be a symbol named foo and a scope named foo without any conflicts but see the section titled "Scope search order".
Structs, unions and enums are explained in a separate section , I do only cover them here, because if they are declared with a name, they open a nested scope, similar to. However, when no name is specified, the behaviour is different: In this case, no new scope will be opened, symbols declared within a struct, union, or enum declaration will then be added to the enclosing scope instead. Accessing symbols from other scopes is possible by using an explicit scope specification, provided that the scope where the symbol lives in has a name.
The namespace token :: is used to access other scopes:. The only way to deny access to a scope from the outside is to declare a scope without a name using the. SCOPE command. A special syntax is used to specify the global scope: If a symbol or scope is preceded by the namespace token, the global scope is searched:.
The assembler searches for a scope in a similar way as for a symbol. First, it looks in the current scope, and then it walks up the enclosing scopes until the scope is found.
However, one important thing to note when using explicit scope syntax is, that a symbol may be accessed before it is defined, but a scope may not be used without a preceding definition.
This means that in the following example:. When outer::inner::bar is referenced in the lda instruction, the assembler will first search in the local scope for a scope named outer. Since none is found, the enclosing scope another is checked. There is still no scope named outer , so scope foo is checked, and finally scope outer is found.
Within this scope, inner is searched, and in this scope, the assembler looks for a symbol named bar. Please note that once the anchor scope is found, all following scopes inner in this case are expected to be found exactly in this scope.
The assembler will search the scope tree only for the first scope if it is not anchored in the root scope. Starting from there on, there is no flexibility, so if the scope named outer found by the assembler does not contain a scope named inner , this would be an error, even if such a pair does exist one level up in global scope.
Ambiguities that may be introduced by this search algorithm may be removed by anchoring the scope specification in the global scope. In the example above, if you want to access the "other" symbol bar , you would have to write:. This is true, even if the symbol is not used as an address. You may also think of a value range of the symbol instead of an address size. Zeropage or direct 8 bits Absolute 16 bits Far 24 bits Long 32 bits. Since the assembler uses default address sizes for the segments and symbols, it is usually not necessary to override the default behaviour.
In cases, where it is necessary, the following keywords may be used to specify address sizes:. FAR for far addressing 24 bits. The assembler assigns an address size to each segment. The address size of a segment may be changed, by using an optional address size modifier.
See the segment directive for an explanation on how this is done. The zeropage addressing override can be used to ensure the use of optimal zeropage instructions, or correct cases where the size isn't yet known due to the single-pass assembly model. The larger addressing overrides can be used to promote a smaller address to absolute or far addressing, instead of being automatically fit into a smaller addressing type. The default address size of a segment depends on the memory model used. Since labels inherit the address size from the segment they are declared in, changing the memory model is an easy way to change the address size of many symbols at once.
Reading this pseudo variable will return the program counter at the start of the current input line. Assignment to this variable is possible when. ORG instead. For the instruction set. ASIZE will return either 8 or 16, depending on the current size of the operand in immediate accu addressing mode. Reading this pseudo variable will give a constant integer value that tells which CPU is currently enabled.
It can also tell which instruction set the CPU is able to translate. The value read from the pseudo variable should be further examined by using one of the constants defined by the "cpu" macro package see. It may be used to replace the. IFPxx pseudo instructions or to construct even more complex expressions. ISIZE will return either 8 or 16, depending on the current size of the operand in immediate index addressing mode.
This builtin pseudo variable is only available in macros. It is replaced by the actual number of parameters that were given in the macro invocation. Reading this pseudo variable will give a constant integer value that represents the current time in POSIX standard as seconds since the Epoch.
It may be used to encode the assembler version or check the assembler for special features not available with older versions. Version 2. Pseudo functions expect their arguments in parentheses, and they have a result, either a string or an expression value. This can be helpful in macros when knowing the address size of a symbol can help with custom instructions. BANK function is used to support systems with banked memory. The argument is an expression with exactly one segment reference -- usually a label.
The function result is the value of the bank attribute assigned to the run memory area of the segment. Please see the linker documentation for more information about memory areas and their attributes. The value of. BANK can be used to switch memory so that a memory bank containing specific data is available. The bank attribute is a bit integer, and so is the result of the. BANK function.
You will have to use. Please note that. BANK always will get evaluated in the link stage, so an expression containing. BANK never can be used where a constant, known result is expected for example, with.
The function returns the bank byte that is, bits of its argument. Builtin function. The function evaluates its argument in parentheses and yields "false" if the argument is non blank there is an argument , and "true" if there is no argument.
The token list that makes up the function argument may optionally be enclosed in curly braces. This allows the inclusion of tokens that would otherwise terminate the list the closing right parenthesis. The curly braces are not considered part of the list, a list just consisting of curly braces is considered to be empty. Builtin string function. The function allows to concatenate a list of string constants separated by commas.
The result is a string constant that is the concatenation of all arguments. This function is most useful in macros and when used together with the. The function may be used in any case where a string constant is expected. The function evaluates its argument in parentheses and yields "true" if the argument is a constant expression that is, an expression that yields a constant value at assembly time and "false" otherwise.
As an example, the. The function expects an identifier as argument in parentheses. The argument is evaluated, and the function yields "true" if the identifier is a symbol that already is defined somewhere in the source file up to the current position.
Otherwise, the function yields false. IFDEF statement may be replaced by. The argument is evaluated, and the function yields "true" if the identifier already has been defined as the name of a macro. The function returns the high byte that is, bits of its argument.
The function expects a string as its argument, and converts this argument into an identifier. If the string starts with the current. The argument is evaluated, and the function yields "true" if the identifier is defined as an instruction mnemonic that is recognized by the assembler.
The first integer expression gives the number of tokens to extract from the token list. The second argument is the token list itself. The token list may optionally be enclosed into curly braces. This allows the inclusion of tokens that would otherwise terminate the list the closing right paren in the given case. To check in a macro if the given argument has a ' ' as first token immediate addressing mode , use something like this:.
See also the. MID and. RIGHT builtin functions. The function returns the low byte that is, bits of its argument. Matches two token lists against each other. This is most useful within macros, since macros are not stored as strings, but as lists of tokens.
Both token list may contain arbitrary tokens with the exception of the terminator token comma resp. The token lists may optionally be enclosed into curly braces.
Often a macro parameter is used for any of the token lists. Please note that the function does only compare tokens, not token attributes. So any number is equal to any other number, regardless of the actual value. The same is true for strings. If you need to compare tokens and token attributes, use the. Assume the macro ASR , that will shift right the accumulator by one, while honoring the sign bit.
We will use the. MATCH function to check for this and print and error for invalid calls. Takes a starting index, a count and a token list as arguments. Will return part of the token list. The first integer expression gives the starting token in the list the first token has index 0. The second integer expression gives the number of tokens to extract from the token list. The third argument is the token list itself. LEFT and. The argument is evaluated, and the function yields "true" if the identifier is a symbol that has already been referenced somewhere in the source file up to the current position.
Otherwise the function yields false. IFREF statement may be replaced by. MID builtin functions. In the case of a procedure or label, its size is defined by the amount of data placed in the segment where the label is relative to.
If a line of code switches segments for example, in a macro , data placed in other segments does not count for the size. Please note that a symbol or scope must exist before it can be used together with.
A scope has preference over a symbol with the same name; so, if the last part of a name represents both a scope and a symbol, then the scope is chosen over the symbol. The example demonstrates that.
Note that this value includes the amount of data emitted in child scopes in this case Code::Inner. Data is emitted within the scope Data , but since the segment is switched after entry, this data is emitted into another segment. It expects a format string as first argument. The number and type of the following arguments depend on the format string. The format string is similar to the one of the C printf function. Missing things are: Length modifiers, variable width.
The function accepts a string and an index as arguments and returns the value of the character at the given position as an integer value. The index is zero based. The function accepts an argument in parentheses and converts this argument into a string constant. The argument may be an identifier, or a constant numeric value.
Since you can use a string in the first place, the use of the function may not be obvious. However, it is useful in macros, or more complex setups. The function accepts a string argument in parentheses and evaluates to the length of the string.
The function accepts a token list in parentheses. The function result is the number of tokens given as argument. The token list may optionally be enclosed into curly braces which are not considered part of the list and not counted. Enclosement in curly braces allows the inclusion of tokens that would otherwise terminate the list the closing right paren in the given case.
The ldax macro accepts the ' ' token to denote immediate addressing as with the normal instructions. To translate it into two separate 8 bit load instructions, the ' ' token has to get stripped from the argument:. The function compares tokens and token values. If you need a function that just compares the type of tokens, have a look at the. MATCH function.
Note: This command will not emit any code, it will tell the assembler to create 16 bit operands for immediate accumulator addressing mode. Note: This command will not emit any code, it will tell the assembler to create 8 bit operands for immediate accu addressing mode. Define word sized data. In mode, this is an alias for. WORD and may be used for better readability if the data words are address values. In mode, the address is forced to be 16 bit wide to fit into the current segment.
See also. The command must be followed by a sequence of not necessarily constant expressions. Align data to a given boundary. The command expects a constant integer argument in the range If there is a second argument, it is used as fill value, otherwise the value defined in the linker configuration file is used the default for this value is zero. ALIGN will insert fill bytes, and the number of fill bytes depend of the final address of the segment.
ALIGN cannot insert a variable number of bytes, since that would break address calculations within the module. So each. ALIGN expects the segment to be aligned to a multiple of the alignment, because that allows the number of fill bytes to be calculated in advance by the assembler. You are therefore required to specify a matching alignment for the segment in the linker config. The linker will output a warning if the alignment of the segment is less than what is necessary to have a correct alignment in the object file.
Some unexpected behaviour might occur if there are multiple. ALIGN commands with different arguments. To allow the assembler to calculate the number of fill bytes in advance, the alignment of the segment must be a multiple of each of the alignment factors. This may result in unexpectedly large alignments for the segment within the module. For the assembler to be able to align correctly, the segment must be aligned to the least common multiple of 15 and 18 which is The assembler will calculate this automatically and will mark the segment with this value.
Unfortunately, the combined alignment may get rather large without the user knowing about it, wasting space in the final executable. If we add another alignment to the example above. To protect the user against errors, the assembler will issue a warning when the combined alignment exceeds The command line option --large-alignment will disable this warning. Please note that with alignments that are a power of two which were the only alignments possible in older versions of the assembler , the problem is less severe, because the least common multiple of powers to the same base is always the larger one.
This will put the string "Hello world" followed by a binary zero into the current segment. There may be more strings separated by commas, but the binary zero is only appended once after the last one. Strings will be translated using the current character mapping definition. BYTE ,. Add an assertion. The command is followed by an expression, an action specifier, and an optional message that is output in case the assertion fails.
If no message was given, the string "Assertion failed" is used. The action specifier may be one of warning , error , ldwarning or lderror. In the former two cases, the assertion is evaluated by the assembler if possible, and in any case, it's also passed to the linker in the object file if one is generated. The linker will then evaluate the expression when segment placement has been done.
More complex expressions are possible. The action specifier warning outputs a warning, while the error specifier outputs an error message. In the latter case, generation of the output file is suppressed in both the assembler and linker.
Is followed by a plus or a minus character. When switched off which is the default so this does not make much sense , this does not happen and an error message is displayed. The state of the autoimport flag is evaluated when the complete source was translated, before outputting actual code, so it is not possible to switch this feature on or off for separate sections of code. The last setting is used for all symbols. You should probably not use this switch because it delays error messages about undefined symbols until the link stage.
The cc65 compiler which is supposed to produce correct assembler code in all circumstances, something which is not true for most assembler programmers will insert this command to avoid importing each and every routine from the runtime library. Define byte sized data by extracting only the bank byte that is, bits from each expression.
This is equivalent to. See also:. Switch to the BSS segment. Define byte sized data. Must be followed by a sequence of byte ranged expressions or strings. Switch on or off case sensitivity on identifiers. The default is off that is, identifiers are case sensitive , but may be changed by the -i switch on the command line. Apply a custom mapping for characters for the commands.
The command is followed by two numbers. The first one is the index of the source character range The mapping applies to all character and string constants when they generate output; and, overrides a mapping table specified with the -t command line switch. Switch to the CODE segment. Export a symbol and mark it in a special way. The linker is able to build tables of all such symbols. This may be used to automatically create a list of functions needed to initialize linked library modules.
Note: The linker has a feature to build a table of marked routines, but it is your code that must call these routines, so just declaring a symbol with. All symbols are exported as an absolute 16 bit symbol. You don't need to use an additional. CONDES is followed by the type, which may be constructor , destructor or a numeric value between 0 and 6 where 0 is the same as specifying constructor and 1 is equal to specifying destructor.
After the type, an optional priority may be specified. Higher numeric values mean higher priority. If no priority is given, the default priority of 7 is used. Be careful when assigning priorities to your own module constructors so they won't interfere with the ones in the cc65 library.
Export a symbol and mark it as a module constructor. This may be used together with the linker to build a table of constructor subroutines that are called by the startup code. Note: The linker has a feature to build a table of marked routines, but it is your code that must call these routines, so just declaring a symbol as constructor does nothing by itself. A constructor is always exported as an absolute 16 bit symbol.
It may have an optional priority that is separated by a comma. Higher numeric values mean a higher priority. Switch to the DATA segment. Define word sized data with the hi and lo bytes swapped use.
0コメント