j***@mdfs.net
2020-05-20 02:20:53 UTC
This has been tearing my hair out for days, and I have found
zero mention of the issues I was getting.
** When making an RT11 EMT call, there is restriction on where
the stack may be. **
My code calls SETTOP to grab memory, then naturally I put SP at
the top of memory. All EMT 375 calls bombed out with Odd Address
errors. Annoyingly, it worked on the Soviet UKNC running its RT11
clone.
I stripped my code down to the minimum example, and weirdly, it
worked. So I gradually added bits of the environment of the
full program until it died.
I make the EMT call by pushing the parameters on the stack and
them MOV SP,R0; EMT &o375. I tried everything I could think of,
not stacking the arguments, not stacking the filename, not
stacking either, the only time it worked was when I did:
EMT SETTOP
;MOV R0,SP ; comment out
I don't know what the explict restriction is, but by trial and
error I've concluded that if I want to make any RT11 EMT calls
the stack must be in the "initial stack area" at &o1000 downwards.
So I've replaced my EMT &o375 calls with a JSR to:
mov sp,510
mov #510,sp
emt &o375
mov 510,sp
rts pc
Are there any other gotchas that may trip me up?
jgh
zero mention of the issues I was getting.
** When making an RT11 EMT call, there is restriction on where
the stack may be. **
My code calls SETTOP to grab memory, then naturally I put SP at
the top of memory. All EMT 375 calls bombed out with Odd Address
errors. Annoyingly, it worked on the Soviet UKNC running its RT11
clone.
I stripped my code down to the minimum example, and weirdly, it
worked. So I gradually added bits of the environment of the
full program until it died.
I make the EMT call by pushing the parameters on the stack and
them MOV SP,R0; EMT &o375. I tried everything I could think of,
not stacking the arguments, not stacking the filename, not
stacking either, the only time it worked was when I did:
EMT SETTOP
;MOV R0,SP ; comment out
I don't know what the explict restriction is, but by trial and
error I've concluded that if I want to make any RT11 EMT calls
the stack must be in the "initial stack area" at &o1000 downwards.
So I've replaced my EMT &o375 calls with a JSR to:
mov sp,510
mov #510,sp
emt &o375
mov 510,sp
rts pc
Are there any other gotchas that may trip me up?
jgh