
Module: /home/henthorn/AUV/gnc-branch/auv-qnx/auv/altex/onboard/camera/xportIO.cc
Group: 'DGROUP' CONST,CONST2,_DATA,_BSS

Segment: _TEXT  DWORD USE32  0000093d bytes  

/****************************************************************************/
/* Copyright (c) 2008 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  : operate XPort from command line                               */
/* Filename : xportIO.cc                                                  */
/* Author   : K Headley                                                     */
/* Project  : Benthic Imaging AUV                                           */
/* Created  : 04/01/2008                                                    */
/****************************************************************************/
/* Modification History:                                                    */
/*  $Id: xportIO.cc,v 1.3.4.1 2016/05/19 18:28:57 headley Exp $    */
/*  $Name: gnc $  */
/****************************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>

#include "XPort.h"
#include "BicamConsts.h"

#ifdef QNX
using namespace std;
#endif


/* 
   local function definitions 
*/
void printUsage(char *prog){
 0000                    void near printUsage( char near * ):
 0000  68 0c 00 00 00                    push    0000000cH
 0005  e8 00 00 00 00                    call    __CHK
 000a  53                                push    ebx
 000b  52                                push    edx
 000c  89 c3                             mov     ebx,eax

  cout<<endl;
 000e  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0013  b8 00 00 00 00                    mov     eax,offset ostream near cout
 0018  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"usage: "<<prog<<" [<options>...] <XPort host addresss>\n"<<endl;
 001d  ba 27 00 00 00                    mov     edx,offset L36
 0022  b8 00 00 00 00                    mov     eax,offset ostream near cout
 0027  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 002c  89 da                             mov     edx,ebx
 002e  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0033  ba 00 00 00 00                    mov     edx,offset L35
 0038  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 003d  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0042  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<endl;
 0047  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 004c  b8 00 00 00 00                    mov     eax,offset ostream near cout
 0051  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  -d         : get direction"<<endl;
 0056  ba 2f 00 00 00                    mov     edx,offset L37
 005b  b8 00 00 00 00                    mov     eax,offset ostream near cout
 0060  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0065  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 006a  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  -D [p1,p2] : set direction"<<endl;
 006f  ba 4c 00 00 00                    mov     edx,offset L38
 0074  b8 00 00 00 00                    mov     eax,offset ostream near cout
 0079  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 007e  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0083  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  -f         : get functions"<<endl;
 0088  ba 69 00 00 00                    mov     edx,offset L39
 008d  b8 00 00 00 00                    mov     eax,offset ostream near cout
 0092  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0097  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 009c  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  -h         : print usage message"<<endl;
 00a1  ba 86 00 00 00                    mov     edx,offset L40
 00a6  b8 00 00 00 00                    mov     eax,offset ostream near cout
 00ab  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 00b0  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 00b5  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  -H [host]  : xport host to use (use last argument by default)"<<endl;
 00ba  ba a9 00 00 00                    mov     edx,offset L41
 00bf  b8 00 00 00 00                    mov     eax,offset ostream near cout
 00c4  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 00c9  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 00ce  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  -l         : get active levels"<<endl;
 00d3  ba e9 00 00 00                    mov     edx,offset L42
 00d8  b8 00 00 00 00                    mov     eax,offset ostream near cout
 00dd  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 00e2  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 00e7  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  -L [p1,p2] : set active levels"<<endl;
 00ec  ba 0a 01 00 00                    mov     edx,offset L43
 00f1  b8 00 00 00 00                    mov     eax,offset ostream near cout
 00f6  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 00fb  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0100  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  -m [msg]   : send message"<<endl;
 0105  ba 2b 01 00 00                    mov     edx,offset L44
 010a  b8 00 00 00 00                    mov     eax,offset ostream near cout
 010f  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0114  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0119  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  -s         : get current states"<<endl;
 011e  ba 47 01 00 00                    mov     edx,offset L45
 0123  b8 00 00 00 00                    mov     eax,offset ostream near cout
 0128  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 012d  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0132  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  -S [p1,p2] : set current states"<<endl;
 0137  ba 69 01 00 00                    mov     edx,offset L46
 013c  b8 00 00 00 00                    mov     eax,offset ostream near cout
 0141  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0146  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 014b  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<endl;
 0150  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0155  b8 00 00 00 00                    mov     eax,offset ostream near cout
 015a  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"where"<<endl;
 015f  ba 8b 01 00 00                    mov     edx,offset L47
 0164  b8 00 00 00 00                    mov     eax,offset ostream near cout
 0169  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 016e  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0173  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  p1 - gpio select mask"<<endl;
 0178  ba 91 01 00 00                    mov     edx,offset L48
 017d  b8 00 00 00 00                    mov     eax,offset ostream near cout
 0182  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0187  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 018c  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  p2 - gpio value mask"<<endl;
 0191  ba a9 01 00 00                    mov     edx,offset L49
 0196  b8 00 00 00 00                    mov     eax,offset ostream near cout
 019b  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 01a0  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 01a5  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  msg - message string (enclosed in single quotes if it contains whitespace)"<<endl;
 01aa  ba c0 01 00 00                    mov     edx,offset L50
 01af  b8 00 00 00 00                    mov     eax,offset ostream near cout
 01b4  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 01b9  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 01be  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<endl;
 01c3  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 01c8  b8 00 00 00 00                    mov     eax,offset ostream near cout
 01cd  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  p1 and p2 are hex integers from 0x0-0xFFFF, e.g., 0x04,0x3A."<<endl;
 01d2  ba 0d 02 00 00                    mov     edx,offset L51
 01d7  b8 00 00 00 00                    mov     eax,offset ostream near cout
 01dc  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 01e1  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 01e6  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  Leading '0x' and leading zeros are permitted but not required."<<endl;
 01eb  ba 4c 02 00 00                    mov     edx,offset L52
 01f0  b8 00 00 00 00                    mov     eax,offset ostream near cout
 01f5  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 01fa  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 01ff  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<"  NOTE: XPort firmware supports up to 32 GPIO pins, but implements only 3 pins"<<endl;
 0204  ba 8d 02 00 00                    mov     edx,offset L53
 0209  b8 00 00 00 00                    mov     eax,offset ostream near cout
 020e  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0213  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0218  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  cout<<endl;
 021d  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0222  b8 00 00 00 00                    mov     eax,offset ostream near cout
 0227  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

}

 022c  5a                                pop     edx
 022d  5b                                pop     ebx
 022e  c3                                ret     

