-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathln.tes
18 lines (17 loc) · 791 Bytes
/
ln.tes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
! ln - show the current line number !
[p[l ! save the p and l registers !
.up ! save the current position !
1ul ! set line counter to 1 !
< ! start loop !
."e ! if we are at the start !
1; ! exit from the loop !
| ! else !
ba-10"e ! if character is an EOL !
ql+1ul ! increment the line conuter by 1 !
' ! end of if !
' ! end of if !
r ! move back a character !
> ! end of loop !
qpj ! return to where we started !
ql= ! print the line number !
]p]l ! restore the p and l registers !