From edf9a500d3c54cc052ab27af7b694147812dee8b Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 21 Feb 2021 22:48:06 +0100 Subject: [PATCH] kernel -> kernal --- README.md | 2 +- compiler/res/prog8lib/c64/syslib.p8 | 2 +- compiler/res/prog8lib/c64/textio.p8 | 2 +- compiler/res/prog8lib/cx16/gfx2.p8 | 2 +- compiler/res/prog8lib/cx16/textio.p8 | 2 +- .../compiler/BeforeAsmGenerationAstChanger.kt | 2 +- .../astprocessing/AstVariousTransforms.kt | 2 +- .../target/c64/C64MachineDefinition.kt | 2 +- .../compiler/target/c64/codegen/AsmGen.kt | 4 ++-- docs/source/index.rst | 2 +- docs/source/libraries.rst | 2 +- docs/source/syntaxreference.rst | 4 ++-- docs/source/targetsystem.rst | 2 +- docs/source/technical.rst | 2 +- docs/source/todo.rst | 1 - examples/test.p8 | 19 ++++++++----------- 16 files changed, 24 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 71063e460..5ad001e64 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ What does Prog8 provide? - "c64": Commodore-64 (6510 CPU = almost a 6502) - "cx16": [CommanderX16](https://www.commanderx16.com) (65c02 CPU) -- If you only use standard kernel and prog8 library routines, it is possible to compile the *exact same program* for both machines (just change the compiler target flag)! +- If you only use standard kernal and prog8 library routines, it is possible to compile the *exact same program* for both machines (just change the compiler target flag)! diff --git a/compiler/res/prog8lib/c64/syslib.p8 b/compiler/res/prog8lib/c64/syslib.p8 index ed8a217d6..f6ad9f101 100644 --- a/compiler/res/prog8lib/c64/syslib.p8 +++ b/compiler/res/prog8lib/c64/syslib.p8 @@ -11,7 +11,7 @@ c64 { &ubyte TIME_HI = $a0 ; software jiffy clock, hi byte &ubyte TIME_MID = $a1 ; .. mid byte &ubyte TIME_LO = $a2 ; .. lo byte. Updated by IRQ every 1/60 sec - &ubyte STATUS = $90 ; kernel status variable for I/O + &ubyte STATUS = $90 ; kernal status variable for I/O &ubyte STKEY = $91 ; various keyboard statuses (updated by IRQ) &ubyte SFDX = $cb ; current key pressed (matrix value) (updated by IRQ) diff --git a/compiler/res/prog8lib/c64/textio.p8 b/compiler/res/prog8lib/c64/textio.p8 index 527099bb5..661403f8e 100644 --- a/compiler/res/prog8lib/c64/textio.p8 +++ b/compiler/res/prog8lib/c64/textio.p8 @@ -586,7 +586,7 @@ _colormod sta $ffff ; modified } asmsub plot (ubyte col @ Y, ubyte row @ A) clobbers(A) { - ; ---- safe wrapper around PLOT kernel routine, to save the X register. + ; ---- safe wrapper around PLOT kernal routine, to save the X register. %asm {{ stx P8ZP_SCRATCH_REG tax diff --git a/compiler/res/prog8lib/cx16/gfx2.p8 b/compiler/res/prog8lib/cx16/gfx2.p8 index b075a292b..12f3b4c8a 100644 --- a/compiler/res/prog8lib/cx16/gfx2.p8 +++ b/compiler/res/prog8lib/cx16/gfx2.p8 @@ -2,7 +2,7 @@ ; Bitmap pixel graphics routines for the CommanderX16 ; Custom routines to use the full-screen 640x480 and 320x240 screen modes. -; (These modes are not supported by the documented GRAPH_xxxx kernel routines) +; (These modes are not supported by the documented GRAPH_xxxx kernal routines) ; ; No text layer is currently shown, text can be drawn as part of the bitmap itself. ; Note: for similar graphics routines that also work on the C-64, use the "graphics" module instead. diff --git a/compiler/res/prog8lib/cx16/textio.p8 b/compiler/res/prog8lib/cx16/textio.p8 index 4018aa62a..8aee3a3f4 100644 --- a/compiler/res/prog8lib/cx16/textio.p8 +++ b/compiler/res/prog8lib/cx16/textio.p8 @@ -717,7 +717,7 @@ sub setcc2 (ubyte column, ubyte row, ubyte char, ubyte colors) { } asmsub plot (ubyte col @ Y, ubyte row @ A) clobbers(A) { - ; ---- safe wrapper around PLOT kernel routine, to save the X register. + ; ---- safe wrapper around PLOT kernal routine, to save the X register. %asm {{ phx tax diff --git a/compiler/src/prog8/compiler/BeforeAsmGenerationAstChanger.kt b/compiler/src/prog8/compiler/BeforeAsmGenerationAstChanger.kt index d7f9c6500..23e1585cc 100644 --- a/compiler/src/prog8/compiler/BeforeAsmGenerationAstChanger.kt +++ b/compiler/src/prog8/compiler/BeforeAsmGenerationAstChanger.kt @@ -107,7 +107,7 @@ internal class BeforeAsmGenerationAstChanger(val program: Program, val errors: I } - // add the implicit return statement at the end (if it's not there yet), but only if it's not a kernel routine. + // add the implicit return statement at the end (if it's not there yet), but only if it's not a kernal routine. // and if an assembly block doesn't contain a rts/rti, and some other situations. val mods = mutableListOf() val returnStmt = Return(null, subroutine.position) diff --git a/compiler/src/prog8/compiler/astprocessing/AstVariousTransforms.kt b/compiler/src/prog8/compiler/astprocessing/AstVariousTransforms.kt index e638b5823..f50e52874 100644 --- a/compiler/src/prog8/compiler/astprocessing/AstVariousTransforms.kt +++ b/compiler/src/prog8/compiler/astprocessing/AstVariousTransforms.kt @@ -32,7 +32,7 @@ internal class AstVariousTransforms(private val program: Program) : AstWalker() } override fun after(subroutine: Subroutine, parent: Node): Iterable { - // For non-kernel subroutines and non-asm parameters: + // For non-kernal subroutines and non-asm parameters: // inject subroutine params as local variables (if they're not there yet). val symbolsInSub = subroutine.allDefinedSymbols() val namesInSub = symbolsInSub.map{ it.first }.toSet() diff --git a/compiler/src/prog8/compiler/target/c64/C64MachineDefinition.kt b/compiler/src/prog8/compiler/target/c64/C64MachineDefinition.kt index 3467e6d72..ccb0530e7 100644 --- a/compiler/src/prog8/compiler/target/c64/C64MachineDefinition.kt +++ b/compiler/src/prog8/compiler/target/c64/C64MachineDefinition.kt @@ -102,7 +102,7 @@ internal object C64MachineDefinition: IMachineDefinition { 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0xff - // 0x90-0xfa is 'kernel work storage area' + // 0x90-0xfa is 'kernal work storage area' )) } diff --git a/compiler/src/prog8/compiler/target/c64/codegen/AsmGen.kt b/compiler/src/prog8/compiler/target/c64/codegen/AsmGen.kt index 81744a2ec..22f0e17d9 100644 --- a/compiler/src/prog8/compiler/target/c64/codegen/AsmGen.kt +++ b/compiler/src/prog8/compiler/target/c64/codegen/AsmGen.kt @@ -354,7 +354,7 @@ internal class AsmGen(private val program: Program, } private fun memdefs2asm(statements: List) { - out("\n; memdefs and kernel subroutines") + out("\n; memdefs and kernal subroutines") val memvars = statements.filterIsInstance().filter { it.type==VarDeclType.MEMORY || it.type==VarDeclType.CONST } for(m in memvars) { if(m.value is NumericLiteralValue) @@ -367,7 +367,7 @@ internal class AsmGen(private val program: Program, val addr = sub.asmAddress if(addr!=null) { if(sub.statements.isNotEmpty()) - throw AssemblyError("kernel subroutine cannot have statements") + throw AssemblyError("kernal subroutine cannot have statements") out(" ${sub.name} = ${addr.toHex()}") } } diff --git a/docs/source/index.rst b/docs/source/index.rst index 85bb744a9..fd983acce 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -57,7 +57,7 @@ Language features - High-level code optimizations, such as const-folding, expression and statement simplifications/rewriting. - Many built-in functions, such as ``sin``, ``cos``, ``rnd``, ``abs``, ``min``, ``max``, ``sqrt``, ``msb``, ``rol``, ``ror``, ``swap``, ``sort`` and ``reverse`` - Supports the sixteen 'virtual' 16-bit registers R0 .. R15 from the Commander X16, also on the C64. -- If you only use standard kernel and prog8 library routines, it is possible to compile the *exact same program* for both machines (just change the compiler target flag)! +- If you only use standard kernal and prog8 library routines, it is possible to compile the *exact same program* for both machines (just change the compiler target flag)! Code example diff --git a/docs/source/libraries.rst b/docs/source/libraries.rst index a538f1663..a66dcc2ae 100644 --- a/docs/source/libraries.rst +++ b/docs/source/libraries.rst @@ -182,7 +182,7 @@ Provides string manipulation routines. floats ------ -Provides definitions for the ROM/kernel subroutines and utility routines dealing with floating +Provides definitions for the ROM/kernal subroutines and utility routines dealing with floating point variables. This includes ``print_f``, the routine used to print floating point numbers. diff --git a/docs/source/syntaxreference.rst b/docs/source/syntaxreference.rst index d25bfea20..cc438df71 100644 --- a/docs/source/syntaxreference.rst +++ b/docs/source/syntaxreference.rst @@ -70,7 +70,7 @@ Directives It's not possible to return cleanly to BASIC when the program exits. The only choice is to perform a system reset. (A ``system_reset`` subroutine is available in the syslib to help you do this) - style ``floatsafe`` -- like the previous one but also reserves the addresses that - are required to perform floating point operations (from the BASIC kernel). No clean exit is possible. + are required to perform floating point operations (from the BASIC kernal). No clean exit is possible. - style ``basicsafe`` -- the most restricted mode; only use the handful 'free' addresses in the ZP, and don't touch change anything else. This allows full use of BASIC and KERNAL ROM routines including default IRQs during normal system operation. @@ -514,7 +514,7 @@ Multiple return values ^^^^^^^^^^^^^^^^^^^^^^ Normal subroutines can only return zero or one return values. However, the special ``asmsub`` routines (implemented in assembly code) or ``romsub`` routines -(referencing a routine in kernel ROM) can return more than one return value. +(referencing a routine in kernal ROM) can return more than one return value. For example a status in the carry bit and a number in A, or a 16-bit value in A/Y registers. It is not possible to process the results of a call to these kind of routines directly from the language, because only single value assignments are possible. diff --git a/docs/source/targetsystem.rst b/docs/source/targetsystem.rst index 6a5f9c795..8edaca714 100644 --- a/docs/source/targetsystem.rst +++ b/docs/source/targetsystem.rst @@ -17,7 +17,7 @@ Currently there are two machines that are supported as compiler target (selectab This chapter explains the relevant system details of these machines. .. hint:: - If you only use standard kernel and prog8 library routines, + If you only use standard kernal and prog8 library routines, it is possible to compile the *exact same program* for both machines (just change the compiler target flag)! diff --git a/docs/source/technical.rst b/docs/source/technical.rst index 2a597890b..eac1e4428 100644 --- a/docs/source/technical.rst +++ b/docs/source/technical.rst @@ -50,7 +50,7 @@ Calling the routine is just a simple JSR instruction, but the other two work lik ``asmsub`` routines ^^^^^^^^^^^^^^^^^^^ -These are usually declarations of kernel (ROM) routines or low-level assembly only routines, +These are usually declarations of kernal (ROM) routines or low-level assembly only routines, that have their arguments solely passed into specific registers. Sometimes even via a processor status flag such as the Carry flag. Return values also via designated registers. diff --git a/docs/source/todo.rst b/docs/source/todo.rst index b06803e8d..8d97c1f06 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -2,7 +2,6 @@ TODO ==== -- rename kernel -> kernal - add sound to the cx16 tehtriz - add const arrays and cost strings diff --git a/examples/test.p8 b/examples/test.p8 index 75c13bcbf..4c63fc0ff 100644 --- a/examples/test.p8 +++ b/examples/test.p8 @@ -7,11 +7,17 @@ main { ; $1F9C0 - $1F9FF PSG registers sub start() { - c64.set_rasterirq(&irq.irq, 100, true) + uword color=0 + repeat { + cx16.vpoke(1, $fa00+6*2, lsb(color)) + cx16.vpoke(1, $fa01+6*2, msb(color)) + color++ + } + ;c64.set_rasterirq(&irq.irq, 100, true) sys.wait(100) - c64.restore_irq() + ;c64.restore_irq() ; uword freq = 1181 ; cx16.vpoke(1, $f9c0, lsb(freq)) @@ -26,15 +32,6 @@ irq { uword counter = 0 sub irq() { - c64.EXTCOL++ - ubyte xx - repeat 20 { - xx++ - } - c64.EXTCOL-- - - @($0400) = lsb(counter) - @($0401) = msb(counter) counter++ }