Commit e4ea178c authored by thomas@cs.ru.nl's avatar thomas@cs.ru.nl

Removed redundant help files, included short description of new heap operations

parent 7dd92d43
cc=A Condition Code (CC) encodes a result of a comparison. Four bits are used to encode the fact that the result of a cmp instruction is zero (Z), negative (N), a carry was needed (C) or overflow was detected (V).
conditioncode=@cc
sr=SR stands for Status Register. The status, called SR (status register) is not a real register but just an interpretation of the top of the stack. The top of the stack is used to store the condition codes resulting after a compare. Four bits, Z, N, C and V of the SR are used to encode the comparison result being zero, negative, carried and overflowed. These bits are only used by branches on conditions (i.e. beq).
statusbits=See SR.
prepostcondition=A kind of pre and postcondition is used to denote the effect of instructions. Behaviour is expressed using equations relating the state of the machine before (pre) execution of an instruction to the state after (post). Values of memory (M), registers (PC,SP,MP,RR) are subscripted with 'pre' resp 'post' to refer to the respective values before/after execution. No equation for a value means that the pre and post values are equal.
cmp_descr=Compare. Replaces 2 top stack values with the status of the comparison of those values. The status is put in SR. See also brf.
cmp_prepost=SP_post = SP_pre - 1, M_post[SP_post] = status(M_pre[SP_pre - 1] - M[SP_pre])
cmp_example=ldl -2 ; if x /= 1 then x = 1, ldc 1, cmp, beq skipLabel, ldc 1, stl -2, skipLabel: ...
beq_descr=Branch on condition. Notation bcc, where the cc in bcc can be eq (equal), ne (not equal), lt (less than), gt (greater than), le (less or equal) or ge (greater or equal). And some others not used often: pl (plus), mi (minus), cc (carry clear), cs (carry set), hi (high), ls (low or same).
beq_prepost=SP_post = SP_pre - 1, PC_post = PC_pre + M_pre[PC_pre + 1] + 2 (if condition matches)
beq_example=@cmp_example
bne_descr=@beq_descr
bne_prepost=@beq_prepost
bne_example=@beq_example
blt_descr=@beq_descr
blt_prepost=@beq_prepost
blt_example=@beq_example
ble_descr=@beq_descr
ble_prepost=@beq_prepost
ble_example=@beq_example
bgt_descr=@beq_descr
bgt_prepost=@beq_prepost
bgt_example=@beq_example
bge_descr=@beq_descr
bge_prepost=@beq_prepost
bge_example=@beq_example
\ No newline at end of file
......@@ -204,3 +204,18 @@ annote_descr=Annotate. A meta instruction (not producing code), annotating the s
annote_prepost=
annote_example=annote SP -1 0 red "Pushed constants" ; annote top 2 stack values
ldh_descr=Load from Heap. Pushes a value pointed to by the value at the top of the stack. The pointer value is offset by a constant offset.
ldh_prepost=
ldh_example=ldc 5, sth, ldh 0
ldmh_descr=Load Multiple from Heap. Pushes values pointed to by the value at the top of the stack. The pointer value is offset by a constant offset. Same as single load variant but the second inline parameter is size.
ldmh_prepost=
ldmh_example=ldc 1, ldc 2, ldc 3, stmh 3, ldmh 0 3
sth_descr=Store into Heap. Pops 1 value from the stack and stores it into the heap. Pushes the heap address of that value on the stack.
sth_prepost=
sth_example=ldc 5, sth
stmh_descr=Store Multiple into Heap. Pops values from the stack and stores it into the heap, retaining the order of the values. Same as single store variant but the inline parameter is size. Pushes the heap address of the last value on the stack.
stmh_prepost=
stmh_example=ldc 1, ldc 2, ldc 3, stmh 3
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment