Example: tourism industry

MARIE Assembly Language

MARIE Assembly LanguageTerminate the program7 HALTUse the value at X as the address to jump to CJUMPI XJump-and-Store: Store the PC at address X and jump to X+10 JNS XSubroutinecall and returnSkip the next instruction based on the condition, C:C = 00016: skip if AC is negative (b11b10 = 002)C = 40016: skip if the AC = 0 (b11b10 = 012)C = 80016: skip if the AC is positive (b11b10 = 102)8 SKIPCOND CUnconditional branch to X by loading the value of X into PC9 JUMP XBranchOutput the value in AC to the display6 OUTPUTI nput a value from the keyboard into AC5 INPUTI/O Store the contents of AC at address X2 STORE XLoad the contents of address X into AC1 LOAD XData TransferPut all zeros in the ACACLEARAdd Indirect: Use the value at X as the actual address of thedata operand to add to ACBADDI XSubtract the contents of address X from the AC4 SUBT XAdd the contents of address X to AC3 ADD XArithmeticDescriptionHexOpcodeMnemonicT ype ofInstructionsMARIEI nstructionFormatOpcode Address (or Condition) 15 12 11 10 0 Revised Figure Datapath in MARIEMAR IR PCInREGMBROutREG ACALU MemoryAddress01232 - 11216-bitsInputDeviceOutputDevice16 Assembly Language Example 1: RESULT = X + Y - Z AddressLabel Assembly LanguageMachine Language0 LOAD X100616

MARIE Assembly Language HALT 7 Terminate the program JUMPI X C Use the value at X as the address to jump to Subroutine JNS X 0 Jump-and-Store: Store the PC at address X and jump to X+1 call and return

Tags:

  Language, Assembly, Mirae, Marie assembly language

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of MARIE Assembly Language

1 MARIE Assembly LanguageTerminate the program7 HALTUse the value at X as the address to jump to CJUMPI XJump-and-Store: Store the PC at address X and jump to X+10 JNS XSubroutinecall and returnSkip the next instruction based on the condition, C:C = 00016: skip if AC is negative (b11b10 = 002)C = 40016: skip if the AC = 0 (b11b10 = 012)C = 80016: skip if the AC is positive (b11b10 = 102)8 SKIPCOND CUnconditional branch to X by loading the value of X into PC9 JUMP XBranchOutput the value in AC to the display6 OUTPUTI nput a value from the keyboard into AC5 INPUTI/O Store the contents of AC at address X2 STORE XLoad the contents of address X into AC1 LOAD XData TransferPut all zeros in the ACACLEARAdd Indirect: Use the value at X as the actual address of thedata operand to add to ACBADDI XSubtract the contents of address X from the AC4 SUBT XAdd the contents of address X to AC3 ADD XArithmeticDescriptionHexOpcodeMnemonicT ype ofInstructionsMARIEI nstructionFormatOpcode Address (or Condition) 15 12 11 10 0 Revised Figure Datapath in MARIEMAR IR PCInREGMBROutREG ACALU MemoryAddress01232 - 11216-bitsInputDeviceOutputDevice16 Assembly Language Example 1: RESULT = X + Y - Z AddressLabel Assembly LanguageMachine Language0 LOAD X1006161 ADD Y3007162 SUBT Z4008163 STORE RESULT2009164 OUTPUT6000165 HALT7000166X,DEC 10 000A167 Y, DEC 200014168Z,DEC 50005169 RESULT,DEC 0000016 MARIE Assembly Language Example 2: Print null terminated string to outputHLL:index = 0while str[index] !

2 = 0 do output str[index] index = index + 1end while000016 DEC 0 / NULL CHARNULL, 1F004416 DEC 68 / D1004C16 DEC 76 / L1D005216 DEC 82 / R1C004F16 DEC 79 / O1B005716 DEC 87 / W1A000D16 DEC 13 /carriage return19004F16 DEC 79 / O18004C16 DEC 76 / L17004C16 DEC 76 / L16004516 DEC 69 / E15004816 DEC 72 / HSTR,14001416 HEX 14 STR_BASE,13000016 HEX 0 ADDR,12000016 DEC 0 INDEX,11000116 DEC 1 ONE,10700016 HALTEND_WHILE,F900216 JUMP WHILEE201116 STORE INDEXD301016 ADD ONEC101116 LOAD INDEXB600016 OUTPUTDO,A900F16 JUMP END_WHILE9900A16 JUMP DO8840016 SKIPCOND 4007B01216 ADDI ADDR6A00016 CLEAR5201216 STORE ADDR4301116 ADD INDEX3101316 LOAD STR_BASEWHILE,2201116 STORE INDEX1A00016 CLEAR 0 Machine LanguageAssembly LanguageLabelAddress


Related search queries