Fixed the assembler weirdness.

git-svn-id: http://www.cdkersey.com/harp/harptool@116 0246edb2-e076-4747-b392-db732a341fa2
This commit is contained in:
chad
2013-01-17 09:35:23 +00:00
parent 4428bcd1b7
commit afe15f4ff1
11 changed files with 355 additions and 380 deletions

View File

@@ -32,20 +32,8 @@ loop: ld %r2, %r1, #0;
jmprt %r5;
.perm rw
.word Array1 -1
.word Array1_01 -2
.word Array1_02 -3
.word Array1_03 -4
.word Array1_04 -5
.word Array1_05 -6
.word Array1_06 -7
.word Array1_07 -8
Array1:
.word -1 -2 -3 -4 -5 -6 -7 -8
.word Array2 1
.word Array2_00 2
.word Array2_01 3
.word Array2_02 4
.word Array2_03 5
.word Array2_04 6
.word Array2_05 7
.word Array2_06 8
Array2:
.word 1 2 3 4 5 6 7 8

View File

@@ -1,41 +0,0 @@
.perm x
.entry
boot: ldi %r5 kernEnt;
skep %r5 ;
ldi %r0 #0x1;
ldi %r1 #0x18;
ldi %r2 #0x4;
muli %r2 %r2 #0x8;
subi %r2 %r2 #0x1;
shl %r0 %r0 %r2 ;
tlbadd %r0 %r0 %r1 ;
ei ;
ldi %r5 entry;
jmpru %r5 ;
kernEnt: subi %r0 %r0 #0x8;
rtop @p0 %r0 ;
@p0 ? reti ;
ldi %r8 #0x1;
ldi %r1 #0x4;
muli %r1 %r1 #0x8;
subi %r1 %r1 #0x1;
shl %r8 %r8 %r1 ;
ld %r0 %r8 #0x0;
subi %r1 %r0 #0x71;
rtop @p0 %r1 ;
notp @p0 @p0 ;
@p0 ? halt ;
st %r0 %r8 #0x0;
ldi %r0 #0xa;
st %r0 %r8 #0x0;
reti ;
entry: ldi %r7 hello;
jali %r5 puts;
jmpi entry;
.perm rw
.word hello 0x6c6c6548
.word __anonWord0 0x41202c6f
.word __anonWord1 0x6e616c74
.word __anonWord2 0xa216174
.word __anonWord3 0x0

View File

@@ -47,5 +47,4 @@ puts_l: ld %r6, %r7, #0;
puts_end: jmpr %r5
.perm rwx
.word digstack 0
.word 9
digstack: .space 10

View File

@@ -84,7 +84,4 @@ loop4: ld %r1, %r0, array;
.string xstr "Exiting loop\n"
.global
.word array 0 /* Basically, 0 and 1 are pre-cleared. */
.word _0 0 /* Given a name, contents are zero. */
_arr:
.word 0xffe /* Empty space of size SIZE-2 words. */
array: .space 0x1000 /* SIZE words of space. */

22
src/test/simple.s Normal file
View File

@@ -0,0 +1,22 @@
/*******************************************************************************
HARPtools by Chad D. Kersey, Summer 2011
********************************************************************************
Sample HARP assmebly program.
*******************************************************************************/
/* Simple example. */
.align 4096
.perm x
.entry
.global
entry: ldi %r7, hello
jali %r5, puts
ldi %r0, #2; /* i = 2 */
trap; /* All traps currently cause a halt. */
.perm rw /* TODO: How should I write section permissions? */
/* TODO: String literals! */
.string hello "\"Harp!\" is how a harp seal says hello!\n"