Hey guys,
I am trying to write a 6800Emulator code to filter out numbers above say 100 and below -100. Ive read through my textbooks but it only gives an extremely relevant exercise without showing how to do it xD
"Create a 6800 program which takes an audio data array as input, and replaces audio data greater than maximum value with the maximum value and less than the minimum value with the minimum value. The data array should be terminated with 0 (assume that no audio values can be equal to this value)."
Help will by much appreciated.
CC
6800 Emulator Problems/Question :\
Page 1 of 14 Replies - 2009 Views - Last Post: 18 May 2012 - 01:50 AM
Replies To: 6800 Emulator Problems/Question :\
#2
Re: 6800 Emulator Problems/Question :\
Posted 17 May 2012 - 10:35 PM
At first this sounds like asking us to do your home work, but the processor - 6800! That is probably not used much anywhere.
I understand that you first make a byte array ending with zero in the memory using directive ".rmb".
Then you zero all the array elements.
Then you read in the data
Or
you first make a byte array ending with zero in the memory using directive ".byte"
then going through byte by byte until that zero is encountered.
If byte is greater than 100, overwrite byte by 100, if byte is less than -100 overwrite byte by -100.
Use X as the buffer pointer.
I understand that you first make a byte array ending with zero in the memory using directive ".rmb".
Then you zero all the array elements.
Then you read in the data
Or
you first make a byte array ending with zero in the memory using directive ".byte"
then going through byte by byte until that zero is encountered.
If byte is greater than 100, overwrite byte by 100, if byte is less than -100 overwrite byte by -100.
Use X as the buffer pointer.
#3
Re: 6800 Emulator Problems/Question :\
Posted 17 May 2012 - 10:41 PM
Any chance you could start me off, ive kinda left this to the last second
#4
Re: 6800 Emulator Problems/Question :\
Posted 18 May 2012 - 01:15 AM
Something like this (only checks for 100, don't have .org, ...)
bufflen EQU <number of bytes in buffer>
buffer:
.byte $11, $22, $33, ..., $00
ldx #0
loop:
ldaa buffer, x
cmpa 100
bpl over
ldaa #100
staa buffer, x
over:
inx
cpx #bufflen
bls loop
bufflen EQU <number of bytes in buffer>
buffer:
.byte $11, $22, $33, ..., $00
ldx #0
loop:
ldaa buffer, x
cmpa 100
bpl over
ldaa #100
staa buffer, x
over:
inx
cpx #bufflen
bls loop
This post has been edited by turboscrew: 18 May 2012 - 01:17 AM
#5
Re: 6800 Emulator Problems/Question :\
Posted 18 May 2012 - 01:50 AM
Thanks for the help
!
Gonna listen from now on xD
Gonna listen from now on xD
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote



|