Welcome, Guest. Please login or register.


Author Topic: FORTH (Read 7202 times)

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13399
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 19.0 Firefox 19.0
    • View Profile
    • http://enterprise.iko.hu/
Re: FORTH
« Reply #45 on: 2013.March.09. 00:22:53 »
Quote from: BruceTanner

One point I have just noticed is that trailing spaces are not removed; thus even the smallest program takes up 1k :oops: and if you have 16 small program fragments each in their own block it will take up 16k :oops::oops::oops::oops::oops::oops::oops::oops::oops::oops::oops::oops::oops::oops::oops::oops: which is not good on tape systems that this is aimed at!
There is a Turbo Pack Tape extension which compresses the saved bytes on the fly  :-) (and higher baud rate also can be used)
« Last Edit: 2013.March.10. 11:25:09 by szipucsu »

Offline lgb

  • EP addict
  • *
  • Posts: 3496
  • Country: hu
  • æðsta yfirmaður
  • OS:
  • Linux Linux
  • Browser:
  • Chrome 26.0.1410.28 Chrome 26.0.1410.28
    • View Profile
    • http://lgb.hu/
Re: FORTH
« Reply #46 on: 2013.March.10. 11:12:46 »
Quote from: BruceTanner
Yes, spot on - you have discovered a little secret! (Actually, not so secret - they are in the manual). Not a major performance increase but slightly quicker nonetheless. I think it's worth it for 0 and 1 which occur in programs very commonly; I'm not so convinced by 2 and 3!
I've just checked the output of vlist out again. It seems there are four words defined whose names are consist of only numbers: 0, 1, 2 and 3. Interesting to have defined words for 2 and 3 too, if it's not worth as much as for 0, 1 because then some may think that eg 4 and 5 should be handled this way as well :)

Offline BruceTanner

  • EP user
  • *
  • Posts: 485
  • Country: gb
  • OS:
  • Linux Linux
  • Browser:
  • Safari 4.0 Safari 4.0
    • View Profile
Re: FORTH
« Reply #47 on: 2013.March.10. 11:28:57 »
Quote from: lgb
...some may think that eg 4 and 5 should be handled this way as well :)
It's FORTH so they can if they want to :smt003 (will require use of assembler if it is to be exactly the same)

Offline BruceTanner

  • EP user
  • *
  • Posts: 485
  • Country: gb
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 25.0.1364.152 Chrome 25.0.1364.152
    • View Profile
Re: FORTH
« Reply #48 on: 2013.March.10. 11:54:16 »
Quote from: BruceTanner
It's FORTH so they can if they want to :smt003 (will require use of assembler if it is to be exactly the same)
So before someone asks:

CODE 4   DE PUSH,  HL DE EX,  4 HL LD,  IX JP(),  END-CODE
CODE 5   DE PUSH,  HL DE EX,  5 HL LD,  IX JP(),  END-CODE

The top two items on the stack are held in registers DE and HL. So PUSH DE puts the current second item on the actual stack to make it the third, EX DE,HL puts the current top of stack in HL into DE to make it the second on the stack, and LD HL,4 makes 4 the new top item on the stack. JP (IX) is how all IS-FORTH machine code words end.

Offline Zozosoft

  • EP addict
  • *
  • Posts: 13399
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 19.0 Firefox 19.0
    • View Profile
    • http://enterprise.iko.hu/
Re: FORTH
« Reply #49 on: 2013.March.12. 21:20:40 »
Lacika wrote prime search program for comparing BASIC and FORTH speed.