CPCWiki forum

General Category => Programming => Topic started by: roudoudou on 09:58, 22 February 17

Title: Rasm Z80 assembler v0.115 [update 2019.07.18]
Post by: roudoudou on 09:58, 22 February 17
update v0.115
- bugfix preprocessing with multi-line comments
- bugfix unrecognized % for modulo
- new banking BUILDZX directive for ZX Spectrum usage




New FR & EN documentation by Siko (Stéphane S.)

Yes! Another assembler!

    - DAMN fast assembling
    - integrated crunched sections (LZ48/LZ49/LZ4/ZX7/Exomizer) + load&crunch on the fly
    - cartridge, snapshot, binaries with or without amsdos header, multiple EDSK generation
    - symbols import/export, breakpoint export
    - ORG checking, unlimited memory workspaces where labels are shared, bank management, structures
    - ALL undocumented instructions
    - conditionnal macro, unlimited & embeded loops with local labels, switch/case
    - floating point engine, mathematical functions, ...
    - MAXAM, AS80 & UZ80 compatibility option
    - English & French documentation
    - Uninterrupted support

Keep in mind that msdos version will work ONLY on true msdos with dos4gw.exe extender or Windows 95,98,Millenium (that graphical manager on msdos) without long filenames. Will work with DOS-box too
Title: Re: Rasm Z80 assembler in beta
Post by: roudoudou on 10:13, 22 February 17

Thanks to all the people
supporting me
advising me for new functionnalities, ergonomics
reporting bugs
and of course using the tool!

update v0.112
- bugfix single NOP wasn't increment nop counter ^_^
- bugfix NOP count with ADD/SUB/XOR/AND/CP (IX+n)/(IY+n)
- bugfix in WAV import

update v0.111- error management code cleanup
- new options with directive INCBIN for wav import
- allow EDSK with invalid track sector size or supernumerary tracks if sectors are DATA compliant
- bugfix confusion between generated global labels and local labels for export
- bugfix EQU with generated names AND curly brackets formulas inside a loop
- bugfix invalid REPEAT values will increment the error counter

update v0.110- allow numeric expression beginning with +- bugfix uninitialized memory reads with embedded Rasm


update v0.109
- bugfix crash when trying to save with a negative size
- bugfix crash case with macro and wrong parameter number
- bugfix EDSK update
- IFDEF/IFNDEF now scans for macro names
- TZX/CDT output support (not working)
- RUN directive may use unknown var as parameter
- embedded Rasm may return info struct about errors and symbols

update v0.108
- allow var name beginning with '_'
- CODE directive may retrieve last outputed byte adress

update v0.107
- colored output with Unix terminal
- trigger error if a (VOID) arg is used with a macro which has parameter(s)
- added Vasm syntax ENDREP and ENDREPEAT to end a REPEAT block
- enforce zero result when there is an error in a calculation
- new directives NOEXPORT/ENOEXPORT to disable/enable on demand symbol export

update v0.106
- multi-line comments

update v0.105
- bugfix wrong error with operator+non decimal negative value
- do not allow CALL (IX) or CALL (IY) syntax
- added comments begining with //
- added SIZEOF support for fields of structures
- new directive TICKER to count instruction duration

update v0.104
- BANK again in the same slot keep memory tracking
- no more path simplification (until i solve it!)

update v0.103
- bugfix memory cleanup with embedded rasm

update v0.102
- bugfix 'BREAKPOINT <adress>' export
- bugfix default limit of 65535
- bugfix limit autotest
- bugfix path simplification for dependencies export
- bugfix memory leak when using (VOID) with macro
- new math function to get a random value

update v0.101
- warn if no byte is written to a snapshot
- warn if RUN directive was already used
- bugfix calculation error cases
- bugfix maxam AND/OR/XOR/MOD operator (regression of v0.89)
- UNDEF does not care anymore about variable existence
- better error management with macro and wrong number of parameters

update v0.100
- bugfix crash with zeroed output file
- bugfix moar memory leaks

update v0.99
- new directive UNDEF
- bugfix memory leaks
- bugfix calculations with a function followed by two or more opened parenthesis

update v0.98
- bugfix with snapshot v2 memory size detection
- new optional parameter to get file size when load and crunch on the fly
- new option to remove warnings
- new fake instructions RR,RL,SRL,SRA,SLL,SLA with 16 bits (BC,DE,HL) registers
- preprocessing does not allow empty parameter to avoid confusion
- extended error may suggest a name if a variable/label/alias looks similar to a 'not found' value

update v0.97
- bugfix conditionnal code inhibition with macro declaration
- better alias infinite recursivity detection

update v0.96
- bugfix memory leak in tag translation with PRINT directive
- bugfix negative offset with INCBIN
- bugfix autotests memory handling
- added include path in command line

update v0.95
- allow spaces in tags inside strings with PRINT directive
- display warning if you try to export symbols or breakpoints with snapshot version 2
- proximity label beginning with BRK will generate an exportable breakpoint
- new enhanced LD instructions (see online documentation)

update v0.94
- bugfix using macro parameter inside print quote
- bugfix multiple memory leak with tag replacement
- bugfix command line side effect with wrong option
- better hack in expression calculator for expression beginning with negative value
- better equality processing in expression calculator
- dependencies export do not display preprocessing message anymore

update v0.93
- bugfix RUN gate array configuration
- overriding an alias with a label will trigger an error
- PRINT directive may use escaped chars in strings
- tags BANK,PAGE,PAGESET may be used with current adress $

update v0.92
- bugfix PAGE tag when using BANK in snapshot mode

update v0.91
- bugfix school case with crunched block
- bugfix proximity labels when using loops or macros
- bugfix imbricated IFUSED/IFNUSED
- new directive FAIL will print a message before exiting with an error flag
- label usage may use formula
- escaped codes support in strings (disregarding the current charset)
- PRINT directive may compute formula in strings when using curly brackets
- RUN directive may set the gate array configuration for snapshots
- generated label with negative index will trigger an error
- overriding an alias with a variable will trigger an error
- overriding a variable with an alias will trigger an error
- missing ENDIF at the end of the source will trigger an error

update v0.90
- PROTECT directive does not increase automatic binary size anymore
- bugfix memory leak with proximity labels
- proximity label properties also for EQU aliases
- label declaration may use formula

update v0.89
- bugfix dependencies export
- multiple bugfix in preprocessor
- simplify path of dependencies when possible
- enhanced ASSERT may PRINT additional parameters

update v0.88
- bugfix another cases during preprocessing

update v0.87
- new proximity labels
- rasm is able to use variables inside label names
- INCBIN directive enhanced for WAV import as a CPC sample or DMA list
- REPEAT directive may export internal counter to a variable
- new directive IFUSED & IFNUSED
- new math operator ! for NOT
- new math function PSGVALUE
- rasm return 1 to shell when there is error(s)
- new options to export dependencies (makefile style)
- new option to define variable(s) from command line
- new option for extended error messages
- bugfix cases during preprocessing
- bugfix tags PAGE & PAGESET
- new autotests embedded in Rasm in order to reduce regressions

update v0.86
- fix many bugs in label import
- fix multi-nops
- fix automatic extension for primary source
- fix infinite loop when error on reserved keyword in an expression

update v0.85
- fix regressions introduced by STRUCT code modifications

update v0.84
- new directives STRUCT and ENDSTRUCT, ENDS to create structures
- fix regression introduced with v0.75 and embedded usage (like Arkos Tracker II does)

update v0.83
- NOCODE output must increment current adress in all cases
- new directives DR & DEFR to define REAL values (Amstrad firmware compatible)

update v0.82
- better infinite loop detection
- bugfix while 0 loop (check and disable block)
- repeat until internal counter harmonisation
- alias SL1 for SLL instruction
- remove CLang warnings on Linux

update v0.81
- added special maxam priorities for parenthesis and boolean operators

update v0.80
- bugfix operator > and >=
- bugfix Maxam priorities


update v0.79
- != operator is back with new solver

update v0.78
- DEFS can handle multiple repetition schemas
- alias DM & DEFM for DEFB


update v0.77
- even faster expression calculation
- maxam & AS80 comparison operators are back


update v0.76
- fix solver when using % prefixed binary values and comparison operators or parenthesis


update v0.75
- newer and faster expression calculator without limitations of comparisons
- % may be used as modulo (still used for binary values)
- Intel hexa & binary style support
- Binary prefix 0b fixed
- does not export IX and IY anymore in symbol files
- better error messages when calculating expressions
- boolean operators && and ||
- PUSH & POP may have more than one register in parameters
- NOP may be multiplied specifying a number of repetition in parameter
- alias <> for != comparison operator
- filenames are forced to upper case when saved to EDSK
- Infinite loop detection won't go to infinite loop anymore ^_^


update v0.74
- usage of snapshot directives forces snapshot output
- try to load .asm or .Z80 file if filename given is not found and has no extension
- BREAKPOINT directive may have an additional parameter to set break adress anywhere
- declaring two MACRO with the same name will trigger an error
- bugfix regression of -m option handling
- each REPEAT or WHILE loop export a REPEAT_COUNTER or WHILE_COUNTER variable, locally


update v0.73
- bugfix in snapshot directive
- bugfix in snapshot when using distinct bank instead of banksets


update v0.72
- ability to generate v2 snapshot for M4Wifi


update v0.71
- math functions HI & LO to get high 8 bits or low 8 bits of a pseudo 16 bits value
- @ prefix for octal values
- AS80 assembler compatibility mode (enough to compile CNG player)


update v0.70
- shifting operator >> bugfix
- EDSK face selection bugfix


update v0.69
- added $ prefix for hex values
- added 0xb prefix for binary values
- added shifting operators << and >>
- EDSK update/generation improvements (make backups before use!)


update v0.68
- Morphos compatibility code
- better error messages
- includes or incbin in a disabled section won't warn anymore if file does not exists
- breakpoint in snapshot with BRKC chunk for ACE emulator
- shorter splash text
- unused var cleanup


update v0.67
- bugfix buffer overflow with long filenames for export
- snapshot support unofficial Winape breakpoint chunk
- new directive BREAKPOINT
- labels begining by BRK or @BRK are exported as breakpoint in snapshots


update v0.66
- new conditionnal directives IFDEF and IFNDEF


