Posts

Showing posts from October, 2024

Early stages of project

 I initially set up and built the current version of GCC on the aarch64-3 server that is provided. I started the build and it took at least an hour to fully compile. I limited the enabled languages to strictly C and C++ as I am most comfortable in these languages and to reduce the complexity of the project. The two files that control compilation passes are passes.cc, and tree-pass.h /* Description of GIMPLE pass.  */ class gimple_opt_pass : public opt_pass { protected:   gimple_opt_pass (const pass_data& data, gcc::context *ctxt)     : opt_pass (data, ctxt)   {   } }; /* Description of RTL pass.  */ class rtl_opt_pass : public opt_pass { protected:   rtl_opt_pass (const pass_data& data, gcc::context *ctxt)     : opt_pass (data, ctxt)   {   } } I did some reading and research on gimple passes and learned that they help optimize code and makes transformation at a high level before going to lower representations.

Lab 4 0-30

Image
 The way to increment the program to output up to 30 was actually much more complex than I initially thought as ascii conversion method that we used by adding 48 to the numbers after the value of 9 stops working as it will output a different value. My solution to this was to split up two digit values into tens and ones and convert each of them individually. 

Lab 4 in class portion

Image
This lab was very difficult for me, as the progress of this class feels very fast and if I'm not up to date I feel pretty left behind in the material and I wasn't of much help during this in class portion. My group mates completed a good portion of the code during the lab without much input from me. I took some time to review and study the material for the aarch 64 and x86 64 assemblers and when I took on this lab again I felt much more prepared and ready to do it. Below is my completed portion of the in class section of the assignment.  .text .globl _start min = 0                          /* starting value for the loop index; **note that this is a symbol (constant)**, not a variable */ max = 10                         /* loop exits when the index hits this number (loop condition is i<max) */ _start:     mov     x19, min loop:...

Lab 3 addition/subtraction calculator

Image
 In this blog post I will write and actually implement the subtracting portion of my previous blog post about lab 3. Below is the code for the subtraction and addition calculator in the 6502 emulator. ; Adding calculator with addition and subtraction capabilities ; ROM routine entry points define          SCINIT          $ff81 ; initialize/clear screen define          CHRIN           $ffcf ; input character from keyboard define          CHROUT          $ffd2 ; output character to screen define          SCREEN          $ffed ; get screen size define          PLOT            $fff0 ; get/set cursor coordinates ; zeropage variables define          PRINT_PTR       $10 define   ...