helo,
I am programming on MOTOROLA 68000
The program i have to make will check if the digits d2,d4,d6 of the bytenum stored in memory $400400 are "1". If all the digits (d2,d4,d6) are "1" the program will set "1" the 4 most signifficant bytes of memory point $400401. Else (the digits are'nt "1") it will set "1" the 4 less significant bytes of the memory point $400401.
The exercise aks to run the program 3 times each time for different number
stored in memory $400400 :
a)C2
b)65
c)D4
The way to read the status of the digit is to write " BTST 2,D0 ". This will read the digit d2 in the register D0. if d2 is "1" then the Z flag becomes "0".
if d2 is "0" then the Z flag becomes "1".
I've attached the code i wrote.I think it works for these numbers but the exercise has 2 restrictions
Not use over 5 Assembler Directives (DC.B, ORG, END, DS.B)
Not use over 7 Commands
Any idea, to program with another way?
Can i read the status ("0" or "1") of each digit inside a loop?
Mike
I am programming on MOTOROLA 68000
The program i have to make will check if the digits d2,d4,d6 of the bytenum stored in memory $400400 are "1". If all the digits (d2,d4,d6) are "1" the program will set "1" the 4 most signifficant bytes of memory point $400401. Else (the digits are'nt "1") it will set "1" the 4 less significant bytes of the memory point $400401.
The exercise aks to run the program 3 times each time for different number
stored in memory $400400 :
a)C2
b)65
c)D4
The way to read the status of the digit is to write " BTST 2,D0 ". This will read the digit d2 in the register D0. if d2 is "1" then the Z flag becomes "0".
if d2 is "0" then the Z flag becomes "1".
I've attached the code i wrote.I think it works for these numbers but the exercise has 2 restrictions
Not use over 5 Assembler Directives (DC.B, ORG, END, DS.B)
Not use over 7 Commands
Any idea, to program with another way?
Can i read the status ("0" or "1") of each digit inside a loop?
Mike
Attachments
-
516 bytes Views: 21
Last edited: