943,525 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 22140
  • Assembly RSS
You are currently viewing page 1 of this multi-page discussion thread
Nov 12th, 2004
0

writing a a program in machine code

Expand Post »
Hi have one querery regarding writing in machine code,

address- instruction
00000 001 10000
00001 010 10000
00010 100 10000
00011 110 10001
00100 111 00000
10000 000 00001
10001 000 11111

i dont know how to write a program in machine code, which adds up to the numbers stored in cell 11000 11001, 11010 and stores the sum in cell 11011.

any help would be much appreciated angela
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ang19 is offline Offline
1 posts
since Nov 2004
Nov 12th, 2004
0

Re: writing a a program in machine code

i have one question. why would you want to write a program in machine code? I mean now with such advanced programming languages from c++ to even java is there any point to learning java.
Reputation Points: 33
Solved Threads: 19
Nearly a Posting Virtuoso
mikeandike22 is offline Offline
1,496 posts
since May 2004
Jan 23rd, 2007
0

Re: writing a a program in machine code

Hi you can write the Machine Code. Instead of writing mnemonics you can write opcodes in asm files , like
db 0aeh ;equal to far jmp instructions. Hope this will help u...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sivaramanNainar is offline Offline
2 posts
since Jan 2007
Jan 23rd, 2007
0

Re: writing a a program in machine code

If you are that much of a masochist, you would have to get hold of the technical reference manual(s) for your processor, and look up how assembly language instructions are encoded into machine code.

Short of writing an operating system for a brand new model of computer, without any possibility of cross assembly, I can't imagine why anybody would want to do it.
Reputation Points: 14
Solved Threads: 4
Junior Poster
mathematician is offline Offline
149 posts
since Nov 2006
Jan 23rd, 2007
0

Re: writing a a program in machine code

Do universities teach that any more? I thought writing programs in machine code went out in the early 1960s, before punch cards were invented.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,945 posts
since Aug 2005
Jan 23rd, 2007
0

Re: writing a a program in machine code

my dad used punchcards still at uni during the late 70's lol
Last edited by jbennet; Jan 23rd, 2007 at 6:28 pm.
Moderator
Featured Poster
Reputation Points: 1764
Solved Threads: 574
Moderator
jbennet is offline Offline
16,485 posts
since Apr 2005
Jan 24th, 2007
0

Re: writing a a program in machine code

There are valid reasons why someone would want to write a program in machine code, though I can't myself see why anyone would need to deal in binary. Anyhow, you can hand assemble code by swapping mneumonics with their opcodes, which are mainly giving in hex.
Last edited by Colin Mac; Jan 24th, 2007 at 10:14 am.
Reputation Points: 78
Solved Threads: 22
Posting Whiz
Colin Mac is offline Offline
327 posts
since Sep 2006
Jan 25th, 2007
0

Re: writing a a program in machine code

Click to Expand / Collapse  Quote originally posted by Colin Mac ...
There are valid reasons why someone would want to write a program in machine code
Only two I can think of
1) academic purposes

2) on obscure os that does not have an assembler
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,945 posts
since Aug 2005
Jan 27th, 2007
0

Re: writing a a program in machine code

Only two I can think of
1) academic purposes

2) on obscure os that does not have an assembler
Patches are frequently applied in machine code. NASA's procurement process for Space Shuttle flight software had the vendor providing a "signed off" image. Subsequent fixes after image sign off were applied as machine code patches. I had 20 words of patch space to work with in the Shuttle's SP0 cockpit display processor. Split 8 here and 12 over there. A reassemply/recertification of the load image to collect them up together was too economically painful to think about. We did hex patches.

Obviously debuggers and such need to do it when they implement the ability to alter code on the fly, and OS internals often do a bit of it when applying patches to known broken apps before allowing them to execute. DOS 5 and later for example, patch the in memory image of applications built with a buggy version of the Rational Systems DOS extender before giving them control.
Reputation Points: 31
Solved Threads: 0
Light Poster
Purple Avenger is offline Offline
49 posts
since Jan 2007
Jan 27th, 2007
0

Re: writing a a program in machine code

Patches are frequently applied in machine code. NASA's procurement process for Space Shuttle flight software had the vendor providing a "signed off" image. Subsequent fixes after image sign off were applied as machine code patches. I had 20 words of patch space to work with in the Shuttle's SP0 cockpit display processor. Split 8 here and 12 over there. A reassemply/recertification of the load image to collect them up together was too economically painful to think about. We did hex patches.
You proved my second reason (obscure os) -- not many people have the opportunity to program for a space shuttle.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,945 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: Can't set the vga color palette entrees
Next Thread in Assembly Forum Timeline: Assembly Beginner. Fahrenheit to Celsius Problem.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC