Sjasm conditional assembly

Por Juan Luis

Master (141)

Imagen del Juan Luis

12-08-2019, 00:59

I'm trying to convert my old assembly code from Pasmo to Sjasm, but there are somethings I can't understand. I'm trying to avoid multiple include of a file like in C, defining labels, but it doesn't work.
-----------------------
; msx-bios.inc file
ifndef MSX_BIOS_INC
macro MSX_BIOS_INC
endmacro
...
EXTBIOS equ 0xFFCA
...
endif
-----------------------

-----------------------
; mapper.asm file
include "msx-bios.inc"

initMapper:
...
call EXTBIOS ; This is an error while assembling
...
-----------------------

-----------------------
; main.asm file
include "msx-bios.inc"
include "mapper.asm"
...
-----------------------

When I assemble main.asm I get an error that says EXTBIOS is defined twice.

- What is the proper way of making once inclusion?
- Another question. Is it possible to include global definitions from a sjasm module?

Thanks in advance.

Login sesión o register para postear comentarios

Por gdx

Enlighted (6071)

Imagen del gdx

12-08-2019, 01:57

Por ARTRAG

Enlighted (6923)

Imagen del ARTRAG

12-08-2019, 09:20

Look at the .lst file
You will see there when your label is included the second time