Some more test code... it runs now as .PRG!

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23340 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2008-01-10 14:49:13 +00:00
parent 85e661dbf0
commit cd6103fab1

View File

@ -40,6 +40,9 @@
* http://mail-index.netbsd.org/tech-userlevel/2007/04/02/0000.html * http://mail-index.netbsd.org/tech-userlevel/2007/04/02/0000.html
* http://pagesperso-orange.fr/patrice.mandin/en/howto-binutils.html * http://pagesperso-orange.fr/patrice.mandin/en/howto-binutils.html
* http://www.wotsit.org/download.asp?f=atariexe&sc=252874182 * http://www.wotsit.org/download.asp?f=atariexe&sc=252874182
*
* generated.m68k/cross-tools/bin/m68k-unknown-haiku-gcc -nostdlib -fpic -Wa,--pcrel -c -o stage1.o src/system/boot/platform/atari_m68k/stage1.S
* generated.m68k/cross-tools/bin/m68k-unknown-haiku-ld -o stage1.prg stage1.o -T src/system/boot/platform/atari_m68k/prg.ld
* *
*/ */
@ -70,7 +73,24 @@
#define S_IFDIR 00000040000o #define S_IFDIR 00000040000o
//Pterm0
//move.w #1,%d0
//trap #1
//rts
lea.l str,%a0
.loopt:
move.b (%a0)+,%d0
beq .strout
bsr putc
bra .loopt
.strout:
//Pterm0
move.w #1,%d0
trap #1
rts
.loop: .loop:
move #'.',%d0 move #'.',%d0
bsr putc bsr putc
@ -79,10 +99,14 @@
/* prints the char in d0.b to the console */ /* prints the char in d0.b to the console */
putc: putc:
movem.l %a0,-(%sp)
move.w %d0,-(%sp) move.w %d0,-(%sp)
move.w #DEV_CON,-(%sp) // DEV_CON move.w #DEV_CON,-(%sp) // DEV_CON
move.w #3,-(%sp) // Bconout move.w #3,-(%sp) // Bconout
trap #13 trap #13
add.l #6,%sp add.l #6,%sp
movem.l (%sp)+,%a0
rts rts
str:
.ascii "Haiku!"
.byte 0