|
|
DataMuseum.dkPresents historical artifacts from the history of: Bogika Butler |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Bogika Butler Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 7040 (0x1b80)
Types: TextFile
Names: »GETCMD.PAS«
└─⟦5e7f516ab⟧ Bits:30009789/_.ft.Ibm2.50007345.imd Mogens Pelles Zilog 80,000 / EOS projekt
└─⟦this⟧ »GETCMD.PAS«
└─⟦66c279d1a⟧ Bits:30009789/_.ft.Ibm2.50007355.imd Mogens Pelles Zilog 80,000 / EOS projekt
└─⟦this⟧ »GETCMD.PAS«
(*****************************************************************************)
(* *)
(* GET_COMMAND *)
(* *)
(*****************************************************************************)
PROCEDURE get_command(VAR status: status_type;
VAR in_file,
out_file: text
);
PROCEDURE options;
BEGIN (* options *)
END; (* options *)
PROCEDURE prompt_file_name(VAR status: status_type;
VAR in_file,
out_file: text;
VAR file_name: file_name_type
);
BEGIN
write(out_file, 'FILE >');
readln(in_file, file_name);
IF ioresult = IO_succes THEN
IF length(file_name) = 0 THEN
status := nomore
ELSE
status := succes
ELSE
status := failure;
END; (* prompt_file_name *)
PROCEDURE per_object_module(VAR status: status_type;
VAR file_exhausted: boolean;
VAR object_module_index: object_module_index_type;
VAR object_file: object_file_type;
module_object_file_index: object_file_index_type;
VAR start_position: long_integer
);
VAR
format: byte;
lr_status,
all_status: status_type;
i: section_kind_type;
dummy_address,
size_read: long_integer;
overflow: boolean;
BEGIN (* per_object_module *)
read_obj_8(status,object_file,format);
IF (status = succes) and (format = object_format_version) THEN
BEGIN
add_32(overflow,
start_position,
obj_pos_hdr_size,
dummy_address
);
seek_obj(status,
object_file,
dummy_address
);
IF status = succes THEN
BEGIN
lr_status := succes;
FOR i := loader_sect TO bss_sect DO
WITH module_table(.object_module_index.).section(.i.) DO
IF lr_status = succes THEN
BEGIN
read_obj_32(lr_status,object_file,size_read);
IF lr_status = succes THEN
BEGIN
relocation_constant := target_module.section(.i.).size;
add_32(overflow,
target_module.section(.i.).size,
size_read,
target_module.section(.i.).size
);
segment_number := segment_by_section(i)
END;
END;
IF lr_status = succes THEN
BEGIN
(* read_obj_32(lr_status,object_file,); *)
END
END
(* 1: read header section
2: insert into module_table if ok
3: check for multiple modules in file and update
start_position *)
END
ELSE
BEGIN
error_message(out_file,2);
status := failure
END
END; (* per_object_module *)
VAR
module_start_position: long_integer;
module_object_file_index: object_file_index_type;
object_file: object_file_type;
dummy_address: long_integer;
file_name: file_name_type;
overflow: boolean;
BEGIN (* get_command *)
REPEAT
allocate_object_file_entry(status,module_object_file_index,object_file);
IF status = succes THEN
BEGIN
prompt_file_name(status,in_file,out_file,file_name);
IF status = succes THEN
BEGIN
assign(object_file.external_file, file_name);
lib_ioresult(status);
IF status = succes THEN
BEGIN
reset_obj(status,object_file);
IF status = succes THEN
BEGIN
module_start_position := long_null;
REPEAT
add_32(overflow,
(obj_siz_hdr),
module_start_position
dummy_address
);
IF within_obj(object_file,dummy_address) THEN
BEGIN
allocate_object_module_entry(status
,object_module_index);
IF status = succes THEN
BEGIN
WITH module_table(.object_module_index.) DO
BEGIN
start_position := module_start_position;
object_file_index := module_object_file_index;
END;
per_object_module(module_status
,file_exhausted
,object_module_index
,object_file_table(.module_object_file_index.)
,object_file_count
,module_start_position
);
(* read object file header section. Initialize a module_table
entry according to header contents and check for multiple
modules repeating module initialization for each end every *)
END
ELSE
END
ELSE
END
UNTIL file_exhausted or not (module_status in (.succes, nomore.));
IF module_status in (.succes,nomore.) THEN
status := succes
ELSE
status := failure
END
END
END
END
ELSE
error_message(out_file,1)
UNTIL status <> succes;
END; (* get_command *)
«eof»