update v0.65
- snapshot is initialised with standard CRTC values, all audio channels OFF, all inks to deep blue except ink 1 to bright yellow
- new directives SETCRTC and SETCPC to select the CRTC and CPC model with snapshots
- new tag {PAGE} before a label to get the gate array banking value for the bank of a label (ex: #C4 for a label in bank 4)
- new tag {PAGESET} before a label to get the gate array banking value for the bankset of a label (ex: #C2 for a label in bankset 1 or bank 4,5,6,7)
- new variable ASSEMBLER_RASM (set to 1) in order to have conditionnal code
- SAVE may be used to save file in a (new) DSK. I have to work on a update mode
- "checkmode" option to assemble without writing file(s)
- moar comprehensive error message when using illegal register combination
- moar compact splash screen- documentation updated


update v0.64
- bugfix SYMB chunk size
- added optionnal var export in snapshot SYMB chunk
- improve bankset switch control (do not mix bank & bankset of the same pages)
- INCBIN handle negative offset to seek relative to the end of file
- INCBIN special option to disable overwrite control


update v0.63
- snapshot generation (with SYMB chunk support for ACE)
- new directive BANKSET to work with 4 consecutives pages (only in snapshot mode)
- MEND alias for ENDM (and vice versa)
- Added '0x' prefix for hexadecimal values
- Cartridge generation is supposed to work with Rasm on big-endian CPU (like PowerPC)
- INCBIN directive support negative value for "size to read" in order to read a size relative to fullsize
- BANK directive may be used without parameter to open a new memory space
- bugfix UNTIL condition test


updated v0.61
- bugfix var memory leak with data flow
- bugfix preprocessing with data flow not using string endchar
- bugfix var export
- new directive ASSERT


update v0.58
- fixed INC SP encoding (was DEC SP opcode)


updated v0.57
- more flexible preprocessor with macro parameters
- new label prefix tag {BANK} to get the bank where is located a label


updated v0.56
- bugfix contiguous ORG check
- bugfix when a macro is opened for declaration and never closed
- added while/wend check in pre-processing
- now you can call a macro with a local value using prefix tag {eval}


updated v0.55
- bugfix local label internal building
- new directive INCEXO to include and crunch a file with Exomizer 2 (it's not faster than the original cruncher...)
- new directive LZEXO to open a code section that will be crunched after assembly
- licenses of third parties softwares are included in the windows executable and their respective source files


update v0.53
- bugfix CHARSET <start>,<end>,<index>
- bugfix duplicate name check for alias
- new directives INCLZ4, INCZX7 to include and crunch a file with LZ4 or LZX7
- new directives LZX7, LZ4 to open a code section that will be crunched after assembly
- literal values syntax check


updated v052
- bugfix ADD (IY+n), SBC (IY+n) ADC (IY+n) CP (iy+n) were encoded like IX version
- label duplicate name check
- tree search for variables speed up +20%


update v0.51
- bugfix ORG analysis for cartridge generation
- bugfix LIMIT
- bugfix with local labels not found in imbricated macros


update v0.50
- bugfix ORG <adress>,$
- you may use unix relative paths using Windows so there is nothing to change when switching between both OS


update 2017.04.03 - v0.49
- bugfix multiple LZ48/LZ49 block in the same ORG zone


updated first post with v0.48
- bugfix of label calculations when placed after a LZ48/LZ49 block (there is a bug left with more than one LZ section in the same ORG)
- directives SWITCH/CASE/DEFAULT/ENDSWITCH added
- PRINT enhancement


update v0.46 RELEASE CANDIDATE
- bugfix force binary mode when writing files with Windows to avoid extra-bytes
- bugfix with identical local labels when many repeat/while/macro are imbricated
- bugfix when macro parameters are bigger than parameter definitions (led to abnormal end)
- bugfix ADD,SUB,ADC,SBC with IX adressing
- bugfix with a few error messages that did not trigger an error
- bugfix truncate instead of rounding in MAXAM compatibility mode
- bugfix translate $ current adress once for all with EQU
- bugfix intempestive error message when writing symbol file
- EQU aliases may be declared after use (even it's NOT a recommended practice)
- Allow repeat 0 (zero) to disable a block. The block must be correct as there will be a partial decoding for loops
- Allow RES,SET,BIT,LIMIT first parameter to be a variable/EQU
- Added optionnal EQU and variable export
- Added FLOOR function for calculations
- Added STR winape directive
- Added LIST keyword to ignored winape directives
- Added check for REPEAT/WHILE opened but not closed
- Added automatic windows compiler detection for visual studio & Watcom C
- Improved a lot MAXAM compatibility (when using appropriate option)
- bugfix calculations when there is no operator inside a parenthesis block


update v0.42
- calculation chain reviewed
- allow old style label declaration with a starting dot
- allow useless A,register form with ADC,ADD,SBC,SUB
- extended syntax for 8bits index registers


update v0.40
- huge bugfix session (local labels, macro, label tree, alias, ...)
- documentation FR/EN!


update v0.37
- Macro support with curly brackets
- EQU is now managed as an alias
- Added a PROTECT function to prevent overwrite
- several bugfixes (memory issue, macro mixed with repeat, WRITE DIRECT)


update v035
- many bugfixes, RASM is still in beta
- new directives WRITE, BANK, LET, READ, BRK, RUN, PRINT, STOP, CHARSET, INCBIN, SAVE


update v032
- a few fixes, new directives incl48, incl49 to include a binary file and crunch it on the fly
- windows executable


early stage v027
- cleanup
- licence
- comment support
- c++ wrapper


early stage v026
- wip with conditionnal assembling
- verbose mode, debug mode


early stage v024
- local labels, duplicate labels
- AMSDOS header wip
- automatic save


early stage v023
- INCLUDE fix
- error management


early stage v022
- conditionnal loops wip
- symbol export


early stage v021
- conditionnal assembling
- instructions fix
- memory leak fix


early stage v019
- REPEAT wip


early stage v018
- relative adress fix
- CPR building wip
- Visual Studio compatibility


early stage v017
- mathematical functions premices
- current assembly adress management


early stage v016 (2017 february 16th)
- all Z80 instructions supported (thinking about a public beta)
- use CRC to speed up instruction


early stage v015
- cleanup
- a lot of instructions added
- undocumented instructions added
- (IX+n) management
- flexible limit for binary output


early stage v014
- state machine for parsing
- fast translation with expression for constants, etc.


early stage v013
- relative jumps
- RST assembling as an expression
- variables computed on the fly


early stage v012
- CPR building
- crunched zone relocation
- local labels premices
- single quote and double quotes
- INCBIN


early stage v010
- wip crunchzone


early stage v009
- wip computeExpression


early stage v008
- memory dump
- wip push label, push expression


early stage v007
- label premices
- expression management


early stage v004
- preprocessor creates a word list


early stage v001
- preprocessor draft
Title: Re: Rasm Z80 assembler in beta
Post by: AMSDOS on 10:58, 22 February 17
Yes! Another assembler!  ;D 



Looks interesting. Looking at some of that code I need to brush up on my assembly, but at least my Assembly is better than my C and was wondering if Translate back to C was an option for this Assembler?  8)
Title: Re: Rasm Z80 assembler in beta
Post by: roudoudou on 11:32, 22 February 17

Looks interesting. Looking at some of that code I need to brush up on my assembly, but at least my Assembly is better than my C and was wondering if Translate back to C was an option for this Assembler?  8)


I think this is a disassembler job, i can modify my old dizasm to do that
Title: Re: Rasm Z80 assembler in beta
Post by: AMSDOS on 11:46, 22 February 17
Sorry my suggestion is ridiculous (I think) :-[ I haven't seen an Assembler translate Assembly back to C, it's unusual I think cause it would only be done to write low-level code into an high-level form. Some early Assembly tutorials for the Amstrad used BASIC and then show equivalent Assembly code which was a good approach, in my case I'm perhaps better at Assembly than C.
Title: Re: Rasm Z80 assembler
Post by: roudoudou on 19:20, 04 March 17
first official release of Rasm in the first post (only sources today, stand alone executables monday since i do not have a windows dev machine at home)


the license is MIT "expat"


Title: Re: Rasm Z80 assembler
Post by: cpcuser on 23:04, 04 March 17

Why do you have to compile the thing itself?
greeting
Title: Re: Rasm Z80 assembler
Post by: roudoudou on 23:26, 04 March 17

Why do you have to compile the thing itself?
greeting




first official release of Rasm in the first post (only sources today, stand alone executables monday since i do not have a windows dev machine at home)


the license is MIT "expat"


wait monday for executables
Title: Re: Rasm Z80 assembler [update 2017.03.06]
Post by: roudoudou on 09:18, 06 March 17

update 2017.03.06:
- new release v032, a few fixes, new directives incl48, incl49 to include a binary file and crunch it on the fly
- Windows executables

Title: Re: Rasm Z80 assembler [update 2017.03.06]
Post by: Golem13 on 13:05, 06 March 17
It's a very great job roudoudou. Thanks.
The maxam compability will be a very good point, coz if it's possible to convert a source to your syntax, it's no more possible to assemble the converted source in a maxam assembler.
Do you believe it will be possible to manage the maxam syntax in your assembler ?
Title: Re: Rasm Z80 assembler [update 2017.03.06]
Post by: roudoudou on 14:17, 06 March 17
It's a very great job roudoudou. Thanks.
The maxam compability will be a very good point, coz if it's possible to convert a source to your syntax, it's no more possible to assemble the converted source in a maxam assembler.
Do you believe it will be possible to manage the maxam syntax in your assembler ?


Thanks to you.


I'm afraid by maxam you mean Winape


Making a maxam compatibility is supposed to be easy to do at short term -> there is only to destroy operator priority


Some of winape directive may be translated on the fly like "Write direct -1,-1,<n>" -> "bank <n>"



I'v already made a winape local label style with '@'  ;)


Rasm do not have yet macro support (it's planned)


Rasm does not support elseif (and i have not think about it)


Rasm does not support "AND" "OR" "XOR" operator but it should not be a great difficulty to integrate them




At this very moment i made Rasm to save time for my future production (november 2017) so i cannot promise to work on it before  :-X
Title: Re: Rasm Z80 assembler [update 2017.03.06]
Post by: Golem13 on 14:51, 06 March 17
You will need to include also, and at least the few instructions below (not a exhaustive list):

READ
filename
INCBIN filename[,offset[,size[,offset_high]]]
LET symbol = value
IFNOT condtion
RUN address
ORG code_address[,output_address]
CHARSET [string,value|byte,value|start,end,value]

From memory, and it's the commands list I use in maxam/winape syntax :-)

Thanks a lot for your skill !  :-*
Title: Re: Rasm Z80 assembler [update 2017.03.06]
Post by: roudoudou on 16:17, 08 March 17
You will need to include also, and at least the few instructions below (not a exhaustive list):

READ
filename
INCBIN filename[,offset[,size[,offset_high]]]
LET symbol = value
IFNOT condtion
RUN address
ORG code_address[,output_address]
CHARSET [string,value|byte,value|start,end,value]

From memory, and it's the commands list I use in maxam/winape syntax :-)

Thanks a lot for your skill !  :-*


I've been working hard on new directives to improve winape/maxam compatibility and facilitate the transfert to Rasm


I added to your list the SAVE, BRK and WRITE DIRECT command


There is a command line switch to avoid operator priority and mimic parenthesis with brackets


The assembler can also import symbols (pasmo/winape/rasm) and work on multiple memory set


For example, if your software is supposed to use expansion bank to run code, you may write a code like this


Each write direct create a new memory set of 64K


In this example there is 3 independent memory set BUT labels are shared


Code: [Select]
org #2000
mystart
; main code with menu from #2000
dec a
jr z,submenu1
dec a
jr z,submenu2
myend


save "main.bin",mystart,myend-mystart


write direct -1,-1,#C4
org #4000
submenu1
; code code
submenu1end
save "menu1.bin",submenu1,submenu1end-submenu1



write direct -1,-1,#C4
org #4000
submenu2


; code code


submenu2end
save "menu2.bin",submenu2,submenu2end-submenu2


Note: If you use the WRITE DIRECT -1,-1,n syntax


The assembler will write to specifics CPR memory sets


If no SAVE command is used, a CPR will be automatically created, the assembler will write 16K from the first adress written in the bank


You may force CPR writing






Moar testing then release soon ;)




Thanks Golem for suggestions












Title: Re: Rasm Z80 assembler [update 2017.03.06]
Post by: roudoudou on 10:54, 13 March 17
new release v035 in the first post, many bugfixes and new directives


RASM is still in beta  ;)



specific winape directive compatibility:

write direct -1,-1,<n>   same as
bank <n> directive
let             this useless keyword is ignored like in locomotive Basic
read            same as include directive
brk             ignored
run <nn>        ignored
print         print var, text or expression
stop         stop assembling
charset [p1,p2[,p3]]   same as Winape charset directive
incbin extended parameters

save "file",adr,size  save memory region in a file
Title: Re: Rasm Z80 assembler [update 2017.03.13]
Post by: roudoudou on 12:21, 15 March 17

updated the first post with v0.37


- Macro support with curly brackets
- EQU is now managed as an alias
- Added a PROTECT function to prevent overwrite
- several bugfixes (memory issue, macro mixed with repeat, WRITE DIRECT)

Title: Re: Rasm Z80 assembler [update 2017.03.16]
Post by: roudoudou on 15:11, 16 March 17

Updated the first post

A quick update today cause v037 was crap...


Rasm is now going into stabilisation phase since all requested functionnalities are implemented
Title: Re: Rasm Z80 assembler [update 2017.03.16]
Post by: roudoudou on 11:46, 18 March 17
Rasm is now going into stabilisation phase since all requested functionnalities are implemented


I worked a lot this night  ;D


change pas d'main, j'sens que ça vient!


updated the first post with v0.40
- huge bugfix session (local labels, macro, label tree, alias, ...)
- documentation FR/EN!
Title: Re: Rasm Z80 assembler [update 2017.03.20]
Post by: roudoudou on 20:03, 20 March 17

(first post modified)
update 2017.03.20 - v0.42
- calculation chain reviewed
- allow old style label declaration with a starting dot
- allow useless A,register form with ADC,ADD,SBC,SUB
- extended syntax for 8bits index registers
- documentation FR/EN updated


still some adjustments to do (local labels are buggy)
Title: Re: Rasm Z80 assembler [update 2017.03.28]
Post by: roudoudou on 09:20, 28 March 17
First release candidate!


Thanks to Golem for intensive testing, now his project compilation is a LOT faster


Manuals will be released soon in a separate ZIP




update 2017.03.28 - v0.46RC

- bugfix force binary mode when writing files with Windows to avoid extra-bytes
- bugfix with identical local labels when many repeat/while/macro are imbricated

- bugfix when macro parameters are bigger than parameter definitions (led to abnormal end)
- bugfix ADD,SUB,ADC,SBC with IX adressing
- bugfix with a few error messages that did not trigger an error
- bugfix truncate instead of rounding in MAXAM compatibility mode
- bugfix translate $ current adress once for all with EQU
- bugfix intempestive error message when writing symbol file
- EQU aliases may be declared after use (even it's NOT a recommended practice)
- Allow repeat 0 (zero) to disable a block. The block must be correct as there will be a partial decoding for loops
- Allow RES,SET,BIT,LIMIT first parameter to be a variable/EQU
- Added optionnal EQU and variable export

- Added FLOOR function for calculations

- Added STR winape directive
- Added LIST keyword to ignored winape directives
- Added check for REPEAT/WHILE opened but not closed
- Added automatic windows compiler detection for visual studio & Watcom C
- Improved a lot MAXAM compatibility (when using appropriate option)
- bugfix calculations when there is no operator inside a parenthesis block

Title: Re: Rasm Z80 assembler [update 2017.03.28] Release Candidate!
Post by: cpcuser on 11:55, 30 March 17



error......  jr nz,vbl

Code: [Select]

buildcpr
bank 0
di
res 5,(ix+0),b ; store in B the result of the RES
jr $


; generate a sinus table
align 256
sinustable
ang=0
repeat 256
defb 127*sin(ang)
ang=ang+360/256
rend


nop:nop:nop:nop:nop:call vbl;just for fun


tic=0
repeat
if tic<32
defb tic
else
defw tic
endif
tic=tic+0.7
until tic<64


LZ48


repeat 50
dec a
jr z,$+3
inc b
rend


LZCLOSE


vbl
ld b,#f5
in a,(c)
rra
jr nz,vbl
ret
Title: Re: Rasm Z80 assembler [update 2017.03.28] Release Candidate!
Post by: cpcuser on 12:11, 30 March 17
error...


Code: [Select]

org #2000
mystart
; main code with menu from #2000
dec a
jr z,submenu1
dec a
jr z,submenu2
myend




save "main.bin",mystart,myend-mystart




write direct #C4
org #4000
submenu1
; code code
submenu1end
save "menu1.bin",submenu1,submenu1end-submenu1






write direct #C4
org #4000
submenu2




; code code




submenu2end
save "menu2.bin",submenu2,submenu2end-submenu2

Title: Re: Rasm Z80 assembler [update 2017.03.28] Release Candidate!
Post by: roudoudou on 12:15, 30 March 17

error......  jr nz,vbl
yep, i have to fix the LZ48 dynamic block since i made a lot of modifications with labels  ;)




error...
Code: [Select]
write direct #C4



Error in the code (that was a wrong example), the correct syntax is describe in manual or winape directive page -> write direct -1,-1,#C4



Title: Re: Rasm Z80 assembler [update 2017.03.28] Release Candidate!
Post by: cpcuser on 13:12, 30 March 17

What are these bad examples?
Can not offer functional?


greeting
Title: Re: Rasm Z80 assembler [update 2017.03.28] Release Candidate!
Post by: roudoudou on 14:02, 30 March 17
What are these bad examples?
Can not offer functional?


greeting


i will remove them. Did you test on your sources?
Title: Re: Rasm Z80 assembler [update 2017.03.28] Release Candidate!
Post by: roudoudou on 09:07, 31 March 17
updated first post with v0.48
- bugfix of label calculations when placed after a LZ48/LZ49 block (there is a buf left with more than one LZ section in the same ORG)
- directives SWITCH/CASE/DEFAULT/ENDSWITCH added
Title: Re: Rasm Z80 assembler [update 2017.04.03]
Post by: roudoudou on 17:12, 03 April 17
update 2017.04.03 - v0.49
- bugfix multiple LZ48/LZ49 block in the same ORG zone

updated first post with new .zip


EDIT: i forgot to mentionned PRINT enhancement, it's now possible to format numeric ouput



MyVar=5*70


PRINT 'MyVar=',{INT}MyVar,' pouet pouet'

Avalaible tags: HEX, HEX2, HEX4, HEX8, BIN, BIN8, BIN16, BIN32, INT
Title: Re: Rasm Z80 assembler [update 2017.04.11]
Post by: roudoudou on 10:39, 11 April 17
update 2017.04.11 - v0.50
- bugfix ORG <adress>,$

- you may use unix relative paths using Windows so there is nothing to change when switching between both OS


updated first post with new release





Title: Re: Rasm Z80 assembler [update 2017.04.18]
Post by: roudoudou on 10:49, 19 April 17

quick update v0.51
- bugfix ORG analysis for cartridge generation
- bugfix LIMIT
- bugfix with local labels not found in imbricated macros


still working on exomizer integrated compression
Title: Re: Rasm Z80 assembler [update 2017.04.18]
Post by: roudoudou on 23:08, 24 April 17
new version in a few days (i cannot generate a windows version until a few days for various reasons...)

critical bug found: ADD (IY+n), SBC (IY+n) ADC (IY+n) CP (iy+n) are encoded like IX version  >:(

Golem report me that literal values syntax was not checked: LD A,5CCF (if you forget the : separator) won't warn but the CCF will be omit at the assembly. I fix this and add error messages.


There was no check for duplicate name between labels and variables, now it's ok

I was afraid to lose some speed so i add the same tree search for variables to speed up again the assembling (+20% faster)

See you soon

Title: Re: Rasm Z80 assembler [update 2017.04.26]
Post by: roudoudou on 08:53, 26 April 17
updated first post with executable of v052


documentation need a strong update now! Soon... :)
Title: Re: Rasm Z80 assembler v0.52 [update 2017.04.26]
Post by: Sykobee (Briggsy) on 17:23, 02 May 17
I look forward one day (hopefully) to use this and its cartridge features!


One day...
Title: Re: Rasm Z80 assembler v0.52 [update 2017.04.26]
Post by: roudoudou on 23:29, 04 May 17
v0.53
- bugfix CHARSET <start>,<end>,<index>
- bugfix duplicate name check for alias
- new directives INCLZ4, INCZX7 to include and crunch a file with LZ4 or LZX7
- new directives LZX7, LZ4 to open a code section that will be crunched after assembly


Manuals and executables updated in the first post
Title: Re: Rasm Z80 assembler v0.55 [update 2017.05.21]
Post by: roudoudou on 18:21, 21 May 17
updated first post 2017.05.21 - v0.55

- bugfix local label internal building

- new directive INCEXO to include and crunch a file with Exomizer 2 (it's not faster than the original cruncher...)
- new directive LZEXO to open a code section that will be crunched after assembly
- documentation updated (now with quick access in the summary)
- licenses of third parties softwares are included in the windows executable and their respective source files
Title: Re: Rasm Z80 assembler v0.56 [update 2017.05.28]
Post by: roudoudou on 10:22, 28 May 17

updated first post 2017.05.28 - v0.56


- bugfix contiguous ORG check
- bugfix when a macro is opened for declaration and never closed
- added while/wend check in pre-processing
- now you can call a macro with a local value using prefix tag {eval} (will be documented)
Title: Re: Rasm Z80 assembler v0.57 [update 2017.07.20]
Post by: roudoudou on 10:58, 20 July 17
updated first post 2017.07.20 - v0.57

- more flexible preprocessor with macro parameters
- new label prefix tag {BANK} to get the bank where is located a label

documentation update in a few days
Title: Re: Rasm Z80 assembler v0.57 [update 2017.07.20]
Post by: roudoudou on 22:24, 20 July 17
doc updated  8)
Title: Re: Rasm Z80 assembler v0.52 [update 2017.04.26]
Post by: roudoudou on 15:15, 22 July 17
I look forward one day (hopefully) to use this and its cartridge features!

One day...


1 minute test  ;D



Title: Re: Rasm Z80 assembler v0.58 [update 2017.08.02]
Post by: roudoudou on 10:22, 02 August 17
update 2017.08.02 - v0.58

- fixed INC SP encoding (was DEC SP opcode :picard:  )



:doh: :doh: :doh:
Title: Re: Rasm Z80 assembler v0.60 [update 2017.09.15]
Post by: roudoudou on 09:00, 15 September 17
minor update 2017.09.15


some improvements in the documentation (that nobody reads anyway since everyone asks me obvious and documented questions.  :P :P :P [size=78%] [/size][/size][size=78%])[/size]



Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: roudoudou on 10:19, 10 October 17
updated first post 2017.10.10 - v0.61

- bugfix var memory leak with data flow
- bugfix preprocessing with data flow not using string endchar
- bugfix var export

- new directive ASSERT
Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: roudoudou on 11:47, 24 November 17



Hey, some news!


Originally Rasm was designed for the release of CRTC³ (cartridge mode, banking, ...)


As i plan to release a few things on CPC i will extend Rasm banking management to make snapshots (up to 576K)


Will it be usefull to allow user to set (a few) snapshot settings? (CRTC, registers?)


Not in my opinion as i'm used to do all initialisations with cartridge but...


Let me know :)

Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: GUNHED on 14:55, 25 November 17
First of all: Thanks for the great work (both prods). It's good to see that this nice ASM project goes on.
Second, personally I don't care about Snapshot stuff and so on, as long as it runs on the native CPC / Plus machines.  :)  But maybe it can help some guys during development of their stuff.
Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: roudoudou on 17:16, 30 November 17
As suggested to me by a few people:


- incbin will handle negative size (to include size-value binary file)
- nocode behaviour will change
- snapshot will include SYMB chunk (supported by ACE emulator) on demand


SYMB chunk in snapshot:
1 byte : symbol name size

n byte(s) : symbol name (without 0 terminator as we know the size)
6 bytes : reserved
2 bytes : with a shitty big endian adress for the symbol

this struct repeated until the chunk size is reached
Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: CloudStrife on 02:29, 02 December 17
2 bytes : with a shitty big endianusing the only logical endianness adress for the symbol

:)
Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: pelrun on 09:29, 02 December 17
Everything looks awesome, except... instead of '&','$' or '0x', it only supports '#' for hex values!? What?  :picard2:

Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: roudoudou on 11:35, 02 December 17
Everything looks awesome, except... instead of '&','$' or '0x', it only supports '#' for hex values!? What?  :picard2:


