diff --git a/CHANGELOG.md b/CHANGELOG.md index ad4328d7..8dae3017 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## [1.18.1](https://github.com/z00m128/sjasmplus/releases/tag/v1.18.1) - 23.1.2021 +- Big-Endian hosts support (experimental and not tested continuously) +- added "listall", "listact" commands to [OPT](http://z00m128.github.io/sjasmplus/documentation.html#po_opt) - to switch between listing types +- [`WHILE`](http://z00m128.github.io/sjasmplus/documentation.html#po_while) has optional argument to set explicit guardian-counter +- [`ASSERT`](http://z00m128.github.io/sjasmplus/documentation.html#po_assert) has optional argument (to add description/notes for expression) +- [`SLOT`](http://z00m128.github.io/sjasmplus/documentation.html#po_slot) and [`MMU`](http://z00m128.github.io/sjasmplus/documentation.html#po_mmu) will now accept also starting address of slot instead of its number +- fix: option `--sym` was not exporting labels starting with underscore +- fix: `SAVENEX` BMP-loader bug when certain builds of sjasmplus were unable to open BMP files +- fix: after `STRUCT` instance the "main" label is not polluted by last field of STRUCT +- minor bugfixes in parser, windows cmake-builds have now icon +- docs: adding "Index" section +- docs: adding some missing information (`__DATE__`, `__TIME__`), fixing HTML anchor names + ## [1.18.0](https://github.com/z00m128/sjasmplus/releases/tag/v1.18.0) - 12.12.2020 - [may break old sources] the colon between end of EQU/DEFL/= expression and instruction is mandatory - [may break old sources] new [abs operator](http://z00m128.github.io/sjasmplus/documentation.html#s_expressions) for absolute integer value diff --git a/docs/documentation.html b/docs/documentation.html index f1dbe74e..c7088da5 100644 --- a/docs/documentation.html +++ b/docs/documentation.html @@ -1,4 +1,4 @@ -SjASMPlus 1.18.0 Documentation [2020-12-12]

SjASMPlus 1.18.0 Documentation [2020-12-12]


1. Introduction
License
What is it?
Main Features
Credits
Feedback
What's new?
2. Where to get and how to use
Packages
Command line
Warnings with id
Source file format
3. Labels
Labels
Local labels
@ Labels
Temporary labels
4. Constants, expressions and other features
Numeric constants
Character and string constants
Expressions
Assembly language
Fake instructions
Real device emulation mode
Predefined defines
5. Pseudo-ops (aka Pseudo-instructions, Directives etc)
Simple example of usage
Pseudo-ops
Conditional assembly
Macros
6. Structures
What is it?
Defining structure
STRUCT instructions
Usage of defined structure
Examples
7. Lua scripting
Why?
How to use?
SjASMPlus functions bindings to Lua
Third-party embedded library(ies)
Example
8. SAVENEX guide
NEX File Format
Detailed description of each SAVENEX command
Examples
9. Source Level Debugging (SLD) data
What is it?
Usage
How to write "non tricky" source
SLD File Format definition (version "1")
Index
+SjASMPlus 1.18.1 Documentation [2021-01-23]

SjASMPlus 1.18.1 Documentation [2021-01-23]


Chapter 1. Introduction

@@ -131,11 +131,12 @@

What's new?

-
WIP - 1.18.1
+
23.1.2021 - 1.18.1
- Big-Endian hosts support (experimental and not tested continuously)
 - added "listall", "listact" commands to OPT - to switch between listing types
 - `WHILE` has optional argument to set explicit guardian-counter
 - `ASSERT` has optional argument (to add description/notes for expression)
+- `SLOT` and `MMU` will now accept also starting address of slot instead of its number
 - fix: option --sym was not exporting labels starting with underscore
 - fix: SAVENEX BMP-loader bug when certain builds of sjasmplus were unable to open BMP files
 - fix: after STRUCT instance the "main" label is not polluted by last field of STRUCT
@@ -416,7 +417,7 @@
 		  Comment blocks start with '/*' and end with '*/' (work in "nested" way,
 		  i.e. comment block started inside comment block must be also ended, before main block ends).
 
-			

Example 2.1. 

+

Example 2.1. 

; comment
@@ -482,7 +483,7 @@
       

(since v1.18.0) If you start the label with an ! (exclamation mark), it will not affect following local labels (same syntax as sjasm).

-

Example 3.1. docs_examples/s_local_labels.asm

+

Example 3.1. docs_examples/s_local_labels.asm

    MODULE main             ; module "main"
@@ -513,7 +514,7 @@
       
 
       

Labels starting with a '@' are not touched by the label processing - and used 'as-is'. See 'SetScreen' in the previous example code.

Example 3.2. docs_examples/s_at_labels.asm

+ and used 'as-is'. See 'SetScreen' in the previous example code.

Example 3.2. docs_examples/s_at_labels.asm

    MODULE xxx
