Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #55885 > unrolled thread
| Started by | hughaguilar96@gmail.com |
|---|---|
| First post | 2017-03-18 00:30 -0700 |
| Last post | 2017-03-18 13:24 -0700 |
| Articles | 5 — 3 participants |
Back to article view | Back to comp.lang.forth
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: bug in VFX --- IF does't work hughaguilar96@gmail.com - 2017-03-18 00:30 -0700
Re: bug in VFX --- IF does't work stephen@mpeforth.com (Stephen Pelc) - 2017-03-18 13:15 +0000
Re: bug in VFX --- IF does't work Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> - 2017-03-18 13:54 +0000
Re: bug in VFX --- IF does't work hughaguilar96@gmail.com - 2017-03-18 18:45 -0700
Re: bug in VFX --- IF does't work hughaguilar96@gmail.com - 2017-03-18 13:24 -0700
| From | hughaguilar96@gmail.com |
|---|---|
| Date | 2017-03-18 00:30 -0700 |
| Subject | Re: bug in VFX --- IF does't work |
| Message-ID | <eb7c78e9-20ef-47d0-be66-9d140593b170@googlegroups.com> |
On Sunday, June 14, 2015 at 6:13:33 PM UTC-7, Doug Hoffman wrote:
> On 6/14/15 7:48 PM, hughaguilar96@gmail.com wrote:
> > On Sunday, June 14, 2015 at 4:20:31 PM UTC-7, Stephen Pelc wrote:
>
> >> If you had made the slightest effort, e.g. by disassembling LITERAL
> >> and what it contains, or by reading the manual, you would find that
> >> LITERAL is already effectively DEFERred.
>
> > I looked up LITERAL and found that it is not deferred. The manual says: [snip]
>
> Hugh,
>
> Stephen also suggested disassembling LITERAL. Try it.
>
> -Doug
For anybody who cares (I don't know why anybody would), here is a disassembly of LITERAL under VFX:
see literal
LITERAL (is IMMEDIATE)
( 00411474 E8F35DFFFF ) CALL 0040726C CLIT,
( 00411479 C3 ) NEXT,
( 6 bytes, 2 instructions )
ok
hex 0040726c disasm/f
( 0040726C E8ADB30000 ) CALL 0041261E
( 00407271 48 ) DEC EAX
( 00407272 B543 ) MOV CH, 43
( 00407274 00FF ) ADD BH, BH
In the weeds ...
( 00407276 0000 ) ADD 0 [EAX], AL
( C bytes, 5 instructions )
ok
hex 0041261e disasm/f
( 0041261E 8D6DFC ) LEA EBP, [EBP+-04]
( 00412621 895D00 ) MOV [EBP], EBX
( 00412624 5B ) POP EBX
( 00412625 8B13 ) MOV EDX, 0 [EBX]
( 00412627 8B5D00 ) MOV EBX, [EBP]
( 0041262A 8D6D04 ) LEA EBP, [EBP+04]
( 0041262D FFD2 ) CALL EDX
( 0041262F C3 ) NEXT,
( 12 bytes, 8 instructions )
ok
LITERAL calls CLIT and that is all that it does. CLIT (which is apparently smudged because it can't be found in the dictionary) is located at $0040726c. All it does is call another function ($0041261e), and that function uses the return-address as a pointer, so it doesn't return to its caller (the CLIT function) but instead eventually returns to the caller's caller (the LITERAL function). That function ($0041261e) does a vectored call. It first pushes EBX (the TOS register) onto the data-stack. Then it pops the return-address into EBX. Then it moves the datum at this address (what was after the CALL in the $0040726c function) into EDX. Then it pops the data-stack back into EBX. Then it calls through the EDX pointer. So, the vector is after the CALL instruction in the $0040726c function --- it is located at: $00407271 --- note that we have data juxtaposed with code, which is a bad idea because it results in cache thrashing.
I don't know why the $0041261e function wasn't written like this:
pop edx
mov edx, 0 [edx]
jmp edx
Actually, I don't know why LITERAL wasn't just made a deferred word --- VFX does have deferred words (such as NUMBER? etc.) --- none of this convoluted assembly-language was necessary.
Anyway, none of this matters. It is a waste of time to become an expert at the internal workings of VFX --- there is no guarantee that any of this will still be available in a new release of VFX --- that is the downside of relying on carnal knowledge.
The bottom line is that the Forth-200x committee (which includes Stephen Pelc) will never define LITERAL 2LITERAL and FLITERAL as being vectored words --- they don't want the Forth community to write cross-compilers in standard Forth that use the built-in outer-interpreter and support literal numbers in TARG colon words --- ANS-Forth and Forth-200x are both purposely crippled to prevent this.
[toc] | [next] | [standalone]
| From | stephen@mpeforth.com (Stephen Pelc) |
|---|---|
| Date | 2017-03-18 13:15 +0000 |
| Message-ID | <58cd31ca.208101698@news.eternal-september.org> |
| In reply to | #55885 |
On Sat, 18 Mar 2017 00:30:26 -0700 (PDT), hughaguilar96@gmail.com wrote: >For anybody who cares (I don't know why anybody would), here is a disassemb= >ly of LITERAL under VFX: > >see literal=20 >LITERAL (is IMMEDIATE)=20 >( 00411474 E8F35DFFFF ) CALL 0040726C CLIT, >( 00411479 C3 ) NEXT, >( 6 bytes, 2 instructions ) > ok What a prat you are! The boss at an engineering company I used to visit has a sign in his office: " Activate brain before engaging mouth" dis clit, CLIT, is DEFERred. Action is C_LIT Stephen -- Stephen Pelc, stephenXXX@mpeforth.com MicroProcessor Engineering Ltd - More Real, Less Time 133 Hill Lane, Southampton SO15 5AF, England tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691 web: http://www.mpeforth.com - free VFX Forth downloads
[toc] | [prev] | [next] | [standalone]
| From | Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> |
|---|---|
| Date | 2017-03-18 13:54 +0000 |
| Message-ID | <20170318135452.361386ef@t530.lan> |
| In reply to | #55898 |
On Sat, 18 Mar 2017 13:15:25 GMT stephen@mpeforth.com (Stephen Pelc) wrote: > [...] > What a prat you are! The boss at an engineering company I used > to visit has a sign in his office: > " Activate brain before engaging mouth" Nicely pruned, thanks, I didn't want to read the rest. Jan Coombs
[toc] | [prev] | [next] | [standalone]
| From | hughaguilar96@gmail.com |
|---|---|
| Date | 2017-03-18 18:45 -0700 |
| Message-ID | <cbc1c65d-17dd-4bd2-b011-90fe82c3642f@googlegroups.com> |
| In reply to | #55899 |
On Saturday, March 18, 2017 at 6:54:53 AM UTC-7, Jan Coombs wrote: > On Sat, 18 Mar 2017 13:15:25 GMT > stephen@mpeforth.com (Stephen Pelc) wrote: > > [...] > > What a prat you are! The boss at an engineering company I used > > to visit has a sign in his office: > > " Activate brain before engaging mouth" > > Nicely pruned, thanks, I didn't want to read the rest. > > Jan Coombs The ANS-Forth standard is crippled to prevent ANS-Forth programmers from writing cross-compilers that use the built-in outer-interpreter and support literal numbers inside of TARG colon words. This was done to prevent them from doing so in competition with the ANS-Forth committee members. Now, Stephen Pelc is on the Forth-200x committee and he is striving to cripple Forth-200x in a similar manner. He wants the Forth community to buy his cross-compiler --- he wants to prevent them from writing their own cross-compilers. Why are you brown-nosing Stephen Pelc? Do you work for MPE? Did you buy a copy of VFX and now you feel obliged to brown-nose MPE? Public brown-nosing is disgusting! You must have some monetary reason for making such a disgusting spectacle out of yourself. Tell us!
[toc] | [prev] | [next] | [standalone]
| From | hughaguilar96@gmail.com |
|---|---|
| Date | 2017-03-18 13:24 -0700 |
| Message-ID | <56d490f6-0310-442b-a69f-4e072c37f3fe@googlegroups.com> |
| In reply to | #55898 |
On Saturday, March 18, 2017 at 6:15:20 AM UTC-7, Stephen Pelc wrote: > On Sat, 18 Mar 2017 00:30:26 -0700 (PDT), hughaguilar96@gmail.com > wrote: > > >For anybody who cares (I don't know why anybody would), here is a disassemb= > >ly of LITERAL under VFX: > > > >see literal=20 > >LITERAL (is IMMEDIATE)=20 > >( 00411474 E8F35DFFFF ) CALL 0040726C CLIT, > >( 00411479 C3 ) NEXT, > >( 6 bytes, 2 instructions ) > > ok > > What a prat you are! The boss at an engineering company I used to > visit has a sign in his office: > " Activate brain before engaging mouth" > > dis clit, > CLIT, is DEFERred. Action is C_LIT The point that I'm making is that ANS-Forth does not vector LITERAL 2LITERAL and FLITERAL --- I think this was done for the purpose of preventing ANS-Forth programmers from writing a cross-compiler that uses the built-in outer-interpreter and supports literal values in TARG colon words --- also, the Forth-200x committee (which you are a member of) refuses to vector LITERAL 2LITERAL and FLITERAL for the same reason. You are now telling me that CLIT, is a deferred word. I am pointing out that CLIT, is not ANS-Forth. Also, nothing in ANS-Forth is deferred. You are trying to trap VFX users in vendor lock-in. You are telling me that I have to disassemble VFX and figure out how LITERAL works internally in order to write a cross-compiler that uses the built-in outer-interpreter and supports literal values in TARG colon words. That information would only be useful to me if I were going to buy VFX --- but I don't want to be an MPE customer --- I want to program in ANS-Forth. If you are opposed to people programming in standard Forth, but insist that they buy your VFX, then you are the worst qualified person in the world to be on the Forth-200x committee --- you are not supporting the Forth community --- you are giving the Forth community a crippled standard in order to push them into buying VFX. BTW: FLITERAL is not vectored in VFX --- so even if I pay for VFX I still don't get to write a cross-compiler that uses the built-in outer-interpreter and supports literal values in TARG colon words --- not floating-point literals, anyway.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.forth
csiph-web