                         .module crap.c
 0000                   .dbfile crap.c
                         .area text
                       ;  IX -> 0,x
 0000                 _SCI_isr::
 0000                   .dbfile C:\ICCTJP\include/isrdecl.h
 0000                   .dbfunc SCI_isr
 0000                   .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};
 0000                 L2:
 0000 3B                rti
                       ;  IX -> 0,x
 0001                 _SPI_isr::
 0001                   .dbfunc SPI_isr
 0001                   .dbline 47
                       ; 
                       ; /************************ End of Global Variables ***********************/
                       ; 
                       ; 
                       ; /************************** Function Declarations  **********************/
                       ; 
 0001                 L3:
 0001 3B                rti
                       ;  IX -> 0,x
 0002                 _PAIE_isr::
 0002                   .dbfunc PAIE_isr
 0002                   .dbline 53
                       ; /******************** End of Function Declarations  *********************/
                       ; 
                       ; 
                       ; /**************************** Main **************************************/
                       ; 
                       ; void main(void)
 0002                 L4:
 0002 3B                rti
                       ;  IX -> 0,x
 0003                 _PAV_isr::
 0003                   .dbfunc PAV_isr
 0003                   .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*/
 0003                 L5:
 0003 3B                rti
                       ;  IX -> 0,x
 0004                 _TOF_isr::
 0004                   .dbfunc TOF_isr
 0004                   .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;
 0004                 L6:
 0004 3B                rti
                       ;  IX -> 0,x
 0005                 _TOC3_isr::
 0005                   .dbfunc TOC3_isr
 0005                   .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);
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 0005                 L7:
 0005 3B                rti
                       ;  IX -> 0,x
 0006                 _TIC3_isr::
 0006                   .dbfunc TIC3_isr
 0006                   .dbline 101
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 0006                 L8:
 0006 3B                rti
                       ;  IX -> 0,x
 0007                 _TIC2_isr::
 0007                   .dbfunc TIC2_isr
 0007                   .dbline 107
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 0007                 L9:
 0007 3B                rti
                       ;  IX -> 0,x
 0008                 _TIC1_isr::
 0008                   .dbfunc TIC1_isr
 0008                   .dbline 113
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 0008                 L10:
 0008 3B                rti
                       ;  IX -> 0,x
 0009                 _IRQ_isr::
 0009                   .dbfunc IRQ_isr
 0009                   .dbline 125
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 0009                 L11:
 0009 3B                rti
                       ;  IX -> 0,x
 000A                 _XIRQ_isr::
 000A                   .dbfunc XIRQ_isr
 000A                   .dbline 131
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 000A                 L12:
 000A 3B                rti
                       ;  IX -> 0,x
 000B                 _SWI_isr::
 000B                   .dbfunc SWI_isr
 000B                   .dbline 137
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 000B                 L13:
 000B 3B                rti
                       ;  IX -> 0,x
 000C                 _ILLOP_isr::
 000C                   .dbfunc ILLOP_isr
 000C                   .dbline 143
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 000C                 L14:
 000C 3B                rti
                       ;  IX -> 0,x
 000D                 _COP_isr::
 000D                   .dbfunc COP_isr
 000D                   .dbline 149
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 000D                 L15:
 000D 3B                rti
                       ;  IX -> 0,x
 000E                 _CLMON_isr::
 000E                   .dbfunc CLMON_isr
 000E                   .dbline 155
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
                       ; }
 000E                 L16:
 000E 3B                rti
                         .area data
 0000                 _drew::
 0000                   .blkw 1
                         .area idata
 0000 0000              .word _interrupt_vectors
                         .area data
 0002                 _error::
 0002                   .blkb 2
                         .area idata
 0002 0000              .word 0
                         .area data
 0004                   .blkb 4
                         .area idata
 0004 00000000          .byte 0,0,0,0
                         .area data
 0008                 _k::
 0008                   .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
 0024                 _main::
 0024 BD0000            jsr __enterb
 0027 9A                .byte 0x9a
 0028                   .dbfile crap.c
 0028                   .dbfunc main
 0028                   .dbline 56
 0028 EC00              ldd 0,x
 002A C30014            addd #20
 002D 18CE000F          ldy #L18
 0031 3C                pshx
 0032 8F                xgdx
 0033 CC0006            ldd #6
 0036 BD0000            jsr __asgnblk
 0039 38                pulx
 003A                   .dbline 59
 003A EC00              ldd 0,x
 003C C3000D            addd #13
 003F 18CE0015          ldy #L19
 0043 3C                pshx
 0044 8F                xgdx
 0045 CC0007            ldd #7
 0048 BD0000            jsr __asgnblk
 004B 38                pulx
 004C                   .dbline 61
 004C EC00              ldd 0,x
 004E C30005            addd #5
 0051 18CE001C          ldy #L20
 0055 3C                pshx
 0056 8F                xgdx
 0057 CC0008            ldd #8
 005A BD0000            jsr __asgnblk
 005D 38                pulx
 005E                   .dbline 62
 005E BD0000            jsr _init_analog
 0061                   .dbline 63
 0061 BD0000            jsr _init_serial
 0064 2053              bra L22
 0066                 L21:
 0066                   .dbline 65
 0066 CC0001            ldd #1
 0069 BD0000            jsr _analog
 006C ED02              std 2,x
 006E CC01F4            ldd #500
 0071 1AEE02            ldy 2,x
 0074 BD0000            jsr __muli
 0077 BD0000            jsr __d2lreg
 007A 18CE0006          ldy #_duty_cycle
 007E BD0000            jsr __lreg2y
 0081                   .dbline 67
 0081 EC00              ldd 0,x
 0083 C30014            addd #20
 0086 37                pshb
 0087 36                psha
 0088 CC00D9            ldd #L24
 008B BD0000            jsr _printf
 008E 1838              puly
 0090                   .dbline 68
 0090 EC00              ldd 0,x
 0092 C3000D            addd #13
 0095 37                pshb
 0096 36                psha
 0097 CC00D9            ldd #L24
 009A BD0000            jsr _printf
 009D 1838              puly
 009F                   .dbline 70
 009F 18CE0006          ldy #_duty_cycle
 00A3 BD0000            jsr __ly2reg
 00A6 183C              pshy
 00A8 183C              pshy
 00AA 1830              tsy
 00AC BD0000            jsr __lreg2y
 00AF CC00D5            ldd #L25
 00B2 BD0000            jsr _printf
 00B5 1838              puly
 00B7 1838              puly
 00B9                   .dbline 71
 00B9                 L22:
 00B9 20AB              bra L21
 00BB                 L17:
 00BB 8F                xgdx
 00BC C3001A            addd #26
 00BF 8F                xgdx
 00C0 35                txs
 00C1 38                pulx
 00C2 39                rts
                       ;  IX -> 0,x
 00C3                 _TOC2_isr::
 00C3                   .dbfunc TOC2_isr
 00C3                   .dbline 75
 00C3 18CE1023          ldy #0x1023
 00C7 181D00BF          bclr 0,y,#0xbf
 00CB                   .dbline 76
 00CB                 L26:
 00CB 3B                rti
                       ;  IX -> 0,x
 00CC                 _RTI_isr::
 00CC                   .dbfunc RTI_isr
 00CC                   .dbline 79
 00CC 18CE1025          ldy #0x1025
 00D0 181D00BF          bclr 0,y,#0xbf
 00D4                   .dbline 80
 00D4                 L27:
 00D4 3B                rti
                         .area bss
 0000                 _desired_position::
 0000                   .blkb 2
 0002                 _period::
 0002                   .blkb 4
 0006                 _duty_cycle::
 0006                   .blkb 4
 000A                 _timertjp::
 000A                   .blkb 2
 000C                 _days::
 000C                   .blkb 2
 000E                 _hours::
 000E                   .blkb 2
 0010                 _minutes::
 0010                   .blkb 2
 0012                 _seconds::
 0012                   .blkb 2
 0014                 _msec::
 0014                   .blkb 2
                         .area text
 00D5                 L25:
 00D5 25640A00          .byte 37,'d,10,0
 00D9                 L24:
 00D9 257300            .byte 37,'s,0
