In: Computer Science
1. Write a program that does the following. Write in Assembly Language program
Loads your student ID number into memory starting at location 0x2000 0100 a. DO NOT do any conversion on your ID number. If my ID number is 123456789, I should be able to read your ID in memory as 123456789 2. Loads the first six characters of your name, in ASSIC, in to memory right after your student ID. Total of 6 bytes. a. This means that you should NOT over write anything that you have already entered. 3. Load from memory location 0x0000 0000 into the registers a. R0 and R1 hold the 64 bits starting at 0x0000 0000 (Total of 2 Words, each of 32 bits) b. R2 holds the next byte (8 bits) data c. R3 holds the next half word (16 bits) d. R4 holds the next word (32 bits) 4. Use the debugger to test your program to make sure that it does what you think it does. Use Lab 1 to help you get started with this
Assembly Language program:
Loads your student ID number into memory starting at location 0x2000 0100 a. DO NOT do any conversion on your ID number. If my ID number is 123456789, I should be able to read your ID in memory as 123456789
2. Loads the first six characters of your name, in ASSIC, in to memory right after your student ID. Total of 6 bytes. a. This means that you should NOT over write anything that you have already entered.
3. Load from memory location 0x0000 0000 into the registers
a. R0 and R1 hold the 64 bits starting at 0x0000 0000 (Total of 2 Words, each of 32 bits)
b. R2 holds the next byte (8 bits) data
c. R3 holds the next half word (16 bits)
d. R4 holds the next word (32 bits)
push r0 ;Save r0 and r1
push r1 ; on the stack
mov r0, -1 ;Assign test values
mov r1, -2
mov r2, 0
mov r3, 0
push r0 ;Push r0 onto stack
push r1 ;Push r1 onto stack
pop r2 ;Pop r2 from stack
pop r3 ;Pop r3 from stack
pop r1 ;Restore saved r0 and r1
pop r0 ; Return values from stack