Use 'ao-dbg' instead of 's51' to communicate with TeleMetrum
[fw/sdcc] / debugger / mcs51 / simi.h
1 /*-------------------------------------------------------------------------
2   simi.h - Header file for simulator interaction
3         Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
4
5    This program is free software; you can redistribute it and/or modify it
6    under the terms of the GNU General Public License as published by the
7    Free Software Foundation; either version 2, or (at your option) any
8    later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19    In other words, you are welcome to use, share and improve this program.
20    You are forbidden to forbid anyone else to use, share and improve
21    what you give them.   Help stamp out software-hoarding!
22 -------------------------------------------------------------------------*/
23
24 #ifndef  SIMI_H
25 #define  SIMI_H
26
27 #ifdef _WIN32
28 /* ugly hack to prevent the incusion of objidl.h */
29 #ifdef __MINGW32__
30 #define _OLE2_H
31 #elif defined _MSC_VER
32 #define _OLE2_H_
33 #endif
34 #include <winsock2.h>
35 #endif
36
37 #define MAX_SIM_BUFF 8*1024
38
39 #define MAX_CACHE_SIZE 4096
40 /* number of cache */
41 #define IMEM_CACHE     0
42 #define XMEM_CACHE     1
43 #define SREG_CACHE     2
44 #define CMEM_CACHE     3
45 #define NMEM_CACHE     4
46 /* special index */
47 #define  BIT_CACHE     5
48
49 typedef struct _memcache
50 {
51     int addr;
52     int size;
53     char buffer[MAX_CACHE_SIZE];
54 } memcache_t;
55
56 //#define SIMNAME "s51"
57 #ifdef _WIN32
58 extern SOCKET sock;
59 #else
60 extern int sock;
61 #endif
62 extern char simactive;
63 void  openSimulator (char **,int);
64 void waitForSim(int timeout_ms, char *expect);
65 void  closeSimulator ();
66 void  sendSim(char *);
67 char *simResponse();
68 void  simSetPC (unsigned int);
69 unsigned int simGetPC (void);
70 void  simSetBP (unsigned int);
71 void  simClearBP (unsigned int);
72 void  simLoadFile(char *);
73 void  simReset ();
74 char  *simRegs() ;
75 unsigned int simGoTillBp (unsigned int);
76 unsigned long simGetValue (unsigned int ,char , int );
77 int simSetValue (unsigned int ,char , int, unsigned long );
78 #endif