Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old February 24th, 2007, 11:21 AM
dustpyle_x3 dustpyle_x3 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 82 dustpyle_x3 User rank is Corporal (100 - 500 Reputation Level)dustpyle_x3 User rank is Corporal (100 - 500 Reputation Level)dustpyle_x3 User rank is Corporal (100 - 500 Reputation Level)dustpyle_x3 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 3 h 48 m 14 sec
Reputation Power: 4
Registers in assembly

What are they exactly and how do they work? I can't seem to find any tutorial that goes in depth about it. For example, I have this Hello World program:
assembly Code:
Original - assembly Code
    section .data         hello: db 'Hello world!',10         helloLen: equ $-hello section .text         global _start _start:         mov eax,4         mov ebx,1         mov ecx,hello         mov edx,helloLen         int 80h         mov eax,1         mov ebx,0         int 80h

That's about as far as every tutorial will take me, but I have no idea what's going on here. Can anyone explain to me or link me to something that can help?

Reply With Quote
  #2  
Old February 24th, 2007, 11:32 AM
Purple Avenger Purple Avenger is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 271 Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level)Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level)Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level)Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level)Purple Avenger User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 2 Days 1 h 51 m 31 sec
Reputation Power: 9
Spend some time in the architecture section where all the registers are described.

Intel Programmer Manual

Assembler syntax varies from one assembler to another in the Intel world, but once you understand the underlying processor architecture, those differences degenerate to just an annoyance.

Reply With Quote
  #3  
Old February 24th, 2007, 01:08 PM
Lux Perpetua Lux Perpetua is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Feb 2004
Location: San Francisco Bay
Posts: 1,418 Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 47 m 34 sec
Reputation Power: 334
To answer your question briefly, a register is a piece of data (typically 32 bits) that the processor has immediate access to. There are very few of them (on the x86 platform, there are 8 general-purpose registers). To manipulate other data in memory, it's therefore customary to move the data into registers, do whatever you want with it there, and then move it back to memory. On some architectures (e. g. SPARC, if I recall), this is the only way to manipulate data in main memory, since the instruction set has no instructions to operate directly on main memory except to move data to and from registers. However, Intel is different, since many instructions can operate on memory directly.

Take a look at Schol-R-Lea's long list of assembly resources: http://forums.devshed.com/showpost....060&postcount=6

I'm not saying it's the best, but this helped me when I was starting out with x86 assembly: http://www.drpaulcarter.com/pcasm/

To fully understand the code you posted, you'll need to delve into Linux assembly, since the "int 80h" system call protocol is specific to Linux.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Registers in assembly


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway