/* * This file is part of Emu48, an emulator of the HP-48 Calculator. * Copyright (C) 1995 Sebastien Carlier * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #define word8 unsigned char #define word16 unsigned short #define word32 unsigned long char in[32]; word8 out[8]; FILE *IN, *OUT; void Ncode(word8 *a, word8 s) { while (s--) { if (a[s] < '0') { a[s] = 0; continue; } if (a[s] <='9') { a[s]-= '0'; continue; } if (a[s] < 'A') { a[s] = 0; continue; } if (a[s] <='F') { a[s]-= ('A'-10); continue; } a[s] = 0; } return; } word32 Nrpack(word8 *a, word8 s) { word32 r = 0; int i; for (i=0; i