Posts

Showing posts from November, 2022

Project Plan (Part 2)

 After doing some research I have some ideas of how I am thinking to plan and the code. I will put some steps in point form in order to make it easy to follow. github:  https://github.com/a-martin94/Spo600 - As we need to run choose between three different versions at run time I will be making a few functions that are able to tell what system that it the code is about to run on. - the first function will be for sve2 implementation. I am still trying to find the way to approach the logic and reviewing more notes and open source documents.  - The second function will be for the sve implementation, and again trying to find best way to code this and what arguments to pass in. - The third will be for the sve/sve2 implementation again the same comments above. - Next I will need to make a resolver function that will have the logic to choose what implementation will be run depending on the machine its being executed on. I am looking into bit fields and how to properly use them in a function as

Project Plan

 I don't no why it would not show up (I just came back to blog more) Project Plan This is going to be a break down of my plan for SPO600 final project, for this project we are going to be doing a proof of concept to test i func procedures " The goal for this project is to produce a proof-of-concept tool that will take code that meets specific conditions and automatically build it with ifunc capability to select between multiple, autovectorized versions of a function, to take advantage of the best SIMD implementation available on the CPU on which the code is running. " (Chris Tyler) To test the solution some code has been provided  https://github.com/ctyler/spo600-fall2022-project-test-code For this task I am going to be using JSnode for the code and plan to write it on VS code or Atom. I am using these languages as I am familiar with that set up. We have some limitations to the project which are the following: This tool only operates on aarch64 systems There are three ta

Lab 5

Image
 For the lab we are tasked with mongering and making a prediction of the relative performance of each scaling algorithm. Using both aarch64 and x86 we first need to unpack the code using tar. I started with aarch64 first.

Lab 4 (x86)

Image
 For this lab we were tasked with doing the same loop problem from the aarch64. How ever me being the genius I am I tried to switch to the x86 well still on the Israel server not even thinking to switch to the Portugal one. So After just getting that sorted out I can now attempt to build the code.  Also unpacking the file was needed again as you can see here:  I have so far got it loop the hello world out but just need to change it to loop for the ascii message and print the number here is my code so far 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     $min,%r15           /* loop index */ loop:     /* ... body of the loop ... do something useful here ... */      movq    $len,%rdx                       /* message length */      movq    $msg,%rsi                       /* message loca

LAB4 (Aarch64)

Image
 For this lab we are tasked with editing some code provided by the prof Chris Tyler. We needed to create a loop in order for the word loop to be printed 30 times. This lab was extremly hard for me as I had to re learn a lot of the commands and it was very time consuming, but was cool to learn. For starters I did not know that to extract the package and to make files was confusing. One of the most time consuming parts was trying to run the code each time and debug it. 1. Review, build, and run the aarch64 assembly language programs. Take a look at the code using  objdump -d  objectfile  and compare it to the source code. First we had to extract the package  tar zxvf fileNameHere.tgz here is the source code provided for the aarch64 task For the aarch64 part of this lab we had to get the word "loop #" to loop ten times and show the count s it looped. This task was seemed easy but became very hard, trying to understand syntax and how the compiler worked. For a long time I was tr

LAB 3 PART 3

 Now that was a lot of code! as you can see I have had to separate the code into three posts. This program works by first executing two sub routines that are going to initialize the memory (init, loop)  which will set the game state and the loop is going to call the subroutines of the program and execute them in order before looping back and and repeating. I like the way this program is broken down into different sub routines like functions it makes it easier to follow. I Changed the controls from the original and also added a way to add a second value called SnakeLengthTwo it increased the size by double but the issue was that when it was added is that from where the last apple was that was eaten the tail value stays at that location in memory and the snake moves but just grows at a rapid rate. updateSnake:   ldx snakeLength   ldx snakeLengthTwo //this will make the snake tail stay at the same spot   dex   txa updateloop:   lda snakeHeadL,x   sta snakeBodyStart,x   dex   bpl updateloo

LAB 3 PART 2

 loop:   jsr readKeys   jsr checkCollision   jsr updateSnake   jsr drawApple   jsr drawSnake   jsr spinWheels   jmp loop readKeys:   lda sysLastKey   cmp #ASCII_i   beq upKey   cmp #ASCII_l   beq rightKey   cmp #ASCII_k   beq downKey   cmp #ASCII_j   beq leftKey   rts upKey:   lda #movingDown   bit snakeDirection   bne illegalMove   lda #movingUp   sta snakeDirection   rts rightKey:   lda #movingLeft   bit snakeDirection   bne illegalMove   lda #movingRight   sta snakeDirection   rts downKey:   lda #movingUp   bit snakeDirection   bne illegalMove   lda #movingDown   sta snakeDirection   rts leftKey:   lda #movingRight   bit snakeDirection   bne illegalMove   lda #movingLeft   sta snakeDirection   rts illegalMove:   rts checkCollision:   jsr checkAppleCollision   jsr checkSnakeCollision   rts checkAppleCollision:   lda appleL   cmp snakeHeadL   bne doneCheckingAppleCollision   lda appleH   cmp snakeHeadH   bne doneCheckingAppleCollision   ;eat apple   inc snakeLength   inc snakeLength

LAB 3 PART 1

 For this lab we were tasked with creating a simple game or using open source code and adding some of our own code to it. The lab is based on the 6502 assembler and is written in assembly language, for this task I found a classic game of snake that is written in assembly and it is a little complex but I was able to follow it and make a few changes.  Green highlight is my code and edits, Blue code is important to user input and movements Source material:  https://skilldrick.github.io/easy6502/#snake THE CODE ;  ___           _        __ ___  __ ___ ; / __|_ _  __ _| |_____ / /| __|/  \_  ) ; \__ \ ' \/ _` | / / -_) _ \__ \ () / / ; |___/_||_\__,_|_\_\___\___/___/\__/___| ; Change direction: W A S D define appleL         $00 ; screen location of apple, low byte define appleH         $01 ; screen location of apple, high byte define snakeHeadL     $10 ; screen location of snake head, low byte define snakeHeadH     $11 ; screen location of snake head, high byte define snakeBodyStart $1

Lab 2 part 2

Image
  Modifying the Code Change the code to fill the display with a different colour on each page (each "page" will be one-quarter of the bitmapped display). For this part of the Lab we were tasked to change the 4 pages to different colors. The way that i accomplished this was through research and finding and testing a command called "ASL" this means arithmetic shift left. Once this is set after the done the page bne it will shift the color in memory and print the even color. There is another way to perform this task by making individual for loops and changing the color value. I found this way to be easy and cool once understood.       lda #$00 ; set a pointer in memory location $40 to point to $0200 sta $40 ; ... low byte ($00) goes in address $40 lda #$02 sta $41 ; ... high byte ($02) goes into address $41 lda #$05 ; colour number ldy #$00 ; set index to 0 loop: sta ($40),y ; set pixel colour at the address (pointer)+Y iny ; incremen