Execute SNUSP/C: Difference between revisions

m
Categorization now in master page
m (<lang>)
m (Categorization now in master page)
Line 1:
{{implementation|SNUSP}}{{collection|RCSNUSP}}[[Category:C]]
This is an interpreter for Modular SNUSP (understands @ and #) written in [[C]], and a special enhanced non-standard mode can be activated from the command line. Limits are hard encoded using #defines; the memory pointer wraps around with a (rather silly) warning.
 
The enhanced mode actives the interpretation of &, different from the one of the Bloated SNUSP; the & instruction changes the behaviour of the ''read'' and ''write'' instructions (, and .): until the next &, the comma will read from the current cell and store the read value into an accumulator register, and the dot (write) will write the value of the accumulator in the current cell.
Line 6:
The source code to be interpreted is specified on the command line after the keyword '''snusp''', while the keyword '''enhanced''' activates the enhanced non standard mode, and the keyword '''debug''' activates debugging mode. Normally the read instruction reads from the stdin and the write instruction writes to stdout.
 
<lang c>#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Line 276 ⟶ 275:
for(i=0; i < maxi; i++)
free(field[i].s);
}</lang>
}
</lang>
Anonymous user