OpenCores
URL https://opencores.org/ocsvn/cpu8080/cpu8080/trunk

Subversion Repositories cpu8080

[/] [cpu8080/] [tags/] [update/] [project/] [test.asm] - Diff between revs 9 and 11

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 9 Rev 11
Line 21... Line 21...
!
!
selenb:  equ    $01             ! enable select
selenb:  equ    $01             ! enable select
selio:   equ    $02                     ! I/O address or memory
selio:   equ    $02                     ! I/O address or memory
 
 
!
!
! Note: select 1 is ROM, 2, is RAM, 3 is interrupt controller
! Note: select 1 is ROM, 2, is RAM, 3 is interrupt controller, 4 is serial I/O.
!
!
 
 
!
!
! Where to place ROM and RAM for this test
! Where to place ROM and RAM for this test
!
!
Line 39... Line 39...
intsts: equ             intbas+$01          ! status
intsts: equ             intbas+$01          ! status
intact: equ             intbas+$02      ! active interrupt
intact: equ             intbas+$02      ! active interrupt
intpol: equ             intbas+$03              ! polarity select
intpol: equ             intbas+$03              ! polarity select
intedg: equ             intbas+$04              ! edge/level select
intedg: equ             intbas+$04              ! edge/level select
intvec: equ             intbas+$05              ! vector base page
intvec: equ             intbas+$05              ! vector base page
 
!
 
! Mits Serial I/O card
 
!
 
siobas: equ     $20
 
sioctl: equ     siobas+$00      ! control register
 
siodat: equ     siobas+$01      ! status
 
 
!
!
! Set up selectors
! Set up selectors
!
!
 
 
Line 66... Line 72...
        mvi     a,$00                   ! exit bootstrap mode
        mvi     a,$00                   ! exit bootstrap mode
        out     selmain
        out     selmain
!
!
                lxi             sp,rambas+1024  ! set stack to top of ram
                lxi             sp,rambas+1024  ! set stack to top of ram
!
!
! Interrupt controller
! Serial I/O
 
!
 
        mvi     a,siobas        ! enable interrupt controller for 4 addresses
 
        out     sel4cmp
 
        mvi     a,$fc or selio or selenb
 
        out     sel4msk
 
!
 
! Print "hello, world" and stop
 
!
 
        lxi     h,helstr        ! index string
 
loop:
 
        mov     a,m             ! get character
 
        inx     h               ! next character
 
        ora     a               ! check end of string
 
        jz      endstr          ! yes, skip
 
        call    wrtout          ! output character
 
        jmp     loop            ! loop next character
 
endstr:
!
!
                mvi             a,intbas                ! enable interrupt controller for 8 addresses
! halt
                out             sel3cmp
 
                mvi             a,$f8 or selio or selenb
 
                out             sel3msk
 
!
!
! Set up interrupt controller for test
        hlt
 
 
 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
!
                mvi             a,$0100 shr 8   ! vector to page 1
! Serial output routine
                out             intvec
 
                mvi             a,$01                   ! enable interrupt 0
 
                out             intact
 
!
!
! Interrupt here
! Outputs the character in a.
!
!
                nop
wrtout:
                nop
        push    psw             ! save character to output
                hlt                                             ! and stop
wrtout01:
 
        in      sioctl          ! get output ready status /n
 
        ani     $80             ! mask
 
        jnz     wrtout01        ! no, loop
 
        pop     psw             ! restore character
 
        out     siodat          ! output
 
        ret                     ! return to caller
!
!
! Locate to page 1
! String to print
!
!
                alignp  256
helstr:
                ret                                             ! return from interrupt
        defb    'HELLO, FPGA WORLD\cr\lf', 0
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.