CSL_assignment_10.pdf

40‐126 : Computer Structure and Language Computer Engineering Department Sharif University of Technology Fall 2007 Distributed: 1386/10/1 Assignment #10 Due: 1386/10/9 Simulate a stack with 68000. The stack should be able to perform at least the following functions. Your code will have these five subroutines. Use A6 as the stack pointer. Having a main program as a test bench is optional. The Stack size is not defined and is up to you. ¾ PUSH_IN This subroutine pushes the value of D0.L into stack. Stack pointer will be changed by this routine. ¾ POP_OUT This subroutine pops the top value of the stack and returns it as a result into D0.L . The stack pointer will be changed by this routine. ¾ GET_TOP This subroutine returns the top value of the stack into D0.L . The stack pointer will not be changed by this routine. ¾ IS_EMPTY If the stack is empty, then this subroutine will write $FF in D1.B; otherwise, it will write $00 in D1.B . ¾ IS_FULL If the stack is full, then this subroutine will write $FF in D1.B; otherwise, it will write $00 in D1.B . For uploading your files, just rename the main code file (*.asm or *.X68) to your Student ID and then zip it; Like : 8512345678.zip