home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,358 of 4,675   
   Rod Pemberton to All   
   Re: reading a file from disk   
   27 May 21 02:07:55   
   
   From: nomailings@nospicedham.trgzxcqvbe.cpm   
      
   On Wed, 26 May 2021 15:33:53 -0700 (PDT)   
   "luser...@nospicedham.gmail.com"    
   wrote:   
      
      
      
   > My goal at this stage is just to get some kind of read/write ability   
   > so the Forth interpreter can read Forth source from a file. So far,   
   > all my Forth code is written in a sort of "pre-compiled" form   
   > directly in the C code that implements the CPU emulator.   
      
   Since your Forth interpreter is coded in C, you might start by using   
   custom Forth words for standard C file I/O functions.  Over time, you   
   could implement modern standard Forth words for loading a file, by   
   transforming and rewriting the custom words, as these mostly match C's   
   functionality.  Personally, I'd avoid loading blocks of ancient text   
   screens like fig-Forth, unless you already have the functionality.   
   E.g., set an ANS Forth word like OPEN-FILE to C's fopen() so you can   
   build other ANS Forth file I/O words like INCLUDED INCLUDE-FILE etc.   
   You might be able to do this by setting the CFA for a primitive (or   
   low-level Forth word) with the address of the C function  E.g., if you   
   have some Forth words coded in C (or assembly), you should be able to   
   do this.   
      
   http://lars.nocrew.org/dpans/dpans11.htm#11.6.1.1718   
      
   --   
   The SALT deduction is a kickback of taxes to wealthy people in wealthy   
   states.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca