text:
User talk:0.39~enwikibooks

 * Please refrain from deleting this module just yet. BTW: I have collaborated to a content on Wikipedia that is now under the threat of deletion. What is the policy about moving the content here - assuming that it meets the standards of Wikibooks?0.39 09:43, 8 December 2005 (UTC)
 * We accept everything mentioned in What is Wikibooks and following Naming policy. --Derbeth talk 10:06, 8 December 2005 (UTC)

Your account will be renamed
Hello,

The developer team at Wikimedia is making some changes to how accounts work, as part of our on-going efforts to provide new and better tools for our users like cross-wiki notifications. These changes will mean you have the same account name everywhere. This will let us give you new features that will help you edit and discuss better, and allow more flexible user permissions for tools. One of the side-effects of this is that user accounts will now have to be unique across all 900 Wikimedia wikis. See the announcement for more information.

Unfortunately, your account clashes with another account also called 0.39. To make sure that both of you can use all Wikimedia projects in future, we have reserved the name 0.39~enwikibooks that only you will have. If you like it, you don't have to do anything. If you do not like it, you can pick out a different name.

Your account will still work as before, and you will be credited for all your edits made so far, but you will have to use the new account name when you log in.

Sorry for the inconvenience.

Yours, Keegan Peterzell Community Liaison, Wikimedia Foundation 22:53, 17 March 2015 (UTC)

Renamed
 This account has been renamed as part of single-user login finalisation. If you own this account you can |log in using your previous username and password for more information. If you do not like this account's new name, you can choose your own using this form after logging in: . -- Keegan (WMF) (talk) 04:27, 19 April 2015 (UTC)

title: User talk:0.39~enwikibooks


text:
User talk:65.248.185.82

Please stop. If you continue to use Wikibooks for advertising, you will be temporarily blocked from editing.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: User talk:65.248.185.82


text: User talk:62.171.194.42

title: User talk:62.171.194.42


text:
Radiation Oncology/RTOG Trials/0438

RTOG 04-38 (LIVER)
 * Title: A Phase I Trial of Highly Conformal Radiation Therapy for Patients with Liver Metastases
 * Objective: To identify the maximally tolerated dose (up to 50 Gy in 5 Gy per fraction) of high dose per fraction, highly conformal radiation therapy in patients with metastatic liver cancer.
 * Protocol:
 * All Patients will receive 10 fractions Monday-Friday for 2 weeks at the following levels; Dose escalation by 0.5 Gy to maximum of 50 Gy, as follows:
 * Eligibility:
 * Non-lymphoma liver metastases confirmed pathologically or new radiographic liver lesions most consistent with metastases, in a patient with known, pathologically proven non-lymphoma cancer and a previously negative contrast CT, MRI or PET/CT of the liver
 * <=5 liver lesions, <=6 cm per lesion
 * Treatment details:
 * GTV = tumor by contrast-enhanced CT scan or MRI. CTV = GTV + 5mm, within the liver. PTV = CTV plus setup margin, at least 4 mm and <= 10 mm.
 * Critical structures: "Normal liver" = liver minus GTV. Normal liver should be at least 1000 cc. No more than 30% may receive > 27 Gy. No more than 50% may receive > 24 Gy. Kidney: no more than 33% of both kidneys may receive > 18 Gy. Cord: max dose 34 Gy. Bowel and stomach: max dose 37 Gy to any 1 cc volume.
 * Enrollment Target: 18 patients
 * Activation: Nov 3, 2005

title: Radiation Oncology/RTOG Trials/0438


text:
Radiation Oncology/RTOG Trials/0421

RTOG 04-21 (Head & Neck)
 * Title: A Phase III Trial for Locally Recurrent, Previously Irradiated Head and Neck Cancer: Concurrent Re-Irradiation and chemotherapy versus chemotherapy alone
 * Objective: To determine whether re-irradiation plus concurrent chemotherapy improves overall survival of patients with previously irradiated, non-metastatic, locally recurrent or new primary squamous cell carcinoma of the head and neck (SCCHN) as compared to conventional chemotherapy alone
 * Protocol: Randomize to
 * Arm 1: RT + CT (RT 60 Gy in 1.5 Gy/fx on weeks 1, 3, 5, 7) + (Cisplatin/paclitaxel on weeks 1, 3, 5, 7) + (G-CSF on weeks 2, 4, 6, 8)
 * Arm 2: CT alone (select cisplatin/5-FU or cisplatin/paclitaxel or cisplatin/docetaxel)
 * Eligibility:
 * Pathologically confirmed squamous cell carcinoma (SCC) of the oral cavity, oropharynx, hypopharynx, larynx, or recurrent neck metastases with unknown primary
 * Patients must not be candidates for surgical resection.
 * Enrollment Target: 240 patients
 * Activation: April 27, 2005
 * Closed: January 5, 2007 -- Closed due to poor accrual

title: Radiation Oncology/RTOG Trials/0421


text:
Radiation Oncology/RTOG Trials/0319

RTOG 03-19 (Breast)
 * Title: A Phase I/II Trial to Evaluate 3D-CRT Confined to the Region of the Lumpectomy Cavity for Stage I and II Breast Carcinoma
 * Objective:
 * Protocol:
 * 38.5 Gy Total/10 fractions (3.85 Gy per fraction), 2 fractions/day (separated by 6 hours), Given in 5 consecutive working days
 * Radiotherapy should begin within eight weeks of surgery (If chemotherapy is given first, RT begins 2 weeks after the last cycle of chemotherapy)
 * Eligibility:
 * Invasive pathology; AJCC Stage I-II; single focus
 * Negative surgical margin; up to 3 LN+
 * Enrollment Target: 46 patients
 * Activation: August 15, 2003
 * Closed: April 30, 2004

title: Radiation Oncology/RTOG Trials/0319


text:
Radiation Oncology/Liver/RTOG Liver

RTOG Website

title: Radiation Oncology/Liver/RTOG Liver


text:
Talk:Embedded Systems/VLSI

This page was merged in from the previous VLSI book, which was a stub with only one contributer, who contributed for only one day. -- 13:25, 8 December 2005 (UTC)

title: Talk:Embedded Systems/VLSI


text:
User:Swapnil durgade/Perl Notes

=Perl Components=

Variables
Example
 * Define: $message = "Hello World\n";
 * Access: print $message;

Array
Example
 * Define: @days = ('Mon','Tue','Wed','Thu','Fri','Sat','Sun');
 * Access: $days[0]

Hash
Example
 * Define: %months = ('January' => 31,'November' => 30,'December' => 31);
 * Access: print "Days in November:",$months{'November'},"\n";

Operators
$Sum = 4 + 5

Statements
if

substr function
Uses 1. get subset of string 2. Replace subset of string with new string.

Syntax $value = substr($string, $offset, $count); $value = substr($string, $offset);

substr($string, $offset, $count) = $newstring; substr($string, $offset, $count, $newstring); # same as previous substr($string, $offset)        = $newtail;

E.g.

$string = 'abcd1234'; $subs = substr($string,4); print $subs; Output: 1234

$string = 'abcd1234'; substr($string,0,4)="pqrs"; print $string;

Output: pqrs1234

substr($string, 0, 5) =~ s/is/at/g;
 * 1) substitute "at" for "is", restricted to first five characters

unpack function
For positioning, use lowercase "x" with a count to skip forward some number of bytes, an uppercase "X" with a count to skip backward some number of bytes, and an "@" to skip to an absolute byte offset within the record.

$a = "To be or not to be"; $b = unpack("x6 A6", $a); # skip 6, grab 6 print $b; or not
 * 1) extract column with unpack

($b, $c) = unpack("x6 A2 X5 A2", $a); # forward 6, grab 2; backward 5, grab 2 print "$b\n$c\n"; or be

title: User:Swapnil durgade/Perl Notes


text:
Radiation Oncology/RTOG Trials/8405

RTOG 84-05 (LIVER)
 * Title: Phase I/II Dose-Escalating Trial of Accelerated Fractionation in the Palliative Irradiation of Hepatic Metastases from Primary Cancer of the GI Tract
 * Objective:
 * I. Assess the feasibility and efficacy of a twice-daily schedule of radiation treatments in the palliation of patients with liver metastases from cancer of the stomach, pancreas, gallbladder, biliary tree, colon, or rectum.
 * II. Determine whether greater doses of hepatic irradiation in a selected population of prognostically favorable patients can result in a decreasing frequency of progressive liver metastases as a direct cause of death.
 * III. Help define the tolerance of the liver to fractionated irradiation delivered in dose fractions that may ultimately be clinically useful in the elective or adjuvant irradiation of the liver in high-risk patients with primary cancers draining via the portal circulation.
 * Protocol: Whole liver dose escalation 27 Gy -> 36 Gy given in 1.5 Gy/fx BID
 * Eligibility: Measurable hepatic metastases (as documented by CT scan) from histologically verified primary cancers arising in the stomach, pancreas, gallbladder, biliary tree, colon, or rectum. All cell types are permissible except leukemia, plasmacytoma, and lymphoma.
 * Enrolled: 173 patients
 * Conclusion:
 * PMID 8365932 -- Accelerated hyperfractionated hepatic irradiation in the management of patients with liver metastases: results of the RTOG dose escalating protocol. (Russel AH, Int J Radiat Oncol Biol Phys. 1993 Sep 1;27(1):117-23.) Conclusion : "The study design could not credibly establish a safe dose for hepatic irradiation, however, it did succeed in determining that 33 Gy in fractions of 1.5 Gy is unsafe, carrying a substantial risk of delayed radiation injury. The absence of apparent late liver injury at the 27 Gy and 30 Gy dose levels suggests that a prior clinical trial of adjuvant hepatic irradiation in patients with resected colon cancer may have employed an insufficient radiation dose (21 Gy) to fully test the question."
 * Publications:

title: Radiation Oncology/RTOG Trials/8405


text:
Template talk:MATLAB CMD

This is just a simple template for referencing a Matlab function. The template links to the Programming:MATLAB book. -- 13:56, 8 December 2005 (UTC)

title: Template talk:MATLAB CMD


text:
People's Tactics/All Chapters

= Introduction =

= Interface =

= Command & Officers =

= Supply =

= Production =

= Units =

= Movement =

= Combat =

= Transfers =

= Scenario Editor =

= PBEM =

= Shortcuts =

title: People's Tactics/All Chapters


text:
Radiation Oncology/RTOG Trials/8301

RTOG 83-01 (LIVER)
 * Title: Phase I/II evaluation of I-131 Antiferritin after RT/CT induction
 * Objective:
 * I. Provide the necessary data to determine the maximum safe dose of adriamycin and 5-fluorouracil that can be combined with I-131 antiferritin IgG (given 30 mCi on day 0 and 20 mCi on day 5).
 * II. Determine whether 20 mCi I-131 anti-AFP plus 30 mCi antiferritin increases tumor dose deposition and offers advantage in tumor effective half-life and dose deposition over I-131 antiferritin alone.
 * III. Combine the radiolabeled preparation considered best (on dosimetric grounds) with escalating doses of adriamycin and 5-fluorouracil.
 * IV. Determine the best combination of adriamycin and 5-fluorouracil plus I-131 labeled antibody for Phase II trial in AFP and non-AFP hepatomas.
 * V. Complete Phase II trials using physical exam and CT tumor volume reconstruction to determine the remission rate, duration of remission, and survival.
 * Protocol:
 * Induction RT (21.0 Gy at 3.0 Gy/Fx or 24.0 Gy at 1.5 Gy/Fx BID) + low-dose CT (5-FU/adriamycin)
 * 1 month later I-131-antiferritin + 5-FU/adriamycin
 * Eligibility: histologically confirmed primary hepatic malignancy
 * Enrolled: 216 patients
 * Conclusion:
 * PMID 2415692 -- Iodine 131 antiferritin, a new treatment modality in hepatoma: a Radiation Therapy Oncology Group study. (Order SE, J Clin Oncol. 1985 Dec;3(12):1573-82.) Conclusion : "These studies have demonstrated the toxicity and therapeutic activity of 131I antiferritin and the emerging role of radiolabelled antibody in cancer therapy."
 * Publications:
 * PMID 1850722 -- A randomized prospective trial comparing full dose chemotherapy to 131I antiferritin: an RTOG study. (1991 Order S, Int J Radiat Oncol Biol Phys. 1991 May;20(5):953-63.) Conclusion : "Overall, radiolabeled antibody administration and full dose chemotherapy led to equivalent partial remission rates (22-30% vs 23-25%) and survival rates compared to chemotherapy (6 month median; AFP+ 5 months; AFP- 10 months)."
 * PMID 1847127 -- Prognostic factors in unresectable hepatocellular cancer: Radiation Therapy Oncology Group Study 83-01. (Stillwagon GB, Int J Radiat Oncol Biol Phys. 1991 Jan;20(1):65-71.) Conclusion : "Good and poor prognostic groups were defined and compared to a similar patient population (RTOG study 83-19) with confirmation of the validity of the model"
 * PMID 2998178 -- Computed tomography assisted volumetric analysis of primary liver tumor as a measure of response to therapy. (Ettinger DS, Am J Clin Oncol. 1985 Oct;8(5):413-8.) Conclusion : "In spite of small changes in total liver volume, there may be concomitantly substantial changes in tumor volume.
 * PMID 6085756 -- Comparative tumor dose from 131I-labeled polyclonal anti-ferritin, anti-AFP, and anti-CEA in primary liver cancers. (Leichner PK, Cancer Drug Deliv. 1984 Fall;1(4):321-8.) Conclusion : "Polyclonal anti-ferritin has, therefore, become the antibody of choice in the treatment of hepatoma."

title: Radiation Oncology/RTOG Trials/8301


text:
Circuit Theory/Circuit Theory Introduction

Who is This Book For?
This is designed for a first course in Circuit Analysis which is usually accompanied by a set of labs. It is assumed that students are in a Differential Equations class at the same time. Phasors are used to avoid the Laplace transform of driving functions while maintaining a complex impedance transform of the physical circuit that is identical in both. 1st and 2nd order differential equations can be solved using phasors and calculus if the driving functions are sinusoidal. The sinusoidal is then replaced by the more simple step function and then the convolution integral is used to find an analytical solution to any driving function. This leaves time for a more intuitive understanding of poles, zeros, transfer functions, and Bode plot interpretation.

For those who have already had differential equations, the Laplace transform equivalent will be presented as an alternative while focusing on phasors and calculus.

This book will expect the reader to have a firm understanding of Calculus specifically, and will not stop to explain the fundamental topics in Calculus.

For information on Calculus, see the wikibook: Calculus.

What Will This Book Cover?
This book will cover linear circuits, and linear circuit elements.

The goal is to emphasize Kirchhoff and symbolic algebra systems such as MuPAD, Mathematica or Sage; at the expense of analysis methods such as node, mesh, and Norton equivalent. A phasor/calculus based approach starts at the very beginning and ends with the convolution integral to handle all the various types of forcing functions.

The result is a linear analysis experience that is general in nature but skips Laplace and Fourier transforms.

Kirchhoff's laws receive normal focus, but the other circuit analysis/simplification techniques receive less than a normal attention.

The class ends with application of these concepts in Power Analysis, Filters, Control systems.

The goal is set the ground work for a transition to the digital version of these concepts from a firm basis in the physical world. The next course would be one focused on modeling linear systems and analyzing them digitally in preparation for a digital signal (DSP) processing course.

Where to Go From Here

 * For a technician version of this course which focuses on the practical rather than the idea, expertise rather than theory, and on algebra rather than calculus, see the Electronics wikibook.
 * Take Ordinary Differential Equations now that you have a practical reason to do so. This math class should ideally feel like an "art" class and be enjoyable.
 * To begin a course of study in Computer Engineering, see the Digital Circuits wikibook.
 * For a traditional "next" course, see the Signals and Systems wikibook. There should be an overlap with this wikibook.
 * The intended next course would have a name such as A New Sequence in Signals and Linear Systems or Elements of Discrete Signal Analysis.


text:
Radiation Oncology/RTOG Trials/8319

RTOG 83-19 (LIVER) excluded.
 * Title: Phase III Randomized Comparison of ADR/5-FU plus I131-Antiferritin IgG vs ADR/5-FU Alone Following ADR/5-FU plus External Beam Radiotherapy in Nonmetastatic Nonresectable Primary Hepatoma
 * Objective:
 * I. Determine the therapeutic efficacy of cyclic I131-antiferritin IgG plus adriamycin/5-fluorouracil vs. adriamycin/5-fluorouracil alone following induction with external beam irradiation plus adriamycin/5-fluorouracil in patients with nonmetastatic, nonresectable primary hepatoma.
 * II. Determine both survival and the incidence of tumor volumetric reduction of at least 30 percent in the two treatment arms.
 * III. Study the relationship between duration of remission and AFP negativity.
 * Protocol:
 * Induction RT (21.0 Gy at 3.0 Gy/Fx) + low-dose CT (5-FU/adriamycin) followed 1 month later by:
 * Arm 1: adriamycin/5-FU + 131-I-antiferritin
 * Arm 2: adriamycin/5-FU
 * Eligibility: Histologically proven primary hepatoma that is nonresectable and from which there are no known extrahepatic metastases. Patients with positive AFP titers are
 * Enrolled:
 * Conclusion:
 * PMID 1850722 -- A randomized prospective trial comparing full dose chemotherapy to 131I antiferritin: an RTOG study. (1991 Order S, Int J Radiat Oncol Biol Phys. 1991 May;20(5):953-63.) Conclusion : "Overall, radiolabeled antibody administration and full dose chemotherapy led to equivalent partial remission rates (22-30% vs 23-25%) and survival rates compared to chemotherapy (6 month median; AFP+ 5 months; AFP- 10 months)."
 * Publications:
 * PMID 9612600 -- Survival results among patients with alpha-fetoprotein-positive, unresectable hepatocellular carcinoma: analysis of three sequential treatments of the RTOG and Johns Hopkins Oncology Center. (Abrams RA, Cancer J Sci Am. 1998 May-Jun;4(3):178-84.) Conclusion : "Intravenous 131I-polyclonal antiferritin did not improve survival when added to either post-induction regimen but dramatically increased hematologic toxicities."

title: Radiation Oncology/RTOG Trials/8319


text:
Talk:Drugs:Fact and Fiction

Copyright concerns
I have been thinking about rewriting this book. I inquired into using from material posted on another website funded by the US government. The US government usually requires all material produced go into the public domain, but to be sure I asked. This is the reply I received

From: "NIDAVIC"  To: Date: Tue, 6 Jul 2010 15:57:04 -0400 Subject: FW: Copyright From nidavic@iqsolutions.com Tue Jul  6 15:06:44 2010

Hello,

Thank you for your message to the National Institute on Drug Abuse (NIDA) asking if the material on our website is in the public domain.

Thank you for your interest in NIDA's website. As part of the Federal Government, we currently hold no copyright on the materials we produce. Therefore, you are free to use or reproduce, in whole or in part, any of our NIDA publications or website materials.

We hope this information is helpful.

Sincerely, Office of Science Policy and Communications National Institute on Drug Abuse

--Thenub314 (talk) 11:22, 7 July 2010 (UTC)

Well this is good new and can be a good way to make this book neutral. I just want to caution against turning this into an anti-drug book, since that is not any more neutral than a pro-drug book. A thought I had on how we might maintain a neutral point of view is by importing and adopting some work that already has been done on Wikipedia for use in this book. Most of Recreational drug use could probably be adopted for use in the Introduction chapter for example. --dark lama  16:36, 8 July 2010 (UTC)

 * I disagree about the usefulness of Recreational drug use, the material at the wikipedia is not very good and in many places is tagged as such. I will try a bit harder to be neutral in my own writing and I have been careful to try to only bring in factual information that is properly sited from the websites controlled by NIDA. There will undoubtedly be some clean up necessary in the end to make sure we maintain NPOV. Thenub314 (talk) 23:00, 8 July 2010 (UTC)

Oy! What happend!
Can we discuss renaming the entire book, I have been actively editing this and it is a bit annoying to work hard for an hour on a page click save and find a message saying the page has been deleted. For reasons I don't have time just at the moment to explain I would perfer to keep it under the previous title. Thenub314 (talk) 16:06, 8 July 2010 (UTC)
 * I like the current title as I forsee this book as potential reference during "NIDA National Drug Facts Week - Shatter the Myths" for which the mantra of fact vs fiction fits in quite well. Thenub314 (talk) 23:02, 8 July 2010 (UTC)
 * My reasoning/thought is that the book should attempt to honor/stick with the original aim/scope of the book, which is about recreational drug use. However the book's title suggests a scope that is broader than the reality.
 * I think in the context of recreational drug use a NPOV can include the benefits from the perspective of those that use the drugs, and the dangers from a medical perspective. --dark lama  12:20, 9 July 2010 (UTC)
 * It is my intention rewrite the book in part to take care of the POV problems that we collectively recommended for clean up in multiple RfD's but were never implemented by anyone. Unfortunately after I returned last evening I discovered my laptop was not plugged in and I could no longer copy and paste work elsewhere.  Which is a bit disappointing. If you plan any major restructuring of the book, particularly one that involves moving many pages, could please leave a note here to give me a heads up it would be appreciated. Thenub314 (talk) 14:22, 9 July 2010 (UTC)
 * Unfortunately there doesn't seem to be specific suggestions of what clean up needed to be done. I think you are already aware of the name I think this book should have so I doubt I need to mention that. Other than the name the only other structural changes I had in mind right now was to include a full table of contents, add navigational aids, and try to get this book to have an actual order for pages to be read. I had in mind to import and use work from Wikipedia to fill in a lot of missing details, not necessarily keeping everything from the Wikipedia pages, but the import would be done to preserve history and provide proper acknowledgments. --dark lama  16:47, 9 July 2010 (UTC)

