machine language - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

machine language

I have to add 2,-3, and 6 in machine language. does anyone know how to do this?

Comments

  • EvenbitEvenbit Posts: 54Member
    : I have to add 2,-3, and 6 in machine language. does anyone know how to do this?
    :
    ; Add.asm
    ;
    ; Assemble with:
    ; NASM Add.asm -o Add.com
    ;

    org 100h

    mov al, 02
    add al, -03
    add al, 06

    ret

    However, if you need the actual hex code (since the subject is 'machine language' instead of 'assembly'), then here is a disassembly with the ML in the middle column:

    00000000 B002 mov al,0x2
    00000002 04FD add al,0xfd
    00000004 0406 add al,0x6
    00000006 C3 ret


Sign In or Register to comment.