This program stores the numbers 3 and 4 in registers ax and bx, adds them together and stores the sum in bx, then moves the contents of bx to dx and converts it to ASCII before printing it to the screen. The program stores 3 in bx, 4 in ax, adds them and puts the result in bx, then moves bx to dx and converts it to ASCII for output.
This program stores the numbers 3 and 4 in registers ax and bx, adds them together and stores the sum in bx, then moves the contents of bx to dx and converts it to ASCII before printing it to the screen. The program stores 3 in bx, 4 in ax, adds them and puts the result in bx, then moves bx to dx and converts it to ASCII for output.
This program stores the numbers 3 and 4 in registers ax and bx, adds them together and stores the sum in bx, then moves the contents of bx to dx and converts it to ASCII before printing it to the screen. The program stores 3 in bx, 4 in ax, adds them and puts the result in bx, then moves bx to dx and converts it to ASCII for output.
This program stores the numbers 3 and 4 in registers ax and bx, adds them together and stores the sum in bx, then moves the contents of bx to dx and converts it to ASCII before printing it to the screen. The program stores 3 in bx, 4 in ax, adds them and puts the result in bx, then moves bx to dx and converts it to ASCII for output.
Download as DOC, PDF, TXT or read online from Scribd
Download as doc, pdf, or txt
You are on page 1of 1
A small program written in Turbo assembler
; This program stores the numbers 3 and 4 in registers ax and bx
; The sum of registers ax and bx is stored in register bx ; The contents of register bx is moved to register dx ; Then dx is converted to ASCII and printed to the screen .model small ; se the small memor! model .stac" 3##h ; Include a stac" segment .data ; $eginning of data segment sum db % the sum of 3 and 4 is &% ; String to print to the screen .code ; Start of code start ' ; Starting address label mov ax()data ; *et data segment address mov ds(ax ; +oad data segment register mov ax(4 ; ,ove 4 into register ax mov bx(3 ; ,ove 3 into register bx add bx(ax ; Add ax to bx and store the sum in bx mov ah( #-h ; .ispla! string mov dx(offset sum ; The string int /0h ; Call $.1S mov dx(bx ; ,ove the sum of 3 and 4 to register dx add dl( 2#2 ; Convert binar! to ASCII mov ah( /h ; .ispla! character service routine int /0h ; Call $.1S ; 3xit the program exit ' mov ah(4Ch ; 3xit process int /0h ; Call $.1S end start ; 3nd of start