::: Area #157 (comp.sys.acorn.programmer) Message: #28252 (Read 10 times, has 0 replies, 1364 bytes) Date : Sat Jan 31 11:23:53 1998 From : Jonathan Graham Harston of fidonet#2:254/27 To : All Subject: Subject: SYS calls/CALLs MG> as CALL &FFF1, is very machine architecture specific - it requires the MG> OSWORD routine to be at &FFF1, which is impossible on an ARM All versions of BBC BASIC have in their CALL/USR routine a bit of code that does the following: IF (address AND &FFFFFF00)<>&FF00 OR CALL has parameters THEN Set registers from A%,B%,C%,D%,E%.... CALL the address Return result from primary register ELSE Set registers from A%, X%, Y%, C% Perform the required MOS interface call Return the result from Cy:X:Y:A ENDIF ...where of course in 6502 BBC BASIC the ELSE clause is identical to the THEN clause, and so factorises out. Quoting the manual (from memory)... Addresses &0FFxx are used to access Operating System calls. However, these addresses are entirely possible as true assembly language entry points and must therefore be avoided when using the assembler. This problem may be circumvented by using CALL with at least one parameter (in addition to the address) which will enter an assembly language routine even if its address is in the range &FF00 to &FFFF. J.G.Harston (BBC PD Library) jgh@arcade.demon.co.uk 70 Camm Street, Walkley, Sheffield, S6 3TR --- ARCbbs RISC OS [1.64á32c] * Origin: Via The Arcade BBS Usenet News Gateway +44 181 655 4412 (2:254/27)