• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
projectsgeek

ProjectsGeek

Download Mini projects with Source Code, Java projects with Source Codes

  • Home
  • Java Projects
  • C++ Projects
  • VB Projects
  • PHP projects
  • .Net Projects
  • NodeJs Projects
  • Android Projects
    • Project Ideas
      • Final Year Project Ideas
      • JSP Projects
  • Assignment Codes
    • Fundamentals of Programming Language
    • Software Design Laboratory
    • Data Structure and Files Lab
    • Computer Graphics Lab
    • Object Oriented Programming Lab
    • Assembly Codes
  • School Projects
  • Forum

Assembly Codes

2s Complement of a Numbers Assembly Code

May 4, 2011 by ProjectsGeek Leave a Comment

2s Complement of a Numbers Assembly Program

2s Complement of a Numbers Algorithm

Step I          :    Initialize the data memory.
Step II        :    Load the number in AX.
Step III       :    Initialize counter = 16 in CX.
Step IV       :    Rotate number by 1 bit position to left with carry.
Step V         :    Complement carry.
Step VI       :    Decrement count.
Step VII     :    Check if count = 0. If not goto step IV
Step VIII    :    Rotate once again by 1 bit to restore original carry back.
Step IX       :    2’s complement = 1’s complement in AX + 1
Step X        :    Display result.
Step XI       :    Stop.
    

2s Complement of a Numbers Assembly Code
 .model small  
 .data  
 a dw 1234H  
 .code  
     mov  ax, @data  ; Initialize data section  
     mov  ds, ax  
     mov  ax, a      ; Load number1 in ax  
     mov  cx, 16         ; Load CX with count  
 up: rcl    ax, 1      ; Rotate ax by 1bit to left with carry  
     cmc            ; find 1's complement of bit  
     loop  up        ; check if all bits complemented, if not goto up  
     rcl    ax, 1      ; return carry back to original position  
     add   ax, 1      ; 2's complement=1's complement+1  
     mov  ch, 04h    ; Count of digits to be displayed  
     mov  cl, 04h    ; Count to roll by 4 bits                  
     mov  bx, ax         ; Result in reg bx  
 l2:  rol    bx, cl     ; roll bl so that msb comes to lsb                
     mov  dl, bl      ; load dl with data to be displayed  
     and   dl, 0fH    ; get only lsb  
     cmp  dl, 09     ; check if digit is 0-9 or letter A-F            
     jbe   l4  
     add   dl, 07     ; if letter add 37H else only add 30H  
 l4:  add   dl, 30H  
     mov  ah, 02         ; Function 2 under INT 21H  
                    ; (Display character)  
     int    21H  
     dec   ch        ; Decrement Count  
     jnz   l2  
     mov  ah, 4cH    ; Terminate Program  
     int    21H  
     end

 

Other Projects to Try:

  1. How to find 1’s complement of a number
  2. Add 8 Bit BCD Numbers
  3. Add Two 16 Bit BCD Numbers Code
  4. Assembly Language Codes
  5. Program to Add Two 16 Bit Numbers Assembly Code

Filed Under: Assembly Codes Tagged With: Assembly Codes

BCD to 7 Segment Code Conversion

May 4, 2011 by ProjectsGeek Leave a Comment

BCD to 7 segment code conversion

BCD to 7 segment code conversion Algorithm

Step I       :    Initialize the data segment.
Step II     :    Load the offset of look up table in BX.
Step III   :    Load AL with key i.e. digit whose 7             
                      segment code is to be found.
Step IV    :    Compute 7 segment code using XLAT
                      instruction.
Step V     :    Display the result.
Step VI    :    Stop.

BCD to 7 segment code conversion Code

 .model small                                             
 .data  
 lookup db 01h, 04h, 1Ah, 09h, 02H  
 key db 02h  
 .code  
     mov  ax, @data      ; Initialize data section  
     mov  ds, ax  
     mov  bx, offset lookup ; Load offset of lookup in bx  
     mov  al, key             ; key no. in al  
     xlat                 ; translate byte in al  
     mov  bh, al          ; al = lookup(key)  
     mov  ch, 02h        ; Count of digits to be displayed  
     mov  cl, 04h         ; Count to roll by 4 bits  
 l2:  rol    bh, cl          ; roll bl so that msb comes to lsb  
     mov  dl, bh          ; load dl with data to be displayed  
     and   dl, 0fH         ; get only lsb  
     cmp  dl, 09          ; check if digit is 0-9 or letter A-F  
     jbe   l4  
     add   dl, 07          ; if letter add 37H else only add 30H  
 l4:  add   dl, 30H  
     mov  ah, 02              ; Function 2 under INT 21H (Display character)  
     int    21H   
     dec   ch            ; Decrement Count  
     jnz   l2     
     mov  ah, 4cH        ; Terminate Program  
     int    21H  
     end

 

Other Projects to Try:

  1. Add 8 Bit BCD Numbers
  2. Hex to BCD Conversion in Assembly Language Code
  3. BCD to decimal Conversion in Assembly Language
  4. Assembly Language Codes
  5. Add Two 16 Bit BCD Numbers Code

Filed Under: Assembly Codes Tagged With: Assembly Codes

Hex to BCD Conversion in Assembly Language Code

May 4, 2011 by ProjectsGeek Leave a Comment

Hex to BCD Conversion in Assembly Language Code

Write a Program For Hex to BCD Conversion in Assembly language . 

 

We  have a 4 digit  Hex  number  whose equivalent binary number is to be found i.e. FFFF H. Initially we compare FFFF H with decimal 10000 ( 2710 H in Hex ). If number is greater than 10,000 we add it to DH register. Also, we subtract decimal 10,000 from FFFF H, each time comparison is made. Then we compare the number obtained in AX by 1000 decimal. Each time we subtract 1000 decimal from AX and add 1000 decimal to BX. Then we compare number obtained in AX by 100 decimals. Each time we subtract 100 decimal from AX and add 100 decimal to BX to obtain BCD equivalent. Then we compare number obtained in AX with 10 decimal. Each time we subtract 10 decimal from AX and we add 10 decimal to BX. Finally we add the result in BX with remainder in AX. The final result is present in register DH with contains the 5th bit if present and register AX.

Algorithm For Hex to BCD Conversion

Step I              :    Initialize the data segment.
Step II             :    Initialize BX = 0000 H and DH = 00H.
Step III           :    Load the number in AX.
Step IV           :    Compare number with 10000 decimal. If below goto step VII else goto step V.
Step V             :    Subtract 10,000 decimal from AX and add 1 decimal to DH
Step VI           :    Jump to step IV.
Step VII          :    Compare number in AX with 1000, if below goto step X else goto step VIII.
Step VIII        :    Subtract 1000 decimal from AX and add 1000 decimal to BX.
Step IX           :    Jump to step VII.
Step X             :    Compare the number in AX with 100 decimal if below goto step XIII
Step XI           :    Subtract 100 decimal from AX and add 100 decimal to BX.
Step XII         :    Jump to step X
Step XIII        :    Compare number in AX with 10. If below goto step XVI
Step XIV        :    Subtract 10 decimal from AX and add 10 decimal to BX..
Step XV          :    Jump to step XIII.
Step XVI        :    Add remainder in AX with result in BX.
Step XVII      :    Display the result in DH and BX.
Step XVIII     :    Stop.
Hex to BCD Conversion in Assembly Language Code 1

 Program For Hex to BCD Conversion Code

.model small  
 .stack 100  
 .code  
      mov ax, 0ffffh            ; hex number to find it's bcd  
      mov      bx, 0000  
      mov      dh, 0  
 l9 :     cmp     ax, 10000     ; if ax>10000  
      jb      l2  
      sub      ax, 10000        ; subtract 10000  
      inc      dh               ; add 1 to dh  
      jmp      l9  
 l2 :     cmp      ax, 1000     ; if ax>1000  
      jb      l4  
      sub      ax, 1000  
      add      bx, 1000h        ; add 1000h to result  
      jmp      l2  
 l4 :     cmp      ax, 100      ; if ax>100  
      jb      l6  
      sub      ax, 100  
      add      bx, 100h         ; add 100h to result  
      jmp      l4  
 l6 :     cmp      ax, 10       ; if ax>10  
      jb      l8  
      sub      ax, 10  
      add      bx, 10h          ; add 10h to result  
      jmp      l6  
 l8 :     add      bx, ax       ; add remainder   
                                ; to result  
      mov      ah, 02            
      mov      cx, 0204h        ; Count to display   
                                ; 2 digits  
      go:      rol dh, cl  
      mov      dl, dh  
      and      dl, 0fh  
      add      dl, 30h          ; display 2 msb digits       
      int      21h  
      dec      ch  
      jnz      go  
      mov      ch, 04h          ; Count of digits to be   
                                ; displayed  
      mov      cl, 04h          ; Count to roll by 4 bits  
 l12:     rol      bx, cl       ; roll bl so that msb   
                                ; comes to lsb                  
      mov      dl, bl           ; load dl with data to be   
                                ; displayed  
      and      dl, 0fH          ; get only lsb  
      cmp      dl, 09           ; check if digit is 0-9 or letter A-F      
      jbe      l14  
      add      dl, 07           ; if letter add 37H else only add 30H  
 l14:     add      dl, 30H  
      mov      ah, 02           ; Function 2 under INT 21H      (Display character)  
      int      21H  
      dec      ch               ; Decrement Count  
      jnz      l12  
      mov      ah, 4cH          ;  Terminate Program  
      int      21H  
 end