XPortCommand *makeCommand(unsigned char cmd,unsigned int p1,unsigned int p2){
 022f                    XPortCommand near * near makeCommand( char unsigned, int unsigned, int unsigned ):
 022f  68 20 00 00 00                    push    00000020H
 0234  e8 00 00 00 00                    call    __CHK
 0239  51                                push    ecx
 023a  56                                push    esi
 023b  57                                push    edi
 023c  83 ec 10                          sub     esp,00000010H
 023f  88 c1                             mov     cl,al
 0241  a1 00 00 00 00                    mov     eax,__wint_thread_data
 0246  89 04 24                          mov     [esp],eax
 0249  89 e0                             mov     eax,esp
 024b  a3 00 00 00 00                    mov     __wint_thread_data,eax
 0250  c7 44 24 04 00 00 
       00 00                             mov     dword ptr +4H[esp],offset L84
 0258  31 ff                             xor     edi,edi
 025a  89 7c 24 08                       mov     +8H[esp],edi

  return new XPortCommand(cmd,p1,p2);
 025e  b8 09 00 00 00                    mov     eax,00000009H
 0263  e8 00 00 00 00                    call    void near * near operator new( int unsigned )
 0268  85 c0                             test    eax,eax
 026a  74 22                             je      L1
 026c  0f b6 f1                          movzx   esi,cl
 026f  89 44 24 0c                       mov     +0cH[esp],eax
 0273  c7 44 24 08 01 00 
       00 00                             mov     dword ptr +8H[esp],00000001H
 027b  89 d9                             mov     ecx,ebx
 027d  89 d3                             mov     ebx,edx
 027f  89 f2                             mov     edx,esi
 0281  e8 00 00 00 00                    call    near XPortCommand::XPortCommand( char unsigned, int unsigned, int unsigned )
 0286  89 7c 24 08                       mov     +8H[esp],edi
 028a  89 c2                             mov     edx,eax
 028c  eb 02                             jmp     L2
 028e  89 fa             L1              mov     edx,edi

}

/* Main Entry Point */
 0290  8b 04 24          L2              mov     eax,[esp]
 0293  a3 00 00 00 00                    mov     __wint_thread_data,eax
 0298  89 d0                             mov     eax,edx
 029a  83 c4 10                          add     esp,00000010H
 029d  5f                                pop     edi
 029e  5e                                pop     esi
 029f  59                                pop     ecx
 02a0  c3                                ret     

