CPCWiki forum
General Category => Programming => Topic started by: roudoudou on 09:58, 22 February 17
Official repository is now on github
https://github.com/EdouardBERGE/rasm (https://github.com/EdouardBERGE/rasm)
Download releases here => https://github.com/EdouardBERGE/rasm/releases (https://github.com/EdouardBERGE/rasm/releases)
Yes! Another assembler!
- DAMN fast assembling (millions of instructions in a blink of an eye)
- integrated crunched sections (LZ48/LZ49/LZ4/ZX7/Exomizer/APlib) + load&crunch on the fly
- CPC cartridge, ZX snapshots, CPC snapshots up to 4M
- save unlimited binaries with or without AMSDOS/HOBETA header
- handle multiple EDSK update or generation simultaneously
- symbols import/export, breakpoint and dependencies 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, Pasmo compatibility option
- Amsdos real & Microsoft basic 40bits float support
- 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
Thanks to all the people
supporting me
advising me for new functionnalities, ergonomics
reporting bugs
and of course using the tool!
update 0.130
- error messages clean-up
update v0.129
- bugfix read overrun in pre-processor
- bugfix read overrun in snapshot encoding
- bugfix AMSDOS header creation with filename that contains a path
- force memory cleanup with MorphOS
- when a variable cannot be computed, check for directive names to avoid confusion
update v0.128
- bugfix moar memory leaks
- label code clean-up
update v0.127
- bugfix some memory leaks
update v0.126
- Rasm is able to mix LZsegments and contiguous ORG sections
update v0.125
- bugfix EQU with current adress reference and crunched zones integration
update v0.124
- new directive DF/DEFF in order to output Microsoft IEEE-754 40bits real
- pasmo compatibility option for DEFB/DEFW with multiple output and reference to current adress
update v0.123
- new option to treat warnings as errors
- bugfix segfault with empty struct declaration
- bugfix v0.121 regression for INCWAV
- check labels,variables and alias when declare macro name
update v0.122
- proximity label enhancement with macro inception and loops
- new directive MODULE
update v0.121- early stages MODULE support
- APlib Ultra integration (load&crunch + crunched section)
- bugfix segfault when trying to assemble a file that does not exists
- bugfix segfault with opened comment '/*' until the end of the file
- bugfix DEFB calculation with $ after crunched section
- proximity label beginning with BRK will generate an exportable breakpoint
- \ support (experimental)
- LIMIT directive evolution (mostly for #FFFF writing case)
- crunched INCBIN may use offset/length/remap before crunch
update v0.120
- BIT,RES,SET may use deferred shifting value
- BANK directive may use NEXT as parameter to switch to next BANK space
- operator assignment are now supported
- may use tags in filenames with SAVE directive
- warn for huge shifting and force result to zero (as it's an architecture independant operation)
update v0.119
- bugfix ASSERT with extra-parameters
- local labels are also reference for proximity label inside their respective scope
- struct may be indexed (work in progress concerning init and filler)
- RUN directive also set execution adress for SAVE directive and may be used multiple times
- new option -wu in order to make warnings for every unused var, alias or label
update v0.118
- bugfix using variables for size/offset with SAVE directive
- bugfix using variables for size/offset in a loop with INCBIN directive
- bugfix error message causing core dump (when doing macro inception)
- new option to enforce void usage with macro without parameter
- new option for INCBIN to interlace+zigzag tiles
update v0.117
- new spectrum option HOBETA for SAVE directive
- new snapshot 48K output when using spectrum mode
- bugfix error message when trying to export in symbol file an invalid (but not used) EQU
- bugfix PAGE,PAGESET when used with generated label names and defered computation
- bugfix automatic uppercase+remove spaces in formulas for generated names with INCBIN
- bugfix using negative size with INCBIN (will compute filesize + negative size)
update v0.116
- bugfix infinite loop when first file is not found
- bugfix using prefix with generated label name
- bugfix default max limit (no moar 65535)
- bugfix eDSK generation with interlaced sectors (wrong since 0.112)
- bugfix snapshot with moar than 192K of extended RAM
- snapshot now use PPI control value to 0x82 as default
- struct definition allow DEFB,DEFW,DEFI,DEFR to be used without value
- struct usage may use default values of the struct definition
- struct usage allow inline values for each field
- allow use CP with non implicit A register
- allow proximity label without previous global label (mostly for heritage sources)
- more flexibility with DEFS value
- new math functions GET_R, GET_G/GET_V, GET_B to manage amstrad Plus colors
- new math functions SET_R, SET_G/SET_V, SET_B to manage amstrad Plus colors
- new symbol export option to export one file per memory space
- MX chunk support for up to 4M snapshot with ACE emulator
- BANK, PAGE and PAGESET enhancement for 4M snapshot support (now return 16 bits gate array value)
update v0.115
- bugfix preprocessing with multi-line comments
- bugfix unrecognized % for modulo
- new banking BUILDZX directive for ZX Spectrum usage
update v0.114
- 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'
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
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
Quote from: roudoudou on 09: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)
Quote from: AMSDOS on 10:58, 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
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.
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"
Why do you have to compile the thing itself?
greeting
Quote from: cpcuser on 23:04, 04 March 17
Why do you have to compile the thing itself?
greeting
Quote from: 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"
wait monday for executables
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
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 ?
Quote from: 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 ?
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
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 ! :-*
Quote from: 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 ! :-*
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
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
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
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)
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
Quote from: roudoudou on 15:11, 16 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!
(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)
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
error...... jr nz,vbl
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
error...
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
Quote from: cpcuser on 11:55, 30 March 17error...... jr nz,vbl
yep, i have to fix the LZ48 dynamic block since i made a lot of modifications with labels ;)
Quote from: cpcuser on 12:11, 30 March 17
error...
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
What are these bad examples?
Can not offer functional?
greeting
Quote from: cpcuser on 13:12, 30 March 17
What are these bad examples?
Can not offer functional?
greeting
i will remove them. Did you test on your sources?
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
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
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
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
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
updated first post with executable of v052
documentation need a strong update now! Soon... :)
I look forward one day (hopefully) to use this and its cartridge features!
One day...
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
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
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)
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
doc updated 8)
Quote from: Sykobee (Briggsy) on 17:23, 02 May 17
I look forward one day (hopefully) to use this and its cartridge features!
One day...
1 minute test ;D
update 2017.08.02 - v0.58
- fixed INC SP encoding (was DEC SP opcode :picard: )
:doh: :doh: :doh:
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]
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
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 :)
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.
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
Quote from: roudoudou on 17:16, 30 November 17
2 bytes : with a shitty big endianusing the only logical endianness adress for the symbol
:)
Everything looks awesome, except... instead of '&','$' or '0x', it only supports '#' for hex values!? What? :picard2:
Quote from: pelrun on 09:29, 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
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.
Quote from: 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.
'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.
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.
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
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.
Quote from: 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.
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
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.
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.
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
Quote from: roudoudou on 09:23, 05 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! :)
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
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
updated first post with v0.66
- new directives IFDEF, IFNDEF to test label, variable or alias existence
Always at the top.
Thank you Roudoudou.
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
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
(at least in ACE it's official :))
Quote from: CloudStrife on 12:55, 22 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
Quote from: CloudStrife on 12:55, 22 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)
Quote from: CloudStrife on 15:56, 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!
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 ?
Thanks! I will take a look
I fix some (minor) bugs this month so...
Maybe a release soon
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
Yeeeeeess! :).
documentation lightly updated (there is a glitch in the english index table, don't know how to remove it but it's still usable)
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!)
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. :)
Quote from: 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. :)
Sure
Will do it for next release
Quote from: roudoudou on 14:14, 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 😋
a quick update cause of shifting operator >> did not work...
now shrinkler sources can compile
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
Cool! Thanks!
update v0.72
- ability to generate snapshot v2 (useful with M4Wifi)
short doc
BUILDSNA V2
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
Quote from: 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
It is a command line tool.
Open a terminal and run
update v0.73
- bugfix in snapshot when using distinct banks instead of gathering them with bankset directive
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
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
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!!! :) :) :)
I have to work on english version too before updating here ;)
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 :)
update v0.76
- fix solver when using % prefixed binary values close to comparison operator or parenthesis
Both FR & EN doc updated 8)
quick update for maxam compatibility mode users
update v0.77
- even faster expression calculation
- maxam & AS80 comparison operators are back
ultra-light but requested update v0.78
- DEFS can handle multiple repetition schemas
- alias DM & DEFM for DEFB
update v0.79
- != operator is back with new solver :doh:
update v0.80
- bugfix operator > and >=
- bugfix Maxam priorities
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 >:(
Fixes are validated coz 0.81 is working fine for me. 8)
Thanks Roudoudou :-*
Yes, 81 seems to be a good number. Everything stable and well here too. :)
Quote from: GUNHED on 15:32, 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
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)
update v0.83
- NOCODE output must increment current adress in all cases
- new directives DR & DEFR to define REAL values (Amstrad firmware compatible)
Example:
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
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?
Quote from: 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?
Using INT() must solve the case
You may be interrested also by the floor() function, the result is again different in another way
Example:
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
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
Interesting. But for my use case, I think the shift (>>) will be more explicit, in fact!
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
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
Ok ok :P ... That's a fact: I am in love :-* :-*
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:
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
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:
ld a,#33
ld (hl),a
inc l
Is there a way to do something like this?
ld a,#33; ld (hl),a; inc l
[EDIT] I think I found the answer. ;D
ld a,#33:ld (hl),a:inc l
Now THAT is a great feature!
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...)
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\.]\+"
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
Quote from: 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
I guess i have to find the .rel format description?
Quote from: roudoudou on 10:09, 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)
Quick question about using ORG...
I've got a bunch of code that refers to a jump table.
A trivial example:
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.
Quote from: 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:
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?
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
#21 #00 #98
...many zeroes...
#00 #A0 #01 #A0 #02 #A0
for a total of 4099 bytes
Quote from: roudoudou on 09:57, 11 May 18
Could you be more specific?
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
#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.
Yes, indeed it was my silly mistake.
I was overwriting other data.
My apologies for the confusion.
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...
Quote from: 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...
I will try to compile a 32 bits version (if i find the correct compiler option)
Quote from: 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" >:(
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
I am sorry to say that this new exe doesn't work as well...
Runs in window and closes immediately!!
Quote from: 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!!
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
Quote from: roudoudou on 21:19, 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!
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:
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: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
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)
Can you fix the return carriages of your code snippets please? I don't understand exactly how this works! Thanks.
Quote from: 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.
sorry, always this shitty WYSI(not)WYG editor >:(
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
The dot makes sense. However... what would be the use of such "proximity" label?
@krusty_benediction yes, SJAsmplus manages local labels.
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.
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?
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)
Quote from: Targhan on 15:48, 19 June 18Hmm, 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?
Not a bad idea indeed!
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
Quote from: roudoudou on 10:37, 24 June 18
(and the english version is still 10 versions late...)
Please catch up, before you forget everything ;) :) :) :)
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
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%
doc updated :)
QuoteDocumentation 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)
Actually for EN this link works:
http://www.roudoudou.com/rasm/rasm_en.html
Quote from: GUNHED on 11:27, 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
@roudoudou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1714) :
RASM says during assembling that after e.g. LD BC,#FF63
and an OUT (C),A
it is truncating the value #FF63 to #63. Does it really truncate it?
Quote from: 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. LD BC,#FF63
and an OUT (C),A
it is truncating the value #FF63 to #63. Does it really truncate it?
Quotesorry i cannot reproduce what you say with ld bc,#FF63 and out (c),a
Quotemust be another line
Quotehave you some DB/DEFB around?
Hmm, sorry. I found the error I made.
I've defined a variable:
VALUE EQU #FF63
...
LD A,0
LD BC,#FF63
OUT (VALUE),A
I had forgot to rewrite the out command.
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
Rasm forever ! May the french soccer team win tonight !
Did not see the match, i was busy fixing PAGE tag -> v0.92 update ;D
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)
replace >>8 by /256
Note: In rasm mode /256 will round upper, in maxam mode this will truncate and may lead to another result
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 ;-)
Quote from: 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 ;-)
with rasm you can do
ld (iy+0),lo(variable_of_16_bit)
ld (iy+1),hi(variable_of_16_bit)
orld (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 :) macro LDIY16 valuetoput
ld (iy+0),lo({valuetoput})
ld (iy+1),hi({valuetoput})
endm
Cool! Thanks!
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)
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
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
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
QuoteFor 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?
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
}
}
]
}
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!
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)
Quote from: Targhan on 12:46, 24 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
update v0.97
- bugfix conditionnal code inhibition with macro declaration
- better alias infinite recursivity detection
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.
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.
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
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
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
This is a code snipped from 1990. Compiled with Z80ASM which looks like this. Maybe I misinterpreted it?
macro setreg val
ifdif val,a
ld a,val
endif
.. endm
org #9000
setreg 6
ret
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
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.99
- new directive UNDEF
- bugfix memory leaks
- bugfix calculations with functions immediatly followed by two or more opened parenthesis
Quote from: 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
The v1.0 is near :D
back from holidays, small update
update v0.100
- bugfix crash with zeroed output file
- bugfix moar memory leaks
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)
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
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.
Quote from: 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.
Thanks
The documentation will be updated soon
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) ?
Quote from: krusty_benediction on 01:19, 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?
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
BTW tell us more about your assembler :P
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)
Quote from: krusty_benediction on 01:19, 28 December 18
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)
super manuel. Il y a quelques typos avec {sizeof}
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
Thanks @roudoudou (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1714) !!
Really cool progress. Would it also possible to have (oldschool) .PHASE and .DEPHASE directives , like in the M80 assembler?
Quote from: 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?
I may add it in the next release, but you can do it already with macros ;D
macro phase adr
org {adr},$
mend
macro dephase
org $
mend
Very helpful, thanks!
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
...
you have the STRUCT directive
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
Ahhhh good. I knew about Struct, but forgot about the "nocode" directive. Thanks!!
I think it is not documented; I discovered it in the post
Quote from: krusty_benediction on 14:35, 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
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. :)
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 :).
Quote from: 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 :) .
I will read again the MAXAM doc about the behaviour of CODE/NOCODE
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.
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?
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 :).
update v0.108
- allow var name beginning with '_'
- CODE directive may retrieve last outputed byte adress
org #100
nocode
nop
code
print $ ; #101
org #200
nocode
nop
code skip
print $ ; #200
Hi roudoudou,
a question regarding the 'save' directive: what are the options for overwriting an existing file on a DSK?
Quote from: 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?
this is the -eo option with the command line
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).
would be such a huuuuuuuuuuuge work
ps: PDF documentation updated!
Quote from: 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?
I found an issue with file overwriting and DSK update
You should delete the dsk meanwhile i fix this
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
update v0.110
- allow numeric expression beginning with +
- bugfix uninitialized memory reads and memory leaks with embedded Rasm
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
Everything 111 now! Thanks for the comprehensive update, that was for sure lot's of work! Great! :)
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 ;)
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
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'
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. :)
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, ...)
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.
Quote from: Volutar on 12:32, 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)
Quote from: Volutar on 12:32, 03 July 19For 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)
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
Hello,rasm is able to define prototype of structures and to instantiate them.However, although it does not raise an error, it seems it is not possible to define value to the field at their instantiation.Is it possible to add such ability ?
For example, st1 of the documentation could be instanciated as :struct st1 mylabel 1, 2in order to generatemylabel.ch1 dw 1.ch2 dw 2
and for metast1:struct metast1 mylabel2 1,2,3,4in order to generatemylabe2.pr1.ch1 dw 1.pr1.ch2 dw 3
.pr2.ch2 dw 4
oldstyle syntax of vasm allows such thing. It is really usefull
thx
I guess it's possible
Quote from: roudoudou on 20:34, 17 August 19
I guess it's possible
Great, lI'm ooking forward for such improvment
Heyo, going to try and use this assembler considering that it has documentation that's pretty straightforward and simple in terms of telling you how to assemble. Thanks for your work! I'll try and give an update afterwards, since if a beginner like me can use it, then, in my opinion, it's been designed well.
Hi
there is a big regression in DSK support since 0.112
many fixes are coming soon but i'm still working on it
sorry for the delay, i moved house twice this year and i'm soooooo tired ;D
++
update v0.116
- bugfix infinite loop when first file is not found
- bugfix using prefix with generated label name
- bugfix default max limit (no moar 65535)
- bugfix eDSK generation with interlaced sectors (wrong since 0.112)
- bugfix snapshot with moar than 192K of extended RAM
- snapshot now use PPI control value to 0x82 as default
- struct definition allow DEFB,DEFW,DEFI,DEFR to be used without value
- struct usage may use default values of the struct definition
- struct usage allow inline values for each field
- allow use CP with non implicit A register
- allow proximity label without previous global label (mostly for heritage sources)
- more flexibility with DEFS value
- new math functions GET_R, GET_G/GET_V, GET_B to manage amstrad Plus colors
- new math functions SET_R, SET_G/SET_V, SET_B to manage amstrad Plus colors
- new symbol export option to export one file per memory space
- MX chunk support for up to 4M snapshot with ACE emulator
- BANK, PAGE and PAGESET enhancement for 4M snapshot support (now return 16 bits gate array value)
Thank you, I will test this version on my project tonight... and come back to you if necessary!
update v0.117
- new spectrum option HOBETA for SAVE directive
- new snapshot 48K output when using spectrum mode
- bugfix error message when trying to export in symbol file an invalid (but not used) EQU
- bugfix PAGE,PAGESET when used with generated label names and defered computation
- bugfix automatic uppercase+remove spaces in formulas for generated names with INCBIN
- bugfix using negative size with INCBIN (will compute filesize + negative size)
128K snapshot for spectrum next timedocumentation soon ;)
Quote from: roudoudou on 11:42, 22 November 19
update v0.117
- new spectrum option HOBETA for SAVE directive
- new snapshot 48K output when using spectrum mode
- bugfix error message when trying to export in symbol file an invalid (but not used) EQU
- bugfix PAGE,PAGESET when used with generated label names and defered computation
- bugfix automatic uppercase+remove spaces in formulas for generated names with INCBIN
- bugfix using negative size with INCBIN (will compute filesize + negative size)
128K snapshot for spectrum next timedocumentation soon ;)
Just compiled v0.117 and when you run it 'rasm -v' it still says its 0.116
Am i doing something silly or did some one forget to roll the version number :laugh:
cheers
shifters
Quote from: shifters74 on 12:19, 14 December 19
Just compiled v0.117 and when you run it 'rasm -v' it still says its 0.116
Am i doing something silly or did some one forget to roll the version number :laugh:
cheers
shifters
i forget ;)
just edit the version in the very first lines
Quote from: roudoudou on 14:21, 14 December 19
i forget ;)
just edit the version in the very first lines
or just make a new release with the version number fix as the only fix :P
I thought the same... ;D
update v0.118
- bugfix using variables for size/offset with SAVE directive
- bugfix using variables for size/offset in a loop with INCBIN directive
- bugfix error message causing core dump (when doing macro inception)
- new option to enforce void usage with macro without parameter
- new option for INCBIN to interlace+zigzag tiles
update v0.119
- bugfix ASSERT with extra-parameters
- local labels are also reference for proximity label inside their respective scope
- struct may be indexed (work in progress concerning init and filler)
- RUN directive also set execution adress for SAVE directive and may be used multiple times
- new option -wu in order to make warnings for every unused var, alias or label
This great assembler runs with MS-DOS? Oh, then ... it would be really great to have a CP/M Plus version too. :) ;D :)
Quote from: roudoudou on 09:58, 22 February 17
update v0.119
* rasm_v0119_srcbis.zip (185.86 kB - downloaded 10 times.)
Hey, RASM is open-source (MIT expat license).
Great! This means it can be compiled on more exotic architectures (use it on ARM machines like Pi, smartphone, etc).
I might incorporate it in https://github.com/cpcitor/cpc-dev-tool-chain
Wow, one 600kbytes / 17klines source code file. Compiled in 7 seconds on my fast i7, mkay.
Other libraries "repacked" in one big .h file.
Roudoudou, what is the purpose of that? Simplifying compilation steps?
Notice that usual one-file libraries do have a common pattern to make them compatible with multi-file source: after the interface declaration (normal .h structure) append the implementation (normally in several .c) enclosed with #ifdef LIB_FOO_IMPLEMENTATION / #ENDIF . With this you can #include the single-file-lib from several source, and only one will do #define LIB_FOO_IMPLEMENTATION before.
For one example, miniaudio used in RetroVirtualMachine and to which I contributed a little, see https://github.com/dr-soft/miniaudio#user-content-building
Anyway, thanks a lot for sharing the source!
Back to my question, what is the purpose of repacking the external dependencies?
Quote from: cpcitor on 17:18, 12 January 20
Hey, RASM is open-source (MIT expat license).
Great! This means it can be compiled on more exotic architectures (use it on ARM machines like Pi, smartphone, etc).
I might incorporate it in https://github.com/cpcitor/cpc-dev-tool-chain (https://github.com/cpcitor/cpc-dev-tool-chain)
Wow, one 600kbytes / 17klines source code file. Compiled in 7 seconds on my fast i7, mkay.
Back to my question, what is the purpose of repacking the external dependencies?
Hi
Rasm is already running on PowerPC and MorphOS (thanks Philippe R.) so i guess it should run properly on ARM (use the hidden option -autotest ;D )
The non-standard package is for:
- execution speed
- easy for me to navigate in the source code
- easy to compile, avoid external dependencies version problems
- the project was not supposed to be public (just wanted to finish my demo on time)
Hey Roudoudou! :)
Quote from: roudoudou on 09:58, 22 February 17
update v0.119
Thanks again a lot for making the source available under a FOSS license!
Context
I'm starting to integrate it in cpc-dev-tool-chain. Currently, my local branch of cpc-dev-tool-chain can automatically fetch Rasm, compile it and add it to PATH.
Thanks to basing everything on source code, this should work on many architectures and OS.
(Some day I will probably offer complete precompiled packages for cpc-dev-tool-chain. This should bring the benefit of many platforms with the convenience of one download for ready-to-use integrated tools.)
I have not yet thought about the various ways RASM and other tools can be mixed for versatility and convenience. First idea is to have projects automatically call Rasm for all files named like *.rasm.
The short-term goal motivating all this is "just" to incorporate music exported by Arkos Tracker in my existing ongoing SDCC/SDASZ80-based project JustGet9.
Issue
Integration is done by downloading source code from some "official" URL.
The current URL to source code is https://www.cpcwiki.eu/forum/programming/rasm-z80-assembler-in-beta/?action=dlattach;attach=30425 (https://www.cpcwiki.eu/forum/programming/rasm-z80-assembler-in-beta/?action=dlattach;attach=30425) which:
* does not show clearly what is downloaded
* does not make obvious how to get back to the conversation
* feels brittle (we have seen some CPC-related forum disappear)
* tends to download to files named like index.html?action=dlattach;attach=30425 or even ?action=dlattach;attach=30425.
Solution
I wish the source code would be available from a site offering nice and stable URLs. Have you considered putting it on some code sharing platform like github?
Such solution also has convenient features like automatically building and serving binaries for various platforms whenever you push a new release.
For example you can visit https://github.com/ColinPitrat/caprice32/releases (https://github.com/ColinPitrat/caprice32/releases) and
consider the stable URLs presented there:
https://github.com/ColinPitrat/caprice32/releases/download/v4.5.0/cap32-win64.zip (https://github.com/ColinPitrat/caprice32/releases/download/v4.5.0/cap32-win64.zip)
https://github.com/ColinPitrat/caprice32/releases/download/latest/cap32-win64.zip (https://github.com/ColinPitrat/caprice32/releases/download/latest/cap32-win64.zip)
I see you put version numbers on your releases. What kind of version tracking tool do you use?
Thank you for your attention.
Quote from: cpcitor on 21:33, 28 February 20
Issue
Integration is done by downloading source code from some "official" URL.
there is an (un)official but stable URL since 0117 for dev users like you
http://www.roudoudou.com/export/cpc/rasm/rasm_v0119_src.zip
Quote from: roudoudou on 23:27, 28 February 20
there is an (un)official but stable URL since 0117 for dev users like you
http://www.roudoudou.com/export/cpc/rasm/rasm_v0119_src.zip
Thanks! This is a much better URL!
Oh. This URL works when using a known interactive browser but fails when using Wget, which is what cpc-dev-tool-chain uses. Experimenting shows that the server rejects requests which have a User-Agent field containing the substring Wget.
I understand that some would had such an idea but find it somehow pointless as it's beyond easy to circumvent -- bad guys would use a different user agent on first query anyway. Were I worried about leechers on my servers, I would first host a robots.txt file at the root, following https://en.wikipedia.org/wiki/Robots_exclusion_standard which is obeyed by a number of programs like wget.
Anyway, thanks a lot!
update v0.120
- BIT,RES,SET may use deferred shifting value
- BANK directive may use NEXT as parameter to switch to next BANK space
- operator assignment are now supported
- may use tags in filenames with SAVE directive
- warn for huge shifting and force result to zero (as it's an architecture independant operation)
executables later...
update v0.121
- early stages MODULE support
- \ support (experimental)
- APlib Ultra integration (load&crunch + crunched section)
- bugfix segfault when trying to assemble a file that does not exists
- bugfix segfault with opened comment '/*' until the end of the file
- bugfix DEFB calculation with $ after crunched section
- proximity label beginning with BRK will generate an exportable breakpoint
- LIMIT directive evolution (mostly for #FFFF writing case)
- crunched INCBIN may use offset/length/remap before crunch
update v0.122
- proximity label enhancement with macro inception and loops
- new directive MODULE
documentation updated (Thanks Siko!) in v122!!!
and the release note as there is some oversights:
- you may use "BANK NEXT" to open next bank (snapshot or cartridge mode), useful when you are supposed to change bank order often
- you may SAVE a file with HOBETA header => SAVE 'myfile.bin',start,size,HOBETA
update v0.124
- new directive DF/DEFF in order to output Microsoft IEEE-754 40bits real
- pasmo compatibility option for DEFB/DEFW with multiple output and reference to current adress
update v0.123
- new option to treat warnings as errors
- bugfix segfault with empty struct declaration
- bugfix v0.121 regression for INCWAV
- check labels,variables and alias when declare macro name
Those versions numbers (0.1xx) with a program that will never reach 0.2 always make me smile. ;D
https://en.wikipedia.org/wiki/Software_versioning (https://en.wikipedia.org/wiki/Software_versioning)
just fix another (important) bug...will push win executables later
- bugfix EQU with current adress reference and crunched zones integration
update v0.126
- Rasm is able to mix LZsegments and contiguous ORG sections
example:
tabeul
defw script0
defw script1
defw script2
script0
org #4000,$
lz49
start1 : jr end1 : defs 100: djnz start1
end1
lzclose
org $
script1
org #4000,$
lz49
start2 : jr end2 : defs 100 : djnz start2
end2
lzclose
org $
script2
org #4000,$
lz49
start3 : jr end3 : defs 100 : djnz start3
end3
lzclose
update v0.127
- bugfix some memory leaks
windows execs soon
update v0.128
- bugfix moar memory leaks
- label code clean-up
new execs
update v0.129
- bugfix read overrun in pre-processor
- bugfix read overrun in snapshot encoding
- bugfix AMSDOS header creation with filename that contains a path
- force memory cleanup with MorphOS
- when a variable cannot be computed, check for directive names to avoid confusion
Yay! Thanks for using GitHub.
I'm subscribed to new releases, and that would make things easier for me!
Btw, if is OK to send you pull requests... may be we could add a Makefile for example :D
Quote from: reidrac on 18:18, 11 June 20
Yay! Thanks for using GitHub.
I'm subscribed to new releases, and that would make things easier for me!
Btw, if is OK to send you pull requests... may be we could add a Makefile for example :D
Yeah, all new releases will be posted to github. I will come back here to mention stable releases or huge updates :)
Rasm does not need makefile and compilation command line are in the header of rasm.c but i may add some compilation .bat .sh or mention this in the readme :)
Quote from: roudoudou on 18:47, 11 June 20
Yeah, all new releases will be posted to github. I will come back here to mention stable releases or huge updates :)
Rasm does not need makefile and compilation command line are in the header of rasm.c but i may add some compilation .bat .sh or mention this in the readme :)
Thanks for opening a github repo! https://github.com/EdouardBERGE/rasm
cpc-dev-tool-chain (https://github.com/cpcitor/cpc-dev-tool-chain/tree/master/tool/rasm) started incorporating rasm recently, though I have not adjusted makefile rules for user projects.
The issue is: by default rasm likes .asm suffix, while in SDCC, assembly source is .s (probably consistent with embedded systems traditions).
SDCC generates .asm files containing assembly generated by the C compiler (very handy to check for efficiency).
Thus, make clean deletes .asm files and they are excluded from source code history.
Currently I use .rasm for assembly source to be compiled by RASM, vs .s for assembly source to be compiled by sdasz80.
Quote from: cpcitor on 10:38, 12 June 20
Thanks for opening a github repo! https://github.com/EdouardBERGE/rasm (https://github.com/EdouardBERGE/rasm)
cpc-dev-tool-chain (https://github.com/cpcitor/cpc-dev-tool-chain/tree/master/tool/rasm) started incorporating rasm recently, though I have not adjusted makefile rules for user projects.
The issue is: by default rasm likes .asm suffix, while in SDCC, assembly source is .s (probably consistent with embedded systems traditions).
SDCC generates .asm files containing assembly generated by the C compiler (very handy to check for efficiency).
Thus, make clean deletes .asm files and they are excluded from source code history.
Currently I use .rasm for assembly source to be compiled by RASM, vs .s for assembly source to be compiled by sdasz80.
When there is no extension i try char *LTryExtension[]={".asm",".z80",".o",".dam",".mxm",".txt"
But if you give the fullname rasm will load it whatever the extension is, so i do not understand where is the issue?
Quote from: roudoudou on 18:47, 11 June 20
Rasm does not need makefile and compilation command line are in the header of rasm.c but i may add some compilation .bat .sh or mention this in the readme :)
Please don't reinvent the wheel. Makefiles are useful even for single-file builds because they remove the need for "some compilation .bat .sh or mention this in the readme". The simplest makefile has one more line than a shell script, and then it builds with "make" just like every other project that uses it.
Quote from: pelrun on 12:32, 12 June 20
Please don't reinvent the wheel. Makefiles are useful even for single-file builds because they remove the need for "some compilation .bat .sh or mention this in the readme". The simplest makefile has one more line than a shell script, and then it builds with "make" just like every other project that uses it.
Well, in perfect world maybe. But in real life Makefiles never work out of the box and you always have to dig inside, and to moan because it is over-complicated for nothing. :P
Quote from: OffseT on 19:47, 12 June 20
Well, in perfect world maybe. But in real life Makefiles never work out of the box and you always have to dig inside, and to moan because it is over-complicated for nothing. :P
it's obviously one makefile per OS so... why not a script? => because there is only one command line to compile rasm ;D
Read the funny manual!
Quote from: cpcitor on 10:38, 12 June 20
Thus, make clean deletes .asm files and they are excluded from source code history.
Currently I use .rasm for assembly source to be compiled by RASM, vs .s for assembly source to be compiled by sdasz80.
Use .z80 for example (I prefer it because I can set specific syntax highlighting for Z80).
Quote from: OffseT on 19:47, 12 June 20
Well, in perfect world maybe. But in real life Makefiles never work out of the box and you always have to dig inside, and to moan because it is over-complicated for nothing. :P
Don't blame friends that help you
You're conflating. Variety of build environments is not Make's fault.
Complaining like this is like blaming a friend that helps you because they don't have a solution for every problem of your life.
Different build systems for different kind of programs.
Programs with tons of dependencies on modern features often use different, higher level tools, because in those cases, pure makefile-based workflow cannot simply express the needs. Perhaps you have suffered some program where author wrote a big makefile in a situation where it was not the simplest solution.
Simple program, simple makefile.
rasm is simple to build, it uses basic file APIs along with standard input and output. It's typically a program perfectly suited for a simple makefile.
A simple makefile is where people are looking first.
When getting source code, people look at file names for hints.
Makefile is a traditional entry point.
A simple makefile is machine-executable documentation.
Programs need it too. IDE, packaging infrastructures, automated quality assurance tools like travis need machine-readable instructions. A two-line Makefile eases integration and avoids bugs due to different contexts using different build options.
No makefile feels like the author is too lazy, doesn't know how to write a two-line makefile.
Simple and convenient solution that always works
For the user, typing make is shorter than other options.
Even make -f Makefile.other is only a few more keystrokes using Tab key.
Such directory layout is very clear, shows that author is seasoned about portability, with default Makefile for gcc-compatible build environment and took care of making things easy for users of a number of platforms:
Makefile
Makefile.win-msvs
Makefile.dos-watcom
Makefile.morphos-gcc
Makefile.macos
source.c
In the case of RASM it *will* work out-of-the-box.
I wasn't going to push the point quite that hard. In fact I forked RASM so I could write the Makefile myself but I was beaten to the punch. Cheers!
Is not the end of the world, really.
I also write my own Makefile for rasm, for example for the rasm version I used in Kitsune's Curse:
all: rasm
rasm: rasm_v0119.c
gcc -s -O2 $< -o $@ -lm -lrt -march=native
clean:
rm -f rasm
.PHONY: all clean
I use GNU Make, but you can make it generic enough.
Quote from: reidrac on 10:17, 13 June 20
Is not the end of the world, really.
I also write my own Makefile for rasm, for example for the rasm version I used in Kitsune's Curse:
You makefile is nice and complete with usual patterns.
I went straight to the point when integrating RASM in cpc-dev-tool-chain (https://github.com/cpcitor/cpc-dev-tool-chain): after automatically fetching and unpacking rasm source, cpc-dev-tool-chain build system copies a strictly two lines makefile (https://github.com/cpcitor/cpc-dev-tool-chain/blob/master/tool/rasm/Makefile.rasm) into the source directory and calls it.
release v1.1 ;)
https://github.com/EdouardBERGE/rasm/releases/tag/v1.1
https://github.com/EdouardBERGE/rasm/releases/tag/v1.2
release v1.2
- nightly bugfix
- bugfix memory leaks and error management with includes in embedded rasm
- bugfix INCLZ4 directive
- many new autotests for include and crunch
- RUN directive do not force PPI configuration to #C0 if there is no second argument
- produce zero size file when there is no breakpoint
- new command line option -amper in order to use ampersand for hex values
- new directive BREAKPOINT_Z80 to produce #ED,#FF opcode
- new directives beginings GETTICK, DURATION (only a few instructions supported)
- new ROM mode to automatically save multiple numbered ROM files
- ability to split 16 bits registers in macro declaration (example: hl.low or {register}.high )
documentation will be updated later
new release v1.3
https://github.com/EdouardBERGE/rasm/releases/tag/v1.3
- extended cartridge support
- new directive LZSA1, LZSA2 for crunched code sections
- new directives INCLZSA1 and INCLZSA2 for binary import and LZSA crunching
- new directives XORMEM and SUMMEM to generate checksum of a memory area
- new directive TIMESTAMP to output date/time
- new TAPE option for SAVE directive
- new DMA import options with INCBIN directive (new checks & warnings)
- new enhanced instructions LD IX/IY,BC/DE & LD BC/DE,IX/IY
- new tag {SLOT} for extended cartridge management
- new suffix .HIGH and .LOW to split 16bits register in macro definition
- new option -msep to specify separator for labels inside modules
- new option -amper to use ampersand for hex values
- directive BRK now generates #ED,#FF opcode
- bugfix byte order for Microsoft real format
- bugfix DSK header with nightly build
- bugfix 16bits PCM wav import
- do not warn for missing file with INCLUDE in disabled condition
- do not export struct definition with symbols
- many warnings removed, cleanup, some draft for future functionalities
Great job done!
Hint to new users: You find the documentation inside the source code.
Quote from: GUNHED on 16:40, 24 November 20
Hint to new users: You find the documentation inside the source code.
always get the latest PDF on master branch because documentation is never up to date when i'm doing a release !
Writing documentation suxx. (I know that from own projects). But nevertheless we all need it. Thanks for this, it's made in an "easy to be understood" way. :) :)
Quote from: GUNHED on 16:50, 24 November 20
Writing documentation suxx. (I know that from own projects). But nevertheless we all need it. Thanks for this, it's made in an "easy to be understood" way. :) :)
anyway i'm always ok to answer any question by mail ;D
FR/EN documentation updated - thanks Siko!
download on github
https://github.com/EdouardBERGE/rasm/blob/master/documentation_EN.pdf
https://github.com/EdouardBERGE/rasm/blob/master/documentation_FR.pdf
Ouf ^^
https://github.com/EdouardBERGE/rasm/releases/tag/v1.4
new release v1.4
new TAPE output code from CNG in GPL2
new directive BUILDTAPE
new directives GETNOP to count Amstrad nops
new directives GETTICK to count Z80 ticks
new DMA options for Amstrad Plus WAV import
new LZSA directives for LZSA1 and LZSA2 compression
new ZX0 directives for ZX0 compression and backward compression
new CONFINE directive
new command line option for amper hex values usage
new command line option for quick ZX0 compression
new postfix .low and .high to split registers in macro definition
BANK tag may process proximity label
bugfix some warnings
bugfix IN A,(C) timing in rasm
bugfix moar timings in documentation
bugfix SRL reg16 alias
bugfix segfault when LZ section was not closed
bugfix compilation without third parties
latest directives will be documented soon (i hope :P )
Quote from: roudoudou on 09:58, 22 February 17
Official repository is now on github
https://github.com/EdouardBERGE/rasm (https://github.com/EdouardBERGE/rasm)
Github is a pain, anything else I would appreciate.
Took one click to get here - https://github.com/EdouardBERGE/rasm/releases
Quote from: GUNHED on 22:51, 03 February 21
Super chaotic, can't find it. Github SUXX!! (And I tell the other members of the group I'm a member all the time).
Can you please put something somewhere just to click at. I'm not willing to waste (now more) than 30 minutes to search a download for something I just can't find.
i put the release link each time i talk about a release :)
see immediate upper post
Quote from: GUNHED on 22:51, 03 February 21Super chaotic, can't find it. Github SUXX!!
:picard:
git clone ...
and compile for your platform.
What's wrong with a download link (working!) of a ZIP or whatever?
Quote from: GUNHED on 00:42, 04 February 21
What's wrong with a download link (working!) of a ZIP or whatever?
There is a direct link and it's working :-X
Then there is many binaries, just get the one you need, no useless ZIP or whatever because binaries are auto-crunched
(https://i.postimg.cc/CKtNQLD4/lapincompris.png)
Can we move on another subject please?
Maybe it's my Windows 7 or my browser, it's a pain in the back for me. 'Just klick and download' doesn't work for me. But nice if it works for everybody else.
Hi There ....
I am in the process of porting som old code to RASM, so far going pretty well
But I get a strange error when trying to assemble using directives defb, defm...
this eg.
; test.asm
org #4000
defm 'Banks: Name: SP AF',39
or when using defs...
I get this error:
Pre-processing [test.asm]
[test.asm:7] quote opened was not closed
Assembling
1 error
I am really lost... What am I doing wrong... Tried with defb directive as well!
Hope someone can help
Regards,Ygdrazil
PS. The code I am porting is from Maxam...
[/code]
change single quote with double quote for strings and DEFB
but i agree this is a bug i will fix ;D
Thanks :D !
Quote from: roudoudou on 22:24, 27 February 21
change single quote with double quote for strings and DEFB
but i agree this is a bug i will fix ;D
just tried to compile this on my Pi400 (Raspbian 64Bit) but I get an error :
rasm.c: In function 'Assemble':
rasm.c:17771:10: error: '*debug' is a pointer; did you mean to use '->'?
debug -> run=run;
^~
->
rasm.c:17771:17: error: 'run' undeclared (first use in this function)
debug -> run=run;
^~~
rasm.c:17771:17: note: each undeclared identifier is reported only once for each function it appears in
rasm.c:17772:10: error: '*debug' is a pointer; did you mean to use '->'?
debug -> start=minmem;
^~
->
make: *** [makefile:102: prod] Fehler 1
Hints ???
how do you compile it ?
Since it has a makefile I'll do a MAKE in console :laugh:
Its my fault
Will fix it
https://github.com/EdouardBERGE/rasm/releases/tag/v1.5
Release v1.5
new directive DELAYED_PRINT
new directive STARTINGINDEX + REPEAT options
new directives PROCEDURE, EXTERNAL, BUILDOBJ for kind of objects export
new shortcut ENDMODULE
new autotests + debug struct info RUN+START
new external function for emulators and assembling into RAM
ROM flat output for BUILDROM directive
use _setmode only with Visual Studio 14.0 and below
use custom strnlen with BorlandC
use only declarations from rasm.h
bugfix IX/IY invalid syntaxes
bugfix INCBIN wav preamp with DMA options
bugfix ZX snapshot output + RUN bugfix
bugfix TIMESTAMP and custom charset
bugfix Borland compatibility
bugfix segfault with wrong char in DEFB/DEFM string
bugfix segfault with quote not closed in the very last directive
bugfix INTn prefix behaviour
bugfix LD reg16,(IX/IY) alias
warn about ORG inside crunched section
compute alias values before crunching sections, this fix some side effects of EQU inside crunched sections
ZX0 firmware compatible decrunch routine
Linux version compiled with GCC v9.3.0
MS-DOS version compiled with Open-Watcom 1.9
Windows version compiled with Microsoft Compiler v19
Documentation is almost up to date (except release version number ^_^ )
new release :)
https://github.com/EdouardBERGE/rasm/releases/tag/v1.6
- ZX0 cruncher upgraded to v2 + new Z80 decrunchers
- do not export command line define(s)
- bugfix ZX0 backward compression
- bugfix automatic filetype search for main source
- bugfix autotests with 3rd parties disabled
- bugfix include paths search
- bugfix IFUSED, IFDEF, IFNDEF when used with MODULE directive
- bugfix file output with HOBETA header
- new option to export ROM description
- new option to export label with original case
for people following latest commit, i rewrote the floating point conversion to be more accurate (directives DEFR or DEFF)
still not enough evolutions/bugfix to make a release
new release 1.7
https://github.com/EdouardBERGE/rasm/releases/tag/v1.7
- bugfix snapshot v3 first chunks when memory cannot be crunched in RLE
- bugfix negative rounding for REAL conversion
- bugfix segfault with UTF8 char usage in strings
- bugfix quote starting with escaped char
- bugfix macOS support, new target install
- bugfix label import
- bugfix GETNOP/GETTICK LD (HL),im8 + some missing instructions added
- bugfix breakpoints missing when exporting for snap and breakpoint file
- bugfix undefined behaviour with EQU usage before declaration
- new Amstrad/Microsoft conversion to 5-bytes REAL with full precision
- new math function FILESIZE to get file size on disk
- new math function GETSIZE to get opcode size
- new poker option with a few cipher methods
- new directive CIPHERMEM to cipher memory
- new directive SNAPINIT to initialize memory with a snapshot
- new CONFINE option in order to enforce location
- new UTF8 support to convert legacy french or spanish char to proper Locomotive Basic values + new command line option
- more symbol exports with "ignore case" (and faster)
- GTILES option for INCBIN to import tiles with gray encoding
documentation NOT updated since 1.6
:D :D :D
Thank you.
Quote from: roudoudou on 00:14, 12 April 22new release 1.7
I tried to compile my pasmo program and I failed. I used
rasm -pasmo pi-cpc-cpm3.asm
and got a lot of error messages. The original pasmo works flawlessly. I have attached files of my old pasmo project.
Quote from: litwr on 09:00, 06 September 22Quote from: roudoudou on 00:14, 12 April 22new release 1.7
I tried to compile my pasmo program and I failed. I used
rasm -pasmo pi-cpc-cpm3.asm
and got a lot of error messages. The original pasmo works flawlessly. I have attached files of my old pasmo project.
yeah, Pasmo compatibility is to compile old Pasmo projects
i wrote the compatibility long time ago when Pasmo seemed abandonned
as Pasmo is back with active developpements, just use Pasmo if you like Pasmo syntax
8 months since the 1.7 release, here is an updated documentation (with almost all last Rasm improvements)
French documentation is now on http://rasm.wikidot.com/
English documentation is now on http://rasm.wikidot.com/english-index:home
Fantastic!
Thank you so much!
new release :)
https://github.com/EdouardBERGE/rasm/releases/tag/v1.8
- new up to date documentation on wikidot => http://rasm.wikidot.com/home:home
- new conditional directive ELSEIFNOT
- new math function IS_REGISTER
- new directives CPRINIT and SNAPINIT in order to initialise RASM memory with a cartridge or a snapshot
- new command line option to handler macro calls on multiple lines
- MAP output improvements
- MODULE support for EQU => Alias are now inside modules, like labels
- CHARSET can be used with string to string conversion
- removed ENDREPEAT and ENDREP literaly unused directives
- bugfix WATCOM compatibility issue
- bugfix STR endmark with CHARSET conversion
- bugfix CONFINE directive with ENFORCE parameter usage
- bugfix backslash usage with CHARSET defined for it
- bugfix memory leak with map output and alias usage
- bugfix memory overrun at memory cleanup
- bugfix preprocessor with include filename strictly ending the line