Blame | Last modification | View Log | Download | RSS feed
Fri Jul 29 18:05:17 2016 Page 1
2500 A.D. 65816 Macro Assembler #26960 - Version 5.02g
-----------------------------------------------------
Input Filename : src\F9\acia.asm
Output Filename : obj\F9\acia.obj
Listing Has Been Relocated
2497 .LIST on
2498
2499 F8FF6A .INCLUDE inc\dirp00.inc
2500 ;----------------------------------------------------------
2501 ; DIRP00.ASM
2502 ; PROGETTO: B1601
2503 ;
2504 ; Variabili in Direct Page $00
2505 ;----------------------------------------------------------
2506
2507 ; sezione COMMON -- questo permette di includere il file in piu' file
2508
2509 .LIST on
2510
2511 DIRP00: .SECTION page0, ref_only, common ;Direct-Page 00
2512
2513 000000 .ABSOLUTE ;; inizia sempre da $00
2514 000000 .ORG 0x00
2515 000000
2516 000000 0000 JiffyClk .DW ; contatore 10ms 32 bit
2517 000002 0000 .DW
2518 000004 SysTmr .DS SYSTMRCNT ; system timer 0 (10ms)
2519 000008 SysTMF .DS SYSTMRCNT ; flag timer (80 -> start)
2520 00000C 00 Bnk0Flag .DB ; <7>: flag test RAM banco 0 ok
2521 ; <6>: flag warm reset
2522 00000D 00 RTCFlag .DB
2523
2524 00000E atadev .DS 2 ; flag device on ata bus #0 & #1
2525 ; <7>: device ready
2526 ; <6>: compact flash device (C.F.)
2527 ; <5>: device identification ok
2528 ; <4>: MBR loaded
2529 ; <3>: valid signature in MBR
2530 ; <2>: first partition found&active
2531 ; <1>:
2532 ; <0>: valid partition flag
2533
2534 000010 atasec .DS 8 ; max. user sectors on ata device
2535 000018 atambr .DS 8 ; data for first partition found in mbr
2536 ; first 3 bytes for start sector of partition
2537 ; last byte for partition type
2538 000020 ataprt .DS 8 ; total sec's of first partition
2539
2540 000028 00 fdcdrv .DB ; phisycal drive status (drive #0)
2541 ; <7>: disk format established in bit 0&1
2542 ; <6>: double step seek done
Fri Jul 29 18:05:17 2016 Page 2
2543 ; <5>: trust format bit's (set after ok r/w)
2544 ; <4>: write protect bit (if disk in drive)
2545 ; <3>: don't care
2546 ; <2>: don't care
2547 ; <1>: HD disk if set else DD disk
2548 ; <0>: CBM format if set else IBM format
2549
2550 000029 00 vdrive .DB ; virtual drive status (ram disk, drive #1)
2551 ; <7>: disk format established in bit 0&1
2552 ; <6>: change disk simulation (after format)
2553 ; <5>: don't care
2554 ; <4>: write protect bit (under sw control)
2555 ; <3>: don't care
2556 ; <2>: don't care
2557 ; <1>: HD disk if set else DD disk
2558 ; <0>: CBM format if set else IBM format
2559
2560 00002A 00 fdcctl .DB ; fdc controller status
2561 ; <7>: drive is attached
2562 ; <6>: drive need recalibration (restore)
2563 ; <5>: FDC controller ok
2564 ; <4>: motor on
2565 ; <3>: dma is active
2566 ; <2>: dma chip ok (post routine)
2567 ; <1>: clock rate (1=HD,0=DD)
2568 ; <0>: disk ready
2569
2570 00002B 00 fdctrk .DB ; fd: current seek track
2571 00002C 00 fdcerr .DB ; fd: last error code
2572 00002D 00 ataerr .DB ; ata: last error code
2573 00002E 00 ataxer .DB ; ata: last extended error code
2574
2575 00002F 00 CtrlBrk .DB ; flag CTRL+BREAK (NMI)
2576
2577 000030 0000 MemTop .DW ; top memoria RAM
2578 000032 00 .DB ; banco top mem
2579
2580 000033 00 DflTxtIn .DB ; device di default text input
2581 000034 00 DflTxtOut .DB ; device di default text output
2582
2583 000035 COPPtr LP ; long pointer for COP decoding
2584 000038 00 COPIdx .DB ; COP signature/index
2585
2586 000039 00 BiosEnt .DB ; flag accesso a bios setup
2587
2588 ; variabili utilizzate da ACIA
2589 00003A spwrk .DS $30
2590
2591 ; bios mem
2592 00006A 0000 nsize .DW ; dimensione blocco da allocare
2593 ;bsize .DW ; dimensione vera blocco free
2594 00006C 0000 splitsz .DW ; dimensione blocco splittato
2595 00006E 0000 bfree .DW ; puntatore blocco free
2596 000070 0000 hdrptr .DW ; puntatore header heap
2597
2598 000072 0000 pbrklv .DW ; current break level of current process
2599 000074 0000 pbrkmin .DW ; minimum breal level of current process
Fri Jul 29 18:05:17 2016 Page 3
2600 000076 0000 pbrkmax .DW ; maximum breal level of current process
2601 000078
2602 ; bios temp. work area
2603 000078 bwrktmp .DS $28
2604
2605 0000A0 00 .DB ; dummy
2606 0000A1
2607
2608 0000A0 .RELATIVE
2609
2610 .ENDS
2611
2612 [01] .IFDEF _ACIA_INC_
2613 F8FF6A .INCLUDE INC\SP.INC
2614 ;;
2615 ;; Copyright (c) 2016 Marco Granati <mg@unet.bz>
2616 ;;
2617 ;; Permission to use, copy, modify, and distribute this software for any
2618 ;; purpose with or without fee is hereby granted, provided that the above
2619 ;; copyright notice and this permission notice appear in all copies.
2620 ;;
2621 ;; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
2622 ;; WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
2623 ;; MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
2624 ;; ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
2625 ;; WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
2626 ;; ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
2627 ;; OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2628 ;;
2629
2630 ;; name: sp.inc
2631 ;; rev.: 2016/07/28
2632 ;; bios C816 version v1.0
2633
2634 .LIST on
2635
2636 000011 SPXON .EQU $11 ; XON seriale per handshake software
2637 000013 SPXOFF .EQU $13 ; XOFF seriale per handshake software
2638
2639 ;NGUARD1 .EQU $800 ; numero bytes di guardia buffer RX XON/XOFF
2640 ;NGUARD2 .EQU $400 ; numero bytes di guardia buffer RX handshake
2641 000040 NGUARD1 .EQU $40 ; numero bytes di guardia buffer RX XON/XOFF
2642 000040 NGUARD2 .EQU $40 ; numero bytes di guardia buffer RX handshake
2643 ;NGUARD3 .EQU $0400 ; minimo posto in coda RX per cancellare pausa remota
2644 000020 NGUARD3 .EQU $20
2645 000040 NGUARD4 .EQU $40
2646
2647 ;---------------------------------------------------------------------------
2648 ; direct page var's for serial ports handling
2649 ;---------------------------------------------------------------------------
2650
2651 DPSP: .SECTION page0, common, ref_only, offset spwrk ;ACIA D.P.
2652
2653 00003A _DPSP_START .DS 0
2654
2655 ; WARNING: not change order and type of the following variables
2656
Fri Jul 29 18:05:17 2016 Page 4
2657 ; acia 1 var's
2658 00003A 00 spisr .DB ; interrupt status register
2659 00003B 00 spcsr .DB ; control status register
2660 00003C 00 spfr .DB ; format register
2661 00003D 00 spout .DB ; XON/XOFF send flag
2662
2663 ; acia 2 var's
2664 00003E 00 spisr2 .DB ; interrupt status register
2665 00003F 00 spcsr2 .DB ; control status register
2666 000040 00 spfr2 .DB ; format register
2667 000041 00 spout2 .DB ; XON/XOFF send flag
2668
2669 ; serial port's mode & status
2670 000042 00 spmode .DB ; <7>: 0=no handshake, 1=handshake
2671 ; <6>: 0=software/1=hardware handshake
2672 ; <5>: not used
2673 ; <4>: baud rate: 0=19200, 1=38400
2674 ; <3>: 0=odd parity, 1=even parity
2675 ; <2>: 0=no parity, 1=parity as specified
2676 ; by bit <3>
2677 ; <1>: interface type: 0=RS232, 1=RS485
2678 ; <0>: RS232: uplink flow control (RTS/DCD)
2679 ; RS485: 120 ohm termination on
2680 ; if bit 7=1 and bit 1=1, bit 6 is forced to 0
2681 000043
2682 000043 00 spstat .DB ; serial port status
2683 ; <7>: rx error (data discarded)
2684 ; <6>: rx buffer overflow
2685 ; <5>: remote disconnession (DSR line = 1)
2686 ; <4>: output buffer is full
2687 ; <3>: not used
2688 ; <2>: framing error
2689 ; <1>: parity error
2690 ; <0>: overrun error
2691
2692 000044 00 sppause .DB ; local/remote pause flag's
2693 ; <7>: remote pause (sent XOFF/XON or RTS=1/0)
2694 ; <6>: local pause (rx XOFF/XON or CTS=0/1)
2695
2696 000045 00 sptmp .DB ; temp. byte used while get data
2697
2698 ; serial port's mode & status
2699 000046 00 spmode2 .DB ; <7>: 0=no handshake, 1=handshake
2700 ; <6>: 0=software/1=hardware handshake
2701 ; <5>: not used
2702 ; <4>: baud rate: 0=19200, 1=38400
2703 ; <3>: 0=odd parity, 1=even parity
2704 ; <2>: 0=no parity, 1=parity as specified
2705 ; by bit <3>
2706 ; <1>: interface type: 0=RS232, 1=RS485
2707 ; <0>: RS232: uplink flow control (RTS/DCD)
2708 ; RS485: 120 ohm termination on
2709 ; if bit 7=1 and bit 1=1, bit 6 is forced to 0
2710 000047
2711 000047 00 spstat2 .DB ; serial port status
2712 ; <7>: rx error (data discarded)
2713 ; <6>: rx buffer overflow
Fri Jul 29 18:05:17 2016 Page 5
2714 ; <5>: remote disconnession (DSR line = 1)
2715 ; <4>: output buffer is full
2716 ; <3>: not used
2717 ; <2>: framing error
2718 ; <1>: parity error
2719 ; <0>: overrun error
2720
2721 000048 00 sppause2 .DB ; local/remote pause flag's
2722 ; <7>: remote pause (sent XOFF/XON or RTS=1/0)
2723 ; <6>: local pause (rx XOFF/XON or CTS=0/1)
2724
2725 000049 00 sppost .DB ; after POST must hold $C0
2726
2727 00004A 0000 ibuftail .DW ; pointer to tail of input buffer
2728 00004C 0000 ibufhead .DW ; pointer to head of input buffer
2729 00004E 0000 ibuftail2 .DW
2730 000050 0000 ibufhead2 .DW
2731
2732 000052 0000 obuftail .DW ; pointer to tail of output buffer
2733 000054 0000 obufhead .DW ; pointer to head of output buffer
2734 000056 0000 obuftail2 .DW
2735 000058 0000 obufhead2 .DW
2736
2737 00005A 0000 ibufcnt .DW ; count of bytes in input buffer
2738 00005C 0000 obufcnt .DW ; count of bytes in output buffer
2739 00005E 0000 ibufcnt2 .DW
2740 000060 0000 obufcnt2 .DW
2741
2742 000062 0000 icntmin .DW ; min. count for clear remote pause
2743 000064 0000 icntmax .DW ; max. count for set remote pause
2744 000066 0000 icntmin2 .DW
2745 000068 0000 icntmax2 .DW
2746
2747 00006A _DPSP_END .DS 0
2748 000030 DPSPSIZ .EQU (_DPSP_END - _DPSP_START)
2749
2750
2751 .ENDS
2752
2753 000043 ACIArxe_1 .EQU spstat
2754 000047 ACIArxe_2 .EQU spstat2
2755 000042 ACIAhsk_1 .EQU spmode
2756 000046 ACIAhsk_2 .EQU spmode2
2757 000044 ACIAPause_1 .EQU sppause
2758 000048 ACIAPause_2 .EQU sppause2
2759 00003B ACIAcsr_1 .EQU spcsr
2760 00003F ACIAcsr_2 .EQU spcsr2
2761 00003C ACIAfr_1 .EQU spfr
2762 000040 ACIAfr_2 .EQU spfr2
2763 000044 ACIAOut_1 .EQU sppause
2764 000048 ACIAOut_2 .EQU sppause2
2765 00005A ACIAICnt_1 .EQU ibufcnt
2766 00005E ACIAICnt_2 .EQU ibufcnt2
2767 00004C ACIAIHead_1 .EQU ibufhead
2768 000050 ACIAIHead_2 .EQU ibufhead2
2769 00004A ACIAITail_1 .EQU ibuftail
2770 00004E ACIAITail_2 .EQU ibuftail2
Fri Jul 29 18:05:17 2016 Page 6
2771 00005C ACIAOCnt_1 .EQU obufcnt
2772 000060 ACIAOCnt_2 .EQU obufcnt2
2773 000054 ACIAOHead_1 .EQU obufhead
2774 000058 ACIAOHead_2 .EQU obufhead2
2775 000052 ACIAOTail_1 .EQU obuftail
2776 000056 ACIAOTail_2 .EQU obuftail2
2777
2778 000100 ACIAOBUFLEN .EQU SOBUFSIZ
2779 000100 ACIAIBUFLEN .EQU SIBUFSIZ
2780 010000 ACIAOUTBUF1 .EQU SPOUTBUFF
2781 012000 ACIAOUTBUF2 .EQU SPOUTBUFF2
2782 050000 ACIAINBUF1 .EQU SPINBUFF
2783 054000 ACIAINBUF2 .EQU SPINBUFF2
2784
2785 000045 ACIATmp .EQU sptmp
2786
Lines Assembled : 3106 Errors : 0