Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!