8 Replies - 1308 Views - Last Post: 21 December 2016 - 01:50 PM

#1 ahmedcrow   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 30
  • Joined: 18-November 16

What's code before assembly ?

Posted 18 November 2016 - 08:57 AM

I've a question and supposed this is the proper section(I hope). I'm trying to learn assembly language to know how computer works inside and deeply, my questions is that how first programmers programmed the assemblers, did they used the machine code, and where I can write pure machine code in computer ?

I hope my question is clear.
Is This A Good Question/Topic? 0
  • +

Replies To: What's code before assembly ?

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15358
  • View blog
  • Posts: 61,577
  • Joined: 12-June 08

Re: What's code before assembly ?

Posted 18 November 2016 - 09:13 AM

Assembly is about as close to the metal as you will get outside of building your own AND/OR logical gates.
Was This Post Helpful? 0
  • +
  • -

#3 ahmedcrow   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 30
  • Joined: 18-November 16

Re: What's code before assembly ?

Posted 21 November 2016 - 11:10 AM

View Postmodi123_1, on 18 November 2016 - 09:13 AM, said:

Assembly is about as close to the metal as you will get outside of building your own AND/OR logical gates.

I think you're right, I loved to know what before just for knowing.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15358
  • View blog
  • Posts: 61,577
  • Joined: 12-June 08

Re: What's code before assembly ?

Posted 21 November 2016 - 11:42 AM

In theory you can build up hardware from gates to ALU/RAM/CPU to an OS that runs on said platform. Depends on where you want to spend your time.
Was This Post Helpful? 0
  • +
  • -

#5 ahmedcrow   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 30
  • Joined: 18-November 16

Re: What's code before assembly ?

Posted 28 November 2016 - 09:15 AM

Good.
Was This Post Helpful? 0
  • +
  • -

#6 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7135
  • View blog
  • Posts: 24,240
  • Joined: 05-May 12

Re: What's code before assembly ?

Posted 30 November 2016 - 07:03 AM

Before assemblers, the programmers would manually translate each assembly language instruction into its numerical machine language equivalent and then encode put that into either the long term memory or short term memory of the computer.

As worse case, you would use memory rope as long term storage:

Was This Post Helpful? 0
  • +
  • -

#7 ahmedcrow   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 30
  • Joined: 18-November 16

Re: What's code before assembly ?

Posted 30 November 2016 - 09:30 AM

This gives new information.
Was This Post Helpful? 0
  • +
  • -

#8 baavgai   User is offline

  • Dreaming Coder
  • member icon


Reputation: 7501
  • View blog
  • Posts: 15,544
  • Joined: 16-October 07

Re: What's code before assembly ?

Posted 30 November 2016 - 10:04 AM

Machine code.

Assembly, at its most basic, is a one to one replacement for machine code.

e.g. XOR CL, 12H = 10000000 11110001 00010010 = 80H F1H 12H
More here: https://en.wikibooks...uage_Conversion

Indeed, any string of bytes is conceivably machine code. When old machines hang or lock up, it's sometimes an internal buffer overflow. The executing code has lost it's way and the pointer is now somewhere else in memory, trying to execute those bytes. It could conceivably execute something detrimental, randomly. Usually, it finds its way to a jump statement and gets stuck in an infinite loop.
Was This Post Helpful? 0
  • +
  • -

#9 jjl   User is offline

  • Engineer
  • member icon

Reputation: 1271
  • View blog
  • Posts: 4,998
  • Joined: 09-June 09

Re: What's code before assembly ?

Posted 21 December 2016 - 01:50 PM

Quote

I'm trying to learn assembly language to know how computer works inside and deeply, my questions is that how first programmers programmed the assemblers,


Assemblers are specific to hardware architecture. Machine code is the lowest level code and it consists of binary instructions. Typically the first N bits of the instruction contain the function to perform, where the rest of the bits contain the data which to operate on.

i.e.

ADD R3 R2 R4 (add R3 and R2 and store result in R4)

may translate into something like
0001 0002 0003 0004
(ADD) R2 R3 R4

These instructions are sequentially executed by a program counter, which increments after each instruction is complete, or jumps to another area of instruction memory if a jump instruction is executed (similar to a continue, break, function call, goto, etc.. in C/C++).

You can write your own machine code if you desire, the first thing you need to do is find the documentation for the instruction set which your processor supports.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1