Skip to content

[BUG] Code processed despite IF condition is not met #126

@mvac7

Description

@mvac7

Hello asMSX team!

Describe the bug
I don't know if it is a pending issue or it is not working.
I have tested the attached code and when assembling it processes everything as if the condition was not interpreted.

Current output

-------------------------------------------------------------------------------
 asMSX v1.1.0 MSX cross-assembler. asMSX Team. [2023-11-04]
-------------------------------------------------------------------------------

Parsing file TestIFDEF.asm
Expanding Macros
DONE Expanding Macros
Expanding REPT
Assembling source file TestIFDEF.asm
Parsing error: syntax error
TestIFDEF.asm, line 11: syntax error

Code

.BIOS
.BIOSVARS

.FILENAME "TESTIFD.ROM"

;--------------------------------------------------------------------
LABELEXIST:

;Case 1: The Label does not exist. The ELSE must be processed.
IFDEF THISLABELNOTEXIST
    CONSTANT1:	EQU $01
    CONSTANT2:	EQU $02
ELSE
CONSTANT1	EQU $01
CONSTANT2	EQU $02
ENDIF

;Case 2: The Label exist. The ELSE does not have to be processed.
IFDEF LABELEXIST
CONSTANT3	EQU $03
CONSTANT4	EQU $04
ELSE
    CONSTANT3:	EQU $03
    CONSTANT4:	EQU $04
ENDIF
;--------------------------------------------------------------------

.PAGE	1
.ROM

MAIN:
  DI
  LD    SP,[HIMEM]	;($FC4A) Stack at the top of memory
  EI

LOOP:		
  halt
    
  ld     A,7         
  call    SNSMAT
  sub     A,11111011B    ;ESC
  JR      Z,EXIT_HELP
	
  jp  LOOP

EXIT_HELP:
  call 0

TestIFDEF.asm.TXT

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions