[racket] Simulating bytes

From: Tomás Coiro (tomcoiro at hotmail.com)
Date: Sat Sep 14 14:14:36 EDT 2013

I started to think about programming a Chip16 emulator (https://github.com/tykel/chip16).
Mainly to practice having a somewhat big project in Racket and hopefully learning something about how basic hardware behaves.

Before even starting to program I couldn't decide how i would simulate signed bytes.
Now, I realize these options are possible to program, and maybe not even hard, but I'd like some advice.

Should I use integers? bitwise-and and such allow for some easy use there, but then I'd need some special functions to sum, multiply, subtract, etc.

Byte-strings are another option, but they don't support either and, or, addition, or subtraction, so I would have to make functions for all of those.

And then I though of vectors of 1's and 0's, which would also carry a load of functions to define.

Is there any way I can simulate signed bytes behavior without implementing a lot of functions? Is there an alternative that i haven't though of?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130914/ef333aa3/attachment.html>

Posted on the users mailing list.