Orphaned pages
– Adrignola talk 00:09, 12 July 2010 (UTC)
 * Drugs:Fact and Fiction/Hydrocodone

Title should reflect the scope
The book is about scheduled drugs not so called "ethical pharmaceuticals." Geofferybard (discuss • contribs) 23:54, 24 February 2011 (UTC)

Huge cleanup
Because this will no doubt attract controversy, I'm going to post here and wait for discussion. Most of this book violates [|TOS], specifically, Lawful behavior. Not all of it does however, so I propose to clean out the illegal drugs from this book. I'm aware this sounds kind of murky since we're from all over the world, so my proposal is to clean it so that it complies to U.S law, since Wikibooks is hosted in the USA, specifically Florida law where the servers are. That would mean that Marijuana would have to go, since recreational use of marijuana is still not legal in Florida, prescription use is. Obviously psychedellic mushrooms are illegal everywhere so they would go, meth, crank, speed are illegal everywhere, so they'd go too   Caffeine, Alcohol and nicotine are all legal and could stay. Yes, it will make the book shorter, but, IMHO we can't keep it in it's current state as it violates TOS as I have described earlier. So, what do you think ? Necromonger Wekeepwhatwekill 16:59, 27 August 2018 (UTC)

 * This is not the only instance of a book which lies in a 'grey area'; see Suicide. Both books have received a fair attraction of controversy, but the general consensus is that these books are here to stay (and both survived multiple RfDs). Specifically, WB:CENSOR notes that content isn't censored for anyone, so I think that the content has to stay as it is. Leaderboard (discuss • contribs) 17:15, 27 August 2018 (UTC)

 * This isn't about censor, I never said that. The contents of this book fail [|TOS], specifically,  Lawful behavior. This isn't something that can worked around or ignored. What I mean is, the contents of this book either pass that criteria or it fails.  In my eyes some of this passes but some of it fails.   Rather than invoke IAR, I thought I should at discuss the changes first.     Necromonger Wekeepwhatwekill 20:19, 28 August 2018 (UTC)

 * Ok....I'm going to allow 7 more days for discussion.  If no further discussion happens, I'll start cleaning this up so that it doesn't run a foul of [|TOS]. Be aware this will involve a lot of this book being cut out.  Yes, I'm aware Wiki is not censored, but in this case, not censored can't be used as a way to keep this book as it is, as it violates TOS, spwecifically, lawful behavior.  Since the servers for this are in the U.S, it has to conform to US laws.  My intent is get this article to comply with current US laws. Necromonger Wekeepwhatwekill 18:02, 4 September 2018 (UTC)

 * You cam certainly count on me to prevent the deletion of any valid and lawful content. As you have stated things I'm a bit afraid of what you intend to do, especially when you make legal claims over the general work without a real contested object and start with the motion that "I propose to clean out the illegal drugs from this book". --Panic (discuss • contribs) 23:13, 4 September 2018 (UTC)
 * User:Panic Do you mean that I'm not specifying what exactly I find illegal ?  I'm happy to:

First, be aware that the law I'm talking about is the State of Florida law, as Wikimedia's severs, which wikibook is a part of , are in Florida, that law is certainly applicable, so my cuts would be

Obviously, this will mean big cuts in this book, so rather than just Be Bold and do it, I'd rather discuss first, since large changes generally are best when discussed first. My rationale for doing this is, again, TOS, specifically, Lawful. Necromonger Wekeepwhatwekill 15:25, 5 September 2018 (UTC)
 * Psychedilics - like LSD, Psilocybin and Mescaline. They're illegal in the state of Florida as have to be cut to conform to TOS:Lawful.
 * Marijuana - is legal for medicianal purposes, therefore, I cant remove it as the book doesn't state whether it's medicinal or recreation use.
 * Ectasy/MDMA - is illegal, and would have to be removed
 * Angel Dust/ ketamine - Angel dust is illegal.  Ketamine is an animal tranqulizer and not legal for human use, so even though it's legal, it's not for human use, so that would have to be cut.

 * I understand the legalities and agree in the general terms but you fail to understand that information about illegal stuff is not illegal by and in itself, the editors (or Wikimedia at the end of the line) could only be actionable if they promoted, facilitated or sold said illegal stuff and frivolous civil actions due to damages can easily be avoided by the normal disclaimer we use on these type of works (like the one referencing cannibalism or suicide). So no, no demolitionist actions required on that regard. --Panic (discuss • contribs) 20:48, 5 September 2018 (UTC)

 * Also note that "You agree to submit to the personal jurisdiction of, and agree that venue is proper in, the courts located in San Francisco County, California, in any legal action or proceeding relating to us or these Terms of Use." and that you are overextended the intention of the point about Lawful behavior (the legal infringements considered there are mostly about intellectual property rights). --Panic (discuss • contribs) 20:53, 5 September 2018 (UTC)
 * User:Panic2k4 I expected resistance, which is why this discussion is happening. I agree that talking about drugs isn't illegal. However, talking about how to have a good trip is an unspoken endorsement to use the drug safely.  Yes you're correct that using Florida Law to decide the "lawful" part of the TOS isnt correct either since Wikibooks explicitly is housed in a San Francisco server.  I've verified this from wikitech itself. That means I would have to leave the marijuana section as is, since San Francisco does allow for recreational use of marijuana.  That still leave the mushrooms, ectasy, MDMA, Ketamine and Angel dust open to deep cuts.  Bear in mind, they may not need them, they may only need slight changes in wording to keep them legal. In the end, I think you and I disagree and where to draw the line on discussing drugs. SO where do you think the line should be drawn? Necromonger  Wekeepwhatwekill 13:26, 6 September 2018 (UTC)
 * According to your logic, topics discussing adult topics on Wikipedia and related pictures on Commons (eg: nudity) should be banned. That isn't happening. Leaderboard (discuss • contribs) 19:10, 6 September 2018 (UTC)
 * Nope, not quite. Adult topics and pictures and still legal, and don't run afoul of TOS:Lawful, so it's not the same thing.   I haven't touched anything in this book, and as you can see, my focus is pretty narrow (mushrooms, ectasy, MDMA, ketamin and Angel dust), and just like I said above, I may only have to slight rewrites. Necromonger  Wekeepwhatwekill 20:33, 6 September 2018 (UTC)

Cleanup list
Ok, so here' the detail on my proposed cleanup

Drugs:Fact and Fiction/Introduction - no change

Drugs:Fact and Fiction/General: Strike "At higher doses it is an extremely powerful psychoactive" - goes into unlawful use / unintended use / not a how-to

Drugs:Fact and Fiction/Hallucinogens: Strike "It is because of this that hallucinogens can cause life-changing experiences" - encourages experimintation / goes into unlawful use/unsourced

Drugs:Fact and Fiction/LSD: Strike "To avoid a trip turning bad, it is suggested to create a change of environment (such as a different location, or listening to soothing music), or to remember that the mental effects are just being caused by the drug, and are only temporary. " - goes into unlawful use/nonreliable source Strike "The "threshold" (smallest dose with perceptible effects) is 20 micrograms. A "common" dose is between 50 and 150 micrograms. The lethal dosage is 12,000 micrograms, roughly 120 times a common dose" - goes into unlawful use / non reliable source

Drugs:Fact and Fiction/Marijuana - No Change

Drugs:Fact and Fiction/DXM - No change

Drugs:Fact and Fiction/PCP - No change

Drugs:Fact and Fiction/Salvia :

Strike " He recommends that it be used for meditation, or other spiritual pursuits. " - goes to Unlawful use / non-reliable source

Strike "There is no known lethal dosage of Salvia divinorum. However, it is very strongly recommended that a trip sitter be present. Because of its short-lasting effects (when smoked), users can take turns being a sitter. Before setting forth to explore the potential of this substance, please read this entire page!" goes to Unlawful use / not a manual.

Strike " A butane torch is recommended to vaporize all of the salvinorin A, but a regular lighter is sufficient and will vaporize most of the salvinorin A. Most users find a regular lighter to be sufficient and the resulting smoke easier to keep in the lungs due to the lower temperature." Goes to unlawful use / again, not a manual.

Strike "so the smoker must hold the smoke in the lungs for a short period if he or she wants to absorb all of the salvinorin A, a generally accepted time frame to hold salvia smoke in is 20-40 seconds, or however long the smoker can hold in the smoke " Unlawful use / not a manual

Strike "Generally salvia leaves and extracts are smoked using the same paraphernalia as Cannabis. Bongs are considered best because the hits are bigger than any other widely used method of smoking. Furthermore, the water cools the smoke and makes it smoother, making the smoke easier to hold in. This in turn allows for optimum absorption of the salvinorin A. In order to vaporize the most salvinorin A, the flame from the lighter must be held on the salvia for the duration of the inhalation, because salvinorin A has a higher vaporization temperature than, for example, THC does in the case of cannabis. Glass pipes are also used and a "second best" to bongs, mainly due to the fact that that they allow the lighter to be held on the salvia for the duration of the hit. Pipes are ineffective in that, due to a smaller chamber, less smoke is able to be absorbed for each hit, and the smoke is hotter and more harsh than with the bong method due to lack of water filtration. It is a rule of thumb that in order to receive the same level of intoxication, one must smoke three hits of a pipe to every one hit from a bong, although experienced pipe users might argue it is also a matter of technique. Cigarettes will work, but not to an extent where they are considered efficient, this is because it is not common practice nor is it practical to hold a flame a cigarette, by the method's very nature. Some effects will come from smoking it in a cigarette, and..."   - Unlawful use and we're not a manual nor a how-to by any means.

Strike "Salvia cigarettes are best when only raw dried leaves are used, as extracts are costly and seem to be less effective in cigarette form than the raw leaf." again - unlawful use and we're not a manual or a how-to

Strike - "Raw dried leaves can be smoked, but, except in users with low tolerance to salvinorin A, the full effect will not be achieved unless large amounts of leaf are smoked. The smoke is a bit harsh, and unlike most other substances, salvinorin A does not have a cumulative dosage effect - if the dosage is not completely consumed within one to two minutes, smoking further will do little to increase the effects." Run afoul of legal / not a how-to

Strike " It is therefore important to prepare mentally for this before smoking salvia." Run afoul of legal / not a how-to

Strike - "Traditionally, the leaves are sublingually ingested. The most common way for this to be done is what is called the quid method. This entails of wrapping 6-20 fresh leaves together in a stick form, and slowly chewing on more and more of the quid, over the period of a half hour, eventually having the whole quid in your mouth, without swallowing it. Swallowing salvia is ineffective since for all practical purposes, stomach acid breaks down salvinorin A, and you would have to swallow enormous amounts in order to receive significant effects. Sublingual absorption generally produces milder effects than smoking and requires much larger doses in order to match the intensity experienced with smoking, but produces much longer lasting effects. The come on period starts after 5 minutes and lasts 20-40 minutes; the peak lasts 40 minutes to an hour and a half, and the after effects last 3-6 hours. Sublingual absorption is also said to have more of a euphoric effect both during and after the peak. Extracts, although they can be quite costly, can also be used this way in order to cut down on the amount of bitter plant material that has to be held in the mouth. Doses for extracts can be 1.5-2 grams of 5x, 0.75-1 gram of 10x, 0.35-0.5 grams of 20x, in proportion to the strength of the extract." runs afoul of lawful / not a how-to

