logoalt Hacker News

DonHopkinstoday at 12:00 AM0 repliesview on HN

Here is some inexplicably but meticulously formatted FORTH code that uses right justified indentation! Including reverse polish notation assembley.

https://donhopkins.com/home/code/tomt-cam-forth-scr.txt

https://donhopkins.com/home/code/tomt-users-forth-scr.txt

  ( FMOVE -- functional intersegment move                   ) HEX

  88 CONSTANT *MOV*  ( fn = 0 )   20 CONSTANT *AND*  ( fn = 1 )
  08 CONSTANT  *OR*  ( fn = 2 )   30 CONSTANT *XOR*  ( fn = 3 )

  CODE FMOVE ( fn s.seg s.off d.seg d.off length --)  AX, SI MOV
      CX POP  DI POP  ES POP  SI POP  DS POP  DX POP  AX PUSH
                        AL, # *XOR* MOV  DX, # 3 CMP  1$ JE
                        AL, #  *OR* MOV  DX, # 2 CMP  1$ JE
                        AL, # *AND* MOV  DX, # 1 CMP  1$ JE
                        AL, # *MOV* MOV               1$:
     CS: HERE 5 + , AL MOV  ( modify "[DI], AL MOV" ) 2$:
                      LODS  ES: [DI], AL MOV  DI INC  2$ LOOP
      AX, CS MOV  ES, AX MOV  DS, AX MOV  SI POP  NEXT,  END-CODE

                                                            -->