Report #NP if segment (O16 A16 CALL FAR) is not present
[jpcrr.git] / streamtools / streamcopy.c
blobe84a16810c1ddad2dbdf5f05082a40176423ecfc
1 /*
2 JPC-RR: A x86 PC Hardware Emulator
3 Release 1
5 Copyright (C) 2009 H. Ilari Liusvaara
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 2 as published by
9 the Free Software Foundation.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 Based on JPC x86 PC Hardware emulator,
21 A project from the Physics Dept, The University of Oxford
23 Details about original JPC can be found at:
25 www-jpc.physics.ox.ac.uk
30 #include "frame.h"
31 #include "stdio.h"
33 int main(int argc, char** argv)
35 if(argc < 3) {
36 fprintf(stderr, "usage: %s <in> <out>\n", argv[0]);
37 fprintf(stderr, "Read stream from <in> and dump the frames unmodified to <out>.\n");
38 return 1;
40 struct frame_input_stream* in = fis_open(argv[1]);
41 struct frame_output_stream* out = fos_open(argv[2]);
42 struct frame* frame;
43 int num = 1;
45 while(1) {
46 frame = fis_next_frame(in);
47 if(!frame)
48 break;
49 fos_save_frame(out, frame);
50 frame_release(frame);
53 fis_close(in);
54 fos_close(out);