immediate syntax

This commit is contained in:
~d6 2024-08-02 13:31:26 -04:00
parent 8b5854c43b
commit d6a02946cc
1 changed files with 7 additions and 1 deletions

View File

@ -120,7 +120,7 @@ The program counter (\fIpc\fP) is updated when \fIbool\fP is non-zero. When \fIx
.SS JSR
( x -- [pc+1*] )
Store the next address to execute before unconditionally updating the program counter (\fIpc\fP). This instruction is usually used to invoke subroutines, which use the \fBJMP2r\fP to return.
Store the next address to execute before unconditionally updating the program counter (\fIpc\fP). This instruction is usually used to invoke subroutines, which use the \fBJMP2r\fP to return. When \fIx\fP is a byte, it is treated as relative (\fBpc += x\fP) and when \fIx\fP is a short it is treated as absolute (\fBpc = x\fP).
.SS STH
( x -- [x] )
@ -241,6 +241,12 @@ The "immediate jump" instructions are produced by the assembler. They interpret
(The instruction pointer will be moved forward 2 bytes, past the relative address.)
These instructions are created by the assembler from special syntax:
\fB!dest\fP produces \fBJMI wx yz\fP
\fB?dest\fP produces \fBJCI wx yz\fP
\fBdest\fP produces \fBJSI wx yz\fP (assuming \fBdest\fP is not a macro or reserved)
.SS LIT, LIT2, LITr, and LIT2r
The "literal" instructions are used to push new data onto the stacks. They interpret the next 1-2 bytes of the ROM (\fIwx\fP, \fIwxyz\fP) as data and push it onto the corresponding stack: