Attachment 'IHPIB1.S'

Download

   1 ^IAL^ 
   2 **************************************************************
   3 * 
   4 * INVERSE ASSEMBLER FOR THE HPIB BUS
   5 * 
   6 * This source code can be used with the HP 64620S, HP 1630A/D/G
   7 * HP 1631A/D, HP 1650A, HP 1651A or HP 16510A logic analyzers.
   8 * 2011-07-11 RudolfReuter, Version 1.0
   9 *
  10 * INPUT_DATA consists of the following GPIB signals (POD 4):
  11 *   Clock J DAV
  12 *   BIT 7   DIO8
  13 *   Bit 6   DIO7
  14 *   BIT 5   DIO6
  15 *   Bit 4   DIO5
  16 *   BIT 3   DIO4
  17 *   Bit 2   DIO3
  18 *   BIT 1   DIO2
  19 *   Bit 0   DIO1
  20 *
  21 * INPUT_STATUS consists of the following GPIB signals (POD 3): 
  22 *   Clock K PAR POLL Option
  23 *   BIT 7   NRFD
  24 *   Bit 6   DAV
  25 *   BIT 5   NDAC
  26 *   Bit 4   SRQ                          _
  27 *   BIT 3   IFC
  28 *   BIT 2   REN
  29 *   BIT 1   EOI
  30 *   BIT 0   ATN
  31 * 
  32 *   These signals are clocked in at the negativ edge of DAV
  33 ***************************************************************
  34 *                      INITIALIZE
  35 ***************************************************************
  36 *        SEARCH_LIMIT     5
  37         DEFAULT_WIDTH    41
  38         LABEL_TITLE      "       ATN  Mnemonic  HEX EOI SRQ REN IFC" 
  39         BASE_TITLE       "                Instructions"
  40 
  41 *  LSB Bit Masks
  42 ML5         CONSTANT    01FH       5 LSB MASK
  43 ML7         CONSTANT    07FH
  44 ML8         CONSTANT    080H
  45 INSTR_LINE  CONSTANT    1      FLAG FOR INSTR LINE
  46 
  47 *        SET RETURN_FLAGS,INSTR_LINE  PRESET TO INSTRUCTION LINE
  48 		SET RETURN_FLAGS,0
  49 
  50 		LOAD INPUT_STATUS    ; Get Status Byte
  51 * show command lines as string
  52 		POSITION ABS,39 
  53 		IF 3,3 <> 0 THEN GOTO TST_ATN  IFC
  54 		OUTPUT S_IFC
  55 TST_ATN
  56 		POSITION ABS,8
  57 		IF 0,0 <> 0 THEN GOTO TST_EOI  ATN
  58 		OUTPUT S_ATN
  59 TST_EOI
  60 		POSITION ABS,27
  61 		IF 1,1 <> 0 THEN GOTO TST_REN  EOI
  62 		OUTPUT S_EOI
  63 TST_REN
  64 		POSITION ABS,35
  65 		IF 2,2 <> 0 THEN GOTO TST_SRQ  REN
  66         OUTPUT S_REN
  67 TST_SRQ
  68         POSITION ABS,31
  69         IF 4,4 <> 0 THEN GOTO OUT_DAT  SRQ
  70         OUTPUT S_SRQ
  71 OUT_DAT
  72         POSITION ABS,23
  73         LOAD INPUT_DATA     ; Get Data Byte
  74         OUTPUT ACCUMULATOR,HEX2_FMT
  75         POSITION ABS,13
  76 * check if Status needs special treatment
  77         LOAD INPUT_STATUS     Get Status Byte
  78         CASE_OF 1,0           handle PARPOLL, EOI & ATN
  79             OUTPUT S_PARPOLL
  80             CALL ANALYSIS     EOI
  81             CALL CMD_SEL      ATN, Data = GPIB Command
  82             CALL ANALYSIS     Data
  83         CASE_END             
  84         RETURN
  85 * now take care about the data and GPIB commands
  86 ANALYSIS
  87         LOAD INPUT_DATA       Get Data Byte
  88         POSITION ABS,1
  89         IF 7,0 < ML8 THEN GOTO IS_ASCII 
  90         OUTPUT S_MSBSET
  91 IS_ASCII
  92         AND ML7
  93         POSITION ABS,13 
  94         IF 6,0 > 020H THEN GOTO ASC_OUT
  95 *  display Control character as string
  96         POSITION REL,1
  97         CASE_OF 4,0
  98             OUTPUT S_NUL
  99             OUTPUT S_SOH 
 100             OUTPUT S_STX 
 101             OUTPUT S_ETX
 102             OUTPUT S_EOT
 103             OUTPUT S_ENQ 
 104             OUTPUT S_ACK 
 105             OUTPUT S_BEL 
 106             OUTPUT S_BS 
 107             OUTPUT S_HT 
 108             OUTPUT S_LF 
 109             OUTPUT S_VT
 110             OUTPUT S_FF 
 111             OUTPUT S_CR 
 112             OUTPUT S_SO 
 113             OUTPUT S_SI 
 114             OUTPUT S_DLE 
 115             OUTPUT S_DC1 
 116             OUTPUT S_DC2 
 117             OUTPUT S_DC3 
 118             OUTPUT S_DC4 
 119             OUTPUT S_NAK 
 120             OUTPUT S_SYN 
 121             OUTPUT S_ETB 
 122             OUTPUT S_CAN 
 123             OUTPUT S_EM  
 124             OUTPUT S_SUB  
 125             OUTPUT S_ESC 
 126             OUTPUT S_FS  
 127             OUTPUT S_GS  
 128             OUTPUT S_RS  
 129             OUTPUT S_US 
 130         CASE_END 
 131         RETURN
 132 
 133 ASC_OUT
 134         IF 6,0 <> 020H THEN GOTO ASC_OUT2
 135         POSITION REL,1 
 136         OUTPUT S_SPACE  
 137         RETURN 
 138 ASC_OUT2  ; display 7 bit Data byte in ASCII format
 139         POSITION REL,3 
 140         OUTPUT ACCUMULATOR,ASC_FMT  
 141         RETURN 
 142 
 143 CMD_SEL  ; select GPIB Command
 144        LOAD INPUT_DATA 
 145        AND ML7
 146        CASE_OF 6,4     0x10 - 0x70
 147 			CALL PRI_CMD 
 148 			CALL ACG_CMD 
 149 			CALL LISTEN 
 150 			CALL LISTEN 
 151 			CALL TALK   
 152 			CALL TALK   
 153 			CALL SGC_CMD
 154 			CALL SGC_CMD
 155        CASE_END
 156        RETURN
 157 
 158 PRI_CMD
 159 		CASE_OF 3,0  
 160 		    GOTO PRI_RET 
 161 		    OUTPUT S_GTL
 162 		    GOTO PRI_RET 
 163 		    GOTO PRI_RET 
 164 		    OUTPUT S_SDC
 165 		    OUTPUT S_PPC 
 166 		    GOTO PRI_RET 
 167 		    GOTO PRI_RET 
 168 		    OUTPUT S_GET 
 169 		    OUTPUT S_TCT 
 170 		    GOTO PRI_RET 
 171 		    GOTO PRI_RET
 172 		    GOTO PRI_RET 
 173 		    GOTO PRI_RET 
 174 		    GOTO PRI_RET 
 175 		    GOTO PRI_RET 
 176         CASE_END 
 177 PRI_RET
 178         RETURN
 179 
 180 ACG_CMD
 181         OUTPUT S_ACG 
 182         AND 0FH        prepare $11-$19 for case selector
 183         OUTPUT S_ACG2 
 184 		CASE_OF 3,0 
 185 			GOTO ACG_RET
 186 			OUTPUT S_LLO 
 187 			GOTO ACG_RET
 188 			GOTO ACG_RET 
 189 			OUTPUT S_DCL 
 190 			OUTPUT S_PPU
 191 			GOTO ACG_RET 
 192 			GOTO ACG_RET 
 193 			OUTPUT S_SPE 
 194 			OUTPUT S_SPD 
 195 			GOTO ACG_RET 
 196 			GOTO ACG_RET 
 197 			GOTO ACG_RET 
 198 			GOTO ACG_RET 
 199 			GOTO ACG_RET
 200 			GOTO ACG_RET 
 201         CASE_END 
 202 ACG_RET
 203         RETURN
 204                 
 205 UCG_CMD
 206         OUTPUT S_UCG 
 207         AND 07H 
 208         OUTPUT S_UCG2 
 209         RETURN  
 210 
 211 LISTEN
 212         AND ML5 
 213         IF 4,0 <> 01FH THEN GOTO LISTEN2 
 214         OUTPUT S_UNL 
 215         RETURN 
 216 LISTEN2
 217         OUTPUT S_LAG
 218         OUTPUT ACCUMULATOR,DEC2_FMT_5 
 219         RETURN  
 220 TALK
 221         AND ML5
 222         IF 4,0 <> 01FH THEN GOTO TALK2
 223         OUTPUT S_UNT 
 224         RETURN
 225 TALK2
 226         OUTPUT S_TAG
 227         OUTPUT ACCUMULATOR,DEC2_FMT_5 
 228         RETURN 
 229 SGC_CMD
 230         OUTPUT S_SCG 
 231         OUTPUT ACCUMULATOR,HEX2_FMT 
 232         OUTPUT S_SCG2
 233         RETURN 
 234 
 235 HEX2_FMT        FORMAT  8,HEX,2     8 BITS, HEX, 2 DIGITS
 236 DEC2_FMT_5      FORMAT  5,DEC,2     5 BITS, DEC, 2 DIGITS
 237 ASC_FMT 	    FORMAT 	ASCII
 238 *  Strings
 239 TITL1           ASCII "       ATN  Mnemonic  HEX EOI SRQ REN IFC " 
 240 S_SPC1          ASCII " "
 241 S_IFC           ASCII "IFC" 
 242 S_ATN           ASCII "ATN" 
 243 S_EOI           ASCII "EOI"
 244 S_REN           ASCII "REN" 
 245 S_SRQ           ASCII "SRQ"
 246 S_PARPOLL       ASCII "PAR POLL "
 247 S_MSBSET        ASCII "MSB set"
 248 * Control characters
 249 S_NUL           ASCII "<NUL>"
 250 S_SOH           ASCII "<SOH>"
 251 S_STX           ASCII "<STX>"
 252 S_ETX           ASCII "<ETX>"
 253 S_EOT           ASCII "<EOT>"
 254 S_ENQ           ASCII "<ENQ>"
 255 S_ACK           ASCII "<ACK>"
 256 S_BEL           ASCII "<BEL>"
 257 S_BS            ASCII "<BS >"
 258 S_HT            ASCII "<HT >"
 259 S_LF            ASCII "<LF >"
 260 S_VT            ASCII "<VT >"
 261 S_FF            ASCII "<FF >"
 262 S_CR            ASCII "<CR >"
 263 S_SO            ASCII "<SO >"
 264 S_SI            ASCII "<SI >"
 265 S_DLE           ASCII "<DLE>"
 266 S_DC1           ASCII "<DC1>"
 267 S_DC2           ASCII "<DC2>"
 268 S_DC3           ASCII "<DC3>"
 269 S_DC4           ASCII "<DC4>"
 270 S_NAK           ASCII "<NAK>"
 271 S_SYN           ASCII "<SYN>"
 272 S_ETB           ASCII "<ETB>"
 273 S_CAN           ASCII "<CAN>"
 274 S_EM            ASCII "<EM >"
 275 S_SUB           ASCII "<SUB>"
 276 S_ESC           ASCII "<ESC>"
 277 S_FS            ASCII "<FS >"
 278 S_GS            ASCII "<GS >"
 279 S_RS            ASCII "<RS >"
 280 S_US            ASCII "<US >"
 281 * 
 282 S_SPACE         ASCII "space"
 283 S_GTL           ASCII " GTL"   Go To Local             0x01
 284 S_SDC           ASCII "  SDC"  Selected Device Clear   0x04
 285 S_PPC           ASCII "  PPC"  Parallel Poll Configure 0x05
 286 S_GET           ASCII "  GET"  Group Execute Trigger   0x08
 287 S_TCT           ASCII "  TCT"  Take Control            0x09
 288 S_ACG           ASCII "ACG ["  Addressed Command Group
 289 S_ACG2          ASCII "]"
 290 S_LLO           ASCII "  LLO"  Local Lockout           0x11
 291 S_DCL           ASCII "  DCL"  Device Clear            0x14
 292 S_PPU           ASCII "  PPU"  Parallel Poll Unconfig. 0x15
 293 S_SPE           ASCII "  SPE"  Serial Poll Unable      0x18
 294 S_SPD           ASCII "  SPD"  Serial Poll Disable     0x19
 295 S_UCG           ASCII "UCG ["  Universal Command Group
 296 S_UCG2          ASCII "]"
 297 S_UNL           ASCII " *UNL* " Unlisten               0x3F
 298 S_LAG           ASCII " LAG_"   Listener Address
 299 S_UNT           ASCII " *UNT* " Untalk                 0x5F
 300 S_TAG           ASCII " TAG_"   Talker Address
 301 S_SCG           ASCII "SCG ["  Secondary Command Group
 302 S_SCG2          ASCII "]"

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2013-05-08 04:53:00, 6.4 KB) [[attachment:HP1652_GPIB_InvAsm.png]]
  • [get | view] (2013-05-08 04:53:00, 5.7 KB) [[attachment:HP1652_GPIB_InvAsmO.png]]
  • [get | view] (2013-05-08 04:53:00, 71.3 KB) [[attachment:HP1652_GPIB_TimeDSC01721.jpg]]
  • [get | view] (2013-05-08 04:53:00, 84.3 KB) [[attachment:HP1652_SFORM_GPIB_DSC01719.jpg]]
  • [get | view] (2013-05-08 04:53:00, 2.1 KB) [[attachment:IHPIB1.R]]
  • [get | view] (2017-05-28 13:40:00, 7.8 KB) [[attachment:IHPIB1.S]]
  • [get | view] (2013-05-08 04:53:00, 18.0 KB) [[attachment:IHPIB1.TXT]]
  • [get | view] (2013-05-08 04:53:00, 5.4 KB) [[attachment:State_Format_GPIB.png]]
  • [get | view] (2013-05-08 04:53:00, 10.8 KB) [[attachment:hp1652.py]]
  • [get | view] (2020-05-02 03:30:47, 11.9 KB) [[attachment:hp1652_ser.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.