Skip to content

Commit c39c2c6

Browse files
committed
Release v2.0
1 parent 1a7c129 commit c39c2c6

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PROJECTNAME=ez80asm
22
ARCHITECTURE=linux_elf_x86_64
3-
BUILD_WINDOWS=false
3+
BUILD_WINDOWS=true
44
# Tools and arguments
55
MSBUILD='/mnt/c/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe'
66
MSBUILDFLAGS=/property:Configuration=Release

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ These versions require at least MOS 1.03.
2222
-d Direct listing to console
2323
-c No color codes in output (version 1.3+)
2424
-x Display assembly statistics (version 1.1+)
25+
-m Minimum memory configuration (version 2.0+)
2526

2627
The given filename will be assembled into these files:
2728
- filename.bin -- output executable file
@@ -30,7 +31,7 @@ The given filename will be assembled into these files:
3031

3132
## Defaults
3233

33-
The compiler defaults to ADL=1 mode. This can be overridden using the .ASSUME directive.
34+
The assembler defaults to ADL=1 mode, CPU type EZ80. This can be overridden using the .ASSUME / .CPU directives.
3435

3536
The default address is 0x40000.
3637

@@ -41,9 +42,12 @@ Lines in the source file should have the following format:
4142

4243
All fields are optional.
4344

44-
- Labels are defined as first token on a line, terminated by a colon (':')
45-
- Instructions are either ez80 opcodes, or assembler directives. Opcodes without a label should start with whitespace. Assembler directives can start with a dot (.)
46-
- Comments start with a semi-colon (;). A line with just a comment can start without whitespace
45+
- Labels are defined as first token on a line, terminated without whitespace by a colon (':')
46+
- Instructions are either z80/z180/ez80 opcodes, or assembler directives
47+
- Starting v2.0, labels and instructions can be preceded by whitespace
48+
- Assembler directives can optionally start with a dot (.)
49+
- Comments start with a semi-colon (;)
50+
4751

4852
Examples
4953

@@ -320,8 +324,9 @@ db 5 ; invalid use of 'DB' directive, shows as 'invalid label'
320324
| Directive | Description | Usage |
321325
|------------------------|------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
322326
| ALIGN | Select alignment for the program counter, pad bytes up to new boundary alignment | ALIGN \<boundary\> The boundary, expressed in bytes, must be a power of two (1,2,4,8 etc) Example: ALIGN 256 ; align next instruction at boundary of 256 |
323-
| ASSUME ADL | Sets default ADL status (0 or 1) | Example: ASSUME ADL=1 ; set ADL mode to 1 |
324-
| BLKB/BLKW/ BLKP/BLKL | Allocate a block with a number of Bytes/ 16-bit words/24-bit Pointers/32-bit words | BLKx \<number\> [, value] Example: BLKB 16 ; allocate 16 uninitialized bytes Example: BLKB 16, 0xFF ; allocate 16 bytes and initialize them to 0xFF |
327+
| ASSUME ADL | Sets default ADL status (0 or 1) | Example: ASSUME ADL=1 ; set ADL mode to 1 |
328+
| CPU (v2.0+) | Limit instruction/opcode output to the specified CPU only | Instructs the assembler that instructions placed after this directive need to be supported for the specified CPU only, or the assembler will need to throw an error. The assembler startup default is type EZ80. Supported CPU types are Z80 / Z180 / EZ80. |
329+
BLKB/BLKW/ BLKP/BLKL | Allocate a block with a number of Bytes/ 16-bit words/24-bit Pointers/32-bit words | BLKx \<number\> [, value] Example: BLKB 16 ; allocate 16 uninitialized bytes Example: BLKB 16, 0xFF ; allocate 16 bytes and initialize them to 0xFF |
325330
| DB / DEFB ASCII / BYTE | Define byte(s) | DB \| DEFB \| ASCII \| BYTE \<value \| string\> [, ...] Reserve and initialize a byte, or a list of bytes. Within a string, these escape characters are supported and converted to their respective ascii code: \ \r \t \b \\\ \\' \\" Strings are not automatically terminated by a null byte. You can use either an additional ',0' value, or use the ASCIZ directive |
326331
| ASCIZ | Same as above, but terminated with a 0 Used for zero-terminated strings mostly | ASCIZ \<value \| string\> [, ...] |
327332
| DW / DEFW | Define 16-bit word(s) | DW \| DEFW \<value\> [, ...] Reserve and initialize a word/long value, or a list of values |
@@ -334,7 +339,7 @@ db 5 ; invalid use of 'DB' directive, shows as 'invalid label'
334339
| INCLUDE | Include file in source code | Allows the insertion of source code from another file into the current source file during assembly. The included file is assembled into the current source file immediately after the directive. When the EOF (End of File) of the included file is reached, the assembly resumes on the line after the INCLUDE directive Example: INCLUDE "example.inc" |
335340
| MACRO / ENDMACRO | Define a macro, see below for detailed explanation | MACRO [arg1, arg2 ...] [macro body] ENDMACRO |
336341
| ORG | Define location counter origin. | Sets the assembler location counter to a specified value. The directive must be followed by an integer constant, which is the value of the new origin. Example: ORG $40000. Starting release 1.9, when the location counter is advanced, the intervening bytes are filled with the defined fillbyte.ORG may only increase the location counter, or leave it unchanged; you cannot use ORG to move the location counter backwards. |
337-
342+
| RELOCATE / ENDRELOCATE (v2.0+) | Defines a block of code as relocatable | RELOCATE \<address> [instruction lines] \<ENDRELOCATE> The specified block of code is output at the current <em>address</em>, whilst all labels in the block are calculated with an applied offset. This allows the block of code to be copied elsewhere to the specified address, due to it's (internal) use of offset labels. The $ symbol is also translated in the specified block. |
338343
## Macros
339344
The 'macro' directive defines a macro, optionally followed by a maximum of 8 arguments. The following lines will be stored as the macro-body, until the 'endmacro' directive is encountered. A macro has to be defined before use.
340345