$ is used since 30 years by (almost?) all Z80 assemblers for current assembling adress.


What assembler do you use?  :o


I may support 0x for hexa but if you want C style hex value you may admit the & stand for AND a nothing else. Be coherent  ;D
Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: pelrun on 14:17, 02 December 17
Yes, $ *by itself* is the current address. And & *by itself* is 'AND'. As prefixes for numbers they are distinct, and can be readily parsed as such.


But I see you've rolled your own lexer and parser, so I suppose you can be given a little slack for not being able to support everything. But it's still a sour note for me.
Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: roudoudou on 15:00, 02 December 17
Yes, $ *by itself* is the current address. And & *by itself* is 'AND'. As prefixes for numbers they are distinct, and can be readily parsed as such.


But I see you've rolled your own lexer and parser, so I suppose you can be given a little slack for not being able to support everything. But it's still a sour note for me.


'0x' prefix for hex value will be available in the next release, so the syntax will be completely consistent. that was not a big deal to add this but i wont add '&' prefix for the same reason.





Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: pelrun on 15:44, 02 December 17
I don't actually care about '0x', I just included it for completeness. I don't like # at all, it's weird and rasm specific, but then it's not my assembler or my choice to make.
Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: roudoudou on 16:26, 02 December 17

That's absolutely not specific to Rasm

# is prefix for hexa in MAXAM and DAMS syntax since 1985  ;D

Those who do not integrate this syntax are curious

Both MAXAM and DAMS are Amstrad CPC assemblers

Rasm was designed as a cool transition from old assemblers. That's why there is also a maxam compatibility flags for very old sources with wrong operator priority everywhere

Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: pelrun on 17:42, 02 December 17
You might want to look at MAXAM again, all the code I can find, including IN THE MANUALS uses &.

DAMS, I have no knowledge of.


In any case, this is completely moot. I voiced my opinion, you said you won't change it, there's nothing left to discuss.
Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: roudoudou on 18:24, 02 December 17
You might want to look at MAXAM again, all the code I can find, including IN THE MANUALS uses &.

DAMS, I have no knowledge of.


In any case, this is completely moot. I voiced my opinion, you said you won't change it, there's nothing left to discuss.


Page 142 of MAXAM manual -> Hexadecimal numbers by "&" or "#"

So that not weird to choose '#' for hex values, that's clever to support the common hex syntax of the two oldest and widely used Z80 assemblers  :P
Title: Re: Rasm Z80 assembler v0.61 [update 2017.10.10]
Post by: Sykobee (Briggsy) on 00:00, 03 December 17
I remember '&' being the standard hex prefix back in the day, far more than #. I'd have to double check.
This may be a UK/not-UK thing.


Supporting 0x is pretty nice IMO, as rasm is modern.
Title: Re: Rasm Z80 assembler v0.63 [update 2017.12.03]
Post by: roudoudou on 15:06, 03 December 17
First post updated with binary and documentation

update 2017.12.03 - v0.63

- snapshot generation (with SYMB chunk support for ACE)
- new directive BANKSET to work with 4 consecutives pages (only in snapshot mode)
- MEND alias for ENDM (and vice versa)
- Added '0x' prefix for hexadecimal values
- Cartridge generation is supposed to work with Rasm on big-endian CPU (like PowerPC)
- INCBIN directive support negative value for "size to read" in order to read a size relative to fullsize
- BANK directive may be used without parameter to open a new memory space
- bugfix UNTIL condition test

Documentation lightly updated

On v0.64 i will upgrade snapshot management and documentation to detail the workflow

