Jump to content
Sign in to follow this  
fransp

Label Access In Asm

Recommended Posts

Hi All,

 

BoostC.

How do I get the HIGH and LOW of an asm { label: } inside the asm itself.

Like:

 

asm{

Tentr: movlw HIGH(Tstart)

......

.......

Tstart: ....

 

}

 

The assembler sees the HIGH as an identifier. If I peek at other assembled code I see the above HIGH() construct.

I must be doing something wrong here, but what?

 

Thanks.

 

 

With best regards,

 

 

Frans.

Share this post


Link to post
Share on other sites
Hi All,

 

BoostC.

How do I get the HIGH and LOW of an asm { label: } inside the asm itself.

Like:

 

asm{

Tentr:  movlw HIGH(Tstart)

          ......

          .......

Tstart: ....

 

}

 

The assembler sees the HIGH as an identifier. If I peek at other assembled code I see the above HIGH() construct.

I must be doing something wrong here, but what?

 

Thanks.

 

 

With best regards,

 

 

Frans.

 

 

Update:

 

I did manage to get a hex file, although I did not check whether it would run.

Here how I worked around it.

Use another assembler, MPASM, I did it through changing the Toolsuite to C2C

But before doing that:

Add goto ' s for each label within the asm{}

Insert dummy arguments for the HIGH() and LOW()

Run in BoostC the compile and link.

Open the .asm

Cut and past the label, that's where the goto where for to get the label from, other wise BoostC will not make one in the asm when not referenced.

Add the HIGH and LOW to the label.

Remove the goto...

swith the toolsuite to C2C

run Assemble

You are done.

 

Despite the failed warning: for a path name being too long MAPASM produced a .lst and .hex

 

 

I am still in for any other 'solution', but for now my project is still on the road.

 

 

With best regards.

 

 

 

Frans.

Share this post


Link to post
Share on other sites
How do I get the HIGH and LOW of an asm { label: } inside the asm itself.

 

You can't do it in BoostC. Why do you need this?

 

Regards,

Pavel

Share this post


Link to post
Share on other sites
How do I get the HIGH and LOW of an asm { label: } inside the asm itself.

 

You can't do it in BoostC. Why do you need this?

 

Regards,

Pavel

 

 

hi Pavel,

 

Well I need a table in rom. BoostC only supports rom char* text = 'text'

unfortunately most of my data can not be translated into text.

 

Then I thought of doing it in asm{} but came upon this HIGH and LOW not recognized by BoostC, but if you look inside the .asm BoostC generates, you see them being there.

 

With best regards,

 

 

Frans.

Share this post


Link to post
Share on other sites
Well I need a table in rom. BoostC only supports rom char* text = 'text'

unfortunately most of my data can not be translated into text.

 

You can put any data into rom char*. Use '\' and than a number. For example to put 0,1,2,100,255 into rom use:

 

rom char *ptr = "\0\1\2\100\255";

 

Regards,

Pavel

Share this post


Link to post
Share on other sites
Well I need a table in rom. BoostC only supports rom char* text = 'text'

unfortunately most of my data can not be translated into text.

 

You can put any data into rom char*. Use '\' and than a number. For example to put 0,1,2,100,255 into rom use:

 

rom char *ptr = "\0\1\2\100\255";

 

Regards,

Pavel

 

Hi Pavel,

 

 

Yes , that works.

The numbers must be decimals.

A rather long _get, so if one is in tight ROM then avoid small tables.

 

 

Thanks for helping me out.

 

 

With best regards,

 

 

Frans.

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...