4 Replies - 2170 Views - Last Post: 18 May 2012 - 01:50 AM

#1 ClassicClown98  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-May 12

6800 Emulator Problems/Question :\

Posted 17 May 2012 - 09:24 PM

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

Is This A Good Question/Topic? 0
  • +

Replies To: 6800 Emulator Problems/Question :\

#2 turboscrew  Icon User is offline

  • D.I.C Addict

Reputation: 100
  • View blog
  • Posts: 615
  • Joined: 03-April 12

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.
Was This Post Helpful? 0
  • +
  • -

#3 ClassicClown98  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-May 12

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 -.-
Was This Post Helpful? 0
  • +
  • -

#4 turboscrew  Icon User is offline

  • D.I.C Addict

Reputation: 100
  • View blog
  • Posts: 615
  • Joined: 03-April 12

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

This post has been edited by turboscrew: 18 May 2012 - 01:17 AM

Was This Post Helpful? 0
  • +
  • -

#5 ClassicClown98  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-May 12

Re: 6800 Emulator Problems/Question :\

Posted 18 May 2012 - 01:50 AM

Thanks for the help :)!

Gonna listen from now on xD
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1