diff --git a/doc/asm/db.htm b/doc/asm/db.htm index 45e5c0de..59a019cd 100644 --- a/doc/asm/db.htm +++ b/doc/asm/db.htm @@ -1,37 +1,26 @@ - - - - xAsm DB, DW + + + + + xAsm DB, DW - + + +

DB, DW

+

DB defines a list of bytes that will be stored in the final image. Ideal for tables and text.

+
DB   1,2,3,4,"This is a string"
+

Alternatively you can use DW to store a list of words. Strings are not allowed as arguments to DW.

+

You can also use DB and DW without arguments. This works exactly like “DS 1” and “DS 2” respectively. Consequently DB and DW can be used in a BSS/HRAM/VRAM section.

+

See also:

+ - -

DB
-DW -

-
- -

DB defines a list of bytes that will be stored in the final image. Ideal for tables and text.
-
- - - - -
-
DB   1,2,3,4,"This is a string"
-
-

Alternatively you can use DW to store a list of words. Strings are not allowed as arguments to DW. -

You can also use DB and DW without arguments. This works exactly like "DS 1" and "DS 2" respectively. Consequently DB and -DW can be used in a BSS/HRAM/VRAM section. -

See also:

- - -

-

Last updated 02 July 1997 by Carsten Sorensen

+
+

Last updated 02 July 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/ds.htm b/doc/asm/ds.htm index 8de7bf2c..ce0610a8 100644 --- a/doc/asm/ds.htm +++ b/doc/asm/ds.htm @@ -1,31 +1,20 @@ - - - - xAsm DS + + + + + xAsm DS - - - -

DS -

-
- -

DS allocates a number of bytes. The content is undefined. This is the preferred method of allocationg space in a BSS section. You can however also use DB and DW without any arguments.
-
- - - - -
-
DS   str_SIZEOF     ;allocate str_SIZEOF bytes
-
- -

See also:

- - -

-

Last updated 02 July 1997 by Carsten Sorensen

+ + +

DS

+

DS allocates a number of bytes. The content is undefined. This is the preferred method of allocationg space in a BSS section. You can however also use DB and DW without any arguments.

+
DS   str_SIZEOF     ;allocate str_SIZEOF bytes
+

See also:

+ +
+

Last updated 02 July 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/equ.htm b/doc/asm/equ.htm index 9dd7a07d..bd88e6d1 100644 --- a/doc/asm/equ.htm +++ b/doc/asm/equ.htm @@ -1,30 +1,21 @@ - - - - xAsm EQU + + + + + xAsm EQU - - - -

EQU


- -

EQUates are constant symbols. They can for example be used for things such as bit-definitions of hardware-registers.
-
- - - - -
-
DONUT_ISGOOD   EQU  $01
-DONUT_ISBAD    EQU  $02
-
-

Note that a colon (:) following the label-name is not allowed. EQUates can be exported and imported. They don't change their value during the link process.
- -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+ + +

EQU

+

EQUates are constant symbols. They can for example be used for things such as bit-definitions of hardware-registers.

+
DONUT_ISGOOD   EQU  $01
+DONUT_ISBAD    EQU  $02
+

Note that a colon (:) following the label-name is not allowed. EQUates can be exported and imported. They don't change their value during the link process.

+

See also:

+ +
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/equs.htm b/doc/asm/equs.htm index 2cad356b..5209bf34 100644 --- a/doc/asm/equs.htm +++ b/doc/asm/equs.htm @@ -1,49 +1,27 @@ - - - - xAsm EQUS + + + + + xAsm EQUS - - - -

EQUS


- -

EQUS is used to define string-symbols. Wherever the assembler meets a string symbol its name is replaced with its value. If you are familiar with C you can think of it as the same as #define.
-
- - - - -
-
COUNTREG EQUS "[hl+]"
+
+
+

EQUS

+

EQUS is used to define string-symbols. Wherever the assembler meets a string symbol its name is replaced with its value. If you are familiar with C you can think of it as the same as #define.

+
COUNTREG EQUS "[hl+]"
           
-         ld   a,COUNTREG
-
-

(Note that : following the label-name is not allowed.)
-

This will be interpreted as:
- - - - -
-
         ld   a,[hl+]
-
-

String-symbols can also be used to define small one-line macros:
- - - - -
-
PUSHA    EQUS "push af\npush bc\npush de\npush hl\n"
-
-

Note that a colon (:) following the label-name is not allowed. String equates can't be exported or imported.
- -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

- + ld a,COUNTREG +

(Note that : following the label-name is not allowed.)

+

This will be interpreted as:

+
         ld   a,[hl+]
+

String-symbols can also be used to define small one-line macros:

+
PUSHA    EQUS "push af\npush bc\npush de\npush hl\n"
+

Note that a colon (:) following the label-name is not allowed. String equates can't be exported or imported.

+

See also:

+ +
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/export.htm b/doc/asm/export.htm index c01a95b8..07a987f0 100644 --- a/doc/asm/export.htm +++ b/doc/asm/export.htm @@ -1,42 +1,35 @@ - - - - xAsm EXPORT/XREF, IMPORT/XDEF, GLOBAL + + + + + xAsm EXPORT/XREF, IMPORT/XDEF, GLOBAL - - - -

EXPORT/XREF
-IMPORT/XDEF
-GLOBAL


- -

Importing and exporting of symbols is a feature that is very useful when your project spans many source-files and for example you -need to jump to a routine defined in another file.
-
- - - - - - - - - - - - - - - - - - - -
Import/export commands
CommandMeaning
IMPORT (or XREF) label[,label,...]This instructs the assembler to define label as if it were present - in the current file but leave the address calculation to the linker.
EXPORT (or XDEF) label[,label,...]The assembler will make label accessible to - other files during the link process.
GLOBAL label[,label,...]If label is defined during the assembly it will be exported, - if not it will be imported. Handy (very!) for include-files.
- -


-

Last updated 21 June 1997 by Carsten Sorensen

+ + +

EXPORT/XREF, IMPORT/XDEF, GLOBAL

+

Importing and exporting of symbols is a feature that is very useful when your project spans many source-files and for example you need to jump to a routine defined in another file.

+ + + + + + + + + + + + + + + + + + + + +
Import/export commands
CommandMeaning
IMPORT (or XREF) label[,label,...]This instructs the assembler to define label as if it were present + in the current file but leave the address calculation to the linker.
EXPORT (or XDEF) label[,label,...]The assembler will make label accessible to other files during the link process.
GLOBAL label[,label,...]If label is defined during the assembly it will be exported, if not it will be imported. Handy (very!) for include-files.
+
+

Last updated 21 June 1997 by Carsten Sorensen

+ diff --git a/doc/asm/expr_fix.htm b/doc/asm/expr_fix.htm index 153b5f6d..bede2bac 100644 --- a/doc/asm/expr_fix.htm +++ b/doc/asm/expr_fix.htm @@ -1,86 +1,76 @@ - - - - xAsm Fixed-point expression + + + + + xAsm Fixed-point expression - + + +

Fixed‐point Expressions

+

Fixed point constants are basically normal 32-bit constants where the upper 16 bits are used for the integer part and the lower 16 bits are used for the fraction (65536ths). This means that you can use them in normal integer expression and indeed some integer operators like plus and minus don't care whether the operands are integer or fixed-point. You can easily convert a fixed-point number to an integer by shifting it right 16 bits. It follows that you can convert an integer to a fixed-point number by shifting it left.

+

Some things are different for fixed-point math though. Which is why you have the following functions to use:

- -

Fixed-point expressions -

-
- -

Fixed point constants are basically normal 32-bit constants where the upper 16 bits are used for the integer part and the lower 16 bits are used for the fraction (65536ths). This means that you can use them in normal integer expression and indeed some integer operators like plus and minus don't care whether the operands are integer or fixed-point. You can easily convert a fixed-point number to an integer by shifting it right 16 bits. It follows that you can convert an integer to a fixed-point number by shifting it left. -

