/[movitz]/ia-x86/ia-x86-test.lisp
ViewVC logotype

Contents of /ia-x86/ia-x86-test.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Fri Jan 16 11:54:14 2004 UTC (10 years, 3 months ago) by ffjeld
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
Removed non-ASCII characters.
1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2 ;;
3 ;; Copyright (C) 2003, Frode Vatvedt Fjeld <frodef@acm.org>
4 ;;
5 ;; Filename: ia-x86-test.lisp
6 ;; Description: Regression tests for the assembler
7 ;; Author: Nikodemus Siivola
8 ;; Created at: Wed Oct 20 23:13:46 1999
9 ;;
10 ;; $Id: ia-x86-test.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
11 ;;
12 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13
14 (defpackage :ia-x86-test
15 (:use :cl :ia-x86 :rt))
16
17 (in-package :ia-x86-test)
18
19 (deftest asm.1
20 (asm :movl :eax :ebx)
21 #C(#x89C3 #x2))
22
23 (defvar *proglist-1* '((:movl 10 :eax) loop
24 (:decl :eax)
25 (:je 'exit)
26 (:jmp 'loop) exit))
27
28 (deftest read-proglist.1
29 ;; KLUDGE: it's just simpler to compare the printed version here...
30 (equal (with-output-to-string (s)
31 (prin1 (read-proglist *proglist-1*) s))
32 "(#<asm MOVL #xA => %EAX> LOOP #<asm DECL %EAX> #<asm JE 'EXIT> #<asm JMP 'LOOP>
33 EXIT)")
34 t)
35
36 (deftest proglist-encode.1
37 (multiple-value-bind (a b)
38 (proglist-encode :octet-list :32-bit 0 (read-proglist *proglist-1*))
39 (and (equal a '(#xB8 #xA #x0 #x0 #x0 #x48 #x74 #x2 #xEB #xFB))
40 (equal b '((EXIT . #xA) (LOOP . #x5)))))
41 t)

  ViewVC Help
Powered by ViewVC 1.1.5