Home » CEEFAX disks » telesoftware7.adl » 10-06-88/QD/C

10-06-88/QD/C

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » CEEFAX disks » telesoftware7.adl
Filename: 10-06-88/QD/C
Read OK:
File size: 0591 bytes
Load address: 0000
Exec address: FFFFFFFF
File contents
/******************************************
*                                         *
*        Quick Dump by Robin Nixon        *
*                                         *
*       (c) Personal Computing with       *
*               the Amstrad               *
*                                         *
******************************************/

#include "rlib.h"

long atol();

main(argc,argv)
int argc;
char *argv[];
{
  FILE *fp;
  int buf[16];
  int counter=0, j;
  long filepos=0;
  long temp;

  if (argc < 2)
  {
    print("Filename required");
    exit(0);
  }
  if (argc > 2)
    filepos=atol(argv[2]);
  fp=fopen(argv[1],"rb");
  if (fp == NULL)
  {
    print("File not found");
    exit(0);
  }
  fseek(fp,filepos,0);
  while (!feof(fp))
  {
    buf[counter++]=fgetc(fp);
    if (counter == 16 || feof(fp))
    {
      printf(" %08lX   ",filepos);
      for (j=0 ; j<16 ; ++j)
      {
        if (j < counter)
          temp=(long) buf[j];
        else
          temp=0;
        if (temp < 0)
          temp=0x0FF;
        printf("%02X ",temp);
        if (j == 7)
          putch(' ');
      }
      print("  ");
      for (j=0 ; j<16 ; ++j)
      {
        if (buf[j] >= ' ' && j < counter)
          putch(buf[j]);
        else
          putch('.');
      }
      crlf();
      filepos+=16;
      counter=0;
    }
  }
  fclose(fp);
}
00000000  2f 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |/***************|
00000010  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000020  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 0d 0a 2a 20 20  |***********..*  |
00000030  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000050  20 20 20 20 20 20 20 2a  0d 0a 2a 20 20 20 20 20  |       *..*     |
00000060  20 20 20 51 75 69 63 6b  20 44 75 6d 70 20 62 79  |   Quick Dump by|
00000070  20 52 6f 62 69 6e 20 4e  69 78 6f 6e 20 20 20 20  | Robin Nixon    |
00000080  20 20 20 20 2a 0d 0a 2a  20 20 20 20 20 20 20 20  |    *..*        |
00000090  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000000b0  20 2a 0d 0a 2a 20 20 20  20 20 20 20 28 63 29 20  | *..*       (c) |
000000c0  50 65 72 73 6f 6e 61 6c  20 43 6f 6d 70 75 74 69  |Personal Computi|
000000d0  6e 67 20 77 69 74 68 20  20 20 20 20 20 20 2a 0d  |ng with       *.|
000000e0  0a 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.*              |
000000f0  20 74 68 65 20 41 6d 73  74 72 61 64 20 20 20 20  | the Amstrad    |
00000100  20 20 20 20 20 20 20 20  20 20 20 2a 0d 0a 2a 20  |           *..* |
00000110  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000130  20 20 20 20 20 20 20 20  2a 0d 0a 2a 2a 2a 2a 2a  |        *..*****|
00000140  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000160  2a 2a 2a 2a 2a 2f 0d 0a  0d 0a 23 69 6e 63 6c 75  |*****/....#inclu|
00000170  64 65 20 22 72 6c 69 62  2e 68 22 0d 0a 0d 0a 6c  |de "rlib.h"....l|
00000180  6f 6e 67 20 61 74 6f 6c  28 29 3b 0d 0a 0d 0a 6d  |ong atol();....m|
00000190  61 69 6e 28 61 72 67 63  2c 61 72 67 76 29 0d 0a  |ain(argc,argv)..|
000001a0  69 6e 74 20 61 72 67 63  3b 0d 0a 63 68 61 72 20  |int argc;..char |
000001b0  2a 61 72 67 76 5b 5d 3b  0d 0a 7b 0d 0a 20 20 46  |*argv[];..{..  F|
000001c0  49 4c 45 20 2a 66 70 3b  0d 0a 20 20 69 6e 74 20  |ILE *fp;..  int |
000001d0  62 75 66 5b 31 36 5d 3b  0d 0a 20 20 69 6e 74 20  |buf[16];..  int |
000001e0  63 6f 75 6e 74 65 72 3d  30 2c 20 6a 3b 0d 0a 20  |counter=0, j;.. |
000001f0  20 6c 6f 6e 67 20 66 69  6c 65 70 6f 73 3d 30 3b  | long filepos=0;|
00000200  0d 0a 20 20 6c 6f 6e 67  20 74 65 6d 70 3b 0d 0a  |..  long temp;..|
00000210  0d 0a 20 20 69 66 20 28  61 72 67 63 20 3c 20 32  |..  if (argc < 2|
00000220  29 0d 0a 20 20 7b 0d 0a  20 20 20 20 70 72 69 6e  |)..  {..    prin|
00000230  74 28 22 46 69 6c 65 6e  61 6d 65 20 72 65 71 75  |t("Filename requ|
00000240  69 72 65 64 22 29 3b 0d  0a 20 20 20 20 65 78 69  |ired");..    exi|
00000250  74 28 30 29 3b 0d 0a 20  20 7d 0d 0a 20 20 69 66  |t(0);..  }..  if|
00000260  20 28 61 72 67 63 20 3e  20 32 29 0d 0a 20 20 20  | (argc > 2)..   |
00000270  20 66 69 6c 65 70 6f 73  3d 61 74 6f 6c 28 61 72  | filepos=atol(ar|
00000280  67 76 5b 32 5d 29 3b 0d  0a 20 20 66 70 3d 66 6f  |gv[2]);..  fp=fo|
00000290  70 65 6e 28 61 72 67 76  5b 31 5d 2c 22 72 62 22  |pen(argv[1],"rb"|
000002a0  29 3b 0d 0a 20 20 69 66  20 28 66 70 20 3d 3d 20  |);..  if (fp == |
000002b0  4e 55 4c 4c 29 0d 0a 20  20 7b 0d 0a 20 20 20 20  |NULL)..  {..    |
000002c0  70 72 69 6e 74 28 22 46  69 6c 65 20 6e 6f 74 20  |print("File not |
000002d0  66 6f 75 6e 64 22 29 3b  0d 0a 20 20 20 20 65 78  |found");..    ex|
000002e0  69 74 28 30 29 3b 0d 0a  20 20 7d 0d 0a 20 20 66  |it(0);..  }..  f|
000002f0  73 65 65 6b 28 66 70 2c  66 69 6c 65 70 6f 73 2c  |seek(fp,filepos,|
00000300  30 29 3b 0d 0a 20 20 77  68 69 6c 65 20 28 21 66  |0);..  while (!f|
00000310  65 6f 66 28 66 70 29 29  0d 0a 20 20 7b 0d 0a 20  |eof(fp))..  {.. |
00000320  20 20 20 62 75 66 5b 63  6f 75 6e 74 65 72 2b 2b  |   buf[counter++|
00000330  5d 3d 66 67 65 74 63 28  66 70 29 3b 0d 0a 20 20  |]=fgetc(fp);..  |
00000340  20 20 69 66 20 28 63 6f  75 6e 74 65 72 20 3d 3d  |  if (counter ==|
00000350  20 31 36 20 7c 7c 20 66  65 6f 66 28 66 70 29 29  | 16 || feof(fp))|
00000360  0d 0a 20 20 20 20 7b 0d  0a 20 20 20 20 20 20 70  |..    {..      p|
00000370  72 69 6e 74 66 28 22 20  25 30 38 6c 58 20 20 20  |rintf(" %08lX   |
00000380  22 2c 66 69 6c 65 70 6f  73 29 3b 0d 0a 20 20 20  |",filepos);..   |
00000390  20 20 20 66 6f 72 20 28  6a 3d 30 20 3b 20 6a 3c  |   for (j=0 ; j<|
000003a0  31 36 20 3b 20 2b 2b 6a  29 0d 0a 20 20 20 20 20  |16 ; ++j)..     |
000003b0  20 7b 0d 0a 20 20 20 20  20 20 20 20 69 66 20 28  | {..        if (|
000003c0  6a 20 3c 20 63 6f 75 6e  74 65 72 29 0d 0a 20 20  |j < counter)..  |
000003d0  20 20 20 20 20 20 20 20  74 65 6d 70 3d 28 6c 6f  |        temp=(lo|
000003e0  6e 67 29 20 62 75 66 5b  6a 5d 3b 0d 0a 20 20 20  |ng) buf[j];..   |
000003f0  20 20 20 20 20 65 6c 73  65 0d 0a 20 20 20 20 20  |     else..     |
00000400  20 20 20 20 20 74 65 6d  70 3d 30 3b 0d 0a 20 20  |     temp=0;..  |
00000410  20 20 20 20 20 20 69 66  20 28 74 65 6d 70 20 3c  |      if (temp <|
00000420  20 30 29 0d 0a 20 20 20  20 20 20 20 20 20 20 74  | 0)..          t|
00000430  65 6d 70 3d 30 78 30 46  46 3b 0d 0a 20 20 20 20  |emp=0x0FF;..    |
00000440  20 20 20 20 70 72 69 6e  74 66 28 22 25 30 32 58  |    printf("%02X|
00000450  20 22 2c 74 65 6d 70 29  3b 0d 0a 20 20 20 20 20  | ",temp);..     |
00000460  20 20 20 69 66 20 28 6a  20 3d 3d 20 37 29 0d 0a  |   if (j == 7)..|
00000470  20 20 20 20 20 20 20 20  20 20 70 75 74 63 68 28  |          putch(|
00000480  27 20 27 29 3b 0d 0a 20  20 20 20 20 20 7d 0d 0a  |' ');..      }..|
00000490  20 20 20 20 20 20 70 72  69 6e 74 28 22 20 20 22  |      print("  "|
000004a0  29 3b 0d 0a 20 20 20 20  20 20 66 6f 72 20 28 6a  |);..      for (j|
000004b0  3d 30 20 3b 20 6a 3c 31  36 20 3b 20 2b 2b 6a 29  |=0 ; j<16 ; ++j)|
000004c0  0d 0a 20 20 20 20 20 20  7b 0d 0a 20 20 20 20 20  |..      {..     |
000004d0  20 20 20 69 66 20 28 62  75 66 5b 6a 5d 20 3e 3d  |   if (buf[j] >=|
000004e0  20 27 20 27 20 26 26 20  6a 20 3c 20 63 6f 75 6e  | ' ' && j < coun|
000004f0  74 65 72 29 0d 0a 20 20  20 20 20 20 20 20 20 20  |ter)..          |
00000500  70 75 74 63 68 28 62 75  66 5b 6a 5d 29 3b 0d 0a  |putch(buf[j]);..|
00000510  20 20 20 20 20 20 20 20  65 6c 73 65 0d 0a 20 20  |        else..  |
00000520  20 20 20 20 20 20 20 20  70 75 74 63 68 28 27 2e  |        putch('.|
00000530  27 29 3b 0d 0a 20 20 20  20 20 20 7d 0d 0a 20 20  |');..      }..  |
00000540  20 20 20 20 63 72 6c 66  28 29 3b 0d 0a 20 20 20  |    crlf();..   |
00000550  20 20 20 66 69 6c 65 70  6f 73 2b 3d 31 36 3b 0d  |   filepos+=16;.|
00000560  0a 20 20 20 20 20 20 63  6f 75 6e 74 65 72 3d 30  |.      counter=0|
00000570  3b 0d 0a 20 20 20 20 7d  0d 0a 20 20 7d 0d 0a 20  |;..    }..  }.. |
00000580  20 66 63 6c 6f 73 65 28  66 70 29 3b 0d 0a 7d 0d  | fclose(fp);..}.|
00000590  0a                                                |.|
00000591
10-06-88/QD/C.m0
10-06-88/QD/C.m1
10-06-88/QD/C.m2
10-06-88/QD/C.m4
10-06-88/QD/C.m5