LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
bytecodeassembler.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include "lmstypes.h"
3 #include "bytecodes.h"
4 
5 #include "prg.c"
6 
7 int main(void)
8 {
9  FILE *pFile;
10  ULONG FileSize;
11  ULONG *pFileSize;
12  char PrgNameBuf[255];
13  char PrgNamePath[255];
14  getcwd(PrgNamePath,250);
15 
16  snprintf(PrgNameBuf,255,"prg.rbf");
17  pFile = fopen (PrgNameBuf,"wb");
18  if (pFile != NULL)
19  {
20  FileSize = sizeof(prg);
21 #ifndef OLD_HEADER
22  pFileSize = (ULONG*)&prg[4];
23  *pFileSize = FileSize;
24 #endif
25  fwrite (prg,1,FileSize,pFile);
26  fclose (pFile);
27  printf("%d bytes\r\n",FileSize);
28  }
29  else
30  {
31  printf("\r\nImage file not created !!!!!\r\n");
32  }
33 
34  return (0);
35 }
#define snprintf
Definition: c_input.c:141
UBYTE prg[]
Definition: p0.c:1
unsigned int ULONG
Basic Type used to symbolise 32 bit unsigned values.
Definition: lmstypes.h:31
int main(void)
#define NULL