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

Implement macro definitions #13

Open
craigthomas opened this issue Apr 5, 2020 · 0 comments
Open

Implement macro definitions #13

craigthomas opened this issue Apr 5, 2020 · 0 comments

Comments

@craigthomas
Copy link
Owner

A macro is a block of assembly language statements that can be defined and then inserted into an assembly language program at any location. A macro is defined by a MACRO and then ENDM pair. A macro must also have a label. The macro is called within the assembly language routine by using the symbol name as if it were any other mnemonic. Values can be passed to macros within the operand field when specifying the macro. Passed values are specified within the macro definition with the \ character and the number for the value (the first passed value will be \0, the next \1, etc). For example:

TEST    MACRO
        LDA \0
        ENDM

        ORG $0E00
        TEST #$40
        END

Macros cannot be nested.

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

No branches or pull requests

1 participant