Assembler programmimg! 68000 processor! STUCK!
#1
Scooby Regular
Thread Starter
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes
on
0 Posts
org $400
move.l #$FFF0,sp set the stack pointer
move.l #12,d0 switch off echo
move.l #0,d1
trap #15
loop move.b #5,d0 read one character into D1
trap #15
move.b #6,d0 echo it to the screen
trap #15
bra loop and repeat
end $400
wrote above program! I need to declare a String "123456abcdef"
Then calculate there code in ASCII now im stuck where i am! Any help thanks Si
move.l #$FFF0,sp set the stack pointer
move.l #12,d0 switch off echo
move.l #0,d1
trap #15
loop move.b #5,d0 read one character into D1
trap #15
move.b #6,d0 echo it to the screen
trap #15
bra loop and repeat
end $400
wrote above program! I need to declare a String "123456abcdef"
Then calculate there code in ASCII now im stuck where i am! Any help thanks Si
#2
Scooby Regular
Join Date: Nov 1999
Location: Stockport
Posts: 474
Likes: 0
Received 0 Likes
on
0 Posts
Long time since I did 68000, but off the top of my head...
to declare a string..
mystring dc.b "abcdef",0
to retrieve the ascii value just read the value out.. its stored as ascii anyway..
ie. to get the ascii value for the third char do this..
lea mystring,a0
moveq #2,d0 ;index
moveq #0,d1
move.b (a0,d0),d1 ;ascii for "c" is not stored in d1
Hope that helps...
to declare a string..
mystring dc.b "abcdef",0
to retrieve the ascii value just read the value out.. its stored as ascii anyway..
ie. to get the ascii value for the third char do this..
lea mystring,a0
moveq #2,d0 ;index
moveq #0,d1
move.b (a0,d0),d1 ;ascii for "c" is not stored in d1
Hope that helps...
#4
Scooby Regular
Thread Starter
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes
on
0 Posts
Define a string of your choice, no longer than twenty characters.
Write a FOR loop to add the ASCII codes of all characters in the string together,
and put the final result in register D5. The loop must also echo the characters
to the screen
#5
Scooby Regular
Join Date: Nov 1999
Location: Stockport
Posts: 474
Likes: 0
Received 0 Likes
on
0 Posts
mystring dc.b "mystring",0
lea mystring,a0 ;ptr to our string
moveq #0,d5 ;initialize result
.loop
moveq #0,d1 ;do this so our ascii code is a word
move.b (a0)+,d1 ;get next character
tst.b d1 ;zero?
beq .exit ;yes.. exit
add.w d1,d5 ;add current ascii value to total
bsr echo ;add your own echo function here, ascii in d1
bra .loop ;loop always
.exit
rts ;result is in d5
there you are... hope I'm on commision.. i'm unemployed you know!!
warning.. this may not work.. its a long time since i've done 68k...
#6
Scooby Regular
Thread Starter
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes
on
0 Posts
I got back to uni monday to find it was in for friday! 4days to learn! which is solid because it doesnt make any sence! cheers anyway!
Si
Si
Trending Topics
#9
Scooby Regular
Thread Starter
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes
on
0 Posts
arghhhhh fooooooooooooool nar that works! it the declaring of the string it done like!
org $400
move.l #$FFF0,sp set the stack pointer
mystring DC.B '0123456789abcdef
LEA mystring,A0 A0->"0123456789abcdef"
moveq #0,d5
loop
moveq #0,d1
move.b (a0)+,d1
tst.b d1
add.w d1,d5
move.b #6,d0
trap #15
end $400
couple hours to go DOH DOH
org $400
move.l #$FFF0,sp set the stack pointer
mystring DC.B '0123456789abcdef
LEA mystring,A0 A0->"0123456789abcdef"
moveq #0,d5
loop
moveq #0,d1
move.b (a0)+,d1
tst.b d1
add.w d1,d5
move.b #6,d0
trap #15
end $400
couple hours to go DOH DOH
#11
Scooby Regular
Thread Starter
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes
on
0 Posts
i know ! now ive changed to
ORG $400
MOVE.L #$FFF0,SP
LEA mystring,A0
LOOP: MOVE.B (A0)+,D1
BEQ NEXT
MOVE.B #6,D0
TRAP #15
BRA LOOP
NEXT: MOVE.B #9,d0
TRAP #15
mystring: DC.B 13,10,'Hello World!',0
END $400
printing to screen now need to count the characters!
ORG $400
MOVE.L #$FFF0,SP
LEA mystring,A0
LOOP: MOVE.B (A0)+,D1
BEQ NEXT
MOVE.B #6,D0
TRAP #15
BRA LOOP
NEXT: MOVE.B #9,d0
TRAP #15
mystring: DC.B 13,10,'Hello World!',0
END $400
printing to screen now need to count the characters!
#17
Anyone used to use the K SEKA DEVPAC assembler ?
Ah, the Copper list! I had a major sprite multiplexor running on that machine!
Still got my Hardware Reference Manual somewhere! What a classic!
Ah, the Copper list! I had a major sprite multiplexor running on that machine!
Still got my Hardware Reference Manual somewhere! What a classic!
#18
Scooby Regular
Join Date: Nov 1999
Location: Stockport
Posts: 474
Likes: 0
Received 0 Likes
on
0 Posts
K Seka... ahhhh.. memories!!! bug ridden piece of crap that it was! graduated onto Devpac from there.. then onto the ultimate.. Snasm.. with remote debugging.. nice!
When I was moving house recently I found the Hardware Reference manual (bible) and the rom kernal one which cost me about £50 when I was a poor teenager...plus all my backup disks and crap like that. I'll have to take a look at them one of these days...
When I was moving house recently I found the Hardware Reference manual (bible) and the rom kernal one which cost me about £50 when I was a poor teenager...plus all my backup disks and crap like that. I'll have to take a look at them one of these days...
Thread
Thread Starter
Forum
Replies
Last Post
gazzawrx
Non Car Related Items For sale
13
17 October 2015 06:51 PM
Pro-Line Motorsport
Car Parts For Sale
2
29 September 2015 07:36 PM