Sykobee: In France there was a wellknown magazine (Amstrad 100%) with assembly initiation using DAMS so i guess that's why many french guys are used to # prefix. The logon system had a section for them where they release DAMS sources also.
Title: Re: Rasm Z80 assembler v0.64 [update 2017.12.05]
Post by: roudoudou on 09:23, 05 December 17
first post updated with v0.64

(mostly snapshot related evolutions and fix)

- bugfix SYMB chunk size
- added optionnal var export in snapshot SYMB chunk
- improve bankset switch control (do not mix bank & bankset of the same pages)
- INCBIN handle negative offset to seek relative to the end of file
- INCBIN special option to disable overwrite control
- Documentation updated
Title: Re: Rasm Z80 assembler v0.64 [update 2017.12.05]
Post by: GUNHED on 14:08, 06 December 17
first post updated with v0.64


Can't wait for v1.28  :P  Thank's for the update, I will post in other-language forums!  :)
Title: Re: Rasm Z80 assembler v0.64 [update 2017.12.05]
Post by: roudoudou on 14:45, 13 December 17
v0.65 is coming (need moar testing)


- new prefix {PAGE} for labels, in order to retrieve gate array banking value (useful in snapshot mode) #C0,#C4,#C5,...


Maybe it can be interresting to have a {PAGESET} prefix when banking 64K? #C2,#CA,#D2,...


- SAVE may be used to save file in a (new) DSK. I have to work on a update mode


SAVE"filename",begin,size ; raw export
SAVE"filename",begin,size,AMSDOS ; export with amsdos header
SAVE"filename",begin,size,DSK,"dskname" ; create a dsk and save filename on it
SAVE"filename",begin,size,DSK,"dskname",B ; side B select to save filename
SAVE"filename",begin,size,DSK ; save filename on last deckared DSK and last side used (rasm can handle as many DSK as you want in the same time)

SAVE"filename",begin,size,DSK,A ; current DSK, back to side A
- "checkmode" option to assemble without writing file(s)

- moar comprehensive error message when using illegal register combination


- moar compact splash screen


Need to update documentation too




Title: Re: Rasm Z80 assembler v0.65 [update 2017.12.19]
Post by: roudoudou on 09:40, 20 December 17
Update v0.65


- snapshot is initialised with standard CRTC values, all audio channels OFF, all inks to deep blue except ink 1 to bright yellow
- new directives SETCRTC and SETCPC to select the CRTC and CPC model with snapshots

- new tag {PAGE} before a label to get the gate array banking value for the bank of a label (ex: #C4 for a label in bank 4)
- new tag {PAGESET} before a label to get the gate array banking value for the bankset of a label (ex: #C2 for a label in bankset 1 or bank 4,5,6,7)
- new variable ASSEMBLER_RASM (set to 1) in order to have specific rasm code

- SAVE may be used to save file in a (new) DSK. I have to work on a update mode
- "checkmode" option to assemble without writing file(s)
- moar comprehensive error message when using illegal register combination
- moar compact splash screen
- documentation updated
Title: Re: Rasm Z80 assembler v0.65 [update 2017.12.19]
Post by: roudoudou on 10:12, 21 December 17
updated first post with v0.66


- new directives IFDEF, IFNDEF to test label, variable or alias existence

Title: Re: Rasm Z80 assembler v0.65 [update 2017.12.19]
Post by: Golem13 on 14:53, 21 December 17
Always at the top.

Thank you Roudoudou.
Title: Re: Rasm Z80 assembler v0.65 [update 2017.12.19]
Post by: roudoudou on 10:32, 22 December 17
updated first post 2017.12.21 - v0.67
- bugfix buffer overflow with long filenames for export
- export breakpoint in snapshot (unofficial Winape chunk)

- new directive BREAKPOINT

Labels begining with BRK or @BRK for local labels will be exported as breakpoints in the snapshots

Code: [Select]
buildsna
bankset 0
run 0


nop
breakpoint
ld hl,#1234
breakpoint
ld hl,#1234
repeat 2
nop
@brktest
ld hl,#1234
nop
rend
brknext
ld hl,#1234
nop
Title: Re: Rasm Z80 assembler v0.65 [update 2017.12.19]
Post by: CloudStrife on 12:55, 22 December 17
(at least in ACE it's official :))
Title: Re: Rasm Z80 assembler v0.65 [update 2017.12.19]
Post by: roudoudou on 12:14, 26 December 17
(at least in ACE it's official :) )

It's a great news because we will have at least 3 emulators with snapshot breakpoint support as Lone annonced next release of Sugarbox will do.

Kevin? You know what to do  ;D
Title: Re: Rasm Z80 assembler v0.65 [update 2017.12.19]
Post by: CloudStrife on 15:56, 26 December 17
(at least in ACE it's official :) )

Need to specify: by the chunk descripted here:
http://www.cpcwiki.eu/index.php/Snapshot#BRKC_Chunk_.28ACE.29
(not the same as WinAPE and more evolved)
Title: Re: Rasm Z80 assembler v0.65 [update 2017.12.19]
Post by: roudoudou on 16:10, 26 December 17
Need to specify: by the chunk descripted here:
http://www.cpcwiki.eu/index.php/Snapshot#BRKC_Chunk_.28ACE.29 (http://www.cpcwiki.eu/index.php/Snapshot#BRKC_Chunk_.28ACE.29)
(not the same as WinAPE and more evolved)

ok, not the same
will add the support for this one, thanks!
Title: Re: Rasm Z80 assembler v0.67 [update 2017.12.22]
Post by: Lone on 12:22, 30 January 18
Hello,


I found (with the help of CPPCheck, that run on the wrong folder  ;D ) some potential bugs in RASM (version 0.67) :


- rasm_v067.c line 1589 : Message: Returning/dereferencing 'subchunk' after it is deallocated / released
- rasm_v067.c line 1594 : Common realloc mistake: 'subchunk' nulled but not freed upon failure
- rasm_v067.c line 3308 : Memory leak: data
- rasm_v067.c line 6782, 6783, 6807, 6831 : Uninitialized variable: mypc


By the way, any plan for a new release soon ?





Title: Re: Rasm Z80 assembler v0.67 [update 2017.12.22]
Post by: roudoudou on 15:01, 30 January 18
Thanks! I will take a look
I fix some (minor) bugs this month so...
Maybe a release soon
Title: Re: Rasm Z80 assembler v0.68 [update 2018.02.07]
Post by: roudoudou on 09:07, 07 February 18
New release, nothing really significant for users, except...

...Rasm does not warn anymore if there is an include of a missing file in a disabled code section

I finally manage to handle the case without loss of speed nor heavy modifications
Title: Re: Rasm Z80 assembler v0.68 [update 2018.02.07]
Post by: Targhan on 12:10, 07 February 18
Yeeeeeess! :).
Title: Re: Rasm Z80 assembler v0.68 [update 2018.02.07]
Post by: roudoudou on 22:23, 07 February 18
documentation lightly updated (there is a glitch in the english index table, don't know how to remove it but it's still usable)
Title: Re: Rasm Z80 assembler v0.69 [update 2018.02.15]
Post by: roudoudou on 14:14, 15 February 18
Valentine's release v0.69
- added $ prefix for hex values
- added 0b prefix for binary values
- added shifting operators << and >>
- EDSK update/generation improvements (make backups before use!)
Title: Re: Rasm Z80 assembler v0.69 [update 2018.02.15]
Post by: GUNHED on 16:41, 15 February 18
Thanks for the update! Yay!  :) :) :)  Just un idea, if future can you rename "manual" to "RASM_manual" or similar, after a while it's confusing to have multiple "manual" files in disc.  :)
Title: Re: Rasm Z80 assembler v0.69 [update 2018.02.15]
Post by: roudoudou on 17:14, 15 February 18
Thanks for the update! Yay!  :) :) :)  Just un idea, if future can you rename "manual" to "RASM_manual" or similar, after a while it's confusing to have multiple "manual" files in disc.  :)
Sure
Will do it for next release
Title: Re: Rasm Z80 assembler v0.69 [update 2018.02.15]
Post by: Ast on 22:32, 15 February 18
Valentine's release v0.69
- added $ prefix for hex values
- added 0xb prefix for binary values
- added shifting operators << and >>
- EDSK update/generation improvements (make backups before use!)
Ah ah ah! Petit coquinou !
What a strange version name (0.69) for valentine ´s day !
What a joker you are!
MacDeath will be happy about that 😋
Title: Re: Rasm Z80 assembler v0.69 [update 2018.02.21]
Post by: roudoudou on 12:09, 21 February 18
a quick update cause of shifting operator >> did not work...
now shrinkler sources can compile
Title: Re: Rasm Z80 assembler v0.71 [update 2018.02.23]
Post by: roudoudou on 10:39, 23 February 18
update v071
- math functions HI & LO to get high 8 bits or low 8 bits of a pseudo 16 bits value
- @ prefix for octal values
- AS80 assembler compatibility mode* (enough to compile CNG player with the same wrong calculations  :P )








short doc
 
Quote
-ass   AS80 behaviour mimic
  • all calculations are done with 32 bits integer values and wrong rounding
  • macro parameters are not protected with {} anymore
  • multiple declarations with DEFB,DEFW,DEFI got reference adress of the first outputed byte. That's why with AS80, using multiple DEFB produces a different result than using DEFB with multiple values
  • MACRO declaration directive must be used after the macro name
Title: Re: Rasm Z80 assembler v0.71 [update 2018.02.23]
Post by: GUNHED on 16:35, 23 February 18
Cool! Thanks!

Title: Re: Rasm Z80 assembler v0.72 [update 2018.02.26]
Post by: roudoudou on 22:04, 26 February 18
update v0.72
- ability to generate snapshot v2 (useful with M4Wifi)

short doc

Code: [Select]
BUILDSNA V2
Title: Re: Rasm Z80 assembler v0.72 [update 2018.02.26]
Post by: Bill on 05:14, 27 February 18
Hi,

Now I feel dumb, I can not get the program to run. I just see the command prompt window to open in a fraction of a second, not able to read what it says, and that's it.


Bill
Title: Re: Rasm Z80 assembler v0.72 [update 2018.02.26]
Post by: roudoudou on 09:01, 27 February 18
Hi,

Now I feel dumb, I can not get the program to run. I just see the command prompt window to open in a fraction of a second, not able to read what it says, and that's it.


Bill
It is a command line tool.
Open a terminal and run
Title: Re: Rasm Z80 assembler v0.73 [update 2018.02.28]
Post by: roudoudou on 14:01, 28 February 18
update v0.73
- bugfix in snapshot when using distinct banks instead of gathering them with bankset directive
Title: Re: Rasm Z80 assembler v0.74 [update 2018.03.18]
Post by: roudoudou on 10:27, 18 March 18
quick update v0.74
- usage of snapshot directives forces snapshot output
- try to load .asm or .Z80 file if filename given is not found and has no extension
- BREAKPOINT directive may have an additional parameter to set break adress anywhere
- declaring two MACRO with the same name will trigger an error
- bugfix regression of -m option handling
- each REPEAT or WHILE loop export a REPEAT_COUNTER or WHILE_COUNTER variable, locally
Title: Re: Rasm Z80 assembler v0.75 [update 2018.03.29]
Post by: roudoudou on 10:10, 29 March 18
update v0.75
- newer and faster expression calculator without limitations of comparisons
- % may be used as modulo (still used for binary values)
- Intel hexa & binary style support
- Binary prefix 0b fixed
- does not export IX and IY anymore in symbol files
- better error messages when calculating expressions
- boolean operators && and ||
- PUSH & POP may have more than one register in parameters
- NOP may be multiplied specifying a number of repetition in parameter
- alias <> for != comparison operator
- filenames are forced to upper case when saved to EDSK
- Infinite loop detection won't go to infinite loop anymore ^_^

As the solver is very different from the previous version, i keep the 0.74 version available, in case of regression

Now i have to work on the documentation, again  ;D
Title: Re: Rasm Z80 assembler v0.75 [update 2018.03.29]
Post by: GUNHED on 14:27, 29 March 18
Another big update! Thank you!


It's great to have a French manual (mother tongue is always the best). But please also update the English manual if needed (still shows 0.72, not 0.75, but maybe it need no update - I have to find out :-))


Keep the great work going!!!  :) :) :)
Title: Re: Rasm Z80 assembler v0.75 [update 2018.03.29]
Post by: roudoudou on 14:39, 29 March 18
I have to work on english version too before updating here ;)
Title: Re: Rasm Z80 assembler v0.75 [update 2018.03.29]
Post by: GUNHED on 17:13, 29 March 18
Yeah, I know, and making docs and manuals is just no fun.  :P  But if you come to an end (or close to an end) I would like to make a translation to German language for you.  :)  Just let me know when "final" stage is in sight  :)
Title: Re: Rasm Z80 assembler v0.76 [update 2018.03.29]
Post by: roudoudou on 22:22, 29 March 18
update v0.76
- fix solver when using % prefixed binary values close to comparison operator or parenthesis

Both FR & EN doc updated  8)
Title: Re: Rasm Z80 assembler v0.77 [update 2018.03.30]
Post by: roudoudou on 22:59, 30 March 18
quick update for maxam compatibility mode users
update v0.77

- even faster expression calculation
- maxam & AS80 comparison operators are back
Title: Re: Rasm Z80 assembler v0.78 [update 2018.04.04]
Post by: roudoudou on 14:08, 04 April 18
ultra-light but requested update v0.78
- DEFS can handle multiple repetition schemas
- alias DM & DEFM for DEFB

Title: Re: Rasm Z80 assembler v0.79 [update 2018.04.04]
Post by: roudoudou on 00:09, 05 April 18
update v0.79
- != operator is back with new solver  :doh:
Title: Re: Rasm Z80 assembler v0.80 [update 2018.04.05]
Post by: roudoudou on 10:28, 05 April 18
update v0.80

- bugfix operator > and >=
- bugfix Maxam priorities

Title: Re: Rasm Z80 assembler v0.80 [update 2018.04.05]
Post by: roudoudou on 14:53, 05 April 18

update v0.81
- added special maxam priorities for parenthesis and boolean operators




The priority management in maxam compatibility mode is less trivial than it seems to be  >:(
Title: Re: Rasm Z80 assembler v0.80 [update 2018.04.05]
Post by: Golem13 on 21:56, 05 April 18
Fixes are validated coz 0.81 is working fine for me. 8)
Thanks Roudoudou  :-*
Title: Re: Rasm Z80 assembler v0.81 [update 2018.04.05]
Post by: GUNHED on 15:32, 06 April 18
Yes, 81 seems to be a good number. Everything stable and well here too.  :)
Title: Re: Rasm Z80 assembler v0.81 [update 2018.04.05]
Post by: roudoudou on 17:48, 06 April 18
Yes, 81 seems to be a good number. Everything stable and well here too.  :)
I have another version pending  ;D
With 'while 0 bugfix' but nothing really important
Title: Re: Rasm Z80 assembler v0.82 [update 2018.04.09]
Post by: roudoudou on 15:38, 09 April 18
Due to my system upgrade (a 6 years old ubuntu LTS to the new Lubuntu beta LTS) i remove many compilation warnings. CLang compilation takes ages but the performance of the executable is noticable (30% faster)

- I added also SL1 alias for SLL
- better infinite loop detection (i mean, safer)
- bugfix while 0 loop (check and disable block)
- repeat until internal counter harmonisation (now they are all starting from value 1)
Title: Re: Rasm Z80 assembler v0.83 [update 2018.04.11]
Post by: roudoudou on 21:28, 11 April 18
update v0.83
- NOCODE output must increment current adress in all cases
- new directives DR & DEFR to define REAL values (Amstrad firmware compatible)

Example:
Code: [Select]
org #8000
call #BBBA ; GRA initialize

ld a,1
call #BC0E ; mode 1
ld a,1
call #BD97 ; deg

ld de,320
ld hl,200
call #BBC9 ; origin 320,200

ld de,180
ld hl,0
call #BBC0 ; move 180,0



ld b,0

circle_trace
    push bc
    ld hl,angle
    ld de,incre
    call #BD7C ; angle=angle+incre

    ld de,angle
    ld hl,tmp
    call #BD61 ; tmp=angle
    call #BDAF ; tmp=cosinus(tmp)
    ld de,rayon
    call #BD85 ; tmp=tmp*rayon
    call #BD6A ; HL=int(tmp)
    call m,fixsign
    push hl

    ld de,angle
    ld hl,tmp
    call #BD61 ; tmp=angle
    call #BDAC ; tmp=sinus(tmp)
    ld de,rayon
    call #BD85 ; tmp=tmp*rayon
    call #BD6A ; HL=int(tmp)
    call m,fixsign
    pop de

    call #BBF6 ; LINE DE,HL

    pop bc
    djnz circle_trace
ret

fixsign
    ld de,0
    ex hl,de
    or a
    sbc hl,de
    ret
   

rayon   defr     180
angle   defr       0
incre   defr 360/256
tmp        defr       0

Title: Re: Rasm Z80 assembler v0.83 [update 2018.04.11]
Post by: Targhan on 10:48, 12 April 18
I just learned (at the Revision, from Offset) that Basic has an integer division, with the symbol \ (or ç on French keyboard). I already reported you that the "accurate" division was a bit problematic in some cases. Do you think something similar could be implemented?
Title: Re: Rasm Z80 assembler v0.83 [update 2018.04.11]
Post by: roudoudou on 12:56, 12 April 18
I just learned (at the Revision, from Offset) that Basic has an integer division, with the symbol \ (or ç on French keyboard). I already reported you that the "accurate" division was a bit problematic in some cases. Do you think something similar could be implemented?
Using INT() must solve the case
Title: Re: Rasm Z80 assembler v0.83 [update 2018.04.11]
Post by: roudoudou on 14:04, 12 April 18
You may be interrested also by the floor() function, the result is again different in another way


Example:



Code: [Select]

a=10
b=2
repeat 10
print a,"/",b," normal=",a/b," int()=",int(a/b)," floor()=",floor(a/b)
b=b+1
rend


Will produce


Code: [Select]
10.00 / 2.00  normal= 5.00  int()= 5.00  floor()= 5.00
10.00 / 3.00  normal= 3.33  int()= 3.00  floor()= 3.00
10.00 / 4.00  normal= 2.50  int()= 3.00  floor()= 2.00
10.00 / 5.00  normal= 2.00  int()= 2.00  floor()= 2.00
10.00 / 6.00  normal= 1.67  int()= 2.00  floor()= 1.00
10.00 / 7.00  normal= 1.43  int()= 1.00  floor()= 1.00
10.00 / 8.00  normal= 1.25  int()= 1.00  floor()= 1.00
10.00 / 9.00  normal= 1.11  int()= 1.00  floor()= 1.00
10.00 / 10.00  normal= 1.00  int()= 1.00  floor()= 1.00
10.00 / 11.00  normal= 0.91  int()= 1.00  floor()= 0.00

Title: Re: Rasm Z80 assembler v0.83 [update 2018.04.11]
Post by: Targhan on 14:50, 12 April 18
Interesting. But for my use case, I think the shift (>>) will be more explicit, in fact!
Title: Re: Rasm Z80 assembler v0.84 [update 2018.04.18]
Post by: roudoudou on 12:22, 18 April 18
update v0.84
- new directives STRUCT and ENDSTRUCT, ENDS to create structures
- fix regression introduced with v0.75 and embedded usage (like Arkos Tracker II does)

Documentation FR updated, EN will follow


Example of structures manipulations

 
Code: [Select]
org #1000

label1

struct st1
ch1 defw 0
ch2 defb 0
endstruct

struct st2
ch1 defb 0
ch2 defw 0
endstruct

label2

assert label1==label2           ; declaring a struct does not change code output
assert st1.ch1<st1              ; declaring a struct is not affected by current output adress
assert st1==st2                 ; size of both structs is equal (NOT recommended vasm syntax)
assert {sizeof}st1=={sizeof}st2 ; explicit size of
assert st1.ch2!=st2.ch2         ; no confusion between struct with identical fields names

struct metast1
struct st1 sub1 ; imbricated structs
struct st2 sub2
endstruct

label3

assert label3==label2 && label3==label1         ; declaring a struct using struct does not change code output
assert metast1.sub1<metast1.sub2                ; check sub-structs are in order
assert metast1.sub1.ch2<metast1.sub2.ch1        ; check sub-structs are not overlapping
assert {sizeof}metast1.sub1=={sizeof}st1        ; can get sizeof in many ways
assert {sizeof}metast1=={sizeof}st1+{sizeof}st2 ; metast1 struct = struct st1+st2
Title: Re: Rasm Z80 assembler v0.84 [update 2018.04.18]
Post by: Golem13 on 12:26, 18 April 18
Ok ok :P ... That's a fact: I am in love :-* :-*
Title: Re: Rasm Z80 assembler v0.85 [update 2018.04.18]
Post by: roudoudou on 23:03, 18 April 18
update v0.85
- fix regressions introduced by STRUCT code modifications
- added some checks and error messages

for the record, one of this regression had 1 chance on a billion to occur. Golem13 project wins the ticket!  :laugh:
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: roudoudou on 15:54, 27 April 18
update v0.86
- fix many bugs in label import
- fix multi-nops
- fix automatic extension for primary source
- fix infinite loop when error on reserved keyword in an expression
- shortcuts LD BC/DE/HL,BC/DE/HL (uz80 style)
- UZ80 compatibility option (for new versions of CNG player)


NEW online documentation FR http://www.roudoudou.com/rasm/rasm_fr.html (http://www.roudoudou.com/rasm/rasm_fr.html)

Still working on online ENglish documentation
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: ervin on 07:38, 01 May 18
I'm really enjoying using RASM - thanks roudoudou!
Just wondering, is there a way to have multiple commands on one line?

For example, instead of:
Code: [Select]
ld a,#33
ld (hl),a
inc l

Is there a way to do something like this?
Code: [Select]
ld a,#33; ld (hl),a; inc l

[EDIT] I think I found the answer.  ;D 

Code: [Select]
ld a,#33:ld (hl),a:inc l

Now THAT is a great feature!
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: roudoudou on 23:19, 05 May 18
I updated the z80.vim in order to highlight rasm directives
http://www.roudoudou.com/rasm/z80.vim

But i'm still stuck with literal values...
Sometimes no color, sometimes half color (hex values...)

Code: [Select]
syn match z80Number "\$[\x]\{1,8}"
syn match z80Number "\$"
syn match z80Number "0x[\x]\{1,8}"
syn match z80Number "0b[01]\{1,32}"
syn match z80Number "#[\x]\{1,8}"
syn match z80Number "%[01]\{1,32}"
syn match z80Number "@[\o]\+"
syn match z80Number "[01]\{1,32}b"
syn match z80Number "[\x]\{1,8}h"
syn match z80Number "[0-9\.]\+"
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: Arnaud on 10:01, 06 May 18
I very nice feature for the C developper could be the possibility to generate a Library compatible SDCC.

Of course i have not idea how difficult could be the task  :P
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: roudoudou on 10:09, 06 May 18
I very nice feature for the C developper could be the possibility to generate a Library compatible SDCC.
Of course i have not idea how difficult could be the task  :P

I guess i have to find the .rel format description?
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: Arnaud on 10:26, 06 May 18
I guess i have to find the .rel format description?

There's a doc about library in SDCC / SDASsembly (sdcc/src/sdas/doc)
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: ervin on 03:09, 11 May 18
Quick question about using ORG...

I've got a bunch of code that refers to a jump table.

A trivial example:

Code: [Select]
ORG #9000

LD HL,jumptable
; do some stuff
RET

jumptable:
defw row1,row2,row3,row4
defw row5,row6,row7,row8

