220 likes | 496 Views
MARIE. MARIE. M achine A rchitecture that is R eally I ntuitive and E asy. MARIE Architecture. 16 bit computer Stored program 16 bit instructions 4K 16 bit words main memory 8KBytes total 4K = 2 2 * 2 10 = 2 12 = 12 bit addresses 16bit wide ALU Two’s complement representation.
E N D
MARIE • Machine Architecture that is Really Intuitive and Easy
MARIE Architecture • 16 bit computer • Stored program • 16 bit instructions • 4K 16 bit words main memory • 8KBytes total • 4K = 22 * 210 = 212 = 12 bit addresses • 16bit wide ALU • Two’s complement representation
Registers • Seven registers • MAR : Memory Address Register • Location to store/retrieve in mainmemory • 12 bits wide • MBR: Memory Buffer Register • Value on way to/from main memory • One input to ALU • 16 bits wide
Registers • Seven registers • AC : Memory Address Register • Stores one input for ALU • Stores output for ALU • 16 bits wide
Registers • Seven registers • IR : Instruction Register • Holds instruction being executed • 16 bits wide • PC : Program Counter • Address of next instruction to execute • 12 bits wide
Registers • Seven registers • InReg: Input Register • Input magically appears here • 8 bits wide (1 char) • OutReg: Output Register • Can be magically written to screen • 8 bits wide (1 char)
MARIE • Logical View:
Instruction Set Architecture • ISA : capabilities machine advertises • Machine instructions
MARIE Instructions • 9 Basic Instructions
MARIE Instructions • Instruction format • 4 bit opcode • 12 bit address (X) • No immediate instructions!!!
Instruction Samples • Load address 3 to AC
Instruction Samples • Add contents of memory location 13 to AC
Assembly • MARIE assembly • .mas files • /starts comment • Data specified as DEC/HEX • label, instruction
Assembler Addresses • Assembly produces • .map file "symbol table" • .lst file "listing" • .mex file "machine code"
Two pass • Assembler uses two passes • Pass1: • Convert instructions • Build symbol table
Two pass • Assembler uses two passes • Pass2: • Replace symbols with addresses
Using Skip • Absolute value
Skipcond • Skipcond– skips next instruction if… • AC matches conditionspecified by bits 11-10 If AC > 0 skip one instruction
Using Skip • Skipcond000:0000 0000 0000AC < 0 • Skipcond400:0100 0000 0000AC = 0 • Skipcond800:1000 0000 0000AC > 0
Pick Larger Number • Pick larger number using non 0 skipcond
Add Numbers • Post test loop: