-
Notifications
You must be signed in to change notification settings - Fork 9
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
Make Conditional Assembly compatible with other cross-assemblers #103
Comments
I have seen that the asMSX supports conditions written without parentheses (I have not seen it in the manual), so the compatibility problem is reduced. If I have found a problem in the relational operator of equality. In Sjasm they support both A possible solution could be to add the equality operator It is worth highlighting, as a curiosity, in the not equal operator everyone supports References:
|
I don't think it's a good idea to use a single |
@duhow I agree with you. I have continued to study this topic and I don't think it offers any improvement. But I found a way, while listening to The Social Network soundtrack ;) I share it here in case it would be useful for someone who has the same need. If you add in the main code a Label that marks the name of the assembler (ASMSX, SJASM or TNIASM) and/or the runtime environment (MSXROM, MSXDOS or MSXBASIC), you can use Although all this at the moment will not work with asMSX until issue #90 is solved For asMSX and tniASM:;This label allows you to distinguish the assembler,
;when you need it when using conditional assembly
;Labels: ASMSX , SJASM or TNIASM
;Use it with the IFDEF statement
ASMSX:
;This label allows you to distinguish the runtime environment,
;when you need it when using conditional assembly
;Labels: MSXROM , MSXDOS or MSXBASIC
;Use it with the IFDEF statement
MSXROM: For Sjasm:;This label allows you to distinguish the assembler,
;when you need it when using conditional assembly
;Labels: ASMSX , SJASM or TNIASM
;Use it with the IFDEF statement
DEFINE SJASM
;This label allows you to distinguish the runtime environment,
;when you need it when using conditional assembly
;Labels: MSXROM , MSXDOS or MSXBASIC
;Use it with the IFDEF statement
DEFINE MSXROM Example of a conditional assembler use case:IFDEF MSXDOS
LD HL,$002D ;MSXID3=BIOS System constant (MSX version number)
LD A,[$FCC1] ;EXPTBL=main BIOS-ROM slot address
CALL $000C ;RDSLT=Reads the value of an address in another slot
EI ;RDSLT leaves interrupts disabled
ELSE
ld A,[$002D] ;MSXID3=BIOS System constant (MSX version number)
ENDIF |
This allows to use IFDEF ASMSX in order to perform specific actions in asMSX. Relates to #103
This allows to use IFDEF ASMSX in order to perform specific actions in asMSX. Relates to #103
Having #108 to define |
With #90 fixed, this should be already ok and we can close it. |
Hello asMSX team!
I am developing a routine that I would like to work with in the asMSX, Sjasm and tniASM cross-assemblers, but the peculiarities of defining constants and variables do not allow it, so I have gone to try to use conditional assembly.
While in Sjasm and tniASM they are compatible to a minimum, which allow the use of conditional assembly with this objective, in asMSX this is not fulfilled.
I would like to propose that this problem be discussed, thinking of facilitating the development of routines for common use without having to create and maintain several code files.
References:
The text was updated successfully, but these errors were encountered: