Assembly |
Computer Organization and Assembly Languages, Fall 2006
|
Jump to...
assignment #1
|
Assignment #2: TOY assemblyAssigned: 10/23/2006Due: 11/06/2006 11:59am DescriptionPlease note that the last toyasm update is Nov 1 2006 18:00. It is just a simple fix so that it works for both Linux and Windows. If you have already downloaded an early version, no need to update. If you want to update, you can either re-download or only download the updated files (windows [toyasm|toylink] or linux [toyasm|toylink])In this project, you will have a chance to practice TOY assembly programming by writing a program to count number of 0-bit in an array and display the count in BCD format. We provide assembler and linker for the TOY machine. You can download either Windows version or Linux version. TOY simulator can be downloaded from here. This file also contain a README file and several examples. The below is a summary for toyasm and toylink. * Comments begin with semicolons. * Only support decimal literals or hexadecimal literals. Hexadecimal literals must begin with 0x * Two assembly directives for data declararion DUP for declaring array DW for defining a number Examples: A DUP 5 ; define an array of five words B DW 10 ; declare a variable B, initialized with 10 * Labels must start with a letter. It can contain letters and numbers. No colons after labels. * It is case-insensitive. * Program will start from the first instruction that the assembler meets * Instructions 0 hlt 1 add RD, RS, ST 2 sub RD, RS, ST 3 and RD, RS, ST 4 xor RD, RS, ST 5 shl RD, RS, ST 6 shr RD, RS, ST 7 lda RD, addr 8 ld RD, addr 9 st RD, addr A ldi RD, RT B sti RD, RT C bz RD, addr D bp RD, addr E jr RD F jl RD, addr * To use assembler toyasm < reverse.asm > reverse.toy * To generate an object file toyasm -o < mul.asm > mul.obj * To link several object files together to make an executable file toylink multest.obj mul.obj stack.obj > multest.toy Program will start from the first instruction of the first object file. SpecificationThe program is divided into three parts.
SubmissionSubmission system is online here. |
|||||||