Some things are different for fixed-point math though. Which is why you have the following functions to use: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameOperation
DIV(x,y)x/y
MUL(x,y)x*y
SIN(x)sin(x)
COS(x)cos(x)
TAN(x)tan(x)
ASIN(x)sin-1(x)
ACOS(x)cos-1(x)
ATAN(x)tan-1(x)
ATAN2(x,y)(x,y) angle
-

These functions are extremely useful for automatic generation of various tables. A circle has 65536.0 -degrees. Sine values are between [-1.0;1.0]
-
- - - - -
-
; --
+
+
+
+	
+	
+
+
+
+	
+	
+
+
+	
+	
+
+
+	
+	
+
+
+	
+	
+
+
+	
+	
+
+
+	
+	
+
+
+	
+	
+
+
+	
+	
+
+
+	
+	
+
+
NameOperation
DIV(x,y)x/y
MUL(x,y)x*y
SIN(x)sin(x)
COS(x)cos(x)
TAN(x)tan(x)
ASIN(x)sin-1(x)
ACOS(x)cos-1(x)
ATAN(x)tan-1(x)
ATAN2(x,y)(x,y) angle
+

These functions are extremely useful for automatic generation of various tables. A circle has 65536.0 degrees. Sine values are between [-1.0;1.0]

+
; --
 ; -- Generate a 256 byte sine table with values between 0 and 128
 ; --
 ANGLE   SET     0.0
         REPT    256
         DB      (MUL(64.0,SIN(ANGLE))+64.0)>>16
 ANGLE   SET     ANGLE+256.0
-        ENDR
-
- -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+ ENDR +

See also:

+ +
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/expr_int.htm b/doc/asm/expr_int.htm index 6286a376..4e6579af 100644 --- a/doc/asm/expr_int.htm +++ b/doc/asm/expr_int.htm @@ -1,104 +1,92 @@ - - - - xAsm Integer/Boolean expressions + + + + + xAsm Integer/Boolean expressions - + + +

Integer and Boolean expressions

+

An expression can be composed of many things. Expressions are always evaluated using signed 32-bit math.

+

The most basic expression is just a single number.

+

Numeric Formats

+

xAsm has a number of numeric formats.

+ +

The last one, Gameboy graphics, is quite interesting and useful. The values are actually pixel values and it converts the “chunky” data to “planar” data as used in the Gameboy.

+
DW   `01012323
+

Admittedly an expression with just a single number is quite boring. To spice things up a bit there’s a few operators you can use to perform calculations between numbers.

+

Operators

+

A great number of operators you can use in expressions are available (listed in order of precedence):

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Operators
OperatorMeaning
( )Precedence override
FUNC()Functioncall
~ + -Unary not/plus/minus
* / %Multiply/divide/modulo
<< >>Shift left/right
& | ^Binary and/or/xor
+ -Add/subtract
!= == <= >= < >Boolean comparison
&& ||Boolean and/or
!Unary Boolean not
- -

Integer and Boolean expressions -

-
+

The result of the boolean operators is zero if when FALSE and non-zero when TRUE. Thus it is legal to use an integer as the condition for IF blocks. You can use symbols instead of numbers in your expression if you wish.

-

An expression can be composed of many things. Expressions are always evaluated using signed 32-bit math. -

The most basic expression is just a single number. -


Numeric Formats

-

xAsm has a number of numeric formats. -

-

The last one, Gameboy graphics, is quite interesting and useful. The values are actually pixel values and it converts -the "chunky" data to "planar" data as used in the Gameboy.
-
- - - - -
-
DW   `01012323
-
+

An expression is said to be constant when it doesn't change its value during linking. This basically means that you can't use labels in those expressions. The instructions in the macro-language all require expressions that are constant.

+

See also:

+ -Admittedly an expression with just a single number is quite boring. To spice things up a bit there's a few operators you can use to perform calculations between numbers. -


-Operators

-

A great number of operators you can use in expressions are available (listed in order of precedence): - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Operators
OperatorMeaning
( )Precedence override
FUNC()Functioncall
~ + -Unary not/plus/minus
* / %Multiply/divide/modulo
<< >>Shift left/right
& | ^Binary and/or/xor
+ -Add/subtract
!= == <= >= < >Boolean comparison
&& ||Boolean and/or
!Unary Boolean not
- -

The result of the boolean operators is zero if when FALSE and non-zero when TRUE. Thus it is legal to use an integer as the condition for IF blocks. You can use symbols instead of numbers in your expression if you wish. - -

An expression is said to be constant when it doesn't change its value during linking. This basically means that you can't use labels in those expressions. The instructions in the macro-language all require expressions that are constant
- -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/expr_str.htm b/doc/asm/expr_str.htm index 3ac84e44..d35abf2a 100644 --- a/doc/asm/expr_str.htm +++ b/doc/asm/expr_str.htm @@ -1,118 +1,114 @@ - - - - xAsm String expressions + + + + + xAsm String expressions - + + +

String Expressions

+

The most basic string expression is any number of characters contained in double quotes ("for instance"). As in C the escape character is \ and there is a number of commands you can use within a string:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Escape characters:
Character sequenceMeaningNotes
\\Backslash
\"Double-quote
\{Curly bracket left
\}Curly bracket right
\nNewline ($0A)
\tTab ($09)
\1-\9MacroargumentOnly in macros
\@Labelname suffixOnly in macros and repts
- -

String expressions -

-
+

A funky feature is {symbol} withing a string. This will examine the type of the symbol and insert its value accordingly. If symbol is a string symbol the symbols value is simply copied. If it's a numeric symbol the value is converted to hexadecimal notation and inserted as a string.

+

HINT: The {symbol} construct can also be used outside strings. The symbols value is again inserted as a string. This is just a short way of doing "{symbol}".

+

Whenever the macro-language expects a string you can actually use a string expression. This consists of one or more of these function. Yes, you can nest them. Note that some of these functions actually return an integer and can be used as part of an integer expression!

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
String functions:
NameOperation
STRLEN(stringexpr)Returns the number of characters in string
STRCAT(stringexpr1,stringexpr2)Appends stringexpr2 to stringexpr1.
STRCMP(stringexpr1,stringexpr2)Returns negative if stringexpr1 is alphabetically less than stringexpr2
Zero if they match
Positive if greater than
STRIN(haystack,needle)Returns needles position within haystack or zero if it's not present
STRSUB(stringexpr,pos,count)Returns a substring of stringexpr starting at pos (first character is position 1) and with count characters
STRUPR(stringexpr)Converts all characters in string to capitals and returns the new string
STRLWR(string)Converts all characters in string to lower case and returns the new string
-

The most basic string expression is any number of characters contained in double quotes ("for instance"). As in C the escape -character is \ and there is a number of commands you can use within a string:
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Escape characters:
Character sequenceMeaningNotes
\\Backslash
\"Double-quote
\{Curly bracket left
\}Curly bracket right
\nNewline ($0A)
\tTab ($09)
\1-\9MacroargumentOnly in macros
\@Labelname suffixOnly in macros and repts
+

See also:

+ -

A funky feature is {symbol} withing a string. This will examine the type of the symbol and insert its -value accordingly. If symbol is a string symbol the symbols value is simply copied. If it's a numeric symbol the value is converted -to hexadecimal notation and inserted as a string. -

HINT: The {symbol} construct can also be used outside strings. The symbols value is again inserted as a -string. This is just a short way of doing "{symbol}".
- -Whenever the macro-language expects a string you can actually use a string expression. This consists of one or more of these function. Yes, you can nest them. Note that some of these functions actually return an integer and can be used as part of an integer expression!
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
String functions:
NameOperation
STRLEN(stringexpr)Returns the number of characters in string
STRCAT(stringexpr1,stringexpr2)Appends stringexpr2 to stringexpr1.
STRCMP(stringexpr1,stringexpr2)Returns negative if stringexpr1 is alphabetically less than stringexpr2
Zero if they match
Positive if greater than
STRIN(haystack,needle)Returns needles position within haystack or zero if it's not present
STRSUB(stringexpr,pos,count)Returns a substring of stringexpr starting at pos (first character is position 1) and with count characters
STRUPR(stringexpr)Converts all characters in string to capitals and returns the new string
STRLWR(string)Converts all characters in string to lower case and returns the new string
- -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/fail.htm b/doc/asm/fail.htm index f201d5ce..93a347e7 100644 --- a/doc/asm/fail.htm +++ b/doc/asm/fail.htm @@ -1,25 +1,20 @@ - - - - xAsm FAIL, WARN + + + + + xAsm FAIL, WARN - + + +

