from Dr Ian Logan, 4th September1984 -------------------------------------------------------------- SINCLAIR LOGO Notes on interfacing to ROBOT BIN files . The command STARTROBOT looks in memory for a suitable file, if this is not found then an attempt is made to load a machine code file from the current default device. The file has to be called ROBOT BIN (ten characters) and must have as its first two bytes the load address of the code, no notice is taken of the load address supplied by the normal Sinclair file header. These first bytes may be corrupted once the code has loaded so before making a copy from within Logo they must be replaced. The bytes occur in the order Low byte, High byte. In the case of a ROBOT BIN file which wishes to make use of the automatic parameter passing facilities built into Logo the file must reside at 64623 (decimal), and so the first two bytes are 64621 111 and 64622 252. The first block of the code must then consist of a jump table to deal with all turtle related commands. If these parameter passing facilities are not required the STOPTURTLE command must be used immediately after loading and the code can be placed elsewhere in memory. STARTROBOT automatically moves the pointers to the top of available workspace, using PRINT .RESERVED before and after loading ROBOT BIN will show this . STARTROBOT must be used before any procedures are written othewise the Logo error message LOGO not fresh !!! will be produced. In version 1.6 of Logo (the current release version ) any attempt to break out of searching for a ROBOT BIN file from cassette (default drive O) will result, unfortunately in a total system restart, which can be annoying. This feature does not occur when using Microdrive. This is the jump table required JP INIT :0 - INIT ARG --)HL JP FD :1 - FD HL (--ARG JP BK :2 - BK HL (--ARG JP RT :3 - RT HL (--ARG JP LT :4 - LT HL (--ARG JP PU :5 - PU NO ARG JP PD :6 - PD NO ARG JP RETURN :7 - PX NO ARG JP RETURN :8 - PE NO ARG JP RETURN :9 - SETH HL (--ARG JP RETURN :10- SETSCRUNCH HL (--ARG1 DE (--ARG2 JP RETURN :11- SETPC HL (--ARG JP RETURN :12- SETPOS HL (--ARG1 DE (--ARG2 JP RETURN :13- CLEAN NO ARG JP RETURN :14- HEADING ARG --)HL JP RETURN :15- POS ARG1 --)HL ARG2 --)DE JP RETURN :16- PC ARG --)HL JP RETURN :17- SETBG HL (--ARG JP RETURN :18- BG ARG --)HL JP BEEP :19- BEEP HL (--ARG1 DE (--ARG2 A RETURN in column two indicates that this command is not implemented in the turtle driver code, any command could be used or not as desired. It is desirable that keyboard reads are included at suitable points to allow an abort of the code if for any reason the turtle hangs up and cannot complete a movement. -------------------------------------------------------------- Supplementary notes ------------------- "ROBOT BIN" file relocated by LOGO to end at 65000-1 at start of file are 20 C3 (195 dec) separated by two bytes apiece this is the jump table. The raw file must have at the start before the first C3 the low and high bytes of the address of the first C3 so LOGO knows where to put it, these are discarded on loading.