How to Run this Program

For Running this program you should have installed Tasm on you computer . If you have not installed Tasm  yet please install from Here .

 
 

C:\programs>tasm hex2bcd.asm
Turbo Assembler  Version 3.0  Copyright (c) 1988, 1991 Borland International
Assembling file:   hex2bcd.ASM
Error messages:    None
Warning messages:  None
Passes:            1
Remaining memory:  437k
C:\programs>tlink hex2bcd
Turbo Link  Version 3.0 Copyright (c) 1987, 1990 Borland International
C:\programs>hex2bcd
065535

 

Other Projects to Try:

  1. Add 8 Bit BCD Numbers
  2. Add Two 16 Bit BCD Numbers Code
  3. BCD to decimal Conversion in Assembly Language
  4. BCD to 7 Segment Code Conversion
  5. ASCII-Binary conversion in Assembly Language

Filed Under: Assembly Codes Tagged With: Assembly Codes

BCD to decimal Conversion in Assembly Language

May 4, 2011 by ProjectsGeek 6 Comments

 Mobile payment system project

 

The project entitled Mobile payment system project is an application to assist mobile phone users to access the information of different bills, send and receive queries requested by user from anywhere and in anytime.

With the use of a single touch button the user is provided with the requested information as quickly as possible. Mobile payment system is focused for professionals as well as House wives and people who are busy can save their time to do their work in home.Mobile payment system project has lots of advanced accessibility features to facilitates users with a user-friendly as well as flexible interface.

When ever user chooses to launch Mobile payment system project, he will be asked for credentials and after that he is logged on to a window .Where he is asked to select which option or service he would like to access. Upon choosing we will be presented with a list of the particular service bill details. If the user selects the options provided on the screen given he is instantly provide with the information pertaining to that particular service.Some of the most unique features of Mobile payment system are accessing the data at the server and retrieving the data from the database.

Project Snapshots

Mobile payment system add new offer
Mobile payment system home page
assign mobile number
Mobile payment system admin login
add new vendor
Mobile payment system project login page

Project Download

Project system Abstract Project Abstract
Project system SRS  Project SRS
Project Code Download  Project Code Download

Other Projects to Try:

  1. Hex to BCD Conversion in Assembly Language Code
  2. Mobile payment system project with Source code
  3. ASCII-Binary conversion in Assembly Language
  4. TestPage
  5. BCD to 7 Segment Code Conversion

Filed Under: Assembly Codes Tagged With: Assembly Codes

Program for Simulating AAA Instruction

May 4, 2011 by ProjectsGeek Leave a Comment

Objective 

Write a Program for Simulating AAA Instruction in assembly language.

Simulating AAA Instruction

AAA instruction stands for ASCII Adjust for Addition. It is used whenever we want to add two decimal digits which are Representative in ASCII code, without masking off “3” in upper nibble. In our program AAA instruction is not available in the instruction set of 8086. So we will first accept the two digits in AL and BL registers. Then we will mask the upper nibble i.e. “3” from AL and BL register by ANDing  with 0F H, so that we will get LSB of two numbers. Then the two numbers are added.
Result of addition is in AL. We will check if the result is valid BCD. If addition > 9, then result is invalid BCD and to make it valid we will add 6. If result is valid, display the result.

Algorithm for Simulating AAA Instruction

