| | |
writing a a program in machine code
![]() |
•
•
Join Date: Nov 2004
Posts: 1
Reputation:
Solved Threads: 0
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
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
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.
•
•
Join Date: Nov 2006
Posts: 133
Reputation:
Solved Threads: 3
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.
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.
•
•
Join Date: Sep 2006
Posts: 326
Reputation:
Solved Threads: 22
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
Join Date: Jan 2007
Posts: 49
Reputation:
Solved Threads: 0
•
•
•
•
Only two I can think of
1) academic purposes
2) on obscure os that does not have an assembler
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.
•
•
•
•
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Other Threads in the Assembly Forum
- Previous Thread: Performance issue in code
- Next Thread: help in`assembly project
| Thread Tools | Search this Thread |






