diff --git a/CHANGELOG.md b/CHANGELOG.md index 9edd0e1..e67dd73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # 変更履歴 +## 4.0.1 (2024-10-12) + +* macro.mac: マクロの引数に式を指定すると正しく展開されない不具合を修正。 + * `STRCPY`、`STRCAT`マクロの`rewind`引数 + * `STREND`、`STRLEN`マクロの`offset`引数 + + ## 4.0.0 (2024-10-06) * dosdef.mac, filesys.mac: 削除予定の機能はシンボル`__RUKA_ENABLE_OBSOLETE_MACRO__`を diff --git a/src/macro.mac b/src/macro.mac index bb84a78..8229da5 100644 --- a/src/macro.mac +++ b/src/macro.mac @@ -1,7 +1,7 @@ .nlist ;macro.mac - RUKA assembler macro for X680x0/Human68k(v3) by TcbnErik -;Last-modified: 2024-10-06 +;Last-modified: 2024-10-12 ; ;Copying and distribution of this file, with or without modification, ;are permitted in any medium without royalty provided the copyright @@ -65,7 +65,7 @@ STRCPY: .macro src,dst,rewind move.b (src)+,(dst)+ bne @loop .if argc>=3 - subq.l #-rewind,dst + subq.l #-(rewind),dst .endif .endm @@ -76,10 +76,10 @@ STREND: .macro areg,offset bne @loop .if argc<=1 subq.l #1,areg - .elif offset<=0 - subq.l #1-offset,areg - .elif offset>=2 - addq.l #offset-1,areg + .elif (offset)<=0 + subq.l #1-(offset),areg + .elif (offset)>=2 + addq.l #(offset)-1,areg .endif .endm