From c6a928b8b47575e780c57ec9b6447ccc9d125f28 Mon Sep 17 00:00:00 2001 From: Warren Toomey Date: Thu, 25 Feb 2016 07:52:26 +1000 Subject: [PATCH] More notes on the assembly syntax. --- misc/asm_syntax.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/misc/asm_syntax.txt b/misc/asm_syntax.txt index 5ecf3d0..6e9b072 100644 --- a/misc/asm_syntax.txt +++ b/misc/asm_syntax.txt @@ -5,7 +5,8 @@ Lines starting with " are comment lines . is the location counter, where the next code or constant will be placed .. is the relocation counter -t = 0 No idea on this yet +t = 0 Sets a built-in variable to this value without generating any machine code. + Variables so far are . .. and t. Not sure what t's purpose is yet. orig: is a label. It looks like labels can have dots in them. Dots seem to separate structures and fields, e.g. u.base @@ -14,22 +15,27 @@ orig: is a label. It looks like labels can have dots in them. jms copy; 10; u.rg+2; 6 Semicolons separate instructions and word expressions that follow the instruction - Some expressions are 0:0, not sure about this + Some expressions are 0:0, not sure about this. + Is it two 9-bit fields? No idea jmp 1f Jump back to the closest 1: label jmp 1b Jump forward to the closest 1: label -I'm not sure why some lines are indented differently to others e.g. +Some lines are indented differently to others e.g. jms betwen; o10000; o17762 jms error dac .+1 +I think this is to indicate the skip logic, but it plays no part in the assembly syntax. + -1 occurs instead of instructions, so it looks like the assembler allows literal constants at any time. String literals seem to be two characters decorated with < > characters, e.g. -"ab" is b. I'm guessing these are placed as pairs in one word. +"ab" is b. I'm guessing these are placed as pairs in one word. The syntax +is confusing, because I've also seen ; 040 ; ; ;