HARM 0.1.3 → 0.1.4
raw patch · 5 files changed
+105/−15 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Arm/BinaryNumber.hs +2/−3
- HARM.cabal +27/−12
- README +7/−0
- p1.arm +34/−0
- p2.arm +35/−0
Arm/BinaryNumber.hs view
@@ -86,7 +86,7 @@ -- x * y = to (binop (*) x y) -- abs = absReal -- signum = signumReal--- fromInteger = to . primIntegerToWord+-- -- fromInteger = to . primIntegerToWord -- -- fromInt = intToBinary32 instance Bounded Binary32 where@@ -103,8 +103,7 @@ x `mod` y = to (binop mod x y) x `quotRem` y = to2 (binop quotRem x y) divMod = quotRem- -- even = even . from- -- toInteger = toInteger . from+ toInteger = toInteger . from -- toInt = binary32ToInt instance Ix Binary32 where
HARM.cabal view
@@ -1,15 +1,30 @@-Name: HARM-Version: 0.1.3-Cabal-Version: >= 1.2-License: OtherLicense-License-File: LICENSE.txt-Author: Jeffrey A. Meunier (and Alex Mason)-Homepage: http://www.engr.uconn.edu/~jeffm/Classes/CSE240-Spring-2001/Lectures/index.html-Category: Compilers/Interpreters-Synopsis: A simple ARM emulator in haskell-build-type: Simple-description: A simple ARM virtual machine designed for teaching assembly-Maintainer: Alex Mason (axman6@gmail.com)+Name: HARM+Version: 0.1.4+Cabal-Version: >= 1.2+License: OtherLicense+License-File: LICENSE.txt+Author: Jeffrey A. Meunier (and Alex Mason)+Homepage: http://www.engr.uconn.edu/~jeffm/Classes/CSE240-Spring-2001/Lectures/index.html+Category: Compilers/Interpreters+Synopsis: A simple ARM emulator in haskell+build-type: Simple+description: A simple ARM virtual machine designed for teaching + assembly. See + http://tinyurl.com/639v6u for details on internals and + examples of how to use it. It is advised you look through the + source on the site and try following along to really learn + what's going on. Currently the emulator does not use standard + ARM assembly, but a custom variant. This will hopefully be + changed in the near future.+ .+ Two programs, runarm and dbgarm, are provided which can be + used to run and debug the assembly.+Maintainer: Alex Mason (axman6@gmail.com)+bug-reports: mailto:axman6@gmail.com+stability: experimental+extra-source-files: p1.arm+ p2.arm+ README Executable runarm Main-Is: runarm.hs
+ README view
@@ -0,0 +1,7 @@+HARM is a simple ARM emulator written in haskell, with the intention of teaching students about assembly and how CPU's work. It was written by Jeffrey A. Meunier at the University of Connecticut for the 2000 "CSE240 Intermediate Computer Systems" course.++It is advised that you go to http://www.engr.uconn.edu/~jeffm/Classes/CSE240-Spring-2001/index.html and work through the syllabus if you want to understand how the project got to where it is. I have updated most of it to work in GHC with the changes that have been made since it was originally written.++Included are two programs, p1.arm and p2.arm which demonstrate the syntax used in the machines. To run there, you can use runarm in ~/.cabal/bin, and dbgarm to debug the assembly.++If you have any questions, email me at axman6@gmail.com and I'll see what I can do for you.
+ p1.arm view
@@ -0,0 +1,34 @@+;---------------------------------------------------------------------+;- FILE: p1.arm+;- DESCRIPTION: +;- DATE: 04/04/2001+;- PROJECT: +;- LANGUAGE PLATFORM: HARM (was VARM (Virtual ARM)), for CSE240 Spring 2001+;- OS PLATFORM: RedHat Linux 6.2+;- AUTHOR: Jeffrey A. Meunier+;- EMAIL: jeffm@cse.uconn.edu+;---------------------------------------------------------------------+++ origin 16+ reg r0 = DATA1++TOP: mov r1, #100 ; this is the top of the loop+LOOP: add r1, r1, #4+ cmp r1, #200+ ;add r1, r1, #4+ bne LOOP+ swi #11++DATA1 = 0,1,2+ 3,4,5++DATA2 = 100++MSG1 = "Hello, World!"++++;---------------------------------------------------------------------+;- eof+;---------------------------------------------------------------------
+ p2.arm view
@@ -0,0 +1,35 @@+;---------------------------------------------------------------------+;- FILE: p1.arm+;- DESCRIPTION: +;- DATE: 04/04/2001+;- PROJECT: +;- LANGUAGE PLATFORM: HARM (was VARM (Virtual ARM)), for CSE240 Spring 2001+;- OS PLATFORM: RedHat Linux 6.2+;- AUTHOR: Jeffrey A. Meunier+;- EMAIL: jeffm@cse.uconn.edu+;---------------------------------------------------------------------++ origin 0+ reg r0 = MSG+ reg r10 = BUFFER+ reg r11 = HELLO++ swi #2+ mov r0, r10+ mov r1, #32+ swi #4+ mov r0, r11+ swi #2+ mov r0, r10+ swi #2+ swi #10+ + swi #11++MSG = "Enter your name: "+HELLO = "Hello, "+BUFFER = array 32 0++;---------------------------------------------------------------------+;- eof+;---------------------------------------------------------------------