Step I          :   Initialize the data segment.
Step II        :   Load number 1 in AL.
Step III       :   Load number 2 in BL.
Step IV       :   Mask the number 1 and store result in AL.
Step V         :   Mask number 2 and store result in BL.
Step VI       :   Add = number 1 + number 2.
Step VII     :   Check if addition < 9. If yes go to step IX. else go to step VIII.
Step VIII    :   Add 6 to make the result valid.
Step IX       :   Display the result.
Step X        :   Stop.

 

Program for Simulating AAA Instruction 2

Program for Simulating AAA Instruction

 .model small  
 .data  
 a db 39H  
 b db 32H  
 .code  
      mov      ax, @data           ; Initialize data section  
      mov      ds, ax  
      mov      al, a               ; Load number1 in al  
      mov      bl, b               ; Load number2 in bl  
      and      al, 0fh             ; unmask numbers and result in al  
      and      bl, 0fh             ; unmask numbers and result in al  
      add      al, bl              ; add the numbers in al and bl   
      cmp      al, 09h             ; check if no is valid BCD   
      jb      next  
      add      al, 06h             ; for invalid BCD add 6 to        
                                   ; make it valid  
 next:      mov      ch, 02h       ; Count of digits to be        
                                   ; displayed  
      mov      cl, 04h             ; Count to roll by 4 bits  
      mov      bh, al              ; Result in reg bh  
 l2:     rol      bh, cl           ; roll bl so that msb comes   
                                   ; to lsb   
      mov      dl, bh              ; load dl with data to be        
                                   ; displayed  
      and      dl, 0fH             ; get only lsb  
      cmp      dl, 09              ; check if digit is 0-9 or        
                                   ; letter A-F  
      jbe      l4  
      add      dl, 07              ; if letter add 37H        
                                   ; else only add 30H  
 l4:     add      dl, 30H  
      mov      ah, 02              ; Function 2 under INT        
                                   ; 21H (Display character)  
      int      21H  
      dec      ch                  ; Decrement Count  
      jnz      l2                                
      mov      ah, 4cH             ; Terminate Program  
      int      21H  
 end  
 
How to Run this Program

For Running this program you should have installed Tasm on you computer . If you have not installed Tasm  yet please install from Here .

C:\programs>tasm aaa.asm
Turbo Assembler  Version 3.0  Copyright (c) 1988, 1991 Borland International
Assembling file:   aaa.asm
Error messages:    None
Warning messages:  None
Passes:            1
Remaining memory:  438k
C:\programs>tlink aaa
Turbo Link  Version 3.0 Copyright (c) 1987, 1990 Borland International
Warning: No stack
C:\programs>aaa
11

Other Projects to Try:

  1. Add 8 Bit BCD Numbers
  2. Add Two 16 Bit BCD Numbers Code
  3. Pack the Two Unpacked BCD Numbers Code
  4. Multiply Two 8 Bit BCD Numbers
  5. Assembly Language Codes

Filed Under: Assembly Codes Tagged With: Assembly Codes

Program to Subtract Two 32 Bit Numbers

May 4, 2011 by ProjectsGeek Leave a Comment

Objective

Write a Program to Subtract Two 32 Bit Numbers in Assembly language.

Subtract Two 32 Bit Numbers

Algorithm for Subtract Two 32 Bit Numbers

  • We have 32 bit numbers. Initially we will load the first 32 bit number into the registers AX and BX.
  • AX contains the LSB while BX contains the MSB of the number.
  • Loading is done using the MOV instruction.
  • Now we will load the second 32 bit number into the registers CX and DX. CX contains the LSB and DX contains the MSB of the number.
  • Initially, we will subtract the LSBs i.e. to subtract the contents of CX with contents of AX. The subtraction is done using SUB instruction.
  • The result of LSB subtraction is stored in AX.
  • Now, we will subtract the MSB alongwith borrow if any generated in the LSB subtraction i.e. we are subtracting DX from BX using SBB (subtract with borrow) instruction.
  • The result of MSB subtraction is in register BX.
  • Display the result using display routine.
For example : BX : AX = 12345678 H 12345678 H
DX : CX = 11111111 H – 11111111 H
01234567 H

Algorithm to Subtract Two 32 Bit Numbers

