diff --git a/PLASMA/src/cmd.pla b/PLASMA/src/cmd.pla index 0aaa5c98..b9f3c862 100644 --- a/PLASMA/src/cmd.pla +++ b/PLASMA/src/cmd.pla @@ -37,7 +37,6 @@ byte stdlibstr[] = "STDLIB" byte clsstr[] = "CLS" byte gotoxystr[] = "GOTOXY" byte viewstr[] = "VIEWPORT" -byte putnlstr[] = "PUTNL" byte putcstr[] = "PUTC" byte putsstr[] = "PUTS" byte getcstr[] = "GETC" @@ -59,7 +58,6 @@ byte execstr[] = "EXEC" word exports[] = @clsstr, @home word = @gotoxystr, @gotoxy word = @viewstr, @viewport -word = @putnlstr, @crout word = @putcstr, @cout word = @putsstr, @prstr word = @getcstr, @cin @@ -83,8 +81,9 @@ word stdlibsym = @exports ; String pool. ; byte version[] = "PLASMA 0.9\n" -byte errorstr[] = "ERR: " +byte errorstr[] = "ERR:$" byte okstr[] = "OK" +byte huhstr[] = "?\n" byte freestr[] = "MEM FREE:$" byte prefix[32] = "" ; @@ -1411,28 +1410,32 @@ crout while 1 prstr(getpfx(@prefix)) cmdptr = rdstr($BA) - when toupper(parsecmd(cmdptr)) - is 'Q' - reboot() - is 'C' - catalog(cmdptr) - is 'P' - setpfx(cmdptr) - is 'V' - volumes(); - is '-' - execsys(cmdptr) - perr = $46 - is '+' - execmod(cmdptr) - wend - if perr - prstr(@errorstr) - prbyte(perr) - perr = 0 - else - prstr(@okstr) + if ^cmdptr + when toupper(parsecmd(cmdptr)) + is 'Q' + reboot() + is 'C' + catalog(cmdptr) + is 'P' + setpfx(cmdptr) + is 'V' + volumes(); + is '-' + execsys(cmdptr) + perr = $46 + is '+' + execmod(cmdptr) + otherwise + prstr(@huhstr) + wend + if perr + prstr(@errorstr) + prbyte(perr) + perr = 0 + else + prstr(@okstr) + fin + crout() fin - crout() loop done \ No newline at end of file diff --git a/PLASMA/src/test.pla b/PLASMA/src/test.pla index 1596014c..1fa2a394 100755 --- a/PLASMA/src/test.pla +++ b/PLASMA/src/test.pla @@ -2,11 +2,11 @@ ; Declare all imported modules and their data/functions. ; import stdlib - predef cls, gotoxy, viewport, puts, putc, putnl, getc + predef cls, gotoxy, viewport, puts, putc, getc end import testlib - predef puti + predef puti, putnl end ; ; Predeclare any functions called before defined. diff --git a/PLASMA/src/testlib.pla b/PLASMA/src/testlib.pla index 737ecaef..3ecde6bc 100755 --- a/PLASMA/src/testlib.pla +++ b/PLASMA/src/testlib.pla @@ -4,7 +4,7 @@ import stdlib predef cls, gotoxy, puts, putc end -byte loadstr[] = "testlib loaded!\n" +byte loadstr[] = "testlib loaded!" ; ; Define functions. ; @@ -20,6 +20,10 @@ export def puti(i) putc(i % 10 + '0') fin end +export def putnl + putc($0D) +end -puts(@loadstr); +puts(@loadstr) +putnl done