@@ -538,7 +539,7 @@
       in the same order during every pass of assembling, but they can be used
       within macro, or repeating blocks (old sjasmplus versions didn't allow usage within macro).

-

Example 3.3. docs_examples/s_temp_labels.asm

+

Example 3.3. docs_examples/s_temp_labels.asm

        ADD A,E
@@ -611,7 +612,7 @@
 \R 13
 \T 9
 \V 11

Inside single quotes two quotes after each other are - parsed as the apostrophe itself (since v1.11).

Example 4.1. 

+ parsed as the apostrophe itself (since v1.11).

Example 4.1. 

    BYTE "stringconstant\n" ; escape sequence assembles to newline
@@ -1003,7 +1004,7 @@
 
       

If only single DEVICE is used in whole source batch, the device becomes "global" and will affect also source ahead of the DEVICE line. -

Example 4.2. docs_examples/s_realdevice.asm

+

Example 4.2. docs_examples/s_realdevice.asm

    DEVICE ZXSPECTRUM128
@@ -1095,7 +1096,7 @@
 				  mid-word substitution, will make more sense with new substitution rules (if ever
 				  the sjasmplus v2.x happens, would be too big change for v1.x). Right now call
 				  LUA for the rescue.

-

Example 4.3. __COUNTER__ usage in LUA script

+

Example 4.3. __COUNTER__ usage in LUA script

    DB __COUNTER__   ; DB 0
@@ -1119,7 +1120,7 @@
 				

The predefined values were renamed and extended to be more like gcc/clang pre-defines, the following ones are deprecated originals.

_SJASMPLUS = 1
-

Deprecated, consider using similar __SJASMPLUS__

Example 4.4. 

+

Deprecated, consider using similar __SJASMPLUS__

Example 4.4. 

   IFDEF _SJASMPLUS
@@ -1129,7 +1130,7 @@
    ENDIF


_VERSION = "version"
-

Deprecated, renamed to __VERSION__

Example 4.5. 

+

Deprecated, renamed to __VERSION__

Example 4.5. 

   IF _VERSION = "1.07"
@@ -1139,7 +1140,7 @@
    ENDIF


_RELEASE = releasenumber
-

Deprecated, consider using similar __SJASMPLUS__

Example 4.6. 

+

Deprecated, consider using similar __SJASMPLUS__

Example 4.6. 

   IF _RELEASE = 1 ; 0 - is stable version
@@ -1177,7 +1178,7 @@
       
.<repeat-count> <single instruction>

Repeat <single instruction> <repeat-count> many times. Doesn't work in the beginning of line. The <repeat-count> must be either simple integer - number or expression fully enclosed in parentheses.

Example 5.1. docs_examples/po_dot_repeat.asm

+ number or expression fully enclosed in parentheses.

Example 5.1. docs_examples/po_dot_repeat.asm

 .3        INC A    ;will be compiled to INC A:INC A:INC A
@@ -1187,7 +1188,7 @@
                 


ABYTE <offset> <bytes>

Defines a byte or a string of bytes. The offset is added - to each of the following bytes.

Example 5.2. 

+ to each of the following bytes.

Example 5.2. 

    ABYTE 2 4,9    ; Same as BYTE 6,11
@@ -1196,7 +1197,7 @@
             
ABYTEC <offset> <bytes>

Defines a byte or a string of bytes, where the last byte of the string will have bit 7 set. The offset is added to each - of the following bytes.

Example 5.3. 

+ of the following bytes.

Example 5.3. 

    ABYTEC 0 "KIP"        ; Same as BYTE "KI",'P'|128
@@ -1204,7 +1205,7 @@
                 


ABYTEZ <offset> <bytes>

Defines a byte or a string of bytes, followed by a zero. - The offset is added to each of the following bytes.

Example 5.4. 

+ The offset is added to each of the following bytes.

Example 5.4. 

    ABYTEZ 0 "KIP"        ; Same as BYTE "KIP",0
@@ -1215,7 +1216,7 @@

Align advances to nearest address where <new address> modulo <expression> (default 4) equals zero (stays at current address if possible).

If <byte> is specified, memory advanced over is set to it. -

Example 5.5. 

+

Example 5.5. 

    ALIGN         ; => ALIGN 4 - simply align by 4
@@ -1225,7 +1226,7 @@
             
ASSERT <expression>[, <anything>]

An 'assertion failed' error is issued if the expression evaluates to zero. The "anything" (optional argument since v1.18.1) is then also visible in the error - message, so you can add description/notes about expression there.

Example 5.6. 

+ message, so you can add description/notes about expression there.

Example 5.6. 

STACKPOINTER=0D500H
@@ -1238,7 +1239,7 @@
             byte>]

Defines space. Has to be followed by the number of byte to reserve, optionally followed by the value to fill these bytes - with.

Example 5.7. 

+ with.

Example 5.7. 

    BLOCK 500     ; define a block of 500 bytes of zero
@@ -1260,7 +1261,7 @@
 					loaded snapshot/NEX/... file, or it will even disable breakpoints when changing
 					machine parameters and ignore the --enable-breakpoints option - will
 					be hopefully improved in the future)
-				  

Example 5.8. 

+

Example 5.8. 

    BPLIST "bpx.ini" unreal  ; open breakpoints list in "Unreal" format
@@ -1270,7 +1271,7 @@
 				

BYTE <bytes>

Defines a byte or a string of bytes. Each value should be - between -129 and 256.

Example 5.9. 

+ between -129 and 256.

Example 5.9. 

    BYTE 0x56
@@ -1293,7 +1294,7 @@
               

If no filename is provided, default is created by appending ".map" to source name.

D24

Defines three bytes by 24b constant. Values should be between - -16777217 and 16777216.

Example 5.10. 

+ -16777217 and 16777216.

Example 5.10. 

    D24 0x123456   ; define three bytes 0x56, 0x34, 0x12
@@ -1302,7 +1303,7 @@

Synonym of BYTE.

DC

Same as BYTE, but every - last character of a string will have bit 7 set.

Example 5.11. 

+ last character of a string will have bit 7 set.

Example 5.11. 

    DC "kip" ; same as BYTE "ki",'p'|128
@@ -1310,7 +1311,7 @@
DD

Synonym of DWORD.

DEFARRAY <id> <replacements>
-