Strike - all of "Effects"  This was already stated in Method of ingestion / runs afoul of lawful / not a how-to Strike - all of "Other important facts" Per Not Trivia/ runs afoul of lawful

Drugs:Facts and Fiction/Stimuants:

Strike " In moderation and at recreational doses however, most are relatively safe. " unreferenced

Strike "Stimulant users should have strong will power, and the ability to tell themselves 'no', and stick with it - Less they wish to join the many individuals that have succumbed to addiction." - unreferenced

Strike "Though not generally as strong as any purified stimulant, the plants are very safe to use as a stimulant on a frequent basis and can generally be enjoyed free of major side effects." Unreferenced

'''Drugs:Fact and Fiction/Amphetamine - as is. '''

'''Drugs: Fact and Fiction/Meth - as is. '''

Drugs: Fact and Fiction/Ritalin

 * SPECIAL NOTE : I'm NOT neutral on Ritalin, as I was prescribed this drug in my youth.

Strike "For enhanced effects but a shorter duration, you may crush the time release capsules and parachute (crush in napkin and swallow as if a pill). It may also be insufflated (snorted) for even more intense effects. There have been reports of the drug being injected, but these are rare. Keep in mind that tolerance and addiction may easily develop on this drug from irresponsible abuse." - We're not a how-to / lawful use / unreferenced

Strike "*IMPORTANT*- Tolerance builds up quickly with repeated use. A dose that is right for an experienced user may not be right for you. Remember that you can always take more, but once you've taken more you can't take less. " Unreferenced / not a how-to/ lawful.

Drugs: Fact and Fiction/Nicotine - as is

Drugs: Fact and Fiction/Depressants - no change

Drugs:Fact and Fiction/Depressants/Zolpidem (Ambien)

Strike "When intended for recreational use, one person may take even a prescribed dose and simply stay awake. It's not hard to keep yourself awake while under the influence of zolpidem, but one may notice a loss of motor skills if it's their first time." Unreferenced / not a how-to/ it's not inteneded for recreational use

That's the list - any objections to the cuts? Necromonger Wekeepwhatwekill 17:13, 10 September 2018 (UTC)

 * As it stands, your proposed changes don't really have consensus. Leaderboard (discuss • contribs) 21:02, 10 September 2018 (UTC)

 * Right now, I've just put up my specific list of changes, so yes, I realize I have no consensus. ) Necromonger  Wekeepwhatwekill 21:37, 10 September 2018 (UTC)

title: Talk:Drugs:Fact and Fiction


text:
Gmail/Labels

What are Labels?

Labels are a feature found exclusively in Gmail. It's more or less the same as the Folder feature found in other web mails like Yahoo! Mail & Hotmail, but definitely simpler & quicker to use.

It is a simple way to set up links to find your emails quickly, and this system is used in conjunction with their Archiving system.

How do I setup a label?

To set up a label, check the box next to the mail you want to label. Then go to the drop-down menu and click "Add New Label". Type the label name into the pop-up. Now you will see a green box on your lower left listing all the labels you have made. Click on it to find all emails with a given label.

Operator

You can use the operator label: in your filters or searchings.

For example, label:saved shows the email that you marked with a tag called saved.

title: Gmail/Labels


text:
Georgia Water/External Links/Assistance

Community Planning

 * Resource teams to aid communities in planning for quality growth, Georgia Department of Community Affairs with links to over 100 tools for community planning.

Environmental Management

 * Economic Development Institute at Georgia Tech - "The U.S. Environmental Protection Agency (EPA) has named Georgia Tech’s Center for International Standards and Quality (CISQ) one of eight Local Resource Centers for Environmental Management Systems .... (to) help local agencies adopt environmental management systems to improve their overall environmental performance and meet environmental goals." See also: example application for Barrow County, Georgia.

National Park Service

 * NPS Rivers, Trails and Conservation Assistance Program The Rivers & Trails Program "staff provide technical assistance to community groups and local, State, and federal government agencies so they can conserve rivers, preserve open space, and develop trails and greenways."

Georgia state programs
Methods for counties and cities to raise funds:
 * Business Improvement District (BID)
 * Community Improvement District (CID)
 * Homestead Option Sales Tax
 * Local Option Sales Tax (LOST)
 * Special Purpose Local Option Sales Tax
 * Tax Allocation District
 * (proposed) Senate Bill 414

US Department of Agriculture
USDA funding in Georgia, 1995-2004, by program.

U.S. Army Corps of Engineers

 * Section 22 - Planning Assistance to States

title: Georgia Water/External Links/Assistance


text:
Radiation Oncology/RTOG Trials/8003

RTOG 80-03 (LIVER)
 * Title: Phase III Comparison of Radiation Alone vs Radiation plus Misonidazole in the Treatment of Liver Metastases
 * Objective:
 * I. Compare the frequency and duration of symptomatic relief in patients with liver metastases from a variety of sites treated by radiotherapy alone vs. radiotherapy plus misonidazole.
 * II. Compare the frequency and duration of normalization of liver function in these 2 groups.
 * III. Compare the frequency of decrease in the size of liver metastases by CT scans in the 2 groups.
 * IV. Evaluate the response for each treatment according to site and histology of the primary, performance status, and tumor volume.
 * V. Evaluate the foregoing objective with respect to the length of survival.
 * Protocol:
 * Arm 1: RT (whole liver to a dose of 21.0 Gy in 3 Gy/fx)
 * Arm 2: RT + radiosensitization with Misonidazole
 * Eligibility: Patients with histologic verification of malignancy other than leukemia, myeloma, or lymphoma, and with hepatic metastases as documented by liver scan and/or CT scan.
 * Enrolled: 214 patients
 * Conclusion:
 * PMID 3597149 -- A comparison of misonidazole sensitized radiation therapy to radiation therapy alone for the palliation of hepatic metastases: results of a Radiation Therapy Oncology Group randomized prospective trial. (Leibel SA, Int J Radiat Oncol Biol Phys. 1987 Jul;13(7):1057-64.) Conclusion : "The addition of misonidazole did not significantly improve the therapeutic response to radiation therapy in any of the parameters studied."
 * Publications:
 * PMID 2180867 -- Accelerated fractionation radiation therapy for liver metastases: selection of an optimal patient population for the evaluation of late hepatic injury in RTOG studies. (Leibel SA, Int J Radiat Oncol Biol Phys. 1990 Mar;18(3):523-8. Conclusion : Favorable characteristics: KPS >=80, CRC primary, no extrahepatic mets

title: Radiation Oncology/RTOG Trials/8003


text:
User talk:206.158.3.70

Please stop. If you continue to blank pages, you will be blocked from editing.

title: User talk:206.158.3.70


text:
Cookbook:Sizzling Sisig (Filipino Pork Sauté)

| Cuisine of the Philippines

Sisig, famous for being a food eaten while drinking alcoholic beverages, is a Filipino dish made from pork jowl and ears (maskara), pork belly, and chicken liver, which is usually seasoned with calamansi, onions, and chili peppers. It originates from the province of Pampanga in Luzon.

Ingredients

 * 1½ kilo pork head
 * ¼ cup grilled liver, diced
 * ½ kilo of pig's heart, grilled and minced
 * ½ kilo of pig's lungs, grilled and minced
 * ½ kilo of pig's intestines, grilled and minced
 * 2 small onions, minced
 * 2 pieces red pepper, minced
 * 1 head garlic, minced
 * 6 pieces hot chile pepper, minced
 * 2 tbsp oil from the pork fat
 * 1 cup vinegar (sukang iloko would be good)
 * 1½ tbsp liquid seasoning
 * 1 tsp black pepper
 * 1 tsp brown sugar
 * 1 cup beef stock

Procedure

 * 1) Grill pork head to remove hair.
 * 2) Boil pork head until tender.
 * 3) Take out all the meat and dice.
 * 4) In a sauté pan, heat oil and sauté garlic, onion, red pepper, pork meat and liver.
 * 5) Season with liquid seasoning, black pepper, and brown sugar.
 * 6) Pour in beef stock and cook until meat is tender and starts to oil again.
 * 7) Add minced chili pepper last.
 * 8) Serve on a sizzling plate.


text:
Water Resources Directory/Education/Planning/Curriculum

Model MS degree in water resources planning
The US Army Corps of Engineers-IWR and the Universities Council on Water Resources developed a model curriculum for a masters degree in water resources planning for the Corps' new hires. The curriculum (30 semester hours) consists of 10 courses: eight cornerstone courses, an independent study course, and a capstone course with advanced planning practicum. Six universities now (2005) offer an MS degree consistent with this model curriculum.

 * Philosophy of Planning
 * Institutional Considerations in Water Resources Planning
 * Social Decision-Making
 * Ecology for Water Resources Planning
 * Engineering for Water Resources Planning
 * Economics for Water Resources Planning
 * Hydrology/Hydraulics/Climatology
 * Quantitative Methods for Water Resources Planning
 * Independent Study (*)
 * Capstone Course – Advanced Planning Practicum


text:
Radiation Oncology/RTOG Trials/7928

RTOG 79-28 (LIVER)
 * Title: Phase I-II Study of Combined Modality Treatment of Primary Liver Cancer with Isotopic Immunoglobulin, Liver Irradiation, and ADR/5-FU
 * Objective:
 * I. Determine the therapeutic efficacy of combining administration of radiolabeled anti-CEA or anti-ferritin with whole liver radiotherapy plus combination chemotherapy using adriamycin/5-fluorouracil in patients with primary liver cancer.
 * II. Determine the maximal tolerated dose of radiolabeled antibody and the toxicities associated with this treatment.
 * III. Determine the dose distributions of anti-CEA and anti-ferritin in the tumor and in the entire body and compare the dose distributions of the 2 antibodies in hepatoma.
 * Protocol:
 * Nonrandomized study. Following treatment on Regimens A and B, patients with hepatic biliary carcinoma are entered to Arm I and patients with hepatoma to Arm I or Arm II.
 * Regimen A: Adriamycin/5-FU + whole liver RT
 * Regimen B: Adriamycin/5-FU
 * Arm I: I-131-labeled anti-CEA.
 * Arm II: I-131-labeled anti-ferritin.
 * Maintenance: Adriamycin/5-FU
 * Eligibility: Histologically documented primary hepatic malignancy who have measurable or evaluable disease.
 * Enrolled:
 * Conclusion:
 * PMID 6275989 -- Phase I-II study of isotopic immunoglobulin therapy for primary liver cancer. (Ettinger DS, Cancer Treat Rep. 1982 Feb;66(2):289-97.) Conclusion : "Present results suggest that further clinical studies with isotopic immunoglobulin are indicated."
 * Publications:
 * PMID 2998178 -- Computed tomography assisted volumetric analysis of primary liver tumor as a measure of response to therapy. (Ettinger DS, Am J Clin Oncol. 1985 Oct;8(5):413-8.) Conclusion : "In spite of small changes in total liver volume, there may be concomitantly substantial changes in tumor volume.
 * PMID 6085756 -- Comparative tumor dose from 131I-labeled polyclonal anti-ferritin, anti-AFP, and anti-CEA in primary liver cancers. (Leichner PK, Cancer Drug Deliv. 1984 Fall;1(4):321-8.)
 * PMID 6307515 -- Dosimetry of 131I-labeled antiferritin in hepatoma: specific activities in the tumor and liver. (Leichner PK, Cancer Treat Rep. 1983 Jul-Aug;67(7-8):647-58.) Conclusion : "These data, in conjunction with toxicity studies and tumor effective half-life measurements, led to the present treatment regimen of administering 30 mCi of polyclonal antiferritin IgG on Day 0 and 20 mCi on Day 5 following the first injection."
 * PMID 6275989 -- Phase I-II study of isotopic immunoglobulin therapy for primary liver cancer. (Ettinger DS, Cancer Treat Rep. 1982 Feb;66(2):289-97.) Conclusion : "Present results suggest that further clinical studies with isotopic immunoglobulin are indicated."
 * PMID 6268576 -- Dosimetry of 131I-labeled anti-ferritin in hepatoma: a model for radioimmunoglobulin dosimetry. (Leichner PK, Int J Radiat Oncol Biol Phys. 1981 Mar;7(3):323-33.)

title: Radiation Oncology/RTOG Trials/7928


text:
Talk:Muggles' Guide to Harry Potter/Books/Goblet of Fire

The existence of the false Moody should not be on this page, as it is a major part of the discoveries in the book. It was as Alastor Moody that he was hired, it was as Alastor Moody that he acted throughout the book, so it is as Alastor Moody that he should appear on this page, in my not-so-humble opinion. Chazz 23:22, 28 December 2006 (UTC)

Chapters
There is now a reasonable chapter summery for chapter 32 of Harry Potter and the Goblet of Fire. I hope to be able to do more chapter summeries (if not much else) for the rest of the books, when i have some spare time on my hands. Jammi568 17:36, 16 March 2007 (UTC)

 * Welcome to the project. Please contact User:Chazz before you write any more chapter summaries so that you can get familiar with the writing style of these pages from an experienced editor. Please also note that this is not Wikipedia and the links you added to Dumbledore's page are incorrect. -within focus 19:51, 16 March 2007 (UTC)

okay, sure thing. But for a first attempt, i think it was very good, personally Jammi568 09:12, 17 March 2007 (UTC)

 * For a first effort, yes... but it will need to be expanded now to include all the details that are important; for instance, the fact that Harry's blood was used in Voldemort's revival was somehow interesting to Dumbledore later, and the author has suggested that we should be curious about that. The amount of interest caused by that one choice certainly makes it critical that we include that in the synopsis, and perhaps go into it in greater depth both in the analysis (where we would mention that Voldemort says that it will grant him immunity against the protection from his mother's sacrifice) and in the greater picture (where we mention Dumbledore's interest in chapter 36, and speculate on the effect it will have in Deathly Hallows). Chazz (talk) 21:30, 18 March 2007 (UTC)


text:
X86 Assembly/X86 Architecture

x86 Architecture
The x86 architecture has 8 General-Purpose Registers (GPR), 6 Segment Registers, 1 Flags Register and an Instruction Pointer. 64-bit x86 has additional registers.

General-Purpose Registers (GPR) - 16-bit naming conventions
The 8 GPRs are as follows :
 * 1) Accumulator register (AX). Used in arithmetic operations. Opcodes combining constants into accumulator are 1-byte.
 * 2) Base register (BX). Used as a pointer to data (located in segment register DS, when in segmented mode).
 * 3) Counter register (CX). Used in shift/rotate instructions and loops.
 * 4) Stack Pointer register (SP). Pointer to the top of the stack.
 * 5) Stack Base Pointer register (BP). Used to point to the base of the stack.
 * 6) Destination Index register (DI). Used as a pointer to a destination in stream operations.
 * 7) Source Index register (SI). Used as a pointer to a source in stream operations.
 * 8) Data register (DX). Used in arithmetic operations and I/O operations.

The order in which they are listed here is for a reason: it is the same order that is used in a push-to-stack operation, which will be covered later.

All registers can be accessed in 16-bit and 32-bit modes. In 16-bit mode, the register is identified by its two-letter abbreviation from the list above. In 32-bit mode, this two-letter abbreviation is prefixed with an 'E' (extended). For example, 'EAX' is the accumulator register as a 32-bit value.

Similarly, in the 64-bit version, the 'E' is replaced with an 'R' (register), so the 64-bit version of 'EAX' is called 'RAX'.

It is also possible to address the first four registers (AX, CX, DX and BX) in their size of 16-bit as two 8-bit halves. The least significant byte (LSB), or low half, is identified by replacing the 'X' with an 'L'. The most significant byte (MSB), or high half, uses an 'H' instead. For example, CL is the LSB of the counter register, whereas CH is its MSB.

In total, this gives us five ways to access the accumulator, counter, data and base registers: 64-bit, 32-bit, 16-bit, 8-bit LSB, and 8-bit MSB. The other four are accessed in only four ways: 64-bit, 32-bit, 16-bit, and 8-bit. The following table summarises this:

Segment Registers
The 6 Segment Registers are:

 * Stack Segment (SS). Pointer to the stack ('S' stands for 'Stack').
 * Code Segment (CS). Pointer to the code ('C' stands for 'Code').
 * Data Segment (DS). Pointer to the data ('D' stands for 'Data').
 * Extra Segment (ES). Pointer to extra data ('E' stands for 'Extra'; 'E' comes after 'D').
 * F Segment (FS). Pointer to more extra data ('F' comes after 'E').
 * G Segment (GS). Pointer to still more extra data ('G' comes after 'F').

Most applications on most modern operating systems (like FreeBSD, Linux or Microsoft Windows) use a memory model that points nearly all segment registers to the same place (and uses paging instead), effectively disabling their use. Typically the use of FS or GS is an exception to this rule, instead being used to point at thread-specific data.

EFLAGS Register
The EFLAGS is a 32-bit register used as a collection of bits representing Boolean values to store the results of operations and the state of the processor.

The names of these bits are:

The bits named 0 and 1 are reserved bits and shouldn't be modified.

Instruction Pointer
The EIP register contains the address of the next instruction to be executed if no branching is done.

EIP can only be read through the stack after a  instruction.

Memory
The x86 architecture is little-endian, meaning that multi-byte values are written least significant byte first. (This refers only to the ordering of the bytes, not to the bits.)

So the 32 bit value B3B2B1B016 on an x86 would be represented in memory as:

For example, the 32 bits double word 0x1BA583D4 (the 0x denotes hexadecimal) would be written in memory as:

This will be seen as  when doing a memory dump.

Two's Complement Representation
Two's complement is the standard way of representing negative integers in binary. The sign is changed by inverting all of the bits and adding one.

0001 represents decimal 1

1111 represents decimal -1

Addressing modes
In x86 assembly language, addressing modes determine how memory operands are specified in instructions. Addressing modes allow the programmer to access data from memory or perform operations on operands effectively. The x86 architecture supports various addressing modes, each offering different ways to reference memory or registers. Here are some common addressing modes in x86:

 * Register Addressing
 * (operand address R is in the address field)

 * Immediate
 * (actual value is in the field)

or

 * Direct memory addressing
 * (operand address is in the address field)

 * Direct offset addressing
 * (uses arithmetics to modify address)

 * Register Indirect
 * (field points to a register that contains the operand address)

 * The registers used for indirect addressing are BX, BP, SI, DI

General-purpose registers (64-bit naming conventions)
64-bit x86 adds 8 more general-purpose registers, named R8, R9, R10 and so on up to R15.

 * R8–R15 are the new 64-bit registers.
 * R8D–R15D are the lowermost 32 bits of each register.
 * R8W–R15W are the lowermost 16 bits of each register.
 * R8B–R15B are the lowermost 8 bits of each register.

As well, 64-bit x86 includes SSE2, so each 64-bit x86 CPU has at least 8 registers (named XMM0–XMM7) that are 128 bits wide, but only accessible through SSE instructions. They cannot be used for quadruple-precision (128-bit) floating-point arithmetic, but they can each hold 2 double-precision or 4 single-precision floating-point values for a SIMD parallel instruction. They can also be operated on as 128-bit integers or vectors of shorter integers. If the processor supports AVX, as newer Intel and AMD desktop CPUs do, then each of these registers is actually the lower half of a 256-bit register (named YMM0–YMM7), the whole of which can be accessed with AVX instructions for further parallelization.

Stack
The stack is a Last In First Out (LIFO) data structure; data is pushed onto it and popped off of it in the reverse order.

The Stack is usually used to pass arguments to functions or procedures and also to keep track of control flow when the  instruction is used. The other common use of the Stack is temporarily saving registers.

Real Mode
Real Mode is a holdover from the original Intel 8086. You generally won't need to know anything about it (unless you are programming for a DOS-based system or, more likely, writing a boot loader that is directly called by the BIOS).

The Intel 8086 accessed memory using 20-bit addresses. But, as the processor itself was 16-bit, Intel invented an addressing scheme that provided a way of mapping a 20-bit addressing space into 16-bit words. Today's x86 processors start in the so-called Real Mode, which is an operating mode that mimics the behavior of the 8086, with some very tiny differences, for backwards compatibility.

In Real Mode, a segment and an offset register are used together to yield a final memory address. The value in the segment register is multiplied by 16 (shifted 4 bits to the left) and the offset is added to the result. This provides a usable address space of 1 MB. However, a quirk in the addressing scheme allows access past the 1 MB limit if a segment address of 0xFFFF (the highest possible) is used; on the 8086 and 8088, all accesses to this area wrapped around to the low end of memory, but on the 80286 and later, up to 65520 bytes past the 1 MB mark can be addressed this way if the A20 address line is enabled. See: The A20 Gate Saga.

One benefit shared by Real Mode segmentation and by Protected Mode Multi-Segment Memory Model is that all addresses must be given relative to another address (this is, the segment base address). A program can have its own address space and completely ignore the segment registers, and thus no pointers have to be relocated to run the program. Programs can perform near calls and jumps within the same segment, and data is always relative to segment base addresses (which in the Real Mode addressing scheme are computed from the values loaded in the Segment Registers).

This is what the DOS *.COM format does; the contents of the file are loaded into memory and blindly run. However, due to the fact that Real Mode segments are always 64 KB long, COM files could not be larger than that (in fact, they had to fit into 65280 bytes, since DOS used the first 256 bytes of a segment for housekeeping data); for many years this wasn't a problem.

Flat Memory Model
If programming in a modern 32-bit operating system (such as Linux, Windows), you are basically programming in flat 32-bit mode. Any register can be used in addressing, and it is generally more efficient to use a full 32-bit register instead of a 16-bit register part. Additionally, segment registers are generally unused in flat mode, and using them in flat mode is not considered best practice.

Multi-Segmented Memory Model
Using a 32-bit register to address memory, the program can access (almost) all of the memory in a modern computer. For earlier processors (with only 16-bit registers) the segmented memory model was used. The 'CS', 'DS', and 'ES' registers are used to point to the different chunks of memory. For a small program (small model) the CS=DS=ES. For larger memory models, these 'segments' can point to different locations.

Long Mode
The term "Long Mode" refers to the 64-bit mode.

Programmation Assembleur x86/Registres X86アセンブラ/x86アーキテクチャ Assembly x86/Registos

title: X86 Assembly/X86 Architecture


text:
X86 Assembly/GNU assembly syntax

General Information
Examples in this article are created using the AT&T assembly syntax used in GNU AS. The main advantage of using this syntax is its compatibility with the GCC inline assembly syntax. However, this is not the only syntax that is used to represent x86 operations. For example, NASM uses a different syntax to represent assembly mnemonics, operands and addressing modes, as do some High-Level Assemblers. The AT&T syntax is the standard on Unix-like systems but some assemblers use the Intel syntax, or can, like GAS itself, accept both. See X86 assembly language Syntax for a comparative table.

GAS instructions generally have the form mnemonic source, destination. For instance, the following mov instruction:

This will move the hexadecimal value 5 into the register al.

Operation Suffixes
GAS assembly instructions are generally suffixed with the letters "b", "s", "w", "l", "q" or "t" to determine what size operand is being manipulated.

 * = byte (8 bit).
 * = single (32-bit floating point).
 * = word (16 bit).
 * = long (32 bit integer or 64-bit floating point).
 * = quad (64 bit).
 * = ten bytes (80-bit floating point).

If the suffix is not specified, and there are no memory operands for the instruction, GAS infers the operand size from the size of the destination register operand (the final operand).

Prefixes
When referencing a register, the register needs to be prefixed with a "%". Constant numbers need to be prefixed with a "$".

Address operand syntax
There are up to 4 parameters of an address operand that are presented in the syntax. This is equivalent to  in Intel syntax.

The base, index and displacement components can be used in any combination, and every component can be omitted; omitted components are excluded from the calculation above.

Introduction
This section is written as a short introduction to GAS. GAS is part of the GNU Project, which gives it the following nice properties:

 * It is available on many operating systems.
 * It interfaces nicely with the other GNU programming tools, including the GNU C compiler (gcc) and GNU linker (ld).

If you are using a computer with the Linux operating system, chances are you already have GAS installed on your system. If you are using a computer with the Windows operating system, you can install GAS and other useful programming utilities by installing Cygwin or Mingw. The remainder of this introduction assumes you have installed GAS and know how to open a command-line interface and edit files.

Generating assembly
Since assembly language corresponds directly to the operations a CPU performs, a carefully written assembly routine may be able to run much faster than the same routine written in a higher-level language, such as C. On the other hand, assembly routines typically take more effort to write than the equivalent routine in C. Thus, a typical method for quickly writing a program that performs well is to first write the program in a high-level language (which is easier to write and debug), then rewrite selected routines in assembly language (which performs better). A good first step to rewriting a C routine in assembly language is to use the C compiler to automatically generate the assembly language. Not only does this give you an assembly file that compiles correctly, but it also ensures that the assembly routine does exactly what you intended it to.

We will now use the GNU C compiler to generate assembly code, for the purposes of examining the GAS assembly language syntax.

Here is the classic "Hello, world" program, written in C:

Save that in a file called "hello.c", then type at the prompt:

gcc -o hello_c hello.c

This should compile the C file and create an executable file called "hello_c". If you get an error, make sure that the contents of "hello.c" are correct.

Now you should be able to type at the prompt:

./hello_c

and the program should print "Hello, world!" to the console.

Now that we know that "hello.c" is typed in correctly and does what we want, let's generate the equivalent 32-bit x86 assembly language. Type the following at the prompt:

gcc -S -m32 hello.c

This should create a file called "hello.s" (".s" is the file extension that the GNU system gives to assembly files). On more recent 64-bit systems, the 32-bit source tree may not be included, which will cause a "bits/predefs.h fatal error"; you may replace the  gcc directive with an   directive to generate 64-bit assembly instead. To compile the assembly file into an executable, type:

gcc -o hello_asm -m32 hello.s

(Note that gcc calls the assembler (as) and the linker (ld) for us.) Now, if you type the following at the prompt:

./hello_asm

this program should also print "Hello, world!" to the console. Not surprisingly, it does the same thing as the compiled C file.

Let's take a look at what is inside "hello.s":

The contents of "hello.s" may vary depending on the version of the GNU tools that are installed; this version was generated with Cygwin, using gcc version 3.3.1.

The lines beginning with periods, like,  , or   are assembler directives — commands that tell the assembler how to assemble the file. The lines beginning with some text followed by a colon, like, are labels, or named locations in the code. The other lines are assembly instructions.

The  and   directives are for debugging. We can leave them out:

"hello.s" line-by-line
This line declares the start of a section of code. You can name sections using this directive, which gives you fine-grained control over where in the executable the resulting machine code goes, which is useful in some cases, like for programming embedded systems. Using. by itself tells the assembler that the following code goes in the default section, which is sufficient for most purposes.

This code declares a label, then places some raw ASCII text into the program, starting at the label's location. The  specifies a line-feed character, while the   specifies a null character at the end of the string; C routines mark the end of strings with null characters, and since we are going to call a C string routine, we need this character here. (NOTE! String in C is an array of datatype char (char[]) and does not exist in any other form, but because one would understand strings as a single entity from the majority of programming languages, it is clearer to express it this way.)

This line tells the assembler that the label  is a global label, which allows other parts of the program to see it. In this case, the linker needs to be able to see the  label, since the startup code with which the program is linked calls   as a subroutine.

This line declares the  label, marking the place that is called from the startup code.

These lines save the value of EBP on the stack, then move the value of ESP into EBP, then subtract 8 from ESP. Note that  automatically decremented ESP by the appropriate length. The  on the end of each opcode indicates that we want to use the version of the opcode that works with long (32-bit) operands; usually the assembler is able to work out the correct opcode version from the operands, but just to be safe, it's a good idea to include the ,  ,  , or other suffix. The percent signs designate register names, and the dollar sign designates a literal value. This sequence of instructions is typical at the start of a subroutine to save space on the stack for local variables; EBP is used as the base register to reference the local variables, and a value is subtracted from ESP to reserve space on the stack (since the Intel stack grows from higher memory locations to lower ones). In this case, eight bytes have been reserved on the stack. We shall see why this space is needed later.

This code s ESP with 0xFFFFFFF0, aligning the stack with the next lowest 16-byte boundary. An examination of Mingw's source code reveals that this may be for SIMD instructions appearing in the  routine, which operate only on aligned addresses. Since our routine doesn't contain SIMD instructions, this line is unnecessary.

This code moves zero into EAX, then moves EAX into the memory location EBP - 4, which is in the temporary space we reserved on the stack at the beginning of the procedure. Then it moves the memory location EBP - 4 back into EAX; clearly, this is not optimized code. Note that the parentheses indicate a memory location, while the number in front of the parentheses indicates an offset from that memory location.

These functions are part of the C library setup. Since we are calling functions in the C library, we probably need these. The exact operations they perform vary depending on the platform and the version of the GNU tools that are installed.

This code (finally!) prints our message. First, it moves the location of the ASCII string to the top of the stack. It seems that the C compiler has optimized a sequence of  into a single move to the top of the stack. Then, it calls the  subroutine in the C library to print the message to the console.

This line stores zero, our return value, in EAX. The C calling convention is to store return values in EAX when exiting a routine.

This line, typically found at the end of subroutines, frees the space saved on the stack by copying EBP into ESP, then popping the saved value of EBP back to EBP.

This line returns control to the calling procedure by popping the saved instruction pointer from the stack.

Communicating directly with the operating system
Note that we only have to call the C library setup routines if we need to call functions in the C library, like. We could avoid calling these routines if we instead communicate directly with the operating system. The disadvantage of communicating directly with the operating system is that we lose portability; our code will be locked to a specific operating system. For instructional purposes, though, let's look at how one might do this under Windows. Here is the C source code, compilable under Mingw or Cygwin:

Ideally, you'd want check the return codes of "GetStdHandle" and "WriteFile" to make sure they are working correctly, but this is sufficient for our purposes. Here is what the generated assembly looks like:

Even though we never use the C standard library, the generated code initializes it for us. Also, there is a lot of unnecessary stack manipulation. We can simplify:

Analyzing line-by-line:

We save the old EBP and reserve four bytes on the stack, since the call to WriteFile needs somewhere to store the number of characters written, which is a 4-byte value.

We push the constant value STD_OUTPUT_HANDLE (-11) to the stack and call GetStdHandle. The returned handle value is in EAX.

We push the parameters to WriteFile and call it. Note that the Windows calling convention is to push the parameters from right-to-left. The load-effective-address instruction adds -4 to the value of EBP, giving the location we saved on the stack for the number of characters printed, which we store in EBX and then push onto the stack. Also note that EAX still holds the return value from the GetStdHandle call, so we just push it directly.

Here we set our program's return value and restore the values of EBP and ESP using the  instruction.

Caveats
From The GAS manual's AT&T Syntax Bugs section:

The UnixWare assembler, and probably other AT&T derived ix86 Unix assemblers, generate floating point instructions with reversed source and destination registers in certain cases. Unfortunately, gcc and possibly many other programs use this reversed syntax, so we're stuck with it.

For example

results in  being updated to   rather than the expected. This happens with all the non-commutative arithmetic floating point operations with two register operands where the source register is  and the destination register is.

Note that even objdump -d -M intel still uses reversed opcodes, so use a different disassembler to check this. See http://bugs.debian.org/372528 for more info.

Additional GAS reading
You can read more about GAS at the GNU GAS documentation page:

https://sourceware.org/binutils/docs/as/

 * X86 Disassembly/Calling Conventions

title: X86 Assembly/GNU assembly syntax


text:
X86 Assembly/X86 Instructions

These pages will discuss, in detail, the different instructions available in the basic x86 instruction set. For ease, and to decrease the page size, the different instructions will be broken up into groups, and discussed individually.

 * Data Transfer Instructions
 * Control Flow Instructions
 * Arithmetic Instructions
 * Logic Instructions
 * Shift and Rotate Instructions
 * Other Instructions
 * x86 Interrupts

For more info, see the resources section.

Conventions
The following template will be used for instructions that take no operands:

The following template will be used for instructions that take 1 operand:

The following template will be used for instructions that take 2 operands. Notice how the format of the instruction is different for different assemblers.

The following template will be used for instructions that take 3 operands. Notice how the format of the instruction is different for different assemblers.

Suffixes
Some instructions, especially when built for non-Windows platforms (i.e. Unix, Linux, etc.), require the use of suffixes to specify the size of the data which will be the subject of the operation. Some possible suffixes are:

 * (byte) = 8 bits.
 * (word) = 16 bits.
 * (long) = 32 bits.
 * (quad) = 64 bits.

An example of the usage with the mov instruction on a 32-bit architecture, GAS syntax:

On Intel Syntax you don't have to use the suffix. Based on the register name and the used immediate value the compiler knows which data size to use.

X86アセンブラ/x86の命令

title: X86 Assembly/X86 Instructions


text:
X86 Assembly/Floating Point

The ALU is only capable of dealing with integer values. While integers are sufficient for some applications, it is often necessary to use decimals. A highly specialized coprocessor, all part of the FPU – the floating-point unit –, will allow you to manipulate numbers with fractional parts.

x87 Coprocessor
The original x86 family members had a separate math coprocessor that handled floating point arithmetic. The original coprocessor was the 8087, and all FPUs since have been dubbed “x87” chips. Later variants integrated the FPU into the microprocessor itself. Having the capability to manage floating point numbers means a few things:
 * 1) The microprocessor must have space to store floating point numbers.
 * 2) The microprocessor must have instructions to manipulate floating point numbers.

The FPU, even when it is integrated into an x86 chip, is still called the “x87” section. For instance, literature on the subject will frequently call the FPU Register Stack the “x87 Stack”, and the FPU operations will frequently be called the “x87 instruction set”.

The presence of an integrated x87 FPU can be checked using the  instruction.

FPU Register Stack
The FPU has an array of eight registers that can be accessed as a stack. There is one top index indicating the current top of the stack. Pushing or popping items to or from the stack will only change the top index and store or wipe data respectively.

or simply  refers to the register that is currently at the top of the stack. If eight values were stored on the stack,  refers to last element on the stack (i. e. the bottom).

Numbers are pushed onto the stack from memory, and are popped off the stack back to memory. There is no instruction allowing to transfer values directly to or from ALU registers. The x87 stack can only be accessed by FPU instructions ‒ you cannot write  ‒ it is necessary to store values to memory if you want to print them, for example.

FPU instructions generally will pop the first two items off the stack, act on them, and push the answer back on to the top of the stack.

Floating point numbers may generally be either 32 bits long, the  data type in the programming language C, or 64 bits long,   in C. However, in order to reduce round-off errors, the FPU stack registers are all 80 bits wide.

Most calling conventions return floating point values in the  register.

Examples
The following program (using NASM syntax) calculates the square root of 123.45.

Essentially, programs that use the FPU load values onto the stack with  and its variants, perform operations on these values, then store them into memory with one of the forms of , most commonly   when you are done with x87, to clean up the x87 stack as required by most calling conventions.

Here is a more complex example that evaluates the Law of Cosines:

Floating-Point Instruction Set
You may notice that some of the instructions below differ from another in name by just one letter: a P appended to the end. This suffix signifies that in addition to performing the normal operation, they also Pop the x87 stack after execution is complete.

Original 8087 instructions
FDISI, FENI, FLDENVW, FLDPI, FNCLEX, FNDISI, FNENI, FNINIT, FNSAVEW, FNSTENVW, FRSTORW, FSAVEW, FSTENVW

Data Transfer Instructions

 * : load floating-point value
 * : load integer
 * load a constant on top of the stack
 * : $$+1$$
 * : $$\log_2 e$$
 * : $$\log_2 10$$
 * : $$\log_{10} 2$$
 * : $$\ln 2$$
 * : “positive” $$0$$
 * : $$\ln 2$$
 * : “positive” $$0$$

 * , : store integer
 * : exchange
 * : store a truncated integer
 * : store a truncated integer

Arithmetic Instructions

 * : absolute value
 * : change sign
 * : split exponent and significant

 * ,,  : addition
 * ,,  : subtraction
 * ,,  : reverse subtraction

 * : square root
 * ,,  : division (see also   bug on Wikipedia)
 * : partial remainder
 * : round to integer
 * : multiply/divide by integral powers of 2
 * : $$2^x - 1$$
 * : $$y \log_2 x$$
 * : $$y \log_2\left(x + 1\right)$$
 * : multiply/divide by integral powers of 2
 * : $$2^x - 1$$
 * : $$y \log_2 x$$
 * : $$y \log_2\left(x + 1\right)$$

FPU Internal and Other Instructions

 * : initialize FPU

 * and : increment or decrement top
 * : tag a register as free

 * : test
 * ,,  : compare floating-point values
 * , : compare with an integer
 * : examine a register

 * : clear exceptions
 * does the same as.
 * does the same as.

Added with 80287
FSETPM

Added with 80387
FCOS, FLDENVD, FNSAVED, FNSTENVD, FPREM1, FRSTORD, FSAVED, FSIN, FSINCOS, FSTENVD, FUCOM, FUCOMP, FUCOMPP

Added with Pentium Pro
FCMOVB, FCMOVBE, FCMOVE, FCMOVNB, FCMOVNBE, FCMOVNE, FCMOVNU, FCMOVU, FCOMI, FCOMIP, FUCOMI, FUCOMIP, FXRSTOR, FXSAVE

Added with SSE
FXRSTOR, FXSAVE

These are also supported on later Pentium IIs which do not contain SSE support

Added with SSE3
FISTTP (x87 to integer conversion with truncation regardless of status word)

Undocumented instructions

 * : performs  and pops the stack

title: X86 Assembly/Floating Point


text:
X86 Assembly/MMX

MMX is a supplemental instruction set introduced by Intel in 1996. Most of the new instructions are "single instruction, multiple data" (SIMD), meaning that single instructions work with multiple pieces of data in parallel.

MMX has a few problems, though: instructions run slightly slower than the regular arithmetic instructions, the Floating Point Unit (FPU) can't be used when the MMX registers are in use, and MMX registers use saturation arithmetic.

Saturation Arithmetic
In an 8-bit grayscale picture, 255 is the value for pure white, and 0 is the value for pure black. In a regular register (AX, BX, CX ...) if we add one to white, we get black! This is because the regular registers "roll-over" to the next value. MMX registers get around this by a technique called "Saturation Arithmetic". In saturation arithmetic, the value of the register never rolls over to 0 again. This means that in the MMX world, we have the following equations:

255 + 100 = 255 200 + 100 = 255 0 - 100 = 0; 99 - 100 = 0;

This may seem counter-intuitive at first to people who are used to their registers rolling over, but it makes sense in some situations: if we try to make white brighter, it shouldn't become black.

Single Instruction Multiple Data (SIMD) Instructions
The MMX registers are 64 bits wide, but can be broken down as follows:

2 32 bit values 4 16 bit values 8 8 bit values

The MMX registers cannot easily be used for 64 bit arithmetic. Let's say that we have 4 bytes loaded in an MMX register: 10, 25, 128, 255. We have them arranged as such:

MM0: | 10 | 25 | 128 | 255 |

And we do the following pseudo code operation:

MM0 + 10

We would get the following result:

MM0: | 10+10 | 25+10 | 128+10 | 255+10 | = | 20 | 35 | 138 | 255 |

Remember that our arithmetic "saturates" in the last box, so the value doesn't go over 255.

Using MMX, we are essentially performing 4 additions in the time it takes to perform 1 addition using the regular registers, using 4 times fewer instructions.

MMX Registers
There are 8 64-bit MMX registers. To avoid having to add new registers, they were made to overlap with the FPU stack register. This means that the MMX instructions and the FPU instructions cannot be used simultaneously. MMX registers are addressed directly, and do not need to be accessed by pushing and popping in the same way as the FPU registers.

MM7 MM6 MM5 MM4 MM3 MM2 MM1 MM0

These registers correspond to the same numbered FPU registers on the FPU stack.

Usually when you initiate an assembly block in your code that contains MMX instructions, the CPU automatically will disallow floating point instructions. To re-allow FPU operations you must end all MMX code with .

The following is a program for GNU AS and GCC which copies 8 bytes from one variable to another and prints the result.

Assembler portion

C portion

MMX Instruction Set
Several suffixes are used to indicate what data size the instruction operates on:
 * Byte (8 bits)
 * Word (16 bits)
 * Double word (32 bits)
 * Quad word (64 bits)

The signedness of the operation is also signified by the suffix: US for unsigned and S for signed.

For example, PSUBUSB subtracts unsigned bytes, while PSUBSD subtracts signed double words.

MMX defined over 40 new instructions, listed below.

EMMS, MOVD, MOVQ, PACKSSDW, PACKSSWB, PACKUSWB, PADDB, PADDD, PADDSB, PADDSW, PADDUSB, PADDUSW, PADDW, PAND, PANDN, PCMPEQB, PCMPEQD, PCMPEQW, PCMPGTB, PCMPGTD, PCMPGTW, PMADDWD, PMULHW, PMULLW, POR, PSLLD, PSLLQ, PSLLW, PSRAD, PSRAW, PSRLD, PSRLQ, PSRLW, PSUBB, PSUBD, PSUBSB, PSUBSW, PSUBUSB, PSUBUSW, PSUBW, PUNPCKHBW, PUNPCKHDQ, PUNPCKHWD, PUNPCKLBW, PUNPCKLDQ, PUNPCKLWD, PXOR

title: X86 Assembly/MMX


text:
X86 Assembly/SSE

SSE stands for Streaming SIMD Extensions. It is essentially the floating-point equivalent of the MMX instructions. The SSE registers are 128 bits, and can be used to perform operations on a variety of data sizes and types. Unlike MMX, the SSE registers do not overlap with the floating point stack.

Registers
SSE, introduced by Intel in 1999 with the Pentium III, creates eight new 128-bit registers:

XMM0 XMM1 XMM2 XMM3 XMM4 XMM5 XMM6 XMM7

Originally, an SSE register could only be used as four 32-bit single precision floating point numbers (the equivalent of a  in C). SSE2 expanded the capabilities of the XMM registers, so they can now be used as:

 * 2 64-bit floating points (double precision)
 * 2 64-bit integers
 * 4 32-bit floating points (single-precision)
 * 4 32-bit integers
 * 8 16-bit integers
 * 16 8-bit characters (bytes)

Data movement examples
The following program (using NASM syntax) performs data movements using SIMD instructions.

Arithmetic example using packed singles
The following program (using NASM syntax) performs a few SIMD operations on some numbers.

The result values should be: 30.800   51.480    77.000    107.360

Using the GNU toolchain, you can debug and single-step like this:

