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.

Big mess

Status
Not open for further replies.

trennonix

New Member
Hello,
I'm very new to assembly programming and i'm very messy, so my code simply comes out ugly; but working
here's a nice piece of code that i wrote:
"
label8
call sendbit ;sendbit
rlf bytetosend,1 ;rotate to get next bit
decfsz ct1,1 ;decrement, if done proceed
goto label8 ;else recycle
;End data
"
i know...
don't worry about what the code actually does

So, does anyone here know of a program where i can simply copy-paste my code and it'll put opcodes in a column of their own, and put arguments in a common column as well, adjust spacing ... ??

Just something to make my code a bit more pleasant to look at.
Thanks guys.
 
Last edited:

gabeNC

Member
Kind of an odd question... maybe I don't understand what you are asking.

Are you using a text editor or an IDE? That and following standard code formatting practices will make your code look good, AND more importantly easy to maintain.
 

blueroomelectronics

Well-Known Member
Plus use code tags when posting code.

Code:
label8
    call sendbit ;sendbit
    rlf bytetosend,1 ;rotate to get next bit
    decfsz ct1,1 ;decrement, if done proceed
    goto label8 ;else recycle
;End data
 

trennonix

New Member
i'm using MPLAB, it's just that i don't take the time to write opcodes in capital, to adjust spacing between opcodes and their arguments...
when i compile my code, i get a warning for each and every command
"opcode in column 1"
plus it looks awful

MPLAB doesn't automatically put my opcodes in a column of their own...
i want a software that organises my code on its own
 

Wond3rboy

Member
A wierd 'problem'. Just use Tab on the first isntruction after the label. When you press enter for the next instruction all instructions will be lined up. When writing another label press enter and then backspce to return to the first column.
 
Last edited:

blueroomelectronics

Well-Known Member
i'm using MPLAB, it's just that i don't take the time to write opcodes in capital, to adjust spacing between opcodes and their arguments...
when i compile my code, i get a warning for each and every command
"opcode in column 1"
plus it looks awful

MPLAB doesn't automatically put my opcodes in a column of their own...
i want a software that organises my code on its own

I suggest you learn to use your shift & tab keys, programming syntax is crucial and neatness helps with readability later.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top