URL
https://opencores.org/ocsvn/zipcpu/zipcpu/trunk
Subversion Repositories zipcpu
Compare Revisions
- This comparison shows the changes necessary to convert path
/zipcpu/trunk/sw/zasm
- from Rev 17 to Rev 19
- ↔ Reverse comparison
Rev 17 → Rev 19
/test.S
11,6 → 11,20
; Status: As of August, 2015, this file assembles, builds, and passes |
; all of its tests in the Verilator simulator. |
; |
; Okay, as of 15 August, there are now some tests that don't pass. |
; In particular, the #include test used to pass but didn't pass today. |
; Likewise the PUSH() macro test hasn't passed yet. Finally, be aware |
; that this implementation is specific to where it loads on a board. |
; I tried loading it on my Basys development board, where I had placed |
; RAM in a different location and ... things didn't work out so well. |
; So grep the __here__ line and adjust it for where you intend to load |
; this file. |
; |
; In general, as I'm building the CPU, I'm modifying this file to place |
; more and more capability tests within the file. If the Lord is |
; willing, this will become the proof that the CPU completely works. |
; |
; |
; Creator: Dan Gisselquist, Ph.D. |
; Gisselquist Tecnology, LLC |
; |
34,7 → 48,7
; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
; |
#include "sys.i" |
// #include "sys.i" |
sys.bus equ 0xc0000000 |
sys.breaken equ 0x080 |
sys.step equ 0x040 |
108,6 → 122,7
mov R0,uCC |
; Don't clear the user PC register |
; Now, let's try loading some constants into registers |
; Specifically, we're testing the LDI, LDIHI, and LDILO instructions |
dead_beef equ 0xdeadbeef |
ldi 0x0dead,r5 |
ldi 0x0beef,r6 |
372,6 → 387,19
cmp $5,r2 |
trap.ne r11 |
|
// Let's test whether LSL works |
ldi $0x0b00,r11 |
ldi 0x035,r2 |
lsl 8,r2 |
ldi 0x03500,r1 |
cmp r2,r1 |
trap.ne r11 |
ldi 0x074,r0 |
and 0x0ff,r0 |
or r0,r2 |
cmp 0x03574,r2 |
trap.ne r11 |
|
// Return success / Test the trap interrupt |
clr r11 |
trap r11 |
384,6 → 412,7
halt |
|
// Now, let's test whether or not we can handle a subroutine |
#ifdef PUSH_TEST |
reverse_bit_order: |
PUSH(R1,SP) |
PUSH(R2,SP) |
398,6 → 427,7
POP(R2,SP) |
POP(R1,SP) |
RET |
#endif |
fill 512,0 |
stack: |
word 0 |