Array of DEFINEs. Use id[#] to retrieve current size of array.

Example 5.12. docs_examples/po_defarray.asm

+

Array of DEFINEs. Use id[#] to retrieve current size of array.

Example 5.12. docs_examples/po_defarray.asm

    DEFARRAY myarray 10*20,"A",20,</D,40>,50,70
@@ -1321,7 +1322,7 @@
     EDUP


DEFARRAY+ <id> <additional replacements>
-

Appending more DEFINEs to already defined array

Example 5.13. 

+

Appending more DEFINEs to already defined array

Example 5.13. 

    DEFARRAY   myarray 'A', 'B', 'C'
@@ -1345,7 +1346,7 @@
               The DEFINE+ (since v1.18.0) will also redefine the identifier <id>
               if it already exists. The replacement could be omitted,
               in such case it is still possible to check if the identifier was defined
-              with IFDEF or IFNDEF.

Example 5.14. 

+ with IFDEF or IFNDEF.

Example 5.14. 

    DEFINE str_honderd "Honderd"
@@ -1359,7 +1360,7 @@
               

Assigns value of <expression> to symbol <label>. New label defined by DEFL is marked internally as "modifiable", allowing to re-assign new values to it with further DEFL statements (you can use also = instead of DEFL). -

Example 5.15. 

+

Example 5.15. 

counter DEFL 0
@@ -1412,14 +1413,14 @@
               is converted to a byte value.

A hyphen '-' (also '.' and '_') represents 0 and any other non-whitespace character - represents 1. It ignores spaces, use them for formatting if you like. Warning, "DG 10100001" is value 255, because character '0' is not a dash '-'. (since v1.11)

Example 5.16. 

+ represents 1. It ignores spaces, use them for formatting if you like. Warning, "DG 10100001" is value 255, because character '0' is not a dash '-'. (since v1.11)

Example 5.16. 

    DG 1-1----1  ; store 161 at the current location
     DG ...# #... .##. .... ; store two bytes: 0x18, 0x60


DH "<data>"[,"<data2>"...]

The data string comprises pairs of hexadecimal digits, each pair is converted to - a byte value. You can add spaces between pairs as you like. (since v1.11)

Example 5.17. 

+ a byte value. You can add spaces between pairs as you like. (since v1.11)

Example 5.17. 

    DH "0123456789ABCDEF"   ; eight bytes #01 #23 ...
     DH "01 23  45 67"       ; four bytes #01 #23 #45 #67
@@ -1434,7 +1435,7 @@ instructions and regular labels, but to avoid warning, you must also map-in the target page into the target memory slot (MMU). When no fixed page in DISP is specified, the current mapping of memory pages is used. -

Example 5.18. docs_examples/po_disp.asm

+

Example 5.18. docs_examples/po_disp.asm

    DEVICE ZXSPECTRUM48
@@ -1468,7 +1469,7 @@
 /C - out as character in apostrophes (truncated to 8 bit)
 /H - out only in Hexadecimal
 /A - out both in Hexadecimal and Decimal

-

Example 5.19. docs_examples/po_display.asm

+

Example 5.19. docs_examples/po_display.asm

    ORG 100h
@@ -1489,7 +1490,7 @@
               

Synonym of BLOCK.

DUP <count>

DUP specifies the number of times to generate the - following lines until an EDUP pseudo-op is encountered. DUP can be used in macro's.

Example 5.20. 

+ following lines until an EDUP pseudo-op is encountered. DUP can be used in macro's.

Example 5.20. 

    DUP 3
@@ -1506,7 +1507,7 @@
               

Synonym of WORD.

DWORD

Defines a so called doubleword. Values should be between - -2147483649 and 4294967296.

Example 5.21. 

+ -2147483649 and 4294967296.

Example 5.21. 

    DWORD 4000h,0d000h
@@ -1514,7 +1515,7 @@
                 


DZ

Same as BYTE, but an extra - zero will be added at the end.

Example 5.22. 

+ zero will be added at the end.

Example 5.22. 

    DZ 1      ; same as BYTE 1,0
@@ -1539,7 +1540,7 @@
               

Set the current encoding, i.e. if you set "DOS", SjASMPlus will automatically convert strings from ANSI to DOS-866. Encoding may be "DOS"(DOS-866) or "WIN"(ANSI/Win-1251). Default - is "WIN".

Example 5.23. 

+ is "WIN".

Example 5.23. 

    ENCODING "WIN"
@@ -1567,7 +1568,7 @@
               counter. The label should not already exist (you can assign only one value to it).
 			  The optional pageNumber can enforce explicit page value for the label
 			  (for the $$label operator).
-			  For modifiable labels holding temporary values use DEFL.

Example 5.24. 

+ For modifiable labels holding temporary values use DEFL.

Example 5.24. 

Label EQU 3
@@ -1577,7 +1578,7 @@
               

The named label will be written to the export-file, in the form 'label: EQU value'. This way the export-file can be included in other sources. Order of labels in file follows the order of EXPORT statements. -

Example 5.25. 

+

Example 5.25. 

DRIE=3
@@ -1592,7 +1593,7 @@
               

In combination with OUTPUT <filename>,r it is possible to update existing files.

-

Example 5.26. 

+

Example 5.26. 

; This example will result in a file with a length of one byte:
@@ -1607,7 +1608,7 @@
             <filename>[,<offset>[,<length>]]

To include a binary file into the outputfile. The offset and length are optional. Added in v1.12.1: if negative offset or length is provided, - it counts relatively from the end of the file.

Example 5.27. 

+ it counts relatively from the end of the file.

Example 5.27. 

    INCBIN "gfx.scc",7        ; include gfx.scc, skip first 7 bytes
@@ -1617,7 +1618,7 @@
                 


INCHOB <filename>[,<offset>[,<length>]]

To include a data from a hobeta file into the outputfile. - The offset and length are optional.

Example 5.28. 

+ The offset and length are optional.

Example 5.28. 

    INCHOB "gfx.$c",7        ; include gfx.scc, skip first 7 bytes
@@ -1638,7 +1639,7 @@
               with completely empty include-path list, use "--inc" option
               early (order matters) without the "=" to empty the current list, like:
               sjasmplus --inc --inc=path1 --inc=path2 file.asm
-              

Example 5.29. 

+

Example 5.29. 

    INCLUDE <VDP.I>     ; search for file "VDP.I" in the include directories, then in current
@@ -1651,7 +1652,7 @@
               directory is the directory the current file comes from) the file
               will be searched for in the directories specified at the
               commandline. When angle brackets are used, the commandline
-              directories are searched before the current directory.

Example 5.30. 

+ directories are searched before the current directory.

Example 5.30. 

    INCLUDELUA <mylibrary1.lua>
@@ -1661,7 +1662,7 @@
             
INCTRD <filenameoftrdimage>,<filenameintrdimage>[,<offset>[,<length>]]

To include a file from a TRD image into the outputfile. - The offset and length are optional.

Example 5.31. 

+ The offset and length are optional.

Example 5.31. 

    INCTRD "test.trd","mygfx.C" ; include mygfx.C from test.trd
@@ -1684,7 +1685,7 @@
               

If <virtual labels> is non zero, then the page number NN is not part of output, and ADDRESS is truncated to 0000..FFFF range.

-

Example 5.32. 

+

Example 5.32. 

    LABELSLIST "x:/somepath/user.l"
@@ -1698,7 +1699,7 @@ PASS3 - interpret Lua script in third pass only. By default. ALLPASS - interpret Lua script in all passes. It is needed if you generate some Z80 code.
-

Example 5.33. 

+

Example 5.33. 

    LUA
@@ -1713,7 +1714,7 @@
                 


MEMORYMAP

Not available yet.

-
MMU <first slot number> [<last slot number>|<single slot option>], <page number>[,<address>]
+
MMU <first slot number or address> [<last slot number or address>|<single slot option>], <page number>[,<address>]

Maps memory page(s) to slot(s), similar to SLOT + PAGE combination, but allows to set up whole range of consecutive slots (with consecutive memory pages). Or when only single slot is specified, extra option can be used to extend particular slot @@ -1724,11 +1725,14 @@

The optional third argument is address for ORG functionality.

+

(since v1.18.1) You can also use starting address of particular slot instead + of its number, ie. for ZX128: MMU $8000,3 is alias of MMU 2,3

+

Single slot option (default state is: no error/warning and no wrap = nothing special):

e = error on writing beyond last byte of slot
 w = warning on writing beyond last byte of slot
 n = wrap address back to start of slot, map next page

-

Example 5.34. docs_examples/po_mmu.asm

+

Example 5.34. docs_examples/po_mmu.asm

    DEVICE ZXSPECTRUM128 : LABELSLIST "po_mmu.lbl"  ; to check label pages
@@ -1751,7 +1755,7 @@
 				  Labels has to be unique only whithin the current module (module is added as prefix to them).
 				  Also note the use of '@' operator to suppress all this label-processing. Modules can
 				  be nested, and module has to be ended by ENDMODULE.
-			  

Example 5.35. docs_examples/po_module.asm

+

Example 5.35. docs_examples/po_module.asm

    MODULE xxx
@@ -1830,7 +1834,7 @@
 			  

The id-warning system state is NOT saved/restored by OPT push/pop/reset and can be modified only by -W option.

-

Example 5.36. docs_examples/po_opt.asm

+

Example 5.36. docs_examples/po_opt.asm

    POP bc, hl   ; pops BC first
@@ -1850,7 +1854,7 @@
               

When used inside DISP block, only the virtual "displaced" program counter is affected, but the machine code will be still sequentially emitted in the original physical location and warning is emitted. -

Example 5.37. docs_examples/po_org.asm

+

Example 5.37. docs_examples/po_org.asm

    ORG 100h ; or 0x100, or $100, or #100
@@ -1892,7 +1896,7 @@
               of the file).

