Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!pitt!willett!ForthNet From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: PYGMY Forth Message-ID: <2213.UUL1.3#5129@willett.pgh.pa.us> Date: 10 Jan 91 04:17:12 GMT Organization: (n.) to be organized. But that's not important right now. Lines: 39 Category 1, Topic 45 Message 60 Wed Jan 09, 1991 F.SERGEANT [Frank] at 02:54 CST JB>Has anyone developed good SCAN, SKIP ... for Pygmy Forth? Assuming a string AAAABBBB at address 100, I have a SCAN that will hunt for a specific character as in ( 100 8) 'A SCAN ( 100 8) or ( 100 8) 'B SCAN ( 104 4) or ( 100 8) 'C SCAN ( 108 0). And a SKIP that will eat beginning delimiters. ( 100 8) 'A SKIP ( 104 4) or ( 100 8) 'B ( 100 8). Are those what you want? If so: CODE SCAN ( a # char - a #) DS AX MOV, AX ES MOV, BX AX MOV, CX POP, DI POP, REPNZ, AL SCAS, 0=, IF, DI DEC, CX INC, THEN, DI PUSH, CX BX MOV, NXT, END-CODE CODE SKIP ( a # char - a #) DS AX MOV, AX ES MOV, BX AX MOV, CX POP, DI POP, REPZ, AL SCAS, 0=, NOT, IF, DI DEC, CX INC, THEN, DI PUSH, CX BX MOV, NXT, END-CODE At least I hope that's what they do. As for the command line, it is sitting in memory at address $80 in the same segment Pygmy is running out of. To see it, do HEX 80 DUMP ( DUMP .... DUMP) Byte $80 holds the number of characters and those characters begin at byte $81. Thanks for your comments. -- Frank ----- This message came from GEnie via willett. You cannot Reply to the author using email. Please post a follow-up article, or use any instructions the author may have included (USMail addresses, telephone #, whatever). Report problems to: dwp@willett.pgh.pa.us or uunet!willett!dwp