-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNOTES.txt
566 lines (502 loc) · 14.6 KB
/
NOTES.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
/ SNL Skip if Nonzero Link
/ SZL Skip if Zero Link
/ SMA Skip if Minus Accumulator. Skip on AC < 0
/ SZA Skip if Zero Accumulator. Skip on AC = 0
/ SPA Skip if Positive Accumulator. Skip on AC >= 0
/ SNA Skip if Nonzero Accumulator. Skip on AC <> 0
/ SMA SZA Skip if Less than or Equal to Zero
/ SPA SNA Skip if Greater than Zero
/ SZA SNL Skip on AC = 0 or L <> 0
/ SNA SZL Skip on AC <> 0 and L = 0
/ SMA SNL Skip on AC < 0 or L <> 0
/ SPA SZL Skip on AC >= 0 and L = 0
/ SMA SZA Skip on AC <= 0
/ SPA SNA Skip on AC > 0
/ SMA SZA SNL Skip on AC <= 0 or L <> 0
/ SPA SNA SZL Skip on AC > 0 and L=0
In: numH, numL
Out L, src
FndLin src tmp tmpH tmpL
Compar Ctype tmp arg1H arg1L arg2H arg2L resH resL
/ The octal set:
/
/ 000 nul 001 soh 002 stx 003 etx 004 eot 005 enq 006 ack 007 bel
/ 010 bs 011 ht 012 nl 013 vt 014 np 015 cr 016 so 017 si
/ 020 dle 021 dc1 022 dc2 023 dc3 024 dc4 025 nak 026 syn 027 etb
/ 030 can 031 em 032 sub 033 esc 034 fs 035 gs 036 rs 037 us
/ 040 sp 041 ! 042 " 043 # 044 $ 045 % 046 & 047 '
/ 050 ( 051 ) 052 * 053 + 054 , 055 - 056 . 057 /
/ 060 0 061 1 062 2 063 3 064 4 065 5 066 6 067 7
/ 070 8 071 9 072 : 073 ; 074 < 075 = 076 > 077 ?
/ 100 @ 101 A 102 B 103 C 104 D 105 E 106 F 107 G
/ 110 H 111 I 112 J 113 K 114 L 115 M 116 N 117 O
/ 120 P 121 Q 122 R 123 S 124 T 125 U 126 V 127 W
/ 130 X 131 Y 132 Z 133 [ 134 \ 135 ] 136 ^ 137 _
/ 140 ` 141 a 142 b 143 c 144 d 145 e 146 f 147 g
/ 150 h 151 i 152 j 153 k 154 l 155 m 156 n 157 o
/ 160 p 161 q 162 r 163 s 164 t 165 u 166 v 167 w
/ 170 x 171 y 172 z 173 { 174 | 175 } 176 ~ 177 del
/
/
/ 110;145;154;154;157;54;40;167;157;162;154;144;41;12;15
/
/ Block copying
/
/ 1 - From keybuf to code - Can copy in any direction
/ ABCDEFGH abcdefghijklmnopqrstuvwxyz
/ ABCDEFGH abcdefghijklmnopqrstuvwxyzABCDEFGH
/
/ 2 - Make new space inside code - Must copy backwards
/ ABCDEFGH abcdefghijklmnopqrstuvwxyzABCDEFGH
/ ABCDEFGH abcdefghi-----jklmnopqrstuvwxyzABCDEFGH
/
/ 3 - Delete a block inside code - Must copy forwards
/ ABCDEFGH abcdefghi-----jklmnopqrstuvwxyzABCDEFGH
/ ABCDEFGH abfghi-----jklmnopqrstuvwxyzABCDEFGH
/
/
/ DEFINE DBLADD A B
/ <CLA CLL; TAD A+1; TAD B+1; DCA A+1; RAL; TAD A; TAD B; DCA A>
/
/ DEFINE DSHFT C D
/ <CLA CLL; TAD C; RAL; DCA C; TAD D; RAL; DCA D>
/
/ DEFINE DMOVE E F
/ <CLA; TAD E; DCA F; TAD E+1; DCA F+1>
/
/ DEFINE DBLSUB G H TE
/ <CLA CLL; TAD H; CMA; DCA TE; TAD H+1; CIA CLL; SZL; ISZ TE; NOP CLL; TAD G+1; DCA G+1; RAL; TAD G; TAD TE; DCA G>
/
/
/
/ BCD functions from DECUS http://dustyoldcomputers.com/pdp-common/reference/papertapes/decus/decus-8-100.pal
/ http://so-much-stuff.com/pdp8/tapes/digital.html
/
/ figlet -W -f standard '* variables' | sed 's/^/\/\/ /g'
/
/ A 24 bit signed integet is +/- 8 388 607
/
//
//
// ____ ____ ___ ___
// |___ \ |___ \ / _ \ / _ \
// __) | __) | | | | | | | | |
// / __/ / __/ | |_| | | |_| |
// |_____| |_____| \___/ \___/
//
// ____ _ _ ___ ___
// |___ \ | || | / _ \ / _ \
// __) | | || |_ | | | | | | | |
// / __/ |__ _| | |_| | | |_| |
// |_____| |_| \___/ \___/
//
// _____ ___ ___ ___
// |___ / / _ \ / _ \ / _ \
// |_ \ | | | | | | | | | | | |
// ___) | | |_| | | |_| | | |_| |
// |____/ \___/ \___/ \___/
//
// _____ ____ ___ ___
// |___ / |___ \ / _ \ / _ \
// |_ \ __) | | | | | | | | |
// ___) | / __/ | |_| | | |_| |
// |____/ |_____| \___/ \___/
//
//
//
//
// _____ _ _ ___ ___
// |___ / | || | / _ \ / _ \
// |_ \ | || |_ | | | | | | | |
// ___) | |__ _| | |_| | | |_| |
// |____/ |_| \___/ \___/
//
// _____ __ ___ ___
// |___ / / /_ / _ \ / _ \
// |_ \ | '_ \ | | | | | | | |
// ___) | | (_) | | |_| | | |_| |
// |____/ \___/ \___/ \___/
//
//
// _ _ ____ ___ ___
// | || | |___ \ / _ \ / _ \
// | || |_ __) | | | | | | | | |
// |__ _| / __/ | |_| | | |_| |
// |_| |_____| \___/ \___/
//
// _ _ _ _ ___ ___
// | || | | || | / _ \ / _ \
// | || |_ | || |_ | | | | | | | |
// |__ _| |__ _| | |_| | | |_| |
// |_| |_| \___/ \___/
//
// _ _ __ ___ ___
// | || | / /_ / _ \ / _ \
// | || |_ | '_ \ | | | | | | | |
// |__ _| | (_) | | |_| | | |_| |
// |_| \___/ \___/ \___/
//
//
// ____ ___ ___ ___
// | ___| / _ \ / _ \ / _ \
// |___ \ | | | | | | | | | | | |
// ___) | | |_| | | |_| | | |_| |
// |____/ \___/ \___/ \___/
//
// ____ ____ ___ ___
// | ___| |___ \ / _ \ / _ \
// |___ \ __) | | | | | | | | |
// ___) | / __/ | |_| | | |_| |
// |____/ |_____| \___/ \___/
//
// ____ _ _ ___ ___
// | ___| | || | / _ \ / _ \
// |___ \ | || |_ | | | | | | | |
// ___) | |__ _| | |_| | | |_| |
// |____/ |_| \___/ \___/
//
// ____ __ ___ ___
// | ___| / /_ / _ \ / _ \
// |___ \ | '_ \ | | | | | | | |
// ___) | | (_) | | |_| | | |_| |
// |____/ \___/ \___/ \___/
//
// __ ___ ___ ___
// / /_ / _ \ / _ \ / _ \
// | '_ \ | | | | | | | | | | | |
// | (_) | | |_| | | |_| | | |_| |
// \___/ \___/ \___/ \___/
//
// __ ____ ___ ___
// / /_ |___ \ / _ \ / _ \
// | '_ \ __) | | | | | | | | |
// | (_) | / __/ | |_| | | |_| |
// \___/ |_____| \___/ \___/
//
// __ _ _ ___ ___
// / /_ | || | / _ \ / _ \
// | '_ \ | || |_ | | | | | | | |
// | (_) | |__ _| | |_| | | |_| |
// \___/ |_| \___/ \___/
//
// __ __ ___ ___
// / /_ / /_ / _ \ / _ \
// | '_ \ | '_ \ | | | | | | | |
// | (_) | | (_) | | |_| | | |_| |
// \___/ \___/ \___/ \___/
// /
// _____ ___ ___ ___
// |___ | / _ \ / _ \ / _ \
// / / | | | | | | | | | | | |
// / / | |_| | | |_| | | |_| |
// /_/ \___/ \___/ \___/
//
// _____ ____ ___ ___
// |___ | |___ \ / _ \ / _ \
// / / __) | | | | | | | | |
// / / / __/ | |_| | | |_| |
// /_/ |_____| \___/ \___/
//
// _____ _ _ ___ ___
// |___ | | || | / _ \ / _ \
// / / | || |_ | | | | | | | |
// / / |__ _| | |_| | | |_| |
// /_/ |_| \___/ \___/
//
// _____ __ ___ ___
// |___ | / /_ / _ \ / _ \
// / / | '_ \ | | | | | | | |
// / / | (_) | | |_| | | |_| |
// /_/ \___/ \___/ \___/
//
/
/https://user-images.githubusercontent.com/325326/65816829-ed435100-e200-11e9-9440-e0df4f8777a1.png
/https://user-images.githubusercontent.com/325326/65816830-ed435100-e200-11e9-8f48-ff7796cf4fc1.png
/
/ -20 = -20
/ -20 < -10
/ -20 < 0
/ -20 < 10
/ -20 < 20
/ -10 > -20
/ -10 = -10
/ -10 < 0
/ -10 < 10
/ -10 < 20
/ 0 > -20
/ 0 > -10
/ 0 = 0
/ 0 < 10
/ 0 < 20
/ 10 > -20
/ 10 > -10
/ 10 > 0
/ 10 = 10
/ 10 < 20
/ 20 > -20
/ 20 > -10
/ 20 > 0
/ 20 > 10
/ 20 = 20
/ ========= =========== =============== =============== ==================
/ NEG - NEG -1 - -1= 0 -1 - -128= 127 -128 - -1= -127 -128 - -128= 0
/ NEG - POS -1 - 1=- 2 -1 - 127= -128 -128 - 1= -129 -128 - 127= -255
/ POS - NEG 1 - -1= 2 1 - -128= 129 127 - -1= 128 127 - -128= 255
/ POS - POS 1 - 1= 0 1 - 127= -126 127 - 1= 126 127 - 127= 0
/ ========= =========== =============== =============== ==================
/
/
/
/
/
/
6000: 0000 0001 0006 7754 7740 7753 7741 0000
6010: 0000 0144 0011 7756 7777 0101 7774 7756
6020: 7777 0102 0000<0000 0310 0010 7757 7777
6030: 0121 7773 7777 0127>0000 0016 7754 7777
6040: 0101 7773 7777 0000 0620 0014 7757 7777
6050: 0101 7773 7777 0101 7765 7776 0036 1100
6060: 0000 0000 0764 0010 7756 7775 0101 0102
6070: 0103 7775 0000 7777 7402 7402 7402 7402
6100: 7402 7402 7402 7402 7402 7402 7402 7402
6110: 7402 7402 7402 7402 7402 7402 7402 7402
6000: 0000 0001 0006 7754 7740 7753 7741 0000 // ORIGINAL
6010: 0000 0144 0011 7756 7777 0101 7774 7756 // ORIGINAL
6020: 7777 0102 0000<0000 0310 0010 7757 7777 // ORIGINAL
6030: 0101 7773 7777 0102 0000 0000 0454 0016 // ORIGINAL
6040: 7754 7777 0101 7773 7777 0102 7753 7777 // ORIGINAL
6050: 0103 7773 7777 0104 0000 0000 0620 0014 // ORIGINAL
6060: 7757 7777 0101 7773 7777 0101 7765 7776 // ORIGINAL
6070: 0036 1100 0000 0000 0764 0010 7756 7775 // ORIGINAL
6100: 0101 0102 0103 7775 0000 7777 // ORIGINAL
6000: 0000 0001 0006 7754 7740 7753 7741 0000 // LINE 200 MARKED
6010: 0000 0144 0011 7756 7777 0101 7774 7756
6020: 7777 0102 0000 ---- ---- ---- ---- ----
6030: ---- ---- ---- ---- ---- 0000 0454 0016
6040: 7754 7777 0101 7773 7777 0102 7753 7777
6050: 0103 7773 7777 0104 0000 0000 0620 0014
6060: 7757 7777 0101 7773 7777 0101 7765 7776
6070: 0036 1100 0000 0000 0764 0010 7756 7775
6100: 0101 0102 0103 7775 0000 7777
6000: 0000 0001 0006 7754 7740 7753 7741 0000 // LINE 200 REMOVED
6010: 0000 0144 0011 7756 7777 0101 7774 7756 // LINE 200 REMOVED
6020: 7777 0102 0000 0000 0454 0016 7754 7777 // LINE 200 REMOVED
6030: 0101 7773 7777 0102 7753 7777 0103 7773 // LINE 200 REMOVED
6040: 7777 0104 0000 0000 0620 0014 7757 7777 // LINE 200 REMOVED
6050: 0101 7773 7777 0101 7765 7776 0036 1100 // LINE 200 REMOVED
6060: 0000 0000 0764 0010 7756 7775 0101 0102 // LINE 200 REMOVED
6070: 0103 7775 0000 7777 // LINE 200 REMOVED
/
NEW
10 LET A=50
20 LET B=20
30 LET C=A+B
31 LET D=A-B
32 LET E=A*B
33 LET F=E/3
50 PRINT A
51 PRINT B
52 PRINT C
53 PRINT D
54 PRINT E
55 PRINT F
60 END
NEW
10 LET A=110
20 GOTO A
30 PRINT 30
31 END
100 PRINT 100
101 END
110 PRINT 110
111 END
120 PRINT 120
121 END
new
4 rem
5 rem Hello World program
6 rem
new
10 let N = 1
20 ? "Hello world #"; N
30 let N = N + 1
40 if N > 5 then goto 100
50 goto 20
100 ? "Bye world..."
110 end
4 rem
5 rem Hello World program
6 rem
NEW
10 PRINT A
20 PRINT B
30 PRINT "AA"
40 PRINT "BB"
50 END
NEW
10 LET A = 0
20 PRINT A;
30 LET A = A + 1
40 IF A < 10 THEN GOTO 20
50 END
-------------------------------------------------------
new
free
5 LET N = 100
10 LET A = 0 - N
20 LET B = 0 - N
30 IF A > B THEN PRINT A ; " > " ; B
40 IF A < B THEN PRINT A ; " < " ; B
50 IF A = B THEN PRINT A ; " = " ; B
60 IF A <> B THEN PRINT A ; " <> " ; B
70 IF A >= B THEN PRINT A ; " >= " ; B
80 IF A <= B THEN PRINT A ; " <= " ; B
90 LET B = B + 1
100 IF B <= N THEN GOTO 30
110 LET A = A + 1
120 IF A <= N THEN GOTO 20
130 END
free
>run
<
!
{
>20 LET B=10
>run
=
}
{
>20 LET B=9
>run
>
!
}
---------------------------------------------------------
new
10 print "Input first number:";
20 input A
30 print "Input second number:";
40 input B
50 if A = B then print "The numbers are the same"
60 if A > B then print "The first number is largest"
70 if A < B then print "The second number is largest"
80 end
list
new
10 print "Number1:";
20 input A
30 print "Number2:";
40 input B
50 if A = B then print "Same"
60 if A > B then print "#1 is largest"
70 if A < B then print "#2 is largest"
80 end
list
new
10 PRINT "A"
20 PRINT "B"
30 PRINT "C"
40 PRINT "A" ; "B" ; "C"
50 PRINT "A" ;
51 PRINT "B" ;
52 PRINT "C"
60 PRINT 0
61 PRINT 1
62 PRINT 2
70 PRINT 0 ; 1 ; 2
80 print 0 ;
81 print 1 ;
82 print 2
90 print "A=" ; A ; "0="; 0
999 END
list
new
10 PRINT "Random ";
20 LET A = RND()
30 PRINT A
40 GOTO 10
50 END
list
new
10 LET A = RND() % 2
30 IF A = 0 THEN PRINT "/";
31 IF A = 1 THEN PRINT "\";
40 GOTO 10
list
new
10 LET A = 11
11 LET B = 0 - A
12 LET C = 3
13 LET D = 0 - C
20 PRINT A ; " % " ; C; " SHOULD BE 2, IS "; A % C
21 PRINT B ; " % " ; C; " SHOULD BE -2, IS "; B % C
22 PRINT A ; " % " ; D; " SHOULD BE 2, IS "; A % D
23 PRINT B ; " % " ; D; " SHOULD BE -2, IS "; B % D
50 end
list
new
10 LET A = 1 : LET B = 2
30 END
80 REMHHHHHHHHHH
70 REMGGGGGGGGGG
60 REMFFFFFFFFFF
50 REMEEEEEEEEEE
40 REMDDDDDDDDDD
30 REMCCCCCCCCCC
20 REMBBBBBBBBBB
10 REMAAAAAAAAAA
10 LET A = 10 : LET B = 20
15 PRINT "Enter new value for B:" ; : INPUT B
20 PRINT "HELLO " ; : PRINT A ; " and " ; B
30 PRINT "WORLD " ; : PRINT 10 ; " and " ; 20
40 GOTO 50 : LET A = 1
45 LET A = 2
50 PRINT "A IS STILL " ; A
60 LET A = 1 : GOTO 70
65 LET A = 2
70 PRINT "A IS NOW " ; A : LET A = 3 : PRINT "AND NOW " ; A
80 PRINT 1 + 2 * 4 / 2 ; " issit 6?"
10015 REMPP
10014 REMOOOOOOOOOO
10013 REMNN
10012 REMMMMMMMMMMM
10011 REMLL
10010 REMKKKKKKKKKK
10009 REMJJ
10008 REMIIIIIIIIII
10007 REMHH
10006 REMGGGGGGGGGG
10005 REMFF
10004 REMEEEEEEEEEE
10003 REMDD
10002 REMCCCCCCCCCC
10001 REMBB
10000 REMAAAAAAAAAA
new
10 PRINT "Start"
20 GOSUB 100
30 PRINT "End"
40 END
100 PRINT "In subroutine"
110 GOSUB 200
120 RETURN
200 PRINT "In sub-subroutine"
210 RETURN
0000
7777 7777 7777 7777 7777 0005
6023 0001
7777 7777 7777 7777 7777 0005
7777 7777 7777 7777 7777 0005
6076 0001
7777 7777 7777 7777 7777 0005
10 FOR A = 5555 to 6666
11 FOR B = 7777 to 8888
20 GOSUB 100
30 END
100 PRINT A ; B
110 NEXT A
120 END
10 FOR A = 5555 TO 6666
20 PRINT A
30 NEXT A
40 PRINT A