Stack, Hexazahl pushen?

X86, Assembler

mov eax, 4711h

push eax eax ist 4 Byte breite

47 11 00 00 Diese Zahl wird jetzt auf den Stack gepusht per littleEndian, d. h. kleinstes Byte an kleinster Adresse.
Wie sehe dies jetzt im Stack aus? ebp => höchste Adresse, esp => kleinste Adresse

47 Adresse 1003

11 Adresse 1002

00 Adresse 1001

00 Adresse 1000

Oder steht im Stack alles in einer Zeile

00 00 11 47 ?

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
1 Answer
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
KarlRanseierIII
1 year ago
if(StackAddressSize == 32) {
	if(OperandSize == 32) {
		ESP = ESP - 4;
		SS:ESP = Source //push doubleword
	}
	else { //OperandSize == 16
		ESP = ESP - 2;
		SS:ESP = Source; //push word
	}
}
else { //StackAddressSize == 16
	if(OperandSize == 16) {
		SP = SP - 2;
		SS:ESP = Source //push word
	}
	else { //OperandSize == 32
		SP = SP - 4;
		SS:ESP = Source; //push doubleword
	}
}

Das ist die Push-Operation des x86.