diff --git a/compiler/res/prog8lib/cx16logo.p8 b/compiler/res/prog8lib/cx16logo.p8 index 0506afdae..7c5afff35 100644 --- a/compiler/res/prog8lib/cx16logo.p8 +++ b/compiler/res/prog8lib/cx16logo.p8 @@ -16,7 +16,7 @@ cx16logo { uword strptr for strptr in logo_lines txt.print(strptr) - txt.chrout('\n') + txt.nl() } str[] logo_lines = [ diff --git a/compiler/res/prog8lib/diskio.p8 b/compiler/res/prog8lib/diskio.p8 index 5e3847630..fca27b9bf 100644 --- a/compiler/res/prog8lib/diskio.p8 +++ b/compiler/res/prog8lib/diskio.p8 @@ -38,7 +38,7 @@ diskio { break txt.chrout(char) } - txt.chrout('\n') + txt.nl() void c64.CHRIN() ; skip 2 bytes void c64.CHRIN() status = c64.READST() @@ -54,7 +54,7 @@ io_error: if status and status != 64 { ; 64=end of file txt.print("\ni/o error, status: ") txt.print_ub(status) - txt.chrout('\n') + txt.nl() return false } diff --git a/docs/source/index.rst b/docs/source/index.rst index 8d8898f88..85bb744a9 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -86,10 +86,10 @@ This code calculates prime numbers using the Sieve of Eratosthenes algorithm:: txt.print(", ") amount++ } - txt.chrout('\n') + txt.nl() txt.print("number of primes (expected 54): ") txt.print_ub(amount) - txt.chrout('\n') + txt.nl() } sub find_next_prime() -> ubyte { diff --git a/examples/arithmetic/builtins.p8 b/examples/arithmetic/builtins.p8 index a938d660e..efc9c326e 100644 --- a/examples/arithmetic/builtins.p8 +++ b/examples/arithmetic/builtins.p8 @@ -20,237 +20,237 @@ main { uword[] uwarr = [%1100111110101010] repeat(10) { - txt.chrout('\n') + txt.nl() } txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() rol(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() rol(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() rol(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() rol(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') - txt.chrout('\n') + txt.nl() + txt.nl() uwarr[0] = %1100111110101010 ror(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() ror(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() ror(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() ror(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() ror(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') - txt.chrout('\n') + txt.nl() + txt.nl() sys.clear_carry() txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() rol2(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() rol2(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() rol2(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() rol2(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') - txt.chrout('\n') + txt.nl() + txt.nl() txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() ror2(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() ror2(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() ror2(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') + txt.nl() ror2(uwarr[0]) txt.print_uwbin(uwarr[0], true) - txt.chrout('\n') - txt.chrout('\n') + txt.nl() + txt.nl() txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() rol(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() rol(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() rol(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() rol(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') - txt.chrout('\n') + txt.nl() + txt.nl() sys.set_carry() ror(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() ror(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() ror(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() ror(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() sys.set_carry() ror(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') - txt.chrout('\n') + txt.nl() + txt.nl() txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() rol2(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() rol2(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() rol2(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() rol2(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') - txt.chrout('\n') + txt.nl() + txt.nl() txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() ror2(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() ror2(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() ror2(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') + txt.nl() ror2(ubarr[0]) txt.print_ubbin(ubarr[0], true) - txt.chrout('\n') - txt.chrout('\n') + txt.nl() + txt.nl() &ubyte membyte = $c000 uword addr = $c000 @(addr) = %10110101 txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() sys.set_carry() rol(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() sys.set_carry() rol(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() sys.set_carry() rol(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() sys.set_carry() rol(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') - txt.chrout('\n') + txt.nl() + txt.nl() @(addr) = %10110101 txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() sys.set_carry() ror(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() sys.set_carry() ror(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() sys.set_carry() ror(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() sys.set_carry() ror(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') - txt.chrout('\n') + txt.nl() + txt.nl() @(addr) = %10110101 txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() rol2(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() rol2(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() rol2(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() rol2(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') - txt.chrout('\n') + txt.nl() + txt.nl() @(addr) = %10110101 txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() ror2(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() ror2(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() ror2(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') + txt.nl() ror2(@(addr)) txt.print_ubbin(@(addr), true) - txt.chrout('\n') - txt.chrout('\n') + txt.nl() + txt.nl() test_stack.test() @@ -270,297 +270,297 @@ main { word ww repeat(20) { - txt.chrout('\n') + txt.nl() } ub = sys.read_flags() txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+sys.read_flags()*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = rnd() txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+rnd()*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() uw = rndw() txt.print_uw(uw) - txt.chrout('\n') + txt.nl() uw = zero+rndw()*1+zero txt.print_uw(uw) - txt.chrout('\n') + txt.nl() uw = 50000 ub = sqrt16(uw) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+sqrt16(uw)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() bb = -100 bb = sgn(bb) txt.print_b(bb) - txt.chrout('\n') + txt.nl() bb = -100 bb = zero+sgn(bb)*1+zero txt.print_b(bb) - txt.chrout('\n') + txt.nl() ub = 100 bb = sgn(ub) txt.print_b(bb) - txt.chrout('\n') + txt.nl() ub = 100 bb = zero+sgn(ub)*1+zero txt.print_b(bb) - txt.chrout('\n') + txt.nl() ww = -1000 bb = sgn(ww) txt.print_b(bb) - txt.chrout('\n') + txt.nl() bb = zero+sgn(ww)*1+zero txt.print_b(bb) - txt.chrout('\n') + txt.nl() uw = 1000 bb = sgn(uw) txt.print_b(bb) - txt.chrout('\n') + txt.nl() bb = zero+sgn(uw)*1+zero txt.print_b(bb) - txt.chrout('\n') + txt.nl() ub = 0 uw = sin16u(ub) txt.print_uw(uw) - txt.chrout('\n') + txt.nl() uw = zero+sin16u(ub)*1+zero txt.print_uw(uw) - txt.chrout('\n') + txt.nl() ub = 0 uw = cos16u(ub) txt.print_uw(uw) - txt.chrout('\n') + txt.nl() uw = zero+cos16u(ub)*1+zero txt.print_uw(uw) - txt.chrout('\n') + txt.nl() ub = 0 ww = sin16(ub) txt.print_w(ww) - txt.chrout('\n') + txt.nl() ww = zero+sin16(ub)*1+zero txt.print_w(ww) - txt.chrout('\n') + txt.nl() ub = 0 ww = cos16(ub) txt.print_w(ww) - txt.chrout('\n') + txt.nl() uw = 0 ww = zero+cos16(ub)*1+zero txt.print_w(ww) - txt.chrout('\n') + txt.nl() ub2 = 0 ub = sin8u(ub2) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+sin8u(ub2)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub2 = 0 ub = cos8u(ub2) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+cos8u(ub2)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub2 = 0 bb = sin8(ub2) txt.print_b(bb) - txt.chrout('\n') + txt.nl() bb = zero+sin8(ub2)*1+zero txt.print_b(bb) - txt.chrout('\n') + txt.nl() ub2 = 0 bb = cos8(ub2) txt.print_b(bb) - txt.chrout('\n') + txt.nl() bb = zero+cos8(ub2)*1+zero txt.print_b(bb) - txt.chrout('\n') + txt.nl() bb = -100 bb = abs(bb) txt.print_b(bb) - txt.chrout('\n') + txt.nl() bb = -100 bb = zero+abs(bb)*1+zero txt.print_b(bb) - txt.chrout('\n') + txt.nl() ww = -1000 ww = abs(ww) txt.print_w(ww) - txt.chrout('\n') + txt.nl() ww = -1000 ww = zero+abs(ww)*1+zero txt.print_w(ww) - txt.chrout('\n') + txt.nl() ub = min(ubarr) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+min(ubarr)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() bb = min(barr) txt.print_b(bb) - txt.chrout('\n') + txt.nl() bb = zero+min(barr)*1+zero txt.print_b(bb) - txt.chrout('\n') + txt.nl() uw = min(uwarr) txt.print_uw(uw) - txt.chrout('\n') + txt.nl() uw = zero+min(uwarr)*1+zero txt.print_uw(uw) - txt.chrout('\n') + txt.nl() ww = min(warr) txt.print_w(ww) - txt.chrout('\n') + txt.nl() ww = zero+min(warr)*1+zero txt.print_w(ww) - txt.chrout('\n') + txt.nl() ub = max(ubarr) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+max(ubarr)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() bb = max(barr) txt.print_b(bb) - txt.chrout('\n') + txt.nl() bb = zero+max(barr)*1+zero txt.print_b(bb) - txt.chrout('\n') + txt.nl() uw = max(uwarr) txt.print_uw(uw) - txt.chrout('\n') + txt.nl() uw = zero+max(uwarr)*1+zero txt.print_uw(uw) - txt.chrout('\n') + txt.nl() ww = max(warr) txt.print_w(ww) - txt.chrout('\n') + txt.nl() ww = zero+max(warr)*1+zero txt.print_w(ww) - txt.chrout('\n') + txt.nl() ub = any(ubarr) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+any(ubarr)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = any(barr) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+any(barr)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = any(uwarr) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+any(uwarr)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = any(warr) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+any(warr)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = all(ubarr) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+all(ubarr)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = all(barr) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+all(barr)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = all(uwarr) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+all(uwarr)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = all(warr) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+all(warr)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() uw = sum(ubarr) txt.print_uw(uw) - txt.chrout('\n') + txt.nl() uw = zero+sum(ubarr)*1+zero txt.print_uw(uw) - txt.chrout('\n') + txt.nl() ww = sum(barr) txt.print_w(ww) - txt.chrout('\n') + txt.nl() ww = zero+sum(barr)*1+zero txt.print_w(ww) - txt.chrout('\n') + txt.nl() uw = sum(uwarr) txt.print_uw(uw) - txt.chrout('\n') + txt.nl() uw = zero+sum(uwarr)*1+zero txt.print_uw(uw) - txt.chrout('\n') + txt.nl() ww = sum(warr) txt.print_w(ww) - txt.chrout('\n') + txt.nl() ww = zero+sum(warr)*1+zero txt.print_w(ww) - txt.chrout('\n') + txt.nl() sort(ubarr) sort(barr) @@ -588,176 +588,176 @@ main { fl = -9.9 fl = abs(fl) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = -9.9 fl = fzero+abs(fl)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = 9.9 fl = atan(fl) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = 9.9 fl = fzero+atan(fl)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = -9.9 fl = ceil(fl) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = -9.9 fl = fzero+ceil(fl)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = -9.9 fl = cos(fl) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = -9.9 fl = fzero+cos(fl)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = -9.9 fl = sin(fl) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = -9.9 fl = fzero+sin(fl)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = 9.9 fl = tan(fl) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = 9.9 fl = fzero+tan(fl)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = 3.1415927 fl = deg(fl) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = 3.1415927 fl = fzero+deg(fl)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = 90 fl = rad(fl) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = 90 fl = fzero+rad(fl)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = -9.9 fl = floor(fl) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = -9.9 fl = fzero+floor(fl)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = 3.1415927 fl = ln(fl) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = 3.1415927 fl = fzero+ln(fl)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = 3.1415927 fl = log2(fl) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = 3.1415927 fl = fzero+log2(fl)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = -9.9 fl = round(fl) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = -9.9 fl = fzero+round(fl)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = -9.9 bb = sgn(fl) txt.print_b(bb) - txt.chrout('\n') + txt.nl() fl = -9.9 bb = zero+sgn(fl)*1+zero txt.print_b(bb) - txt.chrout('\n') + txt.nl() fl = 3.1415927 fl = sqrt(fl) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = 3.1415927 fl = fzero+sqrt(fl)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = rndf() floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = fzero+rndf()*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() swap(fl, fzero) swap(fzero, fl) ub = any(flarr) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+any(flarr)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = all(flarr) txt.print_ub(ub) - txt.chrout('\n') + txt.nl() ub = zero+all(flarr)*1+zero txt.print_ub(ub) - txt.chrout('\n') + txt.nl() reverse(flarr) for ub in 0 to len(flarr)-1 { floats.print_f(flarr[ub]) txt.chrout(',') } - txt.chrout('\n') + txt.nl() fl = max(flarr) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = fzero+max(flarr)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = min(flarr) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = fzero+min(flarr)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = sum(flarr) floats.print_f(fl) - txt.chrout('\n') + txt.nl() fl = fzero+sum(flarr)*1.0+fzero floats.print_f(fl) - txt.chrout('\n') + txt.nl() test_stack.test() } diff --git a/examples/arithmetic/wordbyte.p8 b/examples/arithmetic/wordbyte.p8 index f43d4bd20..33910996d 100644 --- a/examples/arithmetic/wordbyte.p8 +++ b/examples/arithmetic/wordbyte.p8 @@ -6,7 +6,7 @@ main { sub start() { repeat 25 { - txt.chrout('\n') + txt.nl() } ubyte ub @@ -25,7 +25,7 @@ main { else { txt.print("1 fail:") txt.print_uw(uwsum) - txt.chrout('\n') + txt.nl() } wsum = -30000 @@ -39,7 +39,7 @@ main { else { txt.print("2 fail:") txt.print_w(wsum) - txt.chrout('\n') + txt.nl() } uwsum = 50000 @@ -53,7 +53,7 @@ main { else { txt.print("3 fail:") txt.print_uw(uwsum) - txt.chrout('\n') + txt.nl() } wsum = -30000 bb = 100 @@ -90,7 +90,7 @@ main { else { txt.print("6 fail:") txt.print_uw(uwsum) - txt.chrout('\n') + txt.nl() } wsum = -30000 @@ -104,7 +104,7 @@ main { else { txt.print("7 fail:") txt.print_w(wsum) - txt.chrout('\n') + txt.nl() } wsum = -30000 @@ -118,10 +118,10 @@ main { else { txt.print("8 fail:") txt.print_w(wsum) - txt.chrout('\n') + txt.nl() } - txt.chrout('\n') + txt.nl() @@ -135,7 +135,7 @@ main { else { txt.print("1b fail:") txt.print_uw(uwsum) - txt.chrout('\n') + txt.nl() } bb = 0 @@ -148,7 +148,7 @@ main { else { txt.print("2b fail:") txt.print_w(wsum) - txt.chrout('\n') + txt.nl() } uwsum = 50000 @@ -160,7 +160,7 @@ main { else { txt.print("3b fail:") txt.print_uw(uwsum) - txt.chrout('\n') + txt.nl() } wsum = -30000 wsum -= (100+bb) @@ -190,7 +190,7 @@ main { else { txt.print("6b fail:") txt.print_uw(uwsum) - txt.chrout('\n') + txt.nl() } wsum = -30000 @@ -202,7 +202,7 @@ main { else { txt.print("7b fail:") txt.print_w(wsum) - txt.chrout('\n') + txt.nl() } wsum = -30000 @@ -214,10 +214,10 @@ main { else { txt.print("8b fail:") txt.print_w(wsum) - txt.chrout('\n') + txt.nl() } - txt.chrout('\n') + txt.nl() @@ -230,7 +230,7 @@ main { else { txt.print("1c fail:") txt.print_uw(uwsum) - txt.chrout('\n') + txt.nl() } wsum = -30000 @@ -242,7 +242,7 @@ main { else { txt.print("2c fail:") txt.print_w(wsum) - txt.chrout('\n') + txt.nl() } uwsum = 50000 @@ -254,7 +254,7 @@ main { else { txt.print("3c fail:") txt.print_uw(uwsum) - txt.chrout('\n') + txt.nl() } wsum = -30000 wsum -= 100 @@ -284,7 +284,7 @@ main { else { txt.print("6c fail:") txt.print_uw(uwsum) - txt.chrout('\n') + txt.nl() } wsum = -30000 @@ -296,7 +296,7 @@ main { else { txt.print("7c fail:") txt.print_w(wsum) - txt.chrout('\n') + txt.nl() } wsum = -30000 @@ -308,7 +308,7 @@ main { else { txt.print("8c fail:") txt.print_w(wsum) - txt.chrout('\n') + txt.nl() } } diff --git a/examples/cmp/comparisons.p8 b/examples/cmp/comparisons.p8 index db3c87b7c..ddeb91320 100644 --- a/examples/cmp/comparisons.p8 +++ b/examples/cmp/comparisons.p8 @@ -13,20 +13,20 @@ main { sub start() { repeat(25) - txt.chrout('\n') + txt.nl() equal() - txt.chrout('\n') + txt.nl() notequal() - txt.chrout('\n') + txt.nl() less() - txt.chrout('\n') + txt.nl() greater() - txt.chrout('\n') + txt.nl() lessequal() - txt.chrout('\n') + txt.nl() greaterequal() - txt.chrout('\n') + txt.nl() } sub equal() { diff --git a/examples/cmp/word_comps.p8 b/examples/cmp/word_comps.p8 index b585c01a5..18472afc2 100644 --- a/examples/cmp/word_comps.p8 +++ b/examples/cmp/word_comps.p8 @@ -20,57 +20,57 @@ main { txt.print("uword <=\n") txt.print_uw(65535) - txt.chrout('\n') + txt.nl() check_lesseq_uw(0, 65535) txt.print_uw(0) - txt.chrout('\n') + txt.nl() check_not_lesseq_uw(65535, 0) comparevar = 65535 txt.print_uw(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto 0 { check_lesseq_uw(lessvar, comparevar) } comparevar = 65535-2 txt.print_uw(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto 0 { check_lesseq_uw(lessvar, comparevar) } comparevar = 65535-254 txt.print_uw(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto 0 { check_lesseq_uw(lessvar, comparevar) } comparevar = 65535-255 txt.print_uw(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto 0 { check_lesseq_uw(lessvar, comparevar) } comparevar = 65535-256 txt.print_uw(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto 0 { check_lesseq_uw(lessvar, comparevar) } comparevar = 65535-5000 txt.print_uw(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto 0 { check_lesseq_uw(lessvar, comparevar) } comparevar = 32769 txt.print_uw(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto 0 { check_lesseq_uw(lessvar, comparevar) } @@ -78,42 +78,42 @@ main { comparevar = 32768 txt.print_uw(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 65535 downto comparevar+1 { check_not_lesseq_uw(lessvar, comparevar) } comparevar = 1 txt.print_uw(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 65535 downto comparevar+1 { check_not_lesseq_uw(lessvar, comparevar) } comparevar = 0 txt.print_uw(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 65535 downto comparevar+1 { check_not_lesseq_uw(lessvar, comparevar) } comparevar = 11111 txt.print_uw(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 65535 downto comparevar+1 { check_not_lesseq_uw(lessvar, comparevar) } comparevar = 255 txt.print_uw(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 65535 downto comparevar+1 { check_not_lesseq_uw(lessvar, comparevar) } comparevar = 256 txt.print_uw(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 65535 downto comparevar+1 { check_not_lesseq_uw(lessvar, comparevar) } @@ -144,7 +144,7 @@ main { txt.print_uw(w1) txt.print(" <= ") txt.print_uw(w2) - txt.chrout('\n') + txt.nl() sys.exit(1) } } @@ -171,7 +171,7 @@ main { txt.print_uw(w1) txt.print(" not <= ") txt.print_uw(w2) - txt.chrout('\n') + txt.nl() sys.exit(1) } } @@ -184,113 +184,113 @@ main { txt.print("word >\n") txt.print_w(-32767) - txt.chrout('\n') + txt.nl() check_greater_w(32767, -32767) txt.print_w(32766) - txt.chrout('\n') + txt.nl() check_not_greater_w(-32766, 32766) comparevar = 32765 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in comparevar downto -32768 { check_not_greater_w(biggervar, comparevar) } comparevar = -1 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in comparevar downto -32768 { check_not_greater_w(biggervar, comparevar) } comparevar = 0 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in comparevar downto -32768 { check_not_greater_w(biggervar, comparevar) } comparevar = 11111 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in comparevar downto -32768 { check_not_greater_w(biggervar, comparevar) } comparevar = 0 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar+1 { check_greater_w(biggervar, comparevar) } comparevar = -2 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar+1 { check_greater_w(biggervar, comparevar) } comparevar = -254 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar+1 { check_greater_w(biggervar, comparevar) } comparevar = -255 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar+1 { check_greater_w(biggervar, comparevar) } comparevar = -256 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar+1 { check_greater_w(biggervar, comparevar) } comparevar = -5000 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar+1 { check_greater_w(biggervar, comparevar) } comparevar = 1 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar+1 { check_greater_w(biggervar, comparevar) } comparevar = 255 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar+1 { check_greater_w(biggervar, comparevar) } comparevar = 256 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar+1 { check_greater_w(biggervar, comparevar) } comparevar = 257 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar+1 { check_greater_w(biggervar, comparevar) } comparevar = 32760 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar+1 { check_greater_w(biggervar, comparevar) } @@ -327,7 +327,7 @@ main { txt.print_w(w1) txt.print(" > ") txt.print_w(w2) - txt.chrout('\n') + txt.nl() sys.exit(1) } } @@ -361,7 +361,7 @@ main { txt.print_w(w1) txt.print(" not > ") txt.print_w(w2) - txt.chrout('\n') + txt.nl() sys.exit(1) } } @@ -374,113 +374,113 @@ main { txt.print("word >=\n") txt.print_w(-32767) - txt.chrout('\n') + txt.nl() check_greatereq_w(32767, -32767) txt.print_w(32766) - txt.chrout('\n') + txt.nl() check_not_greatereq_w(-32766, 32766) comparevar = 32765 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in comparevar-1 downto -32768 { check_not_greatereq_w(biggervar, comparevar) } comparevar = -1 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in comparevar-1 downto -32768 { check_not_greatereq_w(biggervar, comparevar) } comparevar = 0 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in comparevar-1 downto -32768 { check_not_greatereq_w(biggervar, comparevar) } comparevar = 11111 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in comparevar-1 downto -32768 { check_not_greatereq_w(biggervar, comparevar) } comparevar = 0 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar { check_greatereq_w(biggervar, comparevar) } comparevar = -2 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar { check_greatereq_w(biggervar, comparevar) } comparevar = -254 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar { check_greatereq_w(biggervar, comparevar) } comparevar = -255 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar { check_greatereq_w(biggervar, comparevar) } comparevar = -256 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar { check_greatereq_w(biggervar, comparevar) } comparevar = -5000 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar { check_greatereq_w(biggervar, comparevar) } comparevar = 1 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar { check_greatereq_w(biggervar, comparevar) } comparevar = 255 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar { check_greatereq_w(biggervar, comparevar) } comparevar = 256 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar { check_greatereq_w(biggervar, comparevar) } comparevar = 257 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar { check_greatereq_w(biggervar, comparevar) } comparevar = 32767 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for biggervar in 32767 downto comparevar { check_greatereq_w(biggervar, comparevar) } @@ -517,7 +517,7 @@ main { txt.print_w(w1) txt.print(" >= ") txt.print_w(w2) - txt.chrout('\n') + txt.nl() sys.exit(1) } } @@ -551,7 +551,7 @@ main { txt.print_w(w1) txt.print(" not >= ") txt.print_w(w2) - txt.chrout('\n') + txt.nl() sys.exit(1) } } @@ -564,85 +564,85 @@ main { txt.print("word <=\n") txt.print_w(32767) - txt.chrout('\n') + txt.nl() check_lesseq_w(-32767, 32767) txt.print_w(-32767) - txt.chrout('\n') + txt.nl() check_not_lesseq_w(32767, -32767) comparevar = 0 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto -32768 { check_lesseq_w(lessvar, comparevar) } comparevar = -2 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto -32768 { check_lesseq_w(lessvar, comparevar) } comparevar = -254 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto -32768 { check_lesseq_w(lessvar, comparevar) } comparevar = -255 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto -32768 { check_lesseq_w(lessvar, comparevar) } comparevar = -256 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto -32768 { check_lesseq_w(lessvar, comparevar) } comparevar = -5000 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto -32768 { check_lesseq_w(lessvar, comparevar) } comparevar = 1 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto -32768 { check_lesseq_w(lessvar, comparevar) } comparevar = 255 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto -32768 { check_lesseq_w(lessvar, comparevar) } comparevar = 256 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto -32768 { check_lesseq_w(lessvar, comparevar) } comparevar = 257 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto -32768 { check_lesseq_w(lessvar, comparevar) } comparevar = 32767 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in comparevar downto -32768 { check_lesseq_w(lessvar, comparevar) } @@ -650,28 +650,28 @@ main { comparevar = -32768 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 32766 downto comparevar+1 { check_not_lesseq_w(lessvar, comparevar) } comparevar = -1 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 32766 downto comparevar+1 { check_not_lesseq_w(lessvar, comparevar) } comparevar = 0 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 32766 downto comparevar+1 { check_not_lesseq_w(lessvar, comparevar) } comparevar = 11111 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 32766 downto comparevar+1 { check_not_lesseq_w(lessvar, comparevar) } @@ -701,7 +701,7 @@ main { txt.print_w(w1) txt.print(" <= ") txt.print_w(w2) - txt.chrout('\n') + txt.nl() sys.exit(1) } } @@ -728,7 +728,7 @@ main { txt.print_w(w1) txt.print(" not <= ") txt.print_w(w2) - txt.chrout('\n') + txt.nl() sys.exit(1) } } @@ -741,113 +741,113 @@ main { txt.print("word <\n") txt.print_w(32767) - txt.chrout('\n') + txt.nl() check_less_w(-32767, 32767) txt.print_w(-32767) - txt.chrout('\n') + txt.nl() check_not_less_w(32767, -32767) comparevar = 0 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in -1 downto -32768 { check_less_w(lessvar, comparevar) } comparevar = -2 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in -3 downto -32768 { check_less_w(lessvar, comparevar) } comparevar = -254 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in -255 downto -32768 { check_less_w(lessvar, comparevar) } comparevar = -255 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in -256 downto -32768 { check_less_w(lessvar, comparevar) } comparevar = -256 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in -257 downto -32768 { check_less_w(lessvar, comparevar) } comparevar = -5000 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in -5001 downto -32768 { check_less_w(lessvar, comparevar) } comparevar = 1 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 0 downto -32768 { check_less_w(lessvar, comparevar) } comparevar = 255 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 254 downto -32768 { check_less_w(lessvar, comparevar) } comparevar = 256 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 255 downto -32768 { check_less_w(lessvar, comparevar) } comparevar = 257 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 256 downto -32768 { check_less_w(lessvar, comparevar) } comparevar = 32767 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 32766 downto -32768 { check_less_w(lessvar, comparevar) } comparevar = -32768 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 32766 downto -32768 { check_not_less_w(lessvar, comparevar) } comparevar = -1 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 32766 downto -1 { check_not_less_w(lessvar, comparevar) } comparevar = 0 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 32766 downto 0 { check_not_less_w(lessvar, comparevar) } comparevar = 11111 txt.print_w(comparevar) - txt.chrout('\n') + txt.nl() for lessvar in 32766 downto 11111 { check_not_less_w(lessvar, comparevar) } @@ -877,7 +877,7 @@ main { txt.print_w(w1) txt.print(" < ") txt.print_w(w2) - txt.chrout('\n') + txt.nl() sys.exit(1) } } @@ -904,7 +904,7 @@ main { txt.print_w(w1) txt.print(" not < ") txt.print_w(w2) - txt.chrout('\n') + txt.nl() sys.exit(1) } } diff --git a/examples/compilerperformance/perf.p8 b/examples/compilerperformance/perf.p8 index f7b894ef5..d207b779d 100644 --- a/examples/compilerperformance/perf.p8 +++ b/examples/compilerperformance/perf.p8 @@ -45,7 +45,7 @@ main { util.print_10s(ship.cash) txt.print("\nCommand (?=help): ") ubyte num_chars = txt.input_chars(input) - txt.chrout('\n') + txt.nl() if num_chars { when input[0] { '?' -> { @@ -112,7 +112,7 @@ trader { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() return } @@ -140,7 +140,7 @@ trader { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() } } @@ -361,7 +361,7 @@ market { sub display() { ubyte ci - txt.chrout('\n') + txt.nl() planet.print_name_uppercase() txt.print(" trade market:\n COMMODITY / PRICE / AVAIL / IN HOLD\n") for ci in 0 to len(names)-1 { @@ -377,7 +377,7 @@ market { } txt.print(" ") txt.print_ub(ship.cargohold[ci]) - txt.chrout('\n') + txt.nl() } } @@ -614,7 +614,7 @@ galaxy { txt.print_uwhex(galaxy.seed[1], true) txt.print("\ngalaxy seed2=") txt.print_uwhex(galaxy.seed[2], true) - txt.chrout('\n') + txt.nl() } } @@ -899,9 +899,9 @@ planet { } else { txt.print("Human Colonials") } - txt.chrout('\n') + txt.nl() txt.print(soup()) - txt.chrout('\n') + txt.nl() } } diff --git a/examples/compilerperformance/perf10.p8 b/examples/compilerperformance/perf10.p8 index 6ecad80b4..c9abb6eaa 100644 --- a/examples/compilerperformance/perf10.p8 +++ b/examples/compilerperformance/perf10.p8 @@ -35,7 +35,7 @@ perf10 { util10.print_10s(ship10.cash) txt.print("\nCommand (?=help): ") ubyte num_chars = txt.input_chars(input) - txt.chrout('\n') + txt.nl() if num_chars { when input[0] { '?' -> { @@ -102,7 +102,7 @@ trader10 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() return } @@ -130,7 +130,7 @@ trader10 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() } } @@ -351,7 +351,7 @@ market10 { sub display() { ubyte ci - txt.chrout('\n') + txt.nl() planet10.print_name_uppercase() txt.print(" trade market10:\n COMMODITY / PRICE / AVAIL / IN HOLD\n") for ci in 0 to len(names)-1 { @@ -367,7 +367,7 @@ market10 { } txt.print(" ") txt.print_ub(ship10.cargohold[ci]) - txt.chrout('\n') + txt.nl() } } @@ -604,7 +604,7 @@ galaxy10 { txt.print_uwhex(galaxy10.seed[1], true) txt.print("\ngalaxy10 seed2=") txt.print_uwhex(galaxy10.seed[2], true) - txt.chrout('\n') + txt.nl() } } @@ -889,9 +889,9 @@ planet10 { } else { txt.print("Human Colonials") } - txt.chrout('\n') + txt.nl() txt.print(soup()) - txt.chrout('\n') + txt.nl() } } diff --git a/examples/compilerperformance/perf2.p8 b/examples/compilerperformance/perf2.p8 index 0c2442864..6778c94e0 100644 --- a/examples/compilerperformance/perf2.p8 +++ b/examples/compilerperformance/perf2.p8 @@ -35,7 +35,7 @@ perf2 { util2.print_10s(ship2.cash) txt.print("\nCommand (?=help): ") ubyte num_chars = txt.input_chars(input) - txt.chrout('\n') + txt.nl() if num_chars { when input[0] { '?' -> { @@ -102,7 +102,7 @@ trader2 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() return } @@ -130,7 +130,7 @@ trader2 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() } } @@ -351,7 +351,7 @@ market2 { sub display() { ubyte ci - txt.chrout('\n') + txt.nl() planet2.print_name_uppercase() txt.print(" trade market2:\n COMMODITY / PRICE / AVAIL / IN HOLD\n") for ci in 0 to len(names)-1 { @@ -367,7 +367,7 @@ market2 { } txt.print(" ") txt.print_ub(ship2.cargohold[ci]) - txt.chrout('\n') + txt.nl() } } @@ -604,7 +604,7 @@ galaxy2 { txt.print_uwhex(galaxy2.seed[1], true) txt.print("\ngalaxy2 seed2=") txt.print_uwhex(galaxy2.seed[2], true) - txt.chrout('\n') + txt.nl() } } @@ -889,9 +889,9 @@ planet2 { } else { txt.print("Human Colonials") } - txt.chrout('\n') + txt.nl() txt.print(soup()) - txt.chrout('\n') + txt.nl() } } diff --git a/examples/compilerperformance/perf3.p8 b/examples/compilerperformance/perf3.p8 index 0688ac5ae..ebb90b838 100644 --- a/examples/compilerperformance/perf3.p8 +++ b/examples/compilerperformance/perf3.p8 @@ -35,7 +35,7 @@ perf3 { util3.print_10s(ship3.cash) txt.print("\nCommand (?=help): ") ubyte num_chars = txt.input_chars(input) - txt.chrout('\n') + txt.nl() if num_chars { when input[0] { '?' -> { @@ -102,7 +102,7 @@ trader3 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() return } @@ -130,7 +130,7 @@ trader3 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() } } @@ -351,7 +351,7 @@ market3 { sub display() { ubyte ci - txt.chrout('\n') + txt.nl() planet3.print_name_uppercase() txt.print(" trade market3:\n COMMODITY / PRICE / AVAIL / IN HOLD\n") for ci in 0 to len(names)-1 { @@ -367,7 +367,7 @@ market3 { } txt.print(" ") txt.print_ub(ship3.cargohold[ci]) - txt.chrout('\n') + txt.nl() } } @@ -604,7 +604,7 @@ galaxy3 { txt.print_uwhex(galaxy3.seed[1], true) txt.print("\ngalaxy3 seed2=") txt.print_uwhex(galaxy3.seed[2], true) - txt.chrout('\n') + txt.nl() } } @@ -889,9 +889,9 @@ planet3 { } else { txt.print("Human Colonials") } - txt.chrout('\n') + txt.nl() txt.print(soup()) - txt.chrout('\n') + txt.nl() } } diff --git a/examples/compilerperformance/perf4.p8 b/examples/compilerperformance/perf4.p8 index af37c2a72..2bfe81bc2 100644 --- a/examples/compilerperformance/perf4.p8 +++ b/examples/compilerperformance/perf4.p8 @@ -35,7 +35,7 @@ perf4 { util4.print_10s(ship4.cash) txt.print("\nCommand (?=help): ") ubyte num_chars = txt.input_chars(input) - txt.chrout('\n') + txt.nl() if num_chars { when input[0] { '?' -> { @@ -102,7 +102,7 @@ trader4 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() return } @@ -130,7 +130,7 @@ trader4 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() } } @@ -351,7 +351,7 @@ market4 { sub display() { ubyte ci - txt.chrout('\n') + txt.nl() planet4.print_name_uppercase() txt.print(" trade market4:\n COMMODITY / PRICE / AVAIL / IN HOLD\n") for ci in 0 to len(names)-1 { @@ -367,7 +367,7 @@ market4 { } txt.print(" ") txt.print_ub(ship4.cargohold[ci]) - txt.chrout('\n') + txt.nl() } } @@ -604,7 +604,7 @@ galaxy4 { txt.print_uwhex(galaxy4.seed[1], true) txt.print("\ngalaxy4 seed2=") txt.print_uwhex(galaxy4.seed[2], true) - txt.chrout('\n') + txt.nl() } } @@ -889,9 +889,9 @@ planet4 { } else { txt.print("Human Colonials") } - txt.chrout('\n') + txt.nl() txt.print(soup()) - txt.chrout('\n') + txt.nl() } } diff --git a/examples/compilerperformance/perf5.p8 b/examples/compilerperformance/perf5.p8 index 1bf8e5b29..2ea13de43 100644 --- a/examples/compilerperformance/perf5.p8 +++ b/examples/compilerperformance/perf5.p8 @@ -35,7 +35,7 @@ perf5 { util5.print_10s(ship5.cash) txt.print("\nCommand (?=help): ") ubyte num_chars = txt.input_chars(input) - txt.chrout('\n') + txt.nl() if num_chars { when input[0] { '?' -> { @@ -102,7 +102,7 @@ trader5 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() return } @@ -130,7 +130,7 @@ trader5 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() } } @@ -351,7 +351,7 @@ market5 { sub display() { ubyte ci - txt.chrout('\n') + txt.nl() planet5.print_name_uppercase() txt.print(" trade market5:\n COMMODITY / PRICE / AVAIL / IN HOLD\n") for ci in 0 to len(names)-1 { @@ -367,7 +367,7 @@ market5 { } txt.print(" ") txt.print_ub(ship5.cargohold[ci]) - txt.chrout('\n') + txt.nl() } } @@ -604,7 +604,7 @@ galaxy5 { txt.print_uwhex(galaxy5.seed[1], true) txt.print("\ngalaxy5 seed2=") txt.print_uwhex(galaxy5.seed[2], true) - txt.chrout('\n') + txt.nl() } } @@ -889,9 +889,9 @@ planet5 { } else { txt.print("Human Colonials") } - txt.chrout('\n') + txt.nl() txt.print(soup()) - txt.chrout('\n') + txt.nl() } } diff --git a/examples/compilerperformance/perf6.p8 b/examples/compilerperformance/perf6.p8 index 40606f09e..4417ef00e 100644 --- a/examples/compilerperformance/perf6.p8 +++ b/examples/compilerperformance/perf6.p8 @@ -35,7 +35,7 @@ perf6 { util6.print_10s(ship6.cash) txt.print("\nCommand (?=help): ") ubyte num_chars = txt.input_chars(input) - txt.chrout('\n') + txt.nl() if num_chars { when input[0] { '?' -> { @@ -102,7 +102,7 @@ trader6 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() return } @@ -130,7 +130,7 @@ trader6 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() } } @@ -351,7 +351,7 @@ market6 { sub display() { ubyte ci - txt.chrout('\n') + txt.nl() planet6.print_name_uppercase() txt.print(" trade market6:\n COMMODITY / PRICE / AVAIL / IN HOLD\n") for ci in 0 to len(names)-1 { @@ -367,7 +367,7 @@ market6 { } txt.print(" ") txt.print_ub(ship6.cargohold[ci]) - txt.chrout('\n') + txt.nl() } } @@ -604,7 +604,7 @@ galaxy6 { txt.print_uwhex(galaxy6.seed[1], true) txt.print("\ngalaxy6 seed2=") txt.print_uwhex(galaxy6.seed[2], true) - txt.chrout('\n') + txt.nl() } } @@ -889,9 +889,9 @@ planet6 { } else { txt.print("Human Colonials") } - txt.chrout('\n') + txt.nl() txt.print(soup()) - txt.chrout('\n') + txt.nl() } } diff --git a/examples/compilerperformance/perf7.p8 b/examples/compilerperformance/perf7.p8 index a3af93f2a..87482f91b 100644 --- a/examples/compilerperformance/perf7.p8 +++ b/examples/compilerperformance/perf7.p8 @@ -35,7 +35,7 @@ perf7 { util7.print_10s(ship7.cash) txt.print("\nCommand (?=help): ") ubyte num_chars = txt.input_chars(input) - txt.chrout('\n') + txt.nl() if num_chars { when input[0] { '?' -> { @@ -102,7 +102,7 @@ trader7 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() return } @@ -130,7 +130,7 @@ trader7 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() } } @@ -351,7 +351,7 @@ market7 { sub display() { ubyte ci - txt.chrout('\n') + txt.nl() planet7.print_name_uppercase() txt.print(" trade market7:\n COMMODITY / PRICE / AVAIL / IN HOLD\n") for ci in 0 to len(names)-1 { @@ -367,7 +367,7 @@ market7 { } txt.print(" ") txt.print_ub(ship7.cargohold[ci]) - txt.chrout('\n') + txt.nl() } } @@ -604,7 +604,7 @@ galaxy7 { txt.print_uwhex(galaxy7.seed[1], true) txt.print("\ngalaxy7 seed2=") txt.print_uwhex(galaxy7.seed[2], true) - txt.chrout('\n') + txt.nl() } } @@ -889,9 +889,9 @@ planet7 { } else { txt.print("Human Colonials") } - txt.chrout('\n') + txt.nl() txt.print(soup()) - txt.chrout('\n') + txt.nl() } } diff --git a/examples/compilerperformance/perf8.p8 b/examples/compilerperformance/perf8.p8 index c36ee8b47..cb3e592a6 100644 --- a/examples/compilerperformance/perf8.p8 +++ b/examples/compilerperformance/perf8.p8 @@ -35,7 +35,7 @@ perf8 { util8.print_10s(ship8.cash) txt.print("\nCommand (?=help): ") ubyte num_chars = txt.input_chars(input) - txt.chrout('\n') + txt.nl() if num_chars { when input[0] { '?' -> { @@ -102,7 +102,7 @@ trader8 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() return } @@ -130,7 +130,7 @@ trader8 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() } } @@ -351,7 +351,7 @@ market8 { sub display() { ubyte ci - txt.chrout('\n') + txt.nl() planet8.print_name_uppercase() txt.print(" trade market8:\n COMMODITY / PRICE / AVAIL / IN HOLD\n") for ci in 0 to len(names)-1 { @@ -367,7 +367,7 @@ market8 { } txt.print(" ") txt.print_ub(ship8.cargohold[ci]) - txt.chrout('\n') + txt.nl() } } @@ -604,7 +604,7 @@ galaxy8 { txt.print_uwhex(galaxy8.seed[1], true) txt.print("\ngalaxy8 seed2=") txt.print_uwhex(galaxy8.seed[2], true) - txt.chrout('\n') + txt.nl() } } @@ -889,9 +889,9 @@ planet8 { } else { txt.print("Human Colonials") } - txt.chrout('\n') + txt.nl() txt.print(soup()) - txt.chrout('\n') + txt.nl() } } diff --git a/examples/compilerperformance/perf9.p8 b/examples/compilerperformance/perf9.p8 index ce32ac8d2..6a478c4df 100644 --- a/examples/compilerperformance/perf9.p8 +++ b/examples/compilerperformance/perf9.p8 @@ -35,7 +35,7 @@ perf9 { util9.print_10s(ship9.cash) txt.print("\nCommand (?=help): ") ubyte num_chars = txt.input_chars(input) - txt.chrout('\n') + txt.nl() if num_chars { when input[0] { '?' -> { @@ -102,7 +102,7 @@ trader9 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() return } @@ -130,7 +130,7 @@ trader9 { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() } } @@ -351,7 +351,7 @@ market9 { sub display() { ubyte ci - txt.chrout('\n') + txt.nl() planet9.print_name_uppercase() txt.print(" trade market9:\n COMMODITY / PRICE / AVAIL / IN HOLD\n") for ci in 0 to len(names)-1 { @@ -367,7 +367,7 @@ market9 { } txt.print(" ") txt.print_ub(ship9.cargohold[ci]) - txt.chrout('\n') + txt.nl() } } @@ -604,7 +604,7 @@ galaxy9 { txt.print_uwhex(galaxy9.seed[1], true) txt.print("\ngalaxy9 seed2=") txt.print_uwhex(galaxy9.seed[2], true) - txt.chrout('\n') + txt.nl() } } @@ -889,9 +889,9 @@ planet9 { } else { txt.print("Human Colonials") } - txt.chrout('\n') + txt.nl() txt.print(soup()) - txt.chrout('\n') + txt.nl() } } diff --git a/examples/cx16/assembler/assem.p8 b/examples/cx16/assembler/assem.p8 index 9179b808e..b2afc4c4a 100644 --- a/examples/cx16/assembler/assem.p8 +++ b/examples/cx16/assembler/assem.p8 @@ -36,7 +36,7 @@ textparse { ; simulate user always having at least one space at the start input_line[0] = ' ' input_length = txt.input_chars(&input_line+1) - txt.chrout('\n') + txt.nl() if not input_length { txt.print("exit\n") @@ -109,12 +109,12 @@ textparse { if instr_ptr { ; txt.print("instr: ") ; txt.print(instr_ptr) -; txt.chrout('\n') +; txt.nl() ; if operand_ptr { ; txt.print("operand: ") ; txt.print(operand_ptr) -; txt.chrout('\n') +; txt.nl() ; } assemble_instruction(instr_ptr, operand_ptr) @@ -136,7 +136,7 @@ textparse { } ; txt.print("(debug:) addr.mode: ") ; txt.print_ub(addr_mode) -; txt.chrout('\n') +; txt.nl() txt.chrout(' ') txt.print_uwhex(program_counter, 1) txt.print(" ") @@ -147,7 +147,7 @@ textparse { emit(lsb(cx16.r0)) emit(msb(cx16.r0)) } - txt.chrout('\n') + txt.nl() } } else { txt.print("?instruction error\n") @@ -167,7 +167,7 @@ textparse { txt.print(symbolname_ptr) txt.chrout('=') txt.print_uwhex(value, true) - txt.chrout('\n') + txt.nl() } sub lowercase(uword st) { @@ -270,7 +270,7 @@ textparse { txt.print(optr) txt.print(" -> value: ") txt.print_uwhex(cx16.r0, true) - txt.chrout('\n') + txt.nl() } } @@ -322,7 +322,7 @@ textparse { txt.print(word_ptr) txt.print("] ") } - txt.chrout('\n') + txt.nl() } sub preprocess_assignment_spacing() { diff --git a/examples/cx16/assembler/benchmark-treematch.p8 b/examples/cx16/assembler/benchmark-treematch.p8 index a23c46cc3..5bbfbbccd 100644 --- a/examples/cx16/assembler/benchmark-treematch.p8 +++ b/examples/cx16/assembler/benchmark-treematch.p8 @@ -63,7 +63,7 @@ benchmark { if current_time<100 txt.chrout('0') txt.print_uw(current_time) - txt.chrout('\n') + txt.nl() } } diff --git a/examples/cx16/imageviewer/imageviewer.p8 b/examples/cx16/imageviewer/imageviewer.p8 index 3cfd7c1d9..91cd13d4c 100644 --- a/examples/cx16/imageviewer/imageviewer.p8 +++ b/examples/cx16/imageviewer/imageviewer.p8 @@ -53,7 +53,7 @@ main { sub attempt_load(uword filenameptr) { ;txt.print(">> ") ;txt.print(filenameptr) - ;txt.chrout('\n') + ;txt.nl() uword extension = filenameptr + rfind(filenameptr, '.') if string.compare(extension, ".iff")==0 { ;txt.print("loading ") diff --git a/examples/cx16/mandelbrot.p8 b/examples/cx16/mandelbrot.p8 index 371713710..429d49836 100644 --- a/examples/cx16/mandelbrot.p8 +++ b/examples/cx16/mandelbrot.p8 @@ -36,7 +36,7 @@ main { txt.color2(1, max_iter-iter) txt.chrout(' ') } - txt.chrout('\n') + txt.nl() } } } diff --git a/examples/dirlist.p8 b/examples/dirlist.p8 index 08736e47c..710d95670 100644 --- a/examples/dirlist.p8 +++ b/examples/dirlist.p8 @@ -8,7 +8,7 @@ main { sub start() { txt.print("showing the full directory of drive 8:\n") void diskio.directory(8) - txt.chrout('\n') + txt.nl() if diskio.lf_start_list(8, "cub*") { txt.print("\nfiles starting with 'cub':\n") diff --git a/examples/primes.p8 b/examples/primes.p8 index b48d4aac3..377a16819 100644 --- a/examples/primes.p8 +++ b/examples/primes.p8 @@ -23,10 +23,10 @@ main { txt.print(", ") amount++ } - txt.chrout('\n') + txt.nl() txt.print("number of primes (expected 54): ") txt.print_ub(amount) - txt.chrout('\n') + txt.nl() ; test_stack.test() } diff --git a/examples/sorting.p8 b/examples/sorting.p8 index c7d67d2e6..163f23a4a 100644 --- a/examples/sorting.p8 +++ b/examples/sorting.p8 @@ -45,26 +45,26 @@ main { txt.print_ub(ub) txt.chrout(',') } - txt.chrout('\n') + txt.nl() for uw in uwa { txt.print_uw(uw) txt.chrout(',') } - txt.chrout('\n') + txt.nl() for bb in ba { txt.print_b(bb) txt.chrout(',') } - txt.chrout('\n') + txt.nl() for ww in wa { txt.print_w(ww) txt.chrout(',') } - txt.chrout('\n') - txt.chrout('\n') + txt.nl() + txt.nl() } } } diff --git a/examples/test.p8 b/examples/test.p8 index c132cf7d6..13c4278b6 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -7,27 +7,8 @@ main { sub start() { - ubyte zero=0 - ubyte ub - - sys.clear_carry() - sys.clear_irqd() - ub = sys.read_flags() - txt.print_ubbin(ub,1) - txt.chrout('\n') - sys.clear_carry() - ub = zero+sys.read_flags()+zero - txt.print_ubbin(ub,1) - txt.chrout('\n') - sys.set_carry() - sys.set_irqd() - ub = sys.read_flags() - txt.print_ubbin(ub,1) - txt.chrout('\n') - sys.set_carry() - ub = zero+sys.read_flags()+zero - txt.print_ubbin(ub,1) - txt.chrout('\n') + txt.print("yo") + txt.nl() test_stack.test() @@ -140,10 +121,10 @@ main { txt.print_uwbin(value, true) txt.print(" #") txt.print_uw(cx16.r15) ; number of chars processedc - txt.chrout('\n') + txt.nl() } - txt.chrout('\n') + txt.nl() for strptr in hexstrings { value = conv.hex2uword(strptr) txt.print(strptr) @@ -153,10 +134,10 @@ main { txt.print_uwhex(value, true) txt.print(" #") txt.print_uw(cx16.r15) ; number of chars processedc - txt.chrout('\n') + txt.nl() } - txt.chrout('\n') + txt.nl() for strptr in posdecstrings { value = conv.str2uword(strptr) txt.print(strptr) @@ -164,10 +145,10 @@ main { txt.print_uw(value) txt.print(" #") txt.print_uw(cx16.r15) ; number of chars processedc - txt.chrout('\n') + txt.nl() } - txt.chrout('\n') + txt.nl() for strptr in worddecstrings { wvalue = conv.str2word(strptr) txt.print(strptr) @@ -175,34 +156,34 @@ main { txt.print_w(wvalue) txt.print(" #") txt.print_uw(cx16.r15) ; number of chars processedc - txt.chrout('\n') + txt.nl() } ; found = string.find("irmen de jong", ' ') ; txt.print_uwhex(found, 1) -; txt.chrout('\n') +; txt.nl() ; found = string.find(" irmen-de-jong", ' ') ; txt.print_uwhex(found, 1) -; txt.chrout('\n') +; txt.nl() ; found = string.find("irmen-de-jong ", ' ') ; txt.print_uwhex(found, 1) -; txt.chrout('\n') +; txt.nl() ; found = string.find("irmen-de-jong", ' ') ; txt.print_uwhex(found, 1) -; txt.chrout('\n') +; txt.nl() ; found = strfinds("irmen de jong", "de") ; txt.print_uwhex(found, 1) -; txt.chrout('\n') +; txt.nl() ; found = strfinds("irmen de jong", "irmen") ; txt.print_uwhex(found, 1) -; txt.chrout('\n') +; txt.nl() ; found = strfinds("irmen de jong", "jong") ; txt.print_uwhex(found, 1) -; txt.chrout('\n') +; txt.nl() ; found = strfinds("irmen de jong", "de456") ; txt.print_uwhex(found, 1) -; txt.chrout('\n') +; txt.nl() } } diff --git a/examples/textelite.p8 b/examples/textelite.p8 index c735574fc..67614f29e 100644 --- a/examples/textelite.p8 +++ b/examples/textelite.p8 @@ -35,7 +35,7 @@ main { util.print_10s(ship.cash) txt.print("\nCommand (?=help): ") ubyte num_chars = txt.input_chars(input) - txt.chrout('\n') + txt.nl() if num_chars { when input[0] { '?' -> { @@ -102,7 +102,7 @@ trader { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() return } @@ -130,7 +130,7 @@ trader { } else { txt.print("\ni/o error: ") txt.print(diskio.status(8)) - txt.chrout('\n') + txt.nl() } } @@ -351,7 +351,7 @@ market { sub display() { ubyte ci - txt.chrout('\n') + txt.nl() planet.print_name_uppercase() txt.print(" trade market:\n COMMODITY / PRICE / AVAIL / IN HOLD\n") for ci in 0 to len(names)-1 { @@ -367,7 +367,7 @@ market { } txt.print(" ") txt.print_ub(ship.cargohold[ci]) - txt.chrout('\n') + txt.nl() } } @@ -604,7 +604,7 @@ galaxy { txt.print_uwhex(galaxy.seed[1], true) txt.print("\ngalaxy seed2=") txt.print_uwhex(galaxy.seed[2], true) - txt.chrout('\n') + txt.nl() } } @@ -889,9 +889,9 @@ planet { } else { txt.print("Human Colonials") } - txt.chrout('\n') + txt.nl() txt.print(soup()) - txt.chrout('\n') + txt.nl() } }