Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create MY OWN CODEBLUE ASSEMBLEY LANGUAGE PROGRAM to compete and beat against the following: CarpetBomb: ;carpet bombing - put 1's through memory Loop: COPY #1,@MemPtr
Create MY OWN CODEBLUE ASSEMBLEY LANGUAGE PROGRAM to compete and beat against the following:
CarpetBomb:
;carpet bombing - put 1's through memory Loop: COPY #1,@MemPtr ;put a 1 at location pointed to by MemPtr ADD #1,MemPtr ;increment the pointer JUMP Loop ;and do it again MemPtr: DATA 1
Simple Relocate:
; simple relocate program COPY #-9,Loc ;offset from Loc to start of relocate program COPY #50,NewLoc ;offset from NewLoc to relocate program to Loop: COPY @Loc,@NewLoc ; move an instruction ADD #1,Loc ;increment ptr to next instruction ADD #1,NewLoc ;increment ptr to next location to move it to JUMPZ Done,Loc ;if Loc is 0 we are done JUMP Loop ;otherwise move next Done: COPY #50,NewLoc ;reset beginning of relocated program JUMP @NewLoc ;and jump to it Loc: DATA 0 ;ptr to progam to move NewLoc: DATA 0 ;ptr to location to move to
Runner:
;simple progam that moves through memory copy 0,1
Simple Loop:
;sample program - simple loop Start: ADD #5, Temp ;dummy instruction inside loop ADD #-1,Counter ;decement loop counter JUMPZ NewLocation, Counter ;when counter = 0, done JUMP Start ;otherwise repeat loop Counter: DATA 10 ;loop counter Temp: DATA 0 NewLocation: COPY 0,1 ;dummy instruction after loop
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started