Mercurial > hg > Members > kono > nitros9-code
comparison 3rdparty/packages/sierra/objs_lsl/sierra.asm @ 2599:67f9b769969f
Added two routines to get MMU images instead of trying raw reads of
$FFA0-$FFAF. This is required for memory >512K.
Also made some code simpler. R.Gault
author | robertgault |
---|---|
date | Thu, 05 Jan 2012 12:24:14 +0000 |
parents | b8dc2c8bfa03 |
children |
comparison
equal
deleted
inserted
replaced
2598:95d96304f4f1 | 2599:67f9b769969f |
---|---|
12 * Disassembly of original distribution and merged in comments from | 12 * Disassembly of original distribution and merged in comments from |
13 * an earlier disasm dated 1992. | 13 * an earlier disasm dated 1992. |
14 * | 14 * |
15 * 1 2003/03/10 Boisy G. Pitre | 15 * 1 2003/03/10 Boisy G. Pitre |
16 * Monitor type bug now fixed. | 16 * Monitor type bug now fixed. |
17 * 2 2012/01/05 Robert Gault | |
18 * Converted raw reads of $FFA0-$FFAF to a routine that gets images | |
19 * from the system. Now works with 2 or 8Meg systems. Unfortunately | |
20 * it was necessary to make buffers within the code rather than data | |
21 * area because it was safer given data was shared with other modules. | |
22 * | |
23 * Simplified some other routines. | |
17 | 24 |
18 *Monitor defs | 25 *Monitor defs |
19 #COMP equ 0 | 26 #COMP equ 0 |
20 #RGB equ 1 | 27 #RGB equ 1 |
21 #MONO equ 2 | 28 #MONO equ 2 |
29 nam sierra | 36 nam sierra |
30 ttl Sierra setup module | 37 ttl Sierra setup module |
31 | 38 |
32 ifp1 | 39 ifp1 |
33 use defsfile | 40 use defsfile |
34 use scfdefs | |
35 endc | 41 endc |
36 | 42 |
37 tylg set Prgrm+Objct | 43 tylg set Prgrm+Objct |
38 atrv set ReEnt+rev | 44 atrv set ReEnt+rev |
39 rev set $01 | 45 rev set $01 |
107 | 113 |
108 name fcs /sierra/ | 114 name fcs /sierra/ |
109 fcb edition | 115 fcb edition |
110 | 116 |
111 start equ * | 117 start equ * |
112 L0014 lbra L007D branch to entry process params | 118 L0014 lbra L007D branch to entry process params |
113 L0017 lbra L00DB agi_exit() branch to clean up routines | 119 L0017 lbra L00DB agi_exit() branch to clean up routines |
114 | 120 |
115 | 121 |
116 * Multi-tasking flag (0=No multitask, 1=multitask) | 122 * Multi-tasking flag (0=No multitask, 1=multitask) |
117 L001A fcb $00 we store a value here | 123 L001A fcb $00 we store a value here |
118 * the "old self modifying code" trick | 124 * the "old self modifying code" trick |
139 | 145 |
140 L0086 lbsr L011A relay call to L0140 | 146 L0086 lbsr L011A relay call to L0140 |
141 | 147 |
142 L0089 ldd <u0000 load the data pointer | 148 L0089 ldd <u0000 load the data pointer |
143 beq L00DF if it is zero we have a problem | 149 beq L00DF if it is zero we have a problem |
144 ldd >$FFA9 ??? MMU task 1 block 1 ??? | 150 * ldd >$FFA9 MMU task 1, blocks 1&2 (0-7) |
145 std <u000A save the task 1 block one value | 151 lbsr mmuini2 get MMU values $FFA8-$FFAF |
152 ldd mmubuf+9,pcr | |
153 std <u000A save the task 1, blocks 1&2 | |
146 lda #$00 clear a to zero | 154 lda #$00 clear a to zero |
155 * clra | |
147 sta <u0011 save that value | 156 sta <u0011 save that value |
148 ldx <u0024 set up to jump to mnln and go for it | 157 ldx <u0024 set up to jump to mnln and go for it |
149 jsr sub659 code at L04DA plays with mmu blocks | 158 jsr sub659 code at L04DA plays with mmu blocks |
150 rts | 159 rts |
151 | 160 |
201 | 210 |
202 * disassembler had a little problem here | 211 * disassembler had a little problem here |
203 L00E2 fdb $000C another prog internal var | 212 L00E2 fdb $000C another prog internal var |
204 | 213 |
205 * Are these all data bytes of some kind ??? | 214 * Are these all data bytes of some kind ??? |
206 * quirky assemblage of bytes | 215 * quirky assemblage of bytes. Palette colors? |
207 L00E4 fcb $02,$2E,$06,$09,$04,$20,$10,$1B | 216 L00E4 fcb $02,$2E,$06,$09,$04,$20,$10,$1B |
208 fcb $11,$3D,$17,$29,$33,$3F,$00,$08 | 217 fcb $11,$3D,$17,$29,$33,$3F,$00,$08 |
209 fcb $14,$18,$20,$28,$22,$38,$07,$0B | 218 fcb $14,$18,$20,$28,$22,$38,$07,$0B |
210 fcb $16,$1F,$27,$2D,$37,$3F | 219 fcb $16,$1F,$27,$2D,$37,$3F |
211 | 220 |
237 L0119 fcb $00 Monitor type Coco set to when Sierra ran | 246 L0119 fcb $00 Monitor type Coco set to when Sierra ran |
238 | 247 |
239 | 248 |
240 * L011A called by L0086 | 249 * L011A called by L0086 |
241 L011A lbsr L0140 Clears data area, sets up vars and saves montype | 250 L011A lbsr L0140 Clears data area, sets up vars and saves montype |
242 | 251 lbsr mmuini1 get MMU values $FFA0-$FFA7 |
243 lbsr L01AF Change our process image to dupe block 0 to 1-2 | 252 lbsr L01AF Change our process image to dupe block 0 to 1-2 |
244 L0120 lbsr L01FA copies two subs to data area so others can use them | 253 L0120 lbsr L01FA copies two subs to data area so others can use them |
245 | 254 |
246 lbsr L0419 load intercept routine and open /VI and allocate Ram | 255 lbsr L0419 load intercept routine and open /VI and allocate Ram |
247 bcs L0139 if errors occured close VIRQ device | 256 bcs L0139 if errors occured close VIRQ device |
259 L0136 lbsr L0370 unloads the three other modules | 268 L0136 lbsr L0370 unloads the three other modules |
260 L0139 lbsr L04BD Close VIRQ device | 269 L0139 lbsr L04BD Close VIRQ device |
261 lbsr L0388 restore the MMU blocks | 270 lbsr L0388 restore the MMU blocks |
262 rts | 271 rts |
263 | 272 |
264 * at this point u0000 contains the value of s on entry minus $04FF | 273 * at this point u0000 contains the value of some entry minus $04FF |
265 * which should be the size of our initialized data | 274 * which should be the size of our initialized data |
266 * so we don't over write it but clear the rest of the data area | 275 * so we don't over write it but clear the rest of the data area |
267 | 276 |
268 L0140 ldx #$0002 Init data area from 2-end with 0's | 277 L0140 ldx #$0002 Init data area from 2-end with 0's |
269 ldd #$0000 | 278 ldd #$0000 |
359 L01A3 sta ,x+ | 368 L01A3 sta ,x+ |
360 decb | 369 decb |
361 bne L01A3 | 370 bne L01A3 |
362 rts | 371 rts |
363 | 372 |
364 * Fill routine-two byte pattern | |
365 * Entry: U=2-Byte pattern to fill with | |
366 * B=# bytes to fill | |
367 * X=Start address of fill | |
368 * NO BODY CALLS HERE ?? | |
369 *L01A9 stu ,x++ | |
370 * decb | |
371 * bne L01A9 | |
372 * rts | |
373 | |
374 * Raw disassembly of followin code | |
375 *L01AF orcc #$50 | |
376 * ldx #$0002 | |
377 * stx <u0022 | |
378 * lda >$FFAF | |
379 * sta <u0008 | |
380 * clr >$FFA9 | |
381 * ldd >$2050 | |
382 * anda #$1F | |
383 * addd #$2043 | |
384 * std <u0043 | |
385 * ldb >$2050 | |
386 * andb #$E0 | |
387 * lsrb | |
388 * lsrb | |
389 * lsrb | |
390 * lsrb | |
391 * lsrb | |
392 * ldx #$FFA0 | |
393 * lda b,x | |
394 * sta <u0042 | |
395 * sta >$FFA9 | |
396 * ldx <u0043 | |
397 * ldd -$01,x | |
398 * std >L0102,pcr | |
399 * ldd $01,x | |
400 * std >L0104,pcr | |
401 * ldd -$03,x | |
402 * std -$01,x | |
403 * std $01,x | |
404 * tfr b,a | |
405 * std >$FFA9 | |
406 * std <u0002 | |
407 * andcc #$AF | |
408 * rts | |
409 | 373 |
410 ********************************************************** | 374 ********************************************************** |
411 * COMMENTS FROM CODE RECIEVED | 375 * COMMENTS FROM CODE RECIEVED |
412 * Change our process map: | 376 * Change our process map: |
413 * Blocks 1-2 become duplicates of block 0 (data area... | 377 * Blocks 1-2 become duplicates of block 0 (data area... |
416 * | 380 * |
417 * NOTE: SHOULD CHANGE SO IT MAPS IN BLOCK 0 IN AN UNUSED BLOCK 1ST | 381 * NOTE: SHOULD CHANGE SO IT MAPS IN BLOCK 0 IN AN UNUSED BLOCK 1ST |
418 * TO GET PROCESS DESCRIPTOR DAT IMAGE FOR SIERRA. | 382 * TO GET PROCESS DESCRIPTOR DAT IMAGE FOR SIERRA. |
419 * THEN, CAN BUMP BLOCKS AROUND WITH THE ACTUAL BLOCK # | 383 * THEN, CAN BUMP BLOCKS AROUND WITH THE ACTUAL BLOCK # |
420 * IN FULL 2 MB RANGE, INSTEAD OF JUST GIME 512K RANGE. | 384 * IN FULL 2 MB RANGE, INSTEAD OF JUST GIME 512K RANGE. |
421 | 385 * R.Gault: A better way is to use F$GPrDsc and that is done with |
386 * new routines at the end of the program. | |
422 L01AF orcc #IntMasks Shut interrupts off | 387 L01AF orcc #IntMasks Shut interrupts off |
423 ldx #$0002 ??? | 388 ldx #$0002 ??? |
424 stx <u0022 | 389 stx <u0022 |
425 | 390 |
426 * As per above NOTE, should postpone this until we have DAT image | 391 * As per above NOTE, should postpone this until we have DAT image |
427 * available for Sierra process | 392 * available for Sierra process |
428 | 393 |
429 lda >$FFAF Get MMU block # SIERRA is in | 394 * lda >$FFAF Get MMU block # SIERRA is in |
395 lda mmubuf+$0F,pcr | |
430 sta <u0008 Save it | 396 sta <u0008 Save it |
431 clr >$FFA9 Map system block 0 into $2000-$3FFF | 397 clr >$FFA9 Map system block 0 into $2000-$3FFF |
432 ldd >D.Proc+$2000 Get SIERRA's process dsc. ptr | 398 ldd >D.Proc+$2000 Get SIERRA's process dsc. ptr |
433 anda #$1F Keep non-MMU dependent address | 399 anda #$1F Keep non-MMU dependent address |
434 | 400 |
438 addd #$2000+P$DATImg+3 Set up ptr for what we want out of it | 404 addd #$2000+P$DATImg+3 Set up ptr for what we want out of it |
439 std <u0043 Save it | 405 std <u0043 Save it |
440 ldb >D.Proc+$2000 Get MSB of SIERRA's process dsc. ptr | 406 ldb >D.Proc+$2000 Get MSB of SIERRA's process dsc. ptr |
441 andb #$E0 Calculate which 8K block within | 407 andb #$E0 Calculate which 8K block within |
442 * system task it's in | 408 * system task it's in |
443 lsrb | 409 * I don't like the original and made it simpler. RG |
444 lsrb | 410 * lsrb |
445 lsrb | 411 * lsrb |
446 lsrb | 412 * lsrb |
447 lsrb | 413 * lsrb |
448 | 414 * lsrb |
449 * NOTE: HAVE TO CHANGE THIS TO GET BLOCK #'S FROM SYSTEM DAT IMAGE, | 415 lda #8 |
450 * NOT RAW GIME REGS (TO WORK WITH >512K MACHINES) | 416 mul |
451 ldx #$FFA0 Point to base of System task DAT register set block 0 task 0 | 417 * ldx #$FFA0 Point to base of System task DAT register set block 0 task 0 |
452 lda b,x Get block # that has process desc. for SIERRA | 418 leax mmubuf,pcr |
419 * lda b,x Get block # that has process desc. for SIERRA | |
420 lda a,x Get MMU value of block | |
453 sta <u0042 Save it | 421 sta <u0042 Save it |
454 sta >$FFA9 Map in block with process dsc. to $2000-$3FFF | 422 sta >$FFA9 Map in block with process dsc. to $2000-$3FFF |
455 ldx <u0043 Get offset to 2nd 8K block in DAT map for SIERRA | 423 ldx <u0043 Get offset to 2nd 8K block in DAT map for SIERRA |
456 ldd -1,x Get MMU block # of current 2nd 8k block in SIERRA | 424 ldd -1,x Get MMU block # of current 2nd 8k block in SIERRA |
457 std >L0102,pc Save it | 425 std >L0102,pcr Save it |
458 ldd 1,x Get MMU block # of current 3rd 8k block in SIERRA | 426 ldd 1,x Get MMU block # of current 3rd 8k block in SIERRA |
459 std >L0104,pc Save it | 427 std >L0104,pcr Save it |
460 ldd -3,x Get data area block 3 from sierra (1st block) | 428 ldd -3,x Get data area block 3 from sierra (1st block) |
461 std -1,x Move 8k data area to 2nd block | 429 std -1,x Move 8k data area to 2nd block |
462 std 1,x And to 3rd block | 430 std 1,x And to 3rd block |
463 tfr b,a D=Raw MMU block # for both | 431 tfr b,a D=Raw MMU block # for both |
464 | 432 |
465 * HAVE TO CHANGE TO ALLOW FOR DISTO DAT EXTENSION | |
466 std >$FFA9 Map data area block into both blocks 2&3 | 433 std >$FFA9 Map data area block into both blocks 2&3 |
467 std <u0002 Save both block #'s | 434 std <u0002 Save both block #'s |
468 andcc #^IntMasks Turn interrupts back on | 435 andcc #^IntMasks Turn interrupts back on |
469 rts | 436 rts |
470 | 437 |
471 | 438 |
472 * NOTE: 6809/6309 MOD: STUPID. DO LEAX, AND THEN PSHS X | 439 * NOTE: 6809/6309 MOD: STUPID. DO LEAX, AND THEN PSHS X |
473 | 440 * Right so I'll change it! RG |
474 * load first routine | 441 * load first routine |
475 L01FA leas -2,s Make 2 word buffer on stack | 442 *L01FA leas -2,s Make 2 word buffer on stack |
476 leax >L054F,pc Point to end of routine | 443 * leax >L054F,pcr Point to end of routine |
477 stx ,s Save ptr | 444 * stx ,s Save ptr |
478 leax >L04DA,pc Point to routine | 445 L01FA leax L054F,pcr |
446 pshs x | |
447 leax L04DA,pcr Point to routine | |
479 * ldu #$0659 Point to place in data area to copy it | 448 * ldu #$0659 Point to place in data area to copy it |
480 ldu #sub659 | 449 ldu #sub659 |
481 L0209 lda ,x+ Copy routine | 450 L0209 lda ,x+ Copy routine |
482 sta ,u+ | 451 sta ,u+ |
483 cmpx ,s Done whole routine yet? | 452 cmpx ,s Done whole routine yet? |
490 ldu #int5EE point to place in data area to copy it | 459 ldu #int5EE point to place in data area to copy it |
491 L021E lda ,x+ copy routine | 460 L021E lda ,x+ copy routine |
492 sta ,u+ | 461 sta ,u+ |
493 cmpx ,s Done whole routine yet? | 462 cmpx ,s Done whole routine yet? |
494 blo L021E No, keep going | 463 blo L021E No, keep going |
495 leas $02,s clean up stack | 464 * leas $02,s clean up stack |
496 rts return | 465 * rts return |
466 puls x,pc | |
497 | 467 |
498 * Called from dispatch table at L0120 | 468 * Called from dispatch table at L0120 |
499 * The last op in the subroutine before this one | 469 * The last op in the subroutine before this one |
500 * was a puls a,b after a puhs x and a setsatt call for process+path to VIRQ | 470 * was a puls a,b after a puhs x and a setsatt call for process+path to VIRQ |
501 | 471 |
559 * Call use VDGINT allocates high res graphics for use with screens | 529 * Call use VDGINT allocates high res graphics for use with screens |
560 * updated by the process, does not clear the screens only allocates | 530 * updated by the process, does not clear the screens only allocates |
561 * See OS-9 Technical Reference 8-142 for more details | 531 * See OS-9 Technical Reference 8-142 for more details |
562 * | 532 * |
563 | 533 |
564 L026B leas -$04,s mamke room om stack 2 words | 534 L026B leas -$04,s make room on stack 2 words |
565 lda #$01 Std out | 535 lda #$01 Std out |
566 ldb #SS.AScrn Allocate & map in hi-res screen (VDGINT) | 536 ldb #SS.AScrn Allocate & map in hi-res screen (VDGINT) |
567 ldx #$0004 320x192x16 screen | 537 ldx #$0004 320x192x16 screen |
568 os9 I$SetStt Map it in | 538 os9 I$SetStt Map it in |
569 bcs L02E6 Error, Restore stack & exit | 539 bcs L02E6 Error, Restore stack & exit |
570 tfr y,d Move screen # returned to D | 540 tfr y,d Move screen # returned to D |
571 * stb >$0174 Save screen # | 541 * stb >$0174 Save screen # |
572 stb scr174 Save screen # | 542 stb scr174 Save screen # |
573 | 543 |
574 * call with application address of screen in x | 544 * call with application address of screen in x |
575 * returns with values in u | 545 * returns with MMU values in u |
576 lbsr L03B6 twiddle addresses | 546 lbsr mmuini2 get current MMU values |
547 lbsr L03B6 convert addresses into MMU values | |
577 stu <u0004 stow it two places | 548 stu <u0004 stow it two places |
578 stu <u0014 | 549 stu <u0014 |
579 | 550 |
580 leax >$4000,x end address ??? | 551 leax >$4000,x end address ??? |
581 lbsr L03B6 twiddle addresses | 552 lbsr L03B6 convert addresses into MMU values |
582 stu <u0006 stow it in two places | 553 stu <u0006 stow it in two places |
583 stu <u0016 | 554 stu <u0016 |
584 | 555 |
585 * TFM for 6309 | 556 * TFM for 6309 |
586 ldu #$D800 Clear hi-res screen to color 0 | 557 ldu #$D800 Clear hi-res screen to color 0 |
610 lda #StdOut $01 Std out path | 581 lda #StdOut $01 Std out path |
611 ldb #SS.DScrn Display 320x192x16 screen | 582 ldb #SS.DScrn Display 320x192x16 screen |
612 os9 I$SetStt make the call | 583 os9 I$SetStt make the call |
613 bcs L02E6 | 584 bcs L02E6 |
614 | 585 |
615 leax >L00E2,pc values initialized to is $000C | 586 leax >L00E2,pcr values initialized to is $000C |
616 ldb >$0553 monitor type | 587 ldb >$0553 monitor type |
617 lda #$10 | 588 lda #$10 |
618 mul | 589 mul |
619 abx add b to x and stow at x | 590 abx add b to x and stow at x |
620 | 591 |
645 lbsr L02E9 go disable keyboard interrupts | 616 lbsr L02E9 go disable keyboard interrupts |
646 L02E6 leas $04,s clean up stack | 617 L02E6 leas $04,s clean up stack |
647 rts return | 618 rts return |
648 | 619 |
649 | 620 |
650 * Raw disassembly of following section | |
651 *L02E9 leas <-$20,s | |
652 * lda #$00 | |
653 * ldb #$00 | |
654 * leax ,s | |
655 * os9 I$GetStt | |
656 * bcs L0332 | |
657 * lda >L0115,pcr | |
658 * ldb $04,x | |
659 * sta $04,x | |
660 * stb >L0115,pcr | |
661 * lda >L0116,pcr | |
662 * ldb $0C,x | |
663 * sta $0C,x | |
664 * stb >L0116,pcr | |
665 * lda >L0117,pcr | |
666 * ldb <$10,x | |
667 * sta <$10,x | |
668 * stb >L0117,pcr | |
669 * lda >L0118,pcr | |
670 * ldb <$11,x | |
671 * sta <$11,x | |
672 * stb >L0118,pcr | |
673 * lda #$00 | |
674 * ldb #$00 | |
675 * os9 I$SetStt | |
676 *L0332 leas <$20,s | |
677 * rts | |
678 | 621 |
679 * Kills the echo, eof, int and quit signals | 622 * Kills the echo, eof, int and quit signals |
680 * get current options packet | 623 * get current options packet |
681 * GetStat Function Code $00 | 624 * GetStat Function Code $00 |
682 * Reads the options section of the path descriptor and | 625 * Reads the options section of the path descriptor and |
701 * NOTE: make sure following lines assemble into 5 bit, not 8 bit | 644 * NOTE: make sure following lines assemble into 5 bit, not 8 bit |
702 * These appear to be loading the echo EOF, INT and QUIT with | 645 * These appear to be loading the echo EOF, INT and QUIT with |
703 * null values and saving the original ones back to vars | 646 * null values and saving the original ones back to vars |
704 * since L0115 - L0118 were initialized with $00 | 647 * since L0115 - L0118 were initialized with $00 |
705 | 648 |
706 lda >L0115,pc | 649 lda >L0115,pcr |
707 ldb PD.EKO-PD.OPT,x Get echo option | 650 ldb PD.EKO-PD.OPT,x Get echo option |
708 sta PD.EKO-PD.OPT,x change echo option no echo | 651 sta PD.EKO-PD.OPT,x change echo option no echo |
709 stb >L0115,pc Save original echo option | 652 stb >L0115,pcr Save original echo option |
710 | 653 |
711 lda >L0116,pc | 654 lda >L0116,pcr |
712 ldb PD.EOF-PD.OPT,x Change EOF char | 655 ldb PD.EOF-PD.OPT,x Change EOF char |
713 sta PD.EOF-PD.OPT,x | 656 sta PD.EOF-PD.OPT,x |
714 stb >L0116,pc | 657 stb >L0116,pcr |
715 | 658 |
716 lda >L0117,pc | 659 lda >L0117,pcr |
717 ldb <PD.INT-PD.OPT,x Change INTerrupt char (normally CTRL-C) | 660 ldb <PD.INT-PD.OPT,x Change INTerrupt char (normally CTRL-C) |
718 sta <PD.INT-PD.OPT,x | 661 sta <PD.INT-PD.OPT,x |
719 stb >L0117,pc | 662 stb >L0117,pcr |
720 | 663 |
721 lda >L0118,pc | 664 lda >L0118,pcr |
722 ldb <PD.QUT-PD.OPT,x Change QUIT char (normally CTRL-E) | 665 ldb <PD.QUT-PD.OPT,x Change QUIT char (normally CTRL-E) |
723 sta <PD.QUT-PD.OPT,x | 666 sta <PD.QUT-PD.OPT,x |
724 stb >L0118,pc | 667 stb >L0118,pcr |
725 | 668 |
726 * set current options packet | 669 * set current options packet |
727 * SetStat Function Code $00 | 670 * SetStat Function Code $00 |
728 * Writes the options section of the path descriptor | 671 * Writes the options section of the path descriptor |
729 * from the 32 byte area pointed to by reg X` | 672 * from the 32 byte area pointed to by reg X` |
743 os9 I$SetStt set them to be our new values | 686 os9 I$SetStt set them to be our new values |
744 | 687 |
745 L0332 leas <$20,s Eat temp stack & return | 688 L0332 leas <$20,s Eat temp stack & return |
746 rts | 689 rts |
747 | 690 |
748 * raw disassembly | |
749 *L0336 leas -$02,s | |
750 * tst >$0174 | |
751 * beq L036D | |
752 * lbsr L02E9 | |
753 * bcs L036D | |
754 ** lda #$1B | |
755 * sta ,s | |
756 * lda #$30 | |
757 * sta $01,s | |
758 * ldy #$0002 | |
759 * lda #$01 | |
760 * leax ,s | |
761 * os9 I$Write | |
762 * bcs L036D | |
763 * ldb #$8C | |
764 * ldy #$0000 | |
765 * os9 I$SetStt | |
766 * clra | |
767 * ldb >$0174 | |
768 * tfr d,y | |
769 * lda #$01 | |
770 * ldb #$8D | |
771 * os9 I$SetStt | |
772 *L036D leas $02,s | |
773 * rts | |
774 | 691 |
775 | 692 |
776 * Return the screen to default text sreen and its values | 693 * Return the screen to default text sreen and its values |
777 * deallocate and free memory of high res screen created | 694 * deallocate and free memory of high res screen created |
778 | 695 |
843 lbsr L040B unload it | 760 lbsr L040B unload it |
844 leax >L0110,pcr mnln name string | 761 leax >L0110,pcr mnln name string |
845 lbsr L040B unload it | 762 lbsr L040B unload it |
846 rts | 763 rts |
847 | 764 |
848 *L0388 orcc #$50 | |
849 * lda <u0042 | |
850 * sta >$FFA9 | |
851 * ldx <u0043 | |
852 * ldd >L0104,pcr | |
853 * std $01,x | |
854 * stb >$FFAA | |
855 * ldd >L0102,pcr | |
856 * std -$01,x | |
857 * stb >$FFA9 | |
858 * andcc #$AF | |
859 * clra | |
860 * ldb >L0119,pcr | |
861 * andb #$03 | |
862 * tfr d,x | |
863 * lda #$01 | |
864 * ldb #$92 | |
865 * os9 I$SetStt | |
866 * rts | |
867 ** | |
868 *L03B6 tfr x,d | |
869 * exg a,b | |
870 * lsrb | |
871 * lsrb | |
872 * lsrb | |
873 * lsrb | |
874 * lsrb | |
875 * pshs b | |
876 * ldu #$FFA8 | |
877 * lda b,u | |
878 * incb | |
879 * andb #$07 | |
880 * ldb b,u | |
881 * tfr d,u | |
882 * puls a | |
883 * rts | |
884 | 765 |
885 | 766 |
886 * Restore original MMU block numbers | 767 * Restore original MMU block numbers |
887 L0388 orcc #IntMasks Shut off interrupts | 768 L0388 orcc #IntMasks Shut off interrupts |
888 lda <u0042 get MMU Block # | 769 lda <u0042 get MMU Block # |
889 sta >$FFA9 Restore original block 0 onto MMU | 770 sta >$FFA9 Restore original block 0 onto MMU |
890 ldx <u0043 | 771 ldx <u0043 |
891 ldd >L0104,pc Origanl 3rd block of MMU | 772 ldd >L0104,pcr Original 3rd block of MMU |
892 std 1,x | 773 std 1,x |
893 stb >$FFAA Restore original block 1 onto MMU | 774 stb >$FFAA Restore original block 1 onto MMU |
894 ldd >L0102,pc Original 2nd block of MMU | 775 ldd >L0102,pcr Original 2nd block of MMU |
895 std -1,x | 776 std -1,x |
896 stb >$FFA9 Restore block 0 again | 777 stb >$FFA9 Restore block 0 again |
897 andcc #^IntMasks Turn interrupts back on | 778 andcc #^IntMasks Turn interrupts back on |
898 | 779 |
899 * return monitor type to original value | 780 * return monitor type to original value |
900 clra | 781 clra |
901 ldb >L0119,pc Get original monitor type | 782 ldb >L0119,pcr Get original monitor type |
902 andb #$03 Force to only legit values | 783 andb #$03 Force to only legit values |
903 tfr d,x Move to proper register | 784 tfr d,x Move to proper register |
904 lda #StdOut set path $01 | 785 lda #StdOut set path $01 |
905 ldb #SS.Montr Restore original monitor type | 786 ldb #SS.Montr Restore original monitor type |
906 os9 I$SetStt make the call | 787 os9 I$SetStt make the call |
907 rts | 788 rts |
908 | 789 |
909 * twiddles address | 790 |
910 * called with value to be twiddled in X | 791 * Converts address into MMU values |
792 * called with value to be converted in X | |
911 * returns block # in a | 793 * returns block # in a |
912 * ????? in u | 794 |
913 L03B6 tfr x,d Move address to D | 795 L03B6 tfr x,d Move address to D |
914 exg a,b Swap MSB/LSB | 796 * I decided to simplify this code. RG |
915 lsrb Divide MSB by 32 (calculate 8k block # in proc map) | 797 * exg a,b Swap MSB/LSB should be tfr a,b |
916 lsrb | 798 * lsrb Divide MSB by 32 (calculate 8k block # in proc map) |
917 lsrb | 799 * lsrb |
918 lsrb | 800 * lsrb |
919 lsrb | 801 * lsrb |
920 pshs b Save block # in process map | 802 * lsrb |
921 ldu #$FFA8 Point to start of user DAT image | 803 * pshs b Save block # in process map |
922 lda b,u | 804 * ldu #$FFA8 Point to start of user DAT image |
923 incb | 805 * lda b,u |
924 andb #$07 | 806 ldb #8 |
925 ldb b,u | 807 mul slow but much less code |
926 tfr d,u | 808 pshs a |
809 leau mmubuf+8,pcr | |
810 lda a,u get MMU value | |
811 ldb ,s recover block value | |
812 incb block +1 | |
813 * This next seems inadequate protection. | |
814 andb #$07 must fall within Task1 | |
815 ldb b,u get current value | |
816 tfr d,u save two adjacent MMU values | |
927 puls a | 817 puls a |
928 rts | 818 rts |
929 | 819 |
930 | 820 |
931 | 821 |
948 * | 838 * |
949 * exit: | 839 * exit: |
950 * a -> type/language | 840 * a -> type/language |
951 * b -> module revision | 841 * b -> module revision |
952 * x -> address of the last byte in the pathlist + 1 | 842 * x -> address of the last byte in the pathlist + 1 |
953 * y -> storageb requirements of the module | 843 * y -> storage requirements of the module |
954 * | 844 * |
955 * error: | 845 * error: |
956 * b -> error code if any | 846 * b -> error code if any |
957 * cc -> carry set on error | 847 * cc -> carry set on error |
958 | 848 |
979 ldx $02,s get our name string again | 869 ldx $02,s get our name string again |
980 os9 F$Link link it | 870 os9 F$Link link it |
981 bcs L0408 exit on error | 871 bcs L0408 exit on error |
982 stu $06,s store module header address | 872 stu $06,s store module header address |
983 tfr u,x | 873 tfr u,x |
874 lbsr mmuini2 get current MMU values | |
984 L03E8 stx $04,s | 875 L03E8 stx $04,s |
985 lbsr L03B6 Go twiddle with address` | 876 lbsr L03B6 Go twiddle with address` |
986 ldx ,s | 877 ldx ,s |
987 leax a,x | 878 leax a,x |
988 exg d,u | 879 exg d,u |
1106 inc >u024A,u | 997 inc >u024A,u |
1107 bne L047B | 998 bne L047B |
1108 inc >u0249,u | 999 inc >u0249,u |
1109 L047B tst >u0102,u | 1000 L047B tst >u0102,u |
1110 bne L04BC | 1001 bne L04BC |
1002 | |
1111 inc <u003F | 1003 inc <u003F |
1112 bne L0487 | 1004 bne L0487 |
1113 inc <u003E | 1005 inc <u003E |
1114 L0487 ldd <u0048 | 1006 L0487 ldd <u0048 |
1115 addd #$0001 | 1007 addd #$0001 |
1212 jmp [>$002A] | 1104 jmp [>$002A] |
1213 | 1105 |
1214 L054F fcb $00,$00,$00,$00,$00,$00,$00,$00 ........ | 1106 L054F fcb $00,$00,$00,$00,$00,$00,$00,$00 ........ |
1215 L0557 fcb $73,$69,$65,$72,$72,$61,$00 sierra. | 1107 L0557 fcb $73,$69,$65,$72,$72,$61,$00 sierra. |
1216 | 1108 |
1109 * New routines so we don't have raw reads of the MMU bytes. RG | |
1110 mmubuf fcb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 | |
1111 gprbuf fzb 512 | |
1112 * Get $FFA0-$FFA7 | |
1113 mmuini1 pshs cc,x,y | |
1114 orcc #$50 | |
1115 lda #1 system ID# | |
1116 leax gprbuf,pcr | |
1117 os9 F$GPrDsc get system process descriptor | |
1118 leay $41,x point to its mmu block values | |
1119 leax mmubuf,pcr | |
1120 ldb #8 | |
1121 m2lup lda ,y++ get MMU value and skip over usage | |
1122 sta ,x+ | |
1123 decb | |
1124 bne m2lup | |
1125 puls cc,x,y,pc | |
1126 * Get $FFA8-$FFAF | |
1127 mmuini2 pshs cc,x,y | |
1128 orcc #$50 | |
1129 os9 F$ID get our ID# | |
1130 leax gprbuf,pcr | |
1131 os9 F$GPrDsc get our process descriptor | |
1132 leay $41,x point to our mmu block values | |
1133 leax mmubuf+8,pcr | |
1134 ldb #8 | |
1135 mloop lda ,y++ | |
1136 sta ,x+ | |
1137 decb | |
1138 bne mloop | |
1139 puls cc,x,y,pc | |
1140 | |
1217 emod | 1141 emod |
1218 eom equ * | 1142 eom equ * |
1219 end | 1143 end |
1220 | 1144 |