The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
HP75C / FORTH / Clock?
03-17-2017, 02:00 PM
Post: #1
HP75C / FORTH / Clock?
With the new HP75 emulator EMU75 is makes fun to play with the existing software, for example FORTH.
While learning FORTH with the HP75 – I have transferred the N-Queens benchmark source code to the HP75:

http://www.hpmuseum.org/cgi-sys/cgiwrap/...i?read=700

SCR00005:
8 CONSTANT RR
0 VARIABLE SS
0 VARIABLE XX
0 VARIABLE YY
HEX HERE RR 1+ ALLOT CONSTANT AA
: RCLAA @ AA + C@ ;
: STOAA @ AA + C! ;
: NQCORE 0 SS ! 0 XX !
BEGIN 1 XX +! RR XX STOAA BEGIN 1 SS +! XX @ YY !
BEGIN YY @ 1 > WHILE -1 YY +! XX RCLAA YY RCLAA - DUP
0 = SWAP ABS XX @ YY @ - = OR IF 0 YY !
BEGIN XX RCLAA 1 - DUP XX STOAA 0 = WHILE -1 XX +! REPEAT THEN
REPEAT YY @ 1 = UNTIL RR XX @ = UNTIL ;
: NQUEENS NQCORE ." S=" SS @ . CR ;
DECIMAL


It works! The source is in the file “SCR00005” In the FORTH environment you can load it with “5 LOAD” and start it with “NQUEENS”

But now my question. How I can measure the runtime of the routine NQUEENS. I see no time command in the FORTH environment. Is there a clock memory address?
Who wrote a time routine? Thank you.

(I feel, it is very fast - later, i will try that on the real machine.)

Best regards
Tobie
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP75C / FORTH / Clock? - charger73 - 03-17-2017 02:00 PM
RE: HP75C / FORTH / Clock? - J-F Garnier - 03-18-2017, 08:43 AM
RE: HP75C / FORTH / Clock? - Garth Wilson - 03-18-2017, 09:57 AM
RE: HP75C / FORTH / Clock? - J-F Garnier - 03-19-2017, 10:00 AM
RE: HP75C / FORTH / Clock? - John Cadick - 03-18-2017, 05:19 PM
RE: HP75C / FORTH / Clock? - John Cadick - 03-18-2017, 06:36 PM
RE: HP75C / FORTH / Clock? - charger73 - 03-19-2017, 07:17 AM
RE: HP75C / FORTH / Clock? - xerxes - 03-19-2017, 05:12 PM
RE: HP75C / FORTH / Clock? - hth - 03-19-2017, 09:09 PM



User(s) browsing this thread: 1 Guest(s)