FAIL, WARN

+

FAIL and WARN can be used to terminate the assembling process if you wish to do so. This is especially useful for macros that get an invalid argument. FAIL and WARN take a string as the only argument and they will print this string out as a normal error with a linenumber.

+

FAIL stops assembling immediately while WARN continues after printing the errormessage.

- -

FAIL
-WARN -

-
- -

FAIL and WARN can be used to terminate the assembling process if you wish to do so. This is especially useful for -macros that get an invalid argument. FAIL and WARN take a string as the only argument and they will print this string out as a normal error with a linenumber. -

FAIL stops assembling immediatly while WARN continues after printing the errormessage. - -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+

See also:

+ +
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/history.htm b/doc/asm/history.htm index 36bb6022..ecfde119 100644 --- a/doc/asm/history.htm +++ b/doc/asm/history.htm @@ -1,97 +1,103 @@ - - - - xAsm History + + + + + xAsm History - - - -

xAsm History


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The history of xAsm
VersionDatedRelease notes
1.01 Oct. 96First release
1.011 Dec. 96Fixed bug in INCBIN (sometimes reported the section full)
- Added DEF() function
1.0212 Feb. 97Added STRLEN(), STRCAT(), STRIN(), STRCMP(), STRSUB(), STRUPR() and STRLWR() functions
- IMPORT/EXPORT/GLOBAL takes multiple arguments now
- HRAM sectiontype added
- ORG like features added to SECTION
- LDIO mnemonic added
1.0323 Mar. 97The HRAM section was 128 bytes long instead of 127. potentially thrashing the interrupt enable register if you filled the HRAM.
- The BANK() function, when used on a symbol defined in the current sourcefile, returned the wrong bank ID. (reported by Harry P. Mulder)
- The BANK() function didn't check whether the argument was a properly defined symbol. (reported by Harry P. Mulder)
- Completely new lexical analyser module. This fixed several linenumber bugs and other macro/if/rept related bugs. Also fixed a bug which made it possible to have equated symbols with the same name as a reserved keyword (if you get a "parse error" with this release on some of your sources, this is probably what is going on)
- FAIL and WARN commands.
- __LINE__, __FILE__, __TIME__, __DATE__ predefined symbols added.
-
1.0403 July 1997First ASMotor release
-__TIME__ and __DATE__ give todays date instead of when the assembler was compiled.
-Sometimes the first line of a file wouldn't assemble correctly. Reported by Jeff Frohwein.
-Unrolling multiline string symbols left the linecounter in a sorry state. Jeff Frohwein again.
-DB and DW can now (officially ;-) be used in BSS/HRAM/VRAM sections without any arguments to reserve a byte or a word respectively. Reported/suggested/inspired by Mr. Frohwein.
-The character # can now be used as part of a symbol name. Jeff....
-The RS counter "_RS" is now defined from the very start of the assembly process instead of after the first RSSET or RSRESET.
-Bug fixed: You couldn't use \0-\9 and \@ in {} constructs
-PURGE pseudo-op added. Purges a symbol from the symboltable and memory. Use with extreme caution! Inspired by Harry P. Mulder
-MACRO parameter passing method changed drastically. Read (and re-read) the manual for details. Suggested by Harry P. Mulder.
-
1.0520 July 1997RGBDS fixes:
+ + +

xAsm History

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - + +
The history of xAsm
VersionDatedRelease notes
1.01 Oct. 96First release
1.011 Dec. 96
    +
  • Fixed bug in INCBIN (sometimes reported the section full)
  • +
  • Added DEF() function +
1.0212 Feb. 97
1.0323 Mar. 97
    +
  • The HRAM section was 128 bytes long instead of 127. potentially thrashing the interrupt enable register if you filled the HRAM.
  • +
  • The BANK() function, when used on a symbol defined in the current sourcefile, returned the wrong bank ID. (reported by Harry P. Mulder)
  • +
  • The BANK() function didn't check whether the argument was a properly defined symbol. (reported by Harry P. Mulder)
  • +
  • Completely new lexical analyser module. This fixed several linenumber bugs and other macro/if/rept related bugs. Also fixed a bug which made it possible to have equated symbols with the same name as a reserved keyword (if you get a "parse error" with this release on some of your sources, this is probably what is going on)
  • +
  • FAIL and WARN commands.
  • +
  • __LINE__, __FILE__, __TIME__, __DATE__ predefined symbols added.
  • +
+
1.0403 July 1997
  • First ASMotor release
  • +
  • __TIME__ and __DATE__ give todays date instead of when the assembler was compiled.
  • +
  • Sometimes the first line of a file wouldn't assemble correctly. Reported by Jeff Frohwein.
  • +
  • Unrolling multiline string symbols left the linecounter in a sorry state. Jeff Frohwein again.
  • +
  • DB and DW can now (officially ;-) be used in BSS/HRAM/VRAM sections without any arguments to reserve a byte or a word respectively. Reported/suggested/inspired by Mr. Frohwein.
  • +
  • The character # can now be used as part of a symbol name. Jeff....
  • +
  • The RS counter "_RS" is now defined from the very start of the assembly process instead of after the first RSSET or RSRESET.
  • +
  • Bug fixed: You couldn't use \0-\9 and \@ in {} constructs
  • +
  • PURGE pseudo-op added. Purges a symbol from the symboltable and memory. Use with extreme caution! Inspired by Harry P. Mulder
  • +
  • MACRO parameter passing method changed drastically. Read (and re-read) the manual for details. Suggested by Harry P. Mulder.
  • +
+
1.0520 July 1997RGBDS fixes:
RGBAsm supports the LDD and LDI syntax plus [HLD] and [HLI]. LDH is synonymous with LDIO.
General fixes:
There was a bug in the macro parameter passing. Any whitespace after the last parameter would be appended to the last parameter. Reported by Jeff Frohwein.
-A section stack has been implemented. Look up POPS and PUSHS. Jeff Frohweins doing again.
-OPT command added for defining and changing some options while assembling.
-You can now define which characters are used for the Gameboy graphics -integer (`) using the commandline or the new OPT command. Cool idea by (surprise surprise) Jeff Frohwein.
-Also, an option stack has been added. Look up POPO and PUSHO in the +A section stack has been implemented. Look up POPS and PUSHS. Jeff Frohweins doing again.
+OPT command added for defining and changing some options while assembling.
+You can now define which characters are used for the Gameboy graphics +integer (`) using the commandline or the new OPT command. Cool idea by (surprise surprise) Jeff Frohwein.
+Also, an option stack has been added. Look up POPO and PUSHO in the manual.
Fixed yet another line number bug reported by Jeff Frohwein (when will this guy leave me alone? ;)
-
1.0622 July 1997General fixes:
+
1.0622 July 1997General fixes:
The lamest typo bug of all time has been fixed. RGBAsm would output a word defined with DW as 4 bytes instead of 2. Jeff Frohwein reported this.
The first line of an included file didn't assemble correctly.
--b option added for setting the characters used for binary constants.
-
1.0821 September 1997General fixes:
+-b option added for setting the characters used for binary constants.
+
1.0821 September 1997General fixes:
A crash occured if you tried to use a macro symbol in an expression. (Jeff Frohwein)
You couldn't use STRCMP, STRLEN and STRIN in relocatable expressions. (Harry @@ -99,109 +105,109 @@ P. Mulder)
Relocatable symbols are no longer allowed as arguments to the DEF function.
Bug fixed in the assembler where it would sometimes write out too many bytes for HRAM section definitions.
-
1.0802 July 1999 +
1.0802 July 1999 Feature:
- DQ directive added for defining 32-bit data constants. See operation of DW & DB. + DQ directive added for defining 32-bit data constants. See operation of DW & DB.
-
1.0805 July 1999 +
1.0805 July 1999 Feature:
Allow only a part of a binary file to be included instead of the whole thing.
-
1.0810 June 1999 +
1.0810 June 1999 Feature:
Added output of file dependency information for each file included/assembled. Enabled with a command line option.
-
1.08?? ???? 1999 +
1.08?? ???? 1999 Feature:
Added ORG directive to allow anonymous sections.
-
1.08?? ???? 1999 +
1.08?? ???? 1999 Feature:
Added ability to output error information in either RGBDS or Microsoft Developer Studio format.
-
1.08?? ???? 1999 +
1.08?? ???? 1999 Feature:
Added pseudo-instructions to handle NE (not equal), EQ (equal), and LT (less than) on JR/JP/CALL instructions
-
1.08?? ???? 1999 +
1.08?? ???? 1999 Feature:
Added STRTRIM, STRLTRIM, STRRTRIM directives to allow trimming of white space from strings in macro arguments.
-
1.08?? ???? 1999 +
1.08?? ???? 1999 Bug Fix:
When an "unknown symbol" error was reported during the link phase the undefined symbol was not given.
-
1.08?? ???? 1999 +
1.08?? ???? 1999 Bug Fix:
Declaring a symbol as GLOBAL in a header file and then referencing it in code but never defining it would crash the linker.
-
1.0908 February 2000 +
1.0908 February 2000 Feature:
Can now use a command line option to set the number format between a slightly tweaked Motorola/RGBDS format and Zilog.
Hex numbers can now be represented as $FF or FFh.
- Octal as &77 or 77o. + Octal as &77 or 77o.
Binary as %10010110 or 10010110b.
@@ -209,10 +215,10 @@ for HRAM section definitions.

Decimal numbers remain unchanged.
-


-

Last updated 21 September 1997 by Carsten Sorensen

+

Last updated 21 September 1997 by Carsten Sorensen

diff --git a/doc/asm/if.htm b/doc/asm/if.htm index 44b996ee..df0ec6d8 100644 --- a/doc/asm/if.htm +++ b/doc/asm/if.htm @@ -1,37 +1,24 @@ - - - - xAsm IF, ELSE, ENDC + + + + + xAsm IF, ELSE, ENDC - - - -

IF
-ELSE
-ENDC -

-
- -

These three commands is used to conditionally assemble parts of your file. It is a powerful feature commonly used in macros.
-
- - - - -
-
IF   2+2==4
+
+
+

IF, ELSE, ENDC

+

These three commands is used to conditionally assemble parts of your file. It is a powerful feature commonly used in macros.

+
IF   2+2==4
 PRINTT    "2+2==4\n"
 ELSE
 PRINTT    "2+2!=4\n"
-ENDC
-
-

The ELSE block is optional. IF/ELSE/ENDC-blocks can be nested.
- -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+ENDC +

The ELSE block is optional. IF/ELSE/ENDC-blocks can be nested.

+

See also:

+ +
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/incbin.htm b/doc/asm/incbin.htm index 9f2c4e53..5dfdeb61 100644 --- a/doc/asm/incbin.htm +++ b/doc/asm/incbin.htm @@ -1,44 +1,22 @@ - - - - xAsm INCBIN + + + + + xAsm INCBIN - - - -

INCBIN -

-
- -

You probably have some graphics you'd like to include. Use INCBIN to include a raw binary -file as it is. If the file isn't found in the current directory the include-path list will be searched.
-
- - - - -
-
INCBIN    "titlepic.bin"
-INCBIN    "sprites\\hero.bin"
-
- -

You can also include only part of a file with INCBIN. The example below includes 256 bytes from data.bin starting from position 78.
- -
- - - - -
-
INCBIN    "data.bin",78,256
-
- - -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+ + +

INCBIN

+

You probably have some graphics you’d like to include. Use INCBIN to include a raw binary file as it is. If the file isn’t found in the current directory the include-path list will be searched.

+
INCBIN    "titlepic.bin"
+INCBIN    "sprites\\hero.bin"
+

You can also include only part of a file with INCBIN. The example below includes 256 bytes from data.bin starting from position 78.

+
INCBIN    "data.bin",78,256
+

See also:

+ +
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/include.htm b/doc/asm/include.htm index 4bb38c13..41f34f74 100644 --- a/doc/asm/include.htm +++ b/doc/asm/include.htm @@ -1,30 +1,19 @@ - - - - xAsm INCLUDE + + + + + xAsm INCLUDE - - - -

INCLUDE -

-
- -

Use INCLUDE to process another assembler-file and then return to the current file when done. If the file isn't found in the current directory the include-path list will be searched. You may nest INCLUDE calls infinitely (or until you run out of memory whichever comes first).
-
- - - - -
-
INCLUDE   "irq.inc"
-
- -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+ + +

INCLUDE

+

Use INCLUDE to process another assembler-file and then return to the current file when done. If the file isn't found in the current directory the include-path list will be searched. You may nest INCLUDE calls infinitely (or until you run out of memory whichever comes first).

+
INCLUDE   "irq.inc"
+

See also:

+ +
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/labels.htm b/doc/asm/labels.htm index 547bfbdb..755442f9 100644 --- a/doc/asm/labels.htm +++ b/doc/asm/labels.htm @@ -1,30 +1,22 @@ - - - - xAsm Labels + + + + + xAsm Labels - - - -

Labels


-

One of the assemblers main tasks is to keep track of addresses for you so you don't have to remember obscure numbers but can make do with a meaningful name, a label.
-

This can be done in a number of ways:
-
- - - - -
-
GlobalLabel
+
+
+

Labels

+

One of the assembler’s main tasks is to keep track of addresses for you so you dor’t have to remember obscure numbers but can make do with a meaningful name, a label.

+

This can be done in a number of ways:

+
GlobalLabel
 AnotherGlobal:
 .locallabel
 .yet_a_local:
-ThisWillBeExported::        ;note the two colons
-
-

This is very similar to other assemblers. Local labels are only accessible within the scope they are defined. A scope starts after a global label and ends at the next global label. You may or may not have seen the :: feature before. It declares a normal global label but does an EXPORT at the same time.
-

Labels will normally change their value during the link process and are thus not constant.
-
- -


-

Last updated 21 June 1997 by Carsten Sorensen

+ThisWillBeExported:: ;note the two colons +

This is very similar to other assemblers. Local labels are only accessible within the scope they are defined. A scope starts after a global label and ends at the next global label. You may or may not have seen the :: feature before. It declares a normal global label but does an EXPORT at the same time.

+

Labels will normally change their value during the link process and are thus not constant.

+
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/macro.htm b/doc/asm/macro.htm index 3580b6f0..d2fdbb52 100644 --- a/doc/asm/macro.htm +++ b/doc/asm/macro.htm @@ -1,121 +1,60 @@ - - - - xAsm MACRO/ENDM + + + + + xAsm MACRO/ENDM - - - -

MACRO
-ENDM


- -

One of the best features of an assembler is the ability to write macros for it. Macros also provide a method of passing -arguments to them and they can then react to the input using IF-constructs.
-
- - - - -
-
MyMacro:  MACRO
+
+
+

MACRO, ENDM

+

One of the best features of an assembler is the ability to write macros for it. Macros also provide a method of passing arguments to them and they can then react to the input using IF-constructs.

+
MyMacro:  MACRO
           ld   a,80
           call MyFunc
-          ENDM
-
-

The above example is a very simple macro. You execute the macro by typing its name.
-
- - - - -
-
          add  a,b
+          ENDM
+

The above example is a very simple macro. You execute the macro by typing its name.

+
          add  a,b
           ld   sp,hl
           MyMacro        ;This will be expanded
-          sub  a,87
-
-

When the assembler meets MyMacro it will insert the macrodefinition (the text enclosed in MACRO/ENDM). -

Suppose your macro contains a loop.
-
- - - - -
-
LoopyMacro:    MACRO
+          sub  a,87
+

