assembler line number

Talk about development tools here

Moderator: BigEvilCorporation

Post Reply
ob1
Very interested
Posts: 463
Joined: Wed Dec 06, 2006 9:01 am
Location: Aix-en-Provence, France

assembler line number

Post by ob1 » Fri Jul 03, 2015 9:12 am

Hello you all !

In EASy68k, you can use the character "*" as a reference to the current line number. For example, the instruction

Code: Select all

    ds.b    $2000-*
will reserve a space, padd, from the current line to the $2000 address.

Would any of you happen to know if there is a similar way of doing it with our current assembly tools ?

What I really want to do is pass the line number as a parameter to an asm macro. For example,

Code: Select all

.macro myMacro line
// some instruction
    bra    .LABEL1\line
// some instruction
    bra .LABEL2\line
// some instruction
.LABEL1\line:
// some instruction
.LABEL2\line:
// some instruction
.endm
I need to give a parameter. If I don't, when I call the macro twice, there will be two labels with the same name.

Of course, I can manually type down the line number when I call my macro (eg, "myMacro 785"), but it would be more elegant to simply put "myMacro *"

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Fri Jul 03, 2015 2:27 pm

* is current address
also, as far as I know it should be supported by most of assemblers.
and, about line number.... as far as I know there is no access to line number.
BUT you can write this:
dc.b _filename
:)
Image

Post Reply