- As you may have read I'm reviewing the TRAVEL PACK (here)
- I've used Jaap's REVTRAN to reverse translate the OB3's back to OPL's.
- In the process I found a routine that calls ROM functions from the Top Level Menu. I want to say system services but I'm not sure that is correct.
This example below TIMERTN: works though the top level menu looking for the 'time' utility then calls it and once the user has updated the time it returns successfully to the calling OPL routine.
The routine in question
Can anyone shed light on what exactly is going on!
NOTE I've added the code next to the REM's to help me 'watch' the variables,
Code: Select all
timertn:
REM CM/XP procedure
REM Old globals: OFFSET%
LOCAL L1%,L2%,L3%,L4$(4),L5%(2)
:REM lines added to aid testing
LOCAL OFFSET% :REM Include this global variable
OFFSET%=0 :REM Try 0 and 1 to see difference
L2%=PEEKW(8194)
CURSOR OFF
IF OFFSET%=1
L5%(1)=16292 :REM what's at addresses
L5%(2)=14592 :REM 16292 and 14592
USR(ADDR(L5%()),1)
RETURN
ENDIF
DO
L1%=PEEKB(L2%)
IF L1%=0
RETURN 1
ENDIF
IF L1%=4
L4$=""
L3%=1
DO
L4$=L4$+CHR$(PEEKB(L2%+L3%))
L3%=L3%+1
PRINT L4$,PEEKB(L2%+L3%) :REM Added to
GET :REM Watch variable
UNTIL L3%=5
IF L4$="TIME" OR L4$="DATE" OR L4$="ZEIT"
USR(PEEKW(L2%+L1%+1),0)
RETURN
ENDIF
ENDIF
L2%=L2%+L1%+3
UNTIL 0
Code: Select all
LZ Main Menu
Hlog Find Save
Diary Calc Time
Notes World Alarm
[Prog][Run]TIMERTN
H 76
HL 79
HLO 71
HLOG 0
F 73
FI 78
FIN 68
FIND 201
S 65
SA 86
SAV 69
SAVE 201
C 65
CA 76
CAL 67
CALC 201
T 73
TI 77
TIM 69
TIME 201
If I reinstate the [Time] finction in position 1 it runs and jumps straight into the [Time] function.
It is definitely scanning the top level menu and looking for "TIME" (English) "DATE" (French) OR "ZEIT" (German)
Any help will be appreciated..
Sincerely Martin