notes/.config/newsboat/reddit_rss/Assembly_language.rss
2023-01-28 05:22:19 -08:00

1 line
No EOL
48 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"><category term="Assembly_language" label="r/Assembly_language"/><updated>2023-01-24T03:33:02+00:00</updated><icon>https://www.redditstatic.com/icon.png/</icon><id>/r/Assembly_language.rss</id><link rel="self" href="https://www.reddit.com/r/Assembly_language.rss" type="application/atom+xml" /><link rel="alternate" href="https://www.reddit.com/r/Assembly_language" type="text/html" /><subtitle>This is a subreddit for people who need help with programming in assembly and people who want to post their own code to help others out.</subtitle><title>Assembly Programming</title><entry><author><name>/u/Lokimugr</name><uri>https://www.reddit.com/user/Lokimugr</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Here is the invite link for the official &lt;a href=&quot;/r/Assembly_language&quot;&gt;r/Assembly_language&lt;/a&gt; Discord Server: &lt;a href=&quot;https://discord.gg/NhsJBwPRSc&quot;&gt;https://discord.gg/NhsJBwPRSc&lt;/a&gt;&lt;/p&gt; &lt;p&gt;We will likely need at least two other moderators for it, so if you are interested, please PM me or send a modmail.&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Lokimugr&quot;&gt; /u/Lokimugr &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/nzzbyx/rassembly_language_official_discord/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/nzzbyx/rassembly_language_official_discord/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_nzzbyx</id><link href="https://www.reddit.com/r/Assembly_language/comments/nzzbyx/rassembly_language_official_discord/" /><updated>2021-06-14T22:52:34+00:00</updated><published>2021-06-14T22:52:34+00:00</published><title>r/Assembly_language Official Discord</title></entry><entry><author><name>/u/beyboo</name><uri>https://www.reddit.com/user/beyboo</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/beyboo&quot;&gt; /u/beyboo &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10jcjdz/masm_main_proc_main_endp_reference/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10jcjdz/masm_main_proc_main_endp_reference/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10jcjdz</id><link href="https://www.reddit.com/r/Assembly_language/comments/10jcjdz/masm_main_proc_main_endp_reference/" /><updated>2023-01-23T13:30:40+00:00</updated><published>2023-01-23T13:30:40+00:00</published><title>Masm Main Proc / main endp reference</title></entry><entry><author><name>/u/p_Chewie</name><uri>https://www.reddit.com/user/p_Chewie</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;I&amp;#39;m having trouble making a work from school, if you know how to deal with this Simulator, please help me.&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/p_Chewie&quot;&gt; /u/p_Chewie &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10hvwr1/does_anyone_know_something_about_edsim51/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10hvwr1/does_anyone_know_something_about_edsim51/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10hvwr1</id><link href="https://www.reddit.com/r/Assembly_language/comments/10hvwr1/does_anyone_know_something_about_edsim51/" /><updated>2023-01-21T17:04:17+00:00</updated><published>2023-01-21T17:04:17+00:00</published><title>Does anyone know something about EdSim51?</title></entry><entry><author><name>/u/x8664mmx_intrin_adds</name><uri>https://www.reddit.com/user/x8664mmx_intrin_adds</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/x8664mmx_intrin_adds&quot;&gt; /u/x8664mmx_intrin_adds &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://github.com/IbrahimHindawi/masm64-rtsr&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10hmwf3/masm64_software_renderer/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10hmwf3</id><link href="https://www.reddit.com/r/Assembly_language/comments/10hmwf3/masm64_software_renderer/" /><updated>2023-01-21T08:55:30+00:00</updated><published>2023-01-21T08:55:30+00:00</published><title>MASM64 Software Renderer</title></entry><entry><author><name>/u/Daug17</name><uri>https://www.reddit.com/user/Daug17</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Tried to Google the answer and couldnt find it. Thanks in advance!&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Daug17&quot;&gt; /u/Daug17 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10gybc4/is_there_a_way_to_write_code_say_in_c_for_which/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10gybc4/is_there_a_way_to_write_code_say_in_c_for_which/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10gybc4</id><link href="https://www.reddit.com/r/Assembly_language/comments/10gybc4/is_there_a_way_to_write_code_say_in_c_for_which/" /><updated>2023-01-20T14:28:22+00:00</updated><published>2023-01-20T14:28:22+00:00</published><title>Is there a way to write code (say in c) for which the 32 registers wont suffice?</title></entry><entry><author><name>/u/Jakedez7</name><uri>https://www.reddit.com/user/Jakedez7</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;I have a not completely terrible understanding of some of the basics of x86-64 assembly, and I&amp;#39;d like to gain a better understanding of it, as well as how to implement it in windows, to aid me in both my programming understanding, and understanding of computer systems.&lt;/p&gt; &lt;p&gt;I&amp;#39;m coming into this with a very good understanding of how to program in C, and manage memory with pointers.&lt;/p&gt; &lt;p&gt;What are some good resources I could use, both written, and video if possible, I could use to better understand it?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Jakedez7&quot;&gt; /u/Jakedez7 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10ferya/trying_to_learn_x8664_assembly_on_windows_what/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10ferya/trying_to_learn_x8664_assembly_on_windows_what/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10ferya</id><link href="https://www.reddit.com/r/Assembly_language/comments/10ferya/trying_to_learn_x8664_assembly_on_windows_what/" /><updated>2023-01-18T18:30:50+00:00</updated><published>2023-01-18T18:30:50+00:00</published><title>Trying to learn x86-64 assembly on windows, what are some good resources?</title></entry><entry><author><name>/u/hju_</name><uri>https://www.reddit.com/user/hju_</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;I have no experience in MIPS, but Im forcing myself to learn vim and terminal stuff, so I wanted to know if there is a way to do that with MIPS&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/hju_&quot;&gt; /u/hju_ &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10eu08n/mips_on_mac_terminal/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10eu08n/mips_on_mac_terminal/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10eu08n</id><link href="https://www.reddit.com/r/Assembly_language/comments/10eu08n/mips_on_mac_terminal/" /><updated>2023-01-18T01:26:11+00:00</updated><published>2023-01-18T01:26:11+00:00</published><title>MIPS on Mac Terminal?</title></entry><entry><author><name>/u/The_Languid_One</name><uri>https://www.reddit.com/user/The_Languid_One</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Hi all, &lt;/p&gt; &lt;p&gt;I want to create a website to help people learn MIPs by doing programming challenges. Are there any MIPs compilers I can do API calls to, or that I can download and somehow incorporate into my project? &lt;/p&gt; &lt;p&gt;Thanks!&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/The_Languid_One&quot;&gt; /u/The_Languid_One &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10el223/api_for_a_mips_compiler/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10el223/api_for_a_mips_compiler/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10el223</id><link href="https://www.reddit.com/r/Assembly_language/comments/10el223/api_for_a_mips_compiler/" /><updated>2023-01-17T19:30:53+00:00</updated><published>2023-01-17T19:30:53+00:00</published><title>API for a MIPs compiler?</title></entry><entry><author><name>/u/EmbeddedSoftEng</name><uri>https://www.reddit.com/user/EmbeddedSoftEng</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;pre&gt;&lt;code&gt;10000154 &amp;lt;_init&amp;gt;: 10000154: b5f8 push {r3, r4, r5, r6, r7, lr} 10000156: bf00 nop 10000158: bcf8 pop {r3, r4, r5, r6, r7} 1000015a: bc08 pop {r3} 1000015c: 469e mov lr, r3 1000015e: 4770 bx lr &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;This is from the disassembly of C code from the .elf file.&lt;/p&gt; &lt;p&gt;So, R0, R1, R2, and R3 are all used for passing function parameters and therefore assumed to be getting clobbered and generally not preserved by pushing them onto the stack. But shouldn&amp;#39;t it only be pushing registers it&amp;#39;s actually going to be using for local variables? What&amp;#39;s the point of pushing R4, R5, R6, and R7 to just NOP and then pop them all back? LR is the link register and holds the address the control flow should return to when the function returns. The return address, in other words.&lt;/p&gt; &lt;p&gt;The first three instructions here seem to be achieving exactly nothing that a mere push {lr} wouldn&amp;#39;t have. All of the register contents remain unchanged from before to after and even during. Can anyone explain why the code is generated this way?&lt;/p&gt; &lt;p&gt;Then, instructions 4 and 5 are popping the contents of the LR into R3 and then moving the value from R3 back into the LR. ??? Again, we&amp;#39;re just clobbering the contents of R3, but it&amp;#39;s assumed to be clobbered all the time, so no harm, no foul. And again, we&amp;#39;re setting the content of LR to be… exactly what it has always been.&lt;/p&gt; &lt;p&gt;Finally, the branch and exchange instruction with the LR as its argument is just a subroutine call return.&lt;/p&gt; &lt;p&gt;This whole function seems to be boiling down to:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;void _init(void) { return; } &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;&lt;em&gt;but by the scenic route.&lt;/em&gt; Why couldn&amp;#39;t the first five instructions be removed and the effect would be the same? Is there some kind of timing thing going on? Is there a sizing requirement somewhere in the standards that means that this function has to be at least so large? Are there side effects of some of these instructions of which I am unaware?&lt;/p&gt; &lt;p&gt;I understand the necessity of having the void _init(void) function physicly present, even if it&amp;#39;s essentially a C language NOP, in the binary footprint, for the CRT&amp;#39;s sake, but my understanding would dictate that it could have been done more compactly.&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/EmbeddedSoftEng&quot;&gt; /u/EmbeddedSoftEng &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10ee0pe/help_me_understand_this_arm_thumb_init_function/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10ee0pe/help_me_understand_this_arm_thumb_init_function/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10ee0pe</id><link href="https://www.reddit.com/r/Assembly_language/comments/10ee0pe/help_me_understand_this_arm_thumb_init_function/" /><updated>2023-01-17T14:47:09+00:00</updated><published>2023-01-17T14:47:09+00:00</published><title>Help me understand this ARM Thumb _init() function.</title></entry><entry><author><name>/u/Spam00r</name><uri>https://www.reddit.com/user/Spam00r</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Hi,&lt;/p&gt; &lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;i&amp;#39;m sure this is an easy question. But I can&amp;#39;t find any documentation on this.&lt;/p&gt; &lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;How do I turn a conditional Jump in the form of &lt;strong&gt;0F 84 C3 00 00 00&lt;/strong&gt; into an unconditional Jump?&lt;/p&gt; &lt;p&gt;For short Jumps I know that you can do this for example with &lt;strong&gt;EB&lt;/strong&gt; 7F instead of &lt;strong&gt;74&lt;/strong&gt; 7F for an Jump if equal.&lt;/p&gt; &lt;p&gt;There are dozens of lists on the net with conditional Jumps in this longform, but I can&amp;#39;t find anywhere how to do an unconditional Jump for near and far Jumps.&lt;/p&gt; &lt;p&gt;Sorry for the dumb question.&lt;/p&gt; &lt;p&gt;Please help!&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Spam00r&quot;&gt; /u/Spam00r &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10eht9p/opcode_for_unconditional_near_or_far_jumps/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10eht9p/opcode_for_unconditional_near_or_far_jumps/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10eht9p</id><link href="https://www.reddit.com/r/Assembly_language/comments/10eht9p/opcode_for_unconditional_near_or_far_jumps/" /><updated>2023-01-17T17:23:49+00:00</updated><published>2023-01-17T17:23:49+00:00</published><title>Opcode for Unconditional near or far Jumps.</title></entry><entry><author><name>/u/confusionPrice</name><uri>https://www.reddit.com/user/confusionPrice</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;I&amp;#39;m trying to make a hello world program with nasm. It isn&amp;#39;t working, and I don&amp;#39;t know why.&lt;/p&gt; &lt;p&gt;This is the code&lt;/p&gt; &lt;pre&gt;&lt;code&gt; `global _main` `extern _printf` `section .text` `_main:` `push msg` `call _printf` `add esp, 4` `ret` `msg:` `db &amp;quot;Hello World&amp;quot;, 10, 0` &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;and this what I get trying to assembly and link it&lt;/p&gt; &lt;p&gt;&lt;code&gt;C:\Users\benle\Desktop\asm&amp;gt;nasm -fwin64 hello.asm -o hello.o&lt;/code&gt;&lt;/p&gt; &lt;p&gt;&lt;code&gt;C:\Users\benle\Desktop\asm&amp;gt;gcc hello.o&lt;/code&gt;&lt;/p&gt; &lt;p&gt;&lt;code&gt;hello.o:hello.asm:(.text+0x1): relocation truncated to fit: IMAGE_REL_AMD64_ADDR32 against \&lt;/code&gt;.text&amp;#39;`&lt;/p&gt; &lt;p&gt;&lt;code&gt;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: hello.o:hello.asm:(.text+0x6): undefined reference to \&lt;/code&gt;_printf&amp;#39;`&lt;/p&gt; &lt;p&gt;&lt;code&gt;C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crtexewin.o):crtexewin.c:(.text.startup+0xbd): undefined reference to \&lt;/code&gt;WinMain&amp;#39;`&lt;/p&gt; &lt;p&gt;&lt;code&gt;collect2.exe: error: ld returned 1 exit status&lt;/code&gt;&lt;/p&gt; &lt;p&gt;&lt;code&gt;C:\Users\benle\Desktop\asm&amp;gt;&lt;/code&gt;&lt;/p&gt; &lt;p&gt;The only thing I understand is the &amp;quot;&lt;code&gt;undefined reference to \&lt;/code&gt;_printf&amp;#39;`&amp;quot; part, but since I use gcc, shouldn&amp;#39;t it work?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/confusionPrice&quot;&gt; /u/confusionPrice &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10dwk3j/hello_world_in_nasm_for_windows/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10dwk3j/hello_world_in_nasm_for_windows/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10dwk3j</id><link href="https://www.reddit.com/r/Assembly_language/comments/10dwk3j/hello_world_in_nasm_for_windows/" /><updated>2023-01-16T23:46:29+00:00</updated><published>2023-01-16T23:46:29+00:00</published><title>Hello world in nasm, for Windows</title></entry><entry><author><name>/u/DannyGomes1995</name><uri>https://www.reddit.com/user/DannyGomes1995</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Hello, I got an exam in a couple of days, and I&amp;#39;m doing exams from previous years to study. My teacher is not replying and classes are finished, so I have no one to check if my answers are correct. If anyone can help me check if my though process is correct on some of the ones I struggled with, it would be a great help. Here they are:&lt;/p&gt; &lt;p&gt;&lt;em&gt;9. In x86-64, if we sum two registers with signed values, the result will be incorrect if the carry flag is set.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;This one I put TRUE because the only scenario I can see of the carry flag being set is if we sum a value that is too large to fit in that amount of bits, so the most significant bit carries activating the CF, and it is set to 0.&lt;/p&gt; &lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;&lt;em&gt;12. In x86-64, the instruction “leaq (%rax,%rax,6),%rax” can be used to multiply by seven the value present in %rax.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;This one I put FALSE, simply because I can&amp;#39;t see how this would multiply the value in %rax by seven, I mean we are putting in %rax the value pointed by (%rax + (%rax*6)) isn&amp;#39;t it ? So I don&amp;#39;t know how that would result in a multiplication by 7.&lt;/p&gt; &lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;&lt;em&gt;13. In x86-64, it is possible to get the same result with “imull $-8,%eax” and “shll $3,%eax; notl %eax; incl %eax”&lt;/em&gt;&lt;/p&gt; &lt;p&gt;This one I put FALSE, because we do not know if the imull instruction will result in a binary number that ends in 0 or 1. But the set of instructions after the shll makes it so that the end result of eax is always 0, doesn&amp;#39;t it ? Anything with shll makes the least significant bit 0, notl makes it 1, incl makes it 0.&lt;/p&gt; &lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;&lt;em&gt;14. In x86-64, admit that the value of %rsp is 0x1008. The execution of the ret instruction puts the value 0x1000 in %rsp.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;This one I wasn&amp;#39;t able to answer, I think %rsp is supposed to return to its original value before the function was called after the return, so we can return to the correct place after the function was called, but how do I know if that original value was 0x1000 ? Is %rsp in the beginning of a function always 0x1000 ?&lt;/p&gt; &lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;&lt;em&gt;17. In x86-64, the initial address of an aligned struct depends on the alignment restrictions of its fields.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;This one I put FALSE, because no matter what sort of data type we put in the beginning of a struct it will have no offset to its left it will just sit there, so the initial address does not depend on the size of the fields.&lt;/p&gt; &lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;&lt;em&gt;18. In x86-64, the space occupied by a union is always the same, independently of the order of its fields.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;This one I put TRUE, this is the whole purpose of unions, isn&amp;#39;t it ? We don&amp;#39;t have to worry about the order of the fields, I think. (This one I could be completely wrong, I have to look into unions a bit more.).&lt;/p&gt; &lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;&lt;em&gt;19. In x86-64, the stack is used to support the return vale of the exit of a function, just as it happens with execution flow.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;This one I put TRUE, the wording has me a bit confused, but I think it&amp;#39;s true it is the stack that handles the value of rsp, so we can return to the correct place I think.&lt;/p&gt; &lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;&lt;em&gt;20. The code block “for(j=0;j&amp;lt;N;j++) for(i=0;i&amp;lt;M;i++) sum+=m[j][i];” has good temporal and spacial locality.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;This one I put TRUE, I think it&amp;#39;s just asking if there is a better way to sum all the values in a matrix, I don&amp;#39;t think there is but I could be wrong, not sure what good means.&lt;/p&gt; &lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;Anyway sorry for the long post, it&amp;#39;s just that I&amp;#39;d like to have the correct answers for at least one exam, still going to do quite a few more exams from other years, but I won&amp;#39;t spam the sub with another 10 posts like this for the true or false group just hope my teacher will reply before the exam.&lt;/p&gt; &lt;p&gt;Thanks if you have it a read.&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/DannyGomes1995&quot;&gt; /u/DannyGomes1995 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10dnud3/help_exam_true_or_false_questions/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/10dnud3/help_exam_true_or_false_questions/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_10dnud3</id><link href="https://www.reddit.com/r/Assembly_language/comments/10dnud3/help_exam_true_or_false_questions/" /><updated>2023-01-16T18:48:00+00:00</updated><published>2023-01-16T18:48:00+00:00</published><title>Help - Exam true or false questions</title></entry><entry><author><name>/u/Da-Blue-Guy</name><uri>https://www.reddit.com/user/Da-Blue-Guy</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;I&amp;#39;m trying to learn assembly through GCC code transpiled with -S and research, and found something I can&amp;#39;t really put into words easily enough for a Google search.&lt;/p&gt; &lt;p&gt;I know what standalone square brackets are. mov eax, [eax] will dereference eax and replace it.&lt;/p&gt; &lt;p&gt;But I was looking through some code, and saw .LC0[rip], where .LC0 is a label to a string. I also saw -4[rbp], 40. This is the code:&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;https://preview.redd.it/v2nuwlfvbiba1.png?width=344&amp;amp;format=png&amp;amp;auto=webp&amp;amp;s=3b5d2d900a3b6ad5513a7546892f369455220170&quot;&gt;https://preview.redd.it/v2nuwlfvbiba1.png?width=344&amp;amp;format=png&amp;amp;auto=webp&amp;amp;s=3b5d2d900a3b6ad5513a7546892f369455220170&lt;/a&gt;&lt;/p&gt; &lt;p&gt;My questions:&lt;/p&gt; &lt;p&gt;What does an item before an item in square brackets do?&lt;br/&gt; What does rip do in .LC0[rip], and why is it needed?&lt;br/&gt; From basic reasearch, lea seems to move the address. Is this true?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Da-Blue-Guy&quot;&gt; /u/Da-Blue-Guy &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/109l4f2/values_coming_before_square_brackets_intel_x8664/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/109l4f2/values_coming_before_square_brackets_intel_x8664/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_109l4f2</id><link href="https://www.reddit.com/r/Assembly_language/comments/109l4f2/values_coming_before_square_brackets_intel_x8664/" /><updated>2023-01-12T00:35:20+00:00</updated><published>2023-01-12T00:35:20+00:00</published><title>Values coming before square brackets? (Intel x86-64)</title></entry><entry><author><name>/u/Tobiwan663</name><uri>https://www.reddit.com/user/Tobiwan663</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Hi everyone, as a disclaimer I have never worked with assembly before. For software analysis of a C program I want to trace all assembly operations actually executed on the CPU when running a C program and build statistics how many times each instruction has been called. Is there a straight forward way to do this?&lt;/p&gt; &lt;p&gt;I appreciate all hints :)&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Tobiwan663&quot;&gt; /u/Tobiwan663 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/105qv6f/can_i_trace_assembly_code_line_by_line/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/105qv6f/can_i_trace_assembly_code_line_by_line/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_105qv6f</id><link href="https://www.reddit.com/r/Assembly_language/comments/105qv6f/can_i_trace_assembly_code_line_by_line/" /><updated>2023-01-07T14:55:04+00:00</updated><published>2023-01-07T14:55:04+00:00</published><title>Can I trace assembly code line by line?</title></entry><entry><author><name>/u/baby-byte</name><uri>https://www.reddit.com/user/baby-byte</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/baby-byte&quot;&gt; /u/baby-byte &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;http://babybyte.code.blog/2023/01/03/programming-basics-with-reddit/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/102g7j6/this_subreddit_helped_me_grow_as_a_programmer/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_102g7j6</id><link href="https://www.reddit.com/r/Assembly_language/comments/102g7j6/this_subreddit_helped_me_grow_as_a_programmer/" /><updated>2023-01-03T18:59:01+00:00</updated><published>2023-01-03T18:59:01+00:00</published><title>This subreddit helped me grow as a programmer</title></entry><entry><author><name>/u/baby-byte</name><uri>https://www.reddit.com/user/baby-byte</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/baby-byte&quot;&gt; /u/baby-byte &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://babybyte.code.blog/2022/12/24/programming-in-assembly-language-is-like-chopping-vegetables/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/1003ymw/i_wrote_an_analogy_to_help_me_understand_push/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_1003ymw</id><link href="https://www.reddit.com/r/Assembly_language/comments/1003ymw/i_wrote_an_analogy_to_help_me_understand_push/" /><updated>2022-12-31T21:19:58+00:00</updated><published>2022-12-31T21:19:58+00:00</published><title>I wrote an analogy to help me understand push, call, and pop.</title></entry><entry><author><name>/u/WhateverWhateverson</name><uri>https://www.reddit.com/user/WhateverWhateverson</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Basically the title&lt;/p&gt; &lt;p&gt;I&amp;#39;m using it to do something when an addition overflows, like:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;add dh,dl into &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;However it doesn&amp;#39;t always properly detect overflow and simply continues the program instead of interrupting. I&amp;#39;m probably just using it wrong, but could someone please explain to me why this happens?&lt;/p&gt; &lt;p&gt;I&amp;#39;d also love to add a concrete example, but the whole thing is tested automatically and I don&amp;#39;t see the numbers it was using. I simply see something to the effect of:&lt;/p&gt; &lt;p&gt;&amp;gt;Error: Should have interrupted 15 times, number of actual interrupts: 0&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/WhateverWhateverson&quot;&gt; /u/WhateverWhateverson &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zzvzsa/x8616_into_not_detecting_overflow_when_it_should/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zzvzsa/x8616_into_not_detecting_overflow_when_it_should/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_zzvzsa</id><link href="https://www.reddit.com/r/Assembly_language/comments/zzvzsa/x8616_into_not_detecting_overflow_when_it_should/" /><updated>2022-12-31T15:04:48+00:00</updated><published>2022-12-31T15:04:48+00:00</published><title>[x86-16] INTO not detecting overflow when it should</title></entry><entry><author><name>/u/Zealousideal_Crew562</name><uri>https://www.reddit.com/user/Zealousideal_Crew562</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Hello, I need to write the code (MIPS Assembly, using MARS 4_5) for a program that reads a positive integer and then calculates something depending on the value and prints it. My issue is the &amp;quot;positive integer&amp;quot; part since I need the program to write a message of error if the user&amp;#39;s input is negative or has decimal places, which I have successfully done for negative (including zero) by taking the number and using the bleqz command and sending it to the label that prints the error message. However, I don&amp;#39;t know how to do it for the non-integer part.&lt;/p&gt; &lt;p&gt;I have been advised to read char by char and check if it&amp;#39;s 0-9 but haven&amp;#39;t been able to properly create the loop for it. Also thought about checking if there&amp;#39;s a &amp;quot;.&amp;quot; in the input but also don&amp;#39;t have the knowledge on how to do it.&lt;/p&gt; &lt;p&gt;I would appreciate some help, I can easily give the entire question text and code that I&amp;#39;ve done. Thank you so much.&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Zealousideal_Crew562&quot;&gt; /u/Zealousideal_Crew562 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zxtt58/beginner_mips_assembly_check_if_noninteger_then/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zxtt58/beginner_mips_assembly_check_if_noninteger_then/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_zxtt58</id><link href="https://www.reddit.com/r/Assembly_language/comments/zxtt58/beginner_mips_assembly_check_if_noninteger_then/" /><updated>2022-12-29T03:03:23+00:00</updated><published>2022-12-29T03:03:23+00:00</published><title>Beginner MIPS Assembly Check if non-integer then error</title></entry><entry><author><name>/u/aareedy</name><uri>https://www.reddit.com/user/aareedy</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;Hi there, I&amp;#39;m reading computer systems a programmer&amp;#39;s perspective to fill up some gasps and I have troupble with understanding one practise task.&lt;/p&gt; &lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;https://preview.redd.it/tp3xgqmmwp8a1.png?width=1328&amp;amp;format=png&amp;amp;auto=webp&amp;amp;s=e9ca6a8768992a7aa267ff2ef84cb83a86f57040&quot;&gt;https://preview.redd.it/tp3xgqmmwp8a1.png?width=1328&amp;amp;format=png&amp;amp;auto=webp&amp;amp;s=e9ca6a8768992a7aa267ff2ef84cb83a86f57040&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I&amp;#39;m unsure why does the address in stack changes from 820 to 818 (2 addresses after calling first(10)) and after that from 818 to 810 (8 addresses calling last(9, 11)).&lt;/p&gt; &lt;p&gt;Could someone explain, please?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/aareedy&quot;&gt; /u/aareedy &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zxnlh1/help_with_understanding_what_stack_does/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zxnlh1/help_with_understanding_what_stack_does/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_zxnlh1</id><link href="https://www.reddit.com/r/Assembly_language/comments/zxnlh1/help_with_understanding_what_stack_does/" /><updated>2022-12-28T22:46:57+00:00</updated><published>2022-12-28T22:46:57+00:00</published><title>Help with understanding what stack does.</title></entry><entry><author><name>/u/WhateverWhateverson</name><uri>https://www.reddit.com/user/WhateverWhateverson</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;I&amp;#39;m working on an assignment relating to far jumps and in the process, I&amp;#39;ve run into an error message that I don&amp;#39;t understand and Google didn&amp;#39;t really help much&lt;/p&gt; &lt;p&gt;I can&amp;#39;t paste it here as part of it is in a different language, but it&amp;#39;s saying something about FIXUP subrecord location 9 not being implemented.&lt;/p&gt; &lt;p&gt;Could anyone please explain to me what that means?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/WhateverWhateverson&quot;&gt; /u/WhateverWhateverson &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zxikr4/x8616_fixup_subrecord_error_message/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zxikr4/x8616_fixup_subrecord_error_message/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_zxikr4</id><link href="https://www.reddit.com/r/Assembly_language/comments/zxikr4/x8616_fixup_subrecord_error_message/" /><updated>2022-12-28T19:31:22+00:00</updated><published>2022-12-28T19:31:22+00:00</published><title>[x86-16] &quot;FIXUP subrecord&quot; error message</title></entry><entry><author><name>/u/Byronyx7</name><uri>https://www.reddit.com/user/Byronyx7</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;As the titles states ,Im trying to figure out how to add multiple numbers(roughly 10 intergers) in ARC together.How do I do it?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/Byronyx7&quot;&gt; /u/Byronyx7 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zxcp31/how_does_one_do_repeated_additions_in_arc/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zxcp31/how_does_one_do_repeated_additions_in_arc/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_zxcp31</id><link href="https://www.reddit.com/r/Assembly_language/comments/zxcp31/how_does_one_do_repeated_additions_in_arc/" /><updated>2022-12-28T15:40:56+00:00</updated><published>2022-12-28T15:40:56+00:00</published><title>How does one do repeated additions in ARC</title></entry><entry><author><name>/u/LawnMoverWRRRRR</name><uri>https://www.reddit.com/user/LawnMoverWRRRRR</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;So here is my code, partially from some tutorial but i tried adding my own part using resources on the internet&lt;/p&gt; &lt;pre&gt;&lt;code&gt;BITS 16 ORG 0x7c00 jmp start start: call clear_screen mov ax,cs mov ds,ax mov si,msg call print call flash_and_play_sound jmp $ print: push ax cld pop ax next: mov al,[si] cmp al,0 je done call printchar inc si jmp next done: ret printchar: mov ah,0x0e int 0x10 ret clear_screen: mov ah, 0x07 mov al, 0x00 mov bh, 0x4F mov cx, 0x0000 mov dx, 0x184f int 0x10 ret flash_and_play_sound: mov bh, 0x4F ; Set text color to white on a red background int 0x10 call delay mov bh, 0xF4 ; Set text color to red on a white background int 0x10 call delay mov ah, 0x02 ; Set AH to 02 to play a beep sound int 0x10 jmp flash_and_play_sound delay: push ax mov ah, 0x86 mov cx, 0xFFFF ; Delay for 500,000 microseconds (500 milliseconds) int 0x15 pop ax ret msg: db &amp;quot;hello world&amp;quot;, 0 times 510 - ($-$$) db 0 dw 0xaa55 &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;The flash and play_sound function are not working in a slightest bit, theres only white text on red background. Could someone briefly explain why is it not working and how to fix it. Im a beginner so please forgive my eventual stupidity&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/LawnMoverWRRRRR&quot;&gt; /u/LawnMoverWRRRRR &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zxc3nt/issue_with_custom_mbr/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zxc3nt/issue_with_custom_mbr/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_zxc3nt</id><link href="https://www.reddit.com/r/Assembly_language/comments/zxc3nt/issue_with_custom_mbr/" /><updated>2022-12-28T15:17:17+00:00</updated><published>2022-12-28T15:17:17+00:00</published><title>Issue with custom MBR</title></entry><entry><author><name>/u/WhateverWhateverson</name><uri>https://www.reddit.com/user/WhateverWhateverson</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;So, I&amp;#39;m writing a short program in which I use the &amp;#39;IDIV&amp;#39; instruction, dividing a hex number by 16. To my understanding, this instruction should leave the quotient in AL register and the remainder in the AH register&lt;/p&gt; &lt;p&gt;I&amp;#39;ve run into a problem where this only works right up to 0x79; 0x80 and above leaves incorrect results. For 0x80 for example, while AH is correctly set to 0, AL is set to 0xF8 instead of the result I expected which would be 0x08&lt;/p&gt; &lt;p&gt;Could anyone please explain to me why this happens?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/WhateverWhateverson&quot;&gt; /u/WhateverWhateverson &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zwnetv/x8616_idiv_instruction/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zwnetv/x8616_idiv_instruction/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_zwnetv</id><link href="https://www.reddit.com/r/Assembly_language/comments/zwnetv/x8616_idiv_instruction/" /><updated>2022-12-27T19:13:28+00:00</updated><published>2022-12-27T19:13:28+00:00</published><title>[x86-16] IDIV instruction</title></entry><entry><author><name>/u/M3ther</name><uri>https://www.reddit.com/user/M3ther</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;NASM code:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;global _start section .text _start: ; square of 5 mov eax,5 mov ebx,5 mul ebx ; display answer mov ecx,eax ; 5*5=25 should be stored in eax, so I am moving that to ecx mov eax,4 mov ebx,1 mov edx,5 int 80h ; exit mov eax,1 mov ebx,0 int 80h &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;The program gives no output after running, and doing &lt;code&gt;echo $?&lt;/code&gt; gives the value 0 (just as expected). What am I doing wrong?&lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/M3ther&quot;&gt; /u/M3ther &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zwej8n/failing_to_produce_output_in_linux_terminal_after/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zwej8n/failing_to_produce_output_in_linux_terminal_after/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_zwej8n</id><link href="https://www.reddit.com/r/Assembly_language/comments/zwej8n/failing_to_produce_output_in_linux_terminal_after/" /><updated>2022-12-27T12:27:20+00:00</updated><published>2022-12-27T12:27:20+00:00</published><title>Failing to produce output in Linux terminal after squaring the number in NASM x86 32 bit assembly</title></entry><entry><author><name>/u/a_sad_individual_oux</name><uri>https://www.reddit.com/user/a_sad_individual_oux</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;OS: Windows 11.&lt;/p&gt; &lt;p&gt;I banged my head against the keyboard all day yesterday, and I still don&amp;#39;t have a good environment for x86_64 Assembly.&lt;/p&gt; &lt;p&gt;So far I have &lt;strong&gt;NASM&lt;/strong&gt; installed, and am using the Subsystem for Linux and running &lt;strong&gt;Ubuntu&lt;/strong&gt; as the terminal. I installed &lt;strong&gt;GDB&lt;/strong&gt; to monitor the registers, however I can&amp;#39;t use it efficiently, and I still wish for an easier way of viewing the registers.&lt;/p&gt; &lt;p&gt;Another thing to note is that the compiled program only seems to work on Linux. It&amp;#39;s supposed to print &amp;quot;Hello World&amp;quot;, but only works in the Ubuntu terminal. What&amp;#39;s up with that?&lt;/p&gt; &lt;p&gt;My commands for compiling are:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;nasm -f elf64 app.asm ld app.o -o app ./app &lt;/code&gt;&lt;/pre&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/a_sad_individual_oux&quot;&gt; /u/a_sad_individual_oux &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zuz5pv/hear_me_out_please_how_am_i_supposed_to_set_up/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zuz5pv/hear_me_out_please_how_am_i_supposed_to_set_up/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_zuz5pv</id><link href="https://www.reddit.com/r/Assembly_language/comments/zuz5pv/hear_me_out_please_how_am_i_supposed_to_set_up/" /><updated>2022-12-25T14:31:48+00:00</updated><published>2022-12-25T14:31:48+00:00</published><title>Hear me out please: How am I supposed to set up x86_64 Assembly in VSCode?</title></entry><entry><author><name>/u/alpha_a286</name><uri>https://www.reddit.com/user/alpha_a286</uri></author><category term="Assembly_language" label="r/Assembly_language"/><content type="html">&lt;!-- SC_OFF --&gt;&lt;div class=&quot;md&quot;&gt;&lt;p&gt;I tried to convert the following C function to assembly emu8086. But, the function is not working. There are some bugs.&lt;/p&gt; &lt;p&gt;&amp;#x200B;&lt;/p&gt; &lt;p&gt;C function&lt;/p&gt; &lt;pre&gt;&lt;code&gt;bool isRectangle(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { double cx,cy; double dd1,dd2,dd3,dd4; cx=(x1+x2+x3+x4)/4; cy=(y1+y2+y3+y4)/4; dd1=sqr(cx-x1)+sqr(cy-y1); dd2=sqr(cx-x2)+sqr(cy-y2); dd3=sqr(cx-x3)+sqr(cy-y3); dd4=sqr(cx-x4)+sqr(cy-y4); return dd1==dd2 &amp;amp;&amp;amp; dd1==dd3 &amp;amp;&amp;amp; dd1==dd4; } &lt;/code&gt;&lt;/pre&gt; &lt;p&gt;Assemply function&lt;/p&gt; &lt;pre&gt;&lt;code&gt;isRectangle PROC ; number should be decimal, round the numbers ; test cases ; prepare some test cases to use it when discussing the project centerX dw 0 xor ax,ax mov al, matrix[0] xor dx,dx mov dl,matrix[2] add ax,dx xor dx,dx mov dl,matrix[4] add ax,dx xor dx,dx mov dl,matrix[6] add ax,dx xor cx,cx mov cl,4 div cl mov centerX,ax centerY dw 0 xor ax,ax mov al, matrix[1] xor dx,dx mov dl,matrix[3] add ax,dx xor dx,dx mov dl,matrix[5] add ax,dx xor dx,dx mov dl,matrix[7] add ax,dx xor cx,cx mov cl,4 div cl mov centerY,ax dd1 dw 0 mov ax,centerX xor cx,cx mov cl,matrix[0] sub ax,cx mul ax mov dx,ax mov bx,centerY xor cx,cx mov cl,matrix[1] sub bx,cx mov ax,bx mul ax mov bx,ax add dx,bx mov dd1,dx dd2 dw 0 mov ax,centerX xor cx,cx mov cl,matrix[2] sub ax,cx mul ax mov dx,ax mov bx,centerY xor cx,cx mov cl,matrix[3] sub bx,cx mov ax,bx mul ax mov bx,ax add dx,bx mov dd2,dx dd3 dw 0 mov ax,centerX xor cx,cx mov cl,matrix[4] sub ax,cx mul ax mov dx,ax mov bx,centerY xor cx,cx mov cl,matrix[5] sub bx,cx mov ax,bx mul ax mov bx,ax add dx,bx mov dd3,dx dd4 dw 0 mov ax,centerX xor cx,cx mov cl,matrix[6] sub ax,cx mul ax mov dx,ax mov bx,centerY xor cx,cx mov cl,matrix[7] sub bx,cx mov ax,bx mul ax mov bx,ax add dx,bx mov dd4,dx xor ax,ax mov ax,dd1 cmp ax,dd2 jne return cmp ax,dd3 jne return cmp ax,dd4 jne return PRINT &amp;quot;The shape is rectangle&amp;quot; int 21h ; draw the rectangle ret return:ret isRectangle ENDP Here is the matrix that I am refering to matrix db 2 dup(?) db 2 dup(?) db 2 dup(?) db 2 dup(?) &lt;/code&gt;&lt;/pre&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; &amp;#32; submitted by &amp;#32; &lt;a href=&quot;https://www.reddit.com/user/alpha_a286&quot;&gt; /u/alpha_a286 &lt;/a&gt; &lt;br/&gt; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zuhr4i/i_tried_to_convert_the_following_c_function_to/&quot;&gt;[link]&lt;/a&gt;&lt;/span&gt; &amp;#32; &lt;span&gt;&lt;a href=&quot;https://www.reddit.com/r/Assembly_language/comments/zuhr4i/i_tried_to_convert_the_following_c_function_to/&quot;&gt;[comments]&lt;/a&gt;&lt;/span&gt;</content><id>t3_zuhr4i</id><link href="https://www.reddit.com/r/Assembly_language/comments/zuhr4i/i_tried_to_convert_the_following_c_function_to/" /><updated>2022-12-24T20:13:39+00:00</updated><published>2022-12-24T20:13:39+00:00</published><title>I tried to convert the following C function to assembly emu8086. But, the function is not working. There are some bugs.</title></entry></feed>