Sample Solution For TACKY Encoding And Assembler
The following is the
AIK
code for the sample solution.
Sample Solution For TACKY Encoding And Assembler
; Packable register operations .rop $.r0, .rop $.r1 := .this:5 .r0:3 .rop:5 .r1:3 .alias .rop a2r add and cvt div jr lf li mul not or r2a sh slt st sub xor ; Register and 8-bit immediate .ri8op $.r,.i8 := .this:5 .r:3 .i8:8 .alias .ri8op 17 cf8 ci8 jnz8 jz8 ; 8-bit immediate .i8op .i8 := .this:5 0:3 .i8:8 .alias .i8op 21 jp8 pre sys ; Macros cf $.r,.i16 := pre:5 0:3 (.i16>>8):8 cf8:5 .r:3 .i16:8 ci $.r,.i16 := pre:5 0:3 (.i16>>8):8 ci8:5 .r:3 .i16:8 jnz $.r,.i16 := pre:5 0:3 (.i16>>8):8 jnz8:5 .r:3 .i16:8 jp .i16 := pre:5 0:3 (.i16>>8):8 jp8:5 0:3 .i16:8 jz $.r,.i16 := pre:5 0:3 (.i16>>8):8 jz8:5 .r:3 .i16:8 ; Pre-defined register names .const r0 r1 r2 r3 r4 ra rv sp ; Segment defs, Harvard model (defaults were ok too) .segment .text 16 0x10000 0 .VMEM .segment .data 16 0x10000 0 .VMEM
Sample Assembly Language Input
.text .origin 0x0000 start: a2r $2, add $3 and $4, cvt $5 cf8 $6, here+0 ci8 $7, here+1 div $r0, jr $r1 jnz8 $r2, here+2 jp8 here+3 .data ; switch to data segment .origin 0x0080 here: .word 42 .text ; continue where we left off jz8 $r3, here+3 lf $r4, mul $ra li $rv, not $sp or $0, r2a $1 pre here+4 sh $2, slt $3 st $4, sub $5 sys here+5 xor $6, a2r $7
Advanced Computer Architecture.