Posts

Showing posts from February, 2022

SPO600 Lab 4

Image
In lab 4, I have to do a simple program to print numbers from 0 to 30 with X86_64 and AArch64 Assembly. It was my bad to forget the passphrase of my SSH key, so I could not log in to the server to do the lab. Fortunately, I found a package on Ubuntu APT-GET library that simulates AArch64 architecture, which is QEMU . The command to install it: sudo apt-get install qemu-user gcc-aarch64-linux-gnu. With the program, I was able to compile and run AArch64 Assembly without ARM hardware like a Raspberry Pi 4. Back to the main program, this is my code to print from 0 to 9: .text .globl     main min = 0 max = 10   main:         mov      x19, min                         loop:         adr      x1, msg         mov      x2, len         mov      x0, 1         mov      x8, 64         svc      0                 adr      x23, msg         add      x19, x19, 1         mov      x20, x19         add      x20, x20, '0'         strb     w20, [x23,0]       

SPO600 Lab 3

Image
  For lab 3, my task is to write a simple program using the output screen and to make use of math operation in 6502 assembly. Even though it is a simple program with basic tasks, it is not that easy to write the program in assembly language, while we can do this easily in modern language. Especially we just learned a whole new concept for several classes. Luckily, the lab says: I decided to write a subtraction calculator. Inspired by the adding calculator from my professor’s Github:  (https://github.com/ctyler/6502js-code/blob/master/adding-calculator.6502) I made an investigation to understand how the code works, so later I can modify it to become a subtraction calculator. With a limited amount of time learning 6502 assembly and not many resources on the internet, I could only understand the main part of the program, but it was enough for me to make an incomplete subtraction calculator. My input process is identical to the source code. The only difference is instead of adding tw