Пытаясь научиться использовать ассемблер ca65, я боролся за то, чтобы включил охрану . Поиск в Google и чтение ca65 Руководства пользователя не помогли. Вот минимальный пример, который выдает ошибку.
$ ls -l
total 16
-rw-r--r-- 1 me staff 60 Oct 22 19:40 65.inc
-rw-r--r-- 1 me staff 55 Oct 22 20:01 test.s
$
$ cat 65.inc
.ifndef _65_INC_
.define _65_INC_
.define NUMBER 1
.endif
$
$ cat test.s
.include "65.inc"
.include "65.inc"
lda #NUMBER
rts
$
$ ca65 test.s
65.inc(1): Error: Identifier expected
65.inc(2): Error: Identifier expected
65.inc(4): Error: Identifier expected
65.inc(4): Note: Macro was defined here
$
$ ls -l
total 16
-rw-r--r-- 1 me staff 60 Oct 22 19:40 65.inc
-rw-r--r-- 1 me staff 55 Oct 22 20:01 test.s
$
Если я включу 65.inc
один раз в test.s
, он собирается без проблем, как показано здесь:
$ ls -l
total 16
-rw-r--r-- 1 me staff 60 Oct 22 19:40 65.inc
-rw-r--r-- 1 me staff 37 Oct 22 20:07 test.s
$
$ cat 65.inc
.ifndef _65_INC_
.define _65_INC_
.define NUMBER 1
.endif
$
$ cat test.s
.include "65.inc"
lda #NUMBER
rts
$
$ ca65 test.s
$
$ ls -l
total 24
-rw-r--r-- 1 me staff 60 Oct 22 19:40 65.inc
-rw-r--r-- 1 me staff 295 Oct 22 20:07 test.o
-rw-r--r-- 1 me staff 37 Oct 22 20:07 test.s
$
$ ca65 --version
ca65 V2.17 - Git 153bb29
Чего мне не хватает?