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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [bench/] [asm/] [helloworld.S] - Diff between revs 69 and 150

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

Rev 69 Rev 150
Line 44... Line 44...
;       R10  value to clear/reset the PIC
;       R10  value to clear/reset the PIC
;       uR12 = memory
;       uR12 = memory
;       uR11 = rawsseg
;       uR11 = rawsseg
;       uR9  = state
;       uR9  = state
;       R8   = new value for SSEG
;       R8   = new value for SSEG
 
        .file "helloworld.S"
 
        .text
 
        .globl  entry
 
        .org 0x2000
 
        .type   entry, @function
 
entry:
build_supervisor_state:
build_supervisor_state:
        CLR     R12             ; Load a pointer to our peripherals
        .set peripheral_base, 0xc0000000<<2
        LDIHI   $c000h,R12
        LDI     build_supervisor_state,R0
        LDI     $5f5e1h,R11     ; An amount to reset the timer to: 1/4 sec
        LDI     peripheral_base,R12
 
        LDI     0xc0000000,R12  ; Load a pointer to our peripherals
 
        LDI     $0x5f5e1,R11    ; An amount to reset the timer to: 1/4 sec
        LSL     $6,R11
        LSL     $6,R11
        LDIHI   $8010h,R10      ; A value to clear/reset the PIC for timerA ints
        LDI     0x8010ffff,R0   ; A value to clear/reset the PIC for timerA inst
        LDILO   $ffffh,R10
        MOV     user_data(PC),uR12      ; User memory (so this isn't supervisor state..)
        MOV     $1+PC,uR12      ; User memory (so this isn't supervisor state..)
        ; BRA   $4
        BRA     $4
        BRA     build_user_state
        .DAT    $0x6e9e1c1c     ; Raw SSEG for 'HELL'
user_data:
        .DAT    $0xfc007c70     ; Raw SSEG for 'O UJ'
        .INT    0x6e9e1c1c      ; Raw SSEG for 'HELL'
        .DAT    $0x3a0a607b     ; Raw SSEG for 'orld.'
        .INT    0xfc007c70      ; Raw SSEG for 'O UJ'
        .DAT    $0x00000000     ; Raw SSEG for '    '
        .INT    0x3a0a607b      ; Raw SSEG for 'orld.'
 
        .INT    0x00000000      ; Raw SSEG for '    '
 
        .text
build_user_state:
build_user_state:
        LDI     $15h,R0
        LDI     $0x15,R0
        MOV     R0,uR11
        MOV     R0,uR11
        MOV     $6+PC,uPC
        MOV     user_task(PC),uPC
        CLR     R0
        CLR     R0
        MOV     R0,uR9
        MOV     R0,uR9
repeat:
repeat:
        STO     R11,$4(R12)     ; Reset the timer
        STO     R11,$4(R12)     ; Reset the timer
        STO     R10,(R12)       ; Reset the PIC
        STO     R10,(R12)       ; Reset the PIC
        RTU
        RTU
        BRA     $-4
        ; BRA   $-4
 
        BRA     repeat
user_task:
user_task:
        MOV     R9,R0
        MOV     R9,R0
        LSR     $2,R0
        LSR     $2,R0
        ADD     R12,R0
        ADD     R12,R0
        LOD     (R0),R8         ; Read the left word
        LOD     (R0),R8         ; Read the left word
Line 93... Line 104...
 
 
        ADD     $1,R9           ; Increment our state
        ADD     $1,R9           ; Increment our state
        AND     $15,R9
        AND     $15,R9
 
 
        WAIT                    ; Wait for the next interrupt
        WAIT                    ; Wait for the next interrupt
        BRA     $-21            ; Back up to the top to start over
        ; BRA   $-21            ; Back up to the top to start over
 
        BRA     user_task
 
 
        BREAK
        BREAK
        BREAK
        BREAK
        BREAK
        BREAK
 
 
 
 
 
 

powered by: WebSVN 2.1.0

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