int main (int argc, char *argv[]){

  int c;
  int testScan;
 02a1  68 68 01 00 00    main_           push    00000168H
 02a6  e8 00 00 00 00                    call    __CHK
 02ab  53                                push    ebx
 02ac  51                                push    ecx
 02ad  56                                push    esi
 02ae  57                                push    edi
 02af  55                                push    ebp
 02b0  81 ec 3c 01 00 00                 sub     esp,0000013cH
 02b6  50                                push    eax
 02b7  89 d1                             mov     ecx,edx

  unsigned int param1=0,param2=0;
  //int test;
 02b9  31 d2                             xor     edx,edx
 02bb  89 94 24 30 01 00 
       00                                mov     +130H[esp],edx
 02c2  89 94 24 34 01 00 
       00                                mov     +134H[esp],edx

  XPortResponse xpResponse;
 02c9  8d 84 24 28 01 00 
       00                                lea     eax,+128H[esp]
 02d0  e8 00 00 00 00                    call    near XPortResponse::XPortResponse()

  char* xportHost=NULL;

  XPortCommand *xpCommands[MAX_XPORT_COMMANDS];
  char *messages[MAX_XPORT_COMMANDS];
 02d5  89 94 24 38 01 00 
       00                                mov     +138H[esp],edx

  unsigned int i,commandCount=0;  
 02dc  31 ff                             xor     edi,edi

  unsigned int messageCount=0;
  
 02de  89 94 24 3c 01 00 
       00                                mov     +13cH[esp],edx

  if(argc < 2) {
 02e5  83 3c 24 02                       cmp     dword ptr [esp],00000002H
 02e9  7d 11                             jge     L3

    printUsage(argv[0]);
 02eb  8b 01                             mov     eax,[ecx]
 02ed  e8 00 00 00 00                    call    void near printUsage( char near * )

    exit(1);
  }


  /* parse command line arguments */
 02f2  b8 01 00 00 00                    mov     eax,00000001H
 02f7  e8 00 00 00 00                    call    exit_

  opterr = 0;
 02fc  31 d2             L3              xor     edx,edx
 02fe  89 15 00 00 00 00                 mov     _opterr,edx

  while((c= getopt(argc, argv, "hH:fdD:lL:m:sS:")) != -1 ){
    switch(c)
      {
      case 'd':
	/* get direction */
 0304  bb dc 02 00 00    L4              mov     ebx,offset L54
 0309  89 ca                             mov     edx,ecx
 030b  8b 04 24                          mov     eax,[esp]
 030e  e8 00 00 00 00                    call    getopt_
 0313  83 f8 ff                          cmp     eax,0ffffffffH
 0316  0f 85 da 02 00 00                 jne     L23
 031c  8b 04 24                          mov     eax,[esp]
 031f  48                                dec     eax
 0320  3b 05 00 00 00 00                 cmp     eax,_optind
 0326  0f 8c 77 03 00 00                 jl      L28
 032c  8b 04 24                          mov     eax,[esp]
 032f  8b 44 81 fc                       mov     eax,-4H[ecx+eax*4]
 0333  89 84 24 38 01 00 
       00                                mov     +138H[esp],eax
 033a  e9 e2 03 00 00                    jmp     L29

	xpCommands[commandCount++]=makeCommand(XP_CMD_GET_DIRECTIONS,CFG_MASK_GPIO_SEL_NONE,CFG_GPIO_NONE);
 033f  31 db             L5              xor     ebx,ebx
 0341  31 d2                             xor     edx,edx
 0343  b8 11 00 00 00                    mov     eax,00000011H
 0348  e8 00 00 00 00    L6              call    XPortCommand near * near makeCommand( char unsigned, int unsigned, int unsigned )
 034d  89 84 34 84 00 00 
       00                                mov     +84H[esp+esi],eax
 0354  89 ef                             mov     edi,ebp

	break;
      case 'D':
	/* set direction */
 0356  83 ff 20          L7              cmp     edi,00000020H
 0359  72 a9                             jb      L4
 035b  ba 1a 04 00 00                    mov     edx,offset L70
 0360  b8 00 00 00 00                    mov     eax,offset ostream near cerr
 0365  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 036a  ba 20 00 00 00                    mov     edx,00000020H
 036f  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( long )
 0374  ba 14 04 00 00                    mov     edx,offset L69
 0379  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 037e  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0383  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))
 0388  b8 ff ff ff ff                    mov     eax,0ffffffffH
 038d  e8 00 00 00 00                    call    exit_
 0392  e9 6d ff ff ff                    jmp     L4

	testScan=sscanf(optarg,"%x,%x",&param1,&param2);
 0397  8d 84 24 34 01 00 
       00                L8              lea     eax,+134H[esp]
 039e  50                                push    eax
 039f  8d 84 24 34 01 00 
       00                                lea     eax,+134H[esp]
 03a6  50                                push    eax
 03a7  b8 ec 02 00 00                    mov     eax,offset L55
 03ac  50                                push    eax
 03ad  8b 15 00 00 00 00                 mov     edx,_optarg
 03b3  52                                push    edx
 03b4  e8 00 00 00 00                    call    sscanf_
 03b9  83 c4 10                          add     esp,00000010H

	if(testScan<2){
 03bc  83 f8 02                          cmp     eax,00000002H
 03bf  7d 3e                             jge     L9

	  cerr<<"Invalid direction specified: ["<<optarg<<"] - expecting comma-separated hex values"<<endl;
 03c1  bb 00 00 00 00                    mov     ebx,offset ostream near & near endl( ostream near & )
 03c6  bd f2 02 00 00                    mov     ebp,offset L56
 03cb  8b 35 00 00 00 00                 mov     esi,_optarg
 03d1  ba 1b 03 00 00                    mov     edx,offset L57
 03d6  b8 00 00 00 00                    mov     eax,offset ostream near cerr
 03db  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 03e0  89 f2                             mov     edx,esi
 03e2  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 03e7  89 ea                             mov     edx,ebp
 03e9  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 03ee  89 da                             mov     edx,ebx
 03f0  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

	  exit(-1);
	}
 03f5  b8 ff ff ff ff                    mov     eax,0ffffffffH
 03fa  e8 00 00 00 00                    call    exit_

	xpCommands[commandCount++]=makeCommand(XP_CMD_SET_DIRECTIONS,param1,param2);
 03ff  8b 9c 24 34 01 00 
       00                L9              mov     ebx,+134H[esp]
 0406  8b 94 24 30 01 00 
       00                                mov     edx,+130H[esp]
 040d  b8 19 00 00 00                    mov     eax,00000019H
 0412  e8 00 00 00 00    L10             call    XPortCommand near * near makeCommand( char unsigned, int unsigned, int unsigned )
 0417  89 84 bc 84 00 00 
       00                                mov     +84H[esp+edi*4],eax
 041e  47                                inc     edi

	break;
      case 'f':
	/* get functions */
 041f  e9 32 ff ff ff                    jmp     L7

	xpCommands[commandCount++]=makeCommand(XP_CMD_GET_FUNCTIONS,CFG_MASK_GPIO_SEL_NONE,CFG_GPIO_NONE);
	break;
      case 'h':
 0424  31 db             L11             xor     ebx,ebx
 0426  31 d2                             xor     edx,edx
 0428  b8 10 00 00 00                    mov     eax,00000010H
 042d  e9 16 ff ff ff                    jmp     L6

	printUsage(argv[0]);
 0432  8b 01             L12             mov     eax,[ecx]
 0434  e8 00 00 00 00                    call    void near printUsage( char near * )

	exit(0);
 0439  31 c0                             xor     eax,eax
 043b  e8 00 00 00 00    L13             call    exit_

	break;
      case 'H':
 0440  e9 11 ff ff ff                    jmp     L7

	xportHost=optarg;
 0445  a1 00 00 00 00    L14             mov     eax,_optarg
 044a  89 84 24 38 01 00 
       00                                mov     +138H[esp],eax

	if(strlen(xportHost)>MAXHOSTNAMELEN){
 0451  e8 00 00 00 00                    call    strlen_
 0456  83 f8 40                          cmp     eax,00000040H
 0459  76 37                             jbe     L15

	  cerr<<"host name exceeds MAXHOSTNAMELEN ("<<MAXHOSTNAMELEN<<")"<<endl;
 045b  ba 3c 03 00 00                    mov     edx,offset L59
 0460  b8 00 00 00 00                    mov     eax,offset ostream near cerr
 0465  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 046a  ba 40 00 00 00                    mov     edx,00000040H
 046f  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( long )
 0474  ba 3a 03 00 00                    mov     edx,offset L58
 0479  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 047e  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0483  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

	  exit(1);
	}
 0488  b8 01 00 00 00                    mov     eax,00000001H
 048d  e8 00 00 00 00                    call    exit_

	cout<<"host set to "<<xportHost<<endl;
 0492  ba 5f 03 00 00    L15             mov     edx,offset L60
 0497  b8 00 00 00 00                    mov     eax,offset ostream near cout
 049c  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 04a1  8b 94 24 38 01 00 
       00                                mov     edx,+138H[esp]
 04a8  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 04ad  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 04b2  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

	break;
      case 'l':
	/* get active levels */
 04b7  e9 9a fe ff ff                    jmp     L7

	xpCommands[commandCount++]=makeCommand(XP_CMD_GET_ACTIVE_LEVELS,CFG_MASK_GPIO_SEL_NONE,CFG_GPIO_NONE);
	break;
      case 'L':
	/* set active levels */
 04bc  31 db             L16             xor     ebx,ebx
 04be  31 d2                             xor     edx,edx
 04c0  b8 12 00 00 00                    mov     eax,00000012H
 04c5  e9 7e fe ff ff                    jmp     L6

	testScan=sscanf(optarg,"%x,%x",&param1,&param2);
 04ca  8d 84 24 34 01 00 
       00                L17             lea     eax,+134H[esp]
 04d1  50                                push    eax
 04d2  8d 84 24 34 01 00 
       00                                lea     eax,+134H[esp]
 04d9  50                                push    eax
 04da  68 6c 03 00 00                    push    offset L61
 04df  a1 00 00 00 00                    mov     eax,_optarg
 04e4  50                                push    eax
 04e5  e8 00 00 00 00                    call    sscanf_
 04ea  83 c4 10                          add     esp,00000010H

	if(testScan<2){
 04ed  83 f8 02                          cmp     eax,00000002H
 04f0  7d 3a                             jge     L18

	  cerr<<"Invalid level specified: ["<<optarg<<"] - expecting comma-separated hex values"<<endl;
 04f2  8b 1d 00 00 00 00                 mov     ebx,_optarg
 04f8  ba 9b 03 00 00                    mov     edx,offset L63
 04fd  b8 00 00 00 00                    mov     eax,offset ostream near cerr
 0502  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0507  89 da                             mov     edx,ebx
 0509  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 050e  ba 72 03 00 00                    mov     edx,offset L62
 0513  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0518  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 051d  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

	  exit(-1);
	}
 0522  b8 ff ff ff ff                    mov     eax,0ffffffffH
 0527  e8 00 00 00 00                    call    exit_

	xpCommands[commandCount++]=makeCommand(XP_CMD_SET_ACTIVE_LEVELS,param1,param2);
	break;
      case 'm':
 052c  8b 9c 24 34 01 00 
       00                L18             mov     ebx,+134H[esp]
 0533  8b 94 24 30 01 00 
       00                                mov     edx,+130H[esp]
 053a  b8 1a 00 00 00                    mov     eax,0000001aH
 053f  e9 ce fe ff ff                    jmp     L10

	messages[messageCount]=optarg;
 0544  8b 84 24 3c 01 00 
       00                L19             mov     eax,+13cH[esp]
 054b  8b 15 00 00 00 00                 mov     edx,_optarg
 0551  89 54 84 04                       mov     +4H[esp+eax*4],edx

	xpCommands[commandCount++]=makeCommand(XP_CMD_SEND_MESSAGE,messageCount++,0x00);
	break;
      case 's':
	/* get current states */
 0555  89 c2                             mov     edx,eax
 0557  8d 78 01                          lea     edi,+1H[eax]
 055a  89 bc 24 3c 01 00 
       00                                mov     +13cH[esp],edi
 0561  31 db                             xor     ebx,ebx
 0563  b8 7f 00 00 00                    mov     eax,0000007fH
 0568  e9 db fd ff ff                    jmp     L6

	xpCommands[commandCount++]=makeCommand(XP_CMD_GET_CURRENT_STATES,CFG_MASK_GPIO_SEL_NONE,CFG_GPIO_NONE);
	break;
      case 'S':
	/* set current states */
 056d  31 db             L20             xor     ebx,ebx
 056f  31 d2                             xor     edx,edx
 0571  b8 13 00 00 00                    mov     eax,00000013H
 0576  e9 cd fd ff ff                    jmp     L6

	testScan=sscanf(optarg,"%x,%x",&param1,&param2);
 057b  8d 84 24 34 01 00 
       00                L21             lea     eax,+134H[esp]
 0582  50                                push    eax
 0583  8d 84 24 34 01 00 
       00                                lea     eax,+134H[esp]
 058a  50                                push    eax
 058b  68 b6 03 00 00                    push    offset L64
 0590  8b 2d 00 00 00 00                 mov     ebp,_optarg
 0596  55                                push    ebp
 0597  e8 00 00 00 00                    call    sscanf_
 059c  83 c4 10                          add     esp,00000010H

	if(testScan<2){
 059f  83 f8 02                          cmp     eax,00000002H
 05a2  7d 3a                             jge     L22

	  cerr<<"Invalid state specified: ["<<optarg<<"] - expecting comma-separated hex values"<<endl;
 05a4  8b 1d 00 00 00 00                 mov     ebx,_optarg
 05aa  ba e5 03 00 00                    mov     edx,offset L66
 05af  b8 00 00 00 00                    mov     eax,offset ostream near cerr
 05b4  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 05b9  89 da                             mov     edx,ebx
 05bb  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 05c0  ba bc 03 00 00                    mov     edx,offset L65
 05c5  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 05ca  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 05cf  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

	  exit(-1);
	}
 05d4  b8 ff ff ff ff                    mov     eax,0ffffffffH
 05d9  e8 00 00 00 00                    call    exit_

	xpCommands[commandCount++]=makeCommand(XP_CMD_SET_CURRENT_STATES,param1,param2);
	break;
      default:
	cerr<<"Unknown option: ["<<optopt<<"]"<<endl;
	exit(-1);
	break;
      }

    if(commandCount>=MAX_XPORT_COMMANDS){
      cerr<<"too many commands on command line ("<<MAX_XPORT_COMMANDS<<" max)"<<endl;
      exit(-1);
    }
  }

  if((argc-1)>=optind){
    xportHost=argv[argc-1];
  }else
 05de  8b 9c 24 34 01 00 
       00                L22             mov     ebx,+134H[esp]
 05e5  8b 94 24 30 01 00 
       00                                mov     edx,+130H[esp]
 05ec  b8 1b 00 00 00                    mov     eax,0000001bH
 05f1  e9 1c fe ff ff                    jmp     L10
 05f6  83 f8 64          L23             cmp     eax,00000064H
 05f9  72 46                             jb      L25
 05fb  8d 6f 01                          lea     ebp,+1H[edi]
 05fe  89 fe                             mov     esi,edi
 0600  c1 e6 02                          shl     esi,02H
 0603  83 f8 64                          cmp     eax,00000064H
 0606  0f 86 33 fd ff ff                 jbe     L5
 060c  83 f8 6c                          cmp     eax,0000006cH
 060f  72 1a                             jb      L24
 0611  0f 86 a5 fe ff ff                 jbe     L16
 0617  83 f8 6d                          cmp     eax,0000006dH
 061a  0f 86 24 ff ff ff                 jbe     L19
 0620  83 f8 73                          cmp     eax,00000073H
 0623  0f 84 44 ff ff ff                 je      L20
 0629  eb 40                             jmp     L27
 062b  83 f8 66          L24             cmp     eax,00000066H
 062e  72 3b                             jb      L27
 0630  0f 86 ee fd ff ff                 jbe     L11
 0636  83 f8 68                          cmp     eax,00000068H
 0639  0f 84 f3 fd ff ff                 je      L12
 063f  eb 2a                             jmp     L27
 0641  83 f8 48          L25             cmp     eax,00000048H
 0644  72 1c                             jb      L26
 0646  0f 86 f9 fd ff ff                 jbe     L14
 064c  83 f8 4c                          cmp     eax,0000004cH
 064f  72 1a                             jb      L27
 0651  0f 86 73 fe ff ff                 jbe     L17
 0657  83 f8 53                          cmp     eax,00000053H
 065a  0f 84 1b ff ff ff                 je      L21
 0660  eb 09                             jmp     L27
 0662  83 f8 44          L26             cmp     eax,00000044H
 0665  0f 84 2c fd ff ff                 je      L8
 066b  ba 02 04 00 00    L27             mov     edx,offset L68
 0670  b8 00 00 00 00                    mov     eax,offset ostream near cerr
 0675  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 067a  8b 15 00 00 00 00                 mov     edx,_optopt
 0680  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( long )
 0685  ba 00 04 00 00                    mov     edx,offset L67
 068a  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 068f  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0694  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))
 0699  b8 ff ff ff ff                    mov     eax,0ffffffffH
 069e  e9 98 fd ff ff                    jmp     L13

  if(xportHost==NULL){
 06a3  83 bc 24 38 01 00 
       00 00             L28             cmp     dword ptr +138H[esp],00000000H
 06ab  75 74                             jne     L29

    cout<<"argc="<<argc<<" optind="<<optind<<" host=NULL"<<endl;
 06ad  ba 52 04 00 00                    mov     edx,offset L73
 06b2  b8 00 00 00 00                    mov     eax,offset ostream near cout
 06b7  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 06bc  8b 14 24                          mov     edx,[esp]
 06bf  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( long )
 06c4  ba 49 04 00 00                    mov     edx,offset L72
 06c9  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 06ce  8b 15 00 00 00 00                 mov     edx,_optind
 06d4  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( long )
 06d9  ba 3e 04 00 00                    mov     edx,offset L71
 06de  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 06e3  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 06e8  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

    cerr<<endl<<"No XPort host specified"<<endl;
 06ed  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 06f2  b8 00 00 00 00                    mov     eax,offset ostream near cerr
 06f7  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))
 06fc  ba 58 04 00 00                    mov     edx,offset L74
 0701  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0706  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 070b  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

    printUsage(argv[0]);
 0710  8b 01                             mov     eax,[ecx]
 0712  e8 00 00 00 00                    call    void near printUsage( char near * )

    exit(1);
  }

 0717  b8 01 00 00 00                    mov     eax,00000001H
 071c  e8 00 00 00 00                    call    exit_

  cout<<"argc="<<argc<<" optind="<<optind<<" host="<<xportHost<<endl;
	
 0721  ba 80 04 00 00    L29             mov     edx,offset L77
 0726  b8 00 00 00 00                    mov     eax,offset ostream near cout
 072b  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0730  8b 14 24                          mov     edx,[esp]
 0733  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( long )
 0738  ba 77 04 00 00                    mov     edx,offset L76
 073d  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0742  8b 15 00 00 00 00                 mov     edx,_optind
 0748  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( long )
 074d  ba 70 04 00 00                    mov     edx,offset L75
 0752  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0757  8b 94 24 38 01 00 
       00                                mov     edx,+138H[esp]
 075e  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0763  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0768  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  XPort xport(xportHost,
	      GPIO_IP_PORT,SERIAL_IP_PORT,
	      CFG_GPIO_ALL,CFG_GPIO_OUT,
	      CFG_GPIO_ALL,CFG_GPIO_HI);

  /*
  errno=0;
  test=gethostname(xportHost,MAXHOSTNAMELEN);
  if(test<0)
    cout<<"gethostname failed errno "<<errno<<endl;
  */
 076d  68 ff 00 00 00                    push    000000ffH
 0772  68 ff 00 00 00                    push    000000ffH
 0777  68 ff 00 00 00                    push    000000ffH
 077c  68 ff 00 00 00                    push    000000ffH
 0781  b9 11 27 00 00                    mov     ecx,00002711H
 0786  bb f0 77 00 00                    mov     ebx,000077f0H
 078b  8b 94 24 48 01 00 
       00                                mov     edx,+148H[esp]
 0792  8d 84 24 14 01 00 
       00                                lea     eax,+114H[esp]
 0799  e8 00 00 00 00                    call    near XPort::XPort( char near *, int unsigned, int unsigned, int unsigned, int unsigned, int unsigned, int unsigned )

  xport.getConnection()->configAll(xportHost,
				   GPIO_IP_PORT,SERIAL_IP_PORT,
				   CFG_GPIO_ALL,CFG_GPIO_OUT,
				   CFG_GPIO_ALL,CFG_GPIO_HI);

 079e  68 ff 00 00 00                    push    000000ffH
 07a3  68 ff 00 00 00                    push    000000ffH
 07a8  68 ff 00 00 00                    push    000000ffH
 07ad  68 ff 00 00 00                    push    000000ffH
 07b2  8d 84 24 14 01 00 
       00                                lea     eax,+114H[esp]
 07b9  e8 00 00 00 00                    call    XPortConnection near * near XPort::getConnection()
 07be  b9 11 27 00 00                    mov     ecx,00002711H
 07c3  bb f0 77 00 00                    mov     ebx,000077f0H
 07c8  8b 94 24 48 01 00 
       00                                mov     edx,+148H[esp]
 07cf  e8 00 00 00 00                    call    int near XPortConnection::configAll( char near *, int unsigned, int unsigned, int unsigned, int unsigned, int unsigned, int unsigned )

  xport.connectxp(XPCON_ALL,FALSE);

 07d4  31 db                             xor     ebx,ebx
 07d6  ba 02 00 00 00                    mov     edx,00000002H
 07db  8d 84 24 04 01 00 
       00                                lea     eax,+104H[esp]
 07e2  e8 00 00 00 00                    call    int near XPort::connectxp( ConnectionID, BOOLEAN )

  for(i=0;i<commandCount;i++){
 07e7  31 ed                             xor     ebp,ebp
 07e9  eb 01                             jmp     L31
 07eb  45                L30             inc     ebp
 07ec  39 fd             L31             cmp     ebp,edi
 07ee  0f 83 1b 01 00 00                 jae     L34

    cout<<i<<" :";
 07f4  89 ea                             mov     edx,ebp
 07f6  b8 00 00 00 00                    mov     eax,offset ostream near cout
 07fb  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( long unsigned )
 0800  ba 86 04 00 00                    mov     edx,offset L78
 0805  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )

    if(xpCommands[i]!=NULL){
 080a  89 ee                             mov     esi,ebp
 080c  c1 e6 02                          shl     esi,02H
 080f  8b 9c 34 84 00 00 
       00                                mov     ebx,+84H[esp+esi]
 0816  85 db                             test    ebx,ebx
 0818  74 d1                             je      L30

      if(xpCommands[i]->getCommand()==XP_CMD_SEND_MESSAGE){
 081a  89 d8                             mov     eax,ebx
 081c  e8 00 00 00 00                    call    char unsigned near XPortCommand::getCommand()
 0821  25 ff 00 00 00                    and     eax,000000ffH
 0826  83 f8 7f                          cmp     eax,0000007fH
 0829  0f 85 82 00 00 00                 jne     L33

	cout<<" >> "<<xpCommands[i];
 082f  8b 9c 34 84 00 00 
       00                                mov     ebx,+84H[esp+esi]
 0836  ba 89 04 00 00                    mov     edx,offset L79
 083b  b8 00 00 00 00                    mov     eax,offset ostream near cout
 0840  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 0845  89 da                             mov     edx,ebx
 0847  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( void near * )

	xport.writeSerial(messages[xpCommands[i]->getP1()],strlen(messages[xpCommands[i]->getP1()]),0);
 084c  8b 84 34 84 00 00 
       00                                mov     eax,+84H[esp+esi]
 0853  e8 00 00 00 00                    call    int unsigned near XPortCommand::getP1()
 0858  8b 44 84 04                       mov     eax,+4H[esp+eax*4]
 085c  e8 00 00 00 00                    call    strlen_
 0861  89 c3                             mov     ebx,eax
 0863  8b 84 34 84 00 00 
       00                                mov     eax,+84H[esp+esi]
 086a  e8 00 00 00 00                    call    int unsigned near XPortCommand::getP1()
 086f  8b 54 84 04                       mov     edx,+4H[esp+eax*4]
 0873  31 c9                             xor     ecx,ecx
 0875  8d 84 24 04 01 00 
       00                                lea     eax,+104H[esp]
 087c  e8 00 00 00 00                    call    int near XPort::writeSerial( char const near *, int unsigned, int unsigned )

	xport.writeSerial("\r\n",strlen("\r\n"),0);
 0881  b8 8e 04 00 00                    mov     eax,offset L80
 0886  e8 00 00 00 00                    call    strlen_
 088b  31 c9                             xor     ecx,ecx
 088d  89 c3                             mov     ebx,eax
 088f  ba 91 04 00 00                    mov     edx,offset L81
 0894  8d 84 24 04 01 00 
       00                                lea     eax,+104H[esp]
 089b  e8 00 00 00 00                    call    int near XPort::writeSerial( char const near *, int unsigned, int unsigned )

	delete(xpCommands[i]);
 08a0  8b 84 34 84 00 00 
       00                L32             mov     eax,+84H[esp+esi]
 08a7  e8 00 00 00 00                    call    void near operator delete( void near * )

      }else{
 08ac  e9 3a ff ff ff                    jmp     L30

	cout<<" >> "<< *xpCommands[i];
 08b1  8b 9c 34 84 00 00 
       00                L33             mov     ebx,+84H[esp+esi]
 08b8  ba 94 04 00 00                    mov     edx,offset L82
 08bd  b8 00 00 00 00                    mov     eax,offset ostream near cout
 08c2  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 08c7  89 da                             mov     edx,ebx
 08c9  e8 00 00 00 00                    call    ostream near & near operator <<( ostream near &, XPortCommand const near & )

	xport.writeRead(xpCommands[i],&xpResponse);
 08ce  8b 94 34 84 00 00 
       00                                mov     edx,+84H[esp+esi]
 08d5  8d 9c 24 28 01 00 
       00                                lea     ebx,+128H[esp]
 08dc  8d 84 24 04 01 00 
       00                                lea     eax,+104H[esp]
 08e3  e8 00 00 00 00                    call    int near XPort::writeRead( XPortCommand near *, XPortResponse near * )

	cout<<" << "<<xpResponse<<endl;
	delete(xpCommands[i]);
      }
    }
  }
 08e8  ba 99 04 00 00                    mov     edx,offset L83
 08ed  b8 00 00 00 00                    mov     eax,offset ostream near cout
 08f2  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( char const near * )
 08f7  8d 94 24 28 01 00 
       00                                lea     edx,+128H[esp]
 08fe  e8 00 00 00 00                    call    ostream near & near operator <<( ostream near &, XPortResponse const near & )
 0903  ba 00 00 00 00                    mov     edx,offset ostream near & near endl( ostream near & )
 0908  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))
 090d  eb 91                             jmp     L32

  cout<<endl;
 090f  ba 00 00 00 00    L34             mov     edx,offset ostream near & near endl( ostream near & )
 0914  b8 00 00 00 00                    mov     eax,offset ostream near cout
 0919  e8 00 00 00 00                    call    ostream near & near ostream::operator <<( ostream near & (near *)( ))

  xport.disconnectxp(XPCON_ALL);

  return 0;
  
 091e  ba 02 00 00 00                    mov     edx,00000002H
 0923  8d 84 24 04 01 00 
       00                                lea     eax,+104H[esp]
 092a  e8 00 00 00 00                    call    int near XPort::disconnectxp( ConnectionID )

}
 092f  31 c0                             xor     eax,eax
 0931  81 c4 40 01 00 00                 add     esp,00000140H
 0937  5d                                pop     ebp
 0938  5f                                pop     edi
 0939  5e                                pop     esi
 093a  59                                pop     ecx
 093b  5b                                pop     ebx
 093c  c3                                ret     

