1. Program for addition of two immediate numbers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;<Addition of two 8-bit immediate numbers> | |
jmp start | |
;code | |
start: mvi a, 05H | |
mvi b, 04H | |
add b | |
hlt |
Screen shot after executing the program. See the accumulator content.
2. Program for subtraction of two immediate numbers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;<8085 program for subtraction of two 8-bit | |
; immediate numbers> | |
jmp start | |
;code | |
start: mvi a, 05H | |
mvi b, 04H | |
sub b | |
hlt |
Screen shot after executing the program. See the accumulator content.
Screen shot after executing the program. See the accumulator content. The result is in 2's compliment form.
3. Program for addition of two numbers stored at memory locations 6001H and 6002H and storing the result at 6003H.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;<Additon of two 8-bit numbers stored | |
;at memory location 6001H and 6002H. | |
;The result will be stored at 6003H > | |
jmp start | |
;code | |
start: lda 6001H | |
mov b,a | |
lda 6002H | |
add b | |
sta 6003H | |
hlt |
4. Program for subtraction of two numbers stored at memory locations 6001H and 6002H and storing the result at 6003H.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;<Subtraction of two 8-bit numbers stored | |
;at memory location 6001H and 6002H. | |
;The result will be stored at 6003H > | |
jmp start | |
;code | |
start: lda 6001H | |
mov b,a | |
lda 6002H | |
sub b | |
sta 6003H | |
hlt |
Screen shot after executing the program. see the content of memory locations 6001H, 6002H and 6003H. Content of 6002H is smaller than content of 6001H so the result is in 2's compliment form.
No comments:
Post a Comment