Larkin, Power BASIC cannot be THAT good:

graphics

minimise

If you run it from a commandline, that should work.

Section 3.8.5. And the operator is renamed '=' instead of '.', which I'd forgotten, but it does the same thing.

--
    W
  . | ,. w ,   "Some people are alive only because
   \\|/  \\|/     it is illegal to kill them."    Perna condita delenda est
---^----^---------------------------------------------------------------
Reply to
Bob Larter
Loading thread data ...

My mistake. That operator is named '=' in PS. Eg:

1 2 3 add add = will print '6' to your terminal.

FORTH & PS work by building new words out of existing ones & slapping a name on them. Eg (under Ghostscript): /addsix {6 add =} def ...creates a new function named 'addsix' that adds 6 to whatever number is on the top of the stack & outputs it to your terminal, so:

The operand & execution stacks work the same way that they do in other languages, it's just that they're split into separate stacks. The only 'new' one is the dictionary stack.

--
    W
  . | ,. w ,   "Some people are alive only because
   \\|/  \\|/     it is illegal to kill them."    Perna condita delenda est
---^----^---------------------------------------------------------------
Reply to
Bob Larter

It's modified as a stack (i.e. dictionaries are pushed onto and popped off the top of the stack) and searched as a list.

The end result is equivalent to a dynamically-scoped language.

The way that names are resolved is documented. It's up to the programmer as to how (or whether) to make use of the dictionary stack.

Reply to
Nobody

you'll=20

printers.

PLRM

are

ne,

I never had an issue with the well known property that both of them are stack languages. I took issue with the idea that FORTH code could be run on a PS system unmodified. Nor did i ever contend that anything you can say in FORTH could not be said in PS. The converse may be true however.

I rather think representing graphics operations in a stack is new as well. Now what was that 5th stack?

Reply to
JosephKK

Somehow, this reminds me of the PDP-11; it had 16 general-purpose registers that could be used as stack pointers. (or accumulators, indexes, whatever you could use a register for.)

Cheers! Rich

Reply to
Rich Grise

There are 3 stacks which are explicitly presented as such: the operand stack, dictionary stack, and execution stack. The last one corresponds to "the stack" in more typical languages, and is seldom referenced directly by the program.

In addition to the 3 explicit stacks, the VM state and graphics state can be saved and restored, which implies a stack. However, there is no way to access these stacks as such, i.e. you can't determine the stack depth, or access intermediate frames.

Reply to
Nobody

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D

ASTER

NG RND()!

/10, 1E9*E!/(10*64E6))

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D

o

s into 64-million 32-integer sums.

o make the measurement duration more reasonable.

g the system("date") functions.

short ) *

nbound_data,

=A0 =A0 =A0// 10 x

Y_SIZE; ++index )

inbound_data[index];

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D

r

to

h

Programmers learn to organise the information in their program so that it doesn't swamp out the program itself. Hence, they keep commenting, caps etc to a minimum. It's exactly the same with drawing out a schematic - information is kept to a minimum so it doesn't swamp the circuit, such as not using long power supply or ground lines when a short vcc or gnd label will do.

Reply to
blackhead

1E9*E!/(10*64E6))
64-million 32-integer sums.

measurement duration more reasonable.

system("date") functions.

That makes me yet-again grateful that I'm not a programmer.

I comment my code and my schematics. And my breadboards even.

I never understood the appeal of destroying information. Is it a job security thing?

You'll hate this. Think how much better it would be without comments:

.SBTTL . MAXIM : LOAD A SERIAL DAC

; THE MAXIM SERIAL DAC NEEDS 4 BITS OF CONTROL AND 12 BITS ; OF DATA. THE PATTERNS ARE...

MAXA = 0000h ; 0ddd LOAD DAC A 10 MHZ XO TRIM MAXB = 1000h ; 1ddd LOAD DAC B 50 MHZ OSC TRIM MAXC = 2000h ; 2ddd LOAD DAC C TRIGGER LEVEL MAXD = 3000h ; 3ddd LOAD DAC D DPLL ADC REF

WAKA = 0F000h ; WAKE UP DAC A TRISA = 0F001h ; TRISTATE DAC A WAKB = 0F004h ; WAKE UP DAC B WAKC = 0F008h ; WAKE UP DAC C WAKD = 0F00Ch ; WAKE UP DAC D

; ENTER HERE WITH D4 LOADED WITH A 16-BIT PATTERN, 4 BITS ; OF COMMAND FOLLOWED BY 12 BITS OF DATA.

MAXIM: MOVEM.L D4 D7 A2, -(SP) ; PROTECT REGGIES

MOVEA.W # PORTD, A2 ; AIM AT THE I/O PORT

BMX = 4 ; MAC DAC CS- BITNUM CLK = 2 ; SPI CLOCK DAT = 1 ; SERIAL DATA OUT

BCLR.B # CLK, (A2) ; MAKE SURE CLOCK IS LOW AND BCLR.B # BMX, (A2) ; PULL DOWN MAX CS- MOVE.W # 16-1, D7 ; WE'LL BANG 16 BITS

LD16: ASL.W # 1, D4 ; TEST A BIT... BCS.S MAX1 ; HOP FOR '1' BCLR.B # DAT, (A2) ; DATA LOW BRA.S MAXCLK

MAX1: BSET.B # DAT, (A2) ; DATA HIGH

MAXCLK: BSET.B # CLK, (A2) ; POP THE CLOCK HIGH BCLR.B # CLK, (A2) ; AND LOW DBF D7, LD16 ; LOOP FOR 16 BITS

BSET.B # BMX, (A2) ; RELEASE CHIP SELECT

MOVEM.L (SP)+, D4 D7 A2

RTS

John

Reply to
John Larkin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.