OUTPUT <filename>,t  ; truncate (default)
 OUTPUT <filename>,r  ; rewind
 OUTPUT <filename>,a  ; append

-

Example 5.38. bigfile.asm

+

Example 5.38. bigfile.asm

    OUTPUT loader.com
@@ -1916,7 +1920,7 @@
 
               

Set the current memory page to current slot.

-

Example 5.39. 

+

Example 5.39. 

    PAGE 7 ;set 7 page
@@ -1963,7 +1967,7 @@
 
               

Save the block of RAM.

-

Example 5.40. 

+

Example 5.40. 

    PAGE 7 ;set 7 page to current slot
@@ -1985,7 +1989,7 @@
               

The offset is not limited to page size, i.e. arguments page=1,offset=0x500 are equal to arguments page=0,offset=0x4500 for ZXSPECTRUM128 device (has page size 0x4000).

-

Example 5.41. 

+

Example 5.41. 

    DEVICE ZXSPECTRUM128 : SAVEDEV "fullram.bin",0,0,0x20000 ; save full 128kiB
@@ -1997,7 +2001,7 @@

Save the block of RAM in Hobeta format.

-

Example 5.42. 

+

Example 5.42. 

    PAGE 7 ;set 7 page to current slot
@@ -2015,7 +2019,7 @@
               DEVICE.

Save the snapshot for emulators of ZX-Spectrum. (If start address is omitted, - the one provided by END is used)

Example 5.43. 

+ the one provided by END is used)

Example 5.43. 

    DEVICE ZXSPECTRUM128
@@ -2033,7 +2037,7 @@
               DEVICE.

Append the tape header or block of data to the end of the - standard tape file for emulators of ZX-Spectrum.

Example 5.44. 

+ standard tape file for emulators of ZX-Spectrum.

Example 5.44. 

    DEVICE ZXSPECTRUM48
@@ -2066,7 +2070,7 @@
 				  around region you want to store, if you have zero-ed bytes at beginning or end
 				  of your code).
 
-              

Example 5.45. 

+

Example 5.45. 

    DEVICE ZXSPECTRUM48
@@ -2100,7 +2104,7 @@
 			  

