Where do I learn assembly?

This is a discussion on Where do I learn assembly? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I want to learn assembly, but I don't want to do it with that HLA stuff that they use on ...

  1. #1
    Registered User WebSnozz's Avatar
    Join Date
    Oct 2001
    Posts
    102

    Where do I learn assembly?

    I want to learn assembly, but I don't want to do it with that HLA stuff that they use on the Art of Asembly page.

    Also, could someone post a simply Hello World source that would compile in VC++ using the _asm thing?
    WebSnozz-
    Cats have no butt cheeks.
    If one farted, then it would make a flute noise.

  2. #2
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    they probably have many other resources [perhaps even free/online] aside from AoA... however i've heard it mentioned as if it was the defacto standard to learn the language... seek and ye shall find...
    hasafraggin shizigishin oppashigger...

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    Randall Hyde


    This guy has written an ebook that you can download free.

    Warning ASM is not for the faint hearted

  4. #4
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    Randall Hyde wrote AoA, what he doesn't want to do. But it's probably the best for learning to do asm on MSVC as most other books/tutorials require a dos compiler. If you want to see the asm for Hello World then you can look at the asm generated by MSVC, it'll be something like -

    Code:
    #include <stdio.h>
    
    int main()
    {
    	char* a = "Hello World!\n";
    	char* format = "%s";
    
    	_asm
    	{
    		mov eax,dword ptr[a]
    		push eax
    		mov ecx,dword ptr[format]
    		push ecx
    		call printf
    		add esp,8
    	}
    
    
    	return 0;
    }
    zen

  5. #5
    Registered User WebSnozz's Avatar
    Join Date
    Oct 2001
    Posts
    102
    How do I get it to generate assembly? I only see an obj file and it opens up as a binary file type.
    WebSnozz-
    Cats have no butt cheeks.
    If one farted, then it would make a flute noise.

  6. #6
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    Project/Settings, C/C++ tab, Listing Files category, then select your option in the Listing File Type combo box.

    edit- It's easier to understand if you compile with no optimisations.
    Last edited by zen; 11-11-2001 at 04:14 PM.
    zen

  7. #7
    Registered User WebSnozz's Avatar
    Join Date
    Oct 2001
    Posts
    102
    Thanks Zen, I knew there had to be a way to do it.

  8. #8
    Former Member
    Join Date
    Oct 2001
    Posts
    955
    I have a question for you, zen: why the

    add esp,8 ?

    maybe you could do

    Code:
    #include <windows.h>
    
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
    {
    char* Text="Hello, World";
    
    _asm
    {
    mov ecx,MB_OK
    push ecx
    mov eax, dword ptr [Text]
    push eax
    push eax
    mov eax,NULL
    push eax
    call MessageBox
    }
    return 0;
    }
    but, it might need a mov or an add with esp, that's why I ask
    I just thought it may work, someone with time, please try it.

    I have used Assembly to crack games, though I have only needed to crack one, and I did it, succesfully. But I think I'll only use it when I really need it.

    Oskilian
    Last edited by oskilian; 11-11-2001 at 04:58 PM.

  9. #9
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    Adding the size of the arguments pushed onto the stack, onto the stack pointer - cleaning up as it's __cdecl.
    zen

  10. #10
    Former Member
    Join Date
    Oct 2001
    Posts
    955
    oh, thanks (learn one new thing every day)

    Oskilian

  11. #11
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    I don't think there is big gap between the HLA in AoA and

    nasm or any other assembler. Anyways I have two books one of which covers linux/intel assembly the other one does SPARC like assembly with an emulator; I don't have any on windows/intel assembly.
    Last edited by Nick; 11-11-2001 at 05:30 PM.

  12. #12
    Registered User WebSnozz's Avatar
    Join Date
    Oct 2001
    Posts
    102
    What is a register?, and what is a flip-flop(not the kind on your foot?
    WebSnozz-
    Cats have no butt cheeks.
    If one farted, then it would make a flute noise.

  13. #13
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    A flip-flop is a kind of sequential circuit, and a register
    is made with flip-flops.

  14. #14
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    Book suggestion:


    Assembly Language Primer


    It is the best Assembley book you will every read.
    My Website

    "Circular logic is good because it is."

  15. #15
    Registered User WebSnozz's Avatar
    Join Date
    Oct 2001
    Posts
    102
    Could you expand on the registry thing some more. I am going through the AoA thing and he just starts tossing the term around like it's something I should have already learned about. I don't have any formal programming or computer classes, but I grasped alot of the hardware stuff he talks about except the registers. Best guess is they are some sort of memory, are they part of the processor, mainboard, or memory?

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help using inline assembly for keyboard input
    By sleventeen in forum C Programming
    Replies: 7
    Last Post: 05-10-2009, 01:31 AM
  2. Can I learn Assebmly for reverse-engineering?
    By CChakra in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 09-20-2008, 11:13 AM
  3. Assembly Language Programming
    By shabbirhussain in forum Tech Board
    Replies: 3
    Last Post: 09-15-2008, 10:59 PM
  4. How Di read security permissions of Assembly!!
    By maryjj01 in forum C# Programming
    Replies: 0
    Last Post: 05-27-2007, 11:22 AM
  5. Assembly question
    By linucksrox in forum Tech Board
    Replies: 13
    Last Post: 04-08-2007, 06:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21