Step I      :   Initialize the data segment.
Step II     :   Load the LSB of first number into AX register.
Step III   :   Load the MSB of first number into BX register.
Step IV    :   Load the LSB of the second number into CX register.
Step V     :    Load the MSB of the second number into DX register.
Step VI    :   Subtract the two LSBs.
Step VII   :   Subtract the two MSBs along with borrow.
Step VIII  :  Display the result.
Step IX     :  Stop.
Program to Subtract Two 32 Bit Numbers 3

Program  to Subtract Two 32 Bit Numbers 

.model small  
 .data  
 op1 dd 12345678h                                                         
 op2 dd 11111111h  
 ans dd ?  
 .code  
      mov      ax, @data  
      mov      ds, ax  
      mov      ax, word ptr op1          ; lsb of number1 in ax  
      mov      bx, word ptr op1+2        ; msb of number1 in bx   
      mov      cx, word ptr op2          ; lsb of number2 in cx  
      mov      dx, word ptr op2+2        ; msb of number1 in dx  
      sub      ax, cx                    ; subtract lsb + lsb  
      mov      word ptr ans, ax          ; lsb answer  
      mov      word ptr ans+2, bx        ; msb answer  
      mov      bx, word ptr ans+2        ; Result in reg bx  
      mov      dh, 2  
 l1:     mov      ch, 04h                ; Count of digits to be displayed  
      mov      cl, 04h                   ; Count to roll by 4 bits  
 l2:     rol      bx, cl                 ; roll bl so that msb comes to lsb   
      mov      dl, bl                    ; load dl with data to be displayed  
      and      dl, 0fH                   ; get only lsb  
      cmp      dl, 09                    ; check if digit is 0-9 or letter A-F  
      jbe      l4  
      add      dl, 07                    ; if letter add 37H else only add 30H  
 l4:     add      dl, 30H  
      mov      ah, 02                    ; INT 21H (Display character)  
      int      21H  
      dec      ch                        ; Decrement Count  
      jnz      l2  
      dec      dh  
      cmp      dh, 0  
      mov      bx, word ptr ans          ; display lsb of answer  
      jnz      l1  
      mov      ah, 4ch                   ; Terminate Program  
      int      21h  
 end   

How to Run this Program

For Running this program you should have installed Tasm on you computer . If you have not installed Tasm yet please install from Here .

For more project on assembly language programs or codes.

C:\programs>tasm 32sub.asm
Turbo Assembler  Version 3.0  Copyright (c) 1988, 1991 Borland International
Assembling file:   32sub.asm
Error messages:    None
Warning messages:  None
Passes:            1
Remaining memory:  437k
C:\programs>tlink 32sub
Turbo Link  Version 3.0 Copyright (c) 1987, 1990 Borland International
Warning: No stack
C:\programs>32sub
01234567

Other Projects to Try:

  1. Add 8 Bit BCD Numbers
  2. Program to Subtract Two 16 Bit Numbers
  3. Subtract 8 Bit BCD Numbers
  4. Subtract Two 8 Bit Numbers Code Assembly Language
  5. Program to Add Two 32 Bit Numbers

Filed Under: Assembly Codes Tagged With: Assembly Codes

  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Interim pages omitted …
  • Page 6
  • Go to Next Page »

Primary Sidebar

Tags

.Net Projects Download Android Project Ideas Android Projects Angular 2 Assembly Codes C # Projects C & C++ Projects C++ Projects Class Diagrams Computer Graphics Database Project Data Mining Projects DataScience Projects Datastructure Assignments Download Visual Basic Projects Electronics project Hadoop Projects Installation Guides Internet of Things Project IOS Projects Java Java Interview Questions Java Projects JavaScript JavaScript Projects java tutorial JSON JSP Projects Mechanical Projects Mongodb Networking Projects Node JS Projects OS Problems php Projects Placement Papers Project Ideas Python Projects seminar and presentation Struts

Search this Website


Footer

Download Java Project
Download Visual Basic Projects
Download .Net Projects
Download VB Projects
Download C++ Projects
Download NodeJs Projects
Download School Projects
Download School Projects
Ask Questions - Forum
Latest Projects Ideas
Assembly Codes
Datastructure Assignments
Computer Graphics Lab
Operating system Lab
australia-and-India-flag
  • Home
  • About me
  • Contact Form
  • Submit Your Work
  • Site Map
  • Privacy Policy