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

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.