The unofficial three-letter extensions are also supported (official extensions are only: B, C, D and #). -

Example 5.46. 

+

Example 5.46. 

    EMPTYTRD "test.trd" ;create empty TRD image
     PAGE 7 ;set 7 page to current slot
     SAVETRD "test.trd","myfile1.C",$C000,$4000 ;- save 4000h begin from C000h of RAM to file to TRD image
@@ -2117,7 +2121,7 @@
 				

Will add execution-type breakpoint at address <expression> to the BPLIST export file. If no expression is specified, the current program counter will be used. -

Example 5.47. 

+

Example 5.47. 

    BPLIST "cmd_line.options.txt" zesarux ; open breakpoints list in "ZEsarUX" format
@@ -2133,7 +2137,7 @@
 				

SHELLEXEC <filename>[,<parameters>]

Execute external program <filename> using optional - command line <parameters>.

Example 5.48. 

+ command line <parameters>.

Example 5.48. 

    OUTPUT "mybin.bin"
@@ -2145,7 +2149,7 @@
                 


SIZE <filesize in bytes>

If the resulting file is less than the given length, as - many zero bytes are added as necessary. See OUTPUT for more.

Example 5.49. 

+ many zero bytes are added as necessary. See OUTPUT for more.

Example 5.49. 

    SIZE 32768       ; make sure file will be 32K
@@ -2156,7 +2160,7 @@ Source Level Debugging (SLD) data. The particular keywords depend on the debugger you are using to process SLD data.

-

Example 5.50. 

+

Example 5.50. 

    DEVICE ZXSPECTRUM128
@@ -2167,15 +2171,18 @@
 var1    DB 1      ; WPMEM - exported
 var2    DB 2      ; WpMem - not exported, case sensitive!


-
SLOT <number>
+
SLOT <number_or_address>

Work only in real device emulation mode. See DEVICE.

-

Set current slot. Slot's defined by MEMORYMAP pseudo-op. +

Set current slot. Slots are defined by DEVICE pseudo-op. Use pseudo-op PAGE to change page in the current slot.

-

Example 5.51. 

+

(since v1.18.1) You can also use starting address of particular slot instead + of its number, ie. for ZX128: SLOT $8000 is alias of SLOT 2

+ +

Example 5.51. 

    DEVICE ZXSPECTRUM128
@@ -2193,7 +2200,7 @@
               

Appends one tape block at the end of specified file. All following code will be assembled to this tape file block.

-

Default value of flagbyte is 255.

Example 5.52. bigfile.asm

+

Default value of flagbyte is 255.

Example 5.52. bigfile.asm

    EMPTYTAP screen.tap
@@ -2215,7 +2222,7 @@
             
UNDEFINE <id>

Removes the identifier defined by DEFINE

-

Example 5.53. 

+

Example 5.53. 

    DEFINE Release 1
@@ -2247,7 +2254,7 @@
 				  an ENDW (EDUP/ENDR alias) pseudo-op is encountered.

The optional guardian-counter value will abort the WHILE if there are more iterations, default guardian-counter is set to 100k. -

Example 5.54. 

+

Example 5.54. 

ptr = $4000
@@ -2261,7 +2268,7 @@
 			  

WORD <words>

Defines a word. Values should be between -32787 and - 65536.

Example 5.55. 

+ 65536.

Example 5.55. 

    WORD 4000h,0d000h
@@ -2286,7 +2293,7 @@
 				  does not emit any machine code and does not define any label), you can suppress the
 				  warning.

-

Example 5.56. 

+

Example 5.56. 

    IF (aaa == 0) || (2 = aaa && ((bbb % 13) & 0x01))
@@ -2303,7 +2310,7 @@
               

The condition is true if there is an id defined. These are NOT labels.

-

Example 5.57. 

+

Example 5.57. 

    IFDEF MSX_LEAN_AND_MEAN
@@ -2316,7 +2323,7 @@
               

The condition is true if there isn't an id defined. These are NOT labels.

-

Example 5.58. 

+

Example 5.58. 

1   IN A,(0C4H)
@@ -2330,7 +2337,7 @@
               in the code. You can create libraries of useful functions using
               IFUSED pseudo-op

-

Example 5.59. (similar to tests/misc/ifused_test.asm)

+

Example 5.59. (similar to tests/misc/ifused_test.asm)

    OUTPUT "TEST.OUT"
@@ -2405,7 +2412,7 @@
       name of the macro, optionally followed by the parameters. The following
       lines will be stored as the macro-body until an ENDM pseudo-op is
       encountered. Macro's have to be defined before their use.
-	  

Example 5.60. Macro without parameters (docs_examples/s_macros.asm)

+

Example 5.60. Macro without parameters (docs_examples/s_macros.asm)

  MACRO ADD_HL_A
@@ -2418,7 +2425,7 @@
         


Labels in a macro starting with a dot are local to each macro - expansion.

Example 5.61. A macro with parameters (docs_examples/s_macros.asm)

+ expansion.

Example 5.61. A macro with parameters (docs_examples/s_macros.asm)

  MACRO WAVEOUT reg, data
@@ -2435,7 +2442,7 @@
   LD A,17
   OUT (7FH),A


-

Example 5.62. Another example (docs_examples/s_macros.asm)

+

Example 5.62. Another example (docs_examples/s_macros.asm)

    MACRO LOOP
@@ -2459,7 +2466,7 @@
         


Angle brackets can be used when the arguments contain commas. -

Example 5.63. Argument in angle brackets (docs_examples/s_macros.asm)

+

Example 5.63. Argument in angle brackets (docs_examples/s_macros.asm)

    MACRO UseLess data
@@ -2484,7 +2491,7 @@
 		

As compatibility convenience to make porting from different assemblers somewhat easier, there is alternative syntax, where the macro name is written at beginning of line (as if label, but MODULE part is NOT applied to macro name). -

Example 5.64. Macro name at beginning of line (docs_examples/s_macros.asm)

+

Example 5.64. Macro name at beginning of line (docs_examples/s_macros.asm)

LabelAsMacroName    MACRO  arg1?, arg2?
                         ld  a,arg1?
                         ld  hl,arg2?
@@ -2499,7 +2506,7 @@
 		

If some macro over-shadows regular instruction or directive name, the @ character in front of instruction/directive name can be used to inhibit macro expansion. -

Example 5.65. Inhibit macro expansion operator (docs_examples/s_macros.asm)

+

Example 5.65. Inhibit macro expansion operator (docs_examples/s_macros.asm)

djnz    MACRO   arg1?
             dec c
             jr  nz,arg1?
@@ -2632,7 +2639,7 @@
     

Examples

-

Example 6.1. docs_examples/c_structures.asm

+

Example 6.1. docs_examples/c_structures.asm

	STRUCT SCOLOR
@@ -2648,7 +2655,7 @@
 SCOLOR.GREEN	EQU 1 ; offset
 SCOLOR.BLUE	EQU 2 ; offset

-

Example 6.2. docs_examples/c_structures.asm

+

Example 6.2. docs_examples/c_structures.asm

	STRUCT SDOT
@@ -2669,7 +2676,7 @@
 SDOT.C.BLUE	EQU 4 ; offset
 

-

Example 6.3. docs_examples/c_structures.asm

+

Example 6.3. docs_examples/c_structures.asm

	STRUCT SPOS,4
@@ -2686,7 +2693,7 @@
 SPOS.Y	EQU  6 ; offset
 SPOS.AD	EQU  8 ; offset

-

Example 6.4. docs_examples/c_structures.asm

+

Example 6.4. docs_examples/c_structures.asm

When a structure is defined it is possible to declare labels @@ -2717,7 +2724,7 @@ ; etc.


-

Example 6.5. docs_examples/st_usage_example.asm

+

Example 6.5. docs_examples/st_usage_example.asm

	STRUCT BIN_FILE_MAP, 256
@@ -2744,7 +2751,7 @@
 binData.value2          EQU 0x8101   ; address

-

Example 6.6. docs_examples/st_text.asm

+

Example 6.6. docs_examples/st_text.asm

        STRUCT BLOCK_HEADER
@@ -2797,7 +2804,7 @@
     

How to use?

-

You must use LUA and ENDLUA pseudo-ops.

Example 7.1. Hello World!

+

You must use LUA and ENDLUA pseudo-ops.

Example 7.1. Hello World!

    LUA
@@ -2972,7 +2979,7 @@
 
       

-

Example 7.2. Variables doesn't clear in new passes of the compiler

+

Example 7.2. Variables doesn't clear in new passes of the compiler

    LUA PASS1
@@ -2989,7 +2996,7 @@
        print (v)
 -- out to console: 2
     ENDLUA
-


Example 7.3. To generate some code you need to generate it in all +


Example 7.3. To generate some code you need to generate it in all passes

@@ -3007,7 +3014,7 @@ LUA PASS2 ; if you fully understand what you are doing sj.add_byte(123) -- and you need emit bytes in other mode ENDLUA ; luamc-ok ; you can suppress warning here or at start of block
-


Example 7.4. Declare function and use it

+


Example 7.4. Declare function and use it

     LUA
@@ -3030,7 +3037,7 @@
      LUA
          savetape_mytype("tapefiles/myprogram.tape", _c("StartGameLabel"))
      ENDLUA
-


Example 7.5. Simple sample :)

+


Example 7.5. Simple sample :)

	LUA
@@ -3400,7 +3407,7 @@
   

Examples

-

Example 8.1. docs_examples/s_savenex_examples.asm

+

Example 8.1. docs_examples/s_savenex_examples.asm

Creating NEX file which will have Layer2 loading screen (stripes), progress bar, and will @@ -3657,7 +3664,7 @@

-

Example 9.1. Example of SLD file

+

Example 9.1. Example of SLD file

@@ -3690,6 +3697,6 @@
 
   
-

Index

C

Conditional assembly, Conditional assembly
CSPECTMAP, Pseudo-ops

D

D24, Pseudo-ops, STRUCT instructions
DB (see BYTE)
DC, Pseudo-ops
DD (see DWORD)
DEFARRAY, Pseudo-ops
DEFARRAY+, Pseudo-ops
DEFB (see BYTE)
DEFD (see DWORD)
DEFG (see DG)
DEFH (see DH)
DEFINE, Pseudo-ops
DEFINE+, Pseudo-ops
DEFL, Pseudo-ops
(see also EQU)
DEFM (see BYTE)
DEFS (see BLOCK)
DEFW (see WORD)
DEPHASE (see ENT)
(see also DISP)
DEVICE, Pseudo-ops
(see also MMU)
(see also ZXSPECTRUM128)
(see also ZXSPECTRUMNEXT)
DG, Pseudo-ops
DH, Pseudo-ops
DISP, Pseudo-ops
(see also ENT)
DISPLAY, Pseudo-ops
DM (see BYTE)
DS (see BLOCK)
DUP, Pseudo-ops
DW (see WORD)
DWORD, Pseudo-ops, STRUCT instructions
DZ, Pseudo-ops

E

ELSE, Conditional assembly
(see also IF)
ELSEIF, Conditional assembly
(see also IF)
EMPTYTAP, Pseudo-ops
EMPTYTRD, Pseudo-ops
ENCODING, Pseudo-ops
END, Pseudo-ops
ENDIF, Conditional assembly
ENDLUA, Pseudo-ops
(see also LUA)
ENDMOD (see ENDMODULE)
ENDMODULE, Pseudo-ops
(see also MODULE)
ENDT (see ENT)
ENT, Pseudo-ops
(see also DISP)
EQU, Pseudo-ops
(see also DEFL)
EXPORT, Pseudo-ops

F

FPOS, Pseudo-ops

H

HEX, Pseudo-ops
(see also DH)
high, Expressions

L

LABELSLIST, Pseudo-ops
low, Expressions
LUA, Pseudo-ops

M

MMU, Pseudo-ops
(see also DEVICE)
(see also PAGE)
(see also SLOT)
mod, Expressions
MODULE, Pseudo-ops

O

OPT, Pseudo-ops
or, Expressions
ORG, Pseudo-ops
(see also DEVICE)
OUTEND, Pseudo-ops
(see also OUTPUT)
(see also SIZE)
OUTPUT, Pseudo-ops
(see also SIZE)

P

PAGE, Pseudo-ops
(see also DEVICE)
(see also MMU)
(see also SLOT)
PHASE (see DISP)

R

RELOCATE_END, Pseudo-ops
RELOCATE_START, Pseudo-ops
RELOCATE_TABLE, Pseudo-ops
REPT (see DUP)

S

SAVEBIN, Pseudo-ops
SAVEDEV, Pseudo-ops
SAVEHOB, Pseudo-ops
SAVENEX, Pseudo-ops
SAVESNA, Pseudo-ops
SAVETAP, Pseudo-ops
SAVETRD, Pseudo-ops
SETBP, Pseudo-ops
(see also BPLIST)
SETBREAKPOINT (see SETBP)
SHELLEXEC, Pseudo-ops
shl, Expressions
shr, Expressions
SIZE, Pseudo-ops
(see also OUTPUT)
sj.add_byte(..), SjASMPlus functions bindings to Lua
sj.add_word(..), SjASMPlus functions bindings to Lua
sj.calc(..) (see _c(..))
sj.current_address, SjASMPlus functions bindings to Lua
sj.error(..), SjASMPlus functions bindings to Lua
sj.error_count, SjASMPlus functions bindings to Lua
sj.exit(..), SjASMPlus functions bindings to Lua
sj.file_exists(..), SjASMPlus functions bindings to Lua
sj.get_byte(..), SjASMPlus functions bindings to Lua
sj.get_define(..), SjASMPlus functions bindings to Lua
sj.get_device(), SjASMPlus functions bindings to Lua
sj.get_label(..), SjASMPlus functions bindings to Lua
sj.get_word(..), SjASMPlus functions bindings to Lua
sj.insert_define(..), SjASMPlus functions bindings to Lua
sj.insert_label(..), SjASMPlus functions bindings to Lua
sj.parse_code(..) (see _pc(..))
sj.parse_line(..) (see _pl(..))
sj.set_device(..), SjASMPlus functions bindings to Lua
sj.set_page(..), SjASMPlus functions bindings to Lua
sj.set_slot(..), SjASMPlus functions bindings to Lua
sj.shellexec(..), SjASMPlus functions bindings to Lua
sj.warning(..), SjASMPlus functions bindings to Lua
sj.warning_count, SjASMPlus functions bindings to Lua
SLDOPT, Pseudo-ops
SLOT, Pseudo-ops
(see also DEVICE)
(see also MMU)
(see also PAGE)

T

TAPEND, Pseudo-ops
(see also TAPOUT)
TAPOUT, Pseudo-ops
TEXT, STRUCT instructions
TEXTAREA (see DISP)

U

UNDEFINE, Pseudo-ops
(see also DEFINE)
UNPHASE (see ENT)
+

Index

C

Conditional assembly, Conditional assembly
CSPECTMAP, Pseudo-ops

D

D24, Pseudo-ops, STRUCT instructions
DB (see BYTE)
DC, Pseudo-ops
DD (see DWORD)
DEFARRAY, Pseudo-ops
DEFARRAY+, Pseudo-ops
DEFB (see BYTE)
DEFD (see DWORD)
DEFG (see DG)
DEFH (see DH)
DEFINE, Pseudo-ops
DEFINE+, Pseudo-ops
DEFL, Pseudo-ops
(see also EQU)
DEFM (see BYTE)
DEFS (see BLOCK)
DEFW (see WORD)
DEPHASE (see ENT)
(see also DISP)
DEVICE, Pseudo-ops
(see also MMU)
(see also ZXSPECTRUM128)
(see also ZXSPECTRUMNEXT)
DG, Pseudo-ops
DH, Pseudo-ops
DISP, Pseudo-ops
(see also ENT)
DISPLAY, Pseudo-ops
DM (see BYTE)
DS (see BLOCK)
DUP, Pseudo-ops
DW (see WORD)
DWORD, Pseudo-ops, STRUCT instructions
DZ, Pseudo-ops

E

ELSE, Conditional assembly
(see also IF)
ELSEIF, Conditional assembly
(see also IF)
EMPTYTAP, Pseudo-ops
EMPTYTRD, Pseudo-ops
ENCODING, Pseudo-ops
END, Pseudo-ops
ENDIF, Conditional assembly
ENDLUA, Pseudo-ops
(see also LUA)
ENDMOD (see ENDMODULE)
ENDMODULE, Pseudo-ops
(see also MODULE)
ENDT (see ENT)
ENT, Pseudo-ops
(see also DISP)
EQU, Pseudo-ops
(see also DEFL)
EXPORT, Pseudo-ops

F

FPOS, Pseudo-ops

H

HEX, Pseudo-ops
(see also DH)
high, Expressions

L

LABELSLIST, Pseudo-ops
low, Expressions
LUA, Pseudo-ops

M

MMU, Pseudo-ops
(see also DEVICE)
(see also PAGE)
(see also SLOT)
mod, Expressions
MODULE, Pseudo-ops

O

OPT, Pseudo-ops
or, Expressions
ORG, Pseudo-ops
(see also DEVICE)
OUTEND, Pseudo-ops
(see also OUTPUT)
(see also SIZE)
OUTPUT, Pseudo-ops
(see also SIZE)