When the assembler meets MyMacro it will insert the macrodefinition (the text enclosed in MACRO/ENDM).

+

Suppose your macro contains a loop.

+
LoopyMacro:    MACRO
                xor  a,a
 .loop          ld   [hl+],a
                dec  c
                jr   nz,.loop
-               ENDM
-
-

This is fine. That is, if you only use the macro once per scope. To get around this problem there is a special label string equate called \@ that you can append to your labels and it will then expand to a unique string. -\@ also works in REPT-blocks should you have any loops there.
-
- - - - -
-
LoopyMacro:    MACRO
+               ENDM
+

This is fine. That is, if you only use the macro once per scope. To get around this problem there is a special label string equate called \@ that you can append to your labels and it will then expand to a unique string.

+

\@ also works in REPT-blocks should you have any loops there.

+
LoopyMacro:    MACRO
                xor  a,a
 .loop\@        ld   [hl+],a
                dec  c
                jr   nz,.loop\@
-               ENDM
-
-

Arguments

-

I'd like LoopyMacro a lot better if I didn't have to pre-load the registers with values and then call it. -What I'd like is the ability to pass it arguments and it then loaded the registers itself. -

And I can do that. In macros you can get the arguments by using the special macro string equates \1 through -\9, \1 being the first argument specified on the calling of the macro.
-
- - - - -
-
LoopyMacro:    MACRO
+               ENDM
+

Arguments

+

I’d like LoopyMacro a lot better if I didn’t have to pre-load the registers with values and then call it. What I’d like is the ability to pass it arguments and it then loaded the registers itself.

+

And I can do that. In macros you can get the arguments by using the special macro string equates \1 through \9, \1 being the first argument specified on the calling of the macro.

+
LoopyMacro:    MACRO
                ld   hl,\1
                ld   c,\2
                xor  a,a
 .loop\@        ld   [hl+],a
                dec  c
                jr   nz,.loop\@
-               ENDM
-
-

Now I can call the macro specifying two arguments. The first being the address and the second being a bytecount. -The macro will then reset all bytes in this range.
-
- - - - -
-
               LoopyMacro     MyVars,54
-
-

You can specify up to nine arguments when calling a - macro. Arguments are passed as string equates. There's no need to enclose them in quotes. Parameter passing has changed a bit since v1.03 in that an expression will not be evaluated first but passed directly. This means that it's probably a very good idea to use -brackets around \1-\9 if you perform further calculations on them. For instance if you pass 1+2 as the first argument and then do + ENDM +

Now I can call the macro specifying two arguments. The first being the address and the second being a bytecount. The macro will then reset all bytes in this range.

+
               LoopyMacro     MyVars,54
+

You can specify up to nine arguments when calling a macro. Arguments are passed as string equates. There’s no need to enclose them in quotes. Parameter passing has changed a bit since v1.03 in that an expression will not be evaluated first but passed directly. This means that it’s probably a very good idea to use brackets around \1–\9 if you perform further calculations on them. For instance if you pass 1+2 as the first argument and then do PRINTV \1*2 +you will get the value 5 on screen and not 6 as you might have expected.

+

Note that a colon (:) following the macro-name is required. Macros can't be exported or imported. It's valid to call a macro from a macro (yes, even the same one).

-

- - - -
-
    PRINTV  \1*2
-
-
- -you will get the value 5 on screen and not 6 as you might have expected..
- -

Note that a colon (:) following the macro-name is required. Macros can't be exported or imported. It's valid to call a macro from a macro (yes, even the same one).
- -

See also:

- - -

-

Last updated 02 July 1997 by Carsten Sorensen

+

See also:

+ +
+

Last updated 02 July 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/miscfunc.htm b/doc/asm/miscfunc.htm index eac9ce5b..c843de12 100644 --- a/doc/asm/miscfunc.htm +++ b/doc/asm/miscfunc.htm @@ -1,42 +1,38 @@ - - - - xAsm Other functions + + + + + xAsm Other functions - - - -

Other functions -

-
- -There's a few other functions that do various useful things: - -

- - - - - - - - - - - - - - -
Other functions
NameOperation
BANK(label)Gameboy ONLY: Returns the bank number label is in. The link will have to resolve this so it can't be used when the expression has to be constant
DEF(label)Returns TRUE if label has been defined
- -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+ + +

Other functions

+

There's a few other functions that do various useful things:

+ + + + + + + + + + + + + + + + +
Other functions
NameOperation
BANK(label)Gameboy ONLY: Returns the bank number label is in. The link will have to resolve this so it can't be used when the expression has to be constant
DEF(label)Returns TRUE if label has been defined
+

See alse:

+ +
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/opt.htm b/doc/asm/opt.htm index 6169e3ab..d01f4a4c 100644 --- a/doc/asm/opt.htm +++ b/doc/asm/opt.htm @@ -1,38 +1,27 @@ - - - - xAsm OPT + + + + + xAsm OPT - + + +

OPT

+

OPT can be used to change some of the options during assembling you source instead of defining them on the commandline.

+

OPT takes a comma-seperated list of options as its argument:

- -

OPT -

-
- -

OPT can be used to change some of the options during assembling you source instead of defining them on the commandline.
-

OPT takes a comma-seperated list of options as its argument: - -

- - - -
-
    PUSHO
+
    PUSHO
     OPT   g.oOX    ;Set the GB graphics constants to use these characters
     DW    `..ooOOXX
     POPO
-    DW    `00112233
-
- -

The options that OPT can modify are currently: b, e and g - -

See also:

- - -

-

Last updated 20 July 1997 by Carsten Sorensen

