学生時代に書いた OS になったはずの起点のソースコードです。(その授業は一応合格できました。)
修訂 | 4dfebdcc7138810148fd9b7e9c3dae7eb2455cb4 (tree) |
---|---|
時間 | 2013-07-08 13:50:29 |
作者 | Joel Matthew Rees <reiisi@user...> |
Commiter | Joel Matthew Rees |
I think this was where I got keys to repeat.
@@ -17,7 +17,9 @@ | ||
17 | 17 | 00510 KEYSCN RMB 8 OLD AND SCAN ARE NEGATIVE LOGIC |
18 | 18 | 00520 KEYCHG RMB 8 POSITIVE LOGIC FOR CHANGES IN LAST SLICE |
19 | 19 | 00530 KEYOPN RMB 8 POSITIVE LOGIC KEY RELEASE TABLE |
20 | -00535 KEYLAS FCB KMT | |
20 | +00535 KEYLAS FCB -1 | |
21 | +00536 KEYRAW FCB -1 | |
22 | +00537 KEYVAL FCB 0 | |
21 | 23 | 00540 KEYTIM FCB 0 |
22 | 24 | 00545 KEYRPT FCB 40 REPEAT PAUSE |
23 | 25 | 00546 KEYRAT FCB 6 REPEAT PERIOD |
@@ -199,7 +201,7 @@ | ||
199 | 201 | 03040 BEQ *+3 |
200 | 202 | 03050 RTI |
201 | 203 | 03060 * |
202 | -03065 CLR OVRDRV SWITCH TO WARP SPEED | |
204 | +03065 * CLR OVRDRV SWITCH TO WARP SPEED | |
203 | 205 | 03070 * INDEX PROCESS TABLE ENTRY |
204 | 206 | 03072 LEAX PROTBL,PCR |
205 | 207 | 03074 LDA #PROSIZ |
@@ -222,10 +224,15 @@ | ||
222 | 224 | 03200 LBSR CLICK |
223 | 225 | 03205 * |
224 | 226 | 03210 LDA TICK |
227 | +03211 SUBA #60 | |
228 | +03212 LBLO KEYRD | |
229 | +03213 INC SECOND | |
230 | +03214 STA TICK ALLOW TICKS TO OVERFLOW | |
231 | +03215 LDA SECOND | |
225 | 232 | 03220 SUBA #60 |
226 | 233 | 03230 LBLO KEYRD |
227 | 234 | 03240 INC MINUTE |
228 | -03250 STA SECOND ALLOW TICKS TO OVERFLOW SECONDS | |
235 | +03250 STA SECOND ALLOW SECONDS TO OVERFLOW | |
229 | 236 | 03260 LDA MINUTE |
230 | 237 | 03270 SUBA #60 |
231 | 238 | 03280 LBLO KEYRD |
@@ -243,7 +250,7 @@ | ||
243 | 250 | 03400 CMPA #2 |
244 | 251 | 03410 BNE NOLEAP |
245 | 252 | 03420 LDB YEAR |
246 | -03430 TSTB #3 MODULO 4 | |
253 | +03430 BITB #3 MODULO 4 | |
247 | 254 | 03440 BNE NOLEAP |
248 | 255 | 03450 LSRB YEAR/4 |
249 | 256 | 03460 LSRB |
@@ -381,7 +388,9 @@ | ||
381 | 388 | 04720 BEQ KYTRDM |
382 | 389 | 04730 PSHU A |
383 | 390 | 04740 BSR KYBPUT |
384 | -04750 KYTRDM TST ,U MORE ROWS? | |
391 | +04743 KYTRDM LDA KEYRAW | |
392 | +04745 STA KEYLAS | |
393 | +04750 TST ,U MORE ROWS? | |
385 | 394 | 04760 BNE KYTRDL |
386 | 395 | 04770 PULU A,B |
387 | 396 | 04780 KYTRUP LEAY KEYOPN,PCR |
@@ -390,10 +399,11 @@ | ||
390 | 399 | 04800 PSHU A,B |
391 | 400 | 04810 LDB #-1 |
392 | 401 | 04820 KYTRUL BSR KYTBIT |
402 | +04825 LDA KEYLAS | |
393 | 403 | 04830 CMPA KEYLAS |
394 | 404 | 04840 BNE KYTRUM |
395 | 405 | 04850 CLR KEYTIM |
396 | -04860 LDA #KMT | |
406 | +04860 LDA #-1 | |
397 | 407 | 04870 STA KEYLAS |
398 | 408 | 04880 KYTRUM TST ,U |
399 | 409 | 04890 BNE KYTRUL |
@@ -403,11 +413,12 @@ | ||
403 | 413 | 04930 * |
404 | 414 | 04940 * REPEATS |
405 | 415 | 04950 LDA KEYLAS |
406 | -04960 CMPA #KMT KEY? | |
416 | +04960 CMPA #-1 | |
407 | 417 | 04970 BEQ KYRPNO |
408 | 418 | 04980 LDB KEYTIM |
409 | 419 | 04990 CMPB KEYRPT |
410 | 420 | 05000 BLO KYRPNO |
421 | +05004 LDA KEYVAL | |
411 | 422 | 05005 PSHU A |
412 | 423 | 05006 BSR KYBPUT |
413 | 424 | 05010 SUBB KEYRAT |
@@ -425,7 +436,9 @@ | ||
425 | 436 | 05140 ASLA |
426 | 437 | 05150 ASLA |
427 | 438 | 05160 ADDA 1,U COLUMNS |
439 | +05165 STA KEYRAW | |
428 | 440 | 05170 LDA A,X CHARACTER |
441 | +05175 STA KEYVAL | |
429 | 442 | 05180 RTS |
430 | 443 | 05190 * |
431 | 444 | 05200 *BUFFER READ MUST ALSO BE UNINTERRUPTIBLE (SINGLE MPU) |
@@ -435,7 +448,8 @@ | ||
435 | 448 | 05240 CMPA #KBREAK SYSTEM ATTENTION? |
436 | 449 | 05250 BNE KYBPCH |
437 | 450 | 05260 STA SYSATT |
438 | -05270 LDA #KMT | |
451 | +05270 LDA #-1 | |
452 | +05275 STA KEYLAS | |
439 | 453 | 05280 BRA KYBPF NO REPEAT |
440 | 454 | 05290 KYBPCH CMPA #KMT |
441 | 455 | 05300 BEQ KYBPF |
@@ -451,11 +465,11 @@ | ||
451 | 465 | 05400 LDA #12 |
452 | 466 | 05410 ADDA BEEP |
453 | 467 | 05420 STA BEEP |
454 | -05430 LDA #KMT | |
468 | +05430 LDA #-1 | |
469 | +05435 STA KEYLAS | |
455 | 470 | 05440 BRA KYBPF |
456 | 471 | 05450 KYBPNF STX KEYIN |
457 | -05460 KYBPF STA KEYLAS | |
458 | -05470 CLR KEYTIM | |
472 | +05470 KYBPF CLR KEYTIM | |
459 | 473 | 05480 PULS A,X,CC,PC |
460 | 474 | 05490 * |
461 | 475 | 10000 * |
@@ -575,6 +589,35 @@ | ||
575 | 589 | 20660 STD ,U |
576 | 590 | 20670 PULS A,B,X,PC |
577 | 591 | 20680 * |
592 | +20690 VITRAN PSHS A | |
593 | +20700 LDA ,U | |
594 | +20710 CMPA #' ' | |
595 | +20720 BLO VITRDF | |
596 | +20730 CMPA #'? | |
597 | +20740 BHI *+6 | |
598 | +20750 ORA #$40 UNINVERT | |
599 | +20760 BRA VITRET | |
600 | +20770 CMPA #'^ | |
601 | +20780 BLS VITRET PASS IT ON | |
602 | +20790 CMPA #$60 GRAVE ACCENT | |
603 | +20800 BHS *+6 | |
604 | +20810 LDA #$20 UNDERSCORE IS INVERTED SPACE | |
605 | +20820 BRA VITRET | |
606 | +20830 BHI *+6 | |
607 | +20840 LDA #$27 INVERTED ACCENT | |
608 | +20850 BRA VITRET | |
609 | +20860 CMPA #$7C BAR | |
610 | +20870 BNE *+6 | |
611 | +20880 LDA #$3A INVERTED COLON | |
612 | +20890 BRA VITRET | |
613 | +20900 CMPA #$7F DELETE | |
614 | +20910 BHS VITRDF | |
615 | +20920 ANDA #$1F LOWER CASE IS INVERTED CAP ALPHA | |
616 | +20930 VITRET STA ,U | |
617 | +20940 PULS A,PC | |
618 | +20950 VITRDF LDA #$3F INVERTED ? FOR BAD CODES | |
619 | +20960 BRA VITRET | |
620 | +20970 * | |
578 | 621 | 50000 O EQU * |
579 | 622 | 50010 * STARTUP CODE |
580 | 623 | 50020 * INTIALIZE PORTS |
@@ -615,14 +658,17 @@ | ||
615 | 658 | 50380 LDX #$400 |
616 | 659 | 50390 WAITIQ CLR ,-U WINDOW 0 |
617 | 660 | 50410 LBSR GETKEY |
661 | +50411 LDA ,U | |
662 | +50412 CMPA #3 | |
663 | +50413 BEQ IQDONE | |
664 | +50419 LBSR VITRAN | |
618 | 665 | 50420 PULU A |
619 | 666 | 50430 STA ,X+ |
620 | 667 | 50440 CMPX #$600 |
621 | 668 | 50450 BLO *+5 |
622 | 669 | 50460 LDX #$400 |
623 | -50470 CMPA #3 | |
624 | -50480 BNE WAITIQ | |
625 | -50485 ORCC #IRQMSK | |
670 | +50480 BRA WAITIQ | |
671 | +50485 IQDONE ORCC #IRQMSK | |
626 | 672 | 50490 LDA KEYCOL+1 |
627 | 673 | 50500 ANDA #.NOT.1 |
628 | 674 | 50510 STA KEYCOL+1 |