Random Homebrew: pj1115's HB Collection
pj1115's collection of source code and his latest releases.
This archive is different from the [...]
Friends: Coding 'n Cracking - Nymphaea - PS3 Forum - darkforestgroup - daxhordes.org - Tgames - coldbird - gopsp.it - pspstation.org - prometheus - hgoel.info - MakeSmartTV - ps vita

[Tutorial] Advanced C

Discuss about your favorite (gaming...or not) devices here. The most popular ones will end up getting their own categories
Programming discussions for your favorite Device

Re: [Tutorial] Advanced C

Postby m0skit0 » Wed Mar 14, 2012 8:22 am

frank wrote:I am on Ubuntu 10.04 in a VM (If its the VM screwing with stuff, then I'll try again soon as I fix my hard Ubuntu installation)

The VM has nothing to do. Your Ubuntu is old, and if you didn't update GCC, you're using an old GCC as well, so it's normal you don't get the same output.

I see you've posted x/w $1 twice, but you didn't show what you did between one and the other. If you did nothing, well obviously the output is the same and it's correct.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
User avatar
m0skit0
Guru
 
Posts: 4783
Joined: Mon Sep 27, 2010 6:01 pm

Re: [Tutorial] Advanced C

Postby frank » Wed Mar 14, 2012 11:12 pm

Alright...
apt-get said that build-essential is latest version
I guess I'll update ubuntu although...egh...oi ill have an updated vm and hard 10.04 (cuz i need that version specifically for other things)

Anyways, i did "s" between those two "x/w $1"s.
Sig shrink!
PSP 2000 6.60 ME-1.8
G1 - Super D 1.11
Samsung Galaxy Tab 2 GT-P5113 - CyanogenMod 10
PC - Windows 7 - P4 3.20ghz HT - 3 gb 756 mb RAM - ATI Radeon x600
Cardboard box server - Ubuntu Server :D - AMD Athlon XP 3000+ - 512mb RAM
frank
 
Posts: 545
Joined: Wed Mar 23, 2011 5:15 am
Location: northwest usa

Re: [Tutorial] Advanced C

Postby m0skit0 » Thu Mar 15, 2012 9:05 am

frank wrote:Anyways, i did "s" between those two "x/w $1"s.

You need another "s" because you need mov %eax,-0xc(%ebp) to execute to update the value in RAM. LEA instruction only modifies the CPU register, not the variable per se.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
User avatar
m0skit0
Guru
 
Posts: 4783
Joined: Mon Sep 27, 2010 6:01 pm

Re: [Tutorial] Advanced C

Postby frank » Fri Mar 16, 2012 12:47 am

m0skit0 wrote:
frank wrote:Anyways, i did "s" between those two "x/w $1"s.

You need another "s" because you need mov %eax,-0xc(%ebp) to execute to update the value in RAM. LEA instruction only modifies the CPU register, not the variable per se.

Ah, okay i think I understand. So the LEA instruction calculates into a CPU register, and the mov instruction moves it to RAM, right?
I'll try it when I find the time, because I am busy right now.
Sig shrink!
PSP 2000 6.60 ME-1.8
G1 - Super D 1.11
Samsung Galaxy Tab 2 GT-P5113 - CyanogenMod 10
PC - Windows 7 - P4 3.20ghz HT - 3 gb 756 mb RAM - ATI Radeon x600
Cardboard box server - Ubuntu Server :D - AMD Athlon XP 3000+ - 512mb RAM
frank
 
Posts: 545
Joined: Wed Mar 23, 2011 5:15 am
Location: northwest usa

Re: [Tutorial] Advanced C

Postby m0skit0 » Fri Mar 16, 2012 8:31 am

frank wrote:So the LEA instruction calculates into a CPU register, and the mov instruction moves it to RAM, right?

Absolutely.
I wanna lots of mov al,0xb
Image
"just not into this RA stuffz"
User avatar
m0skit0
Guru
 
Posts: 4783
Joined: Mon Sep 27, 2010 6:01 pm

Previous

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest