projet_systeme/instructions.md
2021-05-09 19:55:27 +02:00

70 lines
2.1 KiB
Markdown

## Instructions generated by our compiler
# ADD @A @B @C
> Adds the values stored in B and C and stores the result in A
# SOU @A @B @C
> Substracts the values stored in B and C and stores the result in A
# MUL @A @B @C
> Multiplies the values stored in B and C and stores the result in A
# DIV @A @B @C
> Divides the values stored in B and C and stores the result in A
# COP @A @B
> Copies at address A the contents from at address B
# AFC @A #B
> Copies at address A the value B
# JMF @A #B
> If the value located at address A is equal to 0 jumps to instruction number B
# JMP #A
> Jumps to instruction number A
# EQ @A @B @C
> If values located at adresses B and C are equal, writes 1 at address A else writes 0
# NEQ @A @B @C
> If values located at addresses B and C are not equal, writes 1 at address A else writes 0
# LT @A @B @C
> If value located at address B is less than the one located at address C, writes 1 at address A else writes 0
# GT @A @B @C
> If value located at address B is greater than the one located at address C, writes 1 at address A else writes 0
#LTE @A @B @C
> If value located at address B is less than or equal to the one located at address C, writes 1 at address A else writes 0
# GTE @A @B @C
> If value located at address B is greater than or equal to the one located at address C, writes 1 at address A else writes 0
# AND @A @B @C
> If the values located at addresses B and C are both greater or equal to 1 writes 1 at address A, else writes 0
# OR @A @B @C
> If the values located at addresses B and C are both equal to 0 writes 0 at address A, else writes 1
# NOT @A @B
> If the value at address B is greater or equal to 1, writes 0 at address A else writes 1
# PRI @A
> Prints the content located at address A
# LEA @A @B
> Copies the value of the address B at A
# COP_LD @A @B
> Copies the value pointed by B at address A
# COP_STR @A @B
> Copies the value of B at the address pointed by A
# RET @A
> Stores the return value at A, changes the values of EBP and ESP
# CALL #A #B
> Saves the values of EBP and the return address, upadtes EBP to EBP + B and jumps to instruction number A