I can't figure out how to put the jump table at a specific memory address.
When I try (by putting ORG #9800, for example), I get all sorts of unexpected behaviour.
When I don't have ORG before the jump table, the program behaves correctly.

Is there a way to put the jump table into a specific memory address?

Thanks.
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: roudoudou on 09:57, 11 May 18
Quick question about using ORG...

I've got a bunch of code that refers to a jump table.

A trivial example:

Code: [Select]
ORG #9000

LD HL,jumptable
; do some stuff
RET

jumptable:
defw row1,row2,row3,row4
defw row5,row6,row7,row8

I can't figure out how to put the jump table at a specific memory address.
When I try (by putting ORG #9800, for example), I get all sorts of unexpected behaviour.
When I don't have ORG before the jump table, the program behaves correctly.

Is there a way to put the jump table into a specific memory address?

Thanks.

Could you be more specific?

Code: [Select]
org #9000

ld hl,jumptable

org #9800

jumptable
defw row1,row2,row3

org #A000
row1 nop
row2 nop
row3 nop

is assembled correctly so i guess the error is elsewhere

Code: [Select]
#21 #00 #98
...many zeroes...
#00 #A0 #01 #A0 #02 #A0

for a total of 4099 bytes

Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: ervin on 10:28, 11 May 18
Could you be more specific?

Code: [Select]
org #9000

ld hl,jumptable

org #9800

jumptable
defw row1,row2,row3

org #A000
row1 nop
row2 nop
row3 nop

is assembled correctly so i guess the error is elsewhere

Code: [Select]
#21 #00 #98
...many zeroes...
#00 #A0 #01 #A0 #02 #A0

for a total of 4099 bytes

The simplified example I gave was just to demonstrate the code structure.

In my program where I'm moving a large sprite around the screen, the sprite is drawn very quickly, when I don't have the ORG before the jumptable.
When I do have the ORG before the jumptable, the program slows down tremendously, although I think it is the screen rendering that is being slowed down instead of the sprite.

Actually maybe the ORG #9800 is clashing with something in my rendering code... I don't think it is, but I'll check it out.
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: ervin on 15:41, 11 May 18
Yes, indeed it was my silly mistake.
I was overwriting other data.

My apologies for the confusion.
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: fgbrain on 11:05, 14 May 18
RASM looks awesome... but it doesnt run in my old PC  (win xp)

it says "rasm.exe is not a valid win32 application"  >:(

sorry perhaps I am old and lame...
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: roudoudou on 11:53, 14 May 18
RASM looks awesome... but it doesnt run in my old PC  (win xp)

it says "rasm.exe is not a valid win32 application"  >:(

sorry perhaps I am old and lame...


I will try to compile a 32 bits version (if i find the correct compiler option)
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: roudoudou on 14:54, 14 May 18
RASM looks awesome... but it doesnt run in my old PC  (win xp)
it says "rasm.exe is not a valid win32 application"  >:(


I added the archive rasm_v086_exewin32.zip (http://www.cpcwiki.eu/forum/programming/rasm-z80-assembler-in-beta/?action=dlattach;attach=25373)in the first post
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: fgbrain on 21:15, 14 May 18
I am sorry to say that this new exe doesn't work as well...

Runs in window and closes immediately!!
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: roudoudou on 21:19, 14 May 18
I am sorry to say that this new exe doesn't work as well...

Runs in window and closes immediately!!
It's a command line tool, so open a terminal to run it

And as Rasm is the fastest assembler ever made, i'm happy to see the windows closes "immediately" even on an old XP machine  ;D
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: Duke on 23:15, 14 May 18
And as Rasm is the fastest assembler ever made, i'm happy to see the windows closes "immediately" even on an old XP machine  ;D
It's lightning fast indeed, big pleasure to use, thanks!
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: roudoudou on 16:57, 18 June 18
Hi

For the time being, Rasm manage local labels inside macro & loops

As indicated by his name, local means local. That kind of label cannot be exported/used outside the macros or the loops

example:
Code: [Select]
repeat 10


add hl,bc


jr c,@verflow


dec hl


@verflowrend
As suggested by Krusty, it could be cool to have another kind of local labels. I think a cool name could be 'proximity labels'

Instead of macro or loops, the scope of operation will be delimited by global labels (default labels are globals)

example:
Code: [Select]
routin1


ld b,5
@proximity


djnz @proximityret

routin2


ld b,5
@proximitydjnz @proximityret

This kind of labels may be used outside the scope, using the previous global label as prefix

Code: [Select]
ld hl,routin1.proximity


ld de,routin2.proximity

The things is local labels and proximity labels will share the '@' prefix, leading (i think) to confusion

I may use the dot '.' prefix for proximity labels, but only in pure Rasm mode (not Maxam compatible) as the dot was a f*cking sh*tty method to declare labels

So i'm not yet decided on the right syntax (but using the dot make sense)






Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: Targhan on 23:52, 18 June 18
Can you fix the return carriages of your code snippets please? I don't understand exactly how this works! Thanks.
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: roudoudou on 09:18, 19 June 18
Can you fix the return carriages of your code snippets please? I don't understand exactly how this works! Thanks.


sorry, always this shitty WYSI(not)WYG editor  >:(
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: krusty_benediction on 09:45, 19 June 18
I think the dot notation makes more sense because:
 - other assemblers I used do that - more importantly, the semantic is not the same; so there is no reason that the symbol to use is the same
@targhan I'm pretty sure sjasmplus has local labels
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: Targhan on 12:59, 19 June 18
The dot makes sense. However... what would be the use of such "proximity" label?


@krusty_benediction yes, SJAsmplus manages local labels.
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: roudoudou on 14:16, 19 June 18
The purpose of proximity labels is to offer an entry point everywhere, without having unicity of labels


You can use a label .loop almost everywhere when you need it (but not directly after another .loop label) :)


BUT, if you need to jump to a proximity label out of the scope, just add the global reference -> routine1.loop, routine2.loop, ...


Anyway, that feature is a feature, there is no obligation to use it.



Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: Targhan on 15:48, 19 June 18
Hmm, I'm note sure I understand, but is the following correct:
MySubCode:
 ld a,5
.loop
 dec a
 jr nz, .loop    --> it will jump one line above.
 ret


MySubCode2:
 ld b,10
.loop
 djnz .loop     --> it will jump one line above, NOT to the MySubCode.loop
 ret


Right?
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: krusty_benediction on 21:26, 19 June 18
yes. This is what I'm doing since years with vasm and asjamsplus
I use normal label as function (i.e. similar to a function in C language) name and local labels as branches inside the function (.i.e. similar to a label in C language)

Hmm, I'm note sure I understand, but is the following correct:
MySubCode:
 ld a,5
.loop
 dec a
 jr nz, .loop    --> it will jump one line above.
 ret


MySubCode2:
 ld b,10
.loop
 djnz .loop     --> it will jump one line above, NOT to the MySubCode.loop
 ret


Right?
Title: Re: Rasm Z80 assembler v0.86 [update 2018.04.27]
Post by: Targhan on 22:46, 19 June 18
Not a bad idea indeed!
Title: Re: Rasm Z80 assembler v0.87 [update 2018.06.24]
Post by: roudoudou on 10:37, 24 June 18
huge update, documentation is not finished yet (and the english version is still 10 versions late...)
update v0.87
- new proximity labels
- rasm is able to use variables inside label names
- INCBIN directive enhanced for WAV import as a CPC sample or DMA list
- REPEAT directive may export internal counter to a variable
- new directive IFUSED & IFNUSED
- new math operator ! for NOT
- new math function PSGVALUE
- rasm return 1 to shell when there is error(s)
- new options to export dependencies (makefile style)
- new option to define variable(s) from command line
- new option for extended error messages
- bugfix cases during preprocessing
- bugfix tags PAGE & PAGESET
- new autotests embedded in Rasm in order to reduce regressions

Title: Re: Rasm Z80 assembler v0.87 [update 2018.06.24]
Post by: GUNHED on 21:42, 24 June 18
(and the english version is still 10 versions late...)


Please catch up, before you forget everything  ;)   :) :) :)
Title: Re: Rasm Z80 assembler v0.89 [update 2018.06.26]
Post by: roudoudou on 14:20, 26 June 18
update v0.89, many bugfixes due to recent evolutions
- bugfix dependencies export
- bugfix in preprocessor
- simplify path of dependencies when possible
- enhanced ASSERT may PRINT additional parameters
Title: Re: Rasm Z80 assembler v0.90 [update 2018.06.27]
Post by: roudoudou on 23:21, 27 June 18
update v0.90
- PROTECT directive does not increase automatic binary size anymore
- bugfix memory leak with proximity labels
- proximity label properties also for alias EQU
- label declaration may use formula (with tags), but only declaration for the moment

still working on doc. French doc partially updated and onlineEnglish online documentation done at 75%
Title: Re: Rasm Z80 assembler v0.90 [update 2018.06.27]
Post by: roudoudou on 10:46, 28 June 18
doc updated :)
Quote
Documentation FR http://www.roudoudou.com/rasm/rasm_fr.html (http://www.roudoudou.com/rasm/rasm_fr.html)
Documentation EN http://www.roudoudou.com/rasm/rasm_en.html (http://www.roudoudou.com/rasm/rasm_en.html)
Title: Re: Rasm Z80 assembler v0.90 [update 2018.06.27]
Post by: GUNHED on 11:27, 28 June 18
Actually for EN this link works:
http://www.roudoudou.com/rasm/rasm_en.html
Title: Re: Rasm Z80 assembler v0.90 [update 2018.06.27]
Post by: roudoudou on 11:51, 28 June 18
Actually for EN this link works:
http://www.roudoudou.com/rasm/rasm_en.html (http://www.roudoudou.com/rasm/rasm_en.html)
Thanks! Again this shitty editor  :'( I fixed my postS

 
Title: Re: Rasm Z80 assembler v0.90 [update 2018.06.27]
Post by: HAL 6128 on 20:36, 07 July 18

@roudoudou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1714) :
RASM says during assembling that after e.g.
Code: [Select]
LD BC,#FF63 and an
Code: [Select]
OUT (C),A it is truncating the value #FF63 to #63. Does it really truncate it?
Title: Re: Rasm Z80 assembler v0.90 [update 2018.06.27]
Post by: roudoudou on 20:39, 07 July 18
@roudoudou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1714) :
RASM says during assembling that after e.g.
Code: [Select]
LD BC,#FF63 and an
Code: [Select]
OUT (C),A it is truncating the value #FF63 to #63. Does it really truncate it?
Quote
sorry i cannot reproduce what you say with ld bc,#FF63 and out (c),a
Quote
must be another line
Quote
have you some DB/DEFB around?

Title: Re: Rasm Z80 assembler v0.90 [update 2018.06.27]
Post by: HAL 6128 on 21:34, 07 July 18

Hmm, sorry. I found the error I made.
I've defined a variable:
Code: [Select]
VALUE EQU #FF63

LD A,0
LD BC,#FF63
OUT (VALUE),A
I had forgot to rewrite the out command.
Title: Re: Rasm Z80 assembler v0.91 [update 2018.07.10]
Post by: roudoudou on 21:08, 10 July 18
update v0.91
- bugfix school case with crunched block
- bugfix proximity labels when using loops or macros
- bugfix imbricated IFUSED/IFNUSED
- new directive FAIL will print a message before exiting with an error flag
- label usage may use formula
- escaped codes support in strings (disregarding the current charset)
- PRINT directive may compute formula in strings when using curly brackets
- RUN directive may set the gate array configuration for snapshots
- generated label with negative index will trigger an error
- overriding an alias with a variable will trigger an error
- overriding a variable with an alias will trigger an error
- missing ENDIF at the end of the source will trigger an error
Title: Re: Rasm Z80 assembler v0.91 [update 2018.07.10]
Post by: Ast on 22:00, 10 July 18
Rasm forever ! May the french soccer team win tonight !
Title: Re: Rasm Z80 assembler v0.92 [update 2018.07.10]
Post by: roudoudou on 22:53, 10 July 18
Did not see the match, i was busy fixing PAGE tag -> v0.92 update  ;D
Title: Re: Rasm Z80 assembler v0.92 [update 2018.07.10]
Post by: GUNHED on 00:23, 11 July 18
Hi!

In RASM there is this code example:

ld (iy+1),PDATE
ld (iy+2),PDATE>>8

PDATE equ 1234

How would this be written in Maxam (I need this for quick testing)
Title: Re: Rasm Z80 assembler v0.92 [update 2018.07.10]
Post by: roudoudou on 00:31, 11 July 18
replace >>8 by /256

Note: In rasm mode /256 will round upper, in maxam mode this will truncate and may lead to another result
Title: Re: Rasm Z80 assembler v0.92 [update 2018.07.10]
Post by: GUNHED on 02:27, 11 July 18
Thanks, I thought about /256. Maxam does it like RASM. But...

ld (iy),variable_of_16_bit

What does it do in RASM? Does it only write the lower 8 bits? Maxam produces an error.

Sorry for bugging, but in the example before, it would write the hi-byte first, and then the low-byte. Shouldn't it the other way around?

RASM is really full of new features, lot's of stuff to learn ;-)
Title: Re: Rasm Z80 assembler v0.92 [update 2018.07.10]
Post by: roudoudou on 08:30, 11 July 18
Thanks, I thought about /256. Maxam does it like RASM. But...

ld (iy),variable_of_16_bit

What does it do in RASM? Does it only write the lower 8 bits? Maxam produces an error.

Sorry for bugging, but in the example before, it would write the hi-byte first, and then the low-byte. Shouldn't it the other way around?

RASM is really full of new features, lot's of stuff to learn ;-)
with rasm you can do
Code: [Select]
ld (iy+0),lo(variable_of_16_bit)
ld (iy+1),hi(variable_of_16_bit)
or
Code: [Select]
ld (iy+0),variable_of_16_bit&#FF
ld (iy+1),variable_of_16_bit>>8
there is no other shortcut but you can also do a macro :)
Code: [Select]
macro LDIY16 valuetoput
ld (iy+0),lo({valuetoput})
ld (iy+1),hi({valuetoput})
endm
Title: Re: Rasm Z80 assembler v0.92 [update 2018.07.10]
Post by: GUNHED on 14:47, 11 July 18
Cool! Thanks!

Title: Re: Rasm Z80 assembler v0.93 [update 2018.07.14]
Post by: roudoudou on 17:01, 14 July 18
update v0.93
- bugfix RUN gate array configuration
- overriding an alias with a label will trigger an error
- PRINT directive may use escaped chars in strings
- tags BANK,PAGE,PAGESET may be used with current adress $

