Skip to content

Commit

Permalink
fix (macro.mac): wrong expansion when argument is an expression
Browse files Browse the repository at this point in the history
  • Loading branch information
kg68k committed Oct 11, 2024
1 parent b6cf347 commit 35785c4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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__`
Expand Down
12 changes: 6 additions & 6 deletions src/macro.mac
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 35785c4

Please sign in to comment.