LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-23-2010, 03:04 PM   #16
fruttenboel
Member
 
Registered: Jul 2008
Location: Tilburg NL
Distribution: Slackware 14.2 ciurrent, kernel 3.18.11
Posts: 270

Rep: Reputation: 48

Quote:
Originally Posted by cvr View Post
Sir,
By seeing just the assembly code,How can we tell the code is 16-bit or 32 bit?
In my opinion it depends on the number of data lines of the processor!
am i rite?
What is the entry function i need to give if i want to compile the assembly code? (LIKE we will give main() in c-language)
That's called 'experience'.

This
Code:
MOV AX,CX
is a 16 bit move. AH = 8 bits. AX = 16 bits. EAX = 32 bits.

This
Code:
_SND_SPKR_TONE:
MOV AL,0B6H
OUT 43h,AL ; 43h = PIT mode control word (page 377)
is a typical DOS style routine to operate the hardware timer.

I programmed in assembly on the PC between 1987 and 1999. After that I switched to a language: Modula-2.
 
Old 06-23-2010, 03:06 PM   #17
fruttenboel
Member
 
Registered: Jul 2008
Location: Tilburg NL
Distribution: Slackware 14.2 ciurrent, kernel 3.18.11
Posts: 270

Rep: Reputation: 48
Quote:
Originally Posted by cvr View Post
I was using cs 5536 chipset(AMD) in the above assembly code ...
It's just plain 8086 assembly code.

Don't pay attention to it. It's old fashioned code that you can not use on anything else than DOS.

Or, are we fixing your homework again?
 
Old 06-23-2010, 04:22 PM   #18
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by cvr View Post
By seeing just the assembly code,How can we tell the code is 16-bit or 32 bit?
Let me expand on that "experience" answer you already got.

If you can read asm code, you can see that chunk of code has two 16 bit operations and several 8 bit operations and no larger operations.

But you can do 8 and 16 bit operations even in 32 or 64 bit mode. So nothing there absolutely rules out 32 or 64 bit mode. The listed 16 bit operations would be particularly stupid in 32 bit or 64 bit mode, but wouldn't be absolutely impossible.

All 32 and 64 bit modes are "protected" modes where any sane OS normally prevents user code from doing those I/O operations.

So combining all of the hints, an expert would have no doubt that this code was written for 16 bit mode, even if no single detail absolutely rules out 32 bit mode.
 
1 members found this post helpful.
Old 06-23-2010, 11:12 PM   #19
Recursion
LQ Newbie
 
Registered: Apr 2009
Posts: 27

Rep: Reputation: 17
Just to clear up some confusion. One does not compile assembly, one assembles it via an assembler.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[solved] missing stropts.h(apue code compilation in Fedora11) joyrock Programming 5 02-11-2010 12:37 PM
porting an inline Intel assembly code with MMX technology into linux arienashwani Ubuntu 0 03-05-2009 05:35 AM
assembly code on linux omerlh Programming 1 06-01-2006 03:25 AM
Can gcc cross-compile C code to M68K Assembly? lowpro2k3 Programming 1 03-25-2005 07:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration