Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

ASSEMBLY

Name: OP 2010-07-22 10:44

I've decided I'd like to try and learn assembly in my spare time.

But I want to know how hard it would be compared to learning C.

And also if you know assembly, how long did it take you to learn and how often do you end up using it?

Not really sure how threads like these go down on /prog/ but I figured here is the best place to ask at least.

Name: Anonymous 2010-07-22 10:49

I don't think I want to read this post.

Name: Anonymous 2010-07-22 10:53

Just fucking learn it, goddammit. This isn't some huge undertaking that is likely to take up years of your time, and it's not like you have anything better to do anyway.

Name: OP 2010-07-22 11:02

Okay then is there any reason the registers are named how they are?

Name: Anonymous 2010-07-22 11:17

Depends on which assembly language you're using.

Name: Anonymous 2010-07-22 11:41

>>4
Jesus fuck.

Name: Anonymous 2010-07-22 11:45

Name: Anonymous 2010-07-22 11:51

Each register name is really an acronym. This is true even for the "alphabetical" registers EAX, EBX, ECX, and EDX. The following list shows the register names and their meanings:

    * EAX - Accumulator Register
    * EBX - Base Register
    * ECX - Counter Register
    * EDX - Data Register
    * ESI - Source Index
    * EDI - Destination Index
    * EBP - Base Pointer
    * ESP - Stack Pointer

Name: OP 2010-07-22 11:55

Anal sex hurts ;_;

Name: Anonymous 2010-07-22 12:20

>>8
You forgot EIP, TSS, CS, DS, ES, FS, GS, SS, EFLAGS, GDTR, IDTR, LDTR, TR, MSW, CR0-7 and DR0-7.

i wont mention the SSE, x87, MMX and all that other crap.

Name: Anonymous 2010-07-22 12:24

The registers are named r0-r31 because there are 32 of them, and they are numbered from zero.

Name: Anonymous 2010-07-22 12:26

>>11
GB2 IBM

Name: FrozenVoid 2010-07-22 13:33

>>10
I store my variables in these for optimized inline assembler routines. Those "special" registers are just hidden from casual programmers. Its like a big secret in the industry.

Name: Anonymous 2010-07-22 14:47

I've been threatening to teach myself ARM assembler lately. Because it's simple, cool and hip.

Name: Anonymous 2010-07-22 15:38

I learned assembly back in the days of the C64 (6502 asm) and then got interested in Carmack's articles during the development of Doom.  He had to do all the graphics shit with 80286 assembly.

Name: VIPPER 2010-07-22 15:45

>>15
WHAT IN THE NAME OF JEWS?

Name: Anonymous 2010-07-22 16:24

>>15
I don't think so!

Name: Anonymous 2010-07-22 17:57

I learnt what I needed to know for a toy compiler I was writing. It's simple enough to learn (what I needed) in a few days, the tough stuff would be writing an ENTERPRISE program, the size of a small county.

tl;dr >>3

Name: >>18 2010-07-22 18:06

Besides, if you get stuck, you've got your friendly neighbourhood /prauge/ to help you out, as I found in >>>1273940930

Name: Anonymous 2010-07-22 19:15

>>13
1/10

Those are not general purpose registers, most can't be used to store general-purpose data. They represent the CPU's status in various forms.

EIP - (extended) instruction pointer
EFLAGS - (extended) flags

EIP points to the current instruction, so you can't really use it to meaninfully store anything without crashing the thread.

cs-ss - segment regs, set by the OS or programmer, again they point to memory or descriptors.

TSS - current task status register.

MSW's - not portable between CPUs, local cpu-specific flags and configuration (can be very useful for some specific things)
GDTR - global descriptor table register
IDTR - interrupt descriptor table register
They point to those descriptor tables.

CR0-7 - protected mode configuration registers.

DR0-7 - debug registers. some contain configuration, and 4 of them contain the hardware breakpoint addresses. Can actually be used to store arbitrary data, but you'll have to set some handlers to ignore random int1's that would occur if the breakpoints are hit!

Those registers aren't hidden from casual programmers, they're just special registers with special purposes. They can be modified by the programmer through a variety of means (some need you to run code in ring0, so a driver is required), others (like drx, eip, eflags) are the current processes' status, so they can be modified easily, how? eip - any instruction changes eip (increment by size of instruction upon execution), jumps change it explicitly (jmp eax would be the same as mov eip, eax, except jmp eax makes a lot more sense), retn pops it from the stack, and so on (there are many other instructions tha change eip). eflags can be changed by a large variety of instructions, like arithmethic ones, and specific flags can be checked by jumps and other instructions. eflags can also be explicitly set by using popfd (and saved to stack by pushfd). Debug registers can't be set directly in ring3 (can be done in ring0), however operating systems provide facilities to set them (along with ANY register), for example in Win32, it can be done by using exception handlers or the SetContext API.

Name: Anonymous 2010-07-22 20:57

Assembly is so easy even a 10-year-old would understand the concept. It's just straight-line execution, with the exception of jumps/calls/returns. However, you'll find that it's rather tedious.

Name: Anonymous 2010-07-22 21:02

>>19
Your >> is invalid

Name: Anonymous 2010-07-22 21:08

>>10,20
Let's see if I remember / can guess / bullshit my way through the segment regs.

Code Segment
Data Segment
Extended (Extra?) Segment
F??? Segment (Free? Floating? Fuckwit?)
Global Segment
Stack Segment

Name: Anonymous 2010-07-22 21:08

>>20
YHBT
There's little point in rating the troll (and particularly giving it a low rating) if you're going to fall for it hook, line, and sinker anyway.

Name: Anonymous 2010-07-22 21:09

>>24
I don't think replying with actual information for the benefit of others would constitute falling for a troll. Especially considering the troll was acknowledged.

Name: Anonymous 2010-07-22 21:09

>>24
HYBMT?

Name: 25 2010-07-22 21:09

>>26
If so, IHBMMT

Name: Anonymous 2010-07-22 21:21

>>23
ds,es,fs,gs are just data segments. ds is the main one, while the others are just extra. Not sure they're even supported to have a name, but ds and es does indeed stand for data and extra segment, I guess they didn't bother to name the other 2. They're used by the OS and even user-mode apps, but for what depends on the OS and applications. For example, on Win32, various offsets into FS( 0, 18, 30) can hold things like process information, local thread storage, exception handler chain and other important process/thread information, some being read-only, other being mutable( the process loader usually does the initial setup of these segments, and they point to memory from within the current proess, just like the data segment, which just points to the start of the process memory).

Name: Anonymous 2010-07-22 21:38

>>20
I recommend you look at the poster's name before responding.

Name: Anonymous 2010-07-22 22:44

>>24
I always take the reciprocal when people do that. Much more accurate.

I'm surprised at how fast this thread accreted shit. I shouldn't be, but it gets me every time. >>1 ASSEMBLYERY LOL >>2- SHITPOST LOL.

>>30 Terrible! LOL!

Name: Anonymous 2010-07-23 0:40

>>23
FS and GS are just alphabetically following ES. Those two registers were added in the 80386 architecture and do don't fit into the original 8086 model.

Name: Anonymous 2010-07-23 1:42

>>31
DO or DON'T? Jeez make up your mind.

Name: Anonymous 2010-07-23 2:56

Name: Anonymous 2010-07-23 3:40

>>33
Hmm, this looks interesting... *scrolls to random page*
One obvious spelling error right in the middle
*closes window*

Name: Anonymous 2010-07-23 4:38

>>20
EIP points to the current instruction, so you can't really use it to meaninfully store anything without crashing the thread.
On Intel 64 I imagine you could use the upper bits to store things.

Name: Anonymous 2010-07-23 5:13

>>35
I dont think so.
I dont know much about IA64 and the way of addressing for that matter, but i dont think there are 32 extra bits in RIP just unused.

Name: Anonymous 2010-07-23 5:26

>>36
Not 32, but at least 16 since 64-bit addresses are only 48 bits wide.

Name: >>20 2010-07-23 5:34

>>35-37
Yes and no. The instruction pointer register was named: ip, eip, rip, for 16bit x86, 32bit x86 and 64bit x86. in the case of ip and eip, all the bits are in use, however as >>37 said, only 48bits are currently used for addressing. So, in the case of EIP, you can't use it for extra storage, but in the case of RIP, you can (at least for now). I once disassembled some x86_64 kernel code (from ntoskrnl) and saw that they do indeed use the upper bits for special purposes. I could also see some languages like Lisps benefit from this as they could use it to tag data.

Name: Anonymous 2010-07-23 5:45

>>38
Cool

Name: Anonymous 2010-07-23 6:35

>>35-39
Experience from older systems (68000, 26-bit ARM) has shown this to be an awesome idea.

Name: Anonymous 2010-07-23 7:43

>>34
using windows, not tabs
Pig disgusting.

Name: Anonymous 2010-07-23 7:57

>>41
He closed his entire PDF reading session out of disgust.

Name: air max shoes 2010-07-23 10:54

http://www.cheapairmaxs.com air max
http://www.cheapairmaxs.com air max shoes
http://www.cheapairmaxs.com/nike-air-max-2012-c-111.html nike air max 2012
http://www.cheapairmaxs.com/mens-air-max-2010-c-93.html mens nike air max 2010
http://www.cheapairmaxs.com/womens-air-max-2010-c-96.html womens nike air max 2010
http://www.cheapairmaxs.com/mens-air-max-2009-c-95.html mens nike air max 2009
http://www.cheapairmaxs.com/womens-air-max-2009-c-98.html womens nike air max 2009
http://www.cheapairmaxs.com/nike-air-max-2003-c-101.html nike air max 2003
http://www.cheapairmaxs.com/nike-air-max-97-c-94.html nike air max 97
http://www.cheapairmaxs.com/mens-air-max-95-c-102.html mens nike air max 95
http://www.cheapairmaxs.com/womens-air-max-95-c-103.html womens nike air max 95
http://www.cheapairmaxs.com/nike-air-max-93-c-106.html nike air max 93
http://www.cheapairmaxs.com/mens-air-max-91-c-104.html mens nike air max 91
http://www.cheapairmaxs.com/womens-air-max-91-c-105.html womens nike air max 91
http://www.cheapairmaxs.com/nike-air-max-89-c-121.html nike air max 89
http://www.cheapairmaxs.com/nike-air-max-88-c-112.html nike air max 88
http://www.cheapairmaxs.com/mens-air-max-87-c-108.html mens nike air max 87
http://www.cheapairmaxs.com/womens-air-max-87-c-109.html womens nike air max 87
http://www.cheapairmaxs.com/nike-air-max-180-c-123.html nike air max 180
http://www.cheapairmaxs.com/nike-air-max-360-c-124.html nike air max 360
http://www.cheapairmaxs.com/mens-air-max-ltd-c-122.html mens air max ltd
http://www.cheapairmaxs.com/womens-air-max-ltd-c-116.html womens air max ltd
http://www.cheapairmaxs.com/nike-air-max-bw-c-117.html nike air max bw
http://www.cheapairmaxs.com/air-max-premium-c-118.html air max premium
http://www.cheapairmaxs.com/air-max-skyline-c-114.html air max skyline
http://www.cheapairmaxs.com/air-max-zenyth-c-125.html air max zenyth
http://www.cheapairmaxs.com/nike-air-max-tn-c-115.html nike air max tn
http://www.cheapairmaxs.com/kids-air-max-90-c-119.html kids air max 90
http://www.cheapairmaxs.com/kids-air-max-bw-c-120.html kids air max bw

Name: Anonymous 2010-07-23 11:44

>>22
Pray tell, how do I go about correcting such a violation?
shiichan?

Name: Anonymous 2010-07-23 11:51

Name: Anonymous 2010-11-02 20:55

Name: Anonymous 2010-12-06 9:11

Back to /b/, ``GNAA Faggot''

Name: Anonymous 2011-02-04 13:56

Don't change these.
Name: Email:
Entire Thread Thread List