trainor@CS.UCLA.EDU (Douglas J Trainor) (07/16/87)
I must resort to capitalism. I will send a crisp $10.00 bill to the first person providing me with a little assembly routine that reads the system clock from BASIC. Plus an insane bonus offer of $10.00 if your mail arrives on July 16th, totaling a possible 20 dollars!!! I am having problems getting this to work, and I don't have the adequate documentation. This is for UCLA educational purposes. The Mac and IIgs (?) have a ROM routine called TickCount which returns the number of ticks (1/60 of secs) since the machine was booted (32 bits). Anything like this is just fine, but not required. It can probably be done in many different ways. All I want to do is to time portions of code. Assume there are a few memory locations where you are going to stick this time (say 777-780 in decimal) and your routine is at address ADDR. It would be called from BASIC by something like: CALL ADDR :REM SAVE TIME T1=PEEK(777)+2^8*PEEK(778)+2^16*PEEK(779) :REM CALC TIME GOSUB 999 :REM WASTE TIME CALL ADDR T2=PEEK(777)+2^8*PEEK(778)+2^16*PEEK(779) T=T2-T1 :REM TIME DELTA 32 bits aren't really needed, but 16 bits might be too small, but I could check if T<0 to compensate... I'm not particular. The sequence of bytes for the time can be increasing, decreasing, whatever. In fact, do it in any way you want such that I can get the value into a variable! When IIgs boots it says "ProDOS 16 v1.1 Loader v1.1", but when I start up my BASIC program it says "ProDOS 8 v1.3 ProDOS BASIC 1.1" Go for it, Douglas PS: You could even compile a C or Pascal program and look at the code...