@@ -351,10 +356,10 @@ Example macro definition without arguments:
351356
endmacro ; end of macro definition
352357

353358
Important notes:
354-
- Starting v1.12 only **local** labels are allowed in macro definitions; global labels were never allowed, while defining anonymous labels in a macro could result in issues using earlier versions. Starting v1.12 local labels defined inside a macro will get an internal macro expansion 'scope', so the macro can be expanded multiple times without label collisions. This 'scope' will not be visible in the listing. Because of their locality, labels defined inside a macro cannot be referenced to outside of the macro
355-
- Starting v1.12, macros can be called from within a macro, with a maximum 'nesting' level of 8 to block expansion recursion.
359+
- Starting v2.0 only **local** labels are allowed in macro definitions; global labels were never allowed, while defining anonymous labels in a macro could result in issues using earlier versions. Starting v2.0, local labels defined inside a macro will get an internal macro expansion 'scope', so the macro can be expanded multiple times without label collisions. This 'scope' will not be visible in the listing. Because of their locality, labels defined inside a macro cannot be referenced to outside of the macro
360+
- Starting v2.0, macros can be called from within a macro, with a maximum 'nesting' level of 8 to block expansion recursion.
356361
- Macro definitions are not allowed inside a macro definition
357-
- Don't use instruction names (e.g. 'ld' or 'and'), nor other macro names as argument names. Starting v1.12 the assembler will throw an error.
362+
- Don't use instruction names (e.g. 'ld' or 'and'), nor other macro names as argument names. Starting v2.0 the assembler will throw an error.
358363
- While accepted by the assembler; avoid defining macros with the same name as a label. This can lead to confusion between calling a label and invoking a macro in your code.
359364

360365
Example macro with arguments:

src/config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#pragma warning(disable:4244) // conversion from '__int64' to 'uint16_t', possible loss of data
1010
#endif
1111

12-
#define VERSION 1
13-
#define REVISION 11
12+
#define VERSION 2
13+
#define REVISION 0
1414
#define ADLMODE_START true
1515
#define START_ADDRESS 0x40000 // Agon default load address
1616
#define FILLBYTE 0xFF // Same as ZDS

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ char outputfilename[FILENAMEMAXLENGTH + 1];
2222
bool noaction;
2323

2424
void printVersion(void) {
25-
printf("ez80asm version %d.%d, (C)2024 - Jeroen Venema\n",VERSION,REVISION);
25+
printf("ez80asm version %d.%d, (C)2025 - Jeroen Venema\n",VERSION,REVISION);
2626
}
2727

2828
void printHelp(void) {

0 commit comments

Comments
 (0)