Add the same speed limitations to the IPL that already applied to the CPU in the emulator, make it possible to use ORG in non-initial positions, and add information on flow control to the readme

This commit is contained in:
CrazyEttin 2022-09-15 20:54:29 +03:00
parent c78d7c69ef
commit 9d318c4c75
3 changed files with 26 additions and 10 deletions

View File

@ -258,8 +258,20 @@ begin
else LblError;
end
else begin
writeln ('Error (line ', LP, '): ORG must be the first instruction');
halt (1);
if Elem [0] = '' then begin
//Set the starting point
if ExtractWord (3, Line, [' ']) <> '' then ArgError;
DatOrg := ExtractWord (2, Line, [' ']);
try
if Hex2Dec (DatOrg) <=$ffff then begin
BP := Hex2Dec (DatOrg);
end
else ArgError;
except
ArgError;
end;
end
else LblError;
end;
end

View File

@ -319,6 +319,7 @@ begin
repeat
read (Prog, Mem [IP]);
IP := IP + 1;
IC := IC + 1;
until (eof (Prog));
//Reinitialise the instruction pointer

View File

@ -23,9 +23,12 @@ Registers and Memory
* 8-bit memory locations 0-FFFF
Multi-byte values are big-endian. Memory locations 0-FFEF are used for
RAM while FFF0-FFFF are reserved for memory mapped devices. Input and
output are mapped to address FFFF, while arbitrary devices can be mapped
to the other reserved addresses.
RAM while FFF0-FFFF are reserved for memory mapped devices.
Input and output are mapped to address FFFF, while arbitrary devices can
be mapped to the other reserved addresses. When interacting with memory
mapped devices Thingamajig will stop processing to wait for the device
to be ready if needed.
Instructions
------------
@ -74,11 +77,11 @@ relative to a label. Relative references are of the form LABEL +/- N;
the spacing is optional.
In addition to the true instructions there are three
pseudo-instructions. ORG defines the starting address of the program: it
can only occur as the first instruction and cannot have a label, and is
not required if the starting address is 0. DATA introduces a byte of
data. ADDR introduces two bytes of data containing the address of a
reference to or relative to a label.
pseudo-instructions. ORG sets the location of the following code and
data; as it has no direct equivalent in machine code it cannot have a
label. The default starting address of 0 does not need to be indicated
with ORG. DATA introduces a byte of data. ADDR introduces two bytes of
data containing the address of a reference to or relative to a label.
Boot
----