+ DW `00112233 +

The options that OPT can modify are currently: b, e and g

+

See also:

+ +
+

Last updated 20 July 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/popo.htm b/doc/asm/popo.htm index 45c0a52f..4843c5ea 100644 --- a/doc/asm/popo.htm +++ b/doc/asm/popo.htm @@ -1,25 +1,18 @@ - - - - xAsm POPO, PUSHO + + + + + xAsm POPO, PUSHO - - - -

POPO
-PUSHO -

-
- -

POPO and PUSHO provide the interface to the option stack. PUSHO will push the current set of options on the option stack. POPO can then later be used to restore them. Useful if you want to change some options in an include file and you don't want to destroy the options set by the program that included your file. The stacks number of entries is limited only by the amount of memory in your machine. - -

German people: Yes, I know what "POPO" means. You are hereby allowed to snigger and giggle every time you type it. - -

See also:

- - -

-

Last updated 20 July 1997 by Carsten Sorensen

+ + +

POPO, PUSHO

+

POPO and PUSHO provide the interface to the option stack. PUSHO will push the current set of options on the option stack. POPO can then later be used to restore them. Useful if you want to change some options in an include file and you don't want to destroy the options set by the program that included your file. The stacks number of entries is limited only by the amount of memory in your machine.

+

See also:

+ +
+

Last updated 20 July 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/pops.htm b/doc/asm/pops.htm index 54dad35e..cf5cd712 100644 --- a/doc/asm/pops.htm +++ b/doc/asm/pops.htm @@ -1,23 +1,18 @@ - - - - xAsm POPS, PUSHS + + + + + xAsm POPS, PUSHS - - - -

POPS
-PUSHS -

-
- -

POPS and PUSHS provide the interface to the section stack. PUSHS will push the current section context on the section stack. POPS can then later be used to restore it. Useful for defining sections in included files when you don't want to destroy the section context for the program that included your file. The stacks number of entries is limited only by the amount of memory in your machine. - -

See also:

- - -

-

Last updated 18 July 1997 by Carsten Sorensen

+ + +

POPS, PUSHS

+

POPS and PUSHS provide the interface to the section stack. PUSHS will push the current section context on the section stack. POPS can then later be used to restore it. Useful for defining sections in included files when you don't want to destroy the section context for the program that included your file. The stacks number of entries is limited only by the amount of memory in your machine.

+

See also:

+ +
+

Last updated 18 July 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/presym.htm b/doc/asm/presym.htm index 929bdc53..a7846f07 100644 --- a/doc/asm/presym.htm +++ b/doc/asm/presym.htm @@ -1,64 +1,63 @@ - - - - xAsm Predeclared symbols + + + + + xAsm Predeclared symbols - - - -

Predeclared symbols -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Symbols
NameContentsType
@PC valueEQU
_PIFixed point ¶EQU
_RS_RS counterSET
_NARGNumber of arguments passed to macroEQU
__LINE__The current linenumberEQU
__FILE__The current filenameEQUS
__DATE__Todays dateEQUS
__TIME__The current timeEQUS
- -

-

Last updated 21 June 1997 by Carsten Sorensen

+ + +

Predeclared symbols

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Symbols
NameContentsType
@PC valueEQU
_PIFixed point ¶EQU
_RS_RS counterSET
_NARGNumber of arguments passed to macroEQU
__LINE__The current linenumberEQU
__FILE__The current filenameEQUS
__DATE__Todays dateEQUS
__TIME__The current timeEQUS
+
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/print.htm b/doc/asm/print.htm index 83811dad..9e7f91b2 100644 --- a/doc/asm/print.htm +++ b/doc/asm/print.htm @@ -1,40 +1,29 @@ - - - - xAsm PRINTT, PRINTV, PRINTF + + + + + xAsm PRINTT, PRINTV, PRINTF - - - -

PRINTT
-PRINTV
-PRINTF
-

-
- -

These three instructions type text and values to stdout. Useful for debugging macros or wherever you may feel the -need to tell yourself some important information.
-
- - - - -
-
PRINTT    "I'm the greatest programmer in the whole wide world\n"
+
+
+

PRINTT, PRINTV, PRINTF

+

These three instructions type text and values to stdout. Useful for debugging macros or wherever you may feel the need to tell yourself some important information.

+
PRINTT    "I'm the greatest programmer in the whole wide world\n"
 PRINTV    (2+3)/5
-PRINTF    MUL(3.14,3987.0)
-
-PRINTT prints out a string
-PRINTV prints out an integer value or, as in the example, the result of a calculation. Unsurprisingly you can also print out a constant symbols value
-PRINTF prints out a fixed point value.
+PRINTF MUL(3.14,3987.0) +

    +
  • PRINTT prints out a string
  • +
  • PRINTV prints out an integer value or, as in the example, the result of a calculation. Unsurprisingly you can also print out a constant symbols value
  • +
  • PRINTF prints out a fixed point value.
  • +
-

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+

See also:

+ +
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/purge.htm b/doc/asm/purge.htm index fcc187c6..2763e60b 100644 --- a/doc/asm/purge.htm +++ b/doc/asm/purge.htm @@ -1,26 +1,18 @@ - - - - xAsm PURGE + + + + + xAsm PURGE - - - -

PURGE


- -

The PURGE command allows you to completely remove a symbol from the symbol table as if it had never existed. USE WITH EXTREME CAUTION!!! I can't stress this enough but you seriously need to know what you are doing. DON'T purge symbol that you use in expressions the linker needs to calculate. In fact, it's probably not even safe to purge anything other than string symbols and macros.
-
- - - - -
-
Kamikaze    EQUS    "I don't want to live anymore"
+
+
+

PURGE

+

The PURGE command allows you to completely remove a symbol from the symbol table as if it had never existed. USE WITH EXTREME CAUTION!!! I can’t stress this enough but you seriously need to know what you are doing. DON’T purge symbol that you use in expressions the linker needs to calculate. In fact, it’s probably not even safe to purge anything other than string symbols and macros.

+
Kamikaze    EQUS    "I don't want to live anymore"
 AOLer       EQUS    "Me too"
-            PURGE   Kamikaze,AOLer
-
-

Note that string symbols that are part of a PURGE command WILL NOT BE EXPANDED as the ONLY exception to this rule.
- -


-

Last updated 02 July 1997 by Carsten Sorensen

+ PURGE Kamikaze,AOLer +

Note that string symbols that are part of a PURGE command WILL NOT BE EXPANDED as the ONLY exception to this rule.

+
+

Last updated 02 July 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/rept.htm b/doc/asm/rept.htm index f6023863..60abe0e3 100644 --- a/doc/asm/rept.htm +++ b/doc/asm/rept.htm @@ -1,51 +1,32 @@ - - - - xAsm REPT, ENDR + + + + + xAsm REPT, ENDR - - - -

REPT
-ENDR -

-
- -

Suppose you're feeling lazy and you want to unroll a time consuming loop. REPT is here for that purpose. Everything between REPT and ENDR will be repeated a number of times just as if you done a copy/paste operation yourself
-
- - - - -
-
REPT 4
+
+
+

REPT, ENDR

+

Suppose you’re feeling lazy and you want to unroll a time consuming loop. REPT is here for that purpose. Everything between REPT and ENDR will be repeated a number of times just as if you done a copy/paste operation yourself

+
REPT 4
 add  a,c
-ENDR
-
-

This will assemble add a,c four times.
-

You can also use REPT to generate tables on the fly: - - - - -
-
; --
+ENDR
+

This will assemble add a,c four times.

+

You can also use REPT to generate tables on the fly:

+
; --
 ; -- Generate a 256 byte sine table with values between 0 and 128
 ; --
 ANGLE   SET     0.0
         REPT    256
         DB      (MUL(64.0,SIN(ANGLE))+64.0)>>16
 ANGLE   SET     ANGLE+256.0
-        ENDR
-
- -REPT is also very useful in recursive macros and as in macros you can also use the special label operator \@. REPT-blocks can be nested.
- -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+ ENDR +

REPT is also very useful in recursive macros and as in macros you can also use the special label operator \@. REPT-blocks can be nested.

+

See also:

+ +
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/rs.htm b/doc/asm/rs.htm index 8049cefb..6980a441 100644 --- a/doc/asm/rs.htm +++ b/doc/asm/rs.htm @@ -1,90 +1,76 @@ - - - - xAsm RSSET, RSRESET, RB, RW + + + + + xAsm RSSET, RSRESET, RB, RW - - - -

RSSET
-RERESET
-RB
-RW


- -

The RS group of commands is a handy way of defining structures:
-
- - - - -
-
              RSRESET
+
+
+

RSSET, RERESET, RB, RW

+

The RS group of commands is a handy way of defining structures:

+
              RSRESET
 str_pStuff    RW   1
 str_tData     RB   256
 str_bCount    RB   1
-str_SIZEOF    RB   0
-
-

The example defines four equated symbols:
-
- - - - - - - - - - - - - - - - - - - - - - - -
Defined symbols
NameValue
str_pStuff0
str_tData2
str_bCount258
str_SIZEOF259
-
-There are four commands in the RS group of commands:
-
- - - - - - - - - - - - - - - - - - - - - - - -
RS related commands
CommandMeaning
RSRESETResets the _RS counter to zero
RSSET constexprSets the _RS counter to constexpr
RB constexprSets the preceding symbol to _RS and adds constexpr to _RS
RW constexprSets the preceding symbol to _RS and adds constexpr*2 to _RS
- -

Note that a colon (:) following the symbol-name is not allowed. RS symbols can be exported and imported. They don't change their value during the link process.
- -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+str_SIZEOF RB 0 +

The example defines four equated symbols:

+ + + + + + + + + + + + + + + + + + + + + + + + +
Defined symbols
NameValue
str_pStuff0
str_tData2
str_bCount258
str_SIZEOF259
+

There are four commands in the RS group of commands:

+ + + + + + + + + + + + + + + + + + + + + + + + +
RS related commands
CommandMeaning
RSRESETResets the _RS counter to zero
RSSET constexprSets the _RS counter to constexpr
RB constexprSets the preceding symbol to _RS and adds constexpr to _RS
RW constexprSets the preceding symbol to _RS and adds constexpr*2 to _RS
+

Note that a colon (:) following the symbol-name is not allowed. RS symbols can be exported and imported. They don't change their value during the link process.

+

See also:

+ +
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/section.htm b/doc/asm/section.htm index c85561cc..912e1ce2 100644 --- a/doc/asm/section.htm +++ b/doc/asm/section.htm @@ -1,95 +1,63 @@ - - - - xAsm SECTION + + + + + xAsm SECTION - - - -

SECTION

-
- -

Before you can start writing code you must define a section. This tells the assembler what kind of data follows and if it is code where to put it.
-
- - - - -
-
SECTION   "CoolStuff",CODE
-
-

This switches to the section called "CoolStuff" (or creates it if it doesn't already exits) and it defines -it as a code section. All sections within a sourcefile must be identified by a unique name.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Section types
NameFunction
CODEA code section. The linker decides where to put this. For the Gameboy it also decides which bank to put it in except #0 (the HOME bank).
DATAReally just a synonym for CODE.
BSSThis section is for variables. For the Gameboy it will be placed where the Gameboy RAM is.
HOMEGameboy ONLY: A code section that will be placed in Gameboy bank #0.
VRAMGameboy ONLY: This section is for allocating VRAM and will be placed where the Gameboy VRAM is.
HRAMGameboy ONLY: This section is for allocating variables in the high RAM area ($FF80-$FFFE) and will be placed there. Suggested by Jens Ch. Restemeier. NOTE WELL: if you use this method of allocating HRAM the assembler will NOT choose the short addressingmode in the LD instruction because the actual address calculation is done by the linker! If you find this undesirable you can use RSSET/RB/RW instead or use the LDIO mnemonic. The address calculation is then done by the assembler.
-

Due to quite a lot of emails requesting an ORG directive you can now add an address to the sectiontype for the Gameboy:
-
- - - - -
-
SECTION   "CoolStuff",HOME[$1234]
-
-

This will force the section to address $1234. This also works with the other sectiontypes. For CODE/DATA sections the linker will then place the section in any bank at the address you specify. If you also want to specify the bank you can do:
-
- - - - -
-
SECTION   "CoolStuff",DATA[$4567],BANK[3]
-
-

And if you only want to force the section into a certain bank, and not it's position within the bank, that's also possible:
-
- - - - -
-
SECTION   "CoolStuff",CODE,BANK[7]
-
-

HINT: If you think this is a lot of typing for doing a simple ORG type thing you can quite easily write an intelligent macro (called ORG for example) that uses \@ for the sectionname and determines correct sectiontype etc as arguments for SECTION
- -

See also:

- - -

-

Last updated 18 July 1997 by Carsten Sorensen

+ + +

SECTION

+

Before you can start writing code you must define a section. This tells the assembler what kind of data follows and if it is code where to put it.

+
SECTION   "CoolStuff",CODE
+

This switches to the section called "CoolStuff" (or creates it if it doesn't already exits) and it defines it as a code section. All sections within a sourcefile must be identified by a unique name.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Section types
NameFunction
CODEA code section. The linker decides where to put this. For the Gameboy it also decides which bank to put it in except #0 (the HOME bank).
DATAReally just a synonym for CODE.
BSSThis section is for variables. For the Gameboy it will be placed where the Gameboy RAM is.
HOMEGameboy ONLY: A code section that will be placed in Gameboy bank #0.
VRAMGameboy ONLY: This section is for allocating VRAM and will be placed where the Gameboy VRAM is.
HRAMGameboy ONLY: This section is for allocating variables in the high RAM area ($FF80-$FFFE) and will be placed there. Suggested by Jens Ch. Restemeier. NOTE WELL: if you use this method of allocating HRAM the assembler will NOT choose the short addressingmode in the LD instruction because the actual address calculation is done by the linker! If you find this undesirable you can use RSSET/RB/RW instead or use the LDIO mnemonic. The address calculation is then done by the assembler.
+

Due to quite a lot of emails requesting an ORG directive you can now add an address to the sectiontype for the Gameboy:

+
SECTION   "CoolStuff",HOME[$1234]
+

This will force the section to address $1234. This also works with the other sectiontypes. For CODE/DATA sections the linker will then place the section in any bank at the address you specify. If you also want to specify the bank you can do:

+
SECTION   "CoolStuff",DATA[$4567],BANK[3]
+

And if you only want to force the section into a certain bank, and not it's position within the bank, that's also possible:

+
SECTION   "CoolStuff",CODE,BANK[7]
+

HINT: If you think this is a lot of typing for doing a simple ORG type thing you can quite easily write an intelligent macro (called ORG for example) that uses \@ for the sectionname and determines correct sectiontype etc as arguments for SECTION

+

See also:

+ +
+

Last updated 18 July 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/set.htm b/doc/asm/set.htm index 18342be9..a78489c4 100644 --- a/doc/asm/set.htm +++ b/doc/asm/set.htm @@ -1,31 +1,22 @@ - - - - xAsm SET + + + + + xAsm SET - - - -

SET


- -

SETs are like EQUates also constant symbols in the sense that their values are defined during the assembly process. These symbols are normally used in macros.
-
- - - - -
-
KINKYCOUNT     SET  2
-KINKYCOUNT     SET  DONUT_ISGOOD+KINKYCOUNT
-
-

Note that a colon (:) following the label-name is not allowed. SETs can be exported and imported but the result is undefined and might change in a later release. Alternatively you can use = as a synonym for SET.
- -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+ + +

SET

+

SETs are like EQUates also constant symbols in the sense that their values are defined during the assembly process. These symbols are normally used in macros.

+
KINKYCOUNT     SET  2
+KINKYCOUNT     SET  DONUT_ISGOOD+KINKYCOUNT
+

Note that a colon (:) following the label-name is not allowed. SETs can be exported and imported but the result is undefined and might change in a later release. Alternatively you can use = as a synonym for SET.

+

See also:

+ +
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/shift.htm b/doc/asm/shift.htm index 910fca90..be81b943 100644 --- a/doc/asm/shift.htm +++ b/doc/asm/shift.htm @@ -1,21 +1,19 @@ - - - - xAsm SHIFT + + + + + xAsm SHIFT - - - -

SHIFT


- -

SHIFT is a special command only available in macros. Very useful in REPT-blocks. It will "shift" the arguments by one "to the left". \1 will get \2's value, \2 will get \3's value and so forth.
- -

See also:

- - -

-

Last updated 21 June 1997 by Carsten Sorensen

+ + +

SHIFT

+

SHIFT is a special command only available in macros. Very useful in REPT-blocks. It will "shift" the arguments by one "to the left". \1 will get \2's value, \2 will get \3's value and so forth.

+

See also:

+ +
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/symbols.htm b/doc/asm/symbols.htm index 9a6cc462..1af4fde0 100644 --- a/doc/asm/symbols.htm +++ b/doc/asm/symbols.htm @@ -1,33 +1,31 @@ - - - - xAsm Symbols + + + + + xAsm Symbols - + + +

xAsm Symbols

+

xAsm supports several types of symbols:

+
    +
  • Label. Used to assign a memory location with a name +
  • EQUate. Give a constant a name. +
  • SET. Same as EQUate but with a subtle difference. You can change the value of a SET during assembling. +
  • Structures (the RS group). Define a structure easily. +
  • String equate (EQUS). Give an often used string a name. Can also be used as a mini-macro. Much like #define in C. +
  • MACROs. A block of code or pseudo instructions that you invoke like any other mnemonic. You can give them arguments too! Life is good. +
- -

xAsm Symbols


+

A symbol cannot have the same name as a reserved keyword.

-xAsm supports several types of symbols:
-
-
    -
  • Label. Used to assign a memory location with a name -
  • EQUate. Give a constant a name. -
  • SET. Same as EQUate but with a subtle difference. You can change the value of a SET during assembling. -
  • Structures (the RS group). Define a structure easily. -
  • String equate (EQUS). Give an often used string a name. Can also be used as a mini-macro. Much like #define in C. -
  • MACROs. A block of code or pseudo instructions that you invoke like any other mnemonic. You can give them arguments too! Life is good. -
- -A symbol cannot have the same name as a reserved keyword. - -

See also:

- - -

-

Last updated 02 July 1997 by Carsten Sorensen

+

See also:

+ +
+

Last updated 02 July 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/syntax.htm b/doc/asm/syntax.htm index f923db50..c308ddc1 100644 --- a/doc/asm/syntax.htm +++ b/doc/asm/syntax.htm @@ -1,47 +1,23 @@ - - - - xAsm Syntax + + + + + xAsm Syntax - + - -

xAsm Syntax


- -The syntax line-based, just as in any other assembler. Meaning that you do one instruction or pseudo-op per line:
-
- - - - -
-
[label] [instruction] [;comment]
-
-
-Example:
-
- - - - -
-
John:          ld   a,87 ;Weee
-
-

A comment can also be an asterisk (*) followed by the comment if the asterisk is the first character on the line: -
-
- - - - -
-
********************************
+
+

xAsm Syntax

+

The syntax line‐based, just as in any other assembler. Meaning that you do one instruction or pseudo‐op per line:

+
[label] [instruction] [;comment]
+

Example:

+
John:          ld   a,87 ;Weee
+

A comment can also be an asterisk (*) followed by the comment if the asterisk is the first character on the line:

+
********************************
 * These are full line comments *
-********************************
-
- -

All pseudo-ops, mnemonics and registers (reserved keywords) are case-insensitive and all labels are case-sensitive.
- -


-

Last updated 21 June 1997 by Carsten Sorensen

+******************************** +

All pseudo‐ops, mnemonics and registers (reserved keywords) are case‐insensitive and all labels are case‐sensitive.

+
+

Last updated 21 June 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/trg_gb.htm b/doc/asm/trg_gb.htm index a34ee9a0..fae41ca3 100644 --- a/doc/asm/trg_gb.htm +++ b/doc/asm/trg_gb.htm @@ -1,102 +1,102 @@ - - - - xAsm Gameboy + + + + + xAsm Gameboy - - - -

Gameboy -

-
- -

The full GB-Z80 instruction-set is implemented with a few modifications to the original Zilog syntax. This is due -to a Bison problem but in my opinion the syntax is better than the original one.
-


-Instructions

-
    ADC
-    ADD
-    AND
-    BIT
-    CALL
-    CCF
-    CP
-    CPL
-    DAA
-    DEC
-    DI
-    EI
-    EX
-    HALT
-    INC
-    JP
-    JR
-    LD
-    LDD
-    LDI
-    LDH/LDIO    (see note below)
-    NOP
-    OR
-    POP
-    PUSH
-    RES
-    RET
-    RETI
-    RL
-    RLA
-    RLC
-    RLCA
-    RR
-    RRA
-    RRC
-    RRCA
-    RST
-    SBC
-    SCF
-    SET
-    SLA
-    SRA
-    SRL
-    STOP
-    SUB
-    SWAP
-    XOR
-

Note that you can use both -

    OR   A,B
-    OR   B
-


Addressingmodes

-

Indirect addressing has been changed to [ ] instead of ( ):
-

    A
-    B
-    C
-    D
-    E
-    H
-    L
-    AF
-    BC
-    DE
-    HL
-    SP
-    [BC]
-    [DE]
-    [HL]
-    [HL-]/[HLI]
-    [HL+]/[HLD]
-    [SP]
-    n8       (8 bit expression)
-    n16      (16 bit expression)
-    n3       (3 bit CONSTANT expression)
-    [n16]/[$FF00+n8]
-    [$FF00+C]/[C]
-

The assembler will intelligently decide between [n16] and [$FF00+n8] in the LD instruction. Note however that if you use any constant symbols in the expression they had better be defined before the instruction or your symbol-table may become mangled. Also worth noting is that it will only ever select the short $FF00 mode when you use constant symbols. NOT if you use symbols defined in a HRAM section. As this defies the whole point of implementing the HRAM sectiontype I've added the LDIO mnemonic. It works like the LD instruction but it will ALWAYS generate the $FF00+ form and it will also automatically logically AND the expression with $FF if it is relocatable. Which is what you want. Trust me ;)
-
-

Conditioncodes

-
    C
-    NC
-    Z
-    NZ
- -

-

Last updated 20 July 1997 by Carsten Sorensen

+ + +

Gameboy

+

The full GB-Z80 instruction-set is implemented with a few modifications to the original Zilog syntax. This is due to a Bison problem but in my opinion the syntax is better than the original one.

+

Instructions

+
    +
  • ADC +
  • ADD +
  • AND +
  • BIT +
  • CALL +
  • CCF +
  • CP +
  • CPL +
  • DAA +
  • DEC +
  • DI +
  • EI +
  • EX +
  • HALT +
  • INC +
  • JP +
  • JR +
  • LD +
  • LDD +
  • LDI +
  • LDH/LDIO (see note below) +
  • NOP +
  • OR +
  • POP +
  • PUSH +
  • RES +
  • RET +
  • RETI +
  • RL +
  • RLA +
  • RLC +
  • RLCA +
  • RR +
  • RRA +
  • RRC +
  • RRCA +
  • RST +
  • SBC +
  • SCF +
  • SET +
  • SLA +
  • SRA +
  • SRL +
  • STOP +
  • SUB +
  • SWAP +
  • XOR +
+

Note that you can use both +

    OR   A,B
+    OR   B
+

Addressingmodes

+

Indirect addressing has been changed to [ ] instead of ( ):

+
    +
  • A +
  • B +
  • C +
  • D +
  • E +
  • H +
  • L +
  • AF +
  • BC +
  • DE +
  • HL +
  • SP +
  • [BC] +
  • [DE] +
  • [HL] +
  • [HL-]/[HLI] +
  • [HL+]/[HLD] +
  • [SP] +
  • n8 (8 bit expression) +
  • n16 (16 bit expression) +
  • n3 (3 bit CONSTANT expression) +
  • [n16]/[$FF00+n8] +
  • [$FF00+C]/[C] +
+

The assembler will intelligently decide between [n16] and [$FF00+n8] in the LD instruction. Note however that if you use any constant symbols in the expression they had better be defined before the instruction or your symbol-table may become mangled. Also worth noting is that it will only ever select the short $FF00 mode when you use constant symbols. NOT if you use symbols defined in a HRAM section. As this defies the whole point of implementing the HRAM sectiontype I've added the LDIO mnemonic. It works like the LD instruction but it will ALWAYS generate the $FF00+ form and it will also automatically logically AND the expression with $FF if it is relocatable. Which is what you want. Trust me ;)

+

Conditioncodes

+
    +
  • C +
  • NC +
  • Z +
  • NZ +
+
+

Last updated 20 July 1997 by Carsten Sorensen

+ + diff --git a/doc/asm/usage.htm b/doc/asm/usage.htm index 7cd0b1e3..f48ac865 100644 --- a/doc/asm/usage.htm +++ b/doc/asm/usage.htm @@ -1,38 +1,30 @@ - - - - xAsm Usage + + + + + xAsm Usage - - - -

xAsm Usage


- - - - - -
-
C:\>xAsm [options] asmfile
-
-Options are preceded by a dash (-) and go as follows:
-
-
    oobjectfile : Write an object-file for xLink
-    ipath       : Add an extra include-path
+
+
+

xAsm Usage

+
C:\>xAsm [options] asmfile
+

Options are preceded by a hyphen (-) and go as follows:

+
    oobjectfile : Write an object-file for xLink
+    ipath       : Add an extra include-path
     h           : Short help text
-    e(l|b)      : Change endianness (CAUTION!)
-    gASCI       : Change the four characters used for Gameboy graphics
-                  constants (default is 0123)
-    bAS         : Change the two characters used for binary constants
-                  (default is 01)
-    zHX         : Set the byte value (hex format) used for uninitialised data (default is ? for random)
-
+ e(l|b) : Change endianness (CAUTION!) + gASCI : Change the four characters used for Gameboy graphics + constants (default is 0123) + bAS : Change the two characters used for binary constants + (default is 01) + zHX : Set the byte value (hex format) used for uninitialised data (default is ? for random) +
-

See also:

- - -

-

Last updated 08 October 1997 by Carsten Sorensen

+

See also:

+ +
+

Last updated 08 October 1997 by Carsten Sorensen

+ +