diff --git a/compiler/test/vm/TestCompilerVirtual.kt b/compiler/test/vm/TestCompilerVirtual.kt index 4b6834a0f..cbb2458d4 100644 --- a/compiler/test/vm/TestCompilerVirtual.kt +++ b/compiler/test/vm/TestCompilerVirtual.kt @@ -258,7 +258,7 @@ main { val virtfile = result.compilationOptions.outputDir.resolve(result.compilerAst.name + ".p8ir") val irSrc = virtfile.readText() irSrc.shouldContain("incm.b $2000") - irSrc.shouldNotContain("INLINEASM") + irSrc.shouldNotContain("") VmRunner().runProgram(irSrc) } diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 5b57b5e57..e51d9590f 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -2,6 +2,8 @@ TODO ==== +- get rid of memory mapped variables: treat them as syntactic sugar for a poke/peek to the symbol. + - add -nowarnunused, or %option ignore_unused (module and block scope), to suppress all warnings about unused symbols. Useful in libraries. put this in all library code, like %option no_symbol_prefixing, and get rid of the "trick" it uses currently to suppress unused symbol warnings for library modules. diff --git a/intermediate/src/prog8/intermediate/IRFileReader.kt b/intermediate/src/prog8/intermediate/IRFileReader.kt index f070b349a..fbd1f9c6e 100644 --- a/intermediate/src/prog8/intermediate/IRFileReader.kt +++ b/intermediate/src/prog8/intermediate/IRFileReader.kt @@ -354,7 +354,7 @@ class IRFileReader { when(reader.peek().asStartElement().name.localPart) { "SUB" -> block += parseSubroutine(reader) "ASMSUB" -> block += parseAsmSubroutine(reader) - "INLINEASM" -> block += parseInlineAssembly(reader) + "ASM" -> block += parseInlineAssembly(reader) "BYTES" -> block += parseBinaryBytes(reader) "CODE" -> { val chunk = parseCodeChunk(reader) @@ -387,7 +387,7 @@ class IRFileReader { when(reader.peek().asStartElement().name.localPart) { "CODE" -> sub += parseCodeChunk(reader) "BYTES" -> sub += parseBinaryBytes(reader) - "INLINEASM" -> sub += parseInlineAssembly(reader) + "ASM" -> sub += parseInlineAssembly(reader) else -> throw IRParseException("invalid line in SUB: ${reader.peek()}") } skipText(reader) @@ -479,7 +479,7 @@ class IRFileReader { private fun parseInlineAssembly(reader: XMLEventReader): IRInlineAsmChunk { skipText(reader) val start = reader.nextEvent().asStartElement() - require(start.name.localPart=="INLINEASM") { "missing INLINEASM" } + require(start.name.localPart=="ASM") { "missing ASM" } val label = start.attributes.asSequence().single { it.name.localPart == "LABEL" }.value.ifBlank { null } val isIr = start.attributes.asSequence().single { it.name.localPart == "IR" }.value.toBoolean() val text = readText(reader).trim() diff --git a/intermediate/src/prog8/intermediate/IRFileWriter.kt b/intermediate/src/prog8/intermediate/IRFileWriter.kt index ac923c6cf..9cd6255e5 100644 --- a/intermediate/src/prog8/intermediate/IRFileWriter.kt +++ b/intermediate/src/prog8/intermediate/IRFileWriter.kt @@ -168,7 +168,7 @@ class IRFileWriter(private val irProgram: IRProgram, outfileOverride: Path?) { } private fun writeInlineAsm(chunk: IRInlineAsmChunk) { - xml.writeStartElement("INLINEASM") + xml.writeStartElement("ASM") xml.writeAttribute("LABEL", chunk.label ?: "") xml.writeAttribute("IR", chunk.isIR.toString()) xml.writeCharacters("\n") diff --git a/intermediate/src/prog8/intermediate/IRProgram.kt b/intermediate/src/prog8/intermediate/IRProgram.kt index 65a2fce0b..7e243551a 100644 --- a/intermediate/src/prog8/intermediate/IRProgram.kt +++ b/intermediate/src/prog8/intermediate/IRProgram.kt @@ -18,12 +18,12 @@ PROGRAM: CODE-LINE (assignment to initialize a variable) ... BLOCK - INLINEASM - INLINEASM + ASM + ASM SUB PARAMS - INLINEASM - INLINEASM + ASM + ASM C (CODE) CODE-LINE (label, instruction, comment, inlinebinary) CODE-LINE @@ -36,10 +36,10 @@ PROGRAM: SUB ASMSUB PARAMS - INLINEASM + ASM ASMSUB PARAMS - INLINEASM + ASM ... BLOCK BLOCK diff --git a/intermediate/test/TestIRFileInOut.kt b/intermediate/test/TestIRFileInOut.kt index fada5c272..6e678912b 100644 --- a/intermediate/test/TestIRFileInOut.kt +++ b/intermediate/test/TestIRFileInOut.kt @@ -86,9 +86,9 @@ return uword sys.wait.jiffies - + loadm.w r0,sys.wait.jiffies - + return