|
16 | 16 | .filenamespace c128lib |
17 | 17 |
|
18 | 18 | /* |
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. |
25 | 25 | */ |
26 | 26 | .macro invokeStackBegin(placeholderPtr) { |
27 | 27 | pla |
|
31 | 31 | } |
32 | 32 |
|
33 | 33 | /* |
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 | +*/ |
41 | 41 | .macro invokeStackEnd(placeholderPtr) { |
42 | 42 | lda placeholderPtr + 1 |
43 | 43 | pha |
|
46 | 46 | } |
47 | 47 |
|
48 | 48 | /* |
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 | +*/ |
55 | 55 | .macro pushParamB(value) { |
56 | 56 | lda #value |
57 | 57 | pha |
58 | 58 | } |
59 | 59 |
|
60 | 60 | /* |
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 | +*/ |
67 | 67 | .macro pushParamW(value) { |
68 | 68 | pushParamB(<value) |
69 | 69 | pushParamB(>value) |
70 | 70 | } |
71 | 71 |
|
72 | 72 | /* |
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 | +*/ |
79 | 79 | .macro pushParamBInd(ptr) { |
80 | 80 | lda ptr |
81 | 81 | pha |
82 | 82 | } |
83 | 83 |
|
84 | 84 | /* |
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 | +*/ |
91 | 91 | .macro pushParamWInd(ptr) { |
92 | 92 | pushParamBInd(ptr) |
93 | 93 | pushParamBInd(ptr + 1) |
94 | 94 | } |
95 | 95 |
|
96 | 96 | /* |
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 | +*/ |
102 | 102 | .macro pullParamB(placeholderPtr) { |
103 | 103 | pla |
104 | 104 | sta placeholderPtr |
105 | 105 | } |
106 | 106 |
|
107 | 107 | /* |
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 | +*/ |
113 | 113 | .macro pullParamW(placeholderPtr) { |
114 | 114 | pullParamB(placeholderPtr + 1) |
115 | 115 | pullParamB(placeholderPtr) |
116 | 116 | } |
117 | 117 |
|
118 | 118 | /* |
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 | +*/ |
124 | 124 | .macro pullParamWList(placeholderPtrList) { |
125 | 125 | .assert "list must be non empty", placeholderPtrList.size() > 0, true |
126 | 126 | pla |
|
0 commit comments