Skip to content

Commit 395a050

Browse files
committed
Uniforming code and documentation
1 parent 141c421 commit 395a050

File tree

6 files changed

+144
-144
lines changed

6 files changed

+144
-144
lines changed

lib/common.asm

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
.filenamespace c128lib
77

88
/*
9-
BasicUpstart for C128
9+
BasicUpstart for C128, creates a basic program that sys' the address
1010

11-
Syntax: BasicUpstart(address)
12-
Usage example: BasicUpstart($2000)
13-
Creates a basic program that sys' the address
14-
*/
11+
Syntax: BasicUpstart128(address)
12+
Usage example: BasicUpstart128($2000)
13+
14+
*/
1515
.macro BasicUpstart128(address) {
1616
.pc = $1c01 "C128 Basic"
1717
.word upstartEnd // link address
@@ -25,11 +25,11 @@ upstartEnd:
2525
}
2626

2727
/*
28-
* Why Kickassembler does not support bitwise negation on numerical values?
29-
*
30-
* Params:
31-
* value: byte to be negated
32-
*/
28+
Why Kickassembler does not support bitwise negation on numerical values?
29+
30+
Params:
31+
value: byte to be negated
32+
*/
3333
.function neg(value) {
3434
.return value ^ $FF
3535
}
@@ -38,18 +38,18 @@ upstartEnd:
3838
.assert "neg(%10101010) gives %01010101", neg(%10101010), %01010101
3939

4040
/*
41-
* Increases argument by one preserving its type (addressing mode). To be used in pseudocommands.
42-
*
43-
* Params:
44-
* arg: mnemonic argument
45-
*/
41+
Increases argument by one preserving its type (addressing mode). To be used in pseudocommands.
42+
43+
Params:
44+
arg: mnemonic argument
45+
*/
4646
.function incArgument(arg) {
4747
.return CmdArgument(arg.getType(), arg.getValue() + 1)
4848
}
4949

