                         .module crap.c
--- 0000                   .dbfile crap.c
                         .area text
                       ;  IX -> 0,x
 9813                  _SCI_isr::
 9813                    .dbfile C:\ICCTJP\include/isrdecl.h
 9813                    .dbfunc SCI_isr
 9813                    .dbline 41
                       ; /************************************************************************************************************************
                       ; *   Program:        crap.c                          *
                       ; *   Description:    This program was written to test the pneumatic                      *
                       ; *                   valves and cylinders.  It will prompt the user  *
                       ; *                   to select the desired function (manual or       *
                       ; *                   automatic positioning) and to select the desired      *
                       ; *                   characteristics of the PWM signal for the       *
                       ; *                   valves.                 *
                       ; *   Programmer:     Scott Nortman                   *
                       ; *   Date:           March 16, 2000                  *
                       ; ************************************************************************************************************************/
                       ; 
                       ; /**************************** Constants *********************************/
                       ; #define pulse_handler TOC2_isr
                       ; #define valve_sensor analog(1)
                       ; #define in  0
                       ; #define out 1
                       ; #define P 0
                       ; #define I 1
                       ; #define D 2
                       ; #define dt 4096
                       ; /**************************** End of Constants **************************/
                       ; 
                       ; /*************************** Interrupts *********************************/
                       ; 
                       ; /*************************** End of Interrupts **************************/
                       ; #pragma interrupt_handler TOC2_isr, RTI_isr;
                       ; /************************** Includes ************************************/
                       ; #include <tjpbase.h>
                       ; #include <analog.h>
                       ; #include <vectors.h>
                       ; #include <mil.h>
                       ; #include <hc11.h>
                       ; /************************ End of includes *******************************/
                       ; 
                       ; /************************** Global Variables*****************************/
                       ; long duty_cycle;    //duty_cycle in e clocks
                       ; long period;        //period in e clocks
                       ; int desired_position;
                       ; int error[3] = {0};
                       ; int k[3] = {500, 0, 0};
 9813                  L2:
 9813  3B                rti
                       ;  IX -> 0,x
 9814                  _SPI_isr::
 9814                    .dbfunc SPI_isr
 9814                    .dbline 47
                       ; 
                       ; /************************ End of Global Variables ***********************/
                       ; 
                       ; 
                       ; /************************** Function Declarations  **********************/
                       ; 
 9814                  L3:
 9814  3B                rti
                       ;  IX -> 0,x
 9815                  _PAIE_isr::
 9815                    .dbfunc PAIE_isr
 9815                    .dbline 53
                       ; /******************** End of Function Declarations  *********************/
                       ; 
                       ; 
                       ; /**************************** Main **************************************/
                       ; 
                       ; void main(void)
 9815                  L4:
 9815  3B                rti
                       ;  IX -> 0,x
 9816                  _PAV_isr::
 9816                    .dbfunc PAV_isr
 9816                    .dbline 59
                       ; {
                       ;     /* VT100 clear screen */ 
                       ;     char clear[]= "\x1b\x5B\x32\x4A\x04"; 
                       ;     
                       ;     /* VT100 position cursor at (x,y) = (3,12) command is "\x1b[3;12H"*/
                       ;     char place_home[]= "\x1b[1;1H"; /*Home*/
 9816                  L5:
 9816  3B                rti
                       ;  IX -> 0,x
 9817                  _TOF_isr::
 9817                    .dbfunc TOF_isr
 9817                    .dbline 65
                       ;     
                       ;     char place_text[] = "\x1b[10;1H";/*position for text to be entered*/
                       ; init_analog();
                       ;     init_serial();
                       ; while(1){   
                       ;     duty_cycle = 500 * valve_sensor;
 9817                  L6:
 9817  3B                rti
                       ;  IX -> 0,x
 9818                  _TOC3_isr::
 9818                    .dbfunc TOC3_isr
 9818                    .dbline 89
                       ;     
                       ;     printf("%s", clear);
                       ;     printf("%s", place_home);
                       ;     
                       ;     printf("%d\n", duty_cycle);
                       ;     }
                       ; } 
                       ; 
                       ; void TOC2_isr(void){
                       ; CLEAR_FLAG(TFLG1, 0x40);
                       ; }
                       ; 
                       ; void RTI_isr(void){
                       ; CLEAR_FLAG(TFLG2, 0x40);
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 9818                  L7:
 9818  3B                rti
                       ;  IX -> 0,x
 9819                  _TIC3_isr::
 9819                    .dbfunc TIC3_isr
 9819                    .dbline 101
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 9819                  L8:
 9819  3B                rti
                       ;  IX -> 0,x
 981A                  _TIC2_isr::
 981A                    .dbfunc TIC2_isr
 981A                    .dbline 107
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 981A                  L9:
 981A  3B                rti
                       ;  IX -> 0,x
 981B                  _TIC1_isr::
 981B                    .dbfunc TIC1_isr
 981B                    .dbline 113
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 981B                  L10:
 981B  3B                rti
                       ;  IX -> 0,x
 981C                  _IRQ_isr::
 981C                    .dbfunc IRQ_isr
 981C                    .dbline 125
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 981C                  L11:
 981C  3B                rti
                       ;  IX -> 0,x
 981D                  _XIRQ_isr::
 981D                    .dbfunc XIRQ_isr
 981D                    .dbline 131
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 981D                  L12:
 981D  3B                rti
                       ;  IX -> 0,x
 981E                  _SWI_isr::
 981E                    .dbfunc SWI_isr
 981E                    .dbline 137
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 981E                  L13:
 981E  3B                rti
                       ;  IX -> 0,x
 981F                  _ILLOP_isr::
 981F                    .dbfunc ILLOP_isr
 981F                    .dbline 143
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 981F                  L14:
 981F  3B                rti
                       ;  IX -> 0,x
 9820                  _COP_isr::
 9820                    .dbfunc COP_isr
 9820                    .dbline 149
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 9820                  L15:
 9820  3B                rti
                       ;  IX -> 0,x
 9821                  _CLMON_isr::
 9821                    .dbfunc CLMON_isr
 9821                    .dbline 155
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 9821                  L16:
 9821  3B                rti
                         .area data
 98FD                  _drew::
 98FD                    .blkw 1
                         .area idata
--- 0000 0000              .word _interrupt_vectors
                         .area data
 98FF                  _error::
 98FF                    .blkb 2
                         .area idata
--- 0002 0000              .word 0
                         .area data
--- 0004                   .blkb 4
                         .area idata
--- 0004 00000000          .byte 0,0,0,0
                         .area data
 9905                  _k::
 9905                    .blkb 2
                         .area idata
--- 0008 01F4              .word 500
                         .area data
--- 000A                   .blkb 2
                         .area idata
--- 000A 0000              .word 0
                         .area data
--- 000C                   .blkb 2
                         .area idata
--- 000C 0000              .word 0
                         .area text
--- 000F                 L18:
--- 000F 1B5B324A0400      .byte 27,91,50,'J,4,0
--- 0015                 L19:
--- 0015 1B5B313B314800    .byte 27,91,49,59,49,'H,0
--- 001C                 L20:
--- 001C 1B5B31303B314800  .byte 27,91,49,48,59,49,'H,0
                       ;  lreg1 -> -4,x
                       ;  lreg2 -> -8,x
                       ;  IX -> 0,x
                       ;  func temp: 2,x - 4,x
                       ;     place_text -> 5,x
                       ;     place_home -> 13,x
                       ;          clear -> 20,x
 9837                  _main::
 9837  BD86BA            jsr __enterb
 983A  9A                .byte 0x9a
 983B                    .dbfile crap.c
 983B                    .dbfunc main
 983B                    .dbline 56
 983B  EC00              ldd 0,x
 983D  C30014            addd #20
 9840  18CE9822          ldy #L18
 9844  3C                pshx
 9845  8F                xgdx
 9846  CC0006            ldd #6
 9849  BD86A2            jsr __asgnblk
 984C  38                pulx
 984D                    .dbline 59
 984D  EC00              ldd 0,x
 984F  C3000D            addd #13
 9852  18CE9828          ldy #L19
 9856  3C                pshx
 9857  8F                xgdx
 9858  CC0007            ldd #7
 985B  BD86A2            jsr __asgnblk
 985E  38                pulx
 985F                    .dbline 61
 985F  EC00              ldd 0,x
 9861  C30005            addd #5
 9864  18CE982F          ldy #L20
 9868  3C                pshx
 9869  8F                xgdx
 986A  CC0008            ldd #8
 986D  BD86A2            jsr __asgnblk
 9870  38                pulx
 9871                    .dbline 62
 9871  BD813B            jsr _init_analog
 9874                    .dbline 63
 9874  BD8381            jsr _init_serial
 9877  2053              bra L22
 9879                  L21:
 9879                    .dbline 65
 9879  CC0001            ldd #1
 987C  BD8144            jsr _analog
 987F  ED02              std 2,x
 9881  CC01F4            ldd #500
 9884  1AEE02            ldy 2,x
 9887  BD8669            jsr __muli
 988A  BD8987            jsr __d2lreg
 988D  18CE9928          ldy #_duty_cycle
 9891  BD8935            jsr __lreg2y
 9894                    .dbline 67
 9894  EC00              ldd 0,x
 9896  C30014            addd #20
 9899  37                pshb
 989A  36                psha
 989B  CC98EC            ldd #L24
 989E  BD9442            jsr _printf
 98A1  1838              puly
 98A3                    .dbline 68
 98A3  EC00              ldd 0,x
 98A5  C3000D            addd #13
 98A8  37                pshb
 98A9  36                psha
 98AA  CC98EC            ldd #L24
 98AD  BD9442            jsr _printf
 98B0  1838              puly
 98B2                    .dbline 70
 98B2  18CE9928          ldy #_duty_cycle
 98B6  BD88F8            jsr __ly2reg
 98B9  183C              pshy
 98BB  183C              pshy
 98BD  1830              tsy
 98BF  BD8935            jsr __lreg2y
 98C2  CC98E8            ldd #L25
 98C5  BD9442            jsr _printf
 98C8  1838              puly
 98CA  1838              puly
 98CC                    .dbline 71
 98CC                  L22:
 98CC  20AB              bra L21
 98CE                  L17:
 98CE  8F                xgdx
 98CF  C3001A            addd #26
 98D2  8F                xgdx
 98D3  35                txs
 98D4  38                pulx
 98D5  39                rts
                       ;  IX -> 0,x
 98D6                  _TOC2_isr::
 98D6                    .dbfunc TOC2_isr
 98D6                    .dbline 75
 98D6  18CE1023          ldy #0x1023
 98DA  181D00BF          bclr 0,y,#0xbf
 98DE                    .dbline 76
 98DE                  L26:
 98DE  3B                rti
                       ;  IX -> 0,x
 98DF                  _RTI_isr::
 98DF                    .dbfunc RTI_isr
 98DF                    .dbline 79
 98DF  18CE1025          ldy #0x1025
 98E3  181D00BF          bclr 0,y,#0xbf
 98E7                    .dbline 80
 98E7                  L27:
 98E7  3B                rti
                         .area bss
 9922                  _desired_position::
 9922                    .blkb 2
 9924                  _period::
 9924                    .blkb 4
 9928                  _duty_cycle::
 9928                    .blkb 4
 992C                  _timertjp::
 992C                    .blkb 2
 992E                  _days::
 992E                    .blkb 2
 9930                  _hours::
 9930                    .blkb 2
 9932                  _minutes::
 9932                    .blkb 2
 9934                  _seconds::
 9934                    .blkb 2
 9936                  _msec::
 9936                    .blkb 2
                         .area text
--- 00D5                 L25:
--- 00D5 25640A00          .byte 37,'d,10,0
--- 00D9                 L24:
--- 00D9 257300            .byte 37,'s,0
