I am taking Digital Design using Microprocessors and I need help with writing a
ID: 2080498 • Letter: I
Question
I am taking Digital Design using Microprocessors and I need help with writing a program.
The program is: "If X can be any number, write a program to detect if the number X is divisible by 3".
We use assembly language to code these programs. We just learned how to use unconditional and conditional Jumps instructions, so we have to use those to do this program.
For almost all the other exercise we have been assigned, we have gotten more information about what to code. This one is just that line of instruction on what to do, so I am confused on how to start doing it. Any help would be appreciated.
Explanation / Answer
DATA SEGMENT A DB 09 B DB 03 DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX MOV AX,00 MOV AL,A MOV BL,B DIV BL CMP AH,00 JZ LOOP1 MOV CL,A MOV CH,00 JMP LOOP2 LOOP1:MOV CH,A MOV CL,00 LOOP2:MOV AH,4CH INT 21H CODE END END START
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.