-
-
Save awave1/80018776c5f6be39e1a907c900e70252 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ======================================================================== | |
; Name: Artem Golovin | |
; Email: [email protected] | |
; Course: COMP2655-001 | |
; Due Date: November 5th | |
; Assignment: 4 | |
; Instructor: ppospisil | |
; Source: A4.S | |
; Purpose: To gain experience with branching and to implement | |
; "snaking" column representation for sorted data | |
; Details: Linux "ls" command, by default displays output in columns | |
; whose format is snaking columns. The information is listed | |
; alphabetically in columns instead of rows. If the number of | |
; items is not evenly divisible by the number of columns, | |
; extra items are distributed in the columns from left to right | |
; | |
; Algorithm works this way: | |
; - Calculate longest string in the file | |
; - Read the file n times, where n is number of rows (incl. extra row) | |
; - Read word from the file | |
; - Skip first words if reading file not for the first time | |
; - Print the word | |
; - After new line is reached, skip words in file: | |
; - If there's an extra row: | |
; - Skip rows - 1 words for m columns that contain extra row | |
; - Skip rows - 2 words for the rest of the columns | |
; - Else: Skip rows - 1 words | |
; - Calculate # of whitespaces | |
; - Column Width - current string size | |
; | |
; Assumptions & Limitations: | |
; It is assumed that provided files are already sorted | |
; alphabetically | |
; | |
; Register Table: | |
; register usage | |
; ========================================================== | |
; d0 Mainly used to store character that was read | |
; from file and to output a charcter to screen | |
; d1 Used to store current file size. Represents | |
; EOF when reached 0 | |
; d2 | |
; d3 | |
; d4 | |
; d5 | |
; d6 | |
; d7 | |
; | |
; | |
; | |
;========================================================================= | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment