Microcontroller 8-Bit Substraction

ALGORITHM:

  • Initialize the pointer to the memory for data and result.
  • The SUBB instruction writes the result in the accumulator.
  • Store the result into Memory from A registers.

INPUT:

  • MOV A,# 20
  • SUBB A,#10  

OUTPUT:

  • 8600     10H  

 PROGRAM:

ADDRESSOPCODESMNEMONICSCOMMENDS
850074 20MOV A,#20Give 8 bit first data in A register
850294 10SUBB A,#10Give  8 bit second  data in acc move
8504 90 86 00 MOV DPTR,#8600Store  in 8600 memory location
8507  F0MOVX @DPTR,AStore the value acc move
850880 FEHERE:       SJMP HEREEnd

You may also like...

error: Content is protected !!