No disassembly errors

------------------------------------------------------------

Segment: CONST  DWORD USE32  0000049e bytes  
 0000  20 5b 3c 6f 70 74 69 6f L35             -  [<optio
 0008  6e 73 3e 2e 2e 2e 5d 20                 - ns>...] 
 0010  3c 58 50 6f 72 74 20 68                 - <XPort h
 0018  6f 73 74 20 61 64 64 72                 - ost addr
 0020  65 73 73 73 3e 0a 00                    - esss>..
 0027  75 73 61 67 65 3a 20 00 L36             - usage: .
 002f  20 20 2d 64 20 20 20 20 L37             -   -d    
 0037  20 20 20 20 20 3a 20 67                 -      : g
 003f  65 74 20 64 69 72 65 63                 - et direc
 0047  74 69 6f 6e 00                          - tion.
 004c  20 20 2d 44 20 5b 70 31 L38             -   -D [p1
 0054  2c 70 32 5d 20 3a 20 73                 - ,p2] : s
 005c  65 74 20 64 69 72 65 63                 - et direc
 0064  74 69 6f 6e 00                          - tion.
 0069  20 20 2d 66 20 20 20 20 L39             -   -f    
 0071  20 20 20 20 20 3a 20 67                 -      : g
 0079  65 74 20 66 75 6e 63 74                 - et funct
 0081  69 6f 6e 73 00                          - ions.
 0086  20 20 2d 68 20 20 20 20 L40             -   -h    
 008e  20 20 20 20 20 3a 20 70                 -      : p
 0096  72 69 6e 74 20 75 73 61                 - rint usa
 009e  67 65 20 6d 65 73 73 61                 - ge messa
 00a6  67 65 00                                - ge.
 00a9  20 20 2d 48 20 5b 68 6f L41             -   -H [ho
 00b1  73 74 5d 20 20 3a 20 78                 - st]  : x
 00b9  70 6f 72 74 20 68 6f 73                 - port hos
 00c1  74 20 74 6f 20 75 73 65                 - t to use
 00c9  20 28 75 73 65 20 6c 61                 -  (use la
 00d1  73 74 20 61 72 67 75 6d                 - st argum
 00d9  65 6e 74 20 62 79 20 64                 - ent by d
 00e1  65 66 61 75 6c 74 29 00                 - efault).
 00e9  20 20 2d 6c 20 20 20 20 L42             -   -l    
 00f1  20 20 20 20 20 3a 20 67                 -      : g
 00f9  65 74 20 61 63 74 69 76                 - et activ
 0101  65 20 6c 65 76 65 6c 73                 - e levels
 0109  00                                      - .
 010a  20 20 2d 4c 20 5b 70 31 L43             -   -L [p1
 0112  2c 70 32 5d 20 3a 20 73                 - ,p2] : s
 011a  65 74 20 61 63 74 69 76                 - et activ
 0122  65 20 6c 65 76 65 6c 73                 - e levels
 012a  00                                      - .
 012b  20 20 2d 6d 20 5b 6d 73 L44             -   -m [ms
 0133  67 5d 20 20 20 3a 20 73                 - g]   : s
 013b  65 6e 64 20 6d 65 73 73                 - end mess
 0143  61 67 65 00                             - age.
 0147  20 20 2d 73 20 20 20 20 L45             -   -s    
 014f  20 20 20 20 20 3a 20 67                 -      : g
 0157  65 74 20 63 75 72 72 65                 - et curre
 015f  6e 74 20 73 74 61 74 65                 - nt state
 0167  73 00                                   - s.
 0169  20 20 2d 53 20 5b 70 31 L46             -   -S [p1
 0171  2c 70 32 5d 20 3a 20 73                 - ,p2] : s
 0179  65 74 20 63 75 72 72 65                 - et curre
 0181  6e 74 20 73 74 61 74 65                 - nt state
 0189  73 00                                   - s.
 018b  77 68 65 72 65 00       L47             - where.
 0191  20 20 70 31 20 2d 20 67 L48             -   p1 - g
 0199  70 69 6f 20 73 65 6c 65                 - pio sele
 01a1  63 74 20 6d 61 73 6b 00                 - ct mask.
 01a9  20 20 70 32 20 2d 20 67 L49             -   p2 - g
 01b1  70 69 6f 20 76 61 6c 75                 - pio valu
 01b9  65 20 6d 61 73 6b 00                    - e mask.
 01c0  20 20 6d 73 67 20 2d 20 L50             -   msg - 
 01c8  6d 65 73 73 61 67 65 20                 - message 
 01d0  73 74 72 69 6e 67 20 28                 - string (
 01d8  65 6e 63 6c 6f 73 65 64                 - enclosed
 01e0  20 69 6e 20 73 69 6e 67                 -  in sing
 01e8  6c 65 20 71 75 6f 74 65                 - le quote
 01f0  73 20 69 66 20 69 74 20                 - s if it 
 01f8  63 6f 6e 74 61 69 6e 73                 - contains
 0200  20 77 68 69 74 65 73 70                 -  whitesp
 0208  61 63 65 29 00                          - ace).
 020d  20 20 70 31 20 61 6e 64 L51             -   p1 and
 0215  20 70 32 20 61 72 65 20                 -  p2 are 
 021d  68 65 78 20 69 6e 74 65                 - hex inte
 0225  67 65 72 73 20 66 72 6f                 - gers fro
 022d  6d 20 30 78 30 2d 30 78                 - m 0x0-0x
 0235  46 46 46 46 2c 20 65 2e                 - FFFF, e.
 023d  67 2e 2c 20 30 78 30 34                 - g., 0x04
 0245  2c 30 78 33 41 2e 00                    - ,0x3A..
 024c  20 20 4c 65 61 64 69 6e L52             -   Leadin
 0254  67 20 27 30 78 27 20 61                 - g '0x' a
 025c  6e 64 20 6c 65 61 64 69                 - nd leadi
 0264  6e 67 20 7a 65 72 6f 73                 - ng zeros
 026c  20 61 72 65 20 70 65 72                 -  are per
 0274  6d 69 74 74 65 64 20 62                 - mitted b
 027c  75 74 20 6e 6f 74 20 72                 - ut not r
 0284  65 71 75 69 72 65 64 2e                 - equired.
 028c  00                                      - .
 028d  20 20 4e 4f 54 45 3a 20 L53             -   NOTE: 
 0295  58 50 6f 72 74 20 66 69                 - XPort fi
 029d  72 6d 77 61 72 65 20 73                 - rmware s
 02a5  75 70 70 6f 72 74 73 20                 - upports 
 02ad  75 70 20 74 6f 20 33 32                 - up to 32
 02b5  20 47 50 49 4f 20 70 69                 -  GPIO pi
 02bd  6e 73 2c 20 62 75 74 20                 - ns, but 
 02c5  69 6d 70 6c 65 6d 65 6e                 - implemen
 02cd  74 73 20 6f 6e 6c 79 20                 - ts only 
 02d5  33 20 70 69 6e 73 00                    - 3 pins.
 02dc  68 48 3a 66 64 44 3a 6c L54             - hH:fdD:l
 02e4  4c 3a 6d 3a 73 53 3a 00                 - L:m:sS:.
 02ec  25 78 2c 25 78 00       L55             - %x,%x.
 02f2  5d 20 2d 20 65 78 70 65 L56             - ] - expe
 02fa  63 74 69 6e 67 20 63 6f                 - cting co
 0302  6d 6d 61 2d 73 65 70 61                 - mma-sepa
 030a  72 61 74 65 64 20 68 65                 - rated he
 0312  78 20 76 61 6c 75 65 73                 - x values
 031a  00                                      - .
 031b  49 6e 76 61 6c 69 64 20 L57             - Invalid 
 0323  64 69 72 65 63 74 69 6f                 - directio
 032b  6e 20 73 70 65 63 69 66                 - n specif
 0333  69 65 64 3a 20 5b 00                    - ied: [.
 033a  29 00                   L58             - ).
 033c  68 6f 73 74 20 6e 61 6d L59             - host nam
 0344  65 20 65 78 63 65 65 64                 - e exceed
 034c  73 20 4d 41 58 48 4f 53                 - s MAXHOS
 0354  54 4e 41 4d 45 4c 45 4e                 - TNAMELEN
 035c  20 28 00                                -  (.
 035f  68 6f 73 74 20 73 65 74 L60             - host set
 0367  20 74 6f 20 00                          -  to .
 036c  25 78 2c 25 78 00       L61             - %x,%x.
 0372  5d 20 2d 20 65 78 70 65 L62             - ] - expe
 037a  63 74 69 6e 67 20 63 6f                 - cting co
 0382  6d 6d 61 2d 73 65 70 61                 - mma-sepa
 038a  72 61 74 65 64 20 68 65                 - rated he
 0392  78 20 76 61 6c 75 65 73                 - x values
 039a  00                                      - .
 039b  49 6e 76 61 6c 69 64 20 L63             - Invalid 
 03a3  6c 65 76 65 6c 20 73 70                 - level sp
 03ab  65 63 69 66 69 65 64 3a                 - ecified:
 03b3  20 5b 00                                -  [.
 03b6  25 78 2c 25 78 00       L64             - %x,%x.
 03bc  5d 20 2d 20 65 78 70 65 L65             - ] - expe
 03c4  63 74 69 6e 67 20 63 6f                 - cting co
 03cc  6d 6d 61 2d 73 65 70 61                 - mma-sepa
 03d4  72 61 74 65 64 20 68 65                 - rated he
 03dc  78 20 76 61 6c 75 65 73                 - x values
 03e4  00                                      - .
 03e5  49 6e 76 61 6c 69 64 20 L66             - Invalid 
 03ed  73 74 61 74 65 20 73 70                 - state sp
 03f5  65 63 69 66 69 65 64 3a                 - ecified:
 03fd  20 5b 00                                -  [.
 0400  5d 00                   L67             - ].
 0402  55 6e 6b 6e 6f 77 6e 20 L68             - Unknown 
 040a  6f 70 74 69 6f 6e 3a 20                 - option: 
 0412  5b 00                                   - [.
 0414  20 6d 61 78 29 00       L69             -  max).
 041a  74 6f 6f 20 6d 61 6e 79 L70             - too many
 0422  20 63 6f 6d 6d 61 6e 64                 -  command
 042a  73 20 6f 6e 20 63 6f 6d                 - s on com
 0432  6d 61 6e 64 20 6c 69 6e                 - mand lin
 043a  65 20 28 00                             - e (.
 043e  20 68 6f 73 74 3d 4e 55 L71             -  host=NU
 0446  4c 4c 00                                - LL.
 0449  20 6f 70 74 69 6e 64 3d L72             -  optind=
 0451  00                                      - .
 0452  61 72 67 63 3d 00       L73             - argc=.
 0458  4e 6f 20 58 50 6f 72 74 L74             - No XPort
 0460  20 68 6f 73 74 20 73 70                 -  host sp
 0468  65 63 69 66 69 65 64 00                 - ecified.
 0470  20 68 6f 73 74 3d 00    L75             -  host=.
 0477  20 6f 70 74 69 6e 64 3d L76             -  optind=
 047f  00                                      - .
 0480  61 72 67 63 3d 00       L77             - argc=.
 0486  20 3a 00                L78             -  :.
 0489  20 3e 3e 20 00          L79             -  >> .
 048e  0d 0a 00                L80             - ...
 0491  0d 0a 00                L81             - ...
 0494  20 3e 3e 20 00          L82             -  >> .
 0499  20 3c 3c 20 00          L83             -  << .

No disassembly errors

------------------------------------------------------------

Segment: CONST2  DWORD USE32  00000016 bytes  
 0000  00 00 00 00 00 00 00 00 L84             - ........
 0008  0c 00 00 00                             DD      DGROUP:L85
 000c  0a 00 0c 00 00 00       L85             - ......
 0012  00 00 00 00                             DD      void near operator delete( void near * )

No disassembly errors

------------------------------------------------------------

Comdat: istream near & near operator >>( istream near &, <long near >::smanip const near & )  SEGMENT ANY '_TEXT'  00000021 bytes  
 0000  68 0c 00 00 00                    push    0000000cH
 0005  e8 00 00 00 00                    call    __CHK
 000a  53                                push    ebx
 000b  51                                push    ecx
 000c  89 c3                             mov     ebx,eax
 000e  89 d1                             mov     ecx,edx
 0010  8b 52 04                          mov     edx,+4H[edx]
 0013  8b 00                             mov     eax,[eax]
 0015  8b 40 04                          mov     eax,+4H[eax]
 0018  01 d8                             add     eax,ebx
 001a  ff 11                             call    dword ptr [ecx]
 001c  89 d8                             mov     eax,ebx
 001e  59                                pop     ecx
 001f  5b                                pop     ebx
 0020  c3                                ret     

No disassembly errors

------------------------------------------------------------

Comdat: istream near & near operator >>( istream near &, <int near >::smanip const near & )  SEGMENT ANY '_TEXT'  00000021 bytes  
 0000  68 0c 00 00 00                    push    0000000cH
 0005  e8 00 00 00 00                    call    __CHK
 000a  53                                push    ebx
 000b  51                                push    ecx
 000c  89 c3                             mov     ebx,eax
 000e  89 d1                             mov     ecx,edx
 0010  8b 52 04                          mov     edx,+4H[edx]
 0013  8b 00                             mov     eax,[eax]
 0015  8b 40 04                          mov     eax,+4H[eax]
 0018  01 d8                             add     eax,ebx
 001a  ff 11                             call    dword ptr [ecx]
 001c  89 d8                             mov     eax,ebx
 001e  59                                pop     ecx
 001f  5b                                pop     ebx
 0020  c3                                ret     

No disassembly errors

------------------------------------------------------------

Comdat: ostream near & near operator <<( ostream near &, <long near >::smanip const near & )  SEGMENT ANY '_TEXT'  00000021 bytes  
 0000  68 0c 00 00 00                    push    0000000cH
 0005  e8 00 00 00 00                    call    __CHK
 000a  53                                push    ebx
 000b  51                                push    ecx
 000c  89 c3                             mov     ebx,eax
 000e  89 d1                             mov     ecx,edx
 0010  8b 52 04                          mov     edx,+4H[edx]
 0013  8b 00                             mov     eax,[eax]
 0015  8b 40 04                          mov     eax,+4H[eax]
 0018  01 d8                             add     eax,ebx
 001a  ff 11                             call    dword ptr [ecx]
 001c  89 d8                             mov     eax,ebx
 001e  59                                pop     ecx
 001f  5b                                pop     ebx
 0020  c3                                ret     

No disassembly errors

------------------------------------------------------------

Comdat: ostream near & near operator <<( ostream near &, <int near >::smanip const near & )  SEGMENT ANY '_TEXT'  00000021 bytes  
 0000  68 0c 00 00 00                    push    0000000cH
 0005  e8 00 00 00 00                    call    __CHK
 000a  53                                push    ebx
 000b  51                                push    ecx
 000c  89 c3                             mov     ebx,eax
 000e  89 d1                             mov     ecx,edx
 0010  8b 52 04                          mov     edx,+4H[edx]
 0013  8b 00                             mov     eax,[eax]
 0015  8b 40 04                          mov     eax,+4H[eax]
 0018  01 d8                             add     eax,ebx
 001a  ff 11                             call    dword ptr [ecx]
 001c  89 d8                             mov     eax,ebx
 001e  59                                pop     ecx
 001f  5b                                pop     ebx
 0020  c3                                ret     

No disassembly errors

------------------------------------------------------------
