Machine Code Instructions

Sdílet
Vložit
  • čas přidán 22. 07. 2024
  • Describes the structure of typical machine code instructions

Komentáře • 204

  • @semtex6412
    @semtex6412 Před 3 lety +40

    7 years later and this video is relevant now more than EVER! top man Mr. Jones! can't thank you enough Sir!

  • @tedwoodpeacock4689
    @tedwoodpeacock4689 Před 6 lety +15

    Truly the most brilliant video series I have ever seen when it comes to explaining this topic. I can't believe how much I appreciate them. Thank you so much!

  • @prod.bythisjustin8449
    @prod.bythisjustin8449 Před 4 lety +4

    you are literally amazing and finally, allowing me understand this topic for my ee class.

  • @jorgecarrascal5284
    @jorgecarrascal5284 Před rokem +3

    I want to thank you for your video!!! I studied this long time ago, but it is wonderful you decided to post this video so more people can understand how a computer works!!!
    Information and understanding it, is important in human development!!!!
    THANK YOU

    • @johnphilipjones
      @johnphilipjones  Před rokem

      Thank you for your comment it is appreciated.
      Best wishes
      Phil

  • @sayedkazimi6008
    @sayedkazimi6008 Před 4 lety +2

    Very useful! I missed watching your videos. I like your explanation 👍🏼👍🏼

  • @alzalame
    @alzalame Před 5 lety +8

    Probably the best explanation that i have ever seen , short , constructive , hit's brain directly , thank you very much !

  • @cherifaly6757
    @cherifaly6757 Před 6 lety +7

    This is by far the best way of teaching computer science! Thanks alot!

  • @jay2short2
    @jay2short2 Před 8 lety +6

    You replies are actually better than the video itself. Great information, Phil, nice one !

  • @AndreUltrasi
    @AndreUltrasi Před 7 lety +2

    Thank you so much, here in Brazil there aren't video explanations like this.

  • @Mikeymikers1
    @Mikeymikers1 Před 2 lety +1

    this helps me in understanding ethereum and how EVM bytecodes work. thanks a bunch!

  • @stephenbaka
    @stephenbaka Před 6 lety +2

    Nice work, thank you for your clear explanation.

  • @nontraditionaltech2073
    @nontraditionaltech2073 Před 3 lety +4

    AWESOME video, just subbed! I’m a CS guy that loves the CE domain more than anything. This video has really helped me, getting ready to start writing a 6502 emulator. I will for sure check out your other videos as well. Cheers!

    • @johnphilipjones
      @johnphilipjones  Před 3 lety

      Thank you for the positive feedback it is appreciated.
      Best wishes Phil

  • @protossscud8435
    @protossscud8435 Před 10 lety +2

    informative, good and clear tutorial , please make more , thanks !

  • @2GFactFinder
    @2GFactFinder Před 6 lety +7

    Yes it is like having a personal tutor. Excellent and thank you very much.

  • @johntolkien9629
    @johntolkien9629 Před 7 lety +11

    Great stuff Scouse ! Super clear presentation. Hope other "teachers" gain your skill in clear communication. Keep up the good work !

  • @AImaxxing
    @AImaxxing Před 3 lety +2

    John phillip jones, this video is astounshing and really helped me. Really impeccable.

  • @maklasik
    @maklasik Před 7 lety +4

    Was looking for this kind of explanation for 5 hours! Thank you very much.

  • @hongkongcantonese501
    @hongkongcantonese501 Před 2 lety +2

    Extremely clear.

  • @mashanishadi5911
    @mashanishadi5911 Před 10 lety +1

    Thank you so much! Your videos are very useful and easy to follow. please upload more!

    • @johnphilipjones
      @johnphilipjones  Před 10 lety +1

      Thank you for your comments I hope to upload two or three a week.
      Bw
      Phil

  • @johnphilipjones
    @johnphilipjones  Před 10 lety +3

    Thank you for your comment. I am concentrating on Python videos at the moment but will return to more on machine code late next year.
    Best wishes
    Phil

  • @jibreelkeddo7030
    @jibreelkeddo7030 Před 7 lety +1

    This video helps a lot. Thank you :)

  • @isaiasprestes
    @isaiasprestes Před 5 lety +3

    Gosh! Finally a very good explanation about this topic. Thanks John!! You made my day!

  • @gamingweek-mv4mr
    @gamingweek-mv4mr Před 3 měsíci +1

    Man you realy helped no would could help me like this keep up the good work

  • @fintarabg
    @fintarabg Před 9 lety +1

    Thanks! You should do more videos on this topic as you explain this matter very, very well!

    • @johnphilipjones
      @johnphilipjones  Před 9 lety +1

      I will be doing more once I have finished doing the Python programming video
      Best wishes
      Phil

  • @hamzaism2712
    @hamzaism2712 Před 10 lety +1

    awesome tuto ,and it will be great if you can make a series about programming
    in assembly (emulator 8086 or something like that )
    and thanks

  • @a.a7907
    @a.a7907 Před 7 lety +2

    Thanks for sharing these useful tutorials. They helped me a lot understanding how does CPU work, and how can I understand Assembly.

  • @ehsanullahkhan5117
    @ehsanullahkhan5117 Před 6 lety +1

    Very helpful. ... carry on plz

  • @jibreelkeddo7030
    @jibreelkeddo7030 Před 7 lety +1

    I am not a CS major but rather an MIS major, it's cousin. I chose MIS to make getting an MBA easier in the future, but man, do I love coding from the bottom of my heart. It's awesome, and high level coding comes to me pretty naturally.
    Even if I will never use it, I want to learn low level coding too. It's fascinating. Now if only I could understand it just a bit better >.>

  • @abdumo4336
    @abdumo4336 Před 3 lety +1

    Thank you Mr John!!!!

  • @Daelion164
    @Daelion164 Před 10 lety +9

    Thanks for this. You made something that I thought was complicated really, really simple.

  • @TimCrinion
    @TimCrinion Před 8 lety +31

    I really want to watch a video of how they got from fiddling with transistors by hand to something that can interpret instructions.

    • @johnphilipjones
      @johnphilipjones  Před 8 lety +7

      +Tim Crinion That would be a long duration video
      Best
      Phil

    • @Dominoes282
      @Dominoes282 Před 8 lety +6

      +Tim Crinion I just went through a 4 month 200 level class to learn that. It's not easy m8.

  • @AbhishekKumar-oy2hw
    @AbhishekKumar-oy2hw Před 5 lety +4

    Thank you very much for this very clear and precise explanation..

  • @user-oh6wg7de4g
    @user-oh6wg7de4g Před 5 lety +1

    How are you doing sir, I liked this youtube very much sir, I am expected you are making these kind of, more sir

  • @anisassassino5000
    @anisassassino5000 Před 5 lety +3

    thank you it was very helpful :D !

  • @2359-UK
    @2359-UK Před 8 lety

    This video is fantastic. thanks for the lecture. thanks for posting it.

    • @johnphilipjones
      @johnphilipjones  Před 8 lety

      +Lo Janus Thank you for your generous comment.
      Regards
      Phil
      (John Philip Jones)

  • @hamzaism2712
    @hamzaism2712 Před 10 lety +1

    awesome explanation thanx,and it will be great if you can make a video series about
    programming using emulator 8086 or something like that

  • @christiancarter255
    @christiancarter255 Před 5 lety +5

    Beautiful!
    I want to one day program in binary. Literally. Even just a little.
    Thank you for showing binary representations of some the assembly instructions.

  • @ameeaty4088
    @ameeaty4088 Před 2 lety +1

    this was awesome thank you

  • @Sancarn
    @Sancarn Před 3 lety

    The lookup tables for getting from Assembly instructions to Opcodes - are these available / queryable from the OS?

    • @johnphilipjones
      @johnphilipjones  Před 3 lety

      You would need to install an assembler. To get the opcodes search on google for the instruction set of the processor.
      Best wishes
      Phil

  • @banwarifageriaexcelclasses1447

    very educative lesson ..sir can you please , prepare simple and nice video on VBA for beginners

  • @173028718
    @173028718 Před 7 lety +1

    Thanks a lot , Sir.

  • @nailnadiroglu8830
    @nailnadiroglu8830 Před 4 lety +1

    Great Teaching.

  • @vinayaksomalwar1232
    @vinayaksomalwar1232 Před 10 lety

    Great video! Very visual! Keep it up!

  • @sirlottawin
    @sirlottawin Před 7 lety +1

    Thank you so very much!

  • @angelfishgod
    @angelfishgod Před 7 lety +2

    Very informative! Thank you for the quality upload.

  • @hoangduy500
    @hoangduy500 Před 2 lety +1

    you just saved me. Thanks a lot :D!

    • @johnphilipjones
      @johnphilipjones  Před 2 lety +1

      Good to hear that the video helped.
      Best wishes Phil

  • @petraflorkova2728
    @petraflorkova2728 Před 5 lety +1

    May I say... how GRATEFUL I am for your amazing videos
    Thank you

  • @yasararafathn3283
    @yasararafathn3283 Před 5 lety +1

    I have got an idea thank u sir

  • @micahgilbertcubing5911
    @micahgilbertcubing5911 Před 5 lety +2

    Awesome! This helps so much with a personal project of mine (using logisim to simulate an 8 bit CPU)

  • @sfxmzxc
    @sfxmzxc Před 10 měsíci +2

    i'm lerning in chanel ser ...Thanks

  • @khalidnawaz6536
    @khalidnawaz6536 Před 3 lety +1

    VERY GOOD SIR.PLEASE UPLOAD FEW MORE VIDEOS

  • @freecrac
    @freecrac Před 7 lety +2

    For Intel 80386+ CPU:
    Instruction Prefix 0 or 1 Byte
    Address-Size Prefix 0 or 1 Byte
    Operand-Size Prefix 0 or 1 Byte
    Segment Prefix 0 or 1 Byte
    Opcode 1 or 2 Byte
    Mod R/M 0 or 1 Byte
    SIB, Scale Index Base (386+) 0 or 1 Byte
    Displacement 0, 1, 2 or 4 Byte (4 only 386+)
    Immediate 0, 1, 2 or 4 Byte (4 only 386+)
    Format of Postbyte(Mod R/M from Intel-Doku)
    ------------------------------------------
    MM RRR MMM
    MM - Memory addressing mode
    RRR - Register operand address
    MMM - Memory operand address
    RRR Register Names
    Filds 8bit 16bit 32bit
    000 AL AX EAX
    001 CL CX ECX
    010 DL DX EDX
    011 Bl BX EBX
    100 AH SP ESP
    101 CH BP EBP
    110 DH SI ESI
    111 BH DI EDI
    ---
    16bit memory (No 32 bit memory address prefix)
    MMM Default MM Field
    Field Sreg 00 01 10 11=MMM is reg
    000 DS [BX+SI] [BX+SI+o8] [BX+SI+o16]
    001 DS [BX+DI] [BX+DI+o8] [BX+DI+o16]
    010 SS [BP+SI] [BP+SI+o8] [BP+SI+o16]
    011 SS [BP+DI] [BP+DI+o8] [BP+DI+o16]
    100 DS [SI] [SI+o8] [SI+o16]
    101 DS [DI] [DI+o8] [SI+o16]
    110 SS [o16] [BP+o8] [BP+o16]
    111 DS [BX] [BX+o8] [BX+o16]
    Note: MMM=110,MM=0 Default Sreg is DS !!!!
    32bit memory (Has 67h 32 bit memory address prefix)
    MMM Default MM Field
    Field Sreg 00 01 10 11=MMM is reg
    000 DS [EAX] [EAX+o8] [EAX+o32]
    001 DS [ECX] [ECX+o8] [ECX+o32]
    010 DS [EDX] [EDX+o8] [EDX+o32]
    011 DS [EBX] [EBX+o8] [EBX+o32]
    100 SIB [SIB] [SIB+o8] [SIB+o32]
    101 SS [o32] [EBP+o8] [EBP+o32]
    110 DS [ESI] [ESI+o8] [ESI+o32]
    111 DS [EDI] [EDI+o8] [EDI+o32]
    Note: MMM=110,MM=0 Default Sreg is DS !!!!
    ---
    SIB is (Scale/Base/Index)
    SS BBB III
    Note: SIB address calculated as:
    =+*(2^(Scale))
    Fild Default Base
    BBB Sreg Register Note
    000 DS EAX
    001 DS ECX
    010 DS EDX
    011 DS EBX
    100 SS ESP
    101 DS o32 if MM=00 (Postbyte)
    SS EBP if MM00 (Postbyte)
    110 SS ESI
    111 DS EDI
    Fild Index
    III register Note
    000 EAX
    001 ECX
    010 EDX
    011 EBX
    100 never Index SS can be 00
    101 EBP
    110 ESI
    111 EDI
    Fild Scale coefficient
    SS =2^(SS)
    00 1
    01 2
    10 4
    11 8

  • @billallwell6507
    @billallwell6507 Před 6 lety

    Very nice. So we can either write out the assembler on a piece of paper, then convert on the paper and then maybe (in the early days) use switches to set each memory address with the correct sequence of binary bits ? The part I still get stuck on is that the assembler can also be a program to convert the codes for us. Is this a program that would be loaded into memory, and therefore the first assemlber would have had to have been hand written (from what I've read, but still a little confused )and manually placed in the memory ?

    • @johnphilipjones
      @johnphilipjones  Před 6 lety

      When you switch on a computer the electronics generates an electrical pulse. This pulse is applied to a CPU pin that causes a machine code instruction to be fetched from a specific memory location. This instruction is the first instruction of the boot program other instruction are then fetched decoded and executed in order one after another. This boot program then sets up the operating system by loading other programs that form the operating system. Once the operating system is in place it is able to load up other programs (such as the assembler) at the request of the user (i.e by clicking on an icon or by issuing a command).
      In the very early days switches were indeed throw to enter the program you wished to execute.

  • @fkas6278
    @fkas6278 Před 6 lety +1

    thank you very much

  • @michaelwilson5454
    @michaelwilson5454 Před 9 lety

    Very good video. You did a good job explaining this and the images shown really helps a lot. Thanks...

  • @allenlin3136
    @allenlin3136 Před 9 lety +1

    It really helps. Thank you.

  • @danekerkkamp2746
    @danekerkkamp2746 Před 2 lety

    So if I had for example machine code: 0xE1160547, the resulting assembly instruction would be the binary equivalent?

  • @dimitriosdesmos4699
    @dimitriosdesmos4699 Před 7 lety +2

    Great stuff exactly what I wanted to form good foundations

  • @kcvinu
    @kcvinu Před 2 lety +1

    Helpful video.

  • @ssn4936
    @ssn4936 Před 6 lety +1

    Thank you so much

  • @moon6080
    @moon6080 Před 7 lety

    would you be able to do a video on floating point binary?

  • @SubbirHosain
    @SubbirHosain Před 5 lety

    how to get opcode for different instruction set?

    • @johnphilipjones
      @johnphilipjones  Před 5 lety

      The following link takes you to the instruction set for the Z80: z80-heaven.wikidot.com/instructions-set
      Best wishes
      Phil

  • @eldarmv4865
    @eldarmv4865 Před 6 lety +1

    Thank you very much

  • @billyfromzera4162
    @billyfromzera4162 Před rokem +2

    It old but it still so good

  • @danishbhatia5004
    @danishbhatia5004 Před 9 lety

    hey thanx for this tutorial but how did you find the opcode for the instructions like inc, add, mov and so on....

    • @johnphilipjones
      @johnphilipjones  Před 9 lety +1

      Danish Bhatia All microprocessors have an instruction set. This is a list of instructions in together with there hexadecimal equivalent. The link below will take you to an instruction set in PDF format which can be downloaded.

    • @johnphilipjones
      @johnphilipjones  Před 9 lety

      Danish Bhatia oops this is the link:
      www.zilog.com/appnotes_download.php?FromPage=DirectLink&dn=UM0080&ft=User%20Manual&f=YUhSMGNEb3ZMM2QzZHk1NmFXeHZaeTVqYjIwdlpHOWpjeTk2T0RBdmRXMHdNRGd3TG5Ca1pnPT0=

  • @sanaaf5209
    @sanaaf5209 Před 10 lety

    How we should find opcode for an operation is there any method r it is assigned value

    • @johnphilipjones
      @johnphilipjones  Před 8 lety +1

      +sanaaf Each microprocessor will have it own user manual and there will be a list of assembly language instruction and in the column next to the instruction will be the hexadecimal value for the instruction. However, you would normally type up the program using an editor and use an assembler to convert the program to machine code (i.e. hexadecimal which is a way to represent binary).
      Regards
      Phil
      (John Philip Jones)

  • @harithreddy2603
    @harithreddy2603 Před 10 lety

    thanq sir..good work.... like to see ur more videos on youtube

    • @johnphilipjones
      @johnphilipjones  Před 10 lety

      Check out the following websites where I list all of the videos
      www.johnphilipjones.com/index.html
      www.pythonbytesize.com/
      Best wishes
      Phil

  • @ShahidQureshi-ee6wz
    @ShahidQureshi-ee6wz Před 5 lety

    Can assembly language play a significant role in programming for the Super Computers?

    • @johnphilipjones
      @johnphilipjones  Před 5 lety +1

      I have never coded for a super computer so cannot really comment. However, I used to code a lot in machine code. What I can say is that all languages are translated to machine code which then 'controls' the microcode (and/or the 'hardwiring'). With a FULL knowledge of the CPU you can always ensure a very efficient execution time when using machine code (well assembly language to be more accurate). However, it would take you an extremely long time to code any meaningful system using machine code. The C programming language has many efficient libraries for controlling CPUs and C programs can be much quicker to 'code up' than assembly language.

  • @amanullahchandio2320
    @amanullahchandio2320 Před rokem +1

    Thank you so much sir

  • @orbita1
    @orbita1 Před 9 lety

    Hi, I hope you can help me:
    I know what opcodes are and how they work, but i want to know something that i have just realised i've overlooked all this time, assembled code (binary after assembly) is just a sequence of instructions in the .text section right? (so all the opcodes with applicable operands).
    If so, i was wondering essentially how the CPU knows what each opcode actually refers to e.g. how does 0xDE mean 'load'?
    for example: say the cpu of a microcontroller turns on, the program counter = 0, so it loads the first opcode in .text (at the start of the section) into cpu and a hardware decoder in the cpu physically decodes each opcode which allows the CPU to translate the intended instruction into the correct operation, right? (then as program counter increments, you process the next operation (opcode)in .text).
    cheers!

    • @simonlee2817
      @simonlee2817 Před 8 lety

      +orbita1 I think I just have the same confusion like you. How can these 1s and 0s make sense to the CPU and be executed differently?

    • @thandermax
      @thandermax Před 8 lety +1

      +orbita1 Each OS has it's own standard of executable (Windows - PE, Linux - ELF...). OS loads the executable and parses the exe header and finds out starting address. OS loader then memory maps the exe and sets IP or EIP register to proper starting address by context switching. The program then continues there on. Now depending on addressing mode, the operand can be from .text part or .bss or .data? etc segment.
      But the first instruction (after switching on) is always a predefined address. For Intel/AMD IBM compatible pc, it is FFFFFFF0h or FFFF0h (depending on 32bit/16bit). Most of them are pointing to BIOS startup routines, which sets up rest of the booting process. Once the ball starts rolling, it works.

    • @marchawley6830
      @marchawley6830 Před 7 lety +1

      Your struggle may be related to asking how does the computer "understand." Perhaps it would help to remember that a computer is merely a bunch of switches. Some of those switches turn other switches on and off. The computer does not "understand" anything in the way a human understands things. The computer is just switches which have been arranged by humans in such a way that certain switches turn other switches on and off in a way to represent numbers and characters understandable to humans. A light switch does not "understand" that the up position means that it is been asked to light the room. When the switch is in the up position power flows to the light because humans have designed the circuit to work that way.

  • @stephenobrien2952
    @stephenobrien2952 Před 4 lety

    what software do you use to produce the videos?

    • @johnphilipjones
      @johnphilipjones  Před 4 lety

      I have put this info at the following link:
      www.pythonbytesize.com/educators.html
      Best wishes
      Phil

  • @johntolkien9629
    @johntolkien9629 Před 7 lety

    Hi John - Are you using Z80 opcodes here ?

  • @zinturis
    @zinturis Před 8 lety +2

    Great stuff! Thanks. Is it necessary to convert instructions and operands to hex numbers? Can you keep instructions as binary code instead of 3E or something like that?

    • @johnphilipjones
      @johnphilipjones  Před 8 lety +1

      +zinturis You would normally code in assembly language and this is converted to the necessary binary codes by the assembler. So in the machine you would actually see binary and not hexadecimal. However, it is usual to look at the binary in hexadecimal as it is easier for us to remember hexadecimal numbers rather than long binary numbers and it is also easy to convert between binary and hexadecimal. The following videos look at converting between Hexadecimal and binary:
      czcams.com/video/fhgk2rxrn-Q/video.html
      czcams.com/video/V-he1Ip36OA/video.html
      Best wishes
      Phil
      (John Philip Jones)

    • @zinturis
      @zinturis Před 8 lety

      Thanks a lot for the quick answer. Sorry if my questions may sound stupid, I am quite newbie in this but if you want to send certain instructions of machine code to the processor, what's the workflow of that? Can you do it from some terminal or do you need to create a text file and save as .bin or .. how that works in practice? I mean, how to control that process?

    • @johnphilipjones
      @johnphilipjones  Před 8 lety +1

      +zinturis You use an editor and type in your assembly language program and save it in a text file and use an assembler to convert your typed in program to machine code. You will need to download an assembler to match the CPU of your computer. However, a good way to learn is to download a CPU emulator that has an assembler incorporated. I used to do assembly programming on a Z80 flight micro-board, a 6511 micro-controller using an in-circuit emulator. However, these have now been superseded and I am not sure what is used today. However, I believe that the Raspberry Pi has a set up that allows for machine coding. I would recommend searching with the phrase "machine code emulator" and see what is out there to assist. Hope this helps.
      Best wishes
      Phil
      (John Philip Jones)

    • @zinturis
      @zinturis Před 8 lety

      From your earlier respond, I understand that assembly language is different for different CPUs? So, if I write z=x+y for Intel it is not gonna work on an AMD based computer? So what's different? Assembly commands or register addresses?

    • @johnphilipjones
      @johnphilipjones  Před 8 lety +1

      zinturis z = x + y is a high level statement and will be converted to the machine code of the CPU that is 'in' your computer by a compiler. However, putting this aside the opcode for add on each different type of CPU is different. Each processor also has a different register set i.e. different number of registers and of different lengths. The architecture of the CPU's can also be different some are RISC other CISC or a combination of both CISC and RISC.

  • @skynet320
    @skynet320 Před 9 lety +1

    Thank you sir for the video. But my question still is, how do you convert the assembly language code to machine code (opcode).Your reply will be much appreciated.

    • @johnphilipjones
      @johnphilipjones  Před 8 lety +1

      +Hammad Ahmed You write your program in assembly language and an assembler converts the assembly language to machine code.
      Regards
      Phil
      (John Philip Jones)

  • @SudarshanisedClick
    @SudarshanisedClick Před 8 lety +1

    great knowledge; thank u so much. Do u also teach MS-ACCESS? I want to know why does MS-ACCESS contain more than one table? and Why is a table called the primary building block of a database?

    • @johnphilipjones
      @johnphilipjones  Před 8 lety +2

      +Sudarshan Karki I am afraid I have no videos on MS-ACCESS
      Best wishes
      Phil

  • @ankitkurup3891
    @ankitkurup3891 Před 8 lety +4

    sir ,is it true that increment operation is done in instruction decode phase only??

  • @dylanisaac1017
    @dylanisaac1017 Před 4 lety

    where do you get this information from

    • @johnphilipjones
      @johnphilipjones  Před 4 lety +1

      The chip manufacturers have manuals on instruction sets. I used the Z80 manual for the information in this video. Back in the day I used to program this chip using assembly language and machine code. Do a Google search on the following to get the manual.
      Zilog Z80 manual
      Best wishes Phil

  • @overclucker
    @overclucker Před 5 lety

    I've been learning assembly for a while, but I had no clue that the destination register is part of the operator. I've been thinking of a and b as both being operands, but I guess it's not the case. Looks like people who use AT syntax are subtracting backwards =/

    • @johnphilipjones
      @johnphilipjones  Před 5 lety

      With machine code I would recommend that you consider source and destination for the 'data items' (i.e. operands)

  • @fakeapplestore4710
    @fakeapplestore4710 Před 7 lety +1

    yay! what a nice video

    • @awkb777
      @awkb777 Před 7 lety

      let me know if you have any questions

  • @pcuser80
    @pcuser80 Před 7 lety +1

    The great Z80!

  • @MelissaMelissasthlm
    @MelissaMelissasthlm Před rokem

    Hello, great video. My question is , are the registers hexadecimal form?

    • @johnphilipjones
      @johnphilipjones  Před rokem

      The registers actually hold binary patterns. It is usual to show these patterns in their hexadecimal form because as humans it is difficult for us to remember long binary patterns. It is much easier to remember hexadecimal and it is relatively easy to convert between binary and hexadecimal.
      Best wishes Phil

  • @yerriswamyk.m6530
    @yerriswamyk.m6530 Před 8 lety

    Can you tell me how assembler converts Mnemonics into opcode.

    • @johnphilipjones
      @johnphilipjones  Před 8 lety +2

      There is essentially a table that contains the mnemonics and opcode in there own column. The mnemonics (i.e. assembly language program) is supplied as a file to a computer program (the assembler) the table is referenced and an executable file that contains the opcodes and operands is created (this is the machine code). The machine code program is then loaded into the computers memory and this program is then executed

  • @junioralamu7438
    @junioralamu7438 Před rokem

    The op codes we learning are only 4 bits and the remaining 12 bits are the address, can you explain this? please

  • @sergeantcrow
    @sergeantcrow Před 8 lety +2

    Thank you for these tutorials...
    I am far more happier immersing myself in this type of learning activity than getting caught up watching political videos on CZcams.. For old times sake I have just discovered and installed Turbo C on my PCs like I used in the 90s...

  • @shikhasingh6865
    @shikhasingh6865 Před 6 lety

    can you explain this to me for 8086 instruction MOV CH,BL

    • @johnphilipjones
      @johnphilipjones  Před 6 lety

      Sorry I have never coded the 8086 so not sure what this instruction does.
      Best wishes
      Phil

  • @totallynotbluu
    @totallynotbluu Před 3 lety

    How does one find opcodes in an exe file?

    • @johnphilipjones
      @johnphilipjones  Před 3 lety

      You would typically write a machine code program in assembly language. The assembly language is then converted to machine code and stored in a file. The file content are then loaded into RAM to be executed. It is a case of locating the op code of the first assembly language instruction. Every assembly language instruction has a number of bytes that form the opcode and operand. Once you find the first op code you can count the number of bytes to the start of the next instruction. This will be the op code of the next instruction.
      Best wishes
      Phil

  • @NANO-SERWIS.MAREK-DASZKE
    @NANO-SERWIS.MAREK-DASZKE Před 4 lety +1

    Very Nice :)

  • @estebanmorales4089
    @estebanmorales4089 Před 5 lety +1

    Good video

  • @cronosfr1
    @cronosfr1 Před 3 lety +1

    thank you

  • @s.dcreations3978
    @s.dcreations3978 Před 5 lety

    Sir,how opcode and operands are combined in an instruction and how they are seperated in an instruction.

    • @johnphilipjones
      @johnphilipjones  Před 5 lety

      The first binary pattern (or first bits in the pattern) fetched fromm memory when you execute a program is always the opcode. Once decoded the instruction knows what to do with the rest of the instruction. This usually involve going back to the memory to get the operand. Once the current instruction has executed the CPU goes back to the memory to fetch the next instruction the and this will be the opcode.

    • @s.dcreations3978
      @s.dcreations3978 Před 5 lety

      @@johnphilipjones thank u sir and which digital circuits are invovlved in joining both opcode and operand together in an instruction.

  • @simonlee2817
    @simonlee2817 Před 8 lety

    I want to know about how machine code is executed. I mean, since you already have these 1s and 0s in RAM, how can the CPU tell from so many instructions and do different actions correspondingly?

    • @johnphilipjones
      @johnphilipjones  Před 8 lety +1

      +Simon Lee When you switch on a microprocessor system (e.g. a computer) the hardware will always look in the same memory location. This location must hold the first operation code to be executed i.e. the program to be executed starts at this memory location. For a computer this is the boot program. For an embedded system containing a microprocessor this location would contain the first operation code for the first program to be executed.

    • @simonlee2817
      @simonlee2817 Před 8 lety

      +John Philip Jones I am sorry, but I am still confused. I mean how the CPU can know these 1s or 0s mean MOV, ADD or SUB etc. How do 1s and 0s make sense to the CPU and indicate the CPU what to do?

    • @johnphilipjones
      @johnphilipjones  Před 8 lety +1

      +Simon Lee A microprocessor system is a collection of million of switches that control the movement of binary patterns along bus systems, In addition these switches can be arranged to perform logic and arithmetic operations. The control of these switches is achieved by another lower level language that is not machine code. However, the machine code is able to dictate which parts of this lower level language execute. Certain patterns within the machine code select the Mov, Inc parts of the lower level language that is to execute.

    • @simonlee2817
      @simonlee2817 Před 8 lety

      +John Philip Jones So, there is a lower level language than machine code. What it is? It seems to be getting complicated, is there any website or book that gives a detailed information and help me understand?

    • @johnphilipjones
      @johnphilipjones  Před 8 lety +4

      +Simon Lee One of the levels below is microcode and this is responsible for directing binary patterns throughout the CPU. The main controlling subsystem within the CPU is the control unit. However, my advice is not to go below machine code as unless you are an electronic engineer it is more likely to confuse any understanding of how you can control a microprocessor system using machine code. My recommendation is to consider the register set of a typical CPU and use register transfer language (RTL) to understand how each machine code instruction executes. The best way is to look at manuals associated with a microprocessor (although they are not easy reads). A good starting place is to search for the "Z80 assembly language manual".
      Hope this helps
      Phil

  • @malteeaser101
    @malteeaser101 Před 10 lety +4

    I get how you know that 01H is 00000001 in binary... But how do you convert the LD A into binary? Or is it something your remember from a list? I have to convert it into machine code, is machine code binary?

    • @johnphilipjones
      @johnphilipjones  Před 10 lety +3

      This is a very good question. Machine code is the language of the machine (I.e low and high voltage levels) which as humans we represent as binary. Every machine code instruction has it's own binary number. Load A with immediate data has the binary number 00111110 which is 3E in hexadecimal (an easy way to remember binary). So every instruction has it's own binary number. Every instruction has it's own binary number so in a sense it comes from a list as you suggest. However, in truth each number makes the electronics behave in a specific way. The binary patterns open and close electronic solid state switches that perform a simple task that when all executed in a specific order are able to implement sophisticated functionality.

    • @malteeaser101
      @malteeaser101 Před 10 lety +3

      John Philip Jones So does LOAD have it's own binary number? Or for example do LOAD A, LOAD B and LOAD C count as three different things with three separate binary numbers representing them?
      And does this mean that there is no way of mathematically converting LOAD A into binary in your head/on paper without a table that literally tells you which binary number represents each op code I think it's called?

    • @johnphilipjones
      @johnphilipjones  Před 10 lety +3

      malteeaser101 LD A, N has its own binary number called an Operation code. LD B, N has a different operation code. When writing assembly language program you type in instructions such as LD A, N and an assembler (computer program) converts the assembly language to machine code (i.e. binary patterns). You can also do the conversion as a human it is called hand assembly and it means you would have to either know all the codes or access them from a printed list.Back in the day I used to code in assembly and as sad as it may sound I knew all of the codes. But there was only around 70 different instructions for the machines I was working on.

    • @malteeaser101
      @malteeaser101 Před 10 lety

      John Philip Jones Haha thanks, I have a assessment due in soon and this helped A LOT.

    • @johnphilipjones
      @johnphilipjones  Před 9 lety +2

      Mo Fo Hello Mo, Every 'type' of CPU (processor) has its own machine code language and related assembly language. For example Intel processors are different to Motorola processors and have a different machine code language from one another. The description I have put forward is based on the Zilog Z80 processor which also has its own machine code language.
      I am unsure what machine code language you are referring to but what you are describing is what is often called absolute addressing The term addressing refers to how data is accessed by an individual machine code instruction. I have a short series of videos that show the difference. I have put links to their playlist below:
      czcams.com/play/PL6lxxT7IdTxGXX6D6j-zjzcgoOD8WYMS2.html
      Phil

  • @unlokia
    @unlokia Před 7 lety +1

    WOW, so easy! You've earned all your subs, and now you've got another one... ME! :) God bless you and thank you, have an amazing, prosperous life :))
    Matthew, Northants.

  • @ariseyhun2085
    @ariseyhun2085 Před 7 lety

    You used the term "INC A" quite often... but when you showed the binary or hex representation of it, it doesn't seem to include the 'A' part... I'm guessing because it's A (the first register of the CPU), you just omit it, but when you want to access B or C, would you simply have an operand directly proceeding the 3D (INC) Op Code?
    (Tried to make it as simple as possible to understand, sorry)

    • @johnphilipjones
      @johnphilipjones  Před 7 lety

      INC B would have a different opcode. INC C would also have a different opcode

  • @victorx4648
    @victorx4648 Před 5 lety +1

    Good old Z80 assembly.

  • @Abdullah_gujjar
    @Abdullah_gujjar Před 8 měsíci +1

    Thank you Sir ❤❤

  • @guliyevshahriyar
    @guliyevshahriyar Před rokem +1

    thanks.

  • @tobiasfurlan4812
    @tobiasfurlan4812 Před 2 lety +1

    Cheers man

  • @MrZacsim
    @MrZacsim Před 10 lety

    Very good.

  • @ankitkurup3891
    @ankitkurup3891 Před 8 lety

    But increment doesn't need alu operation,then why it is a part of execution cycle...

    • @johnphilipjones
      @johnphilipjones  Před 8 lety +2

      There is always a fetch of the opcode which then needs to be decoded to find out what this instruction (i.e. Opcode) is for. After the decode you are in the execute phase. An execute phase does not always mean that the ALU is used. For example moving data from a register to a memory location is an example of an execute phase.