Assembly Guy 72 Posting Whiz

See http://stackoverflow.com/questions/1699748/what-is-the-difference-between-mov-and-lea#answer-1699778 for information on the difference between a value and effective address.

Assembly Guy 72 Posting Whiz

What's your question?

Assembly Guy 72 Posting Whiz

FWIW, my Intel 8086 assembler/machine code reference manual still has a place of honor on my bookshelf...

FWIW, I bought some Z80 chips this year... :p

Assembly Guy 72 Posting Whiz

open(c:/wampserver/tmp/sess_4bkd7oiqmi7298mhikv09447t6, O_RDWR

It's trying to open a session file using a Windows-style filepath... That's odd. It might be a configuration parameter being set inside your PHP code, for example:

ini_set('session.savepath', 'c:/wampserver/tmp/')

You shouldn't need a line like the above, but it sounds like someone/something put that into your code, which means that the live copy will be trying to open a file in a path which doesn't exist, hence your error messages. Without this option, PHP will stick to its configuration file on the web server, which will normally be the system default.

Assembly Guy 72 Posting Whiz

As SHL said, no. In my experience, the only times you will need assembly is if you're developing and operating system, or you're developing on an architecture for which there isn't a compiler for a higher level langauge (eg C). High level languages were invented to be quicker to write, faster to learn and easier to understand than lower level languages. There's a reason that mainstream programmers focus on high level languages.

That being said, if you want to learn assembly, there's nothing stopping you.

Assembly Guy 72 Posting Whiz

What's your question? You'll need to be more specific.

Assembly Guy 72 Posting Whiz

A text editor and a web browser :P

Assembly Guy 72 Posting Whiz

@deceptikon, point taken

Assembly Guy 72 Posting Whiz

I'll re-iterate: in summary, it depends. Thanks all, let's leave it at that instead of squabbling?

Assembly Guy 72 Posting Whiz

In a nutshell, yes. We can't really know. I'll reiterate deceptikon's answer:

It depends

You could compile all three and use objdump to disassemble the machine code generated to identify which is fastest, when compiled by your compiler. The machine code may/will still vary from compiler to compiler, and even the situtation in which the multiplication is used (eg what code is before or after it), and which compiler flags are used.

However, in all theory, an shl paired with an add instruction will mostly be faster than a single mul instruction, but when you're programming in C, your compiler might not compile a simple var*7 into a mul ax,7-type instruction. There are too many variables to give a definitive answer.

EDIT:
FYI: my compiler compiles your first snippet into a left shift followed by a subtraction. The second snippet is turned into a shift, a move, an addition, a move, a shift, followed by an addition. The third snippet is turned into the same machine code as #1.

Assembly Guy 72 Posting Whiz

You're forgetting that the compiler can optimise. Who's to say the compiler doesn't change a multiplication into something like #1, and simplify #2 to #1? There are too many variables here to say for sure which is the fastest when it is put into practice.

The only minus is the subtraction.

Do I sense a pun?

rubberman commented: Excellent points AG, especially the one about the pun! +12
Assembly Guy 72 Posting Whiz

I use Wine with a couple of small utilities which were only ever released on Windows. Namely a tone/sound wave generator. Also some PIC programming software and a Z80 assembler.
I do have a Windows XP VM somewhere on this machine just in case, but it's been years since I last used it.

Fair enough houndhen, I find the Linux accounting software like GnuCash lacks core features like inventory management. There are still some pieces of Windows software which won't get drunk enough when you run it on Wine.

Assembly Guy 72 Posting Whiz

last night we had a bitchin' thunderstorm

That's the first time I've heard a thunderstorm described that way! :)

We've just entered Spring here. The weather's not quite obeying the laws of the seasons.

Assembly Guy 72 Posting Whiz

You probably shouldn't have re-opened this thread; you'll be better off starting your own thread. You've not added any relevant information to this thread which hadn't already been contributed by other members previously.

Assembly Guy 72 Posting Whiz

I have to agree with Mike. Running Windows EXEs through Wine tends to be a bit slow. On top of that, there's a huge amount of software for Linux which most people don't realise is there.

Assembly Guy 72 Posting Whiz

Ancient Dragon's right, you can only change it once.

Assembly Guy 72 Posting Whiz

Dani, it's not happening on this page - I'll try and find a page where it is doing it.

EDIT: It's happening on http://www.daniweb.com/web-development/php/threads/462413/php-dropdown-with-submit

Assembly Guy 72 Posting Whiz

AD, that's exactly what my screenshot depicts

Assembly Guy 72 Posting Whiz

This is definitely going to be THE linux os of the future. No question about.

Not meaning to be cynical, negative or anything, but a lot of people have said that about a lot of distros :)
I like the look of sexy distros, I see the beauty there, but personally, I find it shallow if incredible looks is high on the priority list. I agree that a distro can't look like crap, or it'll be difficult to use, but I can appreciate beauty in distros which aren't groundbreakingly stunning.

But hey, that's just me :)

Assembly Guy 72 Posting Whiz

I'm afraid you'll need to explain more clearly before anyone can help you - maybe provide a screenshot of what these popups look like too.

Assembly Guy 72 Posting Whiz

Maybe it's my browser or my screen width, but the Daniweb social sidebar's being doing this lately:

a3cb98be35ec8e6d2965b6bd8fadca06

I'm running Firefox 23 on Linux, 1280x800 screen size. Not happening on Chromium 29, nor Midori 0.5.5 on the same PC. I've got 5 other browsers I can test with if you want... ;)

Assembly Guy 72 Posting Whiz

I think my crystal ball is telling suggesting Ajax...

Assembly Guy 72 Posting Whiz

The odd capitalisation in my username was initially an acident, but I've embraced it anyway. Just to see what would happen, I tried changing my username to 'Assembly Guy' instead, but I'm being told that the username is already taken. I understand that it's case insensitive so that someone can't call themself 'dani' (all lowercase) and impersonate, but could we maybe change the username changing process such that if you own the username already, you can change the case of it?

As I write this, I'm convincing myself I've written it in a way that makes no sense...

Assembly Guy 72 Posting Whiz

i686 is the short name for the 80686 processor while i386 is the shorthand name for the 80386 processor. They share the same instruction set and are both part of the IA-32 Family but their architecture varies (as that last link highlights). This means that the i686 software was compiled with i686 processors as its target.
i386 is used to mean 32-bit simply because it was the first of the IA-32 family to impliment protected mode (also referred to as PMode), which (in a nutshell) allows larger amounts of memory to be accessed by kernel code, and also allows easier management of memory. Protected mode allows different pieces of code to operate at different rings which have customised access rights to memory and direct I/O, as well as a cut-down instruction set available to non-kernel code. Thus the i386 was the first 'truely useful' IA-32 processor, some may say, so it became the commonplace way of describing 32-bit processors.

Assembly Guy 72 Posting Whiz

I'll take that to mean 'without any additional downloads or installations.' In that case, you might want to look at http://technet.microsoft.com/en-us/library/cc732046%28v=ws.10%29.aspx

Assembly Guy 72 Posting Whiz

Welcome to Daniweb! :)

Assembly Guy 72 Posting Whiz

What's your question?

Assembly Guy 72 Posting Whiz

I edited my original post, your post hadn't shown up at this end.
You could look into an SSH server for Windows. This allows you to run commands on a remote machine (and encrypts the data sent between the two machines), provided you have the login info. freeSSHd is an example that comes to mind.

Assembly Guy 72 Posting Whiz

If you're trying to learn Assembly without any programming background, you're not going to do very well. Assembly is such a nitty-gritty language that beginner programmers will find it difficult and tedious. This will probably put you off programming. Try a higher level language like Perl or Python.

I don't mean to discourage you, I'm just being realistic.

Assembly Guy 72 Posting Whiz

Welcome to Daniweb! :)

Assembly Guy 72 Posting Whiz

You could use remote desktop software to log in remotely, then open a command prompt in the remote session.
Or, the Professional editions of Windows come with a 'telnet shell server' service which you can enable.

Assembly Guy 72 Posting Whiz

Once the problem is solved, I would suggest including something like:

$res=mysql_query($query);

if(!$res)
{
    // Do something to catch the error - maybe display
    // an error message, send the admin an error report
    // by email or try the query again
}

To provide a more useful error message if this recurs in future.

Assembly Guy 72 Posting Whiz

As a quick example off the top of my head, see Luke Edwards's Website. Mainly watch the menu items when you resize your browser window. As arti18 said, it's got nothing to do with SEO - it only affects how the website is displayed on different screen sizes (think smartphones and tablets).
However, responsive design can be used in parallel with SEO to bring more visitors to your site - with your website looking good on more devices, you have a wider audience.

Assembly Guy 72 Posting Whiz

What's your question?

Assembly Guy 72 Posting Whiz

Oops sorry - I assumed you were using Linux.

Assembly Guy 72 Posting Whiz

It's impossible to say. I'm an electronics enthusiast and I've diagnosed and repaired many faults in equipment in my life, but it's really hard to say it's one thing. It could be two bad PSUs in a row, it could be a fault on the motherboard, it could be something completely separate. If you can't fix the problem yourself, find a friend who can come over and diagnose the fault for you. That or sell it online - someone might buy it wanting to fix it.

Assembly Guy 72 Posting Whiz

I understand but I've already deleted it.

You could undelete it, then shred it. OR you could use dd if=/dev/urandom of=filler to fill up the empty space on your disk with random data. Just to be sure that the file's data still isnt there

Assembly Guy 72 Posting Whiz

mysqli_affected_rows() returns the number of rows which were changed as a result of the last query. mysqli_num_rows() returns the number of rows in the array/resource (i.e. the query result) returned by the query.

Even if mysqli_num_rows may work for counting affected rows, it's probably not a good idea to do this, as this functionality may be removed in the future for all we know - the function wasn't necessarily designed for this.

Assembly Guy 72 Posting Whiz

The OP appears to have accidentally put their message inside a code block or list. Be more careful about this next time.

Assembly Guy 72 Posting Whiz

Before doing any editing of partitions, back-up any important data onto a separate disk, just in case. Although partitioning tools like gParted are reliable, they're not perfect and there's always a chance that something happens (eg power outage) during the partion editing.

Assembly Guy 72 Posting Whiz

Just to rule this one out: Have you turned the brightness up?

Assembly Guy 72 Posting Whiz

I tried cd /user/lib

Did you try /user/lib or /usr/lib? There's no such thing as /user/lib (note the 'E' in user). Linux likes to shorten the root folders to three-letter names. Please check you were trying usr instead of user

Assembly Guy 72 Posting Whiz

You should be able to just cd /usr/lib ? That, or try cd /lib/. I'm not 100% familiar with Ubuntu, but I've never seen a distro without a /usr/lib directory.

Stuugie commented: Thanks +4
Assembly Guy 72 Posting Whiz

Good to see new people getting into ham radio! :)

Assembly Guy 72 Posting Whiz

No sorry, I'm in New Zealand. There's a nice community and wiki on http://www.reddit.com/r/amateurradio The wiki's got some articles for getting started in various countries.

Assembly Guy 72 Posting Whiz

@mrgreen Modern NICs can tell if you're using a crossover or not and configure themselves accordingly - I've used both types of cable with no issues.
But if the OP's not got NICs capable of this, they should check it, you're right.

Assembly Guy 72 Posting Whiz

x86 is an architecture that goes way back, all the way back to Intel's 16-bit processors. They named their processors things like 8086, and in later days 80186, 80286, 80386, 80486, 80586, 80686 and so on. Because of this, the 'x' in x86 is just a wildcard.

As far as I am aware, x64 is a lazy way of writing x86-64 (correct me if I'm wrong). x86-64 processors are those which follow the internal architecure of the x86 processors, but are 64 bit. That, or Intel have named their 64-bit processors to end in '64'.

Assembly Guy 72 Posting Whiz

Oh, sorry what I mean is that I've got a widescreen-ish 1280x800 screen and when you add on the browser's address bar and tab area, a task bar, plus the ribbon, it makes it like I'm looking through a letter box.

EDIT: I just realised it's not as bad as it used to be; the header ribbon used to scroll with the page, reducing the viewport's height even further.

Assembly Guy 72 Posting Whiz

I'd still like to have the option of making it go away; my view of Daniweb is widescreen enough without having the bar.

Assembly Guy 72 Posting Whiz

NOTE This code won't work at the application level. It directly addresses memory at 0xB8000 which will result in a segfault at the application level. This code must be part of an OS or an application in a not-so-secure operating system like DOS, where applications can directly address any part of memory.

This is some simple code which facilitates the printing of strings, without needing to use an interrupt like int 0x10. This gives you the foundations so that you can better customise aspects of how printing is done, so that you can, say, make special control characters or speed it up by reading and writing 32 or 64 bits at a time. I've pulled this code up from the remnants of the OS project that I ditched.

This code is simple enough (and has enough comments) that it should explain itself, but I'll highlight some quick points about how VGA text memory is organised at 0xB8000. For each of the 2000 characters on a 80x25 text screen, there are two bytes; the first byte is for the ASCII value of the character, and the second byte is the colour code for the character. This snippet uses the classic white-on-black as a hard-coded value for all character colours

This means that for each row on the screen (80 columns), there are 160 bytes allocated. Hence when we encounter a carriage return in the string, we simply add 160 to the offset in VGA memory for the next byte to be …