Maybe it was used for debugging or single-stepping?
Wild guess: Interrupt vectors? If you press reset, the CPU jumps to
ORIG (or uses ORIG+2 asvector address. And for some other interrupt,
the same with ORIG+4/6.
Hello,
Examining old fig-Forth I noticed a strange thing at its very beginning. Its code starts with a sequence:
ORIG: NOP ; (ORIGIN)
JMP CLD
NOP
JMP WRM
So what does it mean, actually? Is it kind of "tradition" to leave that useless(?) jump there,
or I'm still missing something?
Hello,
Examining old fig-Forth I noticed a strange thing at its very beginning. It= >s code starts with a sequence:
ORIG: NOP ; (ORIGIN)
JMP CLD
NOP
JMP WRM
Hello,
Examining old fig-Forth I noticed a strange thing at its very beginning.
Its code starts with a sequence:
ORIG: NOP ; (ORIGIN)
JMP CLD
NOP
JMP WRM
So what does it mean, actually?
Examining old fig-Forth I noticed a strange thing at its very beginning. Its code starts with a sequence:ORG 100H
ORIG: NOP ; (ORIGIN)With the NOP these vectors are accessible at 4 byte boundaries in the 16b DR/PC/MS-DOS systems this is designed to run on. (search 'org 100h')
JMP CLD
NOP
JMP WRM
From 'Fig Forth Systems Guide.pdf':
"ABORT call ABORT, the warm start procedure" WRM?
[...] Using COLD will remove the user program.
From 'fig86new/FIG86NEW/FORTH1.TXT':
"COLD sets the <CTRL-C> interrupt vector (MS-DOS function 25h)
to the address of a code fragment which vectors the interpreter
to (ABORT)."
As happens here (from 'fig86new/FIG86NEW/FORTH.ASM'):
CTRLC:
WRM: MOV SI,OFFSET WRM1
JMP NEXT
WRM1 DW PABOR
And enters ABORT here:
DB 87H,"(ABORT",")"+80h
DW DFIND - 8
PABOR DW DOCOL
DW ABORT, SEMIS
So what does it mean, actually?If your code crashes, or locks up, then pressing ^C may return
you to your runnable system with user compiled code intact, or
at least get you back to DOS.
Wild guess: Interrupt vectors? If you press reset, the CPU jumps to
ORIG (or uses ORIG+2 asvector address. And for some other interrupt,
the same with ORIG+4/6.
Both the Forths where I found that sequence are "hosted Forths" for DOS (ordinary "com" binaries).
So rather not this case, it seems. That ORIG means just ORIGIN for address space of fig-Forth system.
I understand that much more experienced Forthers are (almost) as confused as I am?
FIG was designed to be portable across CPUs and host systems. Patch locations
for jumps and debugging are to be expected. IIRC +ORIGIN was used as a reference
to other fields in a Fig system. While a DOS-hosted system may have had little
need of JMP WRM there was no harm leaving it in - nor gain removing it.
FIG was designed to be portable across CPUs and host systems. Patch locations
for jumps and debugging are to be expected. IIRC +ORIGIN was used as a reference
to other fields in a Fig system. While a DOS-hosted system may have had little
need of JMP WRM there was no harm leaving it in - nor gain removing it.
Thanks, so it seems my initial „wild guess” that it's kind of „tradition” to keep that there (never mind is it later used at all) was proper. :)
On 9/05/2022 17:39, Zbig wrote:
FIG was designed to be portable across CPUs and host systems. Patch locations
for jumps and debugging are to be expected. IIRC +ORIGIN was used as a reference
to other fields in a Fig system. While a DOS-hosted system may have had little
need of JMP WRM there was no harm leaving it in - nor gain removing it.
Thanks, so it seems my initial „wild guess” that it's kind of „tradition” to keep that there (never mind is it later used at all) was proper. :)
A potential use is systems which had a monitor ROM.
MON
Exit to the system monitor, leaving a re-entry to Forth,
if possible.
Forth could be re-entered using either COLD or WARM vectors. WARM entry would
ensure user-additions didn't get wiped.
On Sun, 8 May 2022 10:09:48 -0700 (PDT)
Zbig <zbigniew2011@gmail.com> wrote:
Hello,
Examining old fig-Forth I noticed a strange thing at its very beginning.
Its code starts with a sequence:
ORG 100H
ORIG: NOP ; (ORIGIN)
JMP CLD
NOP
JMP WRM
With the NOP these vectors are accessible at 4 byte boundaries in the 16b >DR/PC/MS-DOS systems this is designed to run on. (search 'org 100h')
From 'Fig Forth Systems Guide.pdf':
"ABORT call ABORT, the warm start procedure" WRM?
[...] Using COLD will remove the user program.
From 'fig86new/FIG86NEW/FORTH1.TXT':
"COLD sets the <CTRL-C> interrupt vector (MS-DOS function 25h)
to the address of a code fragment which vectors the interpreter
to (ABORT)."
As happens here (from 'fig86new/FIG86NEW/FORTH.ASM'):
CTRLC:
WRM: MOV SI,OFFSET WRM1
JMP NEXT
WRM1 DW PABOR
And enters ABORT here:
DB 87H,"(ABORT",")"+80h
DW DFIND - 8
PABOR DW DOCOL
DW ABORT, SEMIS
So what does it mean, actually?
If your code crashes, or locks up, then pressing ^C may return
you to your runnable system with user compiled code intact, or
at least get you back to DOS.
Jan Coombs
--
Probably if you were debugging fig-forth on a PC board without the
BIOS installed you would want exactly the same setup?
So it seems it's really kind of "leftover". But I posted this question because I could see similar sequence in the other listing. So what does it mean, actually? Is it kind of "tradition" to leave that useless(?) jump there, or I'm still missingsomething?
On Sunday, May 8, 2022 at 12:09:49 PM UTC-5, Zbig wrote:something?
So it seems it's really kind of "leftover". But I posted this question because I could see similar sequence in the other listing. So what does it mean, actually? Is it kind of "tradition" to leave that useless(?) jump there, or I'm still missing
Not much help here I forget the details but I'm almost sure I used both
cold and warm with DOS. I know I used warm with the Atari OS with its
system error vector pointed to warm start which printed message and
aborted.
...
On Sunday, May 8, 2022 at 12:09:49 PM UTC-5, Zbig wrote:question because I could see similar sequence in the other listing. So
So it seems it's really kind of "leftover". But I posted this
what does it mean, actually? Is it kind of "tradition" to leave that >useless(?) jump there, or I'm still missing something?
Not much help here I forget the details but I'm almost sure I used both
cold and warm with DOS. I know I used warm with the Atari OS with its
system error vector pointed to warm start which printed message and
aborted.
...
That's a credible use. For reasons unknown MVP-FORTH (based on
Fig-FORTH) removed
both the WARM start vector and the built-in divide-by-zero checks.
Anything that
triggered the div-zero interrupt would drop you out of Forth. The worry with >redirecting system interrupts is what happens to the system when forth
does crash.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 47:34:52 |
Calls: | 6,710 |
Calls today: | 3 |
Files: | 12,243 |
Messages: | 5,354,496 |
Posted today: | 1 |