Skip to content

Commit d6f25a6

Browse files
authored
Revise assembly source code formatting specifications
Updated formatting guidelines for assembly source code in README.
1 parent 3a87705 commit d6f25a6

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ If you wish to contribute, please fork the repository and submit pull requests.
4747
Also, assembly source code is formatted to the following specifications:
4848

4949
- Spaces only (no tabs)
50-
- Labels start at column 1
51-
- Opcodes start at column 21
52-
- Operands start at column 31
53-
- Comments start at column 51
50+
- One space between opcode and operand, and operand and comments
51+
52+
This ensures a consistent experience and efficient representation in the repo.
5453

5554
Put [this file](https://github.com/nitros9project/nitros9/blob/main/scripts/pre-commit) in your .git/hooks folder to ensure that any source code you submit is automatically formatted.
5655

@@ -69,13 +68,13 @@ Take time to write clearly about what a line of code is doing. Avoid repeating t
6968
Instead of this:
7069

7170
```
72-
clra clear A
71+
clra clear A
7372
```
7473

7574
do this:
7675

7776
```
78-
clra set the path to standard input
77+
clra set the path to standard input
7978
```
8079

8180
## Write comments in lowercase and don't use punctuation
@@ -85,13 +84,13 @@ Comments may or may not be complete sentences; as such, dispense with the formal
8584
Instead of this:
8685

8786
```
88-
ldb #E$PNNF Prepare the "pathname not found" error.
87+
ldb #E$PNNF Prepare the "pathname not found" error.
8988
```
9089

9190
do this:
9291

9392
```
94-
ldb #E$PNNF prepare the "pathname not found" error
93+
ldb #E$PNNF prepare the "pathname not found" error
9594
```
9695
## Use full words
9796

@@ -100,15 +99,15 @@ Avoid abbreviations. Spelling out words increases the readability of the comment
10099
Instead of this:
101100

102101
```
103-
pshs d,x,y,u push regs
104-
leax ,u load path desc ptr in X
102+
pshs d,x,y,u push regs
103+
leax ,u load path desc ptr in X
105104
```
106105

107106
do this:
108107

109108
```
110-
pshs d,x,y,u save the registers on the stack
111-
leax ,u load the path descriptor pointer in X
109+
pshs d,x,y,u save the registers on the stack
110+
leax ,u load the path descriptor pointer in X
112111
```
113112

114113
## Ensure an empty line is at the end of a source file
@@ -119,12 +118,12 @@ the input do not abandon any important information on the last line.
119118
Instead of this:
120119

121120
```
122-
rts
121+
rts
123122
```
124123

125124
do this:
126125

127126
```
128-
rts
127+
rts
129128
130129
```

0 commit comments

Comments
 (0)