A bug may still occur with proximity labels mixing macro, generated names (but i cannot reproduce it)
Title: Re: Rasm Z80 assembler v0.94 [update 2018.07.20]
Post by: roudoudou on 21:47, 20 July 18
update v0.94
- bugfix using macro parameter inside print quote
- bugfix multiple memory leak with tag replacement
- bugfix command line side effect with wrong option
- better hack in expression calculator for expression beginning with negative value
- better equality processing in expression calculator
exewin32 does not have all the fix, will be available monday since i need a 32 bits compiler i do not have at home
Title: Re: Rasm Z80 assembler v0.95 [update 2018.07.22]
Post by: roudoudou on 18:16, 22 July 18
update v0.95
- allow spaces in tags inside strings with PRINT directive
- display warning if you try to export symbols or breakpoints with snapshot version 2
- proximity label beginning with BRK will generate an exportable breakpoint
- new enhanced LD instructions documented here http://www.roudoudou.com/rasm/rasm_en.html#Instructions
Title: Re: Rasm Z80 assembler v0.95 [update 2018.07.22]
Post by: krusty_benediction on 10:07, 24 July 18
For those using Visual Studio Code as Integrated Development Environment for the Amstrad CPC, you can install the "z80 macro assembler" extension that provides syntaxic coloration of code and some snippets for rasm. On my side it has completely replaced vim and its tailored extension. Syntax error analysis is only the missing thing for me
Title: Re: Rasm Z80 assembler v0.95 [update 2018.07.22]
Post by: Targhan on 12:46, 24 July 18
Quote
For those using Visual Studio Code as Integrated Development Environment for the Amstrad CPC, you can install the "z80 macro assembler"


Looks interesting. But the "Goto definition" does not seem to look outside the current file. And how do you create a build task?
Title: Re: Rasm Z80 assembler v0.95 [update 2018.07.22]
Post by: krusty_benediction on 15:12, 24 July 18
A javascript master like you may be able to fix this goto issue by proposing a patch to its author ;)
On my side I use Makefiles in a Dockerized environment  to manage all my stuff, so my build task is simply a Makefile call. So my minimum tasks.json file looks like taht
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build",
            "type": "shell",
            "command": "./bootstrap.sh make",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },

        {
            "label": "CPC",
            "type": "shell",
            "command": "./bootstrap.sh make run_on_cpc",
            "group": {
                "kind": "run",
                "isDefault": false
            }
        }
    ]
}

Title: Re: Rasm Z80 assembler v0.95 [update 2018.07.22]
Post by: Targhan on 00:57, 25 July 18
Javascript master? Well, that's one language I certainly don't master :). Thanks for the script, I'll check it out! But right now, the solution isn't as good as what I already have!
Title: Re: Rasm Z80 assembler v0.96 [update 2018.07.25]
Post by: roudoudou on 15:16, 25 July 18
update v0.96
- bugfix memory leak in tag translation with PRINT directive
- bugfix negative offset with INCBIN
- bugfix autotests memory handling
- added include path in command line
- doc updated
msdos version does not include all v96 update (monday)
Title: Re: Rasm Z80 assembler v0.95 [update 2018.07.22]
Post by: krusty_benediction on 15:55, 26 July 18

Looks interesting. But the "Goto definition" does not seem to look outside the current file. And how do you create a build task?
are you sure about the goto thing ? Just be able to jump in another (but opened) file
Title: Re: Rasm Z80 assembler v0.97 [update 2018.07.27]
Post by: roudoudou on 19:05, 27 July 18
update v0.97
- bugfix conditionnal code inhibition with macro declaration
- better alias infinite recursivity detection
Title: Re: Rasm Z80 assembler v0.97 [update 2018.07.27]
Post by: norecess on 21:25, 29 July 18
So I finally decided to give a try to Rasm.. so far so good :P

The transition was smooth (coming after years of dev under WinAPE). I was used to & for hexadecimal values, had to spend few hours before getting used to # notation.

What I am appreciating so far:
- the doc is awesome (I started with the English version but finally ended with the French one, my eyes were bleeding too much ;-).
- the << >> & parentheses etc. All those stuff works as expected. Under WinAPE, I (sometimes) had to fight with several constants to get same result
- the print vs. fail commands is good catch! I use fail in my macros to simulate an Assert at compile-time, very practical
- WinAPE was often kind of confused when dealing with macros, rasm does a much better job here to handle (report) errors
- looks mature in current state!

Good job Roudoudou.
Title: Re: Rasm Z80 assembler v0.97 [update 2018.07.27]
Post by: krusty_benediction on 21:43, 29 July 18
Yes, this is definitively the most promising assembler.
However, it is not yet enough mature (I regularly hit bugs), but is going to be as Roudoudou is really reactive when we catch bugs (and is not closed to suggestions).

 I have not yet totally switch from vasm to rasm.
Title: Re: Rasm Z80 assembler v0.97 [update 2018.07.27]
Post by: HAL 6128 on 16:06, 31 July 18
Hi @roudoudou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1714)
the code next shows me an error message "cannot use register 6<>A in this context". How can I solve this?
Kind regards,
HAL6128
Code: [Select]
macro setreg val
if {val}<>a
ld a,{val}
endif
push bc
ld bc,PORT ;PORT to be defined
out (c),a
pop bc
endm

org #9000
setreg 6
ret
Title: Re: Rasm Z80 assembler v0.97 [update 2018.07.27]
Post by: krusty_benediction on 16:44, 31 July 18
conditional directives do not know the content of registers, so this is a correct behavior for any assembler
maybe you should add a second argument to your macro that contains the current value of A but YOU have to know it when calling it
Title: Re: Rasm Z80 assembler v0.97 [update 2018.07.27]
Post by: HAL 6128 on 22:34, 31 July 18

This is a code snipped from 1990. Compiled with Z80ASM which looks like this. Maybe I misinterpreted it?
Code: [Select]
macro setreg val
ifdif val,a
  ld a,val
endif
.. endm
org #9000
setreg 6
ret
Title: Re: Rasm Z80 assembler v0.97 [update 2018.07.27]
Post by: roudoudou on 22:44, 31 July 18
With a (partial) integrated code simulator this may work but not in all cases (example: register a taking his previous value from memory)
Golem is using macros and variables like this, with a variable REG_A mirroring register A, so when he does LD A,n he's doing also REG_A=n
This can work with very linear code
Title: Re: Rasm Z80 assembler v0.98 [update 2018.08.03]
Post by: roudoudou on 14:47, 03 August 18
update v0.98
- bugfix with snapshot v2 memory size detection
- new optional parameter to get file size when load and crunch on the fly
- new option to remove warnings
- new fake instructions RR,RL,SRL,SRA,SLL,SLA with 16 bits (BC,DE,HL) registers
- preprocessing does not allow empty parameter to avoid confusion
- extended error may suggest a name if a variable/label/alias looks similar to a 'not found' value
Title: Re: Rasm Z80 assembler v0.99 [update 2018.08.16]
Post by: roudoudou on 16:13, 16 August 18
update v0.99
- new directive UNDEF
- bugfix memory leaks
- bugfix calculations with functions immediatly followed by two or more opened parenthesis
Title: Re: Rasm Z80 assembler v0.99 [update 2018.08.16]
Post by: Arnaud on 18:59, 16 August 18
update v0.99
- new directive UNDEF
- bugfix memory leaks
- bugfix calculations with functions immediatly followed by two or more opened parenthesis
The v1.0 is near  :D 
Title: Re: Rasm Z80 assembler v0.100 [update 2018.09.03]
Post by: roudoudou on 14:06, 03 September 18
back from holidays, small update
update v0.100
- bugfix crash with zeroed output file
- bugfix moar memory leaks
Title: Re: Rasm Z80 assembler v0.101 [update 2018.10.09]
Post by: roudoudou on 20:29, 09 October 18
update v0.101
- warn if no byte is written to a snapshot
- warn if RUN directive was already used
- bugfix calculation error cases
- bugfix maxam AND/OR/XOR/MOD operator (regression of v0.89)
- UNDEF does not care anymore about variable existence
- better error management with macro and wrong number of parameters

Siko is working on a new FR/ENG documentation, please be patient  8)
Title: Re: Rasm Z80 assembler v0.102 [update 2018.10.15]
Post by: roudoudou on 21:27, 15 October 18
update v0.102
- bugfix 'BREAKPOINT <adress>' export
- bugfix default limit of 65535
- bugfix limit autotest
- bugfix path simplification for dependencies export
- bugfix memory leak when using (VOID) with macro
- new math function to get a random value

Title: Re: Rasm Z80 assembler v0.103 [update 2018.10.17]
Post by: gryken on 12:31, 29 November 18
Hi,
Very impressive work with RASM  ;)
 I have noticed an error in documentation
I think that it should be
- Merkle tree
and not
- Merkel tree.
Don’t you think ?
 
Bye.
Title: Re: Rasm Z80 assembler v0.103 [update 2018.10.17]
Post by: roudoudou on 13:43, 29 November 18
Hi,
Very impressive work with RASM  ;)
 I have noticed an error in documentation
I think that it should be
- Merkle tree
and not
- Merkel tree.
Don’t you think ?
 
Bye.
Thanks
The documentation will be updated soon
Title: Re: Rasm Z80 assembler v0.103 [update 2018.10.17]
Post by: krusty_benediction on 01:19, 28 December 18
Hello,I mainly use rasm for my current handwritten code, but I have also written an assembler for my computer generated code (of course, wh'ne I'll have the courage to implement all mnemonics it will replace rasm in my workflow ;)).I have played today with some directives that could be also usefull with rasm.
Here is a test code that validated the approach

        ld a, screen_height
player_line_loop
        stableticker start effectduration ; Start to count nops
            ex af, af'

            pop hl ; 0 1
            xor a : out (c), a : out (c), l
            inc a : out (c), a : out (c), h

            repeat 7
                pop hl ; 2 3 to 14 15
                inc a : out (c), a : out (c), l
                inc a : out (c), a : out (c), h
            endr

            ex af, af'
            dec a
        stableticker stop
        defs 64*3 - effectduration - (1 + duration(jr nz, player_line_loop))
    jr nz, player_line_loop

There is a simple routine that must be played at a certain frequency. Usually we manually compute the number of nops it takes in order to add filling instructions to have the right duration.Its booooring, especially when you forget the timing. So I have added 2 directives to delegate the job to the assembler:- stableticker that counts the number of nops and store them in a variable- duration that can be used in any expression and provide the number of nops of its instruction
Of course there is a limitation with the conditional opcodes having different durations. In my implementation I select the shortest one (that's why I add 1).
This can be generalized to other kind of functions like opcode(mnemonic) that would return the 16bits value of any 8bits/16bits instruction. It will be probalby my homework of tomorrow

@roudoudou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1714) what do you think about implementing them (or more egonomics versions) ?
Title: Re: Rasm Z80 assembler v0.103 [update 2018.10.17]
Post by: roudoudou on 10:14, 28 December 18
...

This would be cool!
But if you start ticker with a variable name, why not stopping ticker also with a variable name?
Then you may start as many tickers as you want?
Title: Re: Rasm Z80 assembler v0.103 [update 2018.10.17]
Post by: krusty_benediction on 11:36, 28 December 18
2 resaons :
- I did that late, it is more difficult to make good choices ;)

- I only though about nested calls and not overlapping calls. But yes to provide an optional argument to stop allows to handle all cases
Title: Re: Rasm Z80 assembler v0.103 [update 2018.10.17]
Post by: roudoudou on 16:16, 28 December 18
BTW tell us more about your assembler  :P
Title: Re: Rasm Z80 assembler v0.103 [update 2018.10.17]
Post by: krusty_benediction on 17:23, 28 December 18
It is currently only a library ;not an executable able to assemble any file.I have not implemented all the mnemonics and directives. Only the things I needed to advance.
I have a parser that generates tokens from a source code. These same tokens can be generated (to noyt code the effect myseld) or manipulated (to optimize or inject specific code at specific place/moment) by my other demotools.
And I have the assembler that transform these tokens in a stream of bytes. My other tools inject them in a snapshot.
So barely useable by someone else ;) If you are curious, everything is there: https://github.com/cpcsdk/rust.cpclib/tree/master/src/assembler (https://github.com/cpcsdk/rust.cpclib/tree/master/src/assembler)
Title: Re: Rasm Z80 assembler v0.103 [update 2018.10.17]
Post by: roudoudou on 09:33, 02 January 19
There is a simple routine that must be played at a certain frequency. Usually we manually compute the number of nops it takes in order to add filling instructions to have the right duration.Its booooring, especially when you forget the timing. So I have added 2 directives to delegate the job to the assembler:- stableticker that counts the number of nops and store them in a variable- duration that can be used in any expression and provide the number of nops of its instruction
I've done the ticker  ;)
update v0.105- bugfix wrong error with operator+non decimal negative value
- do not allow CALL (IX) or CALL (IY) syntax
- added comments begining with //
- added SIZEOF support for fields of structures
- new directive TICKER to count instruction duration
New French and English documentation by Siko (Stéphane S.) in the first post 8)

Title: Re: Rasm Z80 assembler v0.105 [update 2019.01.02]
Post by: krusty_benediction on 20:00, 02 January 19
super manuel. Il y a quelques typos avec {sizeof}
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: roudoudou on 16:36, 16 January 19
update v0.106

