mirror of
https://github.com/simh/simh.git
synced 2026-01-11 23:52:58 +00:00
CARD: Clean up comments on sim_card.[ch] on format of card decks.
This commit is contained in:
parent
3cbe0d696d
commit
e9908577fe
26
sim_card.c
26
sim_card.c
@ -22,7 +22,7 @@
|
|||||||
This is the standard card reader.
|
This is the standard card reader.
|
||||||
This is the standard card punch.
|
This is the standard card punch.
|
||||||
|
|
||||||
Input formats are accepted in a variaty of formats:
|
Input formats are accepted in a variety of formats:
|
||||||
Standard ASCII: one record per line.
|
Standard ASCII: one record per line.
|
||||||
returns are ignored.
|
returns are ignored.
|
||||||
tabs are expanded to modules 8 characters.
|
tabs are expanded to modules 8 characters.
|
||||||
@ -46,7 +46,7 @@
|
|||||||
Bits 5-0 are character.
|
Bits 5-0 are character.
|
||||||
|
|
||||||
CBN Format:
|
CBN Format:
|
||||||
Each record 160 charaters.
|
Each record 160 characters.
|
||||||
First char has bit 7 set. Rest set to 0.
|
First char has bit 7 set. Rest set to 0.
|
||||||
Bit 6 is odd parity.
|
Bit 6 is odd parity.
|
||||||
Bit 5-0 of first character are top 6 bits
|
Bit 5-0 of first character are top 6 bits
|
||||||
@ -62,7 +62,7 @@
|
|||||||
is not enough octal numbers to span a full card the remainder of the
|
is not enough octal numbers to span a full card the remainder of the
|
||||||
card will not be punched.
|
card will not be punched.
|
||||||
|
|
||||||
Also ~eor, will generate a 7/8/9 punch card. An ~eof will gernerate a
|
Also ~eor, will generate a 7/8/9 punch card. An ~eof will generate a
|
||||||
6/7/9 punch card, and a ~eoi will generate a 6/7/8/9 punch.
|
6/7/9 punch card, and a ~eoi will generate a 6/7/8/9 punch.
|
||||||
|
|
||||||
A single line of ~ will set the EOF flag when that card is read.
|
A single line of ~ will set the EOF flag when that card is read.
|
||||||
@ -251,7 +251,10 @@ static const uint16 ascii_to_dec_029[128] = {
|
|||||||
0x604, 0x602, 0x601, 0xA00, 0xC00, 0x600, 0x700,0xf000
|
0x604, 0x602, 0x601, 0xA00, 0xC00, 0x600, 0x700,0xf000
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if SIMH_EVER_USES_THIS
|
||||||
|
/* This is a static const that isn't referenced in this code.
|
||||||
|
* Kept for historical reference.
|
||||||
|
*/
|
||||||
static const uint16 ascii_to_hol_ebcdic[128] = {
|
static const uint16 ascii_to_hol_ebcdic[128] = {
|
||||||
/* Control */
|
/* Control */
|
||||||
0xf000,0xf000,0xf000,0xf000,0xf000,0xf000,0xf000,0xf000, /*0-37*/
|
0xf000,0xf000,0xf000,0xf000,0xf000,0xf000,0xf000,0xf000, /*0-37*/
|
||||||
@ -295,6 +298,7 @@ static const uint16 ascii_to_hol_ebcdic[128] = {
|
|||||||
/* X18 X78 Y18 XYT18 */
|
/* X18 X78 Y18 XYT18 */
|
||||||
0x604, 0x602, 0x601, 0x902, 0x806, 0x502, 0xF02,0xf000
|
0x604, 0x602, 0x601, 0x902, 0x806, 0x502, 0xF02,0xf000
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
const char sim_ascii_to_six[128] = {
|
const char sim_ascii_to_six[128] = {
|
||||||
/* Control */
|
/* Control */
|
||||||
@ -431,7 +435,7 @@ static struct card_formats fmts[] = {
|
|||||||
|
|
||||||
/* Conversion routines */
|
/* Conversion routines */
|
||||||
|
|
||||||
/* Convert BCD character into hollerith code */
|
/* Convert BCD character into Hollerith code */
|
||||||
uint16
|
uint16
|
||||||
sim_bcd_to_hol(uint8 bcd) {
|
sim_bcd_to_hol(uint8 bcd) {
|
||||||
uint16 hol;
|
uint16 hol;
|
||||||
@ -476,7 +480,7 @@ sim_bcd_to_hol(uint8 bcd) {
|
|||||||
return hol;
|
return hol;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the BCD of the hollerith code or 0x7f if error */
|
/* Returns the BCD of the Hollerith code or 0x7f if error */
|
||||||
uint8
|
uint8
|
||||||
sim_hol_to_bcd(uint16 hol) {
|
sim_hol_to_bcd(uint16 hol) {
|
||||||
uint8 bcd;
|
uint8 bcd;
|
||||||
@ -526,7 +530,7 @@ sim_hol_to_bcd(uint16 hol) {
|
|||||||
return bcd;
|
return bcd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert EBCDIC character into hollerith code */
|
/* Convert EBCDIC character into Hollerith code */
|
||||||
uint16
|
uint16
|
||||||
sim_ebcdic_to_hol(uint8 ebcdic) {
|
sim_ebcdic_to_hol(uint8 ebcdic) {
|
||||||
return ebcdic_to_hol[ebcdic];
|
return ebcdic_to_hol[ebcdic];
|
||||||
@ -534,7 +538,7 @@ sim_ebcdic_to_hol(uint8 ebcdic) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Returns the BCD of the hollerith code or 0x7f if error */
|
/* Returns the BCD of the Hollerith code or 0x7f if error */
|
||||||
uint16
|
uint16
|
||||||
sim_hol_to_ebcdic(uint16 hol) {
|
sim_hol_to_ebcdic(uint16 hol) {
|
||||||
return hol_to_ebcdic[hol];
|
return hol_to_ebcdic[hol];
|
||||||
@ -984,7 +988,7 @@ _sim_read_deck(UNIT * uptr, int eof)
|
|||||||
|
|
||||||
buf.len = 0;
|
buf.len = 0;
|
||||||
buf.size = 0;
|
buf.size = 0;
|
||||||
buf.buffer[0] = 0; /* Initialize bufer to empty */
|
buf.buffer[0] = 0; /* Initialize buffer to empty */
|
||||||
|
|
||||||
/* Slurp up current file */
|
/* Slurp up current file */
|
||||||
do {
|
do {
|
||||||
@ -1011,7 +1015,7 @@ _sim_read_deck(UNIT * uptr, int eof)
|
|||||||
sim_uname(uptr), uptr->filename, sim_error_text(r), cards);
|
sim_uname(uptr), uptr->filename, sim_error_text(r), cards);
|
||||||
}
|
}
|
||||||
data->hopper_cards++;
|
data->hopper_cards++;
|
||||||
/* Move data to start at begining of buffer */
|
/* Move data to start at beginning of buffer */
|
||||||
/* Data is moved down to simplify the decoding of one card */
|
/* Data is moved down to simplify the decoding of one card */
|
||||||
l = buf.len - buf.size;
|
l = buf.len - buf.size;
|
||||||
j = buf.size;
|
j = buf.size;
|
||||||
@ -1056,7 +1060,7 @@ sim_punch_card(UNIT * uptr, uint16 image[80])
|
|||||||
/* Convert word record into column image */
|
/* Convert word record into column image */
|
||||||
/* Check output type, if auto or text, try and convert record to bcd first */
|
/* Check output type, if auto or text, try and convert record to bcd first */
|
||||||
/* If failed and text report error and dump what we have */
|
/* If failed and text report error and dump what we have */
|
||||||
/* Else if binary or not convertable, dump as image */
|
/* Else if binary or not convertible, dump as image */
|
||||||
|
|
||||||
/* Try to convert to text */
|
/* Try to convert to text */
|
||||||
uint8 out[512];
|
uint8 out[512];
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
This is the standard card reader.
|
This is the standard card reader.
|
||||||
This is the standard card punch.
|
This is the standard card punch.
|
||||||
|
|
||||||
Input formats are accepted in a variaty of formats:
|
Input formats are accepted in a variety of formats:
|
||||||
Standard ASCII: one record per line.
|
Standard ASCII: one record per line.
|
||||||
returns are ignored.
|
returns are ignored.
|
||||||
tabs are expanded to modules 8 characters.
|
tabs are expanded to modules 8 characters.
|
||||||
@ -47,7 +47,7 @@
|
|||||||
Bits 5-0 are character.
|
Bits 5-0 are character.
|
||||||
|
|
||||||
CBN Format:
|
CBN Format:
|
||||||
Each record 160 charaters.
|
Each record 160 characters.
|
||||||
First char has bit 7 set. Rest set to 0.
|
First char has bit 7 set. Rest set to 0.
|
||||||
Bit 6 is odd parity.
|
Bit 6 is odd parity.
|
||||||
Bit 5-0 of first character are top 6 bits
|
Bit 5-0 of first character are top 6 bits
|
||||||
@ -70,7 +70,7 @@
|
|||||||
is not enough octal numbers to span a full card the remainder of the
|
is not enough octal numbers to span a full card the remainder of the
|
||||||
card will not be punched.
|
card will not be punched.
|
||||||
|
|
||||||
Also ~eor, will generate a 7/8/9 punch card. An ~eof will gernerate a
|
Also ~eor, will generate a 7/8/9 punch card. An ~eof will generate a
|
||||||
6/7/9 punch card, and a ~eoi will generate a 6/7/8/9 punch.
|
6/7/9 punch card, and a ~eoi will generate a 6/7/8/9 punch.
|
||||||
|
|
||||||
A single line of ~ will set the EOF flag when that card is read.
|
A single line of ~ will set the EOF flag when that card is read.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user