├── .DS_Store ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── Linux ├── addWithCarry │ ├── ADDWIT~1.EXE │ ├── ADDWIT~1.OBJ │ └── addWithCarry.asm ├── addWithoutCarry │ ├── ADDWIT~2.EXE │ ├── ADDWIT~2.OBJ │ └── addWithoutCarry.asm ├── affectingOverflow │ ├── AFFECT~1.EXE │ ├── AFFECT~1.OBJ │ └── affectingOverflow.asm ├── compareTwoNos │ ├── COMPAR~1.EXE │ ├── COMPAR~1.OBJ │ └── comparingTwoNos.asm ├── decrement │ ├── DECREM~1.EXE │ ├── DECREM~1.OBJ │ └── decrement.asm ├── emu8086.exe ├── equalsTenOrNot │ ├── EQUALS~1.EXE │ ├── EQUALS~1.OBJ │ └── equalsTenOrNot.asm ├── findInArray │ ├── FILEIN~1.EXE │ ├── FILEIN~1.OBJ │ └── fileInArray.asm ├── findOddFrequency │ ├── FINDOD~1.EXE │ ├── FINDOD~1.OBJ │ └── findOddFreq.asm ├── greatestInThree │ ├── GREATE~1.EXE │ ├── GREATE~1.OBJ │ └── greaterInThree.asm ├── increment │ ├── INCREM~1.EXE │ ├── INCREM~1.OBJ │ └── increment.asm ├── numberExists │ ├── NUMBER~1.EXE │ ├── NUMBER~1.OBJ │ └── numberExists.asm └── subtractWithoutBorrow │ ├── SUBTRA~1.EXE │ ├── SUBTRA~1.OBJ │ └── subtractWithoutBorrow.asm ├── MacOSX ├── .DS_Store ├── DEC │ ├── a.out │ ├── dec.asm │ └── dec.o ├── INC │ ├── a.out │ ├── inc.asm │ └── inc.o ├── add-with-carry │ ├── .DS_Store │ ├── a.out │ ├── awc.asm │ └── awc.o ├── add │ ├── .DS_Store │ ├── a.out │ ├── add.asm │ └── add.o ├── check │ ├── a.out │ ├── check.asm │ └── check.o ├── compare │ ├── comp │ ├── comp.asm │ └── comp.o ├── find-the-unique-number │ ├── unique │ ├── unique.asm │ └── unique.o ├── hello-world │ ├── hello │ ├── hello.asm │ ├── hello.lst │ └── hello.o ├── inc-five-times │ ├── five │ ├── five.asm │ └── five.o ├── largest-of-three │ ├── max │ ├── max.asm │ └── max.o ├── search │ ├── search │ ├── search.asm │ └── search.o ├── sub-with-carry │ └── swc.asm ├── sub │ ├── a.out │ ├── sub.asm │ └── sub.o ├── sum-array │ ├── sum │ ├── sum.asm │ └── sum.o ├── triangle │ ├── a.out │ ├── triangle.asm │ └── triangle.o └── trying │ ├── try │ ├── try.asm │ └── try.o └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributions 2 | 3 | If you would like to contribute to the programs then you can do so by first opening an issue, address the new program you would like to add or an improvement in the existing code. After your issue has been approved, you can send a PR. To send a PR fork this repository and send the PR. 4 | 5 | ## Setup 6 | 7 | ``` 8 | coming soon 9 | ``` 10 | 11 | ## License 12 | 13 | By contributing your code you agree to license your contribution under Apache 2.0 License. 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Linux/addWithCarry/ADDWIT~1.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/addWithCarry/ADDWIT~1.EXE -------------------------------------------------------------------------------- /Linux/addWithCarry/ADDWIT~1.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/addWithCarry/ADDWIT~1.OBJ -------------------------------------------------------------------------------- /Linux/addWithCarry/addWithCarry.asm: -------------------------------------------------------------------------------- 1 | DATA SEGMENT 2 | NUM1 DB ? 3 | NUM2 DB ? 4 | RESULT DB ? 5 | MSG1 DB 10,13,"ENTER FIRST NUMBER TO ADD : $" 6 | MSG2 DB 10,13,"ENTER SECOND NUMBER TO ADD : $" 7 | MSG3 DB 10,13,"RESULT OF ADDITION IS : $" 8 | DATA ENDS 9 | 10 | CODE SEGMENT 11 | ASSUME DS:DATA,CS:CODE 12 | START: 13 | 14 | MOV AX,DATA 15 | MOV DS,AX 16 | 17 | ;n1 input 18 | LEA DX,MSG1 ;Print msg 1 .. a string basically 19 | MOV AH,9 20 | INT 21H 21 | 22 | MOV AH,1 ; input a character 23 | INT 21H 24 | 25 | SUB AL,30H ; subtracting 30 from input 26 | MOV NUM1,AL 27 | 28 | ;n2 input 29 | LEA DX,MSG2 30 | MOV AH,9 31 | INT 21H 32 | 33 | MOV AH,1 34 | INT 21H 35 | 36 | SUB AL,30H 37 | MOV NUM2,AL 38 | 39 | ;add and move to result 40 | ADD AL,NUM1 41 | MOV RESULT,AL 42 | MOV AH,0 ;set higher nibble 0 because ah was 1 before. Try removing this line and you'll understand. 43 | 44 | AAA 45 | 46 | ADD AH,30H 47 | 48 | ADD AL,30H 49 | 50 | MOV BX,AX 51 | 52 | ; printing answer nibble by nibblw 53 | LEA DX,MSG3 54 | MOV AH,9 55 | INT 21H 56 | 57 | 58 | MOV AH,2 59 | MOV DL,BH 60 | INT 21H 61 | 62 | MOV AH,2 63 | MOV DL,BL 64 | INT 21H 65 | 66 | MOV AH,4CH 67 | INT 21H 68 | 69 | CODE ENDS 70 | END START 71 | -------------------------------------------------------------------------------- /Linux/addWithoutCarry/ADDWIT~2.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/addWithoutCarry/ADDWIT~2.EXE -------------------------------------------------------------------------------- /Linux/addWithoutCarry/ADDWIT~2.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/addWithoutCarry/ADDWIT~2.OBJ -------------------------------------------------------------------------------- /Linux/addWithoutCarry/addWithoutCarry.asm: -------------------------------------------------------------------------------- 1 | data SEGMENT 2 | n1 DB 03h 3 | n2 DB 07h 4 | data ENDS 5 | 6 | code SEGMENT 7 | assume CS:code, DS:data 8 | start: 9 | 10 | MOV AX,data 11 | MOV DS,AX 12 | 13 | MOV AL,n1 14 | ADD AL,n2 15 | 16 | ADD AL,30h ; decimal to ascii 17 | MOV DL,AL 18 | 19 | MOV AH,02h ; character output 20 | INT 21h 21 | 22 | MOV AH,4ch ;exit 23 | INT 21h 24 | 25 | code ENDS 26 | END start 27 | -------------------------------------------------------------------------------- /Linux/affectingOverflow/AFFECT~1.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/affectingOverflow/AFFECT~1.EXE -------------------------------------------------------------------------------- /Linux/affectingOverflow/AFFECT~1.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/affectingOverflow/AFFECT~1.OBJ -------------------------------------------------------------------------------- /Linux/affectingOverflow/affectingOverflow.asm: -------------------------------------------------------------------------------- 1 | data SEGMENT 2 | NUM1 DB ? 3 | NUM2 DB ? 4 | msg1 DB 10,13,'Input 1st number : $' 5 | msg2 DB 10,13,'Input 2nd number : $' 6 | caff DB 10,13,'Carry flag =1 i.e. affected.$' 7 | cnotaff DB 10,13,'Carry flag not affected. $' 8 | oaff DB 10,13,'overflow flag =1 i.e. affected.$' 9 | onotaff DB 10,13,'overflow not affected.$' 10 | data ENDS 11 | 12 | code SEGMENT 13 | assume CS:code,DS:data 14 | 15 | start: 16 | MOV AX,data 17 | MOV DS,AX 18 | ; MOV AL,a 19 | ; MOV BL,b 20 | 21 | LEA DX,msg1 22 | MOV AH,9 23 | INT 21H 24 | 25 | MOV AH,1 26 | INT 21H 27 | 28 | MOV NUM1,AL 29 | 30 | LEA DX,msg2 31 | MOV AH,9 32 | INT 21H 33 | 34 | MOV AH,1 35 | INT 21H 36 | 37 | MOV NUM2,AL 38 | 39 | MOV AL,NUM1 40 | SUB AL,NUM2 41 | 42 | ; SUB AL,BL 43 | JO oa 44 | JNO ona 45 | oa: 46 | MOV AH,09h 47 | LEA DX,oaff 48 | INT 21h 49 | JC ca 50 | JNC cna 51 | ona: 52 | MOV AH,09h 53 | LEA DX,onotaff 54 | INT 21h 55 | JC ca 56 | JNC cna 57 | 58 | ca: 59 | MOV AH,09h 60 | LEA DX,caff 61 | INT 21h 62 | JMP endit 63 | 64 | cna: 65 | MOV AH,09h 66 | LEA DX,cnotaff 67 | INT 21h 68 | 69 | endit: 70 | MOV AH,4ch 71 | INT 21h 72 | 73 | code ENDS 74 | END start 75 | -------------------------------------------------------------------------------- /Linux/compareTwoNos/COMPAR~1.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/compareTwoNos/COMPAR~1.EXE -------------------------------------------------------------------------------- /Linux/compareTwoNos/COMPAR~1.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/compareTwoNos/COMPAR~1.OBJ -------------------------------------------------------------------------------- /Linux/compareTwoNos/comparingTwoNos.asm: -------------------------------------------------------------------------------- 1 | data SEGMENT 2 | NUM1 DB ? 3 | NUM2 DB ? 4 | msg1 DB 10,13,'Input number 1 : $' 5 | msg2 DB 10,13,'Input number 2 : $' 6 | equal DB 10,13,'Equal : $ ' 7 | greater DB 10,13,'Greater : $' 8 | smaller DB 10,13,'Smaller : $' 9 | 10 | data ENDS 11 | 12 | code SEGMENT 13 | assume CS:code,DS:data 14 | 15 | start: 16 | MOV AX,data 17 | MOV DS,AX 18 | 19 | LEA DX,msg1 20 | MOV AH,9 21 | INT 21H 22 | 23 | MOV AH,1 24 | INT 21H 25 | 26 | SUB AL,30H 27 | MOV NUM1,AL 28 | 29 | LEA DX,msg2 30 | MOV AH,9 31 | INT 21H 32 | 33 | MOV AH,1 34 | INT 21H 35 | 36 | SUB AL,30H 37 | MOV NUM2,AL 38 | 39 | CMP AL,NUM1 40 | JE isEqual 41 | JG isGreater 42 | 43 | isSmaller: 44 | LEA DX,smaller 45 | MOV AH,9 46 | INT 21H 47 | JMP endit 48 | 49 | isEqual: 50 | LEA DX,equal 51 | MOV AH,9 52 | INT 21H 53 | JMP endit 54 | 55 | isGreater: 56 | LEA DX,greater 57 | MOV AH,9 58 | INT 21H 59 | JMP endit 60 | 61 | endit: 62 | MOV AH,4ch 63 | INT 21h 64 | 65 | code ENDS 66 | END start 67 | -------------------------------------------------------------------------------- /Linux/decrement/DECREM~1.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/decrement/DECREM~1.EXE -------------------------------------------------------------------------------- /Linux/decrement/DECREM~1.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/decrement/DECREM~1.OBJ -------------------------------------------------------------------------------- /Linux/decrement/decrement.asm: -------------------------------------------------------------------------------- 1 | data SEGMENT 2 | n1 DB 08h 3 | data ENDS 4 | 5 | code SEGMENT 6 | assume CS:code, DS:data 7 | start: 8 | 9 | MOV AX,data 10 | MOV DS,AX 11 | 12 | MOV CX,05h 13 | MOV AL,n1 14 | 15 | l1: 16 | 17 | DEC AL 18 | LOOP l1 19 | 20 | ADD AL,30h ; decimal to ascii 21 | MOV DL,AL 22 | 23 | MOV AH,02h ; character output 24 | INT 21h 25 | 26 | MOV AH,4ch ;exit 27 | INT 21h 28 | 29 | code ENDS 30 | END start 31 | -------------------------------------------------------------------------------- /Linux/emu8086.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/emu8086.exe -------------------------------------------------------------------------------- /Linux/equalsTenOrNot/EQUALS~1.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/equalsTenOrNot/EQUALS~1.EXE -------------------------------------------------------------------------------- /Linux/equalsTenOrNot/EQUALS~1.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/equalsTenOrNot/EQUALS~1.OBJ -------------------------------------------------------------------------------- /Linux/equalsTenOrNot/equalsTenOrNot.asm: -------------------------------------------------------------------------------- 1 | data SEGMENT 2 | NUM1 DB ? 3 | NUM2 DB ? 4 | msg1 DB 10,13,'Input number : $' 5 | equal DB 10,13,'Equal to 10 : $ ' 6 | greater DB 10,13,'Greater than 10 : $' 7 | smaller DB 10,13,'Smaller than 10 : $' 8 | 9 | data ENDS 10 | 11 | code SEGMENT 12 | assume CS:code,DS:data 13 | 14 | start: 15 | MOV AX,data 16 | MOV DS,AX 17 | 18 | LEA DX,msg1 19 | MOV AH,9 20 | INT 21H 21 | 22 | MOV AH,1 23 | INT 21H 24 | 25 | SUB AL,30H 26 | 27 | CMP AL,10H 28 | JE isEqual 29 | JG isGreater 30 | 31 | isSmaller: 32 | LEA DX,smaller 33 | MOV AH,9 34 | INT 21H 35 | JMP endit 36 | 37 | isEqual: 38 | LEA DX,equal 39 | MOV AH,9 40 | INT 21H 41 | JMP endit 42 | 43 | isGreater: 44 | LEA DX,greater 45 | MOV AH,9 46 | INT 21H 47 | JMP endit 48 | 49 | endit: 50 | MOV AH,4ch 51 | INT 21h 52 | 53 | code ENDS 54 | END start 55 | -------------------------------------------------------------------------------- /Linux/findInArray/FILEIN~1.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/findInArray/FILEIN~1.EXE -------------------------------------------------------------------------------- /Linux/findInArray/FILEIN~1.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/findInArray/FILEIN~1.OBJ -------------------------------------------------------------------------------- /Linux/findInArray/fileInArray.asm: -------------------------------------------------------------------------------- 1 | DATA SEGMENT 2 | MSG1 DB 10,13,'CHARACTER FOUND :) $' 3 | MSG2 DB 10,13,'CHARACTER NOT FOUND :($' 4 | MSG3 DB 10,13,'ENTER NUMBERS (PRESS ENTER TO HALT): $' 5 | MSG4 DB 10,13,'ENTER THE NUMBER TO BE SEARCHED : $' 6 | NEW DB 10,13,'$' 7 | INST DB 10 DUP(0) 8 | DATA ENDS 9 | 10 | CODE SEGMENT 11 | ASSUME CS:CODE,DS:DATA 12 | 13 | START: 14 | MOV AX,DATA 15 | MOV DS,AX 16 | LEA DX,MSG3 17 | MOV AH,09H 18 | INT 21H 19 | 20 | MOV BX,00 21 | 22 | UP: 23 | MOV AH,01H 24 | INT 21H 25 | CMP AL,0DH 26 | JE DOWN 27 | MOV [INST+BX],AL 28 | INC BX 29 | JMP UP 30 | 31 | DOWN: 32 | LEA DX,NEW 33 | MOV AH,09H 34 | INT 21H 35 | LEA DX,MSG4 36 | MOV AH,09H 37 | INT 21H 38 | MOV AH,01H 39 | INT 21H 40 | MOV CX,BX 41 | MOV DI,0 42 | 43 | UP1: 44 | CMP AL,[INST+DI] 45 | JE DOWN1 46 | INC DI 47 | LOOP UP1 48 | LEA DX,MSG2 49 | MOV AH,09H 50 | INT 21H 51 | JMP FINISH 52 | 53 | DOWN1: 54 | LEA DX,MSG1 55 | MOV AH,09H 56 | INT 21H 57 | 58 | FINISH: 59 | INT 3 60 | 61 | CODE ENDS 62 | END START 63 | -------------------------------------------------------------------------------- /Linux/findOddFrequency/FINDOD~1.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/findOddFrequency/FINDOD~1.EXE -------------------------------------------------------------------------------- /Linux/findOddFrequency/FINDOD~1.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/findOddFrequency/FINDOD~1.OBJ -------------------------------------------------------------------------------- /Linux/findOddFrequency/findOddFreq.asm: -------------------------------------------------------------------------------- 1 | data SEGMENT 2 | ARR DB 1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5 3 | data ENDS 4 | 5 | code SEGMENT 6 | ASSUME CS:code,DS:data 7 | 8 | START: 9 | MOV AX,data 10 | MOV DS,AX 11 | 12 | LEA SI,ARR 13 | MOV AL,0 14 | MOV BL,0 15 | MOV CL,25 16 | 17 | XORING: 18 | MOV BL,ARR[SI] 19 | XOR AL,BL 20 | INC SI 21 | 22 | LOOP XORING 23 | 24 | MOV AL,BL 25 | 26 | ADD AL,30h 27 | MOV DL,AL 28 | MOV AH,02h 29 | INT 21h 30 | 31 | MOV AH,4ch 32 | INT 21h 33 | 34 | code ENDS 35 | END START 36 | -------------------------------------------------------------------------------- /Linux/greatestInThree/GREATE~1.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/greatestInThree/GREATE~1.EXE -------------------------------------------------------------------------------- /Linux/greatestInThree/GREATE~1.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/greatestInThree/GREATE~1.OBJ -------------------------------------------------------------------------------- /Linux/greatestInThree/greaterInThree.asm: -------------------------------------------------------------------------------- 1 | data SEGMENT 2 | NUM1 DB ? 3 | NUM2 DB ? 4 | NUM3 DB ? 5 | msg1 DB 10,13,'Input number 1 : $' 6 | msg2 DB 10,13,'Input number 2 : $' 7 | msg3 DB 10,13,'Input number 3 : $' 8 | 9 | order DB 10,13,'Order is : $ ' 10 | 11 | data ENDS 12 | 13 | code SEGMENT 14 | assume CS:code,DS:data 15 | 16 | start: 17 | MOV AX,data 18 | MOV DS,AX 19 | 20 | LEA DX,msg1 21 | MOV AH,9 22 | INT 21H 23 | 24 | MOV AH,1 25 | INT 21H 26 | 27 | SUB AL,30H 28 | MOV NUM1,AL 29 | 30 | LEA DX,msg2 31 | MOV AH,9 32 | INT 21H 33 | 34 | MOV AH,1 35 | INT 21H 36 | 37 | SUB AL,30H 38 | MOV NUM2,AL 39 | 40 | LEA DX,msg3 41 | MOV AH,9 42 | INT 21H 43 | 44 | MOV AH,1 45 | INT 21H 46 | 47 | SUB AL,30H 48 | MOV NUM3,AL 49 | 50 | MOV AL,NUM1 51 | CMP AL,NUM2 52 | JG isGreater12 53 | 54 | MOV AL,NUM3 55 | CMP AL,NUM2 56 | JG print3 57 | JMP print2 58 | 59 | isGreater12: 60 | MOV AL,NUM1 61 | CMP AL,NUM3 62 | JG print1 63 | JMP print3 64 | 65 | LEA DX,order 66 | MOV AH,9 67 | INT 21H 68 | 69 | print1: 70 | MOV DL,NUM1 71 | ADD DL,30H 72 | MOV AH,2 73 | INT 21H 74 | JMP endit 75 | 76 | print2: 77 | MOV DL,NUM2 78 | ADD DL,30H 79 | MOV AH,2 80 | INT 21H 81 | JMP endit 82 | 83 | print3: 84 | MOV DL,NUM3 85 | ADD DL,30H 86 | MOV AH,2 87 | INT 21H 88 | JMP endit 89 | 90 | endit: 91 | MOV AH,4ch 92 | INT 21h 93 | 94 | code ENDS 95 | END start 96 | -------------------------------------------------------------------------------- /Linux/increment/INCREM~1.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/increment/INCREM~1.EXE -------------------------------------------------------------------------------- /Linux/increment/INCREM~1.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/increment/INCREM~1.OBJ -------------------------------------------------------------------------------- /Linux/increment/increment.asm: -------------------------------------------------------------------------------- 1 | data SEGMENT 2 | n1 DB 03h 3 | data ENDS 4 | 5 | code SEGMENT 6 | assume CS:code, DS:data 7 | start: 8 | 9 | MOV AX,data 10 | MOV DS,AX 11 | 12 | MOV CX,05h 13 | MOV AL,n1 14 | 15 | l1: 16 | 17 | INC AL 18 | LOOP l1 19 | 20 | ADD AL,30h ; decimal to ascii 21 | MOV DL,AL 22 | 23 | MOV AH,02h ; character output 24 | INT 21h 25 | 26 | MOV AH,4ch ;exit 27 | INT 21h 28 | 29 | code ENDS 30 | END start 31 | -------------------------------------------------------------------------------- /Linux/numberExists/NUMBER~1.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/numberExists/NUMBER~1.EXE -------------------------------------------------------------------------------- /Linux/numberExists/NUMBER~1.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/numberExists/NUMBER~1.OBJ -------------------------------------------------------------------------------- /Linux/numberExists/numberExists.asm: -------------------------------------------------------------------------------- 1 | DATA SEGMENT 2 | MSG1 DB 10,13,'CHARACTER FOUND :) $' 3 | MSG2 DB 10,13,'CHARACTER NOT FOUND :($' 4 | MSG3 DB 10,13,'ENTER 10 NUMBERS : $' 5 | MSG4 DB 10,13,'ENTER THE NUMBER TO BE SEARCHED : $' 6 | NEW DB 10,13,'$' 7 | INST DB 10 DUP(0) 8 | DATA ENDS 9 | 10 | CODE SEGMENT 11 | ASSUME CS:CODE,DS:DATA 12 | 13 | START: 14 | MOV AX,DATA 15 | MOV DS,AX 16 | LEA DX,MSG3 17 | 18 | MOV AH,09H 19 | INT 21H 20 | 21 | MOV BX,00 22 | 23 | UP: 24 | MOV AH,01H 25 | INT 21H 26 | CMP AL,0DH 27 | JE DOWN 28 | MOV [INST+BX],AL 29 | INC BX 30 | JMP UP 31 | 32 | DOWN:LEA DX,NEW 33 | MOV AH,09H 34 | INT 21H 35 | LEA DX,MSG4 36 | MOV AH,09H 37 | INT 21H 38 | MOV AH,01H 39 | INT 21H 40 | MOV CX,BX 41 | MOV DI,0 42 | 43 | UP1: 44 | CMP AL,[INST+DI] 45 | JE DOWN1 46 | INC DI 47 | LOOP UP1 48 | LEA DX,MSG2 49 | MOV AH,09H 50 | INT 21H 51 | JMP FINISH 52 | 53 | DOWN1: 54 | LEA DX,MSG1 55 | MOV AH,09H 56 | INT 21H 57 | 58 | FINISH: 59 | INT 3 60 | 61 | CODE ENDS 62 | END START 63 | END 64 | -------------------------------------------------------------------------------- /Linux/subtractWithoutBorrow/SUBTRA~1.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/subtractWithoutBorrow/SUBTRA~1.EXE -------------------------------------------------------------------------------- /Linux/subtractWithoutBorrow/SUBTRA~1.OBJ: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/Linux/subtractWithoutBorrow/SUBTRA~1.OBJ -------------------------------------------------------------------------------- /Linux/subtractWithoutBorrow/subtractWithoutBorrow.asm: -------------------------------------------------------------------------------- 1 | DATA SEGMENT 2 | NUM1 DB ? 3 | NUM2 DB ? 4 | RESULT DB ? 5 | MSG1 DB 10,13,"ENTER GREATER NUMBER TO SUBTRACT : $" 6 | MSG2 DB 10,13,"ENTER SMALLER NUMBER TO SUBTRACT : $" 7 | MSG3 DB 10,13,"RESULT OF ADDITION IS : $" 8 | DATA ENDS 9 | 10 | CODE SEGMENT 11 | ASSUME DS:DATA,CS:CODE 12 | START: 13 | 14 | MOV AX,DATA 15 | MOV DS,AX 16 | 17 | ;n1 input 18 | LEA DX,MSG1 ;Print msg 1 .. a string basically 19 | MOV AH,9 20 | INT 21H 21 | 22 | MOV AH,1 ; input a character 23 | INT 21H 24 | 25 | SUB AL,30H ; subtracting 30 from input 26 | MOV NUM1,AL 27 | 28 | ;n2 input 29 | LEA DX,MSG2 30 | MOV AH,9 31 | INT 21H 32 | 33 | MOV AH,1 34 | INT 21H 35 | 36 | SUB AL,30H 37 | MOV NUM2,AL 38 | 39 | MOV AL,NUM1 40 | ;add and move to result 41 | SUB AL,NUM2 42 | MOV RESULT,AL 43 | MOV AH,0 ;set higher nibble 0 because ah was 1 before. Try removing this line and you'll understand. 44 | 45 | AAA 46 | 47 | ADD AH,30H 48 | 49 | ADD AL,30H 50 | 51 | MOV BX,AX 52 | 53 | ; printing answer nibble by nibble 54 | LEA DX,MSG3 55 | MOV AH,9 56 | INT 21H 57 | 58 | 59 | MOV AH,2 60 | MOV DL,BH 61 | INT 21H 62 | 63 | MOV AH,2 64 | MOV DL,BL 65 | INT 21H 66 | 67 | MOV AH,4CH 68 | INT 21H 69 | 70 | CODE ENDS 71 | END START 72 | -------------------------------------------------------------------------------- /MacOSX/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/.DS_Store -------------------------------------------------------------------------------- /MacOSX/DEC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/DEC/a.out -------------------------------------------------------------------------------- /MacOSX/DEC/dec.asm: -------------------------------------------------------------------------------- 1 | global start 2 | section .text 3 | start: 4 | mov rdx, output ; rdx holds address of next byte to write 5 | mov r8, '0' ; keep track of decrements 6 | mov r9, '5' ; number to be decremented stored 7 | line: 8 | 9 | dec r9 ; decrement number 10 | cmp r9, r8 ; is number equal to decrement num? 11 | jne line ; keep decrementing 12 | mov [rdx], r9 ; write number to output 13 | 14 | done: 15 | mov rax, 0x02000004 ; system call for write 16 | mov rdi, 1 ; file handle 1 is stdout 17 | mov rsi, output ; address of string to output 18 | mov rdx, 1 ; number of bytes 19 | syscall ; invoke operating system to do the write 20 | mov rax, 0x02000001 ; system call for exit 21 | xor rdi, rdi ; exit code 0 22 | syscall ; invoke operating system to exit 23 | 24 | section .bss 25 | output: resq 1 26 | 27 | 28 | ; Run the increase program 29 | ; nasm -fmacho64 dec.asm && ld dec.o && ./a.out 30 | -------------------------------------------------------------------------------- /MacOSX/DEC/dec.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/DEC/dec.o -------------------------------------------------------------------------------- /MacOSX/INC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/INC/a.out -------------------------------------------------------------------------------- /MacOSX/INC/inc.asm: -------------------------------------------------------------------------------- 1 | global start 2 | section .text 3 | start: 4 | mov rdx, output ; rdx holds address of next byte to write 5 | mov r8, '5' ; keep track of increments 6 | mov r9, '0' ; number to be incremented stored 7 | line: 8 | 9 | inc r9 ; increment number 10 | cmp r9, r8 ; is number equal to increment num? 11 | jne line ; keep incrementing 12 | mov [rdx], r9 ; write number to output 13 | 14 | done: 15 | mov rax, 0x02000004 ; system call for write 16 | mov rdi, 1 ; file handle 1 is stdout 17 | mov rsi, output ; address of string to output 18 | mov rdx, 1 ; number of bytes 19 | syscall ; invoke operating system to do the write 20 | mov rax, 0x02000001 ; system call for exit 21 | xor rdi, rdi ; exit code 0 22 | syscall ; invoke operating system to exit 23 | 24 | section .bss 25 | output: resq 1 26 | 27 | 28 | ; Run the increase program 29 | ; nasm -fmacho64 inc.asm && ld inc.o && ./a.out 30 | -------------------------------------------------------------------------------- /MacOSX/INC/inc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/INC/inc.o -------------------------------------------------------------------------------- /MacOSX/add-with-carry/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/add-with-carry/.DS_Store -------------------------------------------------------------------------------- /MacOSX/add-with-carry/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/add-with-carry/a.out -------------------------------------------------------------------------------- /MacOSX/add-with-carry/awc.asm: -------------------------------------------------------------------------------- 1 | section .data 2 | hello db "The answer is %d", 0x0a, 0x00 3 | 4 | section .text 5 | ;default rel 6 | 7 | global _main 8 | extern _printf, _exit 9 | 10 | _main: 11 | push ebp 12 | mov ebp, esp ; Set up stack frame 13 | mov eax, 40 14 | mov ebx, 2255 15 | add ebx, eax 16 | sub esp, 8 ; 16-byte align stack + room for parameters passed 17 | ; to functions we call 18 | 19 | mov dword[esp+4], ebx ; Second parameter at esp+4 20 | mov dword[esp], hello ; First parameter at esp+0 21 | call _printf 22 | 23 | xor eax, eax ; Return value = 0 24 | mov esp, ebp 25 | pop ebp ; Remove stack frame 26 | ret ; We linked with C library that calls _main 27 | ; after initialization. We can do a RET to 28 | ; return back to the C runtime code that will 29 | ; exit the program and return the value in EAX 30 | ; We can do this instead of calling _exit 31 | 32 | 33 | ;/usr/bin/nasm -f macho awc.asm -o awc.o && ld -macosx_version_min 10.8 -no_pie -arch i386 -o awc awc.o -lc 34 | -------------------------------------------------------------------------------- /MacOSX/add-with-carry/awc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/add-with-carry/awc.o -------------------------------------------------------------------------------- /MacOSX/add/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/add/.DS_Store -------------------------------------------------------------------------------- /MacOSX/add/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/add/a.out -------------------------------------------------------------------------------- /MacOSX/add/add.asm: -------------------------------------------------------------------------------- 1 | global start 2 | section .text 3 | start: 4 | mov rdx, output ; rdx holds address of next byte to write 5 | mov r8, '5' ; first number 6 | sub r8, '0' 7 | mov r9, '1' ; second number 8 | sub r9, '0' 9 | add r9, r8 ; add the two numbers 10 | add r9, '0' 11 | mov [rdx], r9 ; write number to output 12 | 13 | done: 14 | mov rax, 0x02000004 ; system call for write 15 | mov rdi, 1 ; file handle 1 is stdout 16 | mov rsi, output ; address of string to output 17 | mov rdx, 1 ; number of bytes 18 | syscall ; invoke operating system to do the write 19 | mov rax, 0x02000001 ; system call for exit 20 | xor rdi, rdi ; exit code 0 21 | syscall ; invoke operating system to exit 22 | 23 | section .bss 24 | output: resq 1 25 | 26 | 27 | ; Run the increase program 28 | ; nasm -fmacho64 add.asm && ld add.o && ./a.out 29 | -------------------------------------------------------------------------------- /MacOSX/add/add.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/add/add.o -------------------------------------------------------------------------------- /MacOSX/check/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/check/a.out -------------------------------------------------------------------------------- /MacOSX/check/check.asm: -------------------------------------------------------------------------------- 1 | global start 2 | section .text 3 | start: 4 | mov rdx, output ; rdx holds address of next byte to write 5 | mov r8, '6' ; store 10 6 | mov r9, '5' ; number to be compared 7 | cmp r9, r8 ; is number equal to increment num? 8 | jnz notEqual 9 | mov r9, '1' 10 | mov [rdx], r9 ; write number to output 11 | jmp done 12 | notEqual: mov r9, '0' 13 | mov [rdx], r9 14 | done: 15 | mov rax, 0x02000004 ; system call for write 16 | mov rdi, 1 ; file handle 1 is stdout 17 | mov rsi, output ; address of string to output 18 | mov rdx, 1 ; number of bytes 19 | syscall ; invoke operating system to do the write 20 | mov rax, 0x02000001 ; system call for exit 21 | xor rdi, rdi ; exit code 0 22 | syscall ; invoke operating system to exit 23 | 24 | section .bss 25 | output: resq 1 26 | 27 | 28 | ; Run the check program 29 | ; nasm -fmacho64 check.asm && ld check.o && ./a.out 30 | -------------------------------------------------------------------------------- /MacOSX/check/check.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/check/check.o -------------------------------------------------------------------------------- /MacOSX/compare/comp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/compare/comp -------------------------------------------------------------------------------- /MacOSX/compare/comp.asm: -------------------------------------------------------------------------------- 1 | section .text 2 | global _main ;must be declared for linker (ld) 3 | extern _printf, _exit 4 | 5 | _main: 6 | push ebp 7 | mov ebp, esp ; Set up stack frame 8 | sub esp, 8 ; 16-byte align stack + room for parameters passed 9 | ; to functions we call 10 | mov ebx, 10 11 | mov ecx, x ;ECX will point to the current element to be summed 12 | cmp ebx, [ecx] 13 | je equal 14 | jl great 15 | mov dword[esp+4], 1 16 | jmp display 17 | equal: 18 | mov dword[esp+4], 0 19 | jmp display 20 | great: 21 | mov dword[esp+4], 2 22 | 23 | display: 24 | mov dword[esp], msg ; First parameter at esp+0 25 | call _printf 26 | 27 | xor eax, eax ; Return value = 0 28 | mov esp, ebp 29 | pop ebp ; Remove stack frame 30 | ret 31 | 32 | section .data 33 | msg db "The number is %d, (0 = equal, 1 = less, 2 = greater)", 0x0a, 0x00 34 | x db 50 35 | 36 | ;/usr/bin/nasm -f macho comp.asm -o comp.o && ld -macosx_version_min 10.8 -no_pie -arch i386 -o comp comp.o -lc 37 | -------------------------------------------------------------------------------- /MacOSX/compare/comp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/compare/comp.o -------------------------------------------------------------------------------- /MacOSX/find-the-unique-number/unique: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/find-the-unique-number/unique -------------------------------------------------------------------------------- /MacOSX/find-the-unique-number/unique.asm: -------------------------------------------------------------------------------- 1 | section .text 2 | global _main ;must be declared for linker (ld) 3 | extern _printf, _exit 4 | 5 | 6 | _main: 7 | push ebp 8 | mov ebp, esp ; Set up stack frame 9 | sub esp, 8 ; 16-byte align stack + room for parameters passed 10 | ; to functions we call 11 | mov ebx,0 ;EBX will store the sum 12 | mov eax,11 ;number bytes to be summed 13 | mov ecx, x ;ECX will point to the current element to be summed 14 | 15 | top: 16 | xor ebx, [ecx] 17 | add ecx,4 ;move pointer to next element 18 | dec eax ;decrement counter 19 | jnz top ;if counter not 0, then loop again 20 | 21 | 22 | done: 23 | mov dword[esp+4], ebx 24 | 25 | display: 26 | mov dword[esp], msg ; First parameter at esp+0 27 | call _printf 28 | 29 | xor eax, eax ; Return value = 0 30 | mov esp, ebp 31 | pop ebp ; Remove stack frame 32 | ret 33 | 34 | section .data 35 | msg db "The unique number is %d", 0x0a, 0x00 36 | x dd 13, 13, 42, 42, 43, 56, 56, 90, 90, 43, 50 37 | 38 | 39 | ;/usr/bin/nasm -f macho unique.asm -o unique.o && ld -macosx_version_min 10.8 -no_pie -arch i386 -o unique unique.o -lc 40 | -------------------------------------------------------------------------------- /MacOSX/find-the-unique-number/unique.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/find-the-unique-number/unique.o -------------------------------------------------------------------------------- /MacOSX/hello-world/hello: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/hello-world/hello -------------------------------------------------------------------------------- /MacOSX/hello-world/hello.asm: -------------------------------------------------------------------------------- 1 | global start 2 | 3 | section .text 4 | start: ; sys_write syscall 5 | push dword msg.len ; Last argument is length 6 | push dword msg ; 2nd last is pointer to string 7 | push dword 1 ; 1st argument is File descriptor (1=STDOUT) 8 | mov eax, 4 ; eax = 4 is write system call 9 | sub esp, 4 ; On OS/X 32-bit code always need to allocate 4 bytes on stack 10 | int 0x80 ; call the kernel 11 | 12 | push dword 42 ; Return value 13 | mov eax, 1 ; eax=1 is exit system call 14 | sub esp, 4 ; allocate 4 bytes on stack 15 | int 0x80 16 | 17 | section .rodata 18 | 19 | msg: db "Hello, world!", 10 20 | .len: equ $ - msg -------------------------------------------------------------------------------- /MacOSX/hello-world/hello.lst: -------------------------------------------------------------------------------- 1 | 1 SECTION .data ; data section 2 | 2 00000000 48656C6C6F20576F72- msg: db "Hello World",10 ; the string to print, 10=cr 3 | 3 00000009 6C640A 4 | 4 len: equ $-msg ; "$" means "here" 5 | 5 ; len is a value, not an address 6 | 6 7 | 7 SECTION .text ; code section 8 | 8 global main ; make label available to linker 9 | 9 main: ; standard gcc entry point 10 | 10 11 | 11 00000000 BA0C000000 mov edx,len ; arg3, length of string to print 12 | 12 00000005 B9[00000000] mov ecx,msg ; arg2, pointer to string 13 | 13 0000000A BB01000000 mov ebx,1 ; arg1, where to write, screen 14 | 14 0000000F B804000000 mov eax,4 ; write sysout command to int 80 hex 15 | 15 00000014 CD80 int 0x80 ; interrupt 80 hex, call kernel 16 | 16 17 | 17 00000016 BB00000000 mov ebx,0 ; exit code, 0=normal 18 | 18 0000001B B801000000 mov eax,1 ; exit command to kernel 19 | 19 00000020 CD80 int 0x80 ; interrupt 80 hex, call kernel 20 | -------------------------------------------------------------------------------- /MacOSX/hello-world/hello.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/hello-world/hello.o -------------------------------------------------------------------------------- /MacOSX/inc-five-times/five: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/inc-five-times/five -------------------------------------------------------------------------------- /MacOSX/inc-five-times/five.asm: -------------------------------------------------------------------------------- 1 | section .data 2 | hello db "The answer is %d", 0x0a, 0x00 3 | 4 | section .text 5 | ;default rel 6 | 7 | global _main 8 | extern _printf, _exit 9 | 10 | _main: 11 | push ebp 12 | mov ebp, esp ; Set up stack frame 13 | mov eax, 40 ; Number to be incremented 14 | inc eax ; Increment by five times 15 | inc eax 16 | inc eax 17 | inc eax 18 | inc eax 19 | sub esp, 8 ; 16-byte align stack + room for parameters passed 20 | ; to functions we call 21 | 22 | mov dword[esp+4], eax ; Second parameter at esp+4 23 | mov dword[esp], hello ; First parameter at esp+0 24 | call _printf 25 | 26 | xor eax, eax ; Return value = 0 27 | mov esp, ebp 28 | pop ebp ; Remove stack frame 29 | ret ; We linked with C library that calls _main 30 | ; after initialization. We can do a RET to 31 | ; return back to the C runtime code that will 32 | ; exit the program and return the value in EAX 33 | ; We can do this instead of calling _exit 34 | 35 | 36 | ;/usr/bin/nasm -f macho five.asm -o five.o && ld -macosx_version_min 10.8 -no_pie -arch i386 -o five five.o -lc 37 | -------------------------------------------------------------------------------- /MacOSX/inc-five-times/five.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/inc-five-times/five.o -------------------------------------------------------------------------------- /MacOSX/largest-of-three/max: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/largest-of-three/max -------------------------------------------------------------------------------- /MacOSX/largest-of-three/max.asm: -------------------------------------------------------------------------------- 1 | section .text 2 | global _main ;must be declared for linker (ld) 3 | extern _printf, _exit 4 | 5 | _main: 6 | push ebp 7 | mov ebp, esp ; Set up stack frame 8 | sub esp, 8 ; 16-byte align stack + room for parameters passed 9 | ; to functions we call 10 | mov ebx,0 ;EBX will store the largest number 11 | mov eax,3 ;number bytes to be summed 12 | mov ecx, x ;ECX will point to the current element to be summed 13 | 14 | top: 15 | cmp ebx, [ecx] 16 | jg back 17 | mov ebx, [ecx] 18 | back: 19 | add ecx,4 ;move pointer to next element 20 | dec eax ;decrement counter 21 | jnz top ;if counter not 0, then loop again 22 | 23 | done: 24 | mov dword[esp+4], ebx 25 | 26 | display: 27 | mov dword[esp], msg ; First parameter at esp+0 28 | call _printf 29 | 30 | xor eax, eax ; Return value = 0 31 | mov esp, ebp 32 | pop ebp ; Remove stack frame 33 | ret 34 | 35 | section .data 36 | msg db "The largest number is %d", 0x0a, 0x00 37 | x dd 13, 456, 32 38 | 39 | 40 | ;/usr/bin/nasm -f macho max.asm -o max.o && ld -macosx_version_min 10.8 -no_pie -arch i386 -o max max.o -lc 41 | -------------------------------------------------------------------------------- /MacOSX/largest-of-three/max.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/largest-of-three/max.o -------------------------------------------------------------------------------- /MacOSX/search/search: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/search/search -------------------------------------------------------------------------------- /MacOSX/search/search.asm: -------------------------------------------------------------------------------- 1 | section .text 2 | global _main ;must be declared for linker (ld) 3 | extern _printf, _exit 4 | 5 | 6 | _main: 7 | push ebp 8 | mov ebp, esp ; Set up stack frame 9 | sub esp, 8 ; 16-byte align stack + room for parameters passed 10 | ; to functions we call 11 | mov eax,10 ;number bytes to be summed 12 | mov ecx, x ;ECX will point to the current element to be summed 13 | 14 | top: 15 | cmp dword[ecx], 41 16 | je done 17 | add ecx,1 ;move pointer to next element 18 | dec eax ;decrement counter 19 | jnz top ;if counter not 0, then loop again 20 | jmp not_done 21 | 22 | done: 23 | mov dword[esp+4], 1 24 | jmp display 25 | 26 | not_done: 27 | mov dword[esp+4], -1 28 | 29 | display: 30 | mov dword[esp], hello ; First parameter at esp+0 31 | call _printf 32 | 33 | xor eax, eax ; Return value = 0 34 | mov esp, ebp 35 | pop ebp ; Remove stack frame 36 | ret 37 | 38 | section .data 39 | hello db "The location is %d", 0x0a, 0x00 40 | x dd 13, 41, 51, 61, 71, 81, 91, 101, 23, 45 41 | 42 | 43 | ;/usr/bin/nasm -f macho search.asm -o search.o && ld -macosx_version_min 10.8 -no_pie -arch i386 -o search search.o -lc 44 | -------------------------------------------------------------------------------- /MacOSX/search/search.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/search/search.o -------------------------------------------------------------------------------- /MacOSX/sub-with-carry/swc.asm: -------------------------------------------------------------------------------- 1 | section .data 2 | hello db "The answer is %d", 0x0a, 0x00 3 | 4 | section .text 5 | ;default rel 6 | 7 | global _main 8 | extern _printf, _exit 9 | 10 | _main: 11 | push ebp 12 | mov ebp, esp ; Set up stack frame 13 | mov eax, 40 14 | mov ebx, 2255 15 | sub ebx, eax 16 | sub esp, 8 ; 16-byte align stack + room for parameters passed 17 | ; to functions we call 18 | 19 | mov dword[esp+4], ebx ; Second parameter at esp+4 20 | mov dword[esp], hello ; First parameter at esp+0 21 | call _printf 22 | 23 | xor eax, eax ; Return value = 0 24 | mov esp, ebp 25 | pop ebp ; Remove stack frame 26 | ret ; We linked with C library that calls _main 27 | ; after initialization. We can do a RET to 28 | ; return back to the C runtime code that will 29 | ; exit the program and return the value in EAX 30 | ; We can do this instead of calling _exit 31 | 32 | 33 | ;/usr/bin/nasm -f macho swc.asm -o swc.o && ld -macosx_version_min 10.8 -no_pie -arch i386 -o swc swc.o -lc 34 | -------------------------------------------------------------------------------- /MacOSX/sub/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/sub/a.out -------------------------------------------------------------------------------- /MacOSX/sub/sub.asm: -------------------------------------------------------------------------------- 1 | global start 2 | section .text 3 | start: 4 | mov rdx, output ; rdx holds address of next byte to write 5 | mov r8, '1' ; first number 6 | sub r8, '0' 7 | mov r9, '5' ; second number 8 | sub r9, '0' 9 | sub r9, r8 ; subtract the two numbers 10 | add r9, '0' 11 | mov [rdx], r9 ; write number to output 12 | 13 | done: 14 | mov rax, 0x02000004 ; system call for write 15 | mov rdi, 1 ; file handle 1 is stdout 16 | mov rsi, output ; address of string to output 17 | mov rdx, 1 ; number of bytes 18 | syscall ; invoke operating system to do the write 19 | mov rax, 0x02000001 ; system call for exit 20 | xor rdi, rdi ; exit code 0 21 | syscall ; invoke operating system to exit 22 | 23 | section .bss 24 | output: resq 1 25 | 26 | 27 | ; Run the subtract program 28 | ; nasm -fmacho64 sub.asm && ld sub.o && ./a.out 29 | -------------------------------------------------------------------------------- /MacOSX/sub/sub.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/sub/sub.o -------------------------------------------------------------------------------- /MacOSX/sum-array/sum: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/sum-array/sum -------------------------------------------------------------------------------- /MacOSX/sum-array/sum.asm: -------------------------------------------------------------------------------- 1 | section .text 2 | global _main ;must be declared for linker (ld) 3 | extern _printf, _exit 4 | 5 | 6 | _main: 7 | push ebp 8 | mov ebp, esp ; Set up stack frame 9 | sub esp, 8 ; 16-byte align stack + room for parameters passed 10 | ; to functions we call 11 | mov ebx,0 ;EBX will store the sum 12 | mov eax,10 ;number bytes to be summed 13 | mov ecx, x ;ECX will point to the current element to be summed 14 | 15 | top: 16 | add ebx, [ecx] 17 | add ecx,4 ;move pointer to next element 18 | dec eax ;decrement counter 19 | jnz top ;if counter not 0, then loop again 20 | 21 | 22 | done: 23 | ;add ebx, '0' 24 | mov dword[esp+4], ebx 25 | 26 | display: 27 | mov dword[esp], msg ; First parameter at esp+0 28 | call _printf 29 | 30 | xor eax, eax ; Return value = 0 31 | mov esp, ebp 32 | pop ebp ; Remove stack frame 33 | ret 34 | 35 | section .data 36 | msg db "The sum is %d", 0x0a, 0x00 37 | x dd 13, 13, 42, 50, 43, 56, 89, 90, 01, 45 38 | 39 | 40 | ;/usr/bin/nasm -f macho sum.asm -o sum.o && ld -macosx_version_min 10.8 -no_pie -arch i386 -o sum sum.o -lc 41 | -------------------------------------------------------------------------------- /MacOSX/sum-array/sum.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/sum-array/sum.o -------------------------------------------------------------------------------- /MacOSX/triangle/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/triangle/a.out -------------------------------------------------------------------------------- /MacOSX/triangle/triangle.asm: -------------------------------------------------------------------------------- 1 | global start 2 | section .text 3 | start: 4 | mov rdx, output ; rdx holds address of next byte to write 5 | mov r8, 1 ; initial line length 6 | mov r9, 0 ; number of stars written on line so far 7 | line: 8 | mov byte [rdx], '*' ; write single star 9 | inc rdx ; advance pointer to next cell to write 10 | inc r9 ; "count" number so far on line 11 | cmp r9, r8 ; did we reach the number of stars for this line? 12 | jne line ; not yet, keep writing on this line 13 | lineDone: 14 | mov byte [rdx], 10 ; write a new line char 15 | inc rdx ; and move pointer to where next char goes 16 | inc r8 ; next line will be one char longer 17 | mov r9, 0 ; reset count of stars written on this line 18 | cmp r8, maxlines ; wait, did we already finish the last line? 19 | jng line ; if not, begin writing this line 20 | done: 21 | mov rax, 0x02000004 ; system call for write 22 | mov rdi, 1 ; file handle 1 is stdout 23 | mov rsi, output ; address of string to output 24 | mov rdx, dataSize ; number of bytes 25 | syscall ; invoke operating system to do the write 26 | mov rax, 0x02000001 ; system call for exit 27 | xor rdi, rdi ; exit code 0 28 | syscall ; invoke operating system to exit 29 | 30 | section .bss 31 | maxlines equ 8 32 | dataSize equ 44 33 | output: resb dataSize 34 | 35 | ; Run the triangle star printing program 36 | ; nasm -fmacho64 triangle.asm && ld triangle.o && ./a.out 37 | -------------------------------------------------------------------------------- /MacOSX/triangle/triangle.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/triangle/triangle.o -------------------------------------------------------------------------------- /MacOSX/trying/try: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/trying/try -------------------------------------------------------------------------------- /MacOSX/trying/try.asm: -------------------------------------------------------------------------------- 1 | section .data 2 | hello db "The answer is %d", 0x0a, 0x00 3 | 4 | section .text 5 | ;default rel 6 | 7 | global _main 8 | extern _printf, _exit 9 | 10 | _main: 11 | push ebp 12 | mov ebp, esp ; Set up stack frame 13 | mov eax, 40 14 | mov ebx, 2255 15 | sub ebx, eax 16 | sub esp, 8 ; 16-byte align stack + room for parameters passed 17 | ; to functions we call 18 | 19 | mov dword[esp+4], ebx ; Second parameter at esp+4 20 | mov dword[esp], hello ; First parameter at esp+0 21 | call _printf 22 | 23 | xor eax, eax ; Return value = 0 24 | mov esp, ebp 25 | pop ebp ; Remove stack frame 26 | ret ; We linked with C library that calls _main 27 | ; after initialization. We can do a RET to 28 | ; return back to the C runtime code that will 29 | ; exit the program and return the value in EAX 30 | ; We can do this instead of calling _exit 31 | 32 | 33 | ;/usr/bin/nasm -f macho try.asm -o try.o && ld -macosx_version_min 10.8 -no_pie -arch i386 -o try try.o -lc 34 | -------------------------------------------------------------------------------- /MacOSX/trying/try.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PikkaPikkachu/Assembly-with-MacOS/fbf2fb6e2c55a27d4973ae265fed0d8c965994b5/MacOSX/trying/try.o -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Assembly-with-MacOS 2 | 3 | A collection of assembly programs specifically with MacOS system calls and nasm intruction set for 8086 microprocessor. 4 | 5 | 6 | ## Setup 7 | 8 | ### MacOS 9 | 10 | ```bash 11 | brew install nasm 12 | git clone https://github.com/PikkaPikkachu/Assembly-with-MacOS 13 | cd Assembly-with-MacOS 14 | ``` 15 | 16 | Now cd into any program and run it with the specified intruction at the end of code! 17 | 18 | ### Linux 19 | 20 | ```bash 21 | git clone https://github.com/PikkaPikkachu/Assembly-with-MacOS 22 | cd Assembly-with-MacOS 23 | ``` 24 | #### Running the programs 25 | 26 | ##### 1. Run on Masm using DOSbox 27 | 28 | Run the following command on terminal: 29 | ```bash 30 | dosbox 31 | ``` 32 | 33 | This should open the pre-installed DOSBox. Run the following commands in the DOSBox terminal: 34 | 35 | ```bash 36 | mount c /path/to/directory/of/asm/file 37 | 38 | c: 39 | 40 | masm 41 | 42 | link 43 | 44 | 45 | 46 | ``` 47 | 48 | Currently the required `.exe` files have been added in the sub-directory itself which can be run directly. 49 | 50 | ##### 2. Run with emu8086 and Wine (faster and better) 51 | 52 | To setup Wine, run on terminal: 53 | ```bash 54 | sudo apt-get update 55 | sudo apt-get install wine 56 | sudo apt-get install virtualbox 57 | 58 | ``` 59 | 60 | Download the `8086emu.exe` file from `/Linux` directory.
61 | Right click and `open-with` Wine. 62 | 63 | Install and get started by directly editing and running `.asm` files in the IDE. 64 | 65 | ## Tutorials 66 | 67 | Get started with [Hello World](https://github.com/PikkaPikkachu/Assembly-with-MacOS/blob/master/MacOSX/hello-world/hello.asm) program in 8086. 68 | 69 | ## Contributions 70 | 71 | Open to [contributions](https://github.com/PikkaPikkachu/Assembly-with-MacOS/blob/master/CONTRIBUTING.md) of other programs as well! 72 | --------------------------------------------------------------------------------