CS552 Course Wiki: Fall 2020 | Main »
Using the Assembler |
|
Using the Assembler The In order to test your processor, you may need to assemble programs to be loaded into memory. To do this, there is a simple assembler provided. It will take source code that looks like the text in figure below and produces two files:
An example assembly program // An example assembly program slbi r1, 0 slbi r1, 0x55 slli r2, r1, 8 bnez r2, .LAB3 subi r2, r2, 1 .LAB3: halt An example object file: @0 9100 9155 a948 6a01 4a41 0000 An example binary listing: 0000 9100 slbi r1, 0 0001 9155 slbi r1, 0x55 0002 a948 slli r2, r1, 8 0003 6a01 bnez r2, .LAB3 0004 4a41 subi r2, r2, 1 0005 .LAB3: 0005 0000 halt Running the AssemblerThe assembler is located here:
That directory should have already been added to your Say you have a source file named
To simulate running the problem image on a golden simulator, see WISC-SP13 simulator-debugger. Assembly SyntaxAssembly programs are written using the semantics outlined in the WISC-SP13 ISA document. C style comments can be used (//). Static data and labels can be used as follows: Labels: beqz r0, .label1 .label1: <-- code here --> Static data: lbi r0, L.DataArea //load the lower half of datum slbi r0, U.DataArea //load the upper half of datum .DataArea data 0x1234 data 0x5678 |
Page last modified on October 03, 2020, visited times |