P

PAGE, Pseudo-ops
(see also DEVICE)
(see also MMU)
(see also SLOT)
PHASE (see DISP)

R

RELOCATE_END, Pseudo-ops
RELOCATE_START, Pseudo-ops
RELOCATE_TABLE, Pseudo-ops
REPT (see DUP)

S

SAVEBIN, Pseudo-ops
SAVEDEV, Pseudo-ops
SAVEHOB, Pseudo-ops
SAVENEX, Pseudo-ops
SAVESNA, Pseudo-ops
SAVETAP, Pseudo-ops
SAVETRD, Pseudo-ops
SETBP, Pseudo-ops
(see also BPLIST)
SETBREAKPOINT (see SETBP)
SHELLEXEC, Pseudo-ops
shl, Expressions
shr, Expressions
SIZE, Pseudo-ops
(see also OUTPUT)
sj.add_byte(..), SjASMPlus functions bindings to Lua
sj.add_word(..), SjASMPlus functions bindings to Lua
sj.calc(..) (see _c(..))
sj.current_address, SjASMPlus functions bindings to Lua
sj.error(..), SjASMPlus functions bindings to Lua
sj.error_count, SjASMPlus functions bindings to Lua
sj.exit(..), SjASMPlus functions bindings to Lua
sj.file_exists(..), SjASMPlus functions bindings to Lua
sj.get_byte(..), SjASMPlus functions bindings to Lua
sj.get_define(..), SjASMPlus functions bindings to Lua
sj.get_device(), SjASMPlus functions bindings to Lua
sj.get_label(..), SjASMPlus functions bindings to Lua
sj.get_word(..), SjASMPlus functions bindings to Lua
sj.insert_define(..), SjASMPlus functions bindings to Lua
sj.insert_label(..), SjASMPlus functions bindings to Lua
sj.parse_code(..) (see _pc(..))
sj.parse_line(..) (see _pl(..))
sj.set_device(..), SjASMPlus functions bindings to Lua
sj.set_page(..), SjASMPlus functions bindings to Lua
sj.set_slot(..), SjASMPlus functions bindings to Lua
sj.shellexec(..), SjASMPlus functions bindings to Lua
sj.warning(..), SjASMPlus functions bindings to Lua
sj.warning_count, SjASMPlus functions bindings to Lua
SLDOPT, Pseudo-ops
SLOT, Pseudo-ops
(see also DEVICE)
(see also MMU)
(see also PAGE)

T

TAPEND, Pseudo-ops
(see also TAPOUT)
TAPOUT, Pseudo-ops
TEXT, STRUCT instructions
TEXTAREA (see DISP)

U

UNDEFINE, Pseudo-ops
(see also DEFINE)
UNPHASE (see ENT)
diff --git a/docs/documentation.xml b/docs/documentation.xml index 1cff7b3f..8bbc8e35 100644 --- a/docs/documentation.xml +++ b/docs/documentation.xml @@ -2,7 +2,7 @@ - SjASMPlus 1.18.0 Documentation [2020-12-12] + SjASMPlus 1.18.1 Documentation [2021-01-23] Introduction @@ -200,13 +200,14 @@ - WIP - 1.18.1 + 23.1.2021 - 1.18.1 - Big-Endian hosts support (experimental and not tested continuously) - added "listall", "listact" commands to OPT - to switch between listing types - `WHILE` has optional argument to set explicit guardian-counter - `ASSERT` has optional argument (to add description/notes for expression) +- `SLOT` and `MMU` will now accept also starting address of slot instead of its number - fix: option --sym was not exporting labels starting with underscore - fix: SAVENEX BMP-loader bug when certain builds of sjasmplus were unable to open BMP files - fix: after STRUCT instance the "main" label is not polluted by last field of STRUCT diff --git a/sjasm/sjdefs.h b/sjasm/sjdefs.h index 459966e7..4817bf7d 100644 --- a/sjasm/sjdefs.h +++ b/sjasm/sjdefs.h @@ -30,8 +30,8 @@ #define __SJDEFS // version string -#define VERSION "1.18.0" -#define VERSION_NUM "0x00011200" +#define VERSION "1.18.1" +#define VERSION_NUM "0x00011201" #define LASTPASS 3 diff --git a/tests/define/predefined_date_time.asm b/tests/define/predefined_date_time.asm index d9a4ffa7..9bbc0c1d 100644 --- a/tests/define/predefined_date_time.asm +++ b/tests/define/predefined_date_time.asm @@ -9,7 +9,7 @@ DD __ERRORS__, __WARNINGS__ DB __PASS__ -; 1.18.0 version check (needs update upon release) +; 1.18.1 version check (needs update upon release) ASSERT 1 == (__SJASMPLUS__>>16) ASSERT 18 == ((__SJASMPLUS__>>8)&0xFF) - ASSERT 0 == (__SJASMPLUS__&0xFF) + ASSERT 1 == (__SJASMPLUS__&0xFF) diff --git a/tests/test build script and options/opt version/option version.cli b/tests/test build script and options/opt version/option version.cli index 6af548e4..d763b7b6 100644 --- a/tests/test build script and options/opt version/option version.cli +++ b/tests/test build script and options/opt version/option version.cli @@ -3,7 +3,7 @@ $MEMCHECK "$EXE" -Wno-behost -h | head -n 1 > help_line1.out &&\ $MEMCHECK "$EXE" -Wno-behost --version 2> version.out &&\ $MEMCHECK "$EXE" -Wno-behost --nologo --version 2> raw_version.out &&\ -echo "1.18.0" > raw.expected &&\ +echo "1.18.1" > raw.expected &&\ diff -a --strip-trailing-cr help_line1.out version.out &&\ diff -a --strip-trailing-cr raw.expected raw_version.out last_result=$?