Posts

Showing posts with the label Lab5

SPO600 Lab5 64-Bit Assembly Language Lab Pt.2 ---x86_64 part

Image
In the part 2 of this Lab , I am going to experiment with assembler on the x86_64 platforms, similar to the Lab part 1. Task 1 Observe the difference between source code and the object file of the x86 assembly language  Source code (gas / AT&T ): Source code (nasm / Intel): object file (gas):  Task 2 -- modify a loop code in the x86 system to print loop for 6 times. Before that, I want to modifty the Makefile so that it can make file for the loop-gas.s Revised Makefile: code: BINARIES=hello-nasm hello-gas loop-gas all: ${BINARIES} AS_ARGS=-g hello-nasm: hello-nasm.s nasm -g -o hello-nasm.o -f elf64 hello-nasm.s ld -o hello-nasm hello-nasm.o hello-gas: hello-gas.s as ${AS_ARGS} -o hello-gas.o hello-gas.s ld -o hello-gas hello-gas.o loop-gas: loop-gas.s as ${AS_ARGS} -...

SPO600 Lab5 64-Bit Assembly Language Lab Pt.1 ---AArch64 part

Image
In this Lab, I am going to experiment with assembler on the x86_64 and aarch64 platforms. Task 1 Observe the difference between source code and the object file of the aarch64 assembly language  source file: object file: Task 2 -- A loop which print 6 "Loop" word  I have to modify a provided code block in the aarch64 system to print loop for 6 times.  modified code: .text .globl _start min = 0                          /* starting value for the loop index; **note that this is a symbol (constant)**, not a variable */ max = 6                         /* loop exits when the index hits this number (loop condition is i<max) */ _start:      mov     x19, min loop:      /* ... body of the loop ... do something useful here ... */      mov     x0, 1           /* file des...