News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Native assembly languages on AMD and Intel processors?

Started by RedSkeleton007, September 10, 2015, 03:45:31 AM

Previous topic - Next topic

RedSkeleton007

I just thought of something today. The majority of my posts on these forums were done on my school laptop, which has an Intel processor. My main computer in my apartment has an AMD processor. Is it still possible to use the same masm32 x86 processor assembly language of these forums on a Windows 7 computer with an AMD processor?

hutch--


dedndave

AMD uses x86 technology
in extended instruction sets, there may be some differences
but, the core instruction sets are pretty compatible

AMD and intel have optimized some instructions differently
so, it's often interesting to compare them

zedd151

In general, I would think that if the processor can run Windows, it should be able to run masm32.

Not sure about 64bit.

dedndave

not really sure about that one
Windows CE, for example, is designed for embedded controllers
lord only knows if that includes non-x86 machines

"assember is assembler" - probably not a good assumption - lol
every processor family has unique architecture
and - different assemblers use different syntax (i hate intel syntax - lol)

i will say this - after you've learned to code for a half-dozen different processors/microcontrollers,
it gets easier to pick up a new one   :P

zedd151

The assumption on my part was more along the lines that if a machine can run let's say
Windows XP, the masm32 package should be able to install, compile programs then
run the programs created with ml and link.

I would never assume that 'assembler is assembler'.

I forget what processor it was, but I looked at some assembly code for programs written
for a programmable graphing calculator (Texas Instruments). The processor there had dozens of registers.

That would certainly come in handy on the x86 platform. 
And would surely speed up my dying laptop. :icon_mrgreen:

dedndave

TI made hundreds of calculator processors - lol
they were pioneers, in many ways

back in the late 70's, i worked for General Instruments
we made memories, calculator chips, etc
the biggest market was game chips (arcade and home computer)
the calculator chips were very simple, compared to the ones made by TI

zedd151

Don't forget about the highly specialized instruction sets in those TI processors.
Anyway the assembly language there was FAR beyond my comprehension.

So, back then I stuck to programming the calc with TI Basic. My very first
introduction to programming some 18 years ago.

hutch--

I think you need to know the specifics of any hardware to know what you can write code for it with. On a PC, if it runs Windows you are reasonably safe in assuming that it is x86 or x86-64 but you can get caught out with some gadgets, some run an Intel Atom which is basic x86 but there are other chips used, ARM and a few others and you need the specific assembler if one is available for that chip.

On a cut down version of Windows on x86 the mnemonics are the same from memory but there are fewer OS API functions so code written for a PC in x86 may fail due to missing functions when run on a gadget.

K_F

'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

Neil

On Intel processors Console mode automatically appears as 25 lines & 80 columns. I've recently changed to an AMD processor & found that if I don't set the console to 80 x 25 at the beginning of the program it appears as still 25 lines but (& I haven't counted them) more like 160 columns, so something is different. 

RedSkeleton007

Quote from: dedndave on September 10, 2015, 03:06:33 PM
i will say this - after you've learned to code for a half-dozen different processors/microcontrollers,
it gets easier to pick up a new one   :P
I wasn't expecting so many replies to this thread. At this point, I'm starting to think that it's impossible to 'pick one'. :dazzled: All I know right now is that the two very most important versions of assembly to master is for x86 processors and for my beloved Super Nintendo hacking. Hacking Super Mario World was what made me decide to become a programmer 4+ years ago.

Farabi

Hi,

I used 64-bit desktop on my office, pretty much it ran most of the 32-bit software, except VB6. Most OCX cant be registered on Win 7 which I had no idea why. x64 used different system folder, "System32" is in tandem with "SysWow64"  :greensml: , well that is the default name for the 64-bit folder.
On 64-bit machine there are 3 modes, 16-bit, 32-bit and 64-bit, pretty much different than what I knew. Mostly, when I ran MS-based compiler I need a virtual machine, but fortunate enough anything built with MASM32 will be compatible, as long as you dont use any dependencies that are troubled, like COM, or OCX(mostly, not all, at least what I encountered).

http://farabidatacenter.url.ph/MySoftware/
My 3D Game Engine Demo.

Contact me at Whatsapp: 6283818314165

jj2007

Quote from: Farabi on October 20, 2015, 04:06:02 PM"SysWow64"  :greensml: , well that is the default name for the 64-bit folder.

No, it's the 32-bit folder.

QuoteOn 64-bit machine there are 32 modes, 16-bit, 32-bit and 64-bit

AssemblyChallenge

My two cents on the subject:

In practical terms there is a very very very little chance you will never need to go so deep inside AMD's specific instruction set, or at least, in the x86 universe. This is because about 95%+ of the opcodes you need are common for both, Intel & AMD.

If your boss someday tells you: "I need you to code a program taking advance of every single capacity inside our AMD CPUs" would likely means that:

* You are working exclusively with AMD processors (your program would crash at times for unsuported opcodes if runned on Intel).
* The program is extremely specific in what it is doing in order to achieve a result. That is, could be trying to do something faster by using those specific opcodes.

If you want to know every single bolt and nut inside AMD, then go here:

http://support.amd.com/en-us/search/tech-docs#Default={%22k%22%3A%22x86%22%2C%22r%22%3A[{%22n%22%3A%22TechDocSubtypeOWSCHCS%22%2C%22t%22%3A[%22\%22%C7%82%C7%8250726f6772616d6d6572205265666572656e636573\%22%22]%2C%22o%22%3A%22OR%22%2C%22k%22%3Afalse%2C%22m%22%3A{%22\%22%C7%82%C7%8250726f6772616d6d6572205265666572656e636573\%22%22%3A%22Programmer%20References%22}}]}

(sorry, copy/paste the whole thing because that weird link is inmune to BB Codes :dazzled:) And start with "AMD64 Architecture Programmer's Manual Volume 1: Application Programming" you can also filter out the results from there.