Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Assembly Code Not Aligned

Status
Not open for further replies.

Suraj143

Active Member
When I insert PIC Assembly code its not align & it is hard to read by the users.

I used many text editors & tabs align, but when I placed the code here its not allign. :(
 
hi Suraj,
Post a sample of the code that is not aligning correctly.
Are you using these to enclose your code text
Code:
  your text go's here

E
 
Not a lot can be done.. only the first tabs are translated all the rest are spaces..
C:
void main(void)       // original tabs seven space
   {
   for(x=0;x<2;x++)   // nest 1 three spaces
     {
     another nest;   // nest 2 three spaces
     }
   }
 
A bit more information would help, including a sample of your code. If you will post one copy using the code tags {code=asm} {/code} (replace curly brackets with regular rackets) and another copy as a .txt attachment, that may help more.

If you are using the MPLab suite, then one possibility is that you are using tabs, but you don't have the replace tabs with spaces box marked (Edit>Properties>"asm" file types):
upload_2015-10-3_6-49-59.png


John
 
Hi thanks for the input.

Oops sorry.In mplab I use tab sizes 4 or 6.When I going to place a code in this site I first copy the code to a notepad & do the alignment.After copy and paste it here.

How do you all do?
 
Last edited:
The important part is to use these tags:

[code]
mov a,b
hh (a few beginning spaces exist here and it's not lined up)
[/code]


This renders as:

Code:
mov    a,b
       hh

It will keep leading spaces. HOWEVER... in order to see it lined up as you type you would have to use courier. I set the font to courier between the code tags, but I should not have to.

In the original text, there are some leading spaces before the hh which were removed. The standard also likes to reduce multiple spaces to one space.

You can post large code fragments because you can scroll through them.

To actually see what I wrote in the edit box, quote my post. You don't have to post it.
More Options.. also provides Preview. I used a tag that won't render what's between the tags.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top