Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] IFDEF does not work #126

Open
mvac7 opened this issue May 2, 2024 · 0 comments
Open

[BUG] IFDEF does not work #126

mvac7 opened this issue May 2, 2024 · 0 comments
Assignees
Labels

Comments

@mvac7
Copy link

mvac7 commented May 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants