📄 counter.lst
字号:
CYASM Version 1.75
(C) 1997 Cypress Semiconductor Corp.
0000 ; Port Usage
0000 ; P1.0 -
0000 ; .1 -
0000 ; .2 - Button (0=pushed) (input)
0000 ; .3 - LED (0=on) (output)
0000 ;
0000 ;*******************************************************************************
0000
0000 ;//$PAGE
0000 ; Directives
0000 FillROM 0
0000
0000 ; Microprocessor definitions
0000 ;;******************************************************************************
0000 ;; C7C63x0x.h - Cypress Semiconductor Cy7C63x0x micrprocessor definitions
0000 ;; Copyright (c) Slade Systems, Inc, 1997
0000 ;;
0000 ;; Cypress Semiconductor Corp.
0000 ;; 12032 113th Ave NE, Kirkland, WA 98034
0000 ;; 206-821-9202 - 206-820-8959(f)
0000 ;;
0000 ;;******************************************************************************
0000
0000
0000 ;*******************************************************************************
0000 ;
0000 ; M8 - 8bit microprocessor
0000 ; registers: accumulator 'acc'
0000 ; index 'x'
0000 ; stack pointer 'dsp'
0000 ; program SP 'psp'
0000 ; program counter 'pc' 16 bits (14 bit addressing)
0000 ; PC low 'pcl'
0000 ; PC high 'pch'
0000 ; When PC is pushed on stack
0000 ; carry flag is stored in bit 14
0000 ; zero flag is stored in bit 15
0000 ;
0000 ; Program ROM 4096 bytes in 256 byte pages
0000 ; Program RAM 128 bytes
0000 ; Processor PORTs contain 16k-ohm resistor (pull-up and slew control)
0000 ;
0000 ; After reset:
0000 ; Port 0 and Port 1 are set high
0000 ;
0000 ;
0000 ;*******************************************************************************
0000
0000 ;*************************************************
0000 ;
0000 ; I/O ports defined
0000 SysPort0 :equ 00h ; GPIO data port 0 (P00-P07)
0000 SysPort1 :equ 01h ; GPIO data port 1 (P10-P13)
0000 SysPort0IntEnable :equ 04h ; Port0 Interrupt Enable
0000 SysPort1IntEnable :equ 05h ; Port1 Interrupt Enable
0000 SysPort0PullUp :equ 08h ; Port0 PullUp Resistor Enable (0=active)
0000 SysPort1PullUp :equ 09h ; Port1 PullUp Resistor Enable (0=active)
0000
0000 ; General
0000 SysStatus :equ FFh ;
0000 SysStatusRun :equ 01h ;
0000 SysStatusReserved2 :equ 02h ; nul
0000 SysStatusReserved3 :equ 04h ; nul
0000 SysStatusSuspend :equ 08h ; write only (restart =256us)
0000 SysStatusPowerOn :equ 10h ;
0000 SysStatusUSBReset :equ 20h ;
0000 SysStatusWDReset :equ 40h ;
0000 SysStatusReserved7 :equ 80h ; nul
0000 SysWatchDog :equ 21h ; WatchDog controller
0000 SysTimerExternal :equ 22h ; Timer also ???
0000 SysTimer :equ 23h ; Timer (read only) {6MHZ=1us resolution}
0000 SysInterrupt :equ 20h ; Global interrupt
0000 SysIntReserved0 :equ 01h ;
0000 SysIntTimer128us :equ 02h ;
0000 SysIntTimer1024us :equ 04h ;
0000 SysIntUSBEndP0 :equ 08h ;
0000 SysIntUSBEndP1 :equ 10h ;
0000 SysIntReserved5 :equ 20h ;
0000 SysIntGPIO :equ 40h ;
0000 SysIntWakeUp :equ 80h ;
0000
0000 ; Ouput ISink ???
0000 SysPort0ISinkPin0 :equ 30h ;
0000 SysPort0ISinkPin1 :equ 31h ;
0000 SysPort0ISinkPin2 :equ 32h ;
0000 SysPort0ISinkPin3 :equ 33h ;
0000 SysPort0ISinkPin4 :equ 34h ;
0000 SysPort0ISinkPin5 :equ 35h ;
0000 SysPort0ISinkPin6 :equ 36h ;
0000 SysPort0ISinkPin7 :equ 37h ;
0000 SysPort1ISinkPin0 :equ 38h ;
0000 SysPort1ISinkPin1 :equ 39h ;
0000 SysPort1ISinkPin2 :equ 3Ah ;
0000 SysPort1ISinkPin3 :equ 3Bh ;
0000
0000 ; USB FIFOs
0000 USBEndP0FIFO :equ 70h
0000 USBEndP0FIFO_0 :equ 70h ; Will contain CRC if (rx count <8)
0000 USBEndP0FIFO_1 :equ 71h
0000 USBEndP0FIFO_2 :equ 72h
0000 USBEndP0FIFO_3 :equ 73h
0000 USBEndP0FIFO_4 :equ 74h
0000 USBEndP0FIFO_5 :equ 75h
0000 USBEndP0FIFO_6 :equ 76h
0000 USBEndP0FIFO_7 :equ 77h
0000 ;
0000 USBEndP1FIFO :equ 78h
0000 USBEndP1FIFO_0 :equ 78h
0000 USBEndP1FIFO_1 :equ 79h
0000 USBEndP1FIFO_2 :equ 7Ah
0000 USBEndP1FIFO_3 :equ 7Bh
0000 USBEndP1FIFO_4 :equ 7Ch
0000 USBEndP1FIFO_5 :equ 7Dh
0000 USBEndP1FIFO_6 :equ 7Eh
0000 USBEndP1FIFO_7 :equ 7Fh
0000
0000 ;*************************************************
0000 ;
0000 USBDeviceAddress :equ 12h ; Assigned device address
0000
0000 ; USB port control
0000 USBControl :equ 13h ; Status/Control register
0000 USBControlBusActive :equ 01h ; 1=active, write 0 and watch if bus dies
0000 USBControlResume :equ 02h ; set transmitter to k state sending resume to host ???
0000 USBControlReserve2 :equ 04h
0000 USBControlAckStatusData :equ 08h ; Auto ACK Data1 SETUP OUT data packets
0000 USBControlAckOutData :equ 10h ; Auto ACK Data1 OUT data packets
0000 USBControlReserve5 :equ 20h
0000 USBControlReserve6 :equ 40h
0000 USBControlReserve7 :equ 80h
0000
0000 USBEndP0RxStatus :equ 14h ; Port0 receive status
0000 USBEndP0RxSetup :equ 01h ; 1=setup token received (must be cleared to write FIFOs ???)
0000 USBEndP0RxOut :equ 02h ; 1=out token received
0000 USBEndP0RxIn :equ 04h ; 1=in token received
0000 USBEndP0RxDataFlag :equ 08h
0000 USBEndP0RxCount0 :equ 10h ; size =count -2 (two bytes of CRC)
0000 USBEndP0RxCount1 :equ 20h
0000 USBEndP0RxCount2 :equ 40h
0000 USBEndP0RxCount3 :equ 80h
0000
0000 USBEndP0TxConfig :equ 10h ; Transmit configuration
0000 USBEndP0TxCount0 :equ 01h
0000 USBEndP0TxCount1 :equ 02h
0000 USBEndP0TxCount2 :equ 04h
0000 USBEndP0TxCount3 :equ 08h
0000 USBEndP0TxRxErr :equ 10h ; read and write
0000 USBEndP0TxStall :equ 20h ;
0000 USBEndP0TxSequence :equ 40h ;
0000 USBEndP0TxRespond :equ 80h ;
0000
0000 USBEndP1TxConfig :equ 11h ;
0000 USBEndP1TxCount0 :equ 01h
0000 USBEndP1TxCount1 :equ 02h
0000 USBEndP1TxCount2 :equ 04h
0000 USBEndP1TxCount3 :equ 08h
0000 USBEndP1TxEnable :equ 10h ;
0000 USBEndP1TxStall :equ 20h ;
0000 USBEndP1TxSequence :equ 40h ;
0000 USBEndP1TxRespond :equ 80h
0000
0000 ;*************************************************
0000 ; USB Protocol
0000 ;union USBRqst
0000 ;{ struct
0000 ; { BYTE bReceipient :5; // 0=Device,1=Interface,2=Endpoint,3=Other,4..31=Reserved
0000 ; BYTE bType :2; // 1=Standard,1=Class,2=Vendor,3=Reserved
0000 ; BYTE bDirection :1; // 0=Host to Device,1=Device to Host
0000 ; BYTE bRqst; //
0000 ; // 0x00,0x01,0x02 =Clear Feature
0000 ; // 0x00,0x01,0x02 =Set Feature
0000 ; // 0x80,0x81,0x82 =Get Status
0000 ; // 0x00 =Set Address
0000 ; // 0x80 =Get Descriptor
0000 ; // 0x00 =Set Descriptor
0000 ; // 0x80 =Get Configuration
0000 ; // 0x81 =Get Interface
0000 ; // 0x01 =Set Interface
0000 ; // 0x82 =Synch Frame
0000 ; WORD wValue; //
0000 ; WORD wIndex; //
0000 ; WORD wLength; //
0000 ; }
0000 ;}
0000
0000 ;*************************************************
0000 ; USB Protocol
0000 USBRqstType :equ USBEndP0FIFO_0 ;
0000 USBRqstTypeDirection :equ 80h ; 1=Device to Host,0=Host to Device
0000
0000 USBRqstTypeMask :equ 60h
0000 USBRqstTypeStandard :equ 00h
0000 USBRqstTypeClass :equ 20h
0000 USBRqstTypeVendor :equ 40h
0000 USBRqstTypeReserved :equ 60h
0000
0000 USBRqstTargetDevice :equ 00h
0000 USBRqstTargetInterface :equ 01h
0000 USBRqstTargetEndPoint :equ 02h
0000 USBRqstTargetOther :equ 03h
0000
0000 USBRqstMessage :equ USBEndP0FIFO_1 ;
0000 USBRqstGetStatus :equ 00h ; bit field: 0x01 =Self powered,0x02 =Remote wakeup
0000 USBRqstClearFeature :equ 01h
0000 USBRqstReserved02 :equ 02h
0000 USBRqstSetFeature :equ 03h
0000 USBRqstReserved04 :equ 04h
0000 USBRqstSetAddress :equ 05h
0000 USBRqstGetDescriptor :equ 06h
0000 USBRqstSetDescriptor :equ 07h
0000 USBRqstGetConfiguration :equ 08h
0000 USBRqstSetConfiguration :equ 09h
0000 USBRqstGetInterface :equ 0Ah
0000 USBRqstSetInterface :equ 0Bh
0000 USBRqstSynchFrame :equ 0Ch
0000 USBRqstReserved0D :equ 0Dh
0000
0000 USBRqstWordValueLo :equ USBEndP0FIFO_2 ;
0000 USBRqstWordValueHi :equ USBEndP0FIFO_3 ;
0000
0000 ;*************************************************
0000 ;
0000 USBDescriptorTypeDevice :equ 01h
0000 USBDescriptorTypeConfig :equ 02h
0000 USBDescriptorTypeString :equ 03h
0000 USBDescriptorTypeInterface :equ 04h
0000 USBDescriptorTypeEndPoint :equ 05h
0000 USBDescriptorTypeReserved06 :equ 06h
0000
0000 ;*************************************************
0000 ;
0000 USBRawProtocolSetup :equ B4h
0000 USBRawProtocolIn :equ 96h
0000 USBRawProtocolOut :equ 87h
0000 USBRawProtocolPort0 :equ C3h
0000 USBRawProtocolPort1 :equ D2h
0000 USBRawProtocolACK :equ 4Bh
0000 USBRawProtocolNAK :equ 5Ah
0000
0000
0000 ;*************************************************
0000 ; Data Segment (RAM)
0000 ;*************************************************
0000
0000 ; Program Stack
0000 gbSysProgramStack :equ 00h ; [00h-1Fh] Stack 0x20h
0000 gbSysDataStack :equ 50h ; [50h-6Fh] Stack 0x70h
0000 gbSysFIFO :equ 70h ; [70h-7Fh] EP0 and EP1 FIFO's
0000
0000 ; Global Interrupt
0000 gbSysInterruptMask :equ 20h ; Holds the current interrupt mask
0000
0000 ; USB management data
0000 gbUSBSendSequence :equ 28h ; Buffer send data 0/1 line
0000 gbUSBSendBytes :equ 29h ; Buffer bytes left to send
0000 gbUSBSendBuffer :equ 2Ah ; Offset into current buffer
0000
0000 gbSuspendCount :equ 2Bh ; # of msec bus has been IDLE
0000
0000 ; Button management
0000 gbButtonDebounce :equ 2Ch ; Debounce count down value
0000 gbButtonClicks :equ 2Dh ; Button count value
0000
0000 Button_Pin :equ 04h ; Pin the switch is on, P12
0000 LED_ON :equ 08h ; P13 is used to indicate Enumeration
0000
0000 ;//$PAGE
0000 ;*************************************************
0000 ; Code Segment (ROM)
0000 ;*************************************************
0000
0000 ; Vector Table
0000 org 00h
0000 80 15 [05] jmp main ; Reset of some type
0002 80 10 [05] jmp SysUnUsed ; 128us timer (not used)
0004 80 48 [05] jmp SysTimer1024usEvent ; 1024us timer
0006 80 AD [05] jmp USBEndPoint0Event ; EP0
0008 80 A2 [05] jmp USBEndPoint1Event ; EP1 (not used)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -