It Used to All Be Assembly Language
In the past, control programs (operating systems, database managers, etc.) and many applications were written in assembly language to maximize the machine's performance. Today, C/C++ is widely used instead. Like assembly language, C/C++ can manipulate the bits at the machine level, but it is also portable to different computer platforms. There are C/C++ compilers for almost all computers.
Assembly Language Vs. Machine Language
Although often used synonymously, assembly language and machine language are not the same. Assembly language is turned into machine language. For example, the assembly instruction COMPARE A,B is translated into COMPARE contents of memory bytes 2340-2350 with 4567-4577 (where A and B happen to be located). The physical binary format of the machine instruction is specific to the computer it's running in.
They Can Be Quite Different
Assembly languages are quite different between computers as is evident in the example below, which takes 16 lines of code for the mini and 82 lines for the micro. The example changes Fahrenheit to Celsius.
HP 3000
begin
intrinsic read,print,binary,ascii;
array buffer(0:17);
array string(0:3);
byte array b'string(*) = string;
integer ftemp, ctemp, len;
move buffer:= "Enter Fahrenheit ";
print (buffer,-30,%320);
len:=read (string,-4);
ftemp:= binary(b'string,len);
ctemp:= (ftemp-32) * 5 / 9;
len:= ascii(ctemp,1-,b'string);
move buffer:= "Celsius is ";
move buffer(14) := string, (-len);
print (buffer,-32,%0);
end
PC (Intel x86)
cseg segment para public 'CODE'
assume cs:cseg,ds:cseg
start:
jmp start1
msgstr db 'Enter Fahrenheit '
crlf db 13,10,'$'
nine db 9
five db 5
outstr db 'Centrigrade is $'
start1: push ds
push cs
pop ds
mov dx,offset cseg:msgstr
mov ah,9
int 21h
sloop:
cent: call getnumb
test ax,ax
je exit
push ax
mov dx,offset cseg:outstr
mov ah,9
int 21h
pop ax
sub ax,32
jns c1
push ax
mov dl,'-'
mov ah,6
int 21h
pop ax
neg ax
cl: mul five
div nine
call putval
mov dx,offset cseg:crlf
mov ah,9
int 21h
jmp sloop
exit: pop ds
mov ah,4ch
int 21h
getnumb:
xor bx,bx
llp: mov dl,0ffh
mov ah,1
int 21h
cmp al,0dh
je llr
sub al,'0'
jb llr
cmp al,'9'
ja llr
xor ah,ah
shl bx,1
add ax,bx
shl bx,1
shl bx,1
add bx,ax
jmp llp
llr: mov dx,offset cseg:crlf
mov ah,9
int 21h
mov ax,bx
ret
putval: xor bx,bx
push bx
mov bx,10
llg: xor dx,dx
div bx
add dx,'0'
push dx
test ax,ax
jne llg
bloop: pop dx
test dx,dx
je endx
mov ah,6
int 21h
jmp bloop
endx: ret
cseg ends
end start
![]() | Reproduced with permission from Computer Desktop Encyclopedia. Copyright (c) 1981-2008 The Computer Language Company Inc. All rights reserved. |
Additional Resources
- Python update makes break with past
- Python 3.0 is a major change from the Python 2 series, and the first release that is intentionally backwards-incompatible. Python developers on Wednesday released the final version of Python 3.0, a major reworking of the programming language that is incompatible with the Python 2 series. Python...
- News items 2008-12-04
- Password stealing malware masquerades as Firefox add-on
- Malware researchers at BitDefender are reporting on a newly discovered malware (Trojan.PWS.ChromeInject.B) that when once dropped in Firefox's add-ons directory starts operating as such, and attempts to steal accounting data from a predefined list of over a hundred E-banking sites. Once the accounting data is obtained, it's forwarded to a...
- Blog posts 2008-12-04
- Schwartz: Three reasons you need JavaFX
- In the run-up to today's launch of JavaFX, ZDNet sat down with Sun CEO Jonathan Schwartz to get his thoughts on JavaFX, Flash, and the future of Java. [ Read: Sun launches JavaFX 1.0, and JavaFX Q&A ] [Ed] Q. Why did Sun create...
- Blog posts 2008-12-04
- JavaFX Q&A
- To learn more about the technical aspects of today's launch of JavaFX including its support in NetBeans and Eclipse I spoke in depth with Eric Klein, VP of Java Marketing at Sun, and Octavian Tanase, Senior Director of the Java Platform Group. For a more business oriented perspective see the...
- Blog posts 2008-12-04
- Open source thrives in downturn
- Collaboration initiatives are all about streamlining business processes, and the interfaces between legacy closed systems and open source stacks are an increasingly common place to find business collaboration environments. According to research firm Gartner, open source software is present in 85% of enterprises and the...
- Blog posts 2008-12-03
- Apple removes Mac antivirus language from site
- Apple removes Mac antivirus language from siteProbably Windows"Previously, the company’s security message in its KnowledgeBase was as follows: “Apple encourages the widespread use of multiple antivirus utilities so that virus programmers have more than one application to circumvent, thus making the whole virus writing process more difficult.” "I think they...
- Discussion threads 2008-12-03
- Apple removes Mac antivirus language from site
- Eagle-eyed Elinor Mills, reporter at sister site CNET, has the scoop that Apple has removed the 2007 item from its support site late last night that urged Mac customers to use multiple antivirus utilities. Now, the company says the Mac is safe "out of the box."(What say...
- Blog posts 2008-12-03
- E pur se muove (and yet it moves)
- * Ryan Naraine is traveling. Guest editorial by Ivan Arce On January 15, 2008, the Vatican released a statement indicating that Pope Benedict XVI had canceled his visit to Italian La Sapienza University as a result of a series of protests...
- Blog posts 2008-12-02
- Has technology evolved our language beyond recognition?
- Has technology evolved our language beyond recognition?Huh?What does Fry's sexual orientation have to do with anything?RE: Has technology evolved our language beyond recognition?Sorry, this is nothing new. Every new thing, and every new idea is built on things and ideas that came before.If you doubt this consider how many...
- Discussion threads 2008-12-02
- Who put the 'crap' in 'Crapintosh'?
- Who put the 'crap' in 'Crapintosh'?Matte Screen - YESI agree wholeheartedly with your final words. Why anyone would think that a highly reflective gloss LCD screen is preferable to a non-reflective matte one beats me.RE: MariusSilverwolfHe's got a degree in English Literature; he's more qualified than me to write on...
- Discussion threads 2008-12-02
- News to know: Apple and anti-virus; Vista SP2; Kumo; Palm; Linux
- Here are today's notable headlines. You can get News To Know via email alert and RSS daily: Christopher Dawson: Just what does it take to switch to desktop Linux (part 2)? Ryan Naraine: Apple: Mac users should run multiple anti-virus Breaking...
- Blog posts 2008-12-02
- Has technology evolved our language beyond recognition?
- You pick up your Blackberry in the morning because your notebook has a virus. You connect to your cloud storage and retrieve a few documents to store on your drive, and grab yourself a cup of Java. I get emails every day, mostly ordinary commentary from like-minded...
- Blog posts 2008-12-01
- Openbravo to push open source ERP more aggressively in US
- One open source project is giving thanks for reaching the one million download milestone and believes the worldwide financial crisis will only accelerate its growth. Openbravo, a purveyor of a popular open source ERP application and newly acquired open source POS solution for the small to medium-sized enterprises, predicts...
- Blog posts 2008-12-01
- A back to school programming exercise
- For most of us in the States, we're getting back to work after four days of family and tryptophan. For the rest of the world, it's just plain Monday. Any way it goes, a lot of us could use something to get back in gear and could certainly...
- Blog posts 2008-11-30
- Virus hits nearly 75% of systems on Afghanistan military base
- Virus hits nearly 75% of systems on Afghanistan military baseThis isn't news.It's par for the course.RE: Virus hits nearly 75% of systemsHave these people not heard of Linux or Mac OS X?What these reports don't tell you...Is that the great majority of these infected systems are simply email stations for...
- Discussion threads 2008-11-29
- Why C wins: the cold realities of abstraction
- Why C wins: the cold realities of abstractionPoints of inflectionMy guess is that if we had a valid means of quantifying "abstractiveness" versus effectiveness we'd find a curve with clear points of inflection - and C on one of those.POSIX itself surprised it was not named SOSIX is an abstraction....
- Discussion threads 2008-11-29
- Hapax CEO recognises importance of shared infrastructure moving forward
- Hapax CEO recognises importance of shared infrastructure moving forwardIt's a competitive advantageHaving a well functioning ontology gives that company an edge. It should also be noted that it was no mean feat to produce it, espcially when we consider that the work is not the most exciting thing to do....
- Discussion threads 2008-11-28
- Hapax CEO recognises importance of shared infrastructure moving forward
- I had an enjoyable conversation with Mark Redgrave recently, ahead of his company's unveiling of their 'meaning platform,' Amplify. Mark is CEO of London-based Hapax, a company that has been applying patented technology to natural language processing NLP since 2000. According to the Press...
- Blog posts 2008-11-28
- Navigon 7200T
- Having to compete with the likes of Garmin and TomTom is no easy task, but Navigon is hoping to woo some new customers with the Navigon 7200T. Now, in the past, we've always commended Navigon for offering feature-rich GPS for an affordable price, but we've had issues with the spotty...
- Product reviews 2008-11-26
- Why engage in open source FUD?
- Why engage in open source FUD?WellWell with a screwed up patent system like you got in the USA where you can patent software code, you are bound to have problems.What FUD needs is a schoolto educate the public, in:What FUD isWho uses FUD past and presentHow to use FUDWho is/are/were...
- Discussion threads 2008-11-26
Neighboring Terms
Premier Vendor Content Whitepapers, webcasts & resources from our Power Center Sponsors
- Video: Making of Intel Core i7
-
The Intel Core i7 microprocessor is built using a new microarchitecture, codenamed Nehalem, that allows chips to handle more data, quicker and more energy efficiently. Go inside Intel labs and meet some of the thousands of Intel engineers who helped design and test the new processor.
- Learn about the mind-boggling effort and teamwork it required >>
CIO Sessions
- Check out our video interviews with leading CIOs today!
-
Differentiating Technorati from Google Technorati VP of Engineering: Dorion Carroll 11:50 -
On the Issues: From Net neutrality to bandwidth caps Qwest CTO: Pieter Poll 11:50 -
How to process over 300 million transactions per day Visa CIO: Michael Dreyer 11:30 -
Adopting collaboration tools in the enterprise Cisco CIO: Rebecca Jacoby 12:35 - All CIO Sessions »