5050
/*
51-
* "Far" bne branch. Depending on the jump length it either does bne or beq/jmp trick.
52-
*/
51+
"Far" bne branch. Depending on the jump length it either does bne or beq/jmp trick.
52+
*/
5353
.macro fbne(label) {
5454
here: // we have to add 2 to "here", because relative jump is counted right after bne xx, and this instruction takes 2 bytes
5555
.if (here > label) {
@@ -74,8 +74,8 @@ upstartEnd:
7474
}
7575

7676
/*
77-
* "Far" bmi branch. Depending on the jump length it either does bne or beq/jmp trick.
78-
*/
77+
"Far" bmi branch. Depending on the jump length it either does bne or beq/jmp trick.
78+
*/
7979
.macro fbmi(label) {
8080
here: // we have to add 2 to "here", because relative jump is counted right after bne xx, and this instruction takes 2 bytes
8181
.if (here > label) {
@@ -102,8 +102,8 @@ upstartEnd:
102102
}
103103

104104
/*
105-
* Convert kbytes to bytes.
106-
*/
105+
Convert kbytes to bytes.
106+
*/
107107
.function toBytes(value) {
108108
.return value * 1024
109109
}

lib/invoke.asm

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
.filenamespace c128lib
1717

1818
/*
19-
* Preserves return address that is used with JSR.
20-
* Should be called at beginning of subroutine.
21-
*
22-
* Params:
23-
* placeholderPtr - pointer to the memory location (that is local variable of the subroutine)
24-
* where return address will be preserved.
19+
Preserves return address that is used with JSR.
20+
Should be called at beginning of subroutine.
21+
22+
Params:
23+
placeholderPtr - pointer to the memory location (that is local variable of the subroutine)
24+
where return address will be preserved.
2525
*/
2626
.macro invokeStackBegin(placeholderPtr) {
2727
pla
@@ -31,13 +31,13 @@
3131
}
3232

3333
/*
34-
* Restores return address that will be then used with RTS.
35-
* Should be called at the very end of subroutine just before RTS.
36-
*
37-
* Params:
38-
* placeholderPtr - pointer to the memory location (that is local variable of the subroutine)
39-
* from where return address will be restored.
40-
*/
34+
Restores return address that will be then used with RTS.
35+
Should be called at the very end of subroutine just before RTS.
36+
37+
Params:
38+
placeholderPtr - pointer to the memory location (that is local variable of the subroutine)
39+
from where return address will be restored.
40+
*/
4141
.macro invokeStackEnd(placeholderPtr) {
4242
lda placeholderPtr + 1
4343
pha
@@ -46,81 +46,81 @@
4646
}
4747

4848
/*
49-
* Pushes byte value as a parameter to the subroutine.
50-
* Such value should be then pulled in subroutine in opposite order.
51-
*
52-
* Params:
53-
* value - byte value of the parameter for subroutine
54-
*/
49+
Pushes byte value as a parameter to the subroutine.
50+
Such value should be then pulled in subroutine in opposite order.
51+
52+
Params:
53+
value - byte value of the parameter for subroutine
54+
*/
5555
.macro pushParamB(value) {
5656
lda #value
5757
pha
5858
}
5959

6060
/*
61-
* Pushes two bytes value as a parameter to the subroutine.
62-
* Such value should be then pulled in subroutine in opposite order.
63-
*
64-
* Params:
65-
* value - word value of the parameter for subroutine
66-
*/
61+
Pushes two bytes value as a parameter to the subroutine.
62+
Such value should be then pulled in subroutine in opposite order.
63+
64+
Params:
65+
value - word value of the parameter for subroutine
66+
*/
6767
.macro pushParamW(value) {
6868
pushParamB(<value)
6969
pushParamB(>value)
7070
}
7171

7272
/*
73-
* Pushes byte pointed by an address as a parameter to the subroutine.
74-
* Such value should be then pulled in subroutine in opposite order.
75-
*
76-
* Params:
77-
* ptr - pointer to the byte value of the parameter for subroutine
78-
*/
73+
Pushes byte pointed by an address as a parameter to the subroutine.
74+
Such value should be then pulled in subroutine in opposite order.
75+
76+
Params:
77+
ptr - pointer to the byte value of the parameter for subroutine
78+
*/
7979
.macro pushParamBInd(ptr) {
8080
lda ptr
8181
pha
8282
}
8383

8484
/*
85-
* Pushes two bytes value pointed by an address as a parameter to the subroutine.
86-
* Such value should be then pulled in subroutine in opposite order.
87-
*
88-
* Params:
89-
* ptr - pointer to the two bytes value of the parameter for subroutine
90-
*/
85+
Pushes two bytes value pointed by an address as a parameter to the subroutine.
86+
Such value should be then pulled in subroutine in opposite order.
87+
88+
Params:
89+
ptr - pointer to the two bytes value of the parameter for subroutine
90+
*/
9191
.macro pushParamWInd(ptr) {
9292
pushParamBInd(ptr)
9393
pushParamBInd(ptr + 1)
9494
}
9595

9696
/*
97-
* Pulls byte value from the stack and stores it under given address.
98-
*
99-
* Params:
100-
* placeholderPtr - pointer to the memory location where given byte will be pulled to
101-
*/
97+
Pulls byte value from the stack and stores it under given address.
98+
99+
Params:
100+
placeholderPtr - pointer to the memory location where given byte will be pulled to
101+
*/
102102
.macro pullParamB(placeholderPtr) {
103103
pla
104104
sta placeholderPtr
105105
}
106106

107107
/*
108-
* Pulls two bytes value from the stack and stores it under given address.
109-
*
110-
* Params:
111-
* placeholderPtr - pointer to the beginning of memory location where given two bytes will be pulled to
112-
*/
108+
Pulls two bytes value from the stack and stores it under given address.
109+
110+
Params:
111+
placeholderPtr - pointer to the beginning of memory location where given two bytes will be pulled to
112+
*/
113113
.macro pullParamW(placeholderPtr) {
114114
pullParamB(placeholderPtr + 1)
115115
pullParamB(placeholderPtr)
116116
}
117117

118118
/*
119-
* Pulls two bytes value from the stack and stores it under provided addresses.
120-
*
121-
* Params:
122-
* placeholderPtrList - List of memory locations, where given two byte value will be stored
123-
*/
119+
Pulls two bytes value from the stack and stores it under provided addresses.
120+
121+
Params:
122+
placeholderPtrList - List of memory locations, where given two byte value will be stored
123+
*/
124124
.macro pullParamWList(placeholderPtrList) {
125125
.assert "list must be non empty", placeholderPtrList.size() > 0, true
126126
pla

lib/kernal.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@
6363
.label SCRORG = $FFED // get current screen window size
6464
.label PLOT = $FFF0 // set or read cursor position
6565
// now uses $e4 - $ee, editor parameters
66-
.label JIOBASE = $FFF3
66+
.label JIOBASE = $FFF3

0 commit comments

Comments
 (0)