First/test.asm

80 lines
1.1 KiB
NASM
Raw Permalink Normal View History

MOV $0xFF0000,%SP
#Test verious instructions
MOV $0x0001,%R0l
MOV $0x0000,%R0h
MOV $0xBEEF,%R1l
MOV $0x0000,%R1h
CALL $SUBROUTINE
CALL $SUBROUTINE
CALL $SUBROUTINE
CALL $SUBROUTINE2
JMP $END
:SUBROUTINE
PUSH %R1
ADD %R0,%R1
POP %R1
RET
:SUBROUTINE2
ADD %R0,%R1
RET
:END
#Test text terminal
MOV $0xFFFC,%R0l
MOV $0x00FF,%R0h
MOV $0x0068,%R1l
MOV $0x0000,%R1h
MOV %R1,(%R0)
MOV $0x0065,%R1l
MOV %R1,(%R0)
MOV $0x006c,%R1l
MOV %R1,(%R0)
MOV $0x006c,%R1l
MOV %R1,(%R0)
MOV $0x006f,%R1l
MOV %R1,(%R0)
# Test Vector Display
MOV $0xFFFF,%R1l
MOV $0xFFFF,%R1h
MOV %R1,(%R0)
MOV $0x0000,%R1l
MOV $0x0000,%R1h
MOV %R1,(%R0)
MOV $0x0000,%R1l
MOV $0xbf80,%R1h
MOV %R1,(%R0)
MOV $0x0000,%R1l
MOV $0xbf80,%R1h
MOV %R1,(%R0)
MOV $0x0000,%R1l
MOV $0x0000,%R1h
MOV %R1,(%R0)
MOV $0x0000,%R1l
MOV $0x3f80,%R1h
MOV %R1,(%R0)
#Test Indirect read/writes
MOV $>TR_LOW,%R0l
MOV $<TR_LOW,%R0h
MOV %R1,(%R0)
MOV (%R0),%R5
#Test mul/div
#R1=pi
MOV $0x0fdb,%R1l
MOV $0x4049,%R1h
#R0=1.3
MOV $0x6666,%R0l
MOV $0x3fa6,%R0h
#R2=2
MOV $0x0000,%R2l
MOV $0x4000,%R2h
FMUL %R0,%R1
FDIV %R2,%R1
HALT
:TR_LOW
DDW $0xDEADBEEF