- multi-line comments with /*  */

update v0.107
- colored output with Unix terminal- trigger error if a (VOID) arg is used with a macro which has parameter(s)
- added Vasm syntax ENDREP and ENDREPEAT to end a REPEAT block
- enforce zero result when there is an error in a calculation
- new directives NOEXPORT/ENOEXPORT to disable/enable on demand symbol export
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: norecess on 16:50, 16 January 19
Thanks @roudoudou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1714) !!
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: HAL 6128 on 21:20, 16 January 19
Really cool progress. Would it also possible to have (oldschool) .PHASE and .DEPHASE directives , like in the M80 assembler?
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: roudoudou on 22:14, 16 January 19
Really cool progress. Would it also possible to have (oldschool) .PHASE and .DEPHASE directives , like in the M80 assembler?
I may add it in the next release, but you can do it already with macros  ;D
Code: [Select]
macro phase adr
org {adr},$
mend
macro dephase
org $
mend
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: HAL 6128 on 13:07, 17 January 19
Very helpful, thanks!
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: Targhan on 00:55, 23 January 19
What would you think the best way to emulate the MAP feature of SJAsmPlus:



   MAP 8
Label # 2     ; Label=8
Kip   # 3     ; Kip=10
Kop   #       ; Kop=13
Kop2  # 1     ; Kop2=13

I would like to avoid doing this:
Start equ #4000
Stuff1 equ Start + 0
Stuff2 equ Start + 1
Stuff3 equ Start + 3
...
Ideally, I'd like to declare the size of each item:
Start <struct> #4000
stuff1 <declare byte>     ;stuff1=#4000
stuff2 <declare word>    ;stuff2=#4001
stuff3 <declare word>    ;stuff3=#4003
...
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: roudoudou on 08:16, 23 January 19
you have the STRUCT directive
Code: [Select]
struct targhan
stuff1 defs 1
stuff2 defs 4
stuff3 defs 2
stuff4
endstruct

nocode
org #4000
struct targhan m4
code

; m4.stuff1=#4000
; m4.stuff2=#4001
; m4.stuff3=#4005
; m4.stuff4=#4007
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: Targhan on 10:03, 23 January 19
Ahhhh good. I knew about Struct, but forgot about the "nocode" directive. Thanks!!
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: krusty_benediction on 14:35, 23 January 19
I think it is not documented; I discovered it in the post
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: roudoudou on 14:56, 23 January 19
I think it is not documented; I discovered it in the post
These directives are obsolete. They were used in Maxam in order to create kind of structures.
I realize now that we can have a more modern usage  :D
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: GUNHED on 17:13, 23 January 19
Well, IMHO nocode is really useful, every assembler should understand it. I work with Z80, I have my style and I don't need anything modern.  ;D ;) :)
RASM is great, and Maxam compatibility is (for me) the most important thing.  :)
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: Targhan on 20:26, 23 January 19
It works, but makes the code a bit complicated :). The ORG change is problematic, so I have to save it and restore it then:
SaveOrg = $
...
org SaveOrg


But it works :).
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: roudoudou on 21:22, 23 January 19
It works, but makes the code a bit complicated :) . The ORG change is problematic, so I have to save it and restore it then:
SaveOrg = $
...
org SaveOrg


But it works :) .
I will read again the MAXAM doc about the behaviour of CODE/NOCODE

Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: GUNHED on 21:53, 23 January 19
Assembling in RAM: NOCODE will stop putting bytes into RAM, when using CODE the bytes are again written in RAM, at the right address.

Assembling to disc: NOCODE stops writing bytes to the output file (binary), then the CODE command will again write the bytes to the file, but the gap in between will NOT be filles with zeros.

So after NOCODE and CODE the binary output file will have a gap and the bytes written after CODE are to early in the file.

Usage of NOCODE: Very nice when testing, but you don't want to write to RAM or file.
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: roudoudou on 23:52, 23 January 19
Thanks Gunhed so the actual NOCODE is legacy but i may add an option to CODE to get the previous $
CODE NOGAP or something like this?
Title: Re: Rasm Z80 assembler v0.107 [update 2019.01.16]
Post by: Targhan on 21:51, 27 January 19
Advice needed. The Arkos Tracker players have duplicated code (for each channel). I'd like to avoid this, but this is tricky. Maybe one of you can enlighten me on how to improve this.

I know I can use macro and local labels.

MACRO ManageNote
ld hl,(@stuff + 1)
@stuff ld de,#4000
ENDM

ManageNote ;For channel 1
ManageNote ;For channel 2
ManageNote ;For channel 3

The problem is, I would like to have these macros to address labels from the related channel.

MACRO ManageTrack
ld hl,(@stuff + 1)     ;From the macro above!!
ld de,12
add hl,de
ENDM

ManageTrack ;For channel 1
ManageTrack ;For channel 2
ManageTrack ;For channel 3

How is it possible? I should be able to generate labels, maybe from placeholder and parameters in the macro, but it probably won't work...
... After testing... YES IT WORKS!! Damn, this is great!

        MACRO test chan
         defb {chan}
stuff{chan} ld a,0
        ENDM
       
        test 1     ; This generated a "stuff1" label!
        test 2     ; This generated a "stuff2" label!

This is amazing!! Well done Roudoudou!! This is crazy stuff. Ok, I guess I have found my solution, but if anyone want to add it 2 cents, thanks :).
Title: Re: Rasm Z80 assembler v0.108 [update 2019.01.28]
Post by: roudoudou on 09:18, 28 January 19

update v0.108

- allow var name beginning with '_'

- CODE directive may retrieve last outputed byte adress


Code: [Select]
org #100
nocode
nop
code
print $ ; #101

org #200
nocode
nop
code skip
print $ ; #200
Title: Re: Rasm Z80 assembler v0.108 [update 2019.01.28]
Post by: HAL 6128 on 16:17, 28 January 19
Hi roudoudou,
a question regarding the 'save' directive: what are the options for overwriting an existing file on a DSK?
Title: Re: Rasm Z80 assembler v0.108 [update 2019.01.28]
Post by: roudoudou on 21:34, 28 January 19
Hi roudoudou,
a question regarding the 'save' directive: what are the options for overwriting an existing file on a DSK?
this is the -eo option with the command line
Title: Re: Rasm Z80 assembler v0.108 [update 2019.01.28]
Post by: krusty_benediction on 21:23, 02 February 19
Here is another directive suggestion for rasm LOCOMOTIVE/ENDLOCOMOTIVE in order to generate basic bootstrap code that launches the binary file.I've just validated the concept with my prototype assembler.
Here is the sample file I have produced (and I have enclosed the generated file):

    LOCOMOTIVE code
10 ' Hello world
20 call {code}
    ENDLOCOMOTIVE

code

    di
        ld hl, 0xc9fb
        ld (0x38), hl
    ei
   
    ld bc, 0x7f10 : out (c), c
    ld a, 0x40 : out (c), a
    jp $


The assembler generates the tokens of the basic program.One of the instruction is call {code} where {code} is replaced by the value of the label {code} in the assembly code. So any {XXX} is replaced by the value of XXX in the symbole table if XXX is provided as an argument of LOCOMOTIVE

It is probalby interesting to add specific comments that contain tags asking to hide some basic lines (for a demo line 20 should be hidden).



Title: Re: Rasm Z80 assembler v0.108 [update 2019.01.28]
Post by: roudoudou on 22:35, 02 February 19
would be such a huuuuuuuuuuuge work

ps: PDF documentation updated!
Title: Re: Rasm Z80 assembler v0.108 [update 2019.01.28]
Post by: roudoudou on 12:11, 03 February 19
Hi roudoudou,
a question regarding the 'save' directive: what are the options for overwriting an existing file on a DSK?
I found an issue with file overwriting and DSK update
You should delete the dsk meanwhile i fix this
Title: Re: Rasm Z80 assembler v0.109 [update 2019.02.22]
Post by: roudoudou on 00:26, 23 February 19
update v0.109
- bugfix crash when trying to save with a negative size
- bugfix crash case with macro and wrong parameter number
- bugfix EDSK update
- IFDEF/IFNDEF now scans for macro names
- TZX/CDT output support (not working)
- RUN directive may use unknown var as parameter
- embedded Rasm may return info struct about errors and symbols

There is more different files to download:
- msdos version
- windows 32bits executable
- windows 64bits executable (20% faster than 32bits version)
- sources
Title: Re: Rasm Z80 assembler v0.110 [update 2019.02.27]
Post by: roudoudou on 14:40, 27 February 19
update v0.110
- allow numeric expression beginning with +
- bugfix uninitialized memory reads and memory leaks with embedded Rasm
Title: Re: Rasm Z80 assembler v0.111 [update 2019.03.20]
Post by: roudoudou on 15:06, 20 March 19
update v0.111
- error management code cleanup
- new options with directive INCBIN for wav import
- allow EDSK with invalid track sector size or supernumerary tracks if sectors are DATA compliant
- bugfix confusion between generated global labels and local labels for export
- bugfix EQU with generated names AND curly brackets formulas inside a loop
- bugfix invalid REPEAT values will increment the error counter
Title: Re: Rasm Z80 assembler v0.111 [update 2019.03.20]
Post by: GUNHED on 15:11, 20 March 19
Everything 111 now! Thanks for the comprehensive update, that was for sure lot's of work! Great!  :)
Title: Re: Rasm Z80 assembler v0.112 [update 2019.04.05]
Post by: roudoudou on 16:37, 05 April 19
update v0.112
- bugfix single NOP wasn't increment nop counter ^_^
- bugfix NOP count with ADD/SUB/XOR/AND/CP (IX+n)/(IY+n)
- bugfix in WAV import


And new PDF for documentation   ;) 
Title: Re: Rasm Z80 assembler v0.113 [update 2019.04.26]
Post by: roudoudou on 15:56, 26 April 19
update v0.113
- trigger an error when dynamic LZ section cannot crunch
- bugfix when trying to crunch an empty section
- dynamic debug options removed
- snapshot & cartridge summary by default
- embedded rasm export all labels and EQU in the info struct
- new math function CEIL
- rasm may handle generated name with INCBIN directive
Title: Re: Rasm Z80 assembler v0.114 [update 2019.06.21]
Post by: roudoudou on 12:51, 21 June 19
update v0114 (summer release!)
- new INCBIN options: REMAP, REVERT, VTILES
- new command line option "-oa" to mimic inputname for binary output
- try some file extensions if the input file is not found
- new alias EXA for EX AF,AF'

Title: Re: Rasm Z80 assembler v0.114 [update 2019.06.21]
Post by: norecess on 15:35, 21 June 19
When I read your "summer update" 's changelog - I conclude your assembler is more than mature and you don't know what to add to it now. :)
Title: Re: Rasm Z80 assembler v0.114 [update 2019.06.21]
Post by: roudoudou on 15:42, 21 June 19

Yeah, maybe some CDT output, a future SNA v4 (memory+roms+cartridge+floppy)

Maybe it's time to work on something else (finish my bubble game (need GFX polish and music)! Work on a new demo, ...)
Title: Re: Rasm Z80 assembler v0.114 [update 2019.06.21]
Post by: Volutar on 12:32, 03 July 19
roudoudou, first of all thank you for this assembler.
It's one of few which handles forward references without any issues.
Though I'm not a CPC guy (ZX here), but I'm actively using it.

For some time (I don't remember since which version) rasm occasionally crashes in "preprocessing" (I guess) stage. It might be related to uninitialized variables due to this "irregular" nature. I couldn't isolate which exactly code causes this crash, since I use it for pretty big project, and it would take alot of time to figure this out.
It would be nice to have some kind of "verbose" assembling to ease this task.

P.S.: I just found, that 64bit versions actually doesn't crash, it seems it's the 32bit version issue.
Title: Re: Rasm Z80 assembler v0.114 [update 2019.06.21]
Post by: roudoudou on 12:40, 03 July 19
Though I'm not a CPC guy (ZX here), but I'm actively using it.
I'm very happy to read ZX people use Rasm! Let me know if you want some TZX export or anything else! (i will need documentation obviously)

For some time (I don't remember since which version) rasm occasionally crashes in "preprocessing" (I guess) stage. It might be related to uninitialized variables due to this "irregular" nature. I couldn't isolate which exactly code causes this crash, since I use it for pretty big project, and it would take alot of time to figure this out.

P.S.: I just found, that 64bit versions actually doesn't crash, it seems it's the 32bit version issue.
If sources are not secret, you may send the whole package to me
Or i may send you a version with debug informations in order to use Visual Studio debuger
Or i may send you a version with many output traces during prepro+assembly (very heavy debuging)
Title: Re: Rasm Z80 assembler v0.115 [update 2019.07.18]
Post by: roudoudou on 22:11, 18 July 19
update v0.115
- bugfix preprocessing with multi-line comments
- bugfix unrecognized % for modulo
- new banking BUILDZX directive for ZX Spectrum usage
and a new option to export symbols for ZX emulators with bank:label informations