Posts by alexsander • 483 points
18 posts
-
11
votes1
answer199
viewsQ: "[-4:]" What is this syntax?
I have the following expression: namer = name[-4:] Where name gets a name, but what does that mean [-4:]?
-
5
votes1
answer93
viewsQ: Why should we make a bootloader before the kernel first?
Why when we develop an operating system, we always have to make an bootloader, because we can’t start with kernel?
-
0
votes1
answer73
viewsQ: Declaration of char in memory
Guys I declare a char example : char a ; , it is only 1 byte in size , and supposing it is on a 32-bit architecture , it would not have lost address space , 3 bytes of the address would not be free…
architecture-computersasked alexsander 483 -
-1
votes1
answer35
viewsQ: Size of memory addresses
I was watching a video where a guy tells his 32-bit architecture the memory address and 1 byte , but it wouldn’t be 4 bytes?
memoryasked alexsander 483 -
1
votes2
answers582
viewsQ: Doubt pointer cast
Folks when you got a line like this: u_char variavel_teste struct teste *p ; p = (struct teste *)variavel_teste; What is the use of this , and what it means, can you give me an example of a program?…
casked alexsander 483 -
0
votes1
answer111
viewsQ: Cast struct c/c++
Guys I’m seeing a code of a network Sniffer and I’m not understanding the following lines : ethernet = (struct sniff_ethernet*)(packet); ip = (struct sniff_ip*)(packet + SIZE_ETHERNET); how do these…
casked alexsander 483 -
1
votes1
answer59
viewsQ: Python doubts syntax
Galera was studying python and saw on a site this line : self.brotcl.plugins.runCustumcomand() I know that self is referencing a class but and these three variables together as well ?…
pythonasked alexsander 483 -
2
votes1
answer108
viewsQ: Processing calculation of the procesator
Guys, it is possible to calculate the speed of a processor to execute one instruction and several instructions?
architecture-computersasked alexsander 483 -
7
votes1
answer143
viewsQ: Memory addresses
My architecture is 32 bits so my memory addresses are 32 bits? because I was using a debug seeing some codes Assembly and arrived in a part where had a loop , and he was picking up byte by byte of a…
-
1
votes1
answer45
viewsQ: Doubt debugging a program
I was debugging a program and I came up with the following question, had architecture is 32 Bits Intel and had the following instruction MOV EAX, DWORD PTR SS[0X401049], and below that instruction…
casked alexsander 483 -
0
votes1
answer291
viewsQ: Representation of Assembly instructions
How to interpret an Assembly statement with its hexadecimal value in a memory address? 8B 4C 24 04 CORRESPONDS TO THIS -> MOV ECX,DWORD PTR SS:[ESP+4] But if I had only hexadecimal values how…
-
4
votes2
answers815
viewsQ: Why declare pointer to array if arrays are already pointers?
if an array char is already a pointer, why declare a pointer to the array? And what’s the difference between char exemplo[10] and char *exemplo[10]?
-
4
votes1
answer898
viewsQ: How do bit operators work?
I have the following code: volatile long Hex_To_int(long Hex , char bits) { long Hex_2_int; char byte; Hex_2_int = 0 ; for(byte = 0 ; byte < bits ; byte++) { if(Hex& (0x0001 << byte))…
-
5
votes1
answer59
viewsQ: Doubt cast with pointer
while( ++idx <= fp_size) { byte current = buff[idx]; int integer = 0 ; short shortint = 0 ; if(idx < fp_size - 3) integer = *((int *))&buff[idx]; } What kind of cast is this *((int *))?…
-
0
votes1
answer53
viewsQ: Doubt about functions and classes
class base_token { public: typedef enum { t_invalid_token=0, t_symbol, t_integer, t_literal, t_punctuation, t_keyword } type_of_token; private: type_of_token token_type; public:…
c++asked alexsander 483 -
0
votes2
answers99
viewsQ: Doubt classes c++
Good morning guys! I’m seeing classes and I saw this syntax in one of the examples: vector<line *>line_table; vector<line *>::iterator iterator; line parser * basic_parser; long…
-
-1
votes1
answer54
viewsQ: Bootloader - programming
I’ve seen that code from a bootloader : https://ghostbin.com/paste/mwpub And I can’t understand that part : MBOOT_PAGE_ALIGN equ 1<<0 MBOOT_MEM_INFO equ 1<<1 Well I wonder what that…
casked alexsander 483 -
0
votes2
answers357
viewsQ: How to translate a hexadecimal statement on the intel x86 architecture to Assembly?
How to do this by looking only at the hexadecimal values of an address?
assemblyasked alexsander 483