- Видео 44
- Просмотров 1 865
Dr. Milhous
Добавлен 16 фев 2010
I am a former professor of Computer Science and Cyber Security. Teaching online to help others learn these skills.
Видео
2 4) Two's Complement
Просмотров 103 месяца назад
This video shows how to store numbers in 2's complement. We print out the binary and review the algorithm used to convert them to base 10.
1.0) Assembly Template [quick start]
Просмотров 115 месяцев назад
1.0) Assembly Template [quick start]
ANSI colors are always nice to understand the significance and capability of statements.
I failed before and I failed again today. I just seem to not be able to SetConsoleMode such that I may use the codes. I get ERROR_INVALID_PARAMETER sent back as an error code.
MOAR... 0xFEEDME
I enjoyed this video; Thanks! I have been building an Assembly compiler for a long damn time now. And I am not a C type of developer; even though I have watched a lot of C type RUclips videos. I am not very capable of writing C. So when you write this C code and show me what the assembly looks like, this gives me the opportunity to write a similar version in my compiler and see what the final ASM looks like too. Then I can compare what C spits out versus what mine spits out. And this process reveals weaknesses and strengths and what flat out just does not work. Currently I am AFH (away from home) and I am using a compiled version of my compiler and I cannot fix what is not working. I failed at creating upper memory data and assigning the struct pointer to that memory. But what I did get working is this: My struct declare looks like this. I used assembly data types because I just think they are easier to understand. Private Type MyType db MyLetter DW MyShort DQ MyNum DB AnotherLetter End Type Here is a snippet of the function: Sub Version1() Local data MyType named MyType NOP MOV MyType.Variables.MyLetter, 'a' MOV MyType.Variables.MyShort, 0x255 MOV MyType.Variables.MyNum, 0xFEED MOV MyType.Variables.AnotherLetter, 'b' End Sub The data is located in the .Data section; the fact that it is declared as a local variable is just a thin layer of abstraction. Its not a stack variable. The keyword 'data' makes it happen this way. Other compilers use the keyword 'Static' for the same result. And I use to use the kehword 'Static' too. But for reasons that I don't want to get into, I changed it to 'Data' about 6 months ago. I could not write the full 0xFEEDBEEF - not exactly sure why. It told me that there was no instruction available. And I noticed that the C compiler wrote the constant into RDX - first. Then moved that into the final memory destination. So it bypassed this problem with an extra line of code. Here is what the debugger shows: mov byte ptr ds:[24140], 61 mov byte ptr ds:[24141], 255 mov byte ptr ds:[24143], FEED mov byte ptr ds:[24148], 62 It was really a relative address calculation, [RIP + ????], but the debugger resolves it as a memory address. Also notice that these addresses are not on any alignment boundaries; I kept it simple and my data is just stacked one variable right after the other. I do have a keyword called 'Align' that will align a variable on a 16 byte boundary. But the default is to just stack the data as is. So when I get home, I will work on why I could not get this to work in upper memory and this will be growth for me. And again... that I why I subscribed and watch your videos, Thanks Again!
The alignment is because it is faster, not because the CPU cannot do that. You should be able to move the whole dword into the memory location, as long as you are on a 32 bit or 64 bit os/mode. There are different instruction prefixes to allow this from the assembly level.
Haha 😅
-Clicked into video -Notices using light mode -Clickoed out of video
I'm too stupid to understand what is going on..
Thank you for the livestream. It will be great if you keep talking something random even when you are just messing around.
You are a Master 😎😎😎
Thanks
Four out of five dad's agree, this is a fantastic prank. The fifth dad had to give away all his green skittles...