{"id":15060354,"url":"https://github.com/burhanahmed1/coal-computerorganizationassemblylanguage","last_synced_at":"2026-02-15T16:36:46.532Z","repository":{"id":246368624,"uuid":"820823437","full_name":"burhanahmed1/COAL-ComputerOrganizationAssemblyLanguage","owner":"burhanahmed1","description":"Practice of codes for Computer Organization and Assembly Language","archived":false,"fork":false,"pushed_at":"2024-06-27T10:12:20.000Z","size":4129,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T19:36:56.014Z","etag":null,"topics":["assembly-language","assembly-language-programming","coal","computer-organization-and-assembly-language","dosbox"],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/burhanahmed1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-27T08:48:11.000Z","updated_at":"2024-08-10T05:12:29.000Z","dependencies_parsed_at":"2024-06-27T16:21:27.777Z","dependency_job_id":"f6bac4cc-eabf-4678-bb23-428131412368","html_url":"https://github.com/burhanahmed1/COAL-ComputerOrganizationAssemblyLanguage","commit_stats":null,"previous_names":["burhanahmed1/coal-computerorganizationassemblylanguage"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burhanahmed1%2FCOAL-ComputerOrganizationAssemblyLanguage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burhanahmed1%2FCOAL-ComputerOrganizationAssemblyLanguage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burhanahmed1%2FCOAL-ComputerOrganizationAssemblyLanguage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burhanahmed1%2FCOAL-ComputerOrganizationAssemblyLanguage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/burhanahmed1","download_url":"https://codeload.github.com/burhanahmed1/COAL-ComputerOrganizationAssemblyLanguage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240271524,"owners_count":19774859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assembly-language","assembly-language-programming","coal","computer-organization-and-assembly-language","dosbox"],"created_at":"2024-09-24T22:57:22.198Z","updated_at":"2025-10-06T20:14:11.900Z","avatar_url":"https://github.com/burhanahmed1.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Computer Organization and Assembly Language**\n\n# Files Description\nThe practice files are from Task1 to Task26, and Acute Triangle, Right Triangle, Diamond, VowelCount, Xenzia and Xenzia1.\n\n## Task 1 :\nWrite an assembly language program which fulfills the following:\n1. Load 25h to Ax register\n2. Swap contents of Ax and Bx\n3. Load the contents of memory location [0x270] in Cx.\n4. Define an array of num = [ 12,25,10] and load the contents of array in Ax using index addressing. [hint: array is defined as: num: db 1, 2 at the end of code]\n\n## Task 2 :\n1. Write a program which adds five numbers using memory variables n1, n2, n3, n4, n5. Initialize the memory variables to 10, 20, 30, 40, 50. Make a new variable, sum, which stores the sum of all.\n2. Modify the program in part a using a single memory label, n, for inputs and result.\n\n## Task 3 :\nWrite a program which fulfills the following requirements:\n```\nAx = 200h\nBx=150h\nMemory location 250 =50h\nMemory Location 200= 25h\nArray = {1,2,7,5,10}\n```\nLoad Ax with contents of memory location 200 using indirect addressing\n\n## Task 4 :\nWrite a program which fulfills the following requirements:\n```\nAx = 200h\nBx=150h\nMemory location 250 =50h\nMemory Location 200= 25h\nArray = {1,2,7,5,10}\n```\nLoad Cx with contents of memory location 250 using direct addressing.\n\n## Task 5 :\nWrite a program which adds the contents of the following array using register + offset addressing. Array dw 111. 999, 888, 888, 11, 99, 88, 88, 1, 9, 8, 8\n\n## Task 6 :\nInitialize AX with last 4 digits of your roll number (for example, if your roll number is 16L-1105 then AX should be initialized with 1105).\n\n## Task 7 :\nModify the program in task 6 to swap two bits\n\n## Task 8 :\nModify your program in Task 6 and 7 to swap two nibbles\n\n## Task 9 :\nInitialize AX with last 4 digits of your roll number (for example, if your roll number is 16L-1105 then AX should be initialized with 1105). Store AX' in BX. Make a memory variable f, initialize it with 0 and compute\n```\nf = (A||B)\u0026\u0026(A XOR 0x1BCD)\n```\n|| is bitwise OR operation, \u0026\u0026 is bitwise AND operation whereas XOR is bitwise XOR operation.\n\n## Task 10 :\nInitialize AX with last 4 digits of your roll number (for example, if your roll number is 16L-1105 then AX should be initialized with 1105). Store AX' in BX. Make a 32-bit memory variable f, initialize it with 0 and compute\n```\nf = (A × B) + {A, B}\n```\n× is Multiplication operation, + is Addition operation whereas {A, B} concatenates 16-bit A and B to form 32-bit number.\n\n## Task 11 :\nDifferentiate between Near, Far and Short Jumps. Write your own assembly language programs and demonstrate how these jumps have been taken.\n\n## Task 12 :\nGiven any array of unsigned numbers nums, generate factorial of each number in nums and store in fac_num array.\n\ninitial values of array:\n```\nnums: dw 3,5,4,8,7\nfac_num: dw 0,0,0,0,0\n```\nafter running code\n```\nfac_num: dw 6,120,24,40320,5040\n```\n\n## Task 13 :\nDifference of two sets (S1-S2) is a set having elements of S1 which are NOT Present in S2, see following examples for detail. Your task is to write a subroutine in Assembly Language that finds Difference of two sets (S1-S2). Note that both the sets are sorted and have distinct elements only.\n\n## Task 14 :\nInitialize AX with last 4 digits of your roll number as Hexadecimal number (for example, if your roll number is 16L-4195 then AX should be initialized with 0x4195). Write a subroutine which receives AX as input and returns number of 1s in AX.\nn = binary_ones(Roll #)\n\nFor example, # of 1s in 0x 4195 is\n\nn = ones(0x4195) = ones(0100_0001_1001_0101) = 6\n\n## Task 15 :\nA number pyramid (we call it Al-Khwarizmi Pyramid). This pyramid is expanding based on the value of s, its size. Write a program which uses s = n + 5 (n from Activity 2) as size of Al-Khwarizmi Pyramid and returns the cumulative sum. For example, if n = 6 then s = 11, and program should return 506.\n\n## Task 16 :\nWrite a subroutine which uses nested loops for creating a delay of around 3-5 secs.\nNote: Do not use any special commands or interrupts for creating any delay.\n\n## Task 17 :\nSTOS Example – Clearing the Screen\n• LODS Example – String Printing\n• SCAS Example – String Length\n• MOVS Example – Screen Scrolling\n\n## Task 18 :\nUse the subroutines developed in Task 16 and Task 17 to create an animation (of Start or End Screen) which shows the following information about you (every message with delay) as shown\n``` txt\nName : Burhan Gujjar\nInstitute : FAST School of Computing\nBatch : 2022\nRoll # 7520\nEmail ID : l227520@lhr.nu.edu.pk\nAddress : Lahore,Pakistan\nFeatures : Punctual, Brave\n```\n\n\n## Task 19 :\nWrite a program that prints and prints the following messages: one message per keypress.\n``` txt\nHi- I am Burhan Gujjar\nI am a patriot\nI am from Fast\nMy Roll # is 22L-7520\n```\nExpected output after 4 key presses\n\n\n## Task 20 :\nYou need to draw 4 lines creating a diamond shape and satisfying the coordinates and increment or decrement as per requirement of the line.\n\n## Task 21 :\nYour task is to get two keystrokes using keyboard interrupt number 0x16 one after the other. On the first keystroke, regardless of which key is pressed, you should clear the screen. The following should be done on second keystroke:\n1. If you press ‘a’, your program should display “Hi, you pressed a”.\n2. If you press ‘b’, your program should display “Hi, you pressed b”.\n3.For any other case your program should display “Hi, you entered wrong credentials”.\n4. After two keystrokes, your program should terminate.\n\n## Task 22 :\nWrite a TSR takes name of the student and then shows it onto the screen according to given rules:\n\n• While left shift is pressed, the name should be displayed on screen.\n• If left shift is released, your screen should be cleared\n• For any other buttons, your code should not do anything\n\nScan Code (Left Shift Press): 0x2a\nScan Code (Right Shift Press): 0x36.\n\n## Task 23 :\nWrite a program to make an asterisk travel the border of the screen, from upper left to upper right to lower right to lower left and back to upper left indefinitely.\n\n## Task 24 :\nWrite a program taskOne that starts printing characters ‘*’ starting from top left corner of the screen moving to top right then to bottom right to the bottom left to top left in an infinite loop. Verify your program. Perform all the functionality in one function. Do not use function call inside taskOne.\n\n## Task 25 :\nWrite a subroutine reverses the contents of a given string. \n\nFor example, if it is provided the string\n\nString1 DB “I am Mr X”, ‘0’\n\nIt should return\n\nString2 DB “X rM ma I”, ‘0’\n\n## Task 26 :\nWrite a subroutine which copies contents of string1 into another string but without spaces and punctuation marks. For example, if it is provided the following string\n\nString1 DB “Mr. Ali, Usman, \u0026 Anwar! Doing what???? want to travel????”, ‘0’\n\nIt should return\n\nString2 DB “MrAliUsmanAnwarDoingwhatwanttotravel”, ‘0’\n\n## Acute Triangle :\nAssembly Language code for creating an Acute Angled Triangle.\n\n## Right Triangle :\nAssembly Language code for creating a Right Angled Triangle.\n\n## Diamond :\nAssembly Language code for creating a Diamond.\n\n## Vowel Count :\nAssembly Language code for counting the number of Vowels in a given string.\n\n## Xenzia :\nCode for Xenzia.\n\n## Xenzia1 :\nA different approach for Xenzia.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburhanahmed1%2Fcoal-computerorganizationassemblylanguage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fburhanahmed1%2Fcoal-computerorganizationassemblylanguage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburhanahmed1%2Fcoal-computerorganizationassemblylanguage/lists"}