Additional programming hints for last assignment (reload for latest version) To load a large constant into a register, it's possible to use the macro: set 0x12345678, %o0 "0x" indicates that hexidecimal digits follow. --- The three C functions in vm6fh.c you will need to call from your assembly program are: printvmstate, useprog1 and useprog2. You don't need to call any of the other C functions. If you are unsure of whether your code is compatible with the C functions (in terms of register usage), look at the assembly code generated for the C functions by gcc: gcc -S -O2 vm6fh.c You are not allowed to add other C functions without permission. You're to write an assembly program! --- To help you get started, here's the initial portion of my solution. You should read it first and edit it to suit your needs. It may be better to not use the "masks" I define here - instead, use "set" directly as above. /* Project VM6Fh: A Virtual Machine Simulator Mapping of Sparc Registers to Virtual Machine Functions: SPARC VM6Fh %o0 instruction register (vir) %g5 instruction pointer (vpc) %g7 stack pointer (vsp) */ .global main .section ".data" /* data section */ .data .align 8 str1: .asciz "stack overflow error\n" .align 8 str2: .asciz "stack underflow error\n" .align 8 imask: .word 0x000000e0 /* 11100000 */ amask: .word 0x0000001f /* 00011111 */ mmask: .word 0x0000007f /* 01111111 */ .section ".bss" /* uninitialized data section */ .bss .align 8 vmcode: .skip 128 vmdata: .skip 128 vmstack: .skip 128 .section ".text" /* code section */ .text .align 8 main: ! implements fetch-decode-execute cycle call vminit ! function to initialize registers of virtual machine nop mov %g5,%o0 ! %g5 is vpc, initially set to vmcode by vminit call useprog2 ! load program 1 (in vm6fh.c) into vmcode nop ! fetch-decode-execute loop fde: call fetch nop call decode ! includes execution of decoded instruction nop ba fde nop ! ...