v6.1
Assembly Language MONitor Definitiveultrararepremiumplus
Standard:
COMMAND (space or tab) ARGUMENT
LDA/EXPA:
EXPA.LENGTH (space or tab) ADDRESS
for example: LDA.8 to load 1 byte, EXPA.16 to export 2 bytes
# or $ is hex
& is decimal
! is binary
@ is pointer
Basic Looping Program
More Advanced Program
Adds to B until B and C are equal, then adds to C.
I'm still working on the BIOS, right now it only supports one-letter commands
Read from an address formatted in hex
Write to an address formatted in hex
>R 5FFC
034E
>W 5FFC F000
>R 5FFC
F000
Replace * with any of the following: A,B,C,F
Sets a register to a value
Loads a value from an address
Exports a register to an address
; After this operation the A register will hold 0
; After this operation, the A register will hold the value that is stored in address #4000
; After this operation #3000 will hold the value of A
; Since it's .16 it'll export a short, and both #3000 and #3001 will have changed
This register is what most of the commands operate on. Most of the commands have two versions, one that takes the value directly, and one that takes an address to look for the value. The @ operator will override which one is used
Math operations
Adds the argument to A
Subtracts the argument from A
Multiplies A by the argument
Divides A by the argument
Adds 1 to the argument address
Subtracts 1 from the argument address
Bit-wise operations
ANDs A against the argument
ORs A against the argument
Flips all of A's bits. Doesn't take an argument
XORs A against the argument
Logical Shift Left, shifts the bits of A left, including the sign bit
Logical Shift Right, shifts the bits of A right, including the sign bit
Arithmetic Shift Left, shifts the bits of A left, preserving the sign bit
Arithmetic Shift Right, shifts the bits of A right, preserving the sign bit
Comparing
Compares the argument to A through subtraction, you know if they are equal when A is 0 after this operation, the sign determines wether it's less than or greater
Use one of these functions to branch:
GOTO argument address if A is greater than 0
GOTO argument address if A is less than 0
GOTO argument address if A is equal to 0
GOTO argument address if A is not 0
GOTO argument address if A is greater than or equal to 0
GOTO argument address if A is less than or equal to 0
CALL argument address if A is greater than 0
CALL argument address if A is less than 0
CALL argument address if A is equal to 0
CALL argument address if A is not 0
CALL argument address if A is greater than or equal to 0
CALL argument address if A is less than or equal to 0
Labels are a way of naming a spot in the code, for referencing in a GOTO or CALL
Variables are labels that point at a number
It's reserving a spot in the code to store a variable, so use a GOTO to skip the variables in execution.
integers are 16 bits each, equivalent to a C short
@ is the pointer operator, where you place it decides whether it's the address-of or pointer-to operator
Macros create a substitution for some other text, which is replaced before being compiled
pushes the given value onto the stack
pops the top item from the stack, and places that value in the given address
Goes to argument address or label
A GOTO that waits for a RTN (aka pushes the current address onto the pointer stack)
Return (aka GOTO the current address on the pointer stack.)
No operation. Takes no argument