Debugger commands explained

 * break: In this case, sets a breakpoint at a given label
 * stepi: Steps one instruction forward in the program
 * p: short for print, prints a given register or variable. Registers are prefixed by $ in GDB.
 * x: short for examine, examines a given memory address. The "/4f" means "4 floats" (floats in GDB are 32-bits). You can use c for chars, x for hexadecimal and any other number instead of 4 of course. The "&" takes the address of v1, as in C.

Shuffling example using shufps
can be used to shuffle packed single-precision floats. The instruction takes three parameters,  an xmm register,   an xmm or a 128-bit memory location and   an 8-bit immediate control byte. will take two elements each from  and , copying the elements to. The lower two elements will come from  and the higher two elements from.

IMM8 control byte description
IMM8 control byte is split into four group of bit fields that control the output into  as follows:

  specifies which element of   ends up in the least significant element of  :

 specifies which element of   ends up in the second element of  :

 specifies which element of   ends up in the third element of  :

 specifies which element of   ends up in the most significant element of  :

IMM8 Example

Consider the byte 0x1B:

The 2-bit values shown above are used to determine which elements are copied to. Bits 7-4 are "indexes" into, and bits 3-0 are "indexes" into the.
 * Since bits 7-6 are 0, the least significant element of  is copied to the most significant elements of , bits 127-96.
 * Since bits 5-4 are 1, the second element of  is copied to third element of , bits 95-64.
 * Since bits 3-2 are 2, the third element of  is copied to the second element of , bits 63-32.
 * Since bits 0-1 are 3, the fourth element of  is copied to the least significant elements of , bits (31-0).

Note that since the first and second arguments are equal in the following example, the mask 0x1B will effectively reverse the order of the floats in the XMM register, since the 2-bit integers are 0, 1, 2, 3. Had it been 3, 2, 1, 0 (0xE4) it would be a no-op. Had it been 0, 0, 0, 0 (0x00) it would be a broadcast of the least significant 32 bits.

Example

Using GAS to build an ELF executable

Text Processing Instructions
SSE 4.2 adds four string text processing instructions,  ,   and. These instructions take three parameters,  an xmm register,   an xmm or a 128-bit memory location and   an 8-bit immediate control byte. These instructions will perform arithmetic comparison between the packed contents of  and. specifies the format of the input/output as well as the operation of two intermediate stages of processing. The results of stage 1 and stage 2 of intermediate processing will be referred to as  and   respectively. These instructions also provide additional information about the result through overload use of the arithmetic flags(, ,  ,  ,   and  ).

The instructions proceed in multiple steps:
 * 1)  and   are compared
 * 2) An aggregation operation is applied to the result of the comparison with the result flowing into
 * 3) An optional negation is performed with the result flowing into
 * 4) An output in the form of an index(in ) or a mask(in  ) is produced

IMM8 control byte description
IMM8 control byte is split into four group of bit fields that control the following settings:

  specifies the format of the 128-bit source data(  and  ):

  specifies the aggregation operation whose result will be placed in intermediate result 1, which we will refer to as. The size of  will depend on the format of the source data, 16-bit for packed bytes and 8-bit for packed words:

 specifies the polarity or the processing of , into intermediate result 2, which will be referred to as  :

 specifies the output selection, or how   will be processed into the output. For  and , the output is an index into the data currently referenced by  :

For  and , the output is a mask reflecting all the set bits in  :

 should be set to zero since it has no designed meaning.

The Four Instructions
, Packed Compare Implicit Length Strings, Return Index. Compares strings of implicit length and generates index in.

 Operands

arg1 arg2 IMM8
 * XMM Register
 * XMM Register
 * Memory
 * 8-bit Immediate value

 Modified flags

 * 1)  is reset if   is zero, set otherwise
 * 2)  is set if a null terminating character is found in , reset otherwise
 * 3)  is set if a null terminating character is found in , reset otherwise
 * 4)  is set to
 * 5)  is reset
 * 6)  is reset

Example

Expected output:

, Packed Compare Implicit Length Strings, Return Mask. Compares strings of implicit length and generates a mask stored in.

 Operands

arg1 arg2 IMM8
 * XMM Register
 * XMM Register
 * Memory
 * 8-bit Immediate value

 Modified flags
 * 1)  is reset if   is zero, set otherwise
 * 2)  is set if a null terminating character is found in , reset otherwise
 * 3)  is set if a null terminating character is found in , reset otherwise
 * 4)  is set to
 * 5)  is reset
 * 6)  is reset

, Packed Compare Explicit Length Strings, Return Index. Compares strings of explicit length and generates index in.

 Operands

arg1 arg2 IMM8
 * XMM Register
 * XMM Register
 * Memory
 * 8-bit Immediate value

 Implicit Operands

 * holds the length of
 * holds the length of

 Modified flags

 * 1)  is reset if   is zero, set otherwise
 * 2)  is set if   is < 16(for bytes) or 8(for words), reset otherwise
 * 3)  is set if   is < 16(for bytes) or 8(for words), reset otherwise
 * 4)  is set to
 * 5)  is reset
 * 6)  is reset

, Packed Compare Explicit Length Strings, Return Mask. Compares strings of explicit length and generates a mask stored in.

 Operands

arg1 arg2 IMM8
 * XMM Register
 * XMM Register
 * Memory
 * 8-bit Immediate value

 Implicit Operands

 * holds the length of
 * holds the length of

 Modified flags

 * 1)  is reset if   is zero, set otherwise
 * 2)  is set if   is < 16(for bytes) or 8(for words), reset otherwise
 * 3)  is set if   is < 16(for bytes) or 8(for words), reset otherwise
 * 4)  is set to
 * 5)  is reset
 * 6)  is reset

SSE Instruction Set
There are literally hundreds of SSE instructions, some of which are capable of much more than simple SIMD arithmetic. For more in-depth references take a look at the resources chapter of this book.

You may notice that many floating point SSE instructions end with something like PS or SD. These suffixes differentiate between different versions of the operation. The first letter describes whether the instruction should be Packed or Scalar. Packed operations are applied to every member of the register, while scalar operations are applied to only the first value. For example, in pseudo-code, a packed add would be executed as: v1[0] = v1[0] + v2[0] v1[1] = v1[1] + v2[1] v1[2] = v1[2] + v2[2] v1[3] = v1[3] + v2[3] While a scalar add would only be: v1[0] = v1[0] + v2[0] The second letter refers to the data size: either Single or Double. This simply tells the processor whether to use the register as four 32-bit floats or two 64-bit doubles, respectively.

SSE: Added with Pentium III
Floating-point Instructions:

ADDPS, ADDSS, CMPPS, CMPSS, COMISS, CVTPI2PS, CVTPS2PI, CVTSI2SS, CVTSS2SI, CVTTPS2PI, CVTTSS2SI, DIVPS, DIVSS, LDMXCSR, MAXPS, MAXSS, MINPS, MINSS, MOVAPS, MOVHLPS, MOVHPS, MOVLHPS, MOVLPS, MOVMSKPS, MOVNTPS, MOVSS, MOVUPS, MULPS, MULSS, RCPPS, RCPSS, RSQRTPS, RSQRTSS, SHUFPS, SQRTPS, SQRTSS, STMXCSR, SUBPS, SUBSS, UCOMISS, UNPCKHPS, UNPCKLPS

Integer Instructions:

ANDNPS, ANDPS, ORPS, PAVGB, PAVGW, PEXTRW, PINSRW, PMAXSW, PMAXUB, PMINSW, PMINUB, PMOVMSKB, PMULHUW, PSADBW, PSHUFW, XORPS

SSE2: Added with Pentium 4
Floating-point Instructions:

ADDPD, ADDSD, ANDNPD, ANDPD, CMPPD, CMPSD*, COMISD, CVTDQ2PD, CVTDQ2PS, CVTPD2DQ, CVTPD2PI, CVTPD2PS, CVTPI2PD, CVTPS2DQ, CVTPS2PD, CVTSD2SI, CVTSD2SS, CVTSI2SD, CVTSS2SD, CVTTPD2DQ, CVTTPD2PI, CVTTPS2DQ, CVTTSD2SI, DIVPD, DIVSD, MAXPD, MAXSD, MINPD, MINSD, MOVAPD, MOVHPD, MOVLPD, MOVMSKPD, MOVSD*, MOVUPD, MULPD, MULSD, ORPD, SHUFPD, SQRTPD, SQRTSD, SUBPD, SUBSD, UCOMISD, UNPCKHPD, UNPCKLPD, XORPD

 * * CMPSD and MOVSD have the same name as the string instruction mnemonics CMPSD (CMPS) and MOVSD (MOVS); however, the former refer to scalar double-precision floating-points whereas the latter refer to doubleword strings.

Integer Instructions:

MOVDQ2Q, MOVDQA, MOVDQU, MOVQ2DQ, PADDQ, PSUBQ, PMULUDQ, PSHUFHW, PSHUFLW, PSHUFD, PSLLDQ, PSRLDQ, PUNPCKHQDQ, PUNPCKLQDQ

SSE3: Added with later Pentium 4
ADDSUBPD, ADDSUBPS, HADDPD, HADDPS, HSUBPD, HSUBPS, MOVDDUP, MOVSHDUP, MOVSLDUP

SSSE3: Added with Xeon 5100 and early Core 2
PSIGNW, PSIGND, PSIGNB, PSHUFB, PMULHRSW, PMADDUBSW, PHSUBW, PHSUBSW, PHSUBD, PHADDW, PHADDSW, PHADDD, PALIGNR, PABSW, PABSD, PABSB

SSE4.1: Added with later Core 2
MPSADBW, PHMINPOSUW, PMULLD, PMULDQ, DPPS, DPPD, BLENDPS, BLENDPD, BLENDVPS, BLENDVPD, PBLENDVB, PBLENDW, PMINSB, PMAXSB, PMINUW, PMAXUW, PMINUD, PMAXUD, PMINSD, PMAXSD, ROUNDPS, ROUNDSS, ROUNDPD, ROUNDSD, INSERTPS, PINSRB, PINSRD, PINSRQ, EXTRACTPS, PEXTRB, PEXTRW, PEXTRD, PEXTRQ, PMOVSXBW, PMOVZXBW, PMOVSXBD, PMOVZXBD, PMOVSXBQ, PMOVZXBQ, PMOVSXWD, PMOVZXWD, PMOVSXWQ, PMOVZXWQ, PMOVSXDQ, PMOVZXDQ, PTEST, PCMPEQQ, PACKUSDW, MOVNTDQA

SSE4a: Added with Phenom
LZCNT, POPCNT, EXTRQ, INSERTQ, MOVNTSD, MOVNTSS

SSE4.2: Added with Nehalem
CRC32, PCMPESTRI, PCMPESTRM, PCMPISTRI, PCMPISTRM, PCMPGTQ

title: X86 Assembly/SSE


text:
X86 Assembly/3DNow!

3DNow! is AMD's extension of the MMX instruction set (K6-2 and more recent) for with floating-point instruction. The instruction set never gained much popularity, and AMD announced on August 2010 that support for 3DNow! will be dropped in future AMD processors, except for two instructions.

title: X86 Assembly/3DNow!