editor
tutorials
tutorials
algorithms & data structures
help
challenges
pseudocode
sql
monthly
exam qs
questions
past papers
resources
tutorials
algorithms & data structures
slides
homework
past papers
data
grade thresholds
PSEUDOCODE
PRO
download
search
buy ($2)
contact
account
login/signup
my favourites
Cambridge Assembly Instruction Set
Machine Code;Opcode;Operand;Description 00000001;LDM;#n | Bn | &n;Immediate addressing. Load the number n to ACC. | LDM #15 | LDM B00001111 | LDM &0F 00000010;LDD;<address>;Direct addressing. Load the contents of the location at the given address to ACC | LDD 15 | LDD a 00000011;LDI;<address>;Indirect addressing. The address to be used is at the given address. Load the contents of this second address to ACC | LDI 15 | LDI a 00000100;LDX;<address>;Indexed addressing. Form the address from <address> + the contents of the index register. Copy the contents of this calculated address to ACC | LDX 15 | LDX a 00000101;LDR;#n | Bn | &n;Immediate addressing. Load the number to IX | LDR #15 | LDR B00001111 | LDR &0F 00000110;STO;<address>;Store the contents of ACC at the given address | STO 15 | STO a 00100011;STX;<address>;[🔴 Removed from 9618 Syllabus] | Indexed addressing. Form the address from <address> + the contents of the index register. Copy the contents from ACC to this calculated address | STX 15 | STX a 00100100;STI;<address>;[🔴 Removed from 9618 Syllabus] | Indirect addressing. The address to be used is at the given address. Store the contents of ACC at this second address | STI 15 | STI a 00000111;MOV;<register>;Move the contents of ACC to the given register (IX) | MOV IX 00001000 | 00001001;ADD;#n | Bn | &n | <address>;Add the number or contents of the given address to the ACC | ADD #15 | ADD B00001111 | ADD &0F | ADD 7 | ADD a 00001010 | 00001011;SUB;#n | Bn | &n | <address>;Subtract the number or contents of the given address to the ACC | SUB #15 | SUB B00001111 | SUB &0F | SUB 7 | SUB a 00001100;INC;ACC | IX;Add 1 to the contents of the given register | INC ACC | INC IX 00001101;DEC;ACC | IX;Subtract 1 from the contents of the given register | DEC ACC | DEC IX 00001110;IN;;Waits for user input and stores the character's Unicode value in the ACC | IN 00001111;OUT;;Output to the screen the character whose Unicode value is stored in ACC | OUT 00010000;JMP;<address>;Jump to the given address. | JMP 15 | JMP a 00010001;JPE;<address>;Jump if Equal. Following a compare instruction, jump to <address> if the compare was True. | JPE 15 | JPE a 00010010;JPN;<address>;Jump if Not Equal. Following a compare instruction, jump to <address> if the compare was False. | JPN 15 | JPN a 00010011;JGT;<address>;Jump if Greater Than. Following a compare instruction, jump to <address> if the value in the ACC was greater than the value being compared with. | JGT 15 | JGT a 00010100;JGE;<address>;Jump if Greater Than or Equal. Following a compare instruction, jump to <address> if the value in the ACC was greater than or equal to the value being compared with. | JGE 15 | JGE a 00010101;JLT;<address>;Jump if Less Than. Following a compare instruction, jump to <address> if the value in the ACC was less than the value being compared with. | JLT 15 | JLT a 00010110;JLE;<address>;Jump if Less Than or Equal. Following a compare instruction, jump to <address> if the value in the ACC was less than or equal to the value being compared with. | JLE 15 | JLE a 00010111 | 00011000;CMP;#n | Bn | &n | <address>;Compare the contents of ACC with the number given or contents of <address>. | CMP #15 | CMP B00001111 | CMP &0F | CMP 15 | CMP a 00011001;CMI;<address>;Indirect addressing. The address to be used is at the given address. Compare the contents of ACC with the contents of this second address. | CMI 15 | CMI a 00011010 | 00011011;AND;#n | Bn | &n | <address>;Bitwise AND operation of the contents of ACC with the given number or contents of <address> | AND #15 | AND B00001111 | AND &0F | AND 7 | AND a 00011100 | 00011101;OR;#n | Bn | &n | <address>;Bitwise OR operation of the contents of ACC with the given number or contents of <address> | OR #15 | OR B00001111 | OR &0F | OR 7 | OR a 00011110 | 00011111;XOR;#n | Bn | &n | <address>;Bitwise XOR operation of the contents of ACC with the given number or contents of <address> | XOR #15 | XOR B00001111 | XOR &0F | XOR 7 | XOR a 00100000;NOT;;Bitwise NOT operation of the contents of ACC | NOT 00100001;LSL;#n | Bn | &n;Bits in ACC are shifted logically n places to the left. Zeros are introduced on the right-hand end. | LSL #15 | LSL B00001111 | LSL &0F 00100010;LSR;#n | Bn | &n;Bits in ACC are shifted logically n places to the right. Zeros are introduced on the left-hand end. | LSR #15 | LSR B00001111 | LSR &0F 00000000;